@ogcio/design-system-react 1.30.0 → 1.31.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 (70) hide show
  1. package/dist/atoms/DsButton.js +3 -2
  2. package/dist/atoms/InsetText.d.ts +14 -0
  3. package/dist/atoms/InsetText.js +17 -0
  4. package/dist/atoms/icons/Close.js +9 -8
  5. package/dist/atoms/icons/KeyboardArrowDown.js +6 -5
  6. package/dist/atoms/icons/KeyboardArrowUp.js +6 -5
  7. package/dist/atoms/icons/Visibility.js +15 -14
  8. package/dist/atoms/icons/VisibilityOff.js +9 -8
  9. package/dist/atoms/icons/logos/LogoBlack.d.ts +3 -0
  10. package/dist/atoms/icons/logos/LogoBlack.js +327 -0
  11. package/dist/atoms/icons/logos/LogoGoldGreen.d.ts +3 -0
  12. package/dist/atoms/icons/logos/LogoGoldGreen.js +327 -0
  13. package/dist/atoms/icons/logos/LogoGoldWhite.d.ts +3 -0
  14. package/dist/atoms/icons/logos/LogoGoldWhite.js +87 -0
  15. package/dist/atoms/icons/logos/LogoHarpBlack.d.ts +3 -0
  16. package/dist/atoms/icons/logos/LogoHarpBlack.js +68 -0
  17. package/dist/atoms/icons/logos/LogoHarpWhite.d.ts +3 -0
  18. package/dist/{assets/logos/LogoHarpBlack.js → atoms/icons/logos/LogoHarpWhite.js} +33 -31
  19. package/dist/atoms/icons/logos/LogoWhite.d.ts +3 -0
  20. package/dist/atoms/icons/logos/LogoWhite.js +327 -0
  21. package/dist/atoms/icons/logos/index.d.ts +6 -0
  22. package/dist/atoms/icons/logos/index.js +14 -0
  23. package/dist/atoms/icons/types.d.ts +5 -5
  24. package/dist/atoms/index.d.ts +1 -0
  25. package/dist/atoms/index.js +12 -10
  26. package/dist/blockquote/blockquote.d.ts +4 -1
  27. package/dist/blockquote/blockquote.js +18 -4
  28. package/dist/breadcrumbs/breadcrumbs.js +54 -33
  29. package/dist/button-group/button-group.js +31 -28
  30. package/dist/character-count/character-count.js +5 -5
  31. package/dist/chip/chip.js +41 -19
  32. package/dist/combo-box/combo-box.js +6 -13
  33. package/dist/cookie-banner/cookie-banner.js +28 -20
  34. package/dist/details/details.js +43 -23
  35. package/dist/drawer/drawer.js +35 -32
  36. package/dist/footer/footer.js +54 -46
  37. package/dist/header/header-legacy.js +8 -8
  38. package/dist/hooks/use-aria-hider.d.ts +1 -1
  39. package/dist/hooks/use-aria-hider.js +14 -13
  40. package/dist/hooks/use-focus-trap.d.ts +1 -1
  41. package/dist/hooks/use-focus-trap.js +179 -179
  42. package/dist/icons/index.d.ts +1 -0
  43. package/dist/icons/index.js +12 -0
  44. package/dist/index.d.ts +1 -0
  45. package/dist/index.js +144 -142
  46. package/dist/input-file/input-file.js +15 -12
  47. package/dist/logos/index.d.ts +1 -0
  48. package/dist/logos/index.js +14 -0
  49. package/dist/modal/modal.js +125 -128
  50. package/dist/popover/popover.js +67 -64
  51. package/dist/score-select/score-select.js +20 -20
  52. package/dist/select/select-next.js +45 -45
  53. package/dist/styles.css +1 -1
  54. package/dist/table/table-row.js +14 -7
  55. package/dist/tabs/tab-panel.js +6 -6
  56. package/dist/tabs/tabs.js +19 -19
  57. package/package.json +10 -10
  58. package/dist/assets/logos/LogoBlack.d.ts +0 -3
  59. package/dist/assets/logos/LogoBlack.js +0 -322
  60. package/dist/assets/logos/LogoGoldGreen.d.ts +0 -3
  61. package/dist/assets/logos/LogoGoldGreen.js +0 -322
  62. package/dist/assets/logos/LogoGoldWhite.d.ts +0 -3
  63. package/dist/assets/logos/LogoGoldWhite.js +0 -82
  64. package/dist/assets/logos/LogoHarpBlack.d.ts +0 -3
  65. package/dist/assets/logos/LogoHarpWhite.d.ts +0 -3
  66. package/dist/assets/logos/LogoHarpWhite.js +0 -60
  67. package/dist/assets/logos/LogoWhite.d.ts +0 -3
  68. package/dist/assets/logos/LogoWhite.js +0 -322
  69. package/dist/assets/logos/index.d.ts +0 -6
  70. package/dist/assets/logos/index.js +0 -14
@@ -1,102 +1,110 @@
1
1
  "use client";
2
- import { jsxs as i, jsx as t, Fragment as u } from "react/jsx-runtime";
3
- import { renderToStaticMarkup as c } from "react-dom/server";
4
- import { LogoGoldGreen as h } from "../assets/logos/LogoGoldGreen.js";
5
- import { LogoHarpWhite as g } from "../assets/logos/LogoHarpWhite.js";
6
- import { cn as v } from "../cn.js";
7
- import { Container as b } from "../container/container.js";
8
- import { translate as a } from "../i18n/utility.js";
9
- import p from "../primitives/anchor.js";
10
- import { SectionBreak as L } from "../section-break/section-break.js";
11
- function l({ logo: e }) {
12
- const n = `data:image/svg+xml;base64,${btoa(c(/* @__PURE__ */ t(g, {})))}`, s = `data:image/svg+xml;base64,${btoa(
13
- c(/* @__PURE__ */ t(h, {}))
2
+ import { jsxs as a, jsx as t, Fragment as u } from "react/jsx-runtime";
3
+ import { renderToStaticMarkup as l } from "react-dom/server";
4
+ import g from "../atoms/icons/logos/LogoGoldGreen.js";
5
+ import h from "../atoms/icons/logos/LogoHarpWhite.js";
6
+ import { cn as p } from "../cn.js";
7
+ import { Container as v } from "../container/container.js";
8
+ import { translate as i } from "../i18n/utility.js";
9
+ import b from "../primitives/anchor.js";
10
+ import { SectionBreak as x } from "../section-break/section-break.js";
11
+ function c({ logo: e }) {
12
+ const o = `data:image/svg+xml;base64,${btoa(l(/* @__PURE__ */ t(h, {})))}`, n = `data:image/svg+xml;base64,${btoa(
13
+ l(/* @__PURE__ */ t(g, {}))
14
14
  )}`;
15
- return /* @__PURE__ */ i("picture", { children: [
16
- /* @__PURE__ */ t("source", { srcSet: (e == null ? void 0 : e.imageLarge) || s }),
15
+ return /* @__PURE__ */ a("picture", { children: [
16
+ /* @__PURE__ */ t("source", { srcSet: (e == null ? void 0 : e.imageLarge) || n }),
17
17
  /* @__PURE__ */ t(
18
18
  "img",
19
19
  {
20
20
  className: "gi-h-16",
21
- src: (e == null ? void 0 : e.imageSmall) || n,
22
- alt: (e == null ? void 0 : e.alt) || a("logo.govieLogo", { defaultValue: "Gov.ie Logo" })
21
+ src: (e == null ? void 0 : e.imageSmall) || o,
22
+ alt: (e == null ? void 0 : e.alt) || i("logo.govieLogo", { defaultValue: "Gov.ie Logo" })
23
23
  }
24
24
  )
25
25
  ] });
26
26
  }
27
- function M({
27
+ function j({
28
28
  primarySlot: e,
29
- secondarySlot: o,
30
- utilitySlot: n,
29
+ secondarySlot: s,
30
+ utilitySlot: o,
31
31
  logo: r,
32
- className: s = "",
33
- dataTestid: d,
34
- ...m
32
+ className: n = "",
33
+ dataTestid: m,
34
+ ...d
35
35
  }) {
36
- const f = () => /* @__PURE__ */ i(u, { children: [
36
+ const f = () => /* @__PURE__ */ a(u, { children: [
37
37
  (r == null ? void 0 : r.href) && /* @__PURE__ */ t(
38
- p,
38
+ b,
39
39
  {
40
40
  href: r.href,
41
- "aria-label": a("footer.goToHomePage", {
41
+ "aria-label": i("footer.goToHomePage", {
42
42
  defaultValue: "Go to Home Page"
43
43
  }),
44
44
  "data-testid": "logo-link",
45
45
  external: r.external,
46
- children: l({ logo: r })
46
+ children: c({ logo: r })
47
47
  }
48
48
  ),
49
- !(r != null && r.href) && l({ logo: r })
49
+ !(r != null && r.href) && c({ logo: r })
50
50
  ] });
51
- return /* @__PURE__ */ i(
51
+ return /* @__PURE__ */ a(
52
52
  "footer",
53
53
  {
54
- className: v("gi-footer", s),
54
+ className: p("gi-bg-color-surface-system-neutral-layer1", n),
55
55
  "data-module": "gieds-footer",
56
56
  role: "contentinfo",
57
- "aria-label": a("footer.footer", { defaultValue: "Footer" }),
58
- "data-testid": d,
59
- ...m,
57
+ "aria-label": i("footer.footer", { defaultValue: "Footer" }),
58
+ "data-testid": m,
59
+ ...d,
60
60
  children: [
61
- /* @__PURE__ */ t("div", { className: "gi-footer-container", children: /* @__PURE__ */ i(b, { children: [
61
+ /* @__PURE__ */ t("div", { className: "gi-py-10", children: /* @__PURE__ */ a(v, { children: [
62
62
  e && /* @__PURE__ */ t(
63
63
  "div",
64
64
  {
65
- "aria-label": a("footer.primarySlot", {
65
+ "aria-label": i("footer.primarySlot", {
66
66
  defaultValue: "Footer Primary Slot"
67
67
  }),
68
68
  children: e
69
69
  }
70
70
  ),
71
- e && o && /* @__PURE__ */ t(
72
- L,
71
+ e && s && /* @__PURE__ */ t(
72
+ x,
73
73
  {
74
74
  color: "gi-border-color-border-system-neutral-subtle",
75
75
  size: "lg"
76
76
  }
77
77
  ),
78
- /* @__PURE__ */ i(
78
+ /* @__PURE__ */ a(
79
79
  "div",
80
80
  {
81
- className: "gi-footer-secondary-slot",
82
- "aria-label": a("footer.secondarySlot", {
81
+ className: "gi-flex gi-flex-row-reverse gi-flex-wrap-reverse gi-justify-between gi-justify-items-stretch",
82
+ "aria-label": i("footer.secondarySlot", {
83
83
  defaultValue: "Footer Secondary Slot"
84
84
  }),
85
85
  children: [
86
- /* @__PURE__ */ t("div", { className: "gi-footer-logo", children: f() }),
87
- o && /* @__PURE__ */ t("div", { className: "gi-footer-secondary-slot-content", children: o })
86
+ /* @__PURE__ */ t(
87
+ "div",
88
+ {
89
+ className: `
90
+ gi-w-fit gi-mt-8 md:gi-mt-0 lg:gi-ml-auto lg:gi-flex-none gi-rounded-sm
91
+ gi-focus-state-outline gi-focus-within-state-outline gi-focus-visible-state-outline`,
92
+ children: f()
93
+ }
94
+ ),
95
+ s && /* @__PURE__ */ t("div", { className: "gi-grow md:gi-max-w-[calc(100%_-_var(--gieds-space-80))]", children: s })
88
96
  ]
89
97
  }
90
98
  )
91
99
  ] }) }),
92
- n && /* @__PURE__ */ t(
100
+ o && /* @__PURE__ */ t(
93
101
  "div",
94
102
  {
95
- className: "gi-footer-utility",
96
- "aria-label": a("footer.utilityLinks", {
103
+ className: "gi-py-4 gi-px-8 gi-bg-color-surface-system-neutral-layer2",
104
+ "aria-label": i("footer.utilityLinks", {
97
105
  defaultValue: "Footer Utility Links"
98
106
  }),
99
- children: n
107
+ children: o
100
108
  }
101
109
  )
102
110
  ]
@@ -104,5 +112,5 @@ function M({
104
112
  );
105
113
  }
106
114
  export {
107
- M as Footer
115
+ j as Footer
108
116
  };
@@ -2,10 +2,10 @@
2
2
  import { jsxs as c, jsx as e } from "react/jsx-runtime";
3
3
  import { useEffect as $, useMemo as H, createElement as I } from "react";
4
4
  import { renderToStaticMarkup as v } from "react-dom/server";
5
- import { LogoWhite as x } from "../assets/logos/LogoWhite.js";
6
- import { LogoBlack as D } from "../assets/logos/LogoBlack.js";
7
- import { LogoHarpBlack as C } from "../assets/logos/LogoHarpBlack.js";
8
- import { LogoHarpWhite as A } from "../assets/logos/LogoHarpWhite.js";
5
+ import x from "../atoms/icons/logos/LogoBlack.js";
6
+ import D from "../atoms/icons/logos/LogoHarpBlack.js";
7
+ import C from "../atoms/icons/logos/LogoHarpWhite.js";
8
+ import A from "../atoms/icons/logos/LogoWhite.js";
9
9
  import { cn as k } from "../cn.js";
10
10
  import { Container as y } from "../container/container.js";
11
11
  import { translate as h } from "../i18n/utility.js";
@@ -18,12 +18,12 @@ import { headerVariants as O, headerMenuVariants as P, headerLogoVariants as U,
18
18
  function S({ logo: r, appearance: n = "default" }) {
19
19
  const t = {
20
20
  harp: {
21
- default: /* @__PURE__ */ e(A, {}),
22
- light: /* @__PURE__ */ e(C, {})
21
+ default: /* @__PURE__ */ e(C, {}),
22
+ light: /* @__PURE__ */ e(D, {})
23
23
  },
24
24
  withText: {
25
- default: /* @__PURE__ */ e(x, {}),
26
- light: /* @__PURE__ */ e(D, {})
25
+ default: /* @__PURE__ */ e(A, {}),
26
+ light: /* @__PURE__ */ e(x, {})
27
27
  }
28
28
  }, s = `data:image/svg+xml;base64,${btoa(v(t.harp[n]))}`, g = `data:image/svg+xml;base64,${btoa(
29
29
  v(t.withText[n])
@@ -1 +1 @@
1
- export declare const useAriaHider: (refNode: HTMLElement | null, shouldActivate: boolean) => void;
1
+ export declare const useAriaHider: (ref: React.RefObject<HTMLElement | null>, shouldActivate: boolean) => void;
@@ -1,20 +1,21 @@
1
- import { useLayoutEffect as d } from "react";
2
- const m = (e, n) => {
3
- d(() => {
4
- if (n !== !0 || e === null)
1
+ import { useLayoutEffect as s } from "react";
2
+ const f = (n, o) => {
3
+ s(() => {
4
+ var t, u;
5
+ if (o !== !0 || !n.current)
5
6
  return;
6
- const r = [...(e.ownerDocument ?? document).body.children].filter((t) => {
7
- const o = t === e, i = t.getAttribute("aria-hidden") === "true";
8
- return !o && !i;
7
+ const i = n.current, r = i.ownerDocument ?? document, c = [...r.body.children].filter((e) => {
8
+ const d = e === i, m = e.getAttribute("aria-hidden") === "true";
9
+ return !d && !m;
9
10
  });
10
- for (const t of r)
11
- t.setAttribute("aria-hidden", "true");
11
+ for (const e of c)
12
+ e.contains(r.activeElement) && ((u = (t = r.activeElement) == null ? void 0 : t.blur) == null || u.call(t)), e.setAttribute("aria-hidden", "true");
12
13
  return () => {
13
- for (const t of r)
14
- t.removeAttribute("aria-hidden");
14
+ for (const e of c)
15
+ e.removeAttribute("aria-hidden");
15
16
  };
16
- }, [n, e]);
17
+ }, [o, n.current]);
17
18
  };
18
19
  export {
19
- m as useAriaHider
20
+ f as useAriaHider
20
21
  };
@@ -1,2 +1,2 @@
1
1
  import { Options as FocusTrapOptions } from 'focus-trap';
2
- export declare const useFocusTrap: (element: HTMLElement | null, isActive: boolean, options?: FocusTrapOptions) => void;
2
+ export declare const useFocusTrap: (ref: React.RefObject<HTMLElement | null>, isActive: boolean, options?: FocusTrapOptions) => void;