@ogcio/design-system-react 1.11.2 → 1.11.3

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 (82) hide show
  1. package/package.json +4 -4
  2. package/dist/accordion/accordion.test.d.ts +0 -1
  3. package/dist/accordion/accordion.test.js +0 -61
  4. package/dist/alert/alert.test.d.ts +0 -1
  5. package/dist/alert/alert.test.js +0 -45
  6. package/dist/blockquote/blockquote.test.d.ts +0 -1
  7. package/dist/blockquote/blockquote.test.js +0 -21
  8. package/dist/breadcrumbs/breadcrumbs.test.d.ts +0 -1
  9. package/dist/breadcrumbs/breadcrumbs.test.js +0 -43
  10. package/dist/button/button.test.d.ts +0 -1
  11. package/dist/button/button.test.js +0 -78
  12. package/dist/button-group/button-group.test.d.ts +0 -1
  13. package/dist/button-group/button-group.test.js +0 -2982
  14. package/dist/card/card.test.d.ts +0 -1
  15. package/dist/card/card.test.js +0 -130
  16. package/dist/combo-box/dropdown-item.test.d.ts +0 -1
  17. package/dist/combo-box/dropdown-item.test.js +0 -88
  18. package/dist/container/container.test.d.ts +0 -1
  19. package/dist/container/container.test.js +0 -28
  20. package/dist/cookie-banner/cookie-banner.test.d.ts +0 -1
  21. package/dist/cookie-banner/cookie-banner.test.js +0 -20
  22. package/dist/details/details.test.d.ts +0 -1
  23. package/dist/details/details.test.js +0 -50
  24. package/dist/drawer/drawer.test.d.ts +0 -1
  25. package/dist/drawer/drawer.test.js +0 -69
  26. package/dist/error-text/error-text.test.d.ts +0 -1
  27. package/dist/error-text/error-text.test.js +0 -30
  28. package/dist/footer/footer.test.d.ts +0 -1
  29. package/dist/footer/footer.test.js +0 -42
  30. package/dist/header/header.test.d.ts +0 -1
  31. package/dist/header/header.test.js +0 -95
  32. package/dist/hint-text/hint-text.test.d.ts +0 -1
  33. package/dist/hint-text/hint-text.test.js +0 -31
  34. package/dist/icon/icon.test.d.ts +0 -1
  35. package/dist/icon/icon.test.js +0 -53
  36. package/dist/icon-button/icon-button.test.d.ts +0 -1
  37. package/dist/icon-button/icon-button.test.js +0 -56
  38. package/dist/input-password/input-password.test.d.ts +0 -1
  39. package/dist/input-password/input-password.test.js +0 -16
  40. package/dist/label/label.test.d.ts +0 -1
  41. package/dist/label/label.test.js +0 -49
  42. package/dist/link/link.test.d.ts +0 -1
  43. package/dist/link/link.test.js +0 -66
  44. package/dist/list/list.test.d.ts +0 -1
  45. package/dist/list/list.test.js +0 -67
  46. package/dist/modal/modal.test.d.ts +0 -1
  47. package/dist/modal/modal.test.js +0 -81
  48. package/dist/pagination/pagination.test.d.ts +0 -1
  49. package/dist/pagination/pagination.test.js +0 -95
  50. package/dist/paragraph/paragraph.test.d.ts +0 -1
  51. package/dist/paragraph/paragraph.test.js +0 -63
  52. package/dist/phase-banner/phase-banner.test.d.ts +0 -1
  53. package/dist/phase-banner/phase-banner.test.js +0 -27
  54. package/dist/primitives/anchor.test.d.ts +0 -1
  55. package/dist/primitives/anchor.test.js +0 -39
  56. package/dist/progress-bar/progress-bar.test.d.ts +0 -1
  57. package/dist/progress-bar/progress-bar.test.js +0 -34
  58. package/dist/progress-stepper/progress-stepper.test.d.ts +0 -1
  59. package/dist/progress-stepper/progress-stepper.test.js +0 -117
  60. package/dist/section-break/section-break.test.d.ts +0 -1
  61. package/dist/section-break/section-break.test.js +0 -36
  62. package/dist/spinner/spinner.test.d.ts +0 -1
  63. package/dist/spinner/spinner.test.js +0 -11
  64. package/dist/stack/stack.test.d.ts +0 -1
  65. package/dist/stack/stack.test.js +0 -44
  66. package/dist/summary-list/summary-list.test.d.ts +0 -1
  67. package/dist/summary-list/summary-list.test.js +0 -56
  68. package/dist/table/table.test.d.ts +0 -1
  69. package/dist/table/table.test.js +0 -18
  70. package/dist/tabs/tabs.test.d.ts +0 -1
  71. package/dist/tabs/tabs.test.js +0 -44
  72. package/dist/tag/tag.test.d.ts +0 -1
  73. package/dist/tag/tag.test.js +0 -40
  74. package/dist/test-utilities-BS7B3BF-.js +0 -34112
  75. package/dist/test-utilities.d.ts +0 -8
  76. package/dist/test-utilities.js +0 -87
  77. package/dist/toast/toast.test.d.ts +0 -1
  78. package/dist/toast/toast.test.js +0 -44
  79. package/dist/tooltip/tooltip.test.d.ts +0 -1
  80. package/dist/tooltip/tooltip.test.js +0 -85
  81. package/dist/utils/utilities.test.d.ts +0 -1
  82. package/dist/utils/utilities.test.js +0 -79
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ogcio/design-system-react",
3
- "version": "1.11.2",
3
+ "version": "1.11.3",
4
4
  "description": "The GOV IE design system React components.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -50,11 +50,11 @@
50
50
  "postcss-import": "^16.1.0",
51
51
  "react": "19.0.0",
52
52
  "react-dom": "19.0.0",
53
- "@ogcio/design-system-eslint-config": "1.2.5",
54
53
  "@ogcio/design-system-prettier-config": "1.0.5",
54
+ "@ogcio/design-system-eslint-config": "1.2.5",
55
+ "@ogcio/design-system-tailwind": "1.10.3",
55
56
  "@ogcio/theme-doete": "1.0.0",
56
- "@ogcio/design-system-tailwind": "1.10.2",
57
- "@ogcio/theme-govie": "1.5.2"
57
+ "@ogcio/theme-govie": "1.5.3"
58
58
  },
59
59
  "scripts": {
60
60
  "format": "prettier 'src/**/*.{ts,tsx}' --write",
@@ -1 +0,0 @@
1
- export {};
@@ -1,61 +0,0 @@
1
- import { jsxs as l, jsx as e } from "react/jsx-runtime";
2
- import { c as h, r as o, f as a } from "../test-utilities-BS7B3BF-.js";
3
- import { AccordionItem as n } from "./accordion-item.js";
4
- import { Accordion as r } from "./accordion.js";
5
- describe("govieAccordion", () => {
6
- afterEach(h), it("should render accordion with all items", () => {
7
- const { getByText: t } = o(
8
- /* @__PURE__ */ l(r, { children: [
9
- /* @__PURE__ */ l(n, { label: "Label1", children: [
10
- /* @__PURE__ */ e("h1", { children: "This is the content Heading 1" }),
11
- /* @__PURE__ */ e("p", { children: "This is a content paragraph paragraph 1" })
12
- ] }),
13
- /* @__PURE__ */ l(n, { label: "Label2", children: [
14
- /* @__PURE__ */ e("h1", { children: "This is the content Heading 2" }),
15
- /* @__PURE__ */ e("p", { children: "This is a content paragraph paragraph 2" })
16
- ] })
17
- ] })
18
- );
19
- expect(t("Label1")).toBeInTheDocument(), expect(t("Label2")).toBeInTheDocument();
20
- }), it("should toggle accordion item visibility when clicked", () => {
21
- const { getByText: t, queryByText: i } = o(
22
- /* @__PURE__ */ l(r, { children: [
23
- /* @__PURE__ */ e(n, { label: "Label1", children: /* @__PURE__ */ e("p", { children: "This is the content for Label1" }) }),
24
- /* @__PURE__ */ e(n, { label: "Label2", children: /* @__PURE__ */ e("p", { children: "This is the content for Label2" }) })
25
- ] })
26
- ), c = t("Label1");
27
- expect(i("This is the content for Label1")).not.toBeVisible(), a.click(c), expect(i("This is the content for Label1")).toBeVisible(), a.click(c), expect(i("This is the content for Label1")).not.toBeVisible();
28
- }), it("should not toggle disabled accordion item", () => {
29
- const { getByText: t, queryByText: i } = o(
30
- /* @__PURE__ */ l(r, { children: [
31
- /* @__PURE__ */ e(n, { label: "Label1", disabled: !0, children: /* @__PURE__ */ e("p", { children: "This is the content for Label1" }) }),
32
- /* @__PURE__ */ e(n, { label: "Label2", children: /* @__PURE__ */ e("p", { children: "This is the content for Label2" }) })
33
- ] })
34
- ), c = t("Label1");
35
- expect(i("This is the content for Label1")).not.toBeVisible(), a.click(c), expect(i("This is the content for Label1")).not.toBeVisible();
36
- }), it("should render accordion items with defaultExpanded set to true", () => {
37
- const { getByText: t } = o(
38
- /* @__PURE__ */ l(r, { children: [
39
- /* @__PURE__ */ e(n, { label: "Label1", defaultExpanded: !0, children: /* @__PURE__ */ e("p", { children: "This is the content for Label1" }) }),
40
- /* @__PURE__ */ e(n, { label: "Label2", children: /* @__PURE__ */ e("p", { children: "This is the content for Label2" }) })
41
- ] })
42
- );
43
- expect(t("This is the content for Label1")).toBeVisible();
44
- }), it("should apply iconStart styling when iconStart is true", () => {
45
- const { container: t } = o(
46
- /* @__PURE__ */ l(r, { iconStart: !0, children: [
47
- /* @__PURE__ */ e(n, { label: "Label1", children: /* @__PURE__ */ e("p", { children: "This is the content for Label1" }) }),
48
- /* @__PURE__ */ e(n, { label: "Label2", children: /* @__PURE__ */ e("p", { children: "This is the content for Label2" }) })
49
- ] })
50
- ), i = t.querySelector(".gi-accordion"), c = i == null ? void 0 : i.getAttribute("data-icon-start");
51
- expect(c).toBe("true");
52
- }), it("should not apply iconStart styling when iconStart is false", () => {
53
- const { container: t } = o(
54
- /* @__PURE__ */ l(r, { children: [
55
- /* @__PURE__ */ e(n, { label: "Label1", children: /* @__PURE__ */ e("p", { children: "This is the content for Label1" }) }),
56
- /* @__PURE__ */ e(n, { label: "Label2", children: /* @__PURE__ */ e("p", { children: "This is the content for Label2" }) })
57
- ] })
58
- ), i = t.querySelector("div.gi-flex-row-reverse");
59
- expect(i).not.toBeInTheDocument();
60
- });
61
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,45 +0,0 @@
1
- import { jsx as i } from "react/jsx-runtime";
2
- import { c as r, t as l, r as o } from "../test-utilities-BS7B3BF-.js";
3
- import { Alert as c } from "./alert.js";
4
- const a = [
5
- "info",
6
- "success",
7
- "warning",
8
- "danger"
9
- ];
10
- describe("Alert", () => {
11
- afterEach(r);
12
- const t = (e) => o(/* @__PURE__ */ i(c, { ...e }));
13
- l(
14
- Reflect.ownKeys(a),
15
- (e) => t({
16
- variant: e,
17
- title: "Information",
18
- children: "This is an info alert"
19
- })
20
- ), it("should render alert with title and message", () => {
21
- const e = t({
22
- variant: "info",
23
- title: "Information",
24
- children: "This is an info alert",
25
- dataTestid: "alert"
26
- }), s = e.getByTestId("alert");
27
- expect(s).toBeTruthy(), expect(e.getByText("Information")).toBeTruthy(), expect(e.getByText("This is an info alert")).toBeTruthy();
28
- }), it("should render different variants", () => {
29
- for (const e of a) {
30
- const n = t({
31
- variant: e,
32
- title: `${e} alert`,
33
- children: `This is a ${e} alert`,
34
- dataTestid: "alert"
35
- }).getByTestId("alert");
36
- expect(n).toHaveClass(`gi-alert-${e}`), r();
37
- }
38
- }), it("should pass axe accessibility tests", async () => {
39
- await t({
40
- variant: "success",
41
- title: "Accessible Alert",
42
- children: "This alert should be accessible"
43
- }).axe();
44
- });
45
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,21 +0,0 @@
1
- import { jsx as c } from "react/jsx-runtime";
2
- import { c as s, r as i } from "../test-utilities-BS7B3BF-.js";
3
- import { Blockquote as r } from "./blockquote.js";
4
- describe("govieBlockquote", () => {
5
- afterEach(s), it("should render a blockquote with the correct content", () => {
6
- const { getByText: e } = i(
7
- /* @__PURE__ */ c(r, { children: "This is a blockquote" })
8
- ), t = e("This is a blockquote");
9
- expect(t).toBeTruthy(), expect(t.tagName.toLowerCase()).toBe("blockquote");
10
- }), it("should render a blockquote with the cite attribute when provided", () => {
11
- const e = "https://example.com/source", { container: t } = i(
12
- /* @__PURE__ */ c(r, { cite: e, children: "This is a blockquote" })
13
- ), o = t.querySelector("blockquote");
14
- expect(o).toBeTruthy(), expect(o == null ? void 0 : o.getAttribute("cite")).toBe(e);
15
- }), it("should pass axe accessibility tests", async () => {
16
- const { axe: e } = i(
17
- /* @__PURE__ */ c(r, { children: "This is a blockquote" })
18
- );
19
- await e();
20
- });
21
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,43 +0,0 @@
1
- import { jsxs as a, jsx as e } from "react/jsx-runtime";
2
- import { c as d, r as c } from "../test-utilities-BS7B3BF-.js";
3
- import { Breadcrumbs as i, BreadcrumbLink as o, BreadcrumbEllipsis as s, BreadcrumbCurrentLink as l } from "./breadcrumbs.js";
4
- describe("govieBreadcrumbs", () => {
5
- afterEach(d), it("should render Breadcrumbs", () => {
6
- const { getByRole: r, getAllByRole: t } = c(
7
- /* @__PURE__ */ a(i, { children: [
8
- /* @__PURE__ */ e(o, { href: "/home", children: "Home" }),
9
- /* @__PURE__ */ e(s, {}),
10
- /* @__PURE__ */ e(l, { href: "/travel", children: "Travel" })
11
- ] })
12
- ), h = r("navigation", {
13
- name: /breadcrumb/i
14
- });
15
- expect(h).toBeInTheDocument();
16
- const n = t("listitem");
17
- expect(n).toHaveLength(3), expect(n[0]).toHaveTextContent("Home"), expect(n[1]).toBeInTheDocument(), expect(n[2]).toHaveTextContent("Travel");
18
- }), it("should render Breadcrumbs with ellipses correctly", () => {
19
- const { container: r } = c(
20
- /* @__PURE__ */ a(i, { children: [
21
- /* @__PURE__ */ e(o, { href: "/home", children: "Home" }),
22
- /* @__PURE__ */ e(s, {}),
23
- /* @__PURE__ */ e(o, { href: "/docs", children: "Documentation" }),
24
- /* @__PURE__ */ e(l, { href: "/travel", children: "Travel" })
25
- ] })
26
- ), t = r.querySelector('div[aria-hidden="true"]');
27
- expect(t).toBeInTheDocument(), expect(t).toHaveTextContent("more_horiz");
28
- }), it("should show left chevron icon when iconStart is true", () => {
29
- const { container: r } = c(
30
- /* @__PURE__ */ e(i, { iconStart: !0, children: /* @__PURE__ */ e(o, { href: "/home", children: "Back to [Previous page]" }) })
31
- ), t = r.querySelector("div > nav > span");
32
- expect(t == null ? void 0 : t.textContent).toBe("chevron_left");
33
- }), it("should pass axe accessibility tests", async () => {
34
- const { axe: r } = c(
35
- /* @__PURE__ */ a(i, { children: [
36
- /* @__PURE__ */ e(o, { href: "/home", children: "Home" }),
37
- /* @__PURE__ */ e(s, {}),
38
- /* @__PURE__ */ e(l, { href: "/travel", children: "Travel" })
39
- ] })
40
- );
41
- await r();
42
- });
43
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,78 +0,0 @@
1
- import { jsx as s } from "react/jsx-runtime";
2
- import { Icon as c } from "../icon/icon.js";
3
- import { c as a, t as u, r as p } from "../test-utilities-BS7B3BF-.js";
4
- import { Button as i } from "./button.js";
5
- import { ButtonVariants as d } from "./types.js";
6
- const o = {
7
- children: "Button Label",
8
- variant: "primary"
9
- };
10
- describe("button", () => {
11
- afterEach(a);
12
- const r = ({ children: t, ...n }) => p(
13
- /* @__PURE__ */ s(i, { ...n, dataTestid: "govie-button", children: t })
14
- );
15
- u(
16
- d,
17
- (t) => r({ ...o, variant: t })
18
- ), it("should render the label", () => {
19
- const t = r(o), n = t.getByText(o.children), e = t.getByTestId("govie-button");
20
- expect(n).toBeTruthy(), expect(e).toBeTruthy();
21
- }), it("should render a secondary button", () => {
22
- const t = {
23
- ...o,
24
- variant: "secondary"
25
- }, e = r(t).getByTestId("govie-button");
26
- expect(e).toBeTruthy();
27
- }), it("should render a flat button", () => {
28
- const t = {
29
- ...o,
30
- variant: "flat"
31
- }, e = r(t).getByTestId("govie-button");
32
- expect(e).toBeTruthy();
33
- }), it("should render a button with default appearance", () => {
34
- const t = {
35
- ...o,
36
- appearance: "default"
37
- }, e = r(t).getByTestId("govie-button");
38
- expect(e).toBeTruthy();
39
- }), it("should render a button with light appearance", () => {
40
- const t = {
41
- ...o,
42
- appearance: "light"
43
- }, e = r(t).getByTestId("govie-button");
44
- expect(e).toBeTruthy();
45
- }), it("should render a button with dark appearance", () => {
46
- const t = {
47
- ...o,
48
- appearance: "dark"
49
- }, e = r(t).getByTestId("govie-button");
50
- expect(e).toBeTruthy();
51
- }), it("should render a small button", () => {
52
- const t = {
53
- ...o,
54
- size: "small"
55
- }, e = r(t).getByTestId("govie-button");
56
- expect(e).toBeTruthy();
57
- }), it("should render a large button", () => {
58
- const t = {
59
- ...o,
60
- size: "large"
61
- }, e = r(t).getByTestId("govie-button");
62
- expect(e).toBeTruthy();
63
- }), it("should render a disabled button", () => {
64
- const t = {
65
- ...o,
66
- disabled: !0
67
- }, e = r(t).getByTestId("govie-button");
68
- expect(e).toBeTruthy(), expect(e).toBeDisabled();
69
- }), it("should render a button with icon", () => {
70
- const { getByTestId: t } = r({
71
- ...o,
72
- children: /* @__PURE__ */ s(c, { icon: "thumb_up" })
73
- }), n = t("govie-icon");
74
- expect(n).toBeTruthy();
75
- }), it("should pass axe tests", async () => {
76
- await r(o).axe();
77
- });
78
- });
@@ -1 +0,0 @@
1
- export {};