@ogcio/design-system-react 1.29.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 (109) hide show
  1. package/README.md +11 -33
  2. package/dist/alert/variants.d.ts +78 -2
  3. package/dist/atoms/DsButton.d.ts +194 -0
  4. package/dist/atoms/DsButton.js +330 -0
  5. package/dist/atoms/InsetText.d.ts +14 -0
  6. package/dist/atoms/InsetText.js +17 -0
  7. package/dist/atoms/icons/Close.d.ts +3 -0
  8. package/dist/atoms/icons/Close.js +23 -0
  9. package/dist/atoms/icons/KeyboardArrowDown.d.ts +3 -0
  10. package/dist/atoms/icons/KeyboardArrowDown.js +23 -0
  11. package/dist/atoms/icons/KeyboardArrowUp.d.ts +3 -0
  12. package/dist/atoms/icons/KeyboardArrowUp.js +23 -0
  13. package/dist/atoms/icons/Visibility.d.ts +3 -0
  14. package/dist/atoms/icons/Visibility.js +23 -0
  15. package/dist/atoms/icons/VisibilityOff.d.ts +3 -0
  16. package/dist/atoms/icons/VisibilityOff.js +23 -0
  17. package/dist/atoms/icons/index.d.ts +6 -0
  18. package/dist/atoms/icons/index.js +12 -0
  19. package/dist/atoms/icons/logos/LogoBlack.d.ts +3 -0
  20. package/dist/atoms/icons/logos/LogoBlack.js +327 -0
  21. package/dist/atoms/icons/logos/LogoGoldGreen.d.ts +3 -0
  22. package/dist/atoms/icons/logos/LogoGoldGreen.js +327 -0
  23. package/dist/atoms/icons/logos/LogoGoldWhite.d.ts +3 -0
  24. package/dist/atoms/icons/logos/LogoGoldWhite.js +87 -0
  25. package/dist/atoms/icons/logos/LogoHarpBlack.d.ts +3 -0
  26. package/dist/atoms/icons/logos/LogoHarpBlack.js +68 -0
  27. package/dist/atoms/icons/logos/LogoHarpWhite.d.ts +3 -0
  28. package/dist/{assets/logos/LogoHarpBlack.js → atoms/icons/logos/LogoHarpWhite.js} +33 -31
  29. package/dist/atoms/icons/logos/LogoWhite.d.ts +3 -0
  30. package/dist/atoms/icons/logos/LogoWhite.js +327 -0
  31. package/dist/atoms/icons/logos/index.d.ts +6 -0
  32. package/dist/atoms/icons/logos/index.js +14 -0
  33. package/dist/atoms/icons/types.d.ts +10 -0
  34. package/dist/atoms/icons/types.js +1 -0
  35. package/dist/atoms/index.d.ts +3 -0
  36. package/dist/atoms/index.js +16 -0
  37. package/dist/autocomplete/autocomplete.js +131 -115
  38. package/dist/blockquote/blockquote.d.ts +4 -1
  39. package/dist/blockquote/blockquote.js +18 -4
  40. package/dist/breadcrumbs/breadcrumbs.js +54 -33
  41. package/dist/button-group/button-group.js +31 -28
  42. package/dist/character-count/character-count.js +5 -5
  43. package/dist/chip/chip.js +41 -19
  44. package/dist/combo-box/combo-box.js +6 -13
  45. package/dist/combo-box/dropdown-item.js +39 -40
  46. package/dist/cookie-banner/cookie-banner.js +28 -20
  47. package/dist/data-table/data-table-footer.js +57 -51
  48. package/dist/data-table/data-table-header.d.ts +7 -7
  49. package/dist/data-table/data-table-header.js +97 -110
  50. package/dist/data-table/data-table-selected-rows.d.ts +1 -0
  51. package/dist/data-table/data-table-selected-rows.js +15 -19
  52. package/dist/details/details.js +43 -23
  53. package/dist/drawer/drawer.js +35 -32
  54. package/dist/footer/footer.js +54 -46
  55. package/dist/forms/form-field/form-field.d.ts +2 -2
  56. package/dist/forms/form-field/form-field.js +40 -30
  57. package/dist/forms/form-field/types.d.ts +10 -3
  58. package/dist/header/components/header-slot.js +33 -32
  59. package/dist/header/header-legacy.js +8 -8
  60. package/dist/header/variants.d.ts +220 -20
  61. package/dist/heading/heading.d.ts +70 -2
  62. package/dist/hooks/use-aria-hider.d.ts +1 -1
  63. package/dist/hooks/use-aria-hider.js +14 -13
  64. package/dist/hooks/use-breakpoint.js +15 -12
  65. package/dist/hooks/use-focus-trap.d.ts +1 -1
  66. package/dist/hooks/use-focus-trap.js +179 -179
  67. package/dist/icon/icon.d.ts +10 -0
  68. package/dist/icon/icon.js +64 -52
  69. package/dist/icon/icons.d.ts +1 -1
  70. package/dist/icons/index.d.ts +1 -0
  71. package/dist/icons/index.js +12 -0
  72. package/dist/index.d.ts +1 -0
  73. package/dist/index.js +144 -142
  74. package/dist/input-file/input-file.js +15 -12
  75. package/dist/input-password/input-password.js +13 -12
  76. package/dist/input-text/input-text.js +18 -16
  77. package/dist/label/label.d.ts +43 -0
  78. package/dist/label/label.js +7 -6
  79. package/dist/logos/index.d.ts +1 -0
  80. package/dist/logos/index.js +14 -0
  81. package/dist/modal/modal.js +125 -127
  82. package/dist/popover/popover.js +67 -64
  83. package/dist/score-select/score-select.js +20 -20
  84. package/dist/select/select-next.js +45 -45
  85. package/dist/spinner/spinner.d.ts +30 -2
  86. package/dist/styles.css +12 -2
  87. package/dist/table/table-row.js +14 -7
  88. package/dist/table/table.d.ts +22 -2
  89. package/dist/tabs/tab-item.d.ts +2 -2
  90. package/dist/tabs/tab-panel.js +6 -6
  91. package/dist/tabs/tabs.js +19 -19
  92. package/dist/text-input/text-input.d.ts +1 -1
  93. package/dist/textarea/textarea.js +27 -28
  94. package/dist/toast/ds-toast.d.ts +78 -2
  95. package/fonts.css +10 -0
  96. package/package.json +17 -12
  97. package/dist/assets/logos/LogoBlack.d.ts +0 -3
  98. package/dist/assets/logos/LogoBlack.js +0 -322
  99. package/dist/assets/logos/LogoGoldGreen.d.ts +0 -3
  100. package/dist/assets/logos/LogoGoldGreen.js +0 -322
  101. package/dist/assets/logos/LogoGoldWhite.d.ts +0 -3
  102. package/dist/assets/logos/LogoGoldWhite.js +0 -82
  103. package/dist/assets/logos/LogoHarpBlack.d.ts +0 -3
  104. package/dist/assets/logos/LogoHarpWhite.d.ts +0 -3
  105. package/dist/assets/logos/LogoHarpWhite.js +0 -60
  106. package/dist/assets/logos/LogoWhite.d.ts +0 -3
  107. package/dist/assets/logos/LogoWhite.js +0 -322
  108. package/dist/assets/logos/index.d.ts +0 -6
  109. package/dist/assets/logos/index.js +0 -14
@@ -1,34 +1,35 @@
1
1
  "use client";
2
- import { jsx as e } from "react/jsx-runtime";
3
- import { forwardRef as r, useState as c } from "react";
4
- import { InputText as l } from "../input-text/input-text.js";
5
- const u = r(
2
+ import { jsx as p } from "react/jsx-runtime";
3
+ import { forwardRef as r, useState as a } from "react";
4
+ import { InputText as c } from "../input-text/input-text.js";
5
+ const l = r(
6
6
  (o, s) => {
7
- const [t, n] = c({
7
+ const [t, e] = a({
8
8
  icon: "visibility",
9
9
  type: "password"
10
- }), p = () => {
10
+ }), n = () => {
11
11
  const i = t.type === "text";
12
- n({
12
+ e({
13
13
  type: i ? "password" : "text",
14
14
  icon: i ? "visibility" : "visibility_off"
15
15
  });
16
16
  };
17
- return /* @__PURE__ */ e(
18
- l,
17
+ return /* @__PURE__ */ p(
18
+ c,
19
19
  {
20
20
  ...o,
21
21
  type: t.type,
22
22
  inputActionButton: {
23
23
  icon: t.icon,
24
- onClick: p
24
+ onClick: n,
25
+ ariaLabel: t.type === "text" ? "show" : "hide"
25
26
  },
26
27
  ref: s
27
28
  }
28
29
  );
29
30
  }
30
31
  );
31
- u.displayName = "InputPassword";
32
+ l.displayName = "InputPassword";
32
33
  export {
33
- u as InputPassword
34
+ l as InputPassword
34
35
  };
@@ -24,7 +24,9 @@ const H = d(
24
24
  __origin: "clear_button"
25
25
  };
26
26
  a && a(f);
27
- }
27
+ },
28
+ ariaLabel: "Clear input"
29
+ // TODO I18N: translation
28
30
  }
29
31
  }
30
32
  );
@@ -35,18 +37,18 @@ const H = d(
35
37
  inputActionButton: e,
36
38
  inputActionPosition: r = "beforeSuffix",
37
39
  suffix: t,
38
- halfFluid: l = !1,
40
+ halfFluid: s = !1,
39
41
  className: f,
40
42
  type: g = "text",
41
43
  iconStart: c,
42
44
  iconStartClassName: v,
43
45
  onIconStartClick: N,
44
- iconEnd: s,
46
+ iconEnd: l,
45
47
  iconEndClassName: T,
46
48
  onIconEndClick: C,
47
49
  disabled: i,
48
- inputClassName: w,
49
- iconEndRef: b,
50
+ inputClassName: b,
51
+ iconEndRef: w,
50
52
  containerProps: k,
51
53
  ...o
52
54
  }, z) => {
@@ -55,7 +57,7 @@ const H = d(
55
57
  {
56
58
  className: "gi-input-text-action-before-suffix",
57
59
  "data-suffix": !!t,
58
- "data-has-icon-end": !!s,
60
+ "data-has-icon-end": !!l,
59
61
  children: /* @__PURE__ */ n(p, { ...e, disabled: i })
60
62
  }
61
63
  ) : null, [e]);
@@ -70,7 +72,7 @@ const H = d(
70
72
  "div",
71
73
  {
72
74
  className: u("gi-input-text-inner", {
73
- "gi-input-half-width": l
75
+ "gi-input-half-width": s
74
76
  }),
75
77
  children: [
76
78
  c && /* @__PURE__ */ n(
@@ -94,26 +96,26 @@ const H = d(
94
96
  {
95
97
  type: g,
96
98
  "data-icon-start": !!c,
97
- "data-icon-end": !!s,
99
+ "data-icon-end": !!l,
98
100
  "data-end-element": !!e,
99
101
  "data-prefix": !!a,
100
102
  "data-suffix": !!t,
101
103
  "data-testid": o.dataTestId,
102
- className: u("gi-input-text", w),
104
+ className: u("gi-input-text", b),
103
105
  ref: z,
104
106
  disabled: i,
105
107
  ...o
106
108
  }
107
109
  ),
108
- s && /* @__PURE__ */ n(
110
+ l && /* @__PURE__ */ n(
109
111
  "div",
110
112
  {
111
113
  className: u("gi-input-text-icon-end", T),
112
114
  "data-end-element": !!e && r === "afterSuffix",
113
115
  "data-suffix": !!t,
114
116
  onClick: C,
115
- ref: b,
116
- children: typeof s == "string" ? /* @__PURE__ */ n(x, { icon: s, size: "md", disabled: i }) : s
117
+ ref: w,
118
+ children: typeof l == "string" ? /* @__PURE__ */ n(x, { icon: l, size: "md", disabled: i }) : l
117
119
  }
118
120
  ),
119
121
  R
@@ -131,11 +133,11 @@ const H = d(
131
133
  ariaLabel: e,
132
134
  icon: r,
133
135
  dataTestId: t,
134
- ...l
136
+ ...s
135
137
  }) => /* @__PURE__ */ n(
136
138
  O,
137
139
  {
138
- ...l,
140
+ ...s,
139
141
  icon: {
140
142
  icon: r
141
143
  },
@@ -150,7 +152,7 @@ const H = d(
150
152
  ({ type: a = "text", clearButtonEnabled: e, ...r }, t) => e || a === "search" ? /* @__PURE__ */ n(H, { ref: t, type: a, ...r }) : /* @__PURE__ */ n(h, { ref: t, type: a, ...r })
151
153
  );
152
154
  I.displayName = "InputText";
153
- const F = d(({ type: a = "text", error: e, ...r }, t) => /* @__PURE__ */ n(
155
+ const D = d(({ type: a = "text", error: e, ...r }, t) => /* @__PURE__ */ n(
154
156
  I,
155
157
  {
156
158
  ...r,
@@ -166,5 +168,5 @@ const F = d(({ type: a = "text", error: e, ...r }, t) => /* @__PURE__ */ n(
166
168
  export {
167
169
  p as InputActionButton,
168
170
  I as InputText,
169
- F as InputTextTableCell
171
+ D as InputTextTableCell
170
172
  };
@@ -3,6 +3,49 @@ export declare const LabelSize: {
3
3
  readonly Medium: "md";
4
4
  readonly Large: "lg";
5
5
  };
6
+ export declare const styles: import('tailwind-variants').TVReturnType<{
7
+ size: {
8
+ sm: string;
9
+ md: string;
10
+ lg: string;
11
+ };
12
+ }, undefined, "gi-label", import('tailwind-variants/dist/config.js').TVConfig<{
13
+ size: {
14
+ sm: string;
15
+ md: string;
16
+ lg: string;
17
+ };
18
+ }, {
19
+ size: {
20
+ sm: string;
21
+ md: string;
22
+ lg: string;
23
+ };
24
+ }>, {
25
+ size: {
26
+ sm: string;
27
+ md: string;
28
+ lg: string;
29
+ };
30
+ }, undefined, import('tailwind-variants').TVReturnType<{
31
+ size: {
32
+ sm: string;
33
+ md: string;
34
+ lg: string;
35
+ };
36
+ }, undefined, "gi-label", import('tailwind-variants/dist/config.js').TVConfig<{
37
+ size: {
38
+ sm: string;
39
+ md: string;
40
+ lg: string;
41
+ };
42
+ }, {
43
+ size: {
44
+ sm: string;
45
+ md: string;
46
+ lg: string;
47
+ };
48
+ }>, unknown, unknown, undefined>>;
6
49
  export declare const Label: import('react').ForwardRefExoticComponent<import('react').LabelHTMLAttributes<HTMLLabelElement> & {
7
50
  text?: string | React.ReactElement;
8
51
  size?: import('./types.js').LabelSizeType;
@@ -1,4 +1,4 @@
1
- import { jsx as s } from "react/jsx-runtime";
1
+ import { jsx as i } from "react/jsx-runtime";
2
2
  import { forwardRef as r } from "react";
3
3
  import { c as o } from "../index-CB-zPpNk.js";
4
4
  const d = {
@@ -17,11 +17,12 @@ const d = {
17
17
  defaultVariants: {
18
18
  size: "md"
19
19
  }
20
- }), b = r(
21
- ({ text: e, size: a = d.Medium, className: l, children: m, ...t }, i) => /* @__PURE__ */ s("label", { className: g({ size: a, className: l }), ref: i, ...t, children: m ?? e })
20
+ }), c = r(
21
+ ({ text: e, size: a = d.Medium, className: m, children: s, ...t }, l) => /* @__PURE__ */ i("label", { className: g({ size: a, className: m }), ref: l, ...t, children: s ?? e })
22
22
  );
23
- b.displayName = "Label";
23
+ c.displayName = "Label";
24
24
  export {
25
- b as Label,
26
- d as LabelSize
25
+ c as Label,
26
+ d as LabelSize,
27
+ g as styles
27
28
  };
@@ -0,0 +1 @@
1
+ export { LogoBlack, LogoGoldGreen, LogoGoldWhite, LogoHarpBlack, LogoWhite, LogoHarpWhite, } from '../atoms/icons/logos';
@@ -0,0 +1,14 @@
1
+ import { default as a } from "../atoms/icons/logos/LogoBlack.js";
2
+ import { default as t } from "../atoms/icons/logos/LogoGoldGreen.js";
3
+ import { default as l } from "../atoms/icons/logos/LogoGoldWhite.js";
4
+ import { default as p } from "../atoms/icons/logos/LogoHarpBlack.js";
5
+ import { default as m } from "../atoms/icons/logos/LogoHarpWhite.js";
6
+ import { default as u } from "../atoms/icons/logos/LogoWhite.js";
7
+ export {
8
+ a as LogoBlack,
9
+ t as LogoGoldGreen,
10
+ l as LogoGoldWhite,
11
+ p as LogoHarpBlack,
12
+ m as LogoHarpWhite,
13
+ u as LogoWhite
14
+ };
@@ -1,129 +1,130 @@
1
1
  "use client";
2
- import { jsx as i, jsxs as y, Fragment as j } from "react/jsx-runtime";
3
- import { isValidElement as U, cloneElement as N, useState as A, useRef as W, useMemo as _, Children as z, useId as G, useEffect as C } from "react";
4
- import { createPortal as J } from "react-dom";
2
+ import { jsx as l, jsxs as y, Fragment as j } from "react/jsx-runtime";
3
+ import { isValidElement as K, cloneElement as T, useState as A, useRef as U, useMemo as W, Children as _, useId as z, useEffect as C } from "react";
4
+ import { createPortal as G } from "react-dom";
5
5
  import { Button as E } from "../button/button.js";
6
6
  import { cn as u } from "../cn.js";
7
- import { Heading as Q } from "../heading/heading.js";
8
- import { useAriaHider as X } from "../hooks/use-aria-hider.js";
9
- import { useFocusTrap as Y } from "../hooks/use-focus-trap.js";
10
- import { Icon as Z } from "../icon/icon.js";
11
- import { IconButton as O } from "../icon-button/icon-button.js";
12
- import { splitAriaProps as R, isSpecialComponent as tt, getSpecialComponentType as et } from "../utils/utilities.js";
7
+ import { Heading as J } from "../heading/heading.js";
8
+ import { useAriaHider as Q } from "../hooks/use-aria-hider.js";
9
+ import { useFocusTrap as X } from "../hooks/use-focus-trap.js";
10
+ import { Icon as Y } from "../icon/icon.js";
11
+ import { IconButton as Z } from "../icon-button/icon-button.js";
12
+ import { splitAriaProps as O, isSpecialComponent as ee, getSpecialComponentType as te } from "../utils/utilities.js";
13
13
  const I = {
14
14
  flat: 0,
15
15
  secondary: 1,
16
16
  primary: 2
17
- }, ot = ({
17
+ }, oe = ({
18
18
  label: e,
19
- size: t = "small",
20
- ...o
19
+ size: o = "small",
20
+ ...t
21
21
  }) => {
22
22
  let n = "sm";
23
- return (t === "large" || t === "medium") && (n = "md"), e ? /* @__PURE__ */ i(
23
+ return (o === "large" || o === "medium") && (n = "md"), e ? /* @__PURE__ */ l(
24
24
  E,
25
25
  {
26
- onClick: o.onClick,
26
+ onClick: t.onClick,
27
27
  variant: "flat",
28
- size: t,
28
+ size: o,
29
29
  appearance: "dark",
30
30
  className: "gi-modal-icon",
31
31
  "aria-label": e,
32
- ...o,
32
+ ...t,
33
33
  children: /* @__PURE__ */ y(j, { children: [
34
34
  e,
35
- /* @__PURE__ */ i(Z, { icon: "close", size: n })
35
+ /* @__PURE__ */ l(Y, { icon: "close", size: n })
36
36
  ] })
37
37
  }
38
- ) : /* @__PURE__ */ i(
39
- O,
38
+ ) : /* @__PURE__ */ l(
39
+ Z,
40
40
  {
41
41
  className: "gi-modal-icon",
42
42
  icon: { icon: "close" },
43
43
  "aria-label": "Close modal",
44
- onClick: o.onClick,
44
+ onClick: t.onClick,
45
45
  variant: "flat",
46
- size: t,
46
+ size: o,
47
47
  appearance: "dark",
48
- ...o
48
+ dataTestid: "modal-close-button",
49
+ ...t
49
50
  }
50
51
  );
51
- }, rt = ({
52
+ }, ae = ({
52
53
  closeButtonLabel: e,
53
- modalTitle: t,
54
- closeOnClick: o,
54
+ modalTitle: o,
55
+ closeOnClick: t,
55
56
  onClose: n,
56
- closeButtonSize: r
57
+ closeButtonSize: a
57
58
  }) => /* @__PURE__ */ y("div", { className: "gi-py-2 xs:gi-py-4", children: [
58
- t,
59
- o && /* @__PURE__ */ i(
60
- ot,
59
+ o,
60
+ t && /* @__PURE__ */ l(
61
+ oe,
61
62
  {
62
63
  onClick: n,
63
64
  label: e,
64
- size: r
65
+ size: a
65
66
  }
66
67
  )
67
- ] }), at = ({
68
+ ] }), re = ({
68
69
  position: e = "center",
69
- size: t = "lg",
70
- closeOnClick: o = !0,
70
+ size: o = "lg",
71
+ closeOnClick: t = !0,
71
72
  closeOnOverlayClick: n = !0,
72
- isOpen: r,
73
- onClose: s,
73
+ isOpen: a,
74
+ onClose: d,
74
75
  closeButtonLabel: h,
75
- className: d,
76
- children: g,
77
- closeButtonSize: a,
78
- closeOnEscape: l,
76
+ className: s,
77
+ children: f,
78
+ closeButtonSize: r,
79
+ closeOnEscape: i,
79
80
  dataTestId: c,
80
81
  ...v
81
82
  }) => {
82
- var k;
83
- const M = W(null);
84
- X(M.current, r);
85
- const [D, S] = _(
86
- () => R(v),
83
+ var w;
84
+ const M = U(null);
85
+ Q(M, a);
86
+ const [D, R] = W(
87
+ () => O(v),
87
88
  [v]
88
- ), F = z.toArray(g), T = (m) => F.find(
89
- (p) => et(p) === m
90
- ), f = T("ModalTitle"), b = T("ModalFooter") || T("DrawerFooter"), L = G(), H = ((k = f == null ? void 0 : f.props) == null ? void 0 : k.id) || `gi-modal-title-${L}`, $ = f ? N(f, {
91
- as: t === "sm" ? "h5" : "h4",
92
- id: H
93
- }) : null, V = b ? N(b, {
94
- dataModalSize: t
95
- }) : null, q = F.filter(
96
- (m) => !tt(m, ["ModalTitle", "ModalFooter", "DrawerFooter"])
89
+ ), F = _.toArray(f), N = (m) => F.find(
90
+ (p) => te(p) === m
91
+ ), g = N("ModalTitle"), b = N("ModalFooter") || N("DrawerFooter"), S = z(), L = ((w = g == null ? void 0 : g.props) == null ? void 0 : w.id) || `gi-modal-title-${S}`, H = g ? T(g, {
92
+ as: o === "sm" ? "h5" : "h4",
93
+ id: L
94
+ }) : null, $ = b ? T(b, {
95
+ dataModalSize: o
96
+ }) : null, V = F.filter(
97
+ (m) => !ee(m, ["ModalTitle", "ModalFooter", "DrawerFooter"])
97
98
  );
98
99
  C(() => {
99
- if (!r || !l)
100
+ if (!a || !i)
100
101
  return;
101
102
  const m = (p) => {
102
- p.key === "Escape" && (p.stopPropagation(), s());
103
+ p.key === "Escape" && (p.stopPropagation(), d());
103
104
  };
104
105
  return document.addEventListener("keydown", m), () => {
105
106
  document.removeEventListener("keydown", m);
106
107
  };
107
- }, [r, l, s]), C(() => {
108
- if (!r || !o || !n)
108
+ }, [a, i, d]), C(() => {
109
+ if (!a || !t || !n)
109
110
  return;
110
111
  const m = (p) => {
111
112
  var B;
112
- const w = (B = M.current) == null ? void 0 : B.querySelector(
113
+ const k = (B = M.current) == null ? void 0 : B.querySelector(
113
114
  ".gi-modal-container-control"
114
115
  );
115
- w && (w.contains(p.target) || s());
116
+ k && (k.contains(p.target) || d());
116
117
  };
117
118
  return document.addEventListener("pointerdown", m, !0), () => document.removeEventListener("pointerdown", m, !0);
118
- }, [r, o, n, s]);
119
- const K = /* @__PURE__ */ i(
119
+ }, [a, t, n, d]);
120
+ const q = /* @__PURE__ */ l(
120
121
  "div",
121
122
  {
122
- ...S,
123
+ ...R,
123
124
  ref: M,
124
125
  className: u("gi-modal", {
125
- "gi-modal-open": r,
126
- "gi-modal-close": !r
126
+ "gi-modal-open": a,
127
+ "gi-modal-close": !a
127
128
  }),
128
129
  "data-testid": c || "modal",
129
130
  tabIndex: -1,
@@ -135,98 +136,98 @@ const I = {
135
136
  "aria-modal": "true",
136
137
  "aria-label": "dialog",
137
138
  ...D,
138
- "data-size": t,
139
+ "data-size": o,
139
140
  "data-position": e,
140
141
  className: u(
141
142
  "gi-modal-container-control",
142
143
  {
143
- "gi-modal-container": !d,
144
+ "gi-modal-container": !s,
144
145
  "gi-modal-container-center": e === "center",
145
146
  "gi-modal-container-left": e === "left",
146
147
  "gi-modal-container-right": e === "right",
147
148
  "gi-modal-container-bottom": e === "bottom"
148
149
  },
149
- d
150
+ s
150
151
  ),
151
152
  children: [
152
- /* @__PURE__ */ i(
153
- rt,
153
+ /* @__PURE__ */ l(
154
+ ae,
154
155
  {
155
156
  closeButtonLabel: h,
156
- modalTitle: $,
157
- closeOnClick: o,
158
- onClose: s,
159
- closeButtonSize: a
157
+ modalTitle: H,
158
+ closeOnClick: t,
159
+ onClose: d,
160
+ closeButtonSize: r
160
161
  }
161
162
  ),
162
163
  /* @__PURE__ */ y("div", { className: u({ "gi-pb-6": !b }), children: [
163
- q,
164
- V
164
+ V,
165
+ $
165
166
  ] })
166
167
  ]
167
168
  }
168
169
  )
169
170
  }
170
171
  );
171
- return /* @__PURE__ */ i(nt, { modalRef: M, isOpen: r, children: K });
172
- }, P = ({ children: e, as: t = "h4", ...o }) => /* @__PURE__ */ i("div", { className: "gi-flex-1", id: o.id, "aria-label": e == null ? void 0 : e.toString(), children: /* @__PURE__ */ i(Q, { as: t, ...o, children: e }) });
172
+ return /* @__PURE__ */ l(ne, { modalRef: M, isOpen: a, children: q });
173
+ }, P = ({ children: e, as: o = "h4", ...t }) => /* @__PURE__ */ l("div", { className: "gi-flex-1", id: t.id, "aria-label": e == null ? void 0 : e.toString(), children: /* @__PURE__ */ l(J, { as: o, ...t, children: e }) });
173
174
  Object.defineProperty(P, "componentType", {
174
175
  value: "ModalTitle",
175
176
  writable: !1,
176
177
  enumerable: !1
177
178
  });
178
179
  P.displayName = "ModalTitle";
179
- const ht = ({
180
+ const he = ({
180
181
  children: e,
181
- className: t,
182
- includeModalClass: o = !0
183
- }) => /* @__PURE__ */ i(
182
+ className: o,
183
+ includeModalClass: t = !0
184
+ }) => /* @__PURE__ */ l(
184
185
  "div",
185
186
  {
186
187
  "aria-label": "Modal content",
187
188
  role: "document",
188
189
  tabIndex: 0,
189
- className: u(o && "gi-modal-body", t),
190
+ className: u(t && "gi-modal-body", o),
190
191
  children: e
191
192
  }
192
193
  ), x = ({
193
194
  className: e,
194
- children: t,
195
- orientation: o,
195
+ children: o,
196
+ orientation: t,
196
197
  dataModalSize: n,
197
- stacked: r
198
+ stacked: a
198
199
  }) => {
199
- const d = (Array.isArray(t) ? t : [t]).filter((a) => {
200
- var l, c;
201
- return U(a) && (a.type === E || ((l = a.type) == null ? void 0 : l.displayName) === "Button" || ((c = a.props) == null ? void 0 : c["data-button"]));
202
- }).sort((a, l) => {
203
- const c = a.props.variant ?? "primary", v = l.props.variant ?? "primary";
200
+ const s = (Array.isArray(o) ? o : [o]).filter((r) => {
201
+ var i, c;
202
+ return K(r) && (r.type === E || ((i = r.type) == null ? void 0 : i.displayName) === "Button" || ((c = r.props) == null ? void 0 : c["data-button"]));
203
+ }).sort((r, i) => {
204
+ const c = r.props.variant ?? "primary", v = i.props.variant ?? "primary";
204
205
  return (I[c] || 0) - (I[v] || 0);
205
- }), g = u({
206
- "gi-justify-center sm:gi-justify-start": !o && n !== "sm" && !r,
207
- "gi-justify-center": o === "vertical" || n === "sm" || r,
208
- "gi-justify-start": o === "horizontal"
206
+ }), f = u({
207
+ "gi-justify-center sm:gi-justify-start": !t && n !== "sm" && !a,
208
+ "gi-justify-center": t === "vertical" || n === "sm" || a,
209
+ "gi-justify-start": t === "horizontal"
209
210
  });
210
- return /* @__PURE__ */ i(
211
+ return /* @__PURE__ */ l(
211
212
  "div",
212
213
  {
213
214
  className: u(e, {
214
- "gi-pt-6": d.length === 0,
215
- "gi-modal-footer": d.length,
216
- "gi-modal-footer-stacked": r
215
+ "gi-pt-6": s.length === 0,
216
+ "gi-modal-footer": s.length,
217
+ "gi-modal-footer-stacked": a
217
218
  }),
218
- children: d.length > 0 && /* @__PURE__ */ i(
219
+ children: s.length > 0 && /* @__PURE__ */ l(
219
220
  "div",
220
221
  {
221
- "data-orientation": o || "unset",
222
+ "data-orientation": t || "unset",
222
223
  "data-modal-size": n,
223
- children: d.map(
224
- (a, l) => {
224
+ children: s.map(
225
+ (r, i) => {
225
226
  var c;
226
- return N(a, {
227
- key: a.key || a.props.id || a.props.dataTestid || `modal-footer-button-${l}`,
228
- id: a.props.id || `modal-footer-button-${l}`,
229
- className: u((c = a == null ? void 0 : a.props) == null ? void 0 : c.className, g)
227
+ return T(r, {
228
+ key: r.key || r.props.id || r.props.dataTestid || `modal-footer-button-${i}`,
229
+ id: r.props.id || `modal-footer-button-${i}`,
230
+ className: u((c = r == null ? void 0 : r.props) == null ? void 0 : c.className, f)
230
231
  });
231
232
  }
232
233
  ) || null
@@ -241,37 +242,34 @@ Object.defineProperty(x, "componentType", {
241
242
  enumerable: !1
242
243
  });
243
244
  x.displayName = "ModalFooter";
244
- const nt = ({
245
+ const ne = ({
245
246
  children: e,
246
- modalRef: t,
247
- isOpen: o
247
+ modalRef: o,
248
+ isOpen: t
248
249
  }) => {
249
- const [n, r] = A(!1);
250
+ const [n, a] = A(!1);
250
251
  return C(() => {
251
- r(!0);
252
- }, []), Y(t == null ? void 0 : t.current, o && n, {
253
- initialFocus: (t == null ? void 0 : t.current) ?? !0,
254
- fallbackFocus: () => t == null ? void 0 : t.current
255
- }), n ? J(e, document.body) : null;
256
- }, vt = ({
252
+ a(!0);
253
+ }, []), X(o, t && n), n ? G(e, document.body) : null;
254
+ }, ve = ({
257
255
  children: e,
258
- triggerButton: t,
259
- startsOpen: o,
256
+ triggerButton: o,
257
+ startsOpen: t,
260
258
  ...n
261
259
  }) => {
262
- const [r, s] = A(!!o), h = () => s(!0), d = () => s(!1), g = N(t, {
260
+ const [a, d] = A(!!t), h = () => d(!0), s = () => d(!1), f = T(o, {
263
261
  "data-testid": "modal-trigger-button-container",
264
262
  "aria-haspopup": "dialog",
265
263
  onClick: h
266
264
  });
267
265
  return /* @__PURE__ */ y(j, { children: [
268
- g,
269
- /* @__PURE__ */ i(
270
- at,
266
+ f,
267
+ /* @__PURE__ */ l(
268
+ re,
271
269
  {
272
- onClose: d,
270
+ onClose: s,
273
271
  position: "center",
274
- isOpen: r,
272
+ isOpen: a,
275
273
  ...n,
276
274
  children: e
277
275
  }
@@ -279,9 +277,9 @@ const nt = ({
279
277
  ] });
280
278
  };
281
279
  export {
282
- vt as Modal,
283
- ht as ModalBody,
280
+ ve as Modal,
281
+ he as ModalBody,
284
282
  x as ModalFooter,
285
283
  P as ModalTitle,
286
- at as ModalWrapper
284
+ re as ModalWrapper
287
285
  };