@ogcio/design-system-react 1.17.0 → 1.17.2

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.
@@ -22,4 +22,5 @@ type DisplayPage = number | -1 | -2;
22
22
  */
23
23
  export declare const getDisplayPages: (currentPage: number, totalPages: number, breakpoint: BreakpointType) => DisplayPage[];
24
24
  export declare const safeCloneElement: (element: React.ReactElement, props?: Record<string, any>) => import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>>;
25
+ export declare const splitAriaProps: (props?: any) => readonly [Record<string, unknown>, Record<string, unknown>];
25
26
  export {};
@@ -1,25 +1,31 @@
1
- import { cloneElement as o } from "react";
2
- import { Breakpoint as m } from "../hooks/use-breakpoint.js";
3
- const y = (p, s, h) => {
4
- if (h === m.Small || h === m.Medium) {
5
- const i = [];
1
+ import { cloneElement as d } from "react";
2
+ import { Breakpoint as n } from "../hooks/use-breakpoint.js";
3
+ const r = (i, s, h) => {
4
+ if (h === n.Small || h === n.Medium) {
5
+ const f = [];
6
6
  if (s <= 3) {
7
- for (let d = 1; d <= s; d++)
8
- i.push(d);
9
- return i;
7
+ for (let o = 1; o <= s; o++)
8
+ f.push(o);
9
+ return f;
10
10
  }
11
- return i.push(1), p > 2 && i.push(-1), p > 1 && p < s && i.push(p), p < s - 1 && i.push(-2), s > 1 && i.push(s), i;
11
+ return f.push(1), i > 2 && f.push(-1), i > 1 && i < s && f.push(i), i < s - 1 && f.push(-2), s > 1 && f.push(s), f;
12
12
  }
13
- const f = [];
14
- p > 3 && f.push(1), p > 4 && f.push(-1);
15
- for (let i = p - 2; i <= p + 2; i++)
16
- i >= 1 && i <= s && f.push(i);
17
- return p < s - 3 && f.push(-2), p < s - 2 && f.push(s), f;
18
- }, x = (p, s = {}) => {
19
- const { __type: h, ...f } = p.props;
20
- return o(p, { ...f, ...s });
13
+ const p = [];
14
+ i > 3 && p.push(1), i > 4 && p.push(-1);
15
+ for (let f = i - 2; f <= i + 2; f++)
16
+ f >= 1 && f <= s && p.push(f);
17
+ return i < s - 3 && p.push(-2), i < s - 2 && p.push(s), p;
18
+ }, y = (i, s = {}) => {
19
+ const { __type: h, ...p } = i.props;
20
+ return d(i, { ...p, ...s });
21
+ }, l = (i = {}) => {
22
+ const s = {}, h = {};
23
+ for (const p in i)
24
+ p === "role" || p.startsWith("aria-") ? s[p] = i[p] : h[p] = i[p];
25
+ return [s, h];
21
26
  };
22
27
  export {
23
- y as getDisplayPages,
24
- x as safeCloneElement
28
+ r as getDisplayPages,
29
+ y as safeCloneElement,
30
+ l as splitAriaProps
25
31
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ogcio/design-system-react",
3
- "version": "1.17.0",
3
+ "version": "1.17.2",
4
4
  "description": "The GOV IE design system React components.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -52,7 +52,7 @@
52
52
  "react-dom": "19.0.0",
53
53
  "@ogcio/design-system-eslint-config": "1.2.6",
54
54
  "@ogcio/design-system-prettier-config": "1.0.6",
55
- "@ogcio/design-system-tailwind": "1.14.1",
55
+ "@ogcio/design-system-tailwind": "1.14.3",
56
56
  "@ogcio/theme-doete": "1.0.0",
57
57
  "@ogcio/theme-govie": "1.7.0"
58
58
  },