@salt-ds/core 1.55.0 → 1.57.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.
Files changed (81) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/css/salt-core.css +184 -1
  3. package/dist-cjs/drawer/Drawer.css.js +1 -1
  4. package/dist-cjs/drawer/Drawer.js.map +1 -1
  5. package/dist-cjs/index.js +17 -0
  6. package/dist-cjs/index.js.map +1 -1
  7. package/dist-cjs/salt-provider/ThemeApplicator.js.map +1 -1
  8. package/dist-cjs/semantic-icon-provider/SemanticIconProvider.js +3 -0
  9. package/dist-cjs/semantic-icon-provider/SemanticIconProvider.js.map +1 -1
  10. package/dist-cjs/spinner/svgSpinners/SpinnerSVG.js +6 -3
  11. package/dist-cjs/spinner/svgSpinners/SpinnerSVG.js.map +1 -1
  12. package/dist-cjs/table/TBody.js +32 -0
  13. package/dist-cjs/table/TBody.js.map +1 -0
  14. package/dist-cjs/table/TD.js +34 -0
  15. package/dist-cjs/table/TD.js.map +1 -0
  16. package/dist-cjs/table/TFoot.js +45 -0
  17. package/dist-cjs/table/TFoot.js.map +1 -0
  18. package/dist-cjs/table/TH.js +34 -0
  19. package/dist-cjs/table/TH.js.map +1 -0
  20. package/dist-cjs/table/THead.js +45 -0
  21. package/dist-cjs/table/THead.js.map +1 -0
  22. package/dist-cjs/table/TR.js +30 -0
  23. package/dist-cjs/table/TR.js.map +1 -0
  24. package/dist-cjs/table/Table.css.js +6 -0
  25. package/dist-cjs/table/Table.css.js.map +1 -0
  26. package/dist-cjs/table/Table.js +71 -0
  27. package/dist-cjs/table/Table.js.map +1 -0
  28. package/dist-cjs/table/TableContainer.js +85 -0
  29. package/dist-cjs/table/TableContainer.js.map +1 -0
  30. package/dist-cjs/table/TableContext.js +26 -0
  31. package/dist-cjs/table/TableContext.js.map +1 -0
  32. package/dist-cjs/theme/Density.js +7 -1
  33. package/dist-cjs/theme/Density.js.map +1 -1
  34. package/dist-es/drawer/Drawer.css.js +1 -1
  35. package/dist-es/drawer/Drawer.js.map +1 -1
  36. package/dist-es/index.js +8 -0
  37. package/dist-es/index.js.map +1 -1
  38. package/dist-es/salt-provider/ThemeApplicator.js.map +1 -1
  39. package/dist-es/semantic-icon-provider/SemanticIconProvider.js +4 -1
  40. package/dist-es/semantic-icon-provider/SemanticIconProvider.js.map +1 -1
  41. package/dist-es/spinner/svgSpinners/SpinnerSVG.js +6 -3
  42. package/dist-es/spinner/svgSpinners/SpinnerSVG.js.map +1 -1
  43. package/dist-es/table/TBody.js +30 -0
  44. package/dist-es/table/TBody.js.map +1 -0
  45. package/dist-es/table/TD.js +32 -0
  46. package/dist-es/table/TD.js.map +1 -0
  47. package/dist-es/table/TFoot.js +43 -0
  48. package/dist-es/table/TFoot.js.map +1 -0
  49. package/dist-es/table/TH.js +32 -0
  50. package/dist-es/table/TH.js.map +1 -0
  51. package/dist-es/table/THead.js +43 -0
  52. package/dist-es/table/THead.js.map +1 -0
  53. package/dist-es/table/TR.js +28 -0
  54. package/dist-es/table/TR.js.map +1 -0
  55. package/dist-es/table/Table.css.js +4 -0
  56. package/dist-es/table/Table.css.js.map +1 -0
  57. package/dist-es/table/Table.js +68 -0
  58. package/dist-es/table/Table.js.map +1 -0
  59. package/dist-es/table/TableContainer.js +83 -0
  60. package/dist-es/table/TableContainer.js.map +1 -0
  61. package/dist-es/table/TableContext.js +23 -0
  62. package/dist-es/table/TableContext.js.map +1 -0
  63. package/dist-es/theme/Density.js +7 -1
  64. package/dist-es/theme/Density.js.map +1 -1
  65. package/dist-types/drawer/Drawer.d.ts +1 -1
  66. package/dist-types/index.d.ts +1 -0
  67. package/dist-types/salt-provider/SaltProvider.d.ts +1 -1
  68. package/dist-types/salt-provider/ThemeApplicator.d.ts +1 -1
  69. package/dist-types/semantic-icon-provider/SemanticIconProvider.d.ts +3 -0
  70. package/dist-types/table/TBody.d.ts +4 -0
  71. package/dist-types/table/TD.d.ts +10 -0
  72. package/dist-types/table/TFoot.d.ts +20 -0
  73. package/dist-types/table/TH.d.ts +10 -0
  74. package/dist-types/table/THead.d.ts +20 -0
  75. package/dist-types/table/TR.d.ts +4 -0
  76. package/dist-types/table/Table.d.ts +20 -0
  77. package/dist-types/table/TableContainer.d.ts +4 -0
  78. package/dist-types/table/TableContext.d.ts +8 -0
  79. package/dist-types/table/index.d.ts +8 -0
  80. package/dist-types/theme/Density.d.ts +1 -1
  81. package/package.json +1 -1
@@ -0,0 +1,30 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { useComponentCssInjection } from '@salt-ds/styles';
3
+ import { useWindow } from '@salt-ds/window';
4
+ import { clsx } from 'clsx';
5
+ import { forwardRef } from 'react';
6
+ import { withTableBaseName } from './Table.js';
7
+ import css_248z from './Table.css.js';
8
+
9
+ const TBody = forwardRef(
10
+ function TBody2({ children, className, ...rest }, ref) {
11
+ const targetWindow = useWindow();
12
+ useComponentCssInjection({
13
+ testId: "salt-table-tbody",
14
+ css: css_248z,
15
+ window: targetWindow
16
+ });
17
+ return /* @__PURE__ */ jsx(
18
+ "tbody",
19
+ {
20
+ ref,
21
+ className: clsx(withTableBaseName("tbody"), className),
22
+ ...rest,
23
+ children
24
+ }
25
+ );
26
+ }
27
+ );
28
+
29
+ export { TBody };
30
+ //# sourceMappingURL=TBody.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TBody.js","sources":["../src/table/TBody.tsx"],"sourcesContent":["import { useComponentCssInjection } from \"@salt-ds/styles\";\nimport { useWindow } from \"@salt-ds/window\";\nimport { clsx } from \"clsx\";\nimport { type ComponentPropsWithoutRef, forwardRef } from \"react\";\nimport { withTableBaseName } from \"./Table\";\n\nimport tableCss from \"./Table.css\";\n\nexport interface TBodyProps extends ComponentPropsWithoutRef<\"tbody\"> {}\n\nexport const TBody = forwardRef<HTMLTableSectionElement, TBodyProps>(\n function TBody({ children, className, ...rest }, ref) {\n const targetWindow = useWindow();\n useComponentCssInjection({\n testId: \"salt-table-tbody\",\n css: tableCss,\n window: targetWindow,\n });\n\n return (\n <tbody\n ref={ref}\n className={clsx(withTableBaseName(\"tbody\"), className)}\n {...rest}\n >\n {children}\n </tbody>\n );\n },\n);\n"],"names":["TBody","tableCss"],"mappings":";;;;;;;;AAUO,MAAM,KAAA,GAAQ,UAAA;AAAA,EACnB,SAASA,OAAM,EAAE,QAAA,EAAU,WAAW,GAAG,IAAA,IAAQ,GAAA,EAAK;AACpD,IAAA,MAAM,eAAe,SAAA,EAAU;AAC/B,IAAA,wBAAA,CAAyB;AAAA,MACvB,MAAA,EAAQ,kBAAA;AAAA,MACR,GAAA,EAAKC,QAAA;AAAA,MACL,MAAA,EAAQ;AAAA,KACT,CAAA;AAED,IAAA,uBACE,GAAA;AAAA,MAAC,OAAA;AAAA,MAAA;AAAA,QACC,GAAA;AAAA,QACA,SAAA,EAAW,IAAA,CAAK,iBAAA,CAAkB,OAAO,GAAG,SAAS,CAAA;AAAA,QACpD,GAAG,IAAA;AAAA,QAEH;AAAA;AAAA,KACH;AAAA,EAEJ;AACF;;;;"}
@@ -0,0 +1,32 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { useComponentCssInjection } from '@salt-ds/styles';
3
+ import { useWindow } from '@salt-ds/window';
4
+ import clsx from 'clsx';
5
+ import { forwardRef } from 'react';
6
+ import { withTableBaseName } from './Table.js';
7
+ import css_248z from './Table.css.js';
8
+
9
+ const TD = forwardRef(function TD2({ children, className, textAlign = "left", ...rest }, ref) {
10
+ const targetWindow = useWindow();
11
+ useComponentCssInjection({
12
+ testId: "salt-table-td",
13
+ css: css_248z,
14
+ window: targetWindow
15
+ });
16
+ return /* @__PURE__ */ jsx(
17
+ "td",
18
+ {
19
+ ref,
20
+ className: clsx(
21
+ withTableBaseName("td"),
22
+ withTableBaseName("td", "align", textAlign),
23
+ className
24
+ ),
25
+ ...rest,
26
+ children
27
+ }
28
+ );
29
+ });
30
+
31
+ export { TD };
32
+ //# sourceMappingURL=TD.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TD.js","sources":["../src/table/TD.tsx"],"sourcesContent":["import { useComponentCssInjection } from \"@salt-ds/styles\";\nimport { useWindow } from \"@salt-ds/window\";\nimport clsx from \"clsx\";\nimport { type ComponentPropsWithoutRef, forwardRef } from \"react\";\nimport { withTableBaseName } from \"./Table\";\n\nimport tableCss from \"./Table.css\";\n\nexport interface TDProps extends ComponentPropsWithoutRef<\"td\"> {\n /**\n * Specifies the alignment of the text within the `TD`.\n *\n * @default \"left\"\n */\n textAlign?: \"left\" | \"right\";\n}\n\nexport const TD = forwardRef<HTMLTableCellElement, TDProps>(function TD(\n { children, className, textAlign = \"left\", ...rest },\n ref,\n) {\n const targetWindow = useWindow();\n useComponentCssInjection({\n testId: \"salt-table-td\",\n css: tableCss,\n window: targetWindow,\n });\n\n return (\n <td\n ref={ref}\n className={clsx(\n withTableBaseName(\"td\"),\n withTableBaseName(\"td\", \"align\", textAlign),\n className,\n )}\n {...rest}\n >\n {children}\n </td>\n );\n});\n"],"names":["TD","tableCss"],"mappings":";;;;;;;;AAiBO,MAAM,EAAA,GAAK,UAAA,CAA0C,SAASA,GAAAA,CACnE,EAAE,QAAA,EAAU,SAAA,EAAW,SAAA,GAAY,MAAA,EAAQ,GAAG,IAAA,EAAK,EACnD,GAAA,EACA;AACA,EAAA,MAAM,eAAe,SAAA,EAAU;AAC/B,EAAA,wBAAA,CAAyB;AAAA,IACvB,MAAA,EAAQ,eAAA;AAAA,IACR,GAAA,EAAKC,QAAA;AAAA,IACL,MAAA,EAAQ;AAAA,GACT,CAAA;AAED,EAAA,uBACE,GAAA;AAAA,IAAC,IAAA;AAAA,IAAA;AAAA,MACC,GAAA;AAAA,MACA,SAAA,EAAW,IAAA;AAAA,QACT,kBAAkB,IAAI,CAAA;AAAA,QACtB,iBAAA,CAAkB,IAAA,EAAM,OAAA,EAAS,SAAS,CAAA;AAAA,QAC1C;AAAA,OACF;AAAA,MACC,GAAG,IAAA;AAAA,MAEH;AAAA;AAAA,GACH;AAEJ,CAAC;;;;"}
@@ -0,0 +1,43 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { useComponentCssInjection } from '@salt-ds/styles';
3
+ import { useWindow } from '@salt-ds/window';
4
+ import { clsx } from 'clsx';
5
+ import { forwardRef } from 'react';
6
+ import { withTableBaseName } from './Table.js';
7
+ import css_248z from './Table.css.js';
8
+
9
+ const TFoot = forwardRef(
10
+ function TFoot2({
11
+ children,
12
+ className,
13
+ sticky = false,
14
+ variant,
15
+ divider = "primary",
16
+ ...rest
17
+ }, ref) {
18
+ const targetWindow = useWindow();
19
+ useComponentCssInjection({
20
+ testId: "salt-table-tfoot",
21
+ css: css_248z,
22
+ window: targetWindow
23
+ });
24
+ return /* @__PURE__ */ jsx(
25
+ "tfoot",
26
+ {
27
+ ref,
28
+ className: clsx(
29
+ withTableBaseName("tfoot"),
30
+ { [withTableBaseName(`tfoot-${variant}`)]: variant },
31
+ { [withTableBaseName("tfoot-sticky")]: sticky },
32
+ { [withTableBaseName(`tfoot-divider-${divider}`)]: divider },
33
+ className
34
+ ),
35
+ ...rest,
36
+ children
37
+ }
38
+ );
39
+ }
40
+ );
41
+
42
+ export { TFoot };
43
+ //# sourceMappingURL=TFoot.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TFoot.js","sources":["../src/table/TFoot.tsx"],"sourcesContent":["import { useComponentCssInjection } from \"@salt-ds/styles\";\nimport { useWindow } from \"@salt-ds/window\";\nimport { clsx } from \"clsx\";\nimport { type ComponentPropsWithoutRef, forwardRef } from \"react\";\nimport { withTableBaseName } from \"./Table\";\n\nimport tableCss from \"./Table.css\";\n\nexport interface TFootProps extends ComponentPropsWithoutRef<\"tfoot\"> {\n /**\n * If footer is positioned with sticky styling.\n * @default false\n */\n sticky?: boolean;\n /**\n * Divider styling variant. Defaults to \"primary\";\n * @default primary\n */\n divider?: \"primary\" | \"secondary\" | \"tertiary\" | \"none\";\n /**\n * Styling variant for footer.\n * If undefined, will match variant of parent Table component's variant.\n * @default undefined\n */\n variant?: \"primary\" | \"secondary\" | \"tertiary\";\n}\n\nexport const TFoot = forwardRef<HTMLTableSectionElement, TFootProps>(\n function TFoot(\n {\n children,\n className,\n sticky = false,\n variant,\n divider = \"primary\",\n ...rest\n },\n ref,\n ) {\n const targetWindow = useWindow();\n useComponentCssInjection({\n testId: \"salt-table-tfoot\",\n css: tableCss,\n window: targetWindow,\n });\n\n return (\n <tfoot\n ref={ref}\n className={clsx(\n withTableBaseName(\"tfoot\"),\n { [withTableBaseName(`tfoot-${variant}`)]: variant },\n { [withTableBaseName(\"tfoot-sticky\")]: sticky },\n { [withTableBaseName(`tfoot-divider-${divider}`)]: divider },\n className,\n )}\n {...rest}\n >\n {children}\n </tfoot>\n );\n },\n);\n"],"names":["TFoot","tableCss"],"mappings":";;;;;;;;AA2BO,MAAM,KAAA,GAAQ,UAAA;AAAA,EACnB,SAASA,MAAAA,CACP;AAAA,IACE,QAAA;AAAA,IACA,SAAA;AAAA,IACA,MAAA,GAAS,KAAA;AAAA,IACT,OAAA;AAAA,IACA,OAAA,GAAU,SAAA;AAAA,IACV,GAAG;AAAA,KAEL,GAAA,EACA;AACA,IAAA,MAAM,eAAe,SAAA,EAAU;AAC/B,IAAA,wBAAA,CAAyB;AAAA,MACvB,MAAA,EAAQ,kBAAA;AAAA,MACR,GAAA,EAAKC,QAAA;AAAA,MACL,MAAA,EAAQ;AAAA,KACT,CAAA;AAED,IAAA,uBACE,GAAA;AAAA,MAAC,OAAA;AAAA,MAAA;AAAA,QACC,GAAA;AAAA,QACA,SAAA,EAAW,IAAA;AAAA,UACT,kBAAkB,OAAO,CAAA;AAAA,UACzB,EAAE,CAAC,iBAAA,CAAkB,CAAA,MAAA,EAAS,OAAO,CAAA,CAAE,CAAC,GAAG,OAAA,EAAQ;AAAA,UACnD,EAAE,CAAC,iBAAA,CAAkB,cAAc,CAAC,GAAG,MAAA,EAAO;AAAA,UAC9C,EAAE,CAAC,iBAAA,CAAkB,CAAA,cAAA,EAAiB,OAAO,CAAA,CAAE,CAAC,GAAG,OAAA,EAAQ;AAAA,UAC3D;AAAA,SACF;AAAA,QACC,GAAG,IAAA;AAAA,QAEH;AAAA;AAAA,KACH;AAAA,EAEJ;AACF;;;;"}
@@ -0,0 +1,32 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { useComponentCssInjection } from '@salt-ds/styles';
3
+ import { useWindow } from '@salt-ds/window';
4
+ import { clsx } from 'clsx';
5
+ import { forwardRef } from 'react';
6
+ import { withTableBaseName } from './Table.js';
7
+ import css_248z from './Table.css.js';
8
+
9
+ const TH = forwardRef(function TH2({ children, className, textAlign = "left", ...rest }, ref) {
10
+ const targetWindow = useWindow();
11
+ useComponentCssInjection({
12
+ testId: "salt-table-th",
13
+ css: css_248z,
14
+ window: targetWindow
15
+ });
16
+ return /* @__PURE__ */ jsx(
17
+ "th",
18
+ {
19
+ ref,
20
+ className: clsx(
21
+ withTableBaseName("th"),
22
+ withTableBaseName("th", "align", textAlign),
23
+ className
24
+ ),
25
+ ...rest,
26
+ children
27
+ }
28
+ );
29
+ });
30
+
31
+ export { TH };
32
+ //# sourceMappingURL=TH.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TH.js","sources":["../src/table/TH.tsx"],"sourcesContent":["import { useComponentCssInjection } from \"@salt-ds/styles\";\nimport { useWindow } from \"@salt-ds/window\";\nimport { clsx } from \"clsx\";\nimport { type ComponentPropsWithoutRef, forwardRef } from \"react\";\nimport { withTableBaseName } from \"./Table\";\n\nimport tableCss from \"./Table.css\";\n\nexport interface THProps extends ComponentPropsWithoutRef<\"th\"> {\n /**\n * Specifies the alignment of the text within the `TH`.\n *\n * @default \"left\"\n */\n textAlign?: \"left\" | \"right\";\n}\n\nexport const TH = forwardRef<HTMLTableCellElement, THProps>(function TH(\n { children, className, textAlign = \"left\", ...rest },\n ref,\n) {\n const targetWindow = useWindow();\n useComponentCssInjection({\n testId: \"salt-table-th\",\n css: tableCss,\n window: targetWindow,\n });\n\n return (\n <th\n ref={ref}\n className={clsx(\n withTableBaseName(\"th\"),\n withTableBaseName(\"th\", \"align\", textAlign),\n className,\n )}\n {...rest}\n >\n {children}\n </th>\n );\n});\n"],"names":["TH","tableCss"],"mappings":";;;;;;;;AAiBO,MAAM,EAAA,GAAK,UAAA,CAA0C,SAASA,GAAAA,CACnE,EAAE,QAAA,EAAU,SAAA,EAAW,SAAA,GAAY,MAAA,EAAQ,GAAG,IAAA,EAAK,EACnD,GAAA,EACA;AACA,EAAA,MAAM,eAAe,SAAA,EAAU;AAC/B,EAAA,wBAAA,CAAyB;AAAA,IACvB,MAAA,EAAQ,eAAA;AAAA,IACR,GAAA,EAAKC,QAAA;AAAA,IACL,MAAA,EAAQ;AAAA,GACT,CAAA;AAED,EAAA,uBACE,GAAA;AAAA,IAAC,IAAA;AAAA,IAAA;AAAA,MACC,GAAA;AAAA,MACA,SAAA,EAAW,IAAA;AAAA,QACT,kBAAkB,IAAI,CAAA;AAAA,QACtB,iBAAA,CAAkB,IAAA,EAAM,OAAA,EAAS,SAAS,CAAA;AAAA,QAC1C;AAAA,OACF;AAAA,MACC,GAAG,IAAA;AAAA,MAEH;AAAA;AAAA,GACH;AAEJ,CAAC;;;;"}
@@ -0,0 +1,43 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { useComponentCssInjection } from '@salt-ds/styles';
3
+ import { useWindow } from '@salt-ds/window';
4
+ import { clsx } from 'clsx';
5
+ import { forwardRef } from 'react';
6
+ import { withTableBaseName } from './Table.js';
7
+ import css_248z from './Table.css.js';
8
+
9
+ const THead = forwardRef(
10
+ function THead2({
11
+ children,
12
+ className,
13
+ sticky = false,
14
+ variant,
15
+ divider = "primary",
16
+ ...rest
17
+ }, ref) {
18
+ const targetWindow = useWindow();
19
+ useComponentCssInjection({
20
+ testId: "salt-table-thead",
21
+ css: css_248z,
22
+ window: targetWindow
23
+ });
24
+ return /* @__PURE__ */ jsx(
25
+ "thead",
26
+ {
27
+ ref,
28
+ className: clsx(
29
+ withTableBaseName("thead"),
30
+ { [withTableBaseName(`thead-${variant}`)]: variant },
31
+ { [withTableBaseName("thead-sticky")]: sticky },
32
+ { [withTableBaseName(`thead-divider-${divider}`)]: divider },
33
+ className
34
+ ),
35
+ ...rest,
36
+ children
37
+ }
38
+ );
39
+ }
40
+ );
41
+
42
+ export { THead };
43
+ //# sourceMappingURL=THead.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"THead.js","sources":["../src/table/THead.tsx"],"sourcesContent":["import { useComponentCssInjection } from \"@salt-ds/styles\";\nimport { useWindow } from \"@salt-ds/window\";\nimport { clsx } from \"clsx\";\nimport { type ComponentPropsWithoutRef, forwardRef } from \"react\";\nimport { withTableBaseName } from \"./Table\";\n\nimport tableCss from \"./Table.css\";\n\nexport interface THeadProps extends ComponentPropsWithoutRef<\"thead\"> {\n /**\n * If header is positioned with sticky styling.\n * @default false\n */\n sticky?: boolean;\n /**\n * Divider styling variant. Defaults to \"primary\";\n * @default primary\n */\n divider?: \"primary\" | \"secondary\" | \"tertiary\" | \"none\";\n /**\n * Styling variant for header.\n * If undefined, will match variant of parent Table component's variant.\n * @default undefined\n */\n variant?: \"primary\" | \"secondary\" | \"tertiary\";\n}\n\nexport const THead = forwardRef<HTMLTableSectionElement, THeadProps>(\n function THead(\n {\n children,\n className,\n sticky = false,\n variant,\n divider = \"primary\",\n ...rest\n },\n ref,\n ) {\n const targetWindow = useWindow();\n useComponentCssInjection({\n testId: \"salt-table-thead\",\n css: tableCss,\n window: targetWindow,\n });\n\n return (\n <thead\n ref={ref}\n className={clsx(\n withTableBaseName(\"thead\"),\n { [withTableBaseName(`thead-${variant}`)]: variant },\n { [withTableBaseName(\"thead-sticky\")]: sticky },\n { [withTableBaseName(`thead-divider-${divider}`)]: divider },\n className,\n )}\n {...rest}\n >\n {children}\n </thead>\n );\n },\n);\n"],"names":["THead","tableCss"],"mappings":";;;;;;;;AA2BO,MAAM,KAAA,GAAQ,UAAA;AAAA,EACnB,SAASA,MAAAA,CACP;AAAA,IACE,QAAA;AAAA,IACA,SAAA;AAAA,IACA,MAAA,GAAS,KAAA;AAAA,IACT,OAAA;AAAA,IACA,OAAA,GAAU,SAAA;AAAA,IACV,GAAG;AAAA,KAEL,GAAA,EACA;AACA,IAAA,MAAM,eAAe,SAAA,EAAU;AAC/B,IAAA,wBAAA,CAAyB;AAAA,MACvB,MAAA,EAAQ,kBAAA;AAAA,MACR,GAAA,EAAKC,QAAA;AAAA,MACL,MAAA,EAAQ;AAAA,KACT,CAAA;AAED,IAAA,uBACE,GAAA;AAAA,MAAC,OAAA;AAAA,MAAA;AAAA,QACC,GAAA;AAAA,QACA,SAAA,EAAW,IAAA;AAAA,UACT,kBAAkB,OAAO,CAAA;AAAA,UACzB,EAAE,CAAC,iBAAA,CAAkB,CAAA,MAAA,EAAS,OAAO,CAAA,CAAE,CAAC,GAAG,OAAA,EAAQ;AAAA,UACnD,EAAE,CAAC,iBAAA,CAAkB,cAAc,CAAC,GAAG,MAAA,EAAO;AAAA,UAC9C,EAAE,CAAC,iBAAA,CAAkB,CAAA,cAAA,EAAiB,OAAO,CAAA,CAAE,CAAC,GAAG,OAAA,EAAQ;AAAA,UAC3D;AAAA,SACF;AAAA,QACC,GAAG,IAAA;AAAA,QAEH;AAAA;AAAA,KACH;AAAA,EAEJ;AACF;;;;"}
@@ -0,0 +1,28 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { useComponentCssInjection } from '@salt-ds/styles';
3
+ import { useWindow } from '@salt-ds/window';
4
+ import { clsx } from 'clsx';
5
+ import { forwardRef } from 'react';
6
+ import { withTableBaseName } from './Table.js';
7
+ import css_248z from './Table.css.js';
8
+
9
+ const TR = forwardRef(function TR2({ children, className, ...rest }, ref) {
10
+ const targetWindow = useWindow();
11
+ useComponentCssInjection({
12
+ testId: "salt-table-tr",
13
+ css: css_248z,
14
+ window: targetWindow
15
+ });
16
+ return /* @__PURE__ */ jsx(
17
+ "tr",
18
+ {
19
+ ref,
20
+ className: clsx(withTableBaseName("tr"), className),
21
+ ...rest,
22
+ children
23
+ }
24
+ );
25
+ });
26
+
27
+ export { TR };
28
+ //# sourceMappingURL=TR.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TR.js","sources":["../src/table/TR.tsx"],"sourcesContent":["import { useComponentCssInjection } from \"@salt-ds/styles\";\nimport { useWindow } from \"@salt-ds/window\";\nimport { clsx } from \"clsx\";\nimport { type ComponentPropsWithoutRef, forwardRef } from \"react\";\nimport { withTableBaseName } from \"./Table\";\n\nimport tableCss from \"./Table.css\";\n\nexport interface TRProps extends ComponentPropsWithoutRef<\"tr\"> {}\n\nexport const TR = forwardRef<HTMLTableRowElement, TRProps>(function TR(\n { children, className, ...rest },\n ref,\n) {\n const targetWindow = useWindow();\n useComponentCssInjection({\n testId: \"salt-table-tr\",\n css: tableCss,\n window: targetWindow,\n });\n\n return (\n <tr\n ref={ref}\n className={clsx(withTableBaseName(\"tr\"), className)}\n {...rest}\n >\n {children}\n </tr>\n );\n});\n"],"names":["TR","tableCss"],"mappings":";;;;;;;;AAUO,MAAM,EAAA,GAAK,UAAA,CAAyC,SAASA,GAAAA,CAClE,EAAE,UAAU,SAAA,EAAW,GAAG,IAAA,EAAK,EAC/B,GAAA,EACA;AACA,EAAA,MAAM,eAAe,SAAA,EAAU;AAC/B,EAAA,wBAAA,CAAyB;AAAA,IACvB,MAAA,EAAQ,eAAA;AAAA,IACR,GAAA,EAAKC,QAAA;AAAA,IACL,MAAA,EAAQ;AAAA,GACT,CAAA;AAED,EAAA,uBACE,GAAA;AAAA,IAAC,IAAA;AAAA,IAAA;AAAA,MACC,GAAA;AAAA,MACA,SAAA,EAAW,IAAA,CAAK,iBAAA,CAAkB,IAAI,GAAG,SAAS,CAAA;AAAA,MACjD,GAAG,IAAA;AAAA,MAEH;AAAA;AAAA,GACH;AAEJ,CAAC;;;;"}
@@ -0,0 +1,4 @@
1
+ var css_248z = "/* Table: Main css class */\n.saltTable {\n --table-header-height: calc(var(--salt-size-base) + var(--salt-spacing-100) + var(--salt-size-fixed-100));\n --table-footer-height: calc(var(--salt-size-base) + var(--salt-spacing-100) + var(--salt-size-fixed-100));\n --table-row-height: calc(var(--salt-size-base) + var(--salt-spacing-100) + var(--salt-size-fixed-100));\n}\n\n.saltTable-primary {\n --table-background: var(--salt-container-primary-background);\n}\n\n.saltTable-secondary {\n --table-background: var(--salt-container-secondary-background);\n}\n\n.saltTable-tertiary {\n --table-background: var(--salt-container-tertiary-background);\n}\n\n.saltTable-divider-primary {\n --table-divider-color: var(--salt-separable-primary-borderColor);\n}\n\n.saltTable-divider-secondary {\n --table-divider-color: var(--salt-separable-secondary-borderColor);\n}\n\n.saltTable-divider-tertiary {\n --table-divider-color: var(--salt-separable-tertiary-borderColor);\n}\n\n/* Zebra styling */\ntable.saltTable-zebra-tertiary tbody tr:nth-of-type(odd) {\n --table-background: var(--salt-container-tertiary-background);\n}\n\ntable.saltTable-primary.saltTable-zebra tbody tr:nth-of-type(odd) {\n --table-background: var(--salt-container-secondary-background);\n}\n\ntable.saltTable-secondary.saltTable-zebra tbody tr:nth-of-type(odd) {\n --table-background: var(--salt-container-primary-background);\n}\n\ntable.saltTable-tertiary.saltTable-zebra tbody tr:nth-of-type(odd) {\n --table-background: var(--salt-container-primary-background);\n}\n\ntable.saltTable {\n border-spacing: 0;\n border-radius: var(--salt-palette-corner, 0);\n border-collapse: collapse;\n color: var(--salt-content-primary-foreground);\n font-family: var(--salt-text-fontFamily);\n font-size: var(--salt-text-fontSize);\n line-height: var(--salt-text-lineHeight);\n width: 100%;\n}\n\n/* TR */\ntable.saltTable tr {\n background: var(--table-background);\n}\n\ntable.saltTable tbody tr {\n height: var(--table-row-height);\n min-height: var(--table-row-height);\n}\n\ntable.saltTable tbody tr:not(:last-child) {\n border-bottom: var(--salt-borderStyle-solid) var(--table-divider-color) var(--salt-size-fixed-100);\n}\n\ntable.saltTable.saltTable-divider-none tbody tr {\n --table-divider-color: transparent;\n}\n\n/* THead */\ntable.saltTable thead {\n border-start-start-radius: var(--salt-palette-corner);\n border-start-end-radius: var(--salt-palette-corner);\n color: var(--salt-content-secondary-foreground);\n height: var(--table-header-height);\n min-height: var(--table-header-height);\n font-size: var(--salt-text-label-fontSize);\n font-weight: var(--salt-text-label-fontWeight-strong);\n line-height: var(--salt-text-label-lineHeight);\n}\n\ntable.saltTable thead.saltTable-thead-sticky {\n position: sticky;\n top: 0;\n}\n\ntable.saltTable thead.saltTable-thead-primary tr {\n background: var(--salt-container-primary-background);\n}\n\ntable.saltTable thead.saltTable-thead-secondary tr {\n background: var(--salt-container-secondary-background);\n}\n\ntable.saltTable thead.saltTable-thead-tertiary tr {\n background: var(--salt-container-tertiary-background);\n}\n\ntable.saltTable thead.saltTable-thead tr {\n border-bottom: var(--salt-borderStyle-solid) var(--table-header-divider-color) var(--salt-size-fixed-100);\n}\n\ntable.saltTable thead.saltTable-thead-divider-primary {\n --table-header-divider-color: var(--salt-separable-primary-borderColor);\n}\n\ntable.saltTable thead.saltTable-thead-divider-secondary {\n --table-header-divider-color: var(--salt-separable-secondary-borderColor);\n}\n\ntable.saltTable thead.saltTable-thead-divider-tertiary {\n --table-header-divider-color: var(--salt-separable-tertiary-borderColor);\n}\n\ntable.saltTable thead.saltTable-thead-divider-none {\n --table-header-divider-color: transparent;\n}\n\n/* TFoot */\ntable.saltTable tfoot {\n border-end-start-radius: var(--salt-palette-corner);\n border-end-end-radius: var(--salt-palette-corner);\n color: var(--salt-content-primary-foreground);\n height: var(--table-footer-height);\n min-height: var(--table-footer-height);\n font-size: var(--salt-text-fontSize);\n line-height: var(--salt-text-lineHeight);\n font-weight: var(--salt-text-fontWeight-strong);\n}\n\ntable.saltTable tfoot.saltTable-tfoot-sticky {\n position: sticky;\n bottom: 0;\n}\n\ntable.saltTable tfoot.saltTable-tfoot tr {\n border-top: var(--salt-borderStyle-solid) var(--table-footer-divider-color) var(--salt-size-fixed-100);\n}\n\ntable.saltTable tfoot.saltTable-tfoot-primary tr {\n background: var(--salt-container-primary-background);\n}\n\ntable.saltTable tfoot.saltTable-tfoot-secondary tr {\n background: var(--salt-container-secondary-background);\n}\n\ntable.saltTable tfoot.saltTable-tfoot-tertiary tr {\n background: var(--salt-container-tertiary-background);\n}\n\ntable.saltTable tfoot.saltTable-tfoot-divider-primary tr {\n --table-footer-divider-color: var(--salt-separable-primary-borderColor);\n}\n\ntable.saltTable tfoot.saltTable-tfoot-divider-secondary tr {\n --table-footer-divider-color: var(--salt-separable-secondary-borderColor);\n}\n\ntable.saltTable tfoot.saltTable-tfoot-divider-tertiary tr {\n --table-footer-divider-color: var(--salt-separable-tertiary-borderColor);\n}\n\ntable.saltTable tfoot.saltTable-tfoot-divider-none tr {\n --table-footer-divider-color: transparent;\n}\n\n/* TH */\ntable.saltTable th {\n padding: calc(var(--salt-spacing-75) + var(--salt-spacing-50)) var(--salt-spacing-100);\n padding-top: calc(var(--salt-spacing-75) + var(--salt-spacing-50) + var(--salt-size-fixed-100));\n position: relative;\n text-align: start;\n vertical-align: top;\n font-weight: inherit;\n}\n\ntable.saltTable th.saltTable-th-align-left {\n text-align: start;\n}\n\ntable.saltTable th.saltTable-th-align-right {\n text-align: end;\n}\n\ntable.saltTable tbody th[scope=\"row\"] {\n font-weight: var(--salt-text-fontWeight-strong);\n line-height: var(--salt-text-lineHeight);\n}\n\ntable.saltTable th + th::before {\n background: var(--salt-separable-tertiary-borderColor);\n content: \"\";\n position: absolute;\n z-index: 1;\n display: block;\n width: var(--salt-size-fixed-100);\n height: calc(100% - var(--salt-spacing-200));\n left: 0;\n top: var(--salt-spacing-100);\n}\n\n/* TD */\ntable.saltTable td {\n height: 100%;\n vertical-align: top;\n padding: calc(var(--salt-spacing-75) + var(--salt-spacing-50)) var(--salt-spacing-100);\n}\n\ntable.saltTable td.saltTable-td-align-left {\n text-align: start;\n}\n\ntable.saltTable td.saltTable-td-align-right {\n text-align: end;\n}\n\n.saltTable-container {\n width: 100%;\n overflow: auto;\n}\n";
2
+
3
+ export { css_248z as default };
4
+ //# sourceMappingURL=Table.css.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Table.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
@@ -0,0 +1,68 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { useComponentCssInjection } from '@salt-ds/styles';
3
+ import { useWindow } from '@salt-ds/window';
4
+ import { clsx } from 'clsx';
5
+ import { forwardRef } from 'react';
6
+ import { makePrefixer } from '../utils/makePrefixer.js';
7
+ import { useIsomorphicLayoutEffect } from '../utils/useIsomorphicLayoutEffect.js';
8
+ import '../utils/useFloatingUI/useFloatingUI.js';
9
+ import { useId } from '../utils/useId.js';
10
+ import '../salt-provider/SaltProvider.js';
11
+ import '../viewport/ViewportProvider.js';
12
+ import css_248z from './Table.css.js';
13
+ import { useTable } from './TableContext.js';
14
+
15
+ const withTableBaseName = makePrefixer("saltTable");
16
+ const Table = forwardRef(
17
+ function Table2(props, ref) {
18
+ const targetWindow = useWindow();
19
+ useComponentCssInjection({
20
+ testId: "salt-table",
21
+ css: css_248z,
22
+ window: targetWindow
23
+ });
24
+ const {
25
+ children,
26
+ className,
27
+ variant = "primary",
28
+ divider = "tertiary",
29
+ zebra = false,
30
+ "aria-labelledby": ariaLabelledBy,
31
+ id,
32
+ ...rest
33
+ } = props;
34
+ const tableId = useId(id);
35
+ const { setId, setLabelledBy } = useTable();
36
+ const labelledBy = ariaLabelledBy ?? tableId;
37
+ useIsomorphicLayoutEffect(() => {
38
+ if (tableId) {
39
+ setId(tableId);
40
+ }
41
+ if (labelledBy) {
42
+ setLabelledBy(labelledBy);
43
+ }
44
+ }, [tableId, labelledBy, setId, setLabelledBy]);
45
+ return /* @__PURE__ */ jsx(
46
+ "table",
47
+ {
48
+ id: tableId,
49
+ className: clsx(
50
+ withTableBaseName(),
51
+ {
52
+ [withTableBaseName(variant)]: variant,
53
+ [withTableBaseName("zebra")]: zebra,
54
+ [withTableBaseName(`divider-${divider}`)]: divider
55
+ },
56
+ className
57
+ ),
58
+ "aria-labelledby": labelledBy,
59
+ ref,
60
+ ...rest,
61
+ children
62
+ }
63
+ );
64
+ }
65
+ );
66
+
67
+ export { Table, withTableBaseName };
68
+ //# sourceMappingURL=Table.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Table.js","sources":["../src/table/Table.tsx"],"sourcesContent":["import { useComponentCssInjection } from \"@salt-ds/styles\";\nimport { useWindow } from \"@salt-ds/window\";\nimport { clsx } from \"clsx\";\nimport { type ComponentPropsWithoutRef, forwardRef } from \"react\";\nimport { makePrefixer, useId, useIsomorphicLayoutEffect } from \"../utils\";\n\nimport tableCss from \"./Table.css\";\nimport { useTable } from \"./TableContext\";\n\nexport interface TableProps extends ComponentPropsWithoutRef<\"table\"> {\n /**\n * Styling variant. Defaults to \"primary\".\n * @default primary\n */\n variant?: \"primary\" | \"secondary\" | \"tertiary\";\n /**\n * Divider styling variant. Defaults to \"tertiary\";\n * @default tertiary\n */\n divider?: \"primary\" | \"secondary\" | \"tertiary\" | \"none\";\n /**\n * Zebra styling. Applies a different fill to every other row.\n * @default false\n */\n zebra?: boolean;\n}\n\nexport const withTableBaseName = makePrefixer(\"saltTable\");\n\nexport const Table = forwardRef<HTMLTableElement, TableProps>(\n function Table(props, ref) {\n const targetWindow = useWindow();\n useComponentCssInjection({\n testId: \"salt-table\",\n css: tableCss,\n window: targetWindow,\n });\n\n const {\n children,\n className,\n variant = \"primary\",\n divider = \"tertiary\",\n zebra = false,\n \"aria-labelledby\": ariaLabelledBy,\n id,\n ...rest\n } = props;\n\n const tableId = useId(id);\n const { setId, setLabelledBy } = useTable();\n const labelledBy = ariaLabelledBy ?? tableId;\n\n useIsomorphicLayoutEffect(() => {\n if (tableId) {\n setId(tableId);\n }\n if (labelledBy) {\n setLabelledBy(labelledBy);\n }\n }, [tableId, labelledBy, setId, setLabelledBy]);\n\n return (\n <table\n id={tableId}\n className={clsx(\n withTableBaseName(),\n {\n [withTableBaseName(variant)]: variant,\n [withTableBaseName(\"zebra\")]: zebra,\n [withTableBaseName(`divider-${divider}`)]: divider,\n },\n className,\n )}\n aria-labelledby={labelledBy}\n ref={ref}\n {...rest}\n >\n {children}\n </table>\n );\n },\n);\n"],"names":["Table","tableCss"],"mappings":";;;;;;;;;;;;;;AA2BO,MAAM,iBAAA,GAAoB,aAAa,WAAW;AAElD,MAAM,KAAA,GAAQ,UAAA;AAAA,EACnB,SAASA,MAAAA,CAAM,KAAA,EAAO,GAAA,EAAK;AACzB,IAAA,MAAM,eAAe,SAAA,EAAU;AAC/B,IAAA,wBAAA,CAAyB;AAAA,MACvB,MAAA,EAAQ,YAAA;AAAA,MACR,GAAA,EAAKC,QAAA;AAAA,MACL,MAAA,EAAQ;AAAA,KACT,CAAA;AAED,IAAA,MAAM;AAAA,MACJ,QAAA;AAAA,MACA,SAAA;AAAA,MACA,OAAA,GAAU,SAAA;AAAA,MACV,OAAA,GAAU,UAAA;AAAA,MACV,KAAA,GAAQ,KAAA;AAAA,MACR,iBAAA,EAAmB,cAAA;AAAA,MACnB,EAAA;AAAA,MACA,GAAG;AAAA,KACL,GAAI,KAAA;AAEJ,IAAA,MAAM,OAAA,GAAU,MAAM,EAAE,CAAA;AACxB,IAAA,MAAM,EAAE,KAAA,EAAO,aAAA,EAAc,GAAI,QAAA,EAAS;AAC1C,IAAA,MAAM,aAAa,cAAA,IAAkB,OAAA;AAErC,IAAA,yBAAA,CAA0B,MAAM;AAC9B,MAAA,IAAI,OAAA,EAAS;AACX,QAAA,KAAA,CAAM,OAAO,CAAA;AAAA,MACf;AACA,MAAA,IAAI,UAAA,EAAY;AACd,QAAA,aAAA,CAAc,UAAU,CAAA;AAAA,MAC1B;AAAA,IACF,GAAG,CAAC,OAAA,EAAS,UAAA,EAAY,KAAA,EAAO,aAAa,CAAC,CAAA;AAE9C,IAAA,uBACE,GAAA;AAAA,MAAC,OAAA;AAAA,MAAA;AAAA,QACC,EAAA,EAAI,OAAA;AAAA,QACJ,SAAA,EAAW,IAAA;AAAA,UACT,iBAAA,EAAkB;AAAA,UAClB;AAAA,YACE,CAAC,iBAAA,CAAkB,OAAO,CAAC,GAAG,OAAA;AAAA,YAC9B,CAAC,iBAAA,CAAkB,OAAO,CAAC,GAAG,KAAA;AAAA,YAC9B,CAAC,iBAAA,CAAkB,CAAA,QAAA,EAAW,OAAO,CAAA,CAAE,CAAC,GAAG;AAAA,WAC7C;AAAA,UACA;AAAA,SACF;AAAA,QACA,iBAAA,EAAiB,UAAA;AAAA,QACjB,GAAA;AAAA,QACC,GAAG,IAAA;AAAA,QAEH;AAAA;AAAA,KACH;AAAA,EAEJ;AACF;;;;"}
@@ -0,0 +1,83 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { useForkRef, useResizeObserver, useIsomorphicLayoutEffect } from '@salt-ds/core';
3
+ import { useComponentCssInjection } from '@salt-ds/styles';
4
+ import { useWindow } from '@salt-ds/window';
5
+ import { clsx } from 'clsx';
6
+ import { forwardRef, useState, useRef, useCallback, useMemo } from 'react';
7
+ import { withTableBaseName } from './Table.js';
8
+ import css_248z from './Table.css.js';
9
+ import { TableContext } from './TableContext.js';
10
+
11
+ const TableContainer = forwardRef(
12
+ function TableContainer2(props, ref) {
13
+ const [isOverflowing, setIsOverflowing] = useState(false);
14
+ const [tableId, setTableId] = useState();
15
+ const [labelledBy, setLabelledBy] = useState();
16
+ const targetWindow = useWindow();
17
+ useComponentCssInjection({
18
+ testId: "salt-table-container",
19
+ css: css_248z,
20
+ window: targetWindow
21
+ });
22
+ const {
23
+ children,
24
+ className,
25
+ // @ts-expect-error: "aria-labelledby" is omitted to prevent accidental misuse,
26
+ // but we still want to forward it for advanced accessible labeling scenarios.
27
+ "aria-labelledby": ariaLabelledBy,
28
+ // @ts-expect-error: Allow passing aria-label even though it's omitted from HTMLAttributes
29
+ // Same reasoning as above: we forward aria-label for accessibility purposes.
30
+ "aria-label": ariaLabel,
31
+ // @ts-expect-error: Allow passing role even though it's omitted from HTMLAttributes
32
+ // Same reasoning as above: we forward role for accessibility purposes.
33
+ role,
34
+ tabIndex,
35
+ ...rest
36
+ } = props;
37
+ const scrollRef = useRef(null);
38
+ const handleRef = useForkRef(ref, scrollRef);
39
+ const checkOverflow = useCallback(() => {
40
+ const element = scrollRef.current;
41
+ if (!element) return;
42
+ const overflowing = element.scrollHeight > element.clientHeight || element.scrollWidth > element.clientWidth;
43
+ setIsOverflowing(overflowing);
44
+ }, []);
45
+ useResizeObserver({ ref: scrollRef, onResize: checkOverflow });
46
+ useIsomorphicLayoutEffect(() => {
47
+ checkOverflow();
48
+ }, [checkOverflow]);
49
+ const overflowProps = isOverflowing ? {
50
+ role: role ?? "region",
51
+ tabIndex: tabIndex ?? 0,
52
+ "aria-label": ariaLabel,
53
+ ...ariaLabelledBy === void 0 && ariaLabel === void 0 && {
54
+ "aria-labelledby": labelledBy ?? tableId
55
+ },
56
+ ...ariaLabelledBy !== void 0 && {
57
+ "aria-labelledby": ariaLabelledBy
58
+ }
59
+ } : {
60
+ role,
61
+ tabIndex,
62
+ "aria-labelledby": ariaLabelledBy,
63
+ "aria-label": ariaLabel
64
+ };
65
+ const contextValue = useMemo(
66
+ () => ({ id: tableId, setId: setTableId, labelledBy, setLabelledBy }),
67
+ [tableId, labelledBy]
68
+ );
69
+ return /* @__PURE__ */ jsx(TableContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(
70
+ "div",
71
+ {
72
+ ref: handleRef,
73
+ className: clsx(withTableBaseName("container"), className),
74
+ ...overflowProps,
75
+ ...rest,
76
+ children
77
+ }
78
+ ) });
79
+ }
80
+ );
81
+
82
+ export { TableContainer };
83
+ //# sourceMappingURL=TableContainer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TableContainer.js","sources":["../src/table/TableContainer.tsx"],"sourcesContent":["import {\n useForkRef,\n useIsomorphicLayoutEffect,\n useResizeObserver,\n} from \"@salt-ds/core\";\nimport { useComponentCssInjection } from \"@salt-ds/styles\";\nimport { useWindow } from \"@salt-ds/window\";\nimport { clsx } from \"clsx\";\nimport {\n type ComponentPropsWithoutRef,\n forwardRef,\n useCallback,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { withTableBaseName } from \"./Table\";\nimport tableCss from \"./Table.css\";\nimport { TableContext } from \"./TableContext\";\n\nexport interface TableContainerProps\n extends Omit<\n ComponentPropsWithoutRef<\"div\">,\n \"aria-label\" | \"aria-labelledby\" | \"role\"\n > {}\n\nexport const TableContainer = forwardRef<HTMLDivElement, TableContainerProps>(\n function TableContainer(props, ref) {\n const [isOverflowing, setIsOverflowing] = useState(false);\n const [tableId, setTableId] = useState<string | undefined>();\n const [labelledBy, setLabelledBy] = useState<string | undefined>();\n\n const targetWindow = useWindow();\n useComponentCssInjection({\n testId: \"salt-table-container\",\n css: tableCss,\n window: targetWindow,\n });\n\n const {\n children,\n className,\n // @ts-expect-error: \"aria-labelledby\" is omitted to prevent accidental misuse,\n // but we still want to forward it for advanced accessible labeling scenarios.\n \"aria-labelledby\": ariaLabelledBy,\n // @ts-expect-error: Allow passing aria-label even though it's omitted from HTMLAttributes\n // Same reasoning as above: we forward aria-label for accessibility purposes.\n \"aria-label\": ariaLabel,\n // @ts-expect-error: Allow passing role even though it's omitted from HTMLAttributes\n // Same reasoning as above: we forward role for accessibility purposes.\n role,\n tabIndex,\n ...rest\n } = props;\n\n const scrollRef = useRef<HTMLDivElement | null>(null);\n const handleRef = useForkRef<HTMLDivElement>(ref, scrollRef);\n\n const checkOverflow = useCallback(() => {\n const element = scrollRef.current;\n if (!element) return;\n const overflowing =\n element.scrollHeight > element.clientHeight ||\n element.scrollWidth > element.clientWidth;\n setIsOverflowing(overflowing);\n }, []);\n\n useResizeObserver({ ref: scrollRef, onResize: checkOverflow });\n\n useIsomorphicLayoutEffect(() => {\n checkOverflow();\n }, [checkOverflow]);\n\n const overflowProps = isOverflowing\n ? {\n role: role ?? \"region\",\n tabIndex: tabIndex ?? 0,\n \"aria-label\": ariaLabel,\n ...(ariaLabelledBy === undefined &&\n ariaLabel === undefined && {\n \"aria-labelledby\": labelledBy ?? tableId,\n }),\n ...(ariaLabelledBy !== undefined && {\n \"aria-labelledby\": ariaLabelledBy,\n }),\n }\n : {\n role,\n tabIndex,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-label\": ariaLabel,\n };\n\n const contextValue = useMemo(\n () => ({ id: tableId, setId: setTableId, labelledBy, setLabelledBy }),\n [tableId, labelledBy],\n );\n\n return (\n <TableContext.Provider value={contextValue}>\n <div\n ref={handleRef}\n className={clsx(withTableBaseName(\"container\"), className)}\n {...overflowProps}\n {...rest}\n >\n {children}\n </div>\n </TableContext.Provider>\n );\n },\n);\n"],"names":["TableContainer","tableCss"],"mappings":";;;;;;;;;;AA0BO,MAAM,cAAA,GAAiB,UAAA;AAAA,EAC5B,SAASA,eAAAA,CAAe,KAAA,EAAO,GAAA,EAAK;AAClC,IAAA,MAAM,CAAC,aAAA,EAAe,gBAAgB,CAAA,GAAI,SAAS,KAAK,CAAA;AACxD,IAAA,MAAM,CAAC,OAAA,EAAS,UAAU,CAAA,GAAI,QAAA,EAA6B;AAC3D,IAAA,MAAM,CAAC,UAAA,EAAY,aAAa,CAAA,GAAI,QAAA,EAA6B;AAEjE,IAAA,MAAM,eAAe,SAAA,EAAU;AAC/B,IAAA,wBAAA,CAAyB;AAAA,MACvB,MAAA,EAAQ,sBAAA;AAAA,MACR,GAAA,EAAKC,QAAA;AAAA,MACL,MAAA,EAAQ;AAAA,KACT,CAAA;AAED,IAAA,MAAM;AAAA,MACJ,QAAA;AAAA,MACA,SAAA;AAAA;AAAA;AAAA,MAGA,iBAAA,EAAmB,cAAA;AAAA;AAAA;AAAA,MAGnB,YAAA,EAAc,SAAA;AAAA;AAAA;AAAA,MAGd,IAAA;AAAA,MACA,QAAA;AAAA,MACA,GAAG;AAAA,KACL,GAAI,KAAA;AAEJ,IAAA,MAAM,SAAA,GAAY,OAA8B,IAAI,CAAA;AACpD,IAAA,MAAM,SAAA,GAAY,UAAA,CAA2B,GAAA,EAAK,SAAS,CAAA;AAE3D,IAAA,MAAM,aAAA,GAAgB,YAAY,MAAM;AACtC,MAAA,MAAM,UAAU,SAAA,CAAU,OAAA;AAC1B,MAAA,IAAI,CAAC,OAAA,EAAS;AACd,MAAA,MAAM,cACJ,OAAA,CAAQ,YAAA,GAAe,QAAQ,YAAA,IAC/B,OAAA,CAAQ,cAAc,OAAA,CAAQ,WAAA;AAChC,MAAA,gBAAA,CAAiB,WAAW,CAAA;AAAA,IAC9B,CAAA,EAAG,EAAE,CAAA;AAEL,IAAA,iBAAA,CAAkB,EAAE,GAAA,EAAK,SAAA,EAAW,QAAA,EAAU,eAAe,CAAA;AAE7D,IAAA,yBAAA,CAA0B,MAAM;AAC9B,MAAA,aAAA,EAAc;AAAA,IAChB,CAAA,EAAG,CAAC,aAAa,CAAC,CAAA;AAElB,IAAA,MAAM,gBAAgB,aAAA,GAClB;AAAA,MACE,MAAM,IAAA,IAAQ,QAAA;AAAA,MACd,UAAU,QAAA,IAAY,CAAA;AAAA,MACtB,YAAA,EAAc,SAAA;AAAA,MACd,GAAI,cAAA,KAAmB,MAAA,IACrB,SAAA,KAAc,MAAA,IAAa;AAAA,QACzB,mBAAmB,UAAA,IAAc;AAAA,OACnC;AAAA,MACF,GAAI,mBAAmB,MAAA,IAAa;AAAA,QAClC,iBAAA,EAAmB;AAAA;AACrB,KACF,GACA;AAAA,MACE,IAAA;AAAA,MACA,QAAA;AAAA,MACA,iBAAA,EAAmB,cAAA;AAAA,MACnB,YAAA,EAAc;AAAA,KAChB;AAEJ,IAAA,MAAM,YAAA,GAAe,OAAA;AAAA,MACnB,OAAO,EAAE,EAAA,EAAI,SAAS,KAAA,EAAO,UAAA,EAAY,YAAY,aAAA,EAAc,CAAA;AAAA,MACnE,CAAC,SAAS,UAAU;AAAA,KACtB;AAEA,IAAA,uBACE,GAAA,CAAC,YAAA,CAAa,QAAA,EAAb,EAAsB,OAAO,YAAA,EAC5B,QAAA,kBAAA,GAAA;AAAA,MAAC,KAAA;AAAA,MAAA;AAAA,QACC,GAAA,EAAK,SAAA;AAAA,QACL,SAAA,EAAW,IAAA,CAAK,iBAAA,CAAkB,WAAW,GAAG,SAAS,CAAA;AAAA,QACxD,GAAG,aAAA;AAAA,QACH,GAAG,IAAA;AAAA,QAEH;AAAA;AAAA,KACH,EACF,CAAA;AAAA,EAEJ;AACF;;;;"}
@@ -0,0 +1,23 @@
1
+ import { useContext } from 'react';
2
+ import { createContext } from '../utils/createContext.js';
3
+ import 'clsx';
4
+ import 'react/jsx-runtime';
5
+ import '../utils/useFloatingUI/useFloatingUI.js';
6
+ import '../utils/useId.js';
7
+ import '../salt-provider/SaltProvider.js';
8
+ import '../viewport/ViewportProvider.js';
9
+
10
+ const TableContext = createContext("TableContext", {
11
+ id: void 0,
12
+ setId: () => {
13
+ },
14
+ labelledBy: void 0,
15
+ setLabelledBy: () => {
16
+ }
17
+ });
18
+ function useTable() {
19
+ return useContext(TableContext);
20
+ }
21
+
22
+ export { TableContext, useTable };
23
+ //# sourceMappingURL=TableContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TableContext.js","sources":["../src/table/TableContext.ts"],"sourcesContent":["import { useContext } from \"react\";\nimport { createContext } from \"../utils\";\n\nexport interface TableContextValue {\n id?: string;\n setId: (id: string) => void;\n labelledBy?: string;\n setLabelledBy: (labelId: string) => void;\n}\n\nexport const TableContext = createContext<TableContextValue>(\"TableContext\", {\n id: undefined,\n setId: () => {},\n labelledBy: undefined,\n setLabelledBy: () => {},\n});\n\nexport function useTable() {\n return useContext(TableContext);\n}\n"],"names":[],"mappings":";;;;;;;;;AAUO,MAAM,YAAA,GAAe,cAAiC,cAAA,EAAgB;AAAA,EAC3E,EAAA,EAAI,MAAA;AAAA,EACJ,OAAO,MAAM;AAAA,EAAC,CAAA;AAAA,EACd,UAAA,EAAY,MAAA;AAAA,EACZ,eAAe,MAAM;AAAA,EAAC;AACxB,CAAC;AAEM,SAAS,QAAA,GAAW;AACzB,EAAA,OAAO,WAAW,YAAY,CAAA;AAChC;;;;"}
@@ -1,4 +1,10 @@
1
- const DensityValues = ["high", "medium", "low", "touch"];
1
+ const DensityValues = [
2
+ "high",
3
+ "medium",
4
+ "low",
5
+ "touch",
6
+ "mobile"
7
+ ];
2
8
 
3
9
  export { DensityValues };
4
10
  //# sourceMappingURL=Density.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Density.js","sources":["../src/theme/Density.ts"],"sourcesContent":["export const DensityValues = [\"high\", \"medium\", \"low\", \"touch\"] as const;\n\nexport type Density = (typeof DensityValues)[number];\n"],"names":[],"mappings":"AAAO,MAAM,aAAA,GAAgB,CAAC,MAAA,EAAQ,QAAA,EAAU,OAAO,OAAO;;;;"}
1
+ {"version":3,"file":"Density.js","sources":["../src/theme/Density.ts"],"sourcesContent":["export const DensityValues = [\n \"high\",\n \"medium\",\n \"low\",\n \"touch\",\n \"mobile\",\n] as const;\n\nexport type Density = (typeof DensityValues)[number];\n"],"names":[],"mappings":"AAAO,MAAM,aAAA,GAAgB;AAAA,EAC3B,MAAA;AAAA,EACA,QAAA;AAAA,EACA,KAAA;AAAA,EACA,OAAA;AAAA,EACA;AACF;;;;"}
@@ -15,7 +15,7 @@ export interface DrawerProps extends ComponentPropsWithoutRef<"div"> {
15
15
  /**
16
16
  * Change background color palette
17
17
  */
18
- variant?: "primary" | "secondary";
18
+ variant?: "primary" | "secondary" | "tertiary";
19
19
  /**
20
20
  * Prevent the dialog closing on click away
21
21
  * */
@@ -58,6 +58,7 @@ export * from "./status-adornment";
58
58
  export * from "./status-indicator";
59
59
  export * from "./stepper";
60
60
  export * from "./switch";
61
+ export * from "./table";
61
62
  export * from "./tag";
62
63
  export * from "./text";
63
64
  export * from "./theme";
@@ -23,7 +23,7 @@ export interface ThemeContextProps {
23
23
  /** @deprecated use `actionFont` */
24
24
  UNSTABLE_actionFont: ActionFont;
25
25
  }
26
- export declare const DensityContext: import("react").Context<"touch" | "high" | "low" | "medium">;
26
+ export declare const DensityContext: import("react").Context<"touch" | "high" | "low" | "medium" | "mobile">;
27
27
  export declare const ThemeContext: import("react").Context<ThemeContextProps>;
28
28
  export declare const BreakpointContext: import("react").Context<Breakpoints>;
29
29
  type ThemeNextOnlyAttributes = "accent" | "corner" | "actionFont" | "headingFont";
@@ -9,7 +9,7 @@ export interface ThemeApplicatorProps {
9
9
  */
10
10
  applyClassesTo: "root" | "scope" | "child";
11
11
  /**
12
- * Either "high", "medium", "low" or "touch".
12
+ * Either "high", "medium", "low", "touch" or "mobile".
13
13
  * Determines the amount of content that can fit on a screen based on the size and spacing of components.
14
14
  * Refer to [density](https://www.saltdesignsystem.com/salt/foundations/density) doc for more detail.
15
15
  *
@@ -23,6 +23,9 @@ export interface SemanticIconMap {
23
23
  CompletedIcon: ElementType;
24
24
  LockedIcon: ElementType;
25
25
  InProgressIcon: ElementType;
26
+ RatingIcon: ElementType;
27
+ RatingSelectedIcon: ElementType;
28
+ RatingUnselectingIcon: ElementType;
26
29
  ErrorStatusAdornment: ElementType;
27
30
  WarningStatusAdornment: ElementType;
28
31
  SuccessStatusAdornment: ElementType;
@@ -0,0 +1,4 @@
1
+ import { type ComponentPropsWithoutRef } from "react";
2
+ export interface TBodyProps extends ComponentPropsWithoutRef<"tbody"> {
3
+ }
4
+ export declare const TBody: import("react").ForwardRefExoticComponent<TBodyProps & import("react").RefAttributes<HTMLTableSectionElement>>;
@@ -0,0 +1,10 @@
1
+ import { type ComponentPropsWithoutRef } from "react";
2
+ export interface TDProps extends ComponentPropsWithoutRef<"td"> {
3
+ /**
4
+ * Specifies the alignment of the text within the `TD`.
5
+ *
6
+ * @default "left"
7
+ */
8
+ textAlign?: "left" | "right";
9
+ }
10
+ export declare const TD: import("react").ForwardRefExoticComponent<TDProps & import("react").RefAttributes<HTMLTableCellElement>>;
@@ -0,0 +1,20 @@
1
+ import { type ComponentPropsWithoutRef } from "react";
2
+ export interface TFootProps extends ComponentPropsWithoutRef<"tfoot"> {
3
+ /**
4
+ * If footer is positioned with sticky styling.
5
+ * @default false
6
+ */
7
+ sticky?: boolean;
8
+ /**
9
+ * Divider styling variant. Defaults to "primary";
10
+ * @default primary
11
+ */
12
+ divider?: "primary" | "secondary" | "tertiary" | "none";
13
+ /**
14
+ * Styling variant for footer.
15
+ * If undefined, will match variant of parent Table component's variant.
16
+ * @default undefined
17
+ */
18
+ variant?: "primary" | "secondary" | "tertiary";
19
+ }
20
+ export declare const TFoot: import("react").ForwardRefExoticComponent<TFootProps & import("react").RefAttributes<HTMLTableSectionElement>>;
@@ -0,0 +1,10 @@
1
+ import { type ComponentPropsWithoutRef } from "react";
2
+ export interface THProps extends ComponentPropsWithoutRef<"th"> {
3
+ /**
4
+ * Specifies the alignment of the text within the `TH`.
5
+ *
6
+ * @default "left"
7
+ */
8
+ textAlign?: "left" | "right";
9
+ }
10
+ export declare const TH: import("react").ForwardRefExoticComponent<THProps & import("react").RefAttributes<HTMLTableCellElement>>;
@@ -0,0 +1,20 @@
1
+ import { type ComponentPropsWithoutRef } from "react";
2
+ export interface THeadProps extends ComponentPropsWithoutRef<"thead"> {
3
+ /**
4
+ * If header is positioned with sticky styling.
5
+ * @default false
6
+ */
7
+ sticky?: boolean;
8
+ /**
9
+ * Divider styling variant. Defaults to "primary";
10
+ * @default primary
11
+ */
12
+ divider?: "primary" | "secondary" | "tertiary" | "none";
13
+ /**
14
+ * Styling variant for header.
15
+ * If undefined, will match variant of parent Table component's variant.
16
+ * @default undefined
17
+ */
18
+ variant?: "primary" | "secondary" | "tertiary";
19
+ }
20
+ export declare const THead: import("react").ForwardRefExoticComponent<THeadProps & import("react").RefAttributes<HTMLTableSectionElement>>;
@@ -0,0 +1,4 @@
1
+ import { type ComponentPropsWithoutRef } from "react";
2
+ export interface TRProps extends ComponentPropsWithoutRef<"tr"> {
3
+ }
4
+ export declare const TR: import("react").ForwardRefExoticComponent<TRProps & import("react").RefAttributes<HTMLTableRowElement>>;