@ogcio/design-system-react 1.17.0 → 1.17.1

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.
@@ -33,7 +33,6 @@ const I = h({
33
33
  onKeyDown: (x) => {
34
34
  x.key === "Enter" && !e && a(!o);
35
35
  },
36
- "aria-expanded": o,
37
36
  tabIndex: 0,
38
37
  className: "gi-accordion",
39
38
  children: /* @__PURE__ */ d(
@@ -82,8 +82,9 @@ type AlertProps = {
82
82
  children?: ReactNode;
83
83
  dismissible?: boolean;
84
84
  dataTestid?: string;
85
+ className?: string;
85
86
  onClose?: (event: React.MouseEvent<HTMLButtonElement>) => void;
86
87
  };
87
- declare function Alert({ title, children, variant, dismissible, onClose, dataTestid, }: AlertProps): import("react/jsx-runtime").JSX.Element | null;
88
+ declare function Alert({ title, children, variant, dismissible, onClose, dataTestid, className, }: AlertProps): import("react/jsx-runtime").JSX.Element | null;
88
89
  export { Alert, alertVariants };
89
90
  export type { AlertProps };
@@ -1,12 +1,12 @@
1
1
  "use client";
2
2
  import { jsxs as n, jsx as r } from "react/jsx-runtime";
3
- import { useState as D } from "react";
4
- import { c as h } from "../index-CB-zPpNk.js";
5
- import { cn as v } from "../cn.js";
6
- import { translate as k } from "../i18n/utility.js";
7
- import { Icon as w } from "../icon/icon.js";
8
- import { IconButton as N } from "../icon-button/icon-button.js";
9
- const V = h({
3
+ import { useState as h } from "react";
4
+ import { c as v } from "../index-CB-zPpNk.js";
5
+ import { cn as k } from "../cn.js";
6
+ import { translate as w } from "../i18n/utility.js";
7
+ import { Icon as N } from "../icon/icon.js";
8
+ import { IconButton as V } from "../icon-button/icon-button.js";
9
+ const x = v({
10
10
  slots: {
11
11
  base: "gi-alert-base",
12
12
  baseDismissible: "gi-alert-base-dismissible",
@@ -30,16 +30,16 @@ const V = h({
30
30
  },
31
31
  warning: {
32
32
  base: "gi-alert-warning",
33
- baseDismissible: "gi-alert-success"
33
+ baseDismissible: "gi-alert-warning"
34
34
  }
35
35
  }
36
36
  },
37
37
  defaultVariants: {
38
38
  variant: "info"
39
39
  }
40
- }), x = ({ variant: e }) => {
40
+ }), I = ({ variant: i }) => {
41
41
  let s;
42
- switch (e) {
42
+ switch (i) {
43
43
  case "warning": {
44
44
  s = "warning";
45
45
  break;
@@ -57,50 +57,51 @@ const V = h({
57
57
  }
58
58
  return s;
59
59
  };
60
- function _({
61
- title: e,
60
+ function q({
61
+ title: i,
62
62
  children: s,
63
- variant: i = "info",
63
+ variant: a = "info",
64
64
  dismissible: t,
65
- onClose: a,
66
- dataTestid: l
65
+ onClose: e,
66
+ dataTestid: l,
67
+ className: c
67
68
  }) {
68
- const [c, o] = D(!1), { base: m, heading: d, container: b, dismiss: g, baseDismissible: f } = V({
69
- variant: i
70
- }), u = t ? f : m;
71
- return c ? null : /* @__PURE__ */ n(
69
+ const [o, m] = h(!1), { base: d, heading: g, container: b, dismiss: f, baseDismissible: u } = x({
70
+ variant: a
71
+ }), p = t ? u : d;
72
+ return o ? null : /* @__PURE__ */ n(
72
73
  "div",
73
74
  {
74
- className: v(u(), "gi-not-prose"),
75
+ className: k(p(), c, "gi-not-prose"),
75
76
  "data-testid": l,
76
77
  role: "alert",
77
78
  "aria-live": "assertive",
78
79
  children: [
79
80
  /* @__PURE__ */ r(
80
- w,
81
+ N,
81
82
  {
82
- icon: x({ variant: i }),
83
+ icon: I({ variant: a }),
83
84
  ariaHidden: !0,
84
85
  className: "gi-alert-icon",
85
- "data-variant": i
86
+ "data-variant": a
86
87
  }
87
88
  ),
88
89
  /* @__PURE__ */ n("div", { className: b(), children: [
89
- /* @__PURE__ */ r("p", { className: d(), children: e }),
90
+ /* @__PURE__ */ r("p", { className: g(), children: i }),
90
91
  s
91
92
  ] }),
92
93
  t && /* @__PURE__ */ r(
93
- N,
94
+ V,
94
95
  {
95
- onClick: (p) => {
96
- o(!0), a == null || a(p);
96
+ onClick: (D) => {
97
+ m(!0), e == null || e(D);
97
98
  },
98
- className: g(),
99
+ className: f(),
99
100
  size: "small",
100
101
  appearance: "dark",
101
102
  variant: "flat",
102
103
  icon: { icon: "close" },
103
- "aria-label": k("alert.dismissAlert", {
104
+ "aria-label": w("alert.dismissAlert", {
104
105
  defaultValue: "Dismiss alert"
105
106
  })
106
107
  }
@@ -110,6 +111,6 @@ function _({
110
111
  );
111
112
  }
112
113
  export {
113
- _ as Alert,
114
- V as alertVariants
114
+ q as Alert,
115
+ x as alertVariants
115
116
  };
@@ -1,22 +1,22 @@
1
1
  "use client";
2
- import { jsx as s, jsxs as x, Fragment as y } from "react/jsx-runtime";
3
- import { useState as D, cloneElement as O } from "react";
4
- import { cn as a } from "../cn.js";
5
- import { ModalBody as F, ModalFooter as M, ModalWrapper as N } from "../modal/modal.js";
2
+ import { jsx as a, jsxs as x, Fragment as y } from "react/jsx-runtime";
3
+ import { useState as D, cloneElement as M } from "react";
4
+ import { cn as r } from "../cn.js";
5
+ import { ModalBody as O, ModalFooter as F, ModalWrapper as N } from "../modal/modal.js";
6
6
  const b = ({
7
7
  children: o,
8
8
  className: e,
9
- ...r
10
- }) => /* @__PURE__ */ s(N, { className: a("gi-drawer-container", e), ...r, children: o }), I = ({
9
+ ...s
10
+ }) => /* @__PURE__ */ a(N, { className: r("gi-drawer-container", e), ...s, children: o }), I = ({
11
11
  children: o,
12
12
  triggerButton: e,
13
- startsOpen: r,
13
+ startsOpen: s,
14
14
  closeButtonLabel: p,
15
15
  position: i = "right",
16
16
  className: m,
17
17
  closeButtonSize: f
18
18
  }) => {
19
- const [t, n] = D(!!r), w = () => n(!0), C = () => n(!1), h = O(e, {
19
+ const [t, n] = D(!!s), w = () => n(!0), C = () => n(!1), h = M(e, {
20
20
  "data-testid": "drawer-trigger-button-container",
21
21
  onClick: (k) => {
22
22
  var l, d;
@@ -26,7 +26,7 @@ const b = ({
26
26
  });
27
27
  return /* @__PURE__ */ x(y, { children: [
28
28
  h,
29
- /* @__PURE__ */ s(
29
+ /* @__PURE__ */ a(
30
30
  b,
31
31
  {
32
32
  children: o,
@@ -39,11 +39,18 @@ const b = ({
39
39
  }
40
40
  )
41
41
  ] });
42
- }, S = ({ children: o, className: e }) => /* @__PURE__ */ s(F, { className: a("gi-drawer-body", e), children: o }), T = ({
42
+ }, S = ({ children: o, className: e }) => /* @__PURE__ */ a(
43
+ O,
44
+ {
45
+ includeModalClass: !1,
46
+ className: r("gi-drawer-body", e),
47
+ children: o
48
+ }
49
+ ), T = ({
43
50
  children: o,
44
51
  className: e,
45
- stacked: r
46
- }) => /* @__PURE__ */ s(M, { stacked: r, className: a("gi-drawer-footer", e), children: o });
52
+ stacked: s
53
+ }) => /* @__PURE__ */ a(F, { stacked: s, className: r("gi-drawer-footer", e), children: o });
47
54
  export {
48
55
  I as Drawer,
49
56
  S as DrawerBody,
@@ -1,40 +1,42 @@
1
1
  "use client";
2
2
  import { jsx as m } from "react/jsx-runtime";
3
- import { forwardRef as f } from "react";
4
- import { isButtonDisabled as p, getButtonIconSizeClass as B, getVariantAppearanceClass as I } from "../button/helpers.js";
5
- import { cn as b } from "../cn.js";
3
+ import { forwardRef as p } from "react";
4
+ import { isButtonDisabled as B, getButtonIconSizeClass as I, getVariantAppearanceClass as b } from "../button/helpers.js";
5
+ import { cn as d } from "../cn.js";
6
6
  import { Icon as g } from "../icon/icon.js";
7
- const x = f(
7
+ const x = p(
8
8
  ({
9
9
  icon: i,
10
- variant: t,
10
+ variant: o,
11
11
  appearance: n,
12
12
  size: r,
13
- disabled: o,
13
+ disabled: t,
14
14
  onClick: s,
15
15
  className: e = "",
16
16
  type: c = "button",
17
+ dataTestid: a,
17
18
  ...u
18
- }, a) => {
19
- const l = r === "small" ? "sm" : "md";
19
+ }, l) => {
20
+ const f = r === "small" ? "sm" : "md";
20
21
  return /* @__PURE__ */ m(
21
22
  "button",
22
23
  {
23
- ref: a,
24
+ ref: l,
24
25
  type: c,
25
- "aria-disabled": o,
26
- disabled: o,
26
+ "aria-disabled": t,
27
+ disabled: t,
27
28
  role: "button",
28
29
  onClick: s,
30
+ "data-testid": a,
29
31
  ...u,
30
- className: b(
32
+ className: d(
31
33
  "gi-btn",
32
- I({ disabled: o, variant: t, appearance: n }),
33
- B(r),
34
- p({ disabled: o, variant: t, appearance: n }),
34
+ b({ disabled: t, variant: o, appearance: n }),
35
+ I(r),
36
+ B({ disabled: t, variant: o, appearance: n }),
35
37
  e
36
38
  ),
37
- children: /* @__PURE__ */ m(g, { size: l, ...i })
39
+ children: /* @__PURE__ */ m(g, { size: f, ...i })
38
40
  }
39
41
  );
40
42
  }
@@ -6,9 +6,10 @@ export declare const ModalTitle: {
6
6
  ({ children, as, ...props }: HeadingProps): import("react/jsx-runtime").JSX.Element;
7
7
  displayName: string;
8
8
  };
9
- export declare const ModalBody: ({ children, className, }: {
9
+ export declare const ModalBody: ({ children, className, includeModalClass, }: {
10
10
  children: ReactNode;
11
11
  className?: string;
12
+ includeModalClass?: boolean;
12
13
  }) => import("react/jsx-runtime").JSX.Element;
13
14
  export declare const ModalFooter: {
14
15
  ({ className, children, orientation, dataModalSize, stacked, }: ModalFooterProps): import("react/jsx-runtime").JSX.Element;