@midas-ds/table-styles 2.1.6 → 2.2.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 (3) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/index.mjs +47 -88
  3. package/package.json +4 -3
package/CHANGELOG.md CHANGED
@@ -1,3 +1,14 @@
1
+ ## 2.2.0 (2026-10-09)
2
+
3
+ ### 🚀 Features
4
+
5
+ - **components,layout,table-styles:** depend on lucide-react ([#1405](https://github.com/migrationsverket/midas/pull/1405))
6
+
7
+ ### 🧱 Updated Dependencies
8
+
9
+ - Updated components to 17.30.0
10
+ - Updated theme to 3.17.7
11
+
1
12
  ## 2.1.6 (2026-10-09)
2
13
 
3
14
  ### 🧱 Updated Dependencies
package/index.mjs CHANGED
@@ -1,49 +1,8 @@
1
- import { createElement as e, forwardRef as t } from "react";
1
+ import { ChevronLeft as e, ChevronRight as t } from "lucide-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';//#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 = {
5
+ import './index.css';var f = {
47
6
  en: {
48
7
  nextPage: "Next page",
49
8
  previousPage: "Previous page",
@@ -66,7 +25,7 @@ var f = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) =
66
25
  rows: "rader",
67
26
  selectPage: "Välj sida"
68
27
  }
69
- }, C = {
28
+ }, p = {
70
29
  pagination: "_pagination_1m98q_1",
71
30
  separator: "_separator_1m98q_17",
72
31
  select: "_select_1m98q_21",
@@ -78,113 +37,113 @@ var f = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) =
78
37
  pageIndex: "_pageIndex_1m98q_85 _select_1m98q_21",
79
38
  buttons: "_buttons_1m98q_108",
80
39
  button: "_button_1m98q_108 _separator_1m98q_17"
81
- }, w = ({ getCanNextPage: e, getCanPreviousPage: t, nextPage: r, previousPage: i }) => {
82
- let a = c(), s = o(S), f = (e) => {
40
+ }, m = ({ getCanNextPage: r, getCanPreviousPage: i, nextPage: a, previousPage: s }) => {
41
+ let m = c(), h = o(f), g = (e) => {
83
42
  switch (e.key) {
84
43
  case "ArrowRight":
85
- a?.focusNext({ wrap: !0 });
44
+ m?.focusNext({ wrap: !0 });
86
45
  break;
87
- case "ArrowLeft": a?.focusPrevious({ wrap: !0 });
46
+ case "ArrowLeft": m?.focusPrevious({ wrap: !0 });
88
47
  }
89
48
  };
90
49
  return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(n, {
91
- "aria-label": s.format("previousPage"),
92
- className: C.button,
93
- isDisabled: !t(),
94
- onKeyDown: f,
95
- onPress: i,
50
+ "aria-label": h.format("previousPage"),
51
+ className: p.button,
52
+ isDisabled: !i(),
53
+ onKeyDown: g,
54
+ onPress: s,
96
55
  variant: "icon",
97
- children: /* @__PURE__ */ u(b, {})
56
+ children: /* @__PURE__ */ u(e, {})
98
57
  }), /* @__PURE__ */ u(n, {
99
- "aria-label": s.format("nextPage"),
100
- className: C.button,
101
- isDisabled: !e(),
102
- onKeyDown: f,
103
- onPress: r,
58
+ "aria-label": h.format("nextPage"),
59
+ className: p.button,
60
+ isDisabled: !r(),
61
+ onKeyDown: g,
62
+ onPress: a,
104
63
  variant: "icon",
105
- children: /* @__PURE__ */ u(x, {})
64
+ children: /* @__PURE__ */ u(t, {})
106
65
  })] });
107
- }, T = (e) => {
108
- let { getPageCount: t, getRowCount: n, pageIndex: c, pageSize: l, pageSizeOptions: f = [
66
+ }, h = (e) => {
67
+ let { getPageCount: t, getRowCount: n, pageIndex: c, pageSize: l, pageSizeOptions: h = [
109
68
  10,
110
69
  20,
111
70
  30,
112
71
  40,
113
72
  50
114
- ], setPageIndex: p, setPageSize: m } = e, h = o(S), g = t(), _ = n(), v = (c + 1) * l, y = v - l + 1;
73
+ ], setPageIndex: g, setPageSize: _ } = e, v = o(f), y = t(), b = n(), x = (c + 1) * l, S = x - l + 1;
115
74
  return /* @__PURE__ */ d("div", {
116
- className: C.pagination,
75
+ className: p.pagination,
117
76
  children: [
118
77
  /* @__PURE__ */ u(i, {
119
- className: C.pageSize,
120
- items: f.map((e) => ({
78
+ className: p.pageSize,
79
+ items: h.map((e) => ({
121
80
  id: e.toString(),
122
81
  name: e
123
82
  })),
124
- label: h.format("rowsPerPage"),
83
+ label: v.format("rowsPerPage"),
125
84
  onChange: (e) => {
126
85
  let t = e === null ? l : Number(e);
127
- m(t);
86
+ _(t);
128
87
  },
129
88
  value: l.toString(),
130
89
  children: (e) => /* @__PURE__ */ u(r, {
131
- className: C.listBoxItem,
90
+ className: p.listBoxItem,
132
91
  id: e.id,
133
92
  textValue: e.id,
134
93
  children: e.name
135
94
  })
136
95
  }),
137
96
  /* @__PURE__ */ d(a, {
138
- className: C.result,
97
+ className: p.result,
139
98
  children: [
140
- y,
99
+ S,
141
100
  " -",
142
101
  " ",
143
- v > _ ? _ : v,
102
+ x > b ? b : x,
144
103
  " ",
145
- h.format("of"),
104
+ v.format("of"),
146
105
  " ",
147
- _.toLocaleString(),
106
+ b.toLocaleString(),
148
107
  " ",
149
- _ === 1 ? h.format("row") : h.format("rows")
108
+ b === 1 ? v.format("row") : v.format("rows")
150
109
  ]
151
110
  }),
152
111
  /* @__PURE__ */ d("div", {
153
- className: C.pageIndexContainer,
112
+ className: p.pageIndexContainer,
154
113
  children: [/* @__PURE__ */ u(i, {
155
- "aria-label": h.format("selectPage"),
156
- className: C.pageIndex,
157
- items: Array.from({ length: g }, (e, t) => ({
114
+ "aria-label": v.format("selectPage"),
115
+ className: p.pageIndex,
116
+ items: Array.from({ length: y }, (e, t) => ({
158
117
  id: t.toString(),
159
118
  name: t
160
119
  })),
161
120
  onChange: (e) => {
162
- p(e === null ? 0 : Number(e));
121
+ g(e === null ? 0 : Number(e));
163
122
  },
164
123
  value: c.toString(),
165
124
  children: (e) => /* @__PURE__ */ u(r, {
166
- className: C.listBoxItem,
125
+ className: p.listBoxItem,
167
126
  id: e.id,
168
127
  textValue: (Number(e.id) + 1).toString(),
169
128
  children: e.name + 1
170
129
  })
171
130
  }), /* @__PURE__ */ d(a, {
172
- className: C.label,
131
+ className: p.label,
173
132
  children: [
174
- h.format("of"),
133
+ v.format("of"),
175
134
  " ",
176
- g,
135
+ y,
177
136
  " ",
178
- g === 1 ? h.format("page") : h.format("pages")
137
+ y === 1 ? v.format("page") : v.format("pages")
179
138
  ]
180
139
  })]
181
140
  }),
182
141
  /* @__PURE__ */ u("div", {
183
- className: C.buttons,
184
- children: /* @__PURE__ */ u(s, { children: /* @__PURE__ */ u(w, { ...e }) })
142
+ className: p.buttons,
143
+ children: /* @__PURE__ */ u(s, { children: /* @__PURE__ */ u(m, { ...e }) })
185
144
  })
186
145
  ]
187
146
  });
188
147
  };
189
148
  //#endregion
190
- export { T as Pagination };
149
+ export { h 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.1.6",
17
+ "version": "2.2.0",
18
18
  "main": "./index.mjs",
19
19
  "types": "./index.d.ts",
20
20
  "files": [
@@ -31,8 +31,9 @@
31
31
  }
32
32
  },
33
33
  "dependencies": {
34
- "@midas-ds/components": "17.29.0",
35
- "@midas-ds/theme": "3.17.6",
34
+ "@midas-ds/components": "17.30.0",
35
+ "@midas-ds/theme": "3.17.7",
36
+ "lucide-react": ">=0.563.0 <2.0.0",
36
37
  "react-aria-components": "1.21.1",
37
38
  "react-aria": "3.52.1"
38
39
  },