@agregio-solutions/design-system 1.34.0 → 1.35.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -965,8 +965,17 @@ See https://s-c.sh/2BAXzed for more info.`),window[Pa]+=1);const be={color:{cont
965
965
  line-height: ${re.xxSmall};
966
966
  `,T7=l.forwardRef(({count:e,onPageChange:t,pageIndex:n,itemsPerPageOptions:r=[10,20,30,40,50],itemsPerPage:a=10,onItemsPerPageChange:u,...o},i)=>{const s=l.useMemo(()=>n*a+1,[a,n]),d=l.useMemo(()=>Math.min((n+1)*a,e),[e,a,n]),c=l.useMemo(()=>Math.ceil(e/a),[e,a]),p=l.useMemo(()=>Math.max(c-1,0),[c]);return m.jsxs(v$,{...o,ref:i,children:[m.jsxs(g$,{children:[m.jsx(b$,{children:"Item per page"}),m.jsx(rl,{id:"table-pagination-items-per-page",label:"Select the number of items per page",mode:"single",value:String(a),onChange:h=>u(Number(h)),fullWidth:!0,children:r.map(h=>m.jsx(Rn,{id:String(h),text:String(h)},h))}),m.jsxs(y$,{"data-testid":"table-pagination-items-range",children:[m.jsx("b",{children:s})," - ",m.jsx("b",{children:d})," of ",m.jsx("b",{children:e})," items"]})]}),m.jsxs(x$,{children:[m.jsx(rl,{id:"table-pagination-page-selector",label:"Select page to display",mode:"single",value:String(n),onChange:h=>t(Number(h)),fullWidth:!0,children:h$(c).map(h=>m.jsx(Rn,{id:String(h),text:String(h+1)},h))}),m.jsxs($$,{"data-testid":"table-pagination-pages-range",children:["On ",m.jsx("b",{children:c})," pages"]}),m.jsxs("div",{children:[m.jsx(Be,{iconLeft:"first_page","aria-label":"Go to first page",onClick:()=>t(0),disabled:n===0,mode:"tertiary"}),m.jsx(Be,{iconLeft:"chevron_left","aria-label":"Go to previous page",onClick:()=>t(n-1),disabled:n===0,mode:"tertiary"}),m.jsx(Be,{iconLeft:"chevron_right","aria-label":"Go to next page",onClick:()=>t(n+1),disabled:n===p,mode:"tertiary"}),m.jsx(Be,{iconLeft:"last_page","aria-label":"Go to last page",onClick:()=>t(p),disabled:n===p,mode:"tertiary"})]})]})]})}),C$=I.table`
967
967
  width: 100%;
968
- border-collapse: separate;
969
- border-spacing: 0 var(--spacing-xxs);
968
+ border-collapse: collapse;
969
+ border-spacing: 0;
970
+ background-color: var(--color-content-neutral-primary-reversed);
971
+
972
+ tbody {
973
+ border-top: 1px solid var(--color-content-neutral-stroke);
974
+
975
+ tr {
976
+ border-bottom: 1px solid var(--color-content-neutral-stroke);
977
+ }
978
+ }
970
979
  `;function R7({children:e,...t}){return m.jsx(C$,{...t,children:e})}const D$=I.div`
971
980
  padding: var(--spacing-md);
972
981
  text-align: center;
@@ -991,10 +1000,20 @@ See https://s-c.sh/2BAXzed for more info.`),window[Pa]+=1);const be={color:{cont
991
1000
  > [data-design-system-component="Checkbox"] {
992
1001
  padding: 0 !important;
993
1002
  }
1003
+
1004
+ &[data-border="left"],
1005
+ &[data-border="both"] {
1006
+ border-left: 1px solid var(--color-content-neutral-stroke);
1007
+ }
1008
+
1009
+ &[data-border="right"],
1010
+ &[data-border="both"] {
1011
+ border-right: 1px solid var(--color-content-neutral-stroke);
1012
+ }
994
1013
  `,P$=I(Ce)`
995
1014
  display: inline-block;
996
1015
  font-size: ${X.large};
997
- `;function A$({children:e,iconLeft:t,...n}){return m.jsx(S$,{...n,children:m.jsxs(k$,{children:[!!t&&m.jsx(P$,{name:t}),e]})})}const F$=I.th`
1016
+ `;function A$({children:e,iconLeft:t,border:n,...r}){return m.jsx(S$,{...r,children:m.jsxs(k$,{"data-border":n,children:[!!t&&m.jsx(P$,{name:t}),e]})})}const F$=I.th`
998
1017
  padding: 0;
999
1018
  vertical-align: bottom;
1000
1019
  `,T$=I.div`
@@ -1003,7 +1022,18 @@ See https://s-c.sh/2BAXzed for more info.`),window[Pa]+=1);const be={color:{cont
1003
1022
  width: 100%;
1004
1023
  column-gap: var(--spacing-xxs);
1005
1024
  padding: var(--spacing-sm);
1025
+ background: var(--color-background-neutral-underground-1);
1006
1026
  border-bottom: 1px solid var(--color-content-neutral-stroke);
1027
+
1028
+ &[data-border="left"],
1029
+ &[data-border="both"] {
1030
+ border-left: 1px solid var(--color-content-neutral-stroke);
1031
+ }
1032
+
1033
+ &[data-border="right"],
1034
+ &[data-border="both"] {
1035
+ border-right: 1px solid var(--color-content-neutral-stroke);
1036
+ }
1007
1037
  `,al=I(Ce)`
1008
1038
  display: inline-block;
1009
1039
  font-size: ${X.large};
@@ -1028,7 +1058,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[Pa]+=1);const be={color:{cont
1028
1058
  }
1029
1059
  `,R$=I(I7)`
1030
1060
  height: ${X.large};
1031
- `;function I$({text:e,iconLeft:t,sortDirection:n="none",onSortClick:r,...a}){return m.jsx(F$,{...a,children:m.jsxs(T$,{children:[!!t&&m.jsx(al,{name:t}),m.jsx(I7,{type:"button",onClick:r,disabled:!r,children:e}),!!r&&n!=="none"&&m.jsx(R$,{type:"button",onClick:r,disabled:!r,children:m.jsx(al,{name:n==="asc"?"expand_less":"expand_more"})})]})})}const M$=I(Bb)`
1061
+ `;function I$({text:e,iconLeft:t,sortDirection:n="none",onSortClick:r,border:a,...u}){return m.jsx(F$,{...u,children:m.jsxs(T$,{"data-border":a,children:[!!t&&m.jsx(al,{name:t}),m.jsxs(I7,{type:"button",onClick:r,disabled:!r,children:[e||" "," "]}),!!r&&n!=="none"&&m.jsx(R$,{type:"button",onClick:r,disabled:!r,children:m.jsx(al,{name:n==="asc"?"expand_less":"expand_more"})})]})})}const M$=I(Bb)`
1032
1062
  display: flex;
1033
1063
 
1034
1064
  &[data-fullwidth="true"] {
@@ -1485,9 +1515,10 @@ See https://s-c.sh/2BAXzed for more info.`),window[Pa]+=1);const be={color:{cont
1485
1515
  display: flex;
1486
1516
  flex-direction: column;
1487
1517
  gap: var(--spacing-sm);
1518
+ margin-bottom: var(--spacing-sm);
1488
1519
  `,BC=I.div`
1489
1520
  display: flex;
1490
- align-items: center;
1521
+ align-items: flex-end;
1491
1522
  justify-content: flex-end;
1492
1523
  gap: var(--spacing-sm);
1493
1524
  `,SC=I.div`
@@ -22138,8 +22138,17 @@ const DC = R.div`
22138
22138
  }
22139
22139
  ), kC = R.table`
22140
22140
  width: 100%;
22141
- border-collapse: separate;
22142
- border-spacing: 0 var(--spacing-xxs);
22141
+ border-collapse: collapse;
22142
+ border-spacing: 0;
22143
+ background-color: var(--color-content-neutral-primary-reversed);
22144
+
22145
+ tbody {
22146
+ border-top: 1px solid var(--color-content-neutral-stroke);
22147
+
22148
+ tr {
22149
+ border-bottom: 1px solid var(--color-content-neutral-stroke);
22150
+ }
22151
+ }
22143
22152
  `;
22144
22153
  function AC({
22145
22154
  children: e,
@@ -22222,6 +22231,16 @@ const RC = R.td`
22222
22231
  > [data-design-system-component="Checkbox"] {
22223
22232
  padding: 0 !important;
22224
22233
  }
22234
+
22235
+ &[data-border="left"],
22236
+ &[data-border="both"] {
22237
+ border-left: 1px solid var(--color-content-neutral-stroke);
22238
+ }
22239
+
22240
+ &[data-border="right"],
22241
+ &[data-border="both"] {
22242
+ border-right: 1px solid var(--color-content-neutral-stroke);
22243
+ }
22225
22244
  `, VC = R(Te)`
22226
22245
  display: inline-block;
22227
22246
  font-size: ${ne.large};
@@ -22229,9 +22248,10 @@ const RC = R.td`
22229
22248
  function gw({
22230
22249
  children: e,
22231
22250
  iconLeft: t,
22232
- ...n
22251
+ border: n,
22252
+ ...r
22233
22253
  }) {
22234
- return /* @__PURE__ */ m(RC, { ...n, children: /* @__PURE__ */ Y(MC, { children: [
22254
+ return /* @__PURE__ */ m(RC, { ...r, children: /* @__PURE__ */ Y(MC, { "data-border": n, children: [
22235
22255
  !!t && /* @__PURE__ */ m(VC, { name: t }),
22236
22256
  e
22237
22257
  ] }) });
@@ -22245,7 +22265,18 @@ const KC = R.th`
22245
22265
  width: 100%;
22246
22266
  column-gap: var(--spacing-xxs);
22247
22267
  padding: var(--spacing-sm);
22268
+ background: var(--color-background-neutral-underground-1);
22248
22269
  border-bottom: 1px solid var(--color-content-neutral-stroke);
22270
+
22271
+ &[data-border="left"],
22272
+ &[data-border="both"] {
22273
+ border-left: 1px solid var(--color-content-neutral-stroke);
22274
+ }
22275
+
22276
+ &[data-border="right"],
22277
+ &[data-border="both"] {
22278
+ border-right: 1px solid var(--color-content-neutral-stroke);
22279
+ }
22249
22280
  `, cl = R(Te)`
22250
22281
  display: inline-block;
22251
22282
  font-size: ${ne.large};
@@ -22276,11 +22307,15 @@ function bw({
22276
22307
  iconLeft: t,
22277
22308
  sortDirection: n = "none",
22278
22309
  onSortClick: r,
22279
- ...a
22310
+ border: a,
22311
+ ...u
22280
22312
  }) {
22281
- return /* @__PURE__ */ m(KC, { ...a, children: /* @__PURE__ */ Y(OC, { children: [
22313
+ return /* @__PURE__ */ m(KC, { ...u, children: /* @__PURE__ */ Y(OC, { "data-border": a, children: [
22282
22314
  !!t && /* @__PURE__ */ m(cl, { name: t }),
22283
- /* @__PURE__ */ m(H7, { type: "button", onClick: r, disabled: !r, children: e }),
22315
+ /* @__PURE__ */ Y(H7, { type: "button", onClick: r, disabled: !r, children: [
22316
+ e || " ",
22317
+ " "
22318
+ ] }),
22284
22319
  !!r && n !== "none" && /* @__PURE__ */ m(
22285
22320
  LC,
22286
22321
  {
@@ -23271,9 +23306,10 @@ const xD = R.div`
23271
23306
  display: flex;
23272
23307
  flex-direction: column;
23273
23308
  gap: var(--spacing-sm);
23309
+ margin-bottom: var(--spacing-sm);
23274
23310
  `, AD = R.div`
23275
23311
  display: flex;
23276
- align-items: center;
23312
+ align-items: flex-end;
23277
23313
  justify-content: flex-end;
23278
23314
  gap: var(--spacing-sm);
23279
23315
  `, FD = R.div`
@@ -28,6 +28,10 @@ type Props = {
28
28
  * The inline style for the element.
29
29
  */
30
30
  style?: React.CSSProperties;
31
+ /**
32
+ * The border to apply to the cell.
33
+ */
34
+ border?: "right" | "left" | "both";
31
35
  };
32
- export default function DataTableCell({ children, iconLeft, ...otherProps }: Props): React.ReactElement;
36
+ export default function DataTableCell({ children, iconLeft, border, ...otherProps }: Props): React.ReactElement;
33
37
  export {};
@@ -25,5 +25,19 @@ export type Props = {
25
25
  * The inline style for the element.
26
26
  */
27
27
  style?: React.CSSProperties;
28
+ /**
29
+ * The border to apply to the header.
30
+ */
31
+ border?: "right" | "left" | "both";
32
+ /**
33
+ * Sets or retrieves the number columns in the table that the object should span.
34
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLTableCellElement/colSpan)
35
+ */
36
+ colSpan?: number;
37
+ /**
38
+ * Sets or retrieves how many rows in a table the cell should span.
39
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLTableCellElement/rowSpan)
40
+ */
41
+ rowSpan?: number;
28
42
  };
29
- export default function DataTableHeader({ text, iconLeft, sortDirection, onSortClick, ...otherProps }: Props): React.ReactElement;
43
+ export default function DataTableHeader({ text, iconLeft, sortDirection, onSortClick, border, ...otherProps }: Props): React.ReactElement;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agregio-solutions/design-system",
3
- "version": "1.34.0",
3
+ "version": "1.35.1",
4
4
  "description": "React Component library and Storybook that is part of the Design System for Agregio Solutions",
5
5
  "type": "module",
6
6
  "module": "dist/design-system.js",
@@ -16,7 +16,7 @@
16
16
  "build": "vite build",
17
17
  "build-storybook": "storybook build",
18
18
  "chromatic": "chromatic",
19
- "eslint": "eslint . --ignore-path .gitignore",
19
+ "eslint": "eslint .",
20
20
  "formatters": "npm run prettier:check && npm run eslint && npm run typescript:check",
21
21
  "integrity": "npm run formatters && npm run build && npm run vitest:all && npm run storybook:test:integrity",
22
22
  "jest:compatibility-check": "npm run build && jest internal/test-jest-compatibility.jest.js",
@@ -36,10 +36,13 @@
36
36
  "devDependencies": {
37
37
  "@emotion/react": "^11.13.3",
38
38
  "@emotion/styled": "^11.13.0",
39
+ "@eslint/compat": "^1.2.2",
40
+ "@eslint/js": "^9.14.0",
39
41
  "@mui/material": "^5.16.7",
40
42
  "@semantic-release/gitlab": "^13.2.1",
41
43
  "@semantic-release/npm": "^12.0.1",
42
44
  "@storybook/addon-a11y": "^8.3.6",
45
+ "@storybook/addon-docs": "^8.4.2",
43
46
  "@storybook/addon-essentials": "^8.3.6",
44
47
  "@storybook/addon-interactions": "^8.3.6",
45
48
  "@storybook/addon-links": "^8.3.6",
@@ -53,16 +56,14 @@
53
56
  "@tanstack/react-table": "^8.20.5",
54
57
  "@types/lodash": "^4.17.13",
55
58
  "@types/node": "^22.0.0",
56
- "@typescript-eslint/eslint-plugin": "^8.0.0",
57
59
  "@vitejs/plugin-react": "^4.3.3",
58
60
  "chromatic": "^11.12.6",
59
61
  "conventional-changelog-conventionalcommits": "8.0.0",
60
- "eslint": "^8.57.1",
61
62
  "eslint-config-prettier": "^9.1.0",
62
63
  "eslint-plugin-jest-dom": "^5.4.0",
63
- "eslint-plugin-react": "^7.37.1",
64
+ "eslint-plugin-react": "^7.37.2",
64
65
  "eslint-plugin-react-hooks": "^5.0.0",
65
- "eslint-plugin-storybook": "^0.10.1",
66
+ "eslint-plugin-storybook": "^0.11.0",
66
67
  "http-server": "^14.1.1",
67
68
  "husky": "^9.1.6",
68
69
  "jest": "^29.7.0",
@@ -77,6 +78,7 @@
77
78
  "semantic-release": "^24.1.3",
78
79
  "start-server-and-test": "^2.0.8",
79
80
  "storybook": "^8.3.6",
81
+ "typescript-eslint": "^8.13.0",
80
82
  "vite-plugin-dts": "4.3.0",
81
83
  "vitest": "^2.1.3"
82
84
  },