@midas-ds/table-styles 2.0.116 → 2.0.117

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 (3) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/index.mjs +88 -47
  3. package/package.json +4 -8
package/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## 2.0.117 (2026-09-17)
2
+
3
+ ### 🩹 Fixes
4
+
5
+ - **table-styles:** externalize shared dependencies ([1954bad5a69](https://github.com/migrationsverket/midas/commit/1954bad5a69))
6
+
7
+ ### 🔧 Maintenance
8
+
9
+ - **table-styles:** configure @nx/dependency-checks ([4f631fd4d19](https://github.com/migrationsverket/midas/commit/4f631fd4d19))
10
+
11
+ ### 🧱 Updated Dependencies
12
+
13
+ - Updated components to 17.23.9
14
+
1
15
  ## 2.0.116 (2026-09-08)
2
16
 
3
17
  ### 🔧 Maintenance
package/index.mjs CHANGED
@@ -1,8 +1,49 @@
1
- import { ChevronLeft as e, ChevronRight as t } from "lucide-react";
1
+ import { createElement as e, forwardRef as t } from "react";
2
2
  import { Button as n, ListBoxItem as r, Select as i, Text as a, useLocalizedStringFormatter as o } from "@midas-ds/components";
3
3
  import { FocusScope as s, useFocusManager as c } from "react-aria";
4
4
  import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
5
- import './index.css';var f = {
5
+ import './index.css';//#region ../../node_modules/lucide-react/dist/esm/shared/src/utils/mergeClasses.js
6
+ var f = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) === t).join(" ").trim(), p = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), m = (e) => e.replace(/^([A-Z])|[\s-_]+(\w)/g, (e, t, n) => n ? n.toUpperCase() : t.toLowerCase()), h = (e) => {
7
+ let t = m(e);
8
+ return t.charAt(0).toUpperCase() + t.slice(1);
9
+ }, g = {
10
+ xmlns: "http://www.w3.org/2000/svg",
11
+ width: 24,
12
+ height: 24,
13
+ viewBox: "0 0 24 24",
14
+ fill: "none",
15
+ stroke: "currentColor",
16
+ strokeWidth: 2,
17
+ strokeLinecap: "round",
18
+ strokeLinejoin: "round"
19
+ }, _ = (e) => {
20
+ for (let t in e) if (t.startsWith("aria-") || t === "role" || t === "title") return !0;
21
+ return !1;
22
+ }, v = t(({ color: t = "currentColor", size: n = 24, strokeWidth: r = 2, absoluteStrokeWidth: i, className: a = "", children: o, iconNode: s, ...c }, l) => e("svg", {
23
+ ref: l,
24
+ ...g,
25
+ width: n,
26
+ height: n,
27
+ stroke: t,
28
+ strokeWidth: i ? Number(r) * 24 / Number(n) : r,
29
+ className: f("lucide", a),
30
+ ...!o && !_(c) && { "aria-hidden": "true" },
31
+ ...c
32
+ }, [...s.map(([t, n]) => e(t, n)), ...Array.isArray(o) ? o : [o]])), y = (n, r) => {
33
+ let i = t(({ className: t, ...i }, a) => e(v, {
34
+ ref: a,
35
+ iconNode: r,
36
+ className: f(`lucide-${p(h(n))}`, `lucide-${n}`, t),
37
+ ...i
38
+ }));
39
+ return i.displayName = h(n), i;
40
+ }, b = y("chevron-left", [["path", {
41
+ d: "m15 18-6-6 6-6",
42
+ key: "1wnfg3"
43
+ }]]), x = y("chevron-right", [["path", {
44
+ d: "m9 18 6-6-6-6",
45
+ key: "mthhwq"
46
+ }]]), S = {
6
47
  en: {
7
48
  nextPage: "Next page",
8
49
  previousPage: "Previous page",
@@ -25,7 +66,7 @@ import './index.css';var f = {
25
66
  rows: "rader",
26
67
  selectPage: "Välj sida"
27
68
  }
28
- }, p = {
69
+ }, C = {
29
70
  pagination: "_pagination_1m98q_1",
30
71
  separator: "_separator_1m98q_17",
31
72
  select: "_select_1m98q_21",
@@ -37,114 +78,114 @@ import './index.css';var f = {
37
78
  pageIndex: "_pageIndex_1m98q_85 _select_1m98q_21",
38
79
  buttons: "_buttons_1m98q_108",
39
80
  button: "_button_1m98q_108 _separator_1m98q_17"
40
- }, m = ({ getCanNextPage: r, getCanPreviousPage: i, nextPage: a, previousPage: s }) => {
41
- let m = c(), h = o(f), g = (e) => {
81
+ }, w = ({ getCanNextPage: e, getCanPreviousPage: t, nextPage: r, previousPage: i }) => {
82
+ let a = c(), s = o(S), f = (e) => {
42
83
  switch (e.key) {
43
84
  case "ArrowRight":
44
- m?.focusNext({ wrap: !0 });
85
+ a?.focusNext({ wrap: !0 });
45
86
  break;
46
87
  case "ArrowLeft":
47
- m?.focusPrevious({ wrap: !0 });
88
+ a?.focusPrevious({ wrap: !0 });
48
89
  break;
49
90
  }
50
91
  };
51
92
  return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(n, {
52
- "aria-label": h.format("previousPage"),
53
- className: p.button,
54
- isDisabled: !i(),
55
- onKeyDown: g,
56
- onPress: s,
93
+ "aria-label": s.format("previousPage"),
94
+ className: C.button,
95
+ isDisabled: !t(),
96
+ onKeyDown: f,
97
+ onPress: i,
57
98
  variant: "icon",
58
- children: /* @__PURE__ */ u(e, {})
99
+ children: /* @__PURE__ */ u(b, {})
59
100
  }), /* @__PURE__ */ u(n, {
60
- "aria-label": h.format("nextPage"),
61
- className: p.button,
62
- isDisabled: !r(),
63
- onKeyDown: g,
64
- onPress: a,
101
+ "aria-label": s.format("nextPage"),
102
+ className: C.button,
103
+ isDisabled: !e(),
104
+ onKeyDown: f,
105
+ onPress: r,
65
106
  variant: "icon",
66
- children: /* @__PURE__ */ u(t, {})
107
+ children: /* @__PURE__ */ u(x, {})
67
108
  })] });
68
- }, h = (e) => {
69
- let { getPageCount: t, getRowCount: n, pageIndex: c, pageSize: l, pageSizeOptions: h = [
109
+ }, T = (e) => {
110
+ let { getPageCount: t, getRowCount: n, pageIndex: c, pageSize: l, pageSizeOptions: f = [
70
111
  10,
71
112
  20,
72
113
  30,
73
114
  40,
74
115
  50
75
- ], setPageIndex: g, setPageSize: _ } = e, v = o(f), y = t(), b = n(), x = (c + 1) * l, S = x - l + 1;
116
+ ], setPageIndex: p, setPageSize: m } = e, h = o(S), g = t(), _ = n(), v = (c + 1) * l, y = v - l + 1;
76
117
  return /* @__PURE__ */ d("div", {
77
- className: p.pagination,
118
+ className: C.pagination,
78
119
  children: [
79
120
  /* @__PURE__ */ u(i, {
80
- className: p.pageSize,
81
- items: h.map((e) => ({
121
+ className: C.pageSize,
122
+ items: f.map((e) => ({
82
123
  id: e.toString(),
83
124
  name: e
84
125
  })),
85
- label: v.format("rowsPerPage"),
126
+ label: h.format("rowsPerPage"),
86
127
  onChange: (e) => {
87
- _(e === null ? l : Number(e));
128
+ m(e === null ? l : Number(e));
88
129
  },
89
130
  value: l.toString(),
90
131
  children: (e) => /* @__PURE__ */ u(r, {
91
- className: p.listBoxItem,
132
+ className: C.listBoxItem,
92
133
  id: e.id,
93
134
  textValue: e.id,
94
135
  children: e.name
95
136
  })
96
137
  }),
97
138
  /* @__PURE__ */ d(a, {
98
- className: p.result,
139
+ className: C.result,
99
140
  children: [
100
- S,
141
+ y,
101
142
  " -",
102
143
  " ",
103
- x > b ? b : x,
144
+ v > _ ? _ : v,
104
145
  " ",
105
- v.format("of"),
146
+ h.format("of"),
106
147
  " ",
107
- b.toLocaleString(),
148
+ _.toLocaleString(),
108
149
  " ",
109
- b === 1 ? v.format("row") : v.format("rows")
150
+ _ === 1 ? h.format("row") : h.format("rows")
110
151
  ]
111
152
  }),
112
153
  /* @__PURE__ */ d("div", {
113
- className: p.pageIndexContainer,
154
+ className: C.pageIndexContainer,
114
155
  children: [/* @__PURE__ */ u(i, {
115
- "aria-label": v.format("selectPage"),
116
- className: p.pageIndex,
117
- items: Array.from({ length: y }, (e, t) => ({
156
+ "aria-label": h.format("selectPage"),
157
+ className: C.pageIndex,
158
+ items: Array.from({ length: g }, (e, t) => ({
118
159
  id: t.toString(),
119
160
  name: t
120
161
  })),
121
162
  onChange: (e) => {
122
- g(e === null ? 0 : Number(e));
163
+ p(e === null ? 0 : Number(e));
123
164
  },
124
165
  value: c.toString(),
125
166
  children: (e) => /* @__PURE__ */ u(r, {
126
- className: p.listBoxItem,
167
+ className: C.listBoxItem,
127
168
  id: e.id,
128
169
  textValue: (Number(e.id) + 1).toString(),
129
170
  children: e.name + 1
130
171
  })
131
172
  }), /* @__PURE__ */ d(a, {
132
- className: p.label,
173
+ className: C.label,
133
174
  children: [
134
- v.format("of"),
175
+ h.format("of"),
135
176
  " ",
136
- y,
177
+ g,
137
178
  " ",
138
- y === 1 ? v.format("page") : v.format("pages")
179
+ g === 1 ? h.format("page") : h.format("pages")
139
180
  ]
140
181
  })]
141
182
  }),
142
183
  /* @__PURE__ */ u("div", {
143
- className: p.buttons,
144
- children: /* @__PURE__ */ u(s, { children: /* @__PURE__ */ u(m, { ...e }) })
184
+ className: C.buttons,
185
+ children: /* @__PURE__ */ u(s, { children: /* @__PURE__ */ u(w, { ...e }) })
145
186
  })
146
187
  ]
147
188
  });
148
189
  };
149
190
  //#endregion
150
- export { h as Pagination };
191
+ export { T as Pagination };
package/package.json CHANGED
@@ -14,7 +14,7 @@
14
14
  "description": "Midas table components and styles for TanStack Table",
15
15
  "homepage": "https://designsystem.migrationsverket.se/",
16
16
  "license": "CC0-1.0",
17
- "version": "2.0.116",
17
+ "version": "2.0.117",
18
18
  "main": "./index.mjs",
19
19
  "types": "./index.d.ts",
20
20
  "files": [
@@ -31,16 +31,12 @@
31
31
  }
32
32
  },
33
33
  "dependencies": {
34
- "@midas-ds/components": "17.23.8",
34
+ "@midas-ds/components": "17.23.9",
35
35
  "@midas-ds/theme": "3.17.0",
36
- "lucide-react": "^0.563.0",
37
- "react-aria": "^3.51.0",
38
- "react-aria-components": "1.20.0"
36
+ "react-aria-components": "1.20.0",
37
+ "react-aria": "^3.51.0"
39
38
  },
40
39
  "peerDependencies": {
41
40
  "@tanstack/react-table": "^8.21.3"
42
- },
43
- "devDependencies": {
44
- "@tanstack/react-table": "^8.21.3"
45
41
  }
46
42
  }