@ogcio/design-system-react 1.11.1 → 1.11.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.
- package/dist/accordion/accordion-item.d.ts +11 -0
- package/dist/accordion/accordion-item.js +76 -0
- package/dist/accordion/accordion.d.ts +10 -0
- package/dist/accordion/accordion.js +39 -0
- package/dist/accordion/accordion.test.d.ts +1 -0
- package/dist/accordion/accordion.test.js +61 -0
- package/dist/alert/alert.d.ts +89 -0
- package/dist/alert/alert.js +115 -0
- package/dist/alert/alert.test.d.ts +1 -0
- package/dist/alert/alert.test.js +45 -0
- package/dist/assets/logos/gov-of-ireland/harp-gold-text-green.d.ts +2 -0
- package/dist/assets/logos/gov-of-ireland/harp-gold-text-green.js +322 -0
- package/dist/assets/logos/gov-of-ireland/harp-white.d.ts +2 -0
- package/dist/assets/logos/gov-of-ireland/harp-white.js +322 -0
- package/dist/assets/logos/harp/harp-white.d.ts +2 -0
- package/dist/assets/logos/harp/harp-white.js +60 -0
- package/dist/autocomplete/autocomplete.d.ts +4 -0
- package/dist/autocomplete/autocomplete.js +252 -0
- package/dist/autocomplete/types.d.ts +61 -0
- package/dist/autocomplete/types.js +13 -0
- package/dist/blockquote/blockquote.d.ts +3 -0
- package/dist/blockquote/blockquote.js +7 -0
- package/dist/blockquote/blockquote.test.d.ts +1 -0
- package/dist/blockquote/blockquote.test.js +21 -0
- package/dist/breadcrumbs/breadcrumbs.d.ts +5 -0
- package/dist/breadcrumbs/breadcrumbs.js +38 -0
- package/dist/breadcrumbs/breadcrumbs.test.d.ts +1 -0
- package/dist/breadcrumbs/breadcrumbs.test.js +43 -0
- package/dist/breadcrumbs/types.d.ts +17 -0
- package/dist/breadcrumbs/types.js +1 -0
- package/dist/button/button.d.ts +9 -0
- package/dist/button/button.js +38 -0
- package/dist/button/button.test.d.ts +1 -0
- package/dist/button/button.test.js +78 -0
- package/dist/button/helpers.d.ts +13 -0
- package/dist/button/helpers.js +39 -0
- package/dist/button/types.d.ts +13 -0
- package/dist/button/types.js +4 -0
- package/dist/button-group/button-group.d.ts +21 -0
- package/dist/button-group/button-group.js +85 -0
- package/dist/button-group/button-group.test.d.ts +1 -0
- package/dist/button-group/button-group.test.js +2982 -0
- package/dist/card/card-legacy.d.ts +5 -0
- package/dist/card/card-legacy.js +68 -0
- package/dist/card/card-next.d.ts +13 -0
- package/dist/card/card-next.js +84 -0
- package/dist/card/card.d.ts +2 -0
- package/dist/card/card.js +26 -0
- package/dist/card/card.test.d.ts +1 -0
- package/dist/card/card.test.js +130 -0
- package/dist/card/types.d.ts +92 -0
- package/dist/card/types.js +1 -0
- package/dist/checkbox/checkbox-group.d.ts +4 -0
- package/dist/checkbox/checkbox-group.js +7 -0
- package/dist/checkbox/checkbox.d.ts +4 -0
- package/dist/checkbox/checkbox.js +7 -0
- package/dist/checkbox/types.d.ts +14 -0
- package/dist/checkbox/types.js +5 -0
- package/dist/chip/chip.d.ts +9 -0
- package/dist/chip/chip.js +37 -0
- package/dist/cn.d.ts +2 -0
- package/dist/cn.js +19 -0
- package/dist/combo-box/combo-box.content.d.ts +12 -0
- package/dist/combo-box/combo-box.content.js +685 -0
- package/dist/combo-box/combo-box.d.ts +2 -0
- package/dist/combo-box/combo-box.js +17 -0
- package/dist/combo-box/dropdown-item.d.ts +2 -0
- package/dist/combo-box/dropdown-item.js +154 -0
- package/dist/combo-box/dropdown-item.test.d.ts +1 -0
- package/dist/combo-box/dropdown-item.test.js +88 -0
- package/dist/combo-box/types.d.ts +18 -0
- package/dist/combo-box/types.js +1 -0
- package/dist/common/types.d.ts +7 -0
- package/dist/common/types.js +1 -0
- package/dist/container/container.d.ts +16 -0
- package/dist/container/container.js +37 -0
- package/dist/container/container.test.d.ts +1 -0
- package/dist/container/container.test.js +28 -0
- package/dist/cookie-banner/cookie-banner.content.d.ts +3 -0
- package/dist/cookie-banner/cookie-banner.content.js +21 -0
- package/dist/cookie-banner/cookie-banner.d.ts +12 -0
- package/dist/cookie-banner/cookie-banner.js +31 -0
- package/dist/cookie-banner/cookie-banner.test.d.ts +1 -0
- package/dist/cookie-banner/cookie-banner.test.js +20 -0
- package/dist/details/details.d.ts +4 -0
- package/dist/details/details.js +55 -0
- package/dist/details/details.test.d.ts +1 -0
- package/dist/details/details.test.js +50 -0
- package/dist/drawer/drawer.content.d.ts +3 -0
- package/dist/drawer/drawer.content.js +68 -0
- package/dist/drawer/drawer.d.ts +26 -0
- package/dist/drawer/drawer.js +48 -0
- package/dist/drawer/drawer.test.d.ts +1 -0
- package/dist/drawer/drawer.test.js +69 -0
- package/dist/error-text/error-text.d.ts +7 -0
- package/dist/error-text/error-text.js +40 -0
- package/dist/error-text/error-text.test.d.ts +1 -0
- package/dist/error-text/error-text.test.js +30 -0
- package/dist/error-text/types.d.ts +8 -0
- package/dist/error-text/types.js +1 -0
- package/dist/file-upload/file-upload.d.ts +9 -0
- package/dist/file-upload/file-upload.js +6 -0
- package/dist/footer/footer.d.ts +11 -0
- package/dist/footer/footer.js +108 -0
- package/dist/footer/footer.test.d.ts +1 -0
- package/dist/footer/footer.test.js +42 -0
- package/dist/forms/form-field-with-tag/form-field-with-tag.d.ts +24 -0
- package/dist/forms/form-field-with-tag/form-field-with-tag.js +50 -0
- package/dist/forms/form-field.d.ts +11 -0
- package/dist/forms/form-field.js +41 -0
- package/dist/forms/form.d.ts +4 -0
- package/dist/forms/form.js +5 -0
- package/dist/header/components/header-menu.d.ts +13 -0
- package/dist/header/components/header-menu.js +126 -0
- package/dist/header/components/header-search.d.ts +7 -0
- package/dist/header/components/header-search.js +59 -0
- package/dist/header/components/header-slot.d.ts +12 -0
- package/dist/header/components/header-slot.js +129 -0
- package/dist/header/header.d.ts +2 -0
- package/dist/header/header.js +201 -0
- package/dist/header/header.test.d.ts +1 -0
- package/dist/header/header.test.js +95 -0
- package/dist/header/helper.d.ts +2 -0
- package/dist/header/helper.js +79 -0
- package/dist/header/types.d.ts +76 -0
- package/dist/header/types.js +1 -0
- package/dist/heading/heading.d.ts +82 -0
- package/dist/heading/heading.js +50 -0
- package/dist/hint-text/hint-text.d.ts +7 -0
- package/dist/hint-text/hint-text.js +30 -0
- package/dist/hint-text/hint-text.test.d.ts +1 -0
- package/dist/hint-text/hint-text.test.js +31 -0
- package/dist/hint-text/types.d.ts +7 -0
- package/dist/hint-text/types.js +1 -0
- package/dist/hooks/use-breakpoint.d.ts +12 -0
- package/dist/hooks/use-breakpoint.js +24 -0
- package/dist/hooks/use-dom-id.d.ts +1 -0
- package/dist/hooks/use-dom-id.js +8 -0
- package/dist/i18n/config.d.ts +7 -0
- package/dist/i18n/config.js +13 -0
- package/dist/i18n/utility.d.ts +1 -0
- package/dist/i18n/utility.js +5 -0
- package/dist/i18next-DxWa09nx.js +1395 -0
- package/dist/icon/icon.d.ts +15 -0
- package/dist/icon/icon.js +173 -0
- package/dist/icon/icon.test.d.ts +1 -0
- package/dist/icon/icon.test.js +53 -0
- package/dist/icon/icons.d.ts +2 -0
- package/dist/icon/icons.js +144 -0
- package/dist/icon/svg.d.ts +7 -0
- package/dist/icon/svg.js +22 -0
- package/dist/icon/svgs/bluesky.d.ts +5 -0
- package/dist/icon/svgs/bluesky.js +24 -0
- package/dist/icon/svgs/facebook.d.ts +5 -0
- package/dist/icon/svgs/facebook.js +24 -0
- package/dist/icon/svgs/instagram.d.ts +5 -0
- package/dist/icon/svgs/instagram.js +24 -0
- package/dist/icon/svgs/linkedin.d.ts +5 -0
- package/dist/icon/svgs/linkedin.js +24 -0
- package/dist/icon/svgs/placeholder.d.ts +5 -0
- package/dist/icon/svgs/placeholder.js +30 -0
- package/dist/icon/svgs/threads.d.ts +5 -0
- package/dist/icon/svgs/threads.js +24 -0
- package/dist/icon/svgs/tiktok.d.ts +5 -0
- package/dist/icon/svgs/tiktok.js +24 -0
- package/dist/icon/svgs/x.d.ts +5 -0
- package/dist/icon/svgs/x.js +24 -0
- package/dist/icon/svgs/youtube.d.ts +5 -0
- package/dist/icon/svgs/youtube.js +29 -0
- package/dist/icon-button/icon-button.d.ts +10 -0
- package/dist/icon-button/icon-button.js +43 -0
- package/dist/icon-button/icon-button.test.d.ts +1 -0
- package/dist/icon-button/icon-button.test.js +56 -0
- package/dist/index-DNkhmzZp.js +2419 -0
- package/dist/index-ntYL1VRC.js +64 -0
- package/dist/index.d.ts +102 -0
- package/dist/index.js +190 -0
- package/dist/input-checkbox/input-checkbox.d.ts +3 -0
- package/dist/input-checkbox/input-checkbox.js +51 -0
- package/dist/input-checkbox/types.d.ts +12 -0
- package/dist/input-checkbox/types.js +8 -0
- package/dist/input-checkbox-group/input-checkbox-group.d.ts +2 -0
- package/dist/input-checkbox-group/input-checkbox-group.js +24 -0
- package/dist/input-checkbox-group/types.d.ts +7 -0
- package/dist/input-checkbox-group/types.js +1 -0
- package/dist/input-file/input-file.d.ts +2 -0
- package/dist/input-file/input-file.js +20 -0
- package/dist/input-file/types.d.ts +1 -0
- package/dist/input-file/types.js +1 -0
- package/dist/input-password/input-password.d.ts +2 -0
- package/dist/input-password/input-password.js +30 -0
- package/dist/input-password/input-password.test.d.ts +1 -0
- package/dist/input-password/input-password.test.js +16 -0
- package/dist/input-password/types.d.ts +2 -0
- package/dist/input-password/types.js +1 -0
- package/dist/input-radio/input-radio.d.ts +3 -0
- package/dist/input-radio/input-radio.js +68 -0
- package/dist/input-radio/types.d.ts +14 -0
- package/dist/input-radio/types.js +8 -0
- package/dist/input-radio-group/input-radio-group.d.ts +3 -0
- package/dist/input-radio-group/input-radio-group.js +28 -0
- package/dist/input-radio-group/types.d.ts +5 -0
- package/dist/input-radio-group/types.js +1 -0
- package/dist/input-text/input-text.d.ts +19 -0
- package/dist/input-text/input-text.js +140 -0
- package/dist/input-text/type.d.ts +27 -0
- package/dist/input-text/type.js +1 -0
- package/dist/label/label.d.ts +11 -0
- package/dist/label/label.js +27 -0
- package/dist/label/label.test.d.ts +1 -0
- package/dist/label/label.test.js +49 -0
- package/dist/label/types.d.ts +7 -0
- package/dist/label/types.js +1 -0
- package/dist/link/link.d.ts +47 -0
- package/dist/link/link.js +104 -0
- package/dist/link/link.test.d.ts +1 -0
- package/dist/link/link.test.js +66 -0
- package/dist/list/list.d.ts +13 -0
- package/dist/list/list.js +44 -0
- package/dist/list/list.test.d.ts +1 -0
- package/dist/list/list.test.js +67 -0
- package/dist/list-item/list-item.d.ts +9 -0
- package/dist/list-item/list-item.js +19 -0
- package/dist/modal/modal.content.d.ts +2 -0
- package/dist/modal/modal.content.js +19 -0
- package/dist/modal/modal.d.ts +11 -0
- package/dist/modal/modal.js +222 -0
- package/dist/modal/modal.test.d.ts +1 -0
- package/dist/modal/modal.test.js +81 -0
- package/dist/modal/types.d.ts +39 -0
- package/dist/modal/types.js +1 -0
- package/dist/pagination/pagination.d.ts +8 -0
- package/dist/pagination/pagination.js +104 -0
- package/dist/pagination/pagination.test.d.ts +1 -0
- package/dist/pagination/pagination.test.js +95 -0
- package/dist/paragraph/paragraph.d.ts +17 -0
- package/dist/paragraph/paragraph.js +60 -0
- package/dist/paragraph/paragraph.test.d.ts +1 -0
- package/dist/paragraph/paragraph.test.js +63 -0
- package/dist/phase-banner/phase-banner.d.ts +5 -0
- package/dist/phase-banner/phase-banner.js +10 -0
- package/dist/phase-banner/phase-banner.test.d.ts +1 -0
- package/dist/phase-banner/phase-banner.test.js +27 -0
- package/dist/popover/popover.d.ts +2 -0
- package/dist/popover/popover.js +946 -0
- package/dist/popover/types.d.ts +10 -0
- package/dist/popover/types.js +1 -0
- package/dist/primitives/anchor.d.ts +7 -0
- package/dist/primitives/anchor.js +14 -0
- package/dist/primitives/anchor.test.d.ts +1 -0
- package/dist/primitives/anchor.test.js +39 -0
- package/dist/primitives/input.d.ts +3 -0
- package/dist/primitives/input.js +9 -0
- package/dist/progress-bar/progress-bar.d.ts +7 -0
- package/dist/progress-bar/progress-bar.js +40 -0
- package/dist/progress-bar/progress-bar.test.d.ts +1 -0
- package/dist/progress-bar/progress-bar.test.js +34 -0
- package/dist/progress-stepper/progress-stepper.d.ts +5 -0
- package/dist/progress-stepper/progress-stepper.js +198 -0
- package/dist/progress-stepper/progress-stepper.test.d.ts +1 -0
- package/dist/progress-stepper/progress-stepper.test.js +117 -0
- package/dist/progress-stepper/types.d.ts +49 -0
- package/dist/progress-stepper/types.js +7 -0
- package/dist/radio/radio-group.d.ts +4 -0
- package/dist/radio/radio-group.js +7 -0
- package/dist/radio/radio.d.ts +4 -0
- package/dist/radio/radio.js +7 -0
- package/dist/radio/types.d.ts +14 -0
- package/dist/radio/types.js +5 -0
- package/dist/score-select/score-select.d.ts +3 -0
- package/dist/score-select/score-select.js +124 -0
- package/dist/score-select/type.d.ts +14 -0
- package/dist/score-select/type.js +1 -0
- package/dist/section-break/section-break.d.ts +7 -0
- package/dist/section-break/section-break.js +38 -0
- package/dist/section-break/section-break.test.d.ts +1 -0
- package/dist/section-break/section-break.test.js +36 -0
- package/dist/select/select-menu.d.ts +7 -0
- package/dist/select/select-menu.js +141 -0
- package/dist/select/select-native.d.ts +5 -0
- package/dist/select/select-native.js +27 -0
- package/dist/select/select-next.d.ts +5 -0
- package/dist/select/select-next.js +162 -0
- package/dist/select/select.d.ts +5 -0
- package/dist/select/select.js +10 -0
- package/dist/select/types.d.ts +62 -0
- package/dist/select/types.js +1 -0
- package/dist/side-nav/side-nav.d.ts +6 -0
- package/dist/side-nav/side-nav.js +171 -0
- package/dist/side-nav/types.d.ts +18 -0
- package/dist/side-nav/types.js +1 -0
- package/dist/spinner/spinner.d.ts +35 -0
- package/dist/spinner/spinner.js +84 -0
- package/dist/spinner/spinner.test.d.ts +1 -0
- package/dist/spinner/spinner.test.js +11 -0
- package/dist/stack/stack.d.ts +3 -0
- package/dist/stack/stack.js +186 -0
- package/dist/stack/stack.test.d.ts +1 -0
- package/dist/stack/stack.test.js +44 -0
- package/dist/stack/types.d.ts +32 -0
- package/dist/stack/types.js +1 -0
- package/dist/styles.css +3 -0
- package/dist/summary-list/summary-list.d.ts +14 -0
- package/dist/summary-list/summary-list.js +46 -0
- package/dist/summary-list/summary-list.test.d.ts +1 -0
- package/dist/summary-list/summary-list.test.js +56 -0
- package/dist/summary-list/types.d.ts +20 -0
- package/dist/summary-list/types.js +1 -0
- package/dist/table/caption.d.ts +5 -0
- package/dist/table/caption.js +15 -0
- package/dist/table/column-group.d.ts +2 -0
- package/dist/table/column-group.js +10 -0
- package/dist/table/column.d.ts +2 -0
- package/dist/table/column.js +10 -0
- package/dist/table/table-body.d.ts +2 -0
- package/dist/table/table-body.js +10 -0
- package/dist/table/table-content.d.ts +1 -0
- package/dist/table/table-content.js +26 -0
- package/dist/table/table-data.d.ts +8 -0
- package/dist/table/table-data.js +35 -0
- package/dist/table/table-foot.d.ts +2 -0
- package/dist/table/table-foot.js +10 -0
- package/dist/table/table-head.d.ts +2 -0
- package/dist/table/table-head.js +10 -0
- package/dist/table/table-header.d.ts +8 -0
- package/dist/table/table-header.js +35 -0
- package/dist/table/table-row.d.ts +2 -0
- package/dist/table/table-row.js +10 -0
- package/dist/table/table.d.ts +25 -0
- package/dist/table/table.js +33 -0
- package/dist/table/table.test.d.ts +1 -0
- package/dist/table/table.test.js +18 -0
- package/dist/tabs/tab-item.d.ts +17 -0
- package/dist/tabs/tab-item.js +42 -0
- package/dist/tabs/tab-list.d.ts +5 -0
- package/dist/tabs/tab-list.js +62 -0
- package/dist/tabs/tab-panel.d.ts +7 -0
- package/dist/tabs/tab-panel.js +22 -0
- package/dist/tabs/tabs-content.d.ts +1 -0
- package/dist/tabs/tabs-content.js +17 -0
- package/dist/tabs/tabs.d.ts +7 -0
- package/dist/tabs/tabs.js +24 -0
- package/dist/tabs/tabs.test.d.ts +1 -0
- package/dist/tabs/tabs.test.js +44 -0
- package/dist/tag/tag.d.ts +19 -0
- package/dist/tag/tag.js +27 -0
- package/dist/tag/tag.test.d.ts +1 -0
- package/dist/tag/tag.test.js +40 -0
- package/dist/test-utilities-BS7B3BF-.js +34112 -0
- package/dist/test-utilities.d.ts +8 -0
- package/dist/test-utilities.js +87 -0
- package/dist/text-input/text-input.d.ts +23 -0
- package/dist/text-input/text-input.js +7 -0
- package/dist/textarea/textarea.d.ts +13 -0
- package/dist/textarea/textarea.js +98 -0
- package/dist/toast/ds-toast.d.ts +82 -0
- package/dist/toast/ds-toast.js +116 -0
- package/dist/toast/toast.d.ts +6 -0
- package/dist/toast/toast.js +125 -0
- package/dist/toast/toast.test.d.ts +1 -0
- package/dist/toast/toast.test.js +44 -0
- package/dist/toast/types.d.ts +24 -0
- package/dist/toast/types.js +1 -0
- package/dist/tooltip/tooltip.d.ts +10 -0
- package/dist/tooltip/tooltip.js +67 -0
- package/dist/tooltip/tooltip.test.d.ts +1 -0
- package/dist/tooltip/tooltip.test.js +85 -0
- package/dist/utilities.d.ts +9 -0
- package/dist/utilities.js +13 -0
- package/dist/utils/utilities.d.ts +24 -0
- package/dist/utils/utilities.js +20 -0
- package/dist/utils/utilities.test.d.ts +1 -0
- package/dist/utils/utilities.test.js +79 -0
- package/package.json +3 -3
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
2
|
+
import { c as i, r as l } from "../test-utilities-BS7B3BF-.js";
|
|
3
|
+
import { SummaryList as m, SummaryListRow as r, SummaryListValue as o, SummaryListAction as a } from "./summary-list.js";
|
|
4
|
+
describe("govieSummaryList", () => {
|
|
5
|
+
afterEach(i);
|
|
6
|
+
const c = (e) => l(/* @__PURE__ */ t(m, { ...e }));
|
|
7
|
+
it("should render SummaryList and its rows correctly", () => {
|
|
8
|
+
const { getByText: e } = c({
|
|
9
|
+
children: [
|
|
10
|
+
/* @__PURE__ */ n(r, { label: "Name", children: [
|
|
11
|
+
/* @__PURE__ */ t(o, { children: "John Smith" }),
|
|
12
|
+
/* @__PURE__ */ t(a, { href: "/change-name", children: "Change name" })
|
|
13
|
+
] }, "1"),
|
|
14
|
+
/* @__PURE__ */ n(r, { label: "Date of Birth", children: [
|
|
15
|
+
/* @__PURE__ */ t(o, { children: "8 November 1982" }),
|
|
16
|
+
/* @__PURE__ */ t(a, { href: "/change-dob", children: "Change date of birth" })
|
|
17
|
+
] }, "2")
|
|
18
|
+
]
|
|
19
|
+
});
|
|
20
|
+
expect(e("Name")).toBeInTheDocument(), expect(e("John Smith")).toBeInTheDocument(), expect(e("Change name")).toBeInTheDocument(), expect(e("Date of Birth")).toBeInTheDocument(), expect(e("8 November 1982")).toBeInTheDocument(), expect(e("Change date of birth")).toBeInTheDocument();
|
|
21
|
+
}), it("should render correctly a row without an action", () => {
|
|
22
|
+
const { getByText: e } = c({
|
|
23
|
+
children: [
|
|
24
|
+
/* @__PURE__ */ t(r, { label: "Address", children: /* @__PURE__ */ n(o, { children: [
|
|
25
|
+
"72 Guild Street",
|
|
26
|
+
/* @__PURE__ */ t("br", {}),
|
|
27
|
+
"London",
|
|
28
|
+
/* @__PURE__ */ t("br", {}),
|
|
29
|
+
"SE23 6FH"
|
|
30
|
+
] }) }, "1")
|
|
31
|
+
]
|
|
32
|
+
});
|
|
33
|
+
expect(e("Address")).toBeInTheDocument(), expect(e("72 Guild Street", { exact: !1 })).toBeInTheDocument(), expect(e("London", { exact: !1 })).toBeInTheDocument(), expect(e("SE23 6FH", { exact: !1 })).toBeInTheDocument();
|
|
34
|
+
}), it("should render correctly with `withBorder` prop", () => {
|
|
35
|
+
const { getByText: e } = c({
|
|
36
|
+
children: [
|
|
37
|
+
/* @__PURE__ */ t(r, { label: "Contact Details", withBorder: !0, children: /* @__PURE__ */ n(o, { children: [
|
|
38
|
+
"07700 900900",
|
|
39
|
+
/* @__PURE__ */ t("br", {}),
|
|
40
|
+
"john.smith@example.com"
|
|
41
|
+
] }) }, "1")
|
|
42
|
+
]
|
|
43
|
+
}), h = e("Contact Details").closest("dl");
|
|
44
|
+
expect(h).toHaveAttribute("data-border", "true");
|
|
45
|
+
}), it("should pass axe accessibility tests", async () => {
|
|
46
|
+
const { axe: e } = c({
|
|
47
|
+
children: [
|
|
48
|
+
/* @__PURE__ */ n(r, { label: "Name", children: [
|
|
49
|
+
/* @__PURE__ */ t(o, { children: "John Smith" }),
|
|
50
|
+
/* @__PURE__ */ t(a, { href: "/change-name", children: "Change name" })
|
|
51
|
+
] }, "1")
|
|
52
|
+
]
|
|
53
|
+
});
|
|
54
|
+
await e();
|
|
55
|
+
});
|
|
56
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { LinkProps } from '../link/link.js';
|
|
2
|
+
import { SummaryListAction, SummaryListRow, SummaryListValue } from './summary-list.js';
|
|
3
|
+
export type SummaryListItem = {
|
|
4
|
+
key: string;
|
|
5
|
+
value: string | string[];
|
|
6
|
+
actionLink: LinkProps;
|
|
7
|
+
};
|
|
8
|
+
export type SummaryListValueProps = {
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
};
|
|
11
|
+
export type SummaryListActionProps = Pick<LinkProps, 'children' | 'href' | 'asChild'>;
|
|
12
|
+
export type SummaryListRowProps = {
|
|
13
|
+
label: string;
|
|
14
|
+
withBorder?: boolean;
|
|
15
|
+
children: React.ReactElement<typeof SummaryListValue | typeof SummaryListAction> | React.ReactElement<typeof SummaryListValue | typeof SummaryListAction>[];
|
|
16
|
+
} & React.AriaAttributes;
|
|
17
|
+
export type SummaryListProps = {
|
|
18
|
+
children: React.ReactElement<typeof SummaryListRow>[] | React.ReactElement<typeof SummaryListRow>;
|
|
19
|
+
dataTestid?: string;
|
|
20
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export type CaptionProps = {
|
|
3
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
4
|
+
} & React.HTMLAttributes<HTMLTableCaptionElement>;
|
|
5
|
+
export declare function Caption({ children, size, ...props }: CaptionProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { cn as e } from "../cn.js";
|
|
3
|
+
function m({ children: a, size: i = "lg", ...t }) {
|
|
4
|
+
return /* @__PURE__ */ o(
|
|
5
|
+
"caption",
|
|
6
|
+
{
|
|
7
|
+
className: e(`gi-table-caption-text gi-text-${i}`, t.className),
|
|
8
|
+
...t,
|
|
9
|
+
children: a
|
|
10
|
+
}
|
|
11
|
+
);
|
|
12
|
+
}
|
|
13
|
+
export {
|
|
14
|
+
m as Caption
|
|
15
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const TableContent: import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsxs as e, Fragment as l, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { Caption as t } from "./caption.js";
|
|
3
|
+
import { TableBody as d } from "./table-body.js";
|
|
4
|
+
import { TableData as a } from "./table-data.js";
|
|
5
|
+
import { TableFoot as n } from "./table-foot.js";
|
|
6
|
+
import { TableHead as h } from "./table-head.js";
|
|
7
|
+
import { TableHeader as i } from "./table-header.js";
|
|
8
|
+
import { TableRow as o } from "./table-row.js";
|
|
9
|
+
const x = /* @__PURE__ */ e(l, { children: [
|
|
10
|
+
/* @__PURE__ */ r(t, { children: "This is caption" }),
|
|
11
|
+
/* @__PURE__ */ r(h, { children: /* @__PURE__ */ r(o, { children: /* @__PURE__ */ r(i, { children: "This is the table head" }) }) }),
|
|
12
|
+
/* @__PURE__ */ e(d, { children: [
|
|
13
|
+
/* @__PURE__ */ e(o, { children: [
|
|
14
|
+
/* @__PURE__ */ r(i, { children: "Header 1" }),
|
|
15
|
+
/* @__PURE__ */ r(a, { children: "Data 1" })
|
|
16
|
+
] }),
|
|
17
|
+
/* @__PURE__ */ e(o, { children: [
|
|
18
|
+
/* @__PURE__ */ r(i, { children: "Header 2" }),
|
|
19
|
+
/* @__PURE__ */ r(a, { children: "Data 2" })
|
|
20
|
+
] })
|
|
21
|
+
] }),
|
|
22
|
+
/* @__PURE__ */ r(n, { children: /* @__PURE__ */ r(o, { children: /* @__PURE__ */ r(i, { children: "This is a foot" }) }) })
|
|
23
|
+
] });
|
|
24
|
+
export {
|
|
25
|
+
x as TableContent
|
|
26
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { TdHTMLAttributes } from 'react';
|
|
2
|
+
import { TableAlign, VerticalAlign } from './table.js';
|
|
3
|
+
interface TableDataProps extends TdHTMLAttributes<HTMLTableCellElement> {
|
|
4
|
+
align?: TableAlign;
|
|
5
|
+
valign?: VerticalAlign;
|
|
6
|
+
}
|
|
7
|
+
export declare function TableData({ align, valign, className, children, ...props }: TableDataProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { cn as m } from "../cn.js";
|
|
3
|
+
function c({
|
|
4
|
+
align: t = "left",
|
|
5
|
+
valign: e = "middle",
|
|
6
|
+
className: i,
|
|
7
|
+
children: l,
|
|
8
|
+
...n
|
|
9
|
+
}) {
|
|
10
|
+
const g = {
|
|
11
|
+
left: "gi-text-left",
|
|
12
|
+
center: "gi-text-center",
|
|
13
|
+
right: "gi-text-right"
|
|
14
|
+
}[t], o = {
|
|
15
|
+
top: "gi-align-top",
|
|
16
|
+
middle: "gi-align-middle",
|
|
17
|
+
bottom: "gi-align-bottom"
|
|
18
|
+
}[e];
|
|
19
|
+
return /* @__PURE__ */ a(
|
|
20
|
+
"td",
|
|
21
|
+
{
|
|
22
|
+
className: m(
|
|
23
|
+
g,
|
|
24
|
+
o,
|
|
25
|
+
"gi-table-td",
|
|
26
|
+
i
|
|
27
|
+
),
|
|
28
|
+
...n,
|
|
29
|
+
children: l
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
export {
|
|
34
|
+
c as TableData
|
|
35
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ThHTMLAttributes } from 'react';
|
|
2
|
+
import { TableAlign, VerticalAlign } from './table.js';
|
|
3
|
+
interface TableHeaderProps extends ThHTMLAttributes<HTMLTableCellElement> {
|
|
4
|
+
align?: TableAlign;
|
|
5
|
+
valign?: VerticalAlign;
|
|
6
|
+
}
|
|
7
|
+
export declare function TableHeader({ align, valign, className, children, ...props }: TableHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { cn as a } from "../cn.js";
|
|
3
|
+
function c({
|
|
4
|
+
align: t = "left",
|
|
5
|
+
valign: e = "middle",
|
|
6
|
+
className: i,
|
|
7
|
+
children: l,
|
|
8
|
+
...n
|
|
9
|
+
}) {
|
|
10
|
+
const g = {
|
|
11
|
+
left: "gi-text-left",
|
|
12
|
+
center: "gi-text-center",
|
|
13
|
+
right: "gi-text-right"
|
|
14
|
+
}[t], o = {
|
|
15
|
+
top: "gi-align-top",
|
|
16
|
+
middle: "gi-align-middle",
|
|
17
|
+
bottom: "gi-align-bottom"
|
|
18
|
+
}[e];
|
|
19
|
+
return /* @__PURE__ */ r(
|
|
20
|
+
"th",
|
|
21
|
+
{
|
|
22
|
+
className: a(
|
|
23
|
+
g,
|
|
24
|
+
o,
|
|
25
|
+
"gi-table-th",
|
|
26
|
+
i
|
|
27
|
+
),
|
|
28
|
+
...n,
|
|
29
|
+
children: l
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
export {
|
|
34
|
+
c as TableHeader
|
|
35
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { VariantProps } from 'tailwind-variants';
|
|
3
|
+
export type TableAlign = 'left' | 'center' | 'right';
|
|
4
|
+
export type VerticalAlign = 'top' | 'middle' | 'bottom';
|
|
5
|
+
declare const tableVariants: import('tailwind-variants').TVReturnType<{
|
|
6
|
+
layout: {
|
|
7
|
+
auto: string;
|
|
8
|
+
fixed: string;
|
|
9
|
+
};
|
|
10
|
+
}, undefined, "gi-table", TVConfig<V, EV>, {
|
|
11
|
+
layout: {
|
|
12
|
+
auto: string;
|
|
13
|
+
fixed: string;
|
|
14
|
+
};
|
|
15
|
+
}, undefined, import('tailwind-variants').TVReturnType<{
|
|
16
|
+
layout: {
|
|
17
|
+
auto: string;
|
|
18
|
+
fixed: string;
|
|
19
|
+
};
|
|
20
|
+
}, undefined, "gi-table", TVConfig<V, EV>, unknown, unknown, undefined>>;
|
|
21
|
+
export type TableProps = VariantProps<typeof tableVariants> & {
|
|
22
|
+
dataTestid?: string;
|
|
23
|
+
} & React.TableHTMLAttributes<HTMLTableElement>;
|
|
24
|
+
export declare function Table({ layout, dataTestid, children, ...props }: React.PropsWithChildren<TableProps>): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { c as l } from "../index-DNkhmzZp.js";
|
|
3
|
+
import { cn as r } from "../cn.js";
|
|
4
|
+
const b = l({
|
|
5
|
+
base: "gi-table",
|
|
6
|
+
variants: {
|
|
7
|
+
layout: {
|
|
8
|
+
auto: "gi-table-auto",
|
|
9
|
+
fixed: "gi-table-fixed"
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
function u({
|
|
14
|
+
layout: t = "auto",
|
|
15
|
+
dataTestid: a,
|
|
16
|
+
children: e,
|
|
17
|
+
...o
|
|
18
|
+
}) {
|
|
19
|
+
const s = b({ layout: t });
|
|
20
|
+
return /* @__PURE__ */ i(
|
|
21
|
+
"table",
|
|
22
|
+
{
|
|
23
|
+
className: r(s),
|
|
24
|
+
role: "table",
|
|
25
|
+
"data-testid": a,
|
|
26
|
+
...o,
|
|
27
|
+
children: e
|
|
28
|
+
}
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
export {
|
|
32
|
+
u as Table
|
|
33
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { c as a, r as n } from "../test-utilities-BS7B3BF-.js";
|
|
3
|
+
import { TableContent as r } from "./table-content.js";
|
|
4
|
+
import { Table as o } from "./table.js";
|
|
5
|
+
describe("table", () => {
|
|
6
|
+
afterEach(a);
|
|
7
|
+
const t = (e) => n(/* @__PURE__ */ s(o, { ...e }));
|
|
8
|
+
it("should render table", () => {
|
|
9
|
+
const e = t({
|
|
10
|
+
children: r
|
|
11
|
+
});
|
|
12
|
+
expect(e.getByText("This is the table head")).toBeTruthy();
|
|
13
|
+
}), it("should pass axe tests", async () => {
|
|
14
|
+
await t({
|
|
15
|
+
children: r
|
|
16
|
+
}).axe();
|
|
17
|
+
});
|
|
18
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { default as React, FC } from 'react';
|
|
2
|
+
export type TabItemProps = {
|
|
3
|
+
value: string;
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
href?: string;
|
|
6
|
+
checked?: boolean;
|
|
7
|
+
ariaLabel?: string;
|
|
8
|
+
ariaLabelledby?: string;
|
|
9
|
+
onTabClick?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
10
|
+
};
|
|
11
|
+
export type InternalTabItemProps = TabItemProps & {
|
|
12
|
+
onTabClick?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
13
|
+
onTabKeyDown?: (event: React.KeyboardEvent<HTMLButtonElement>) => void;
|
|
14
|
+
index: number;
|
|
15
|
+
};
|
|
16
|
+
export declare const TabItem: FC<TabItemProps>;
|
|
17
|
+
export declare const InternalTabItem: FC<InternalTabItemProps>;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
3
|
+
import { useRef as f, useEffect as b } from "react";
|
|
4
|
+
import { slugify as p } from "../utilities.js";
|
|
5
|
+
const g = () => null, N = ({
|
|
6
|
+
value: m,
|
|
7
|
+
href: s,
|
|
8
|
+
checked: e = !1,
|
|
9
|
+
children: i,
|
|
10
|
+
onTabClick: l,
|
|
11
|
+
onTabKeyDown: n
|
|
12
|
+
}) => {
|
|
13
|
+
const o = p(m), a = f(null), c = f(!1);
|
|
14
|
+
return b(() => {
|
|
15
|
+
var t;
|
|
16
|
+
e && !c.current && ((t = a.current) == null || t.click());
|
|
17
|
+
}, [e]), /* @__PURE__ */ r(
|
|
18
|
+
"button",
|
|
19
|
+
{
|
|
20
|
+
ref: a,
|
|
21
|
+
id: `tab-${o}`,
|
|
22
|
+
role: "tab",
|
|
23
|
+
"aria-roledescription": "tab",
|
|
24
|
+
"aria-selected": e ? "true" : "false",
|
|
25
|
+
"aria-controls": `tab-panel-${o}`,
|
|
26
|
+
className: `gi-tab-item ${e ? "gi-tab-item-checked" : ""}`,
|
|
27
|
+
onClick: (t) => {
|
|
28
|
+
var u;
|
|
29
|
+
c.current = !0, l && l(t), (u = a.current) == null || u.blur();
|
|
30
|
+
},
|
|
31
|
+
onKeyDown: (t) => {
|
|
32
|
+
n && n(t);
|
|
33
|
+
},
|
|
34
|
+
children: s ? /* @__PURE__ */ r("a", { href: s, className: "gi-decoration-xs", children: i }) : /* @__PURE__ */ r("span", { className: "gi-decoration-xs", children: i })
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
};
|
|
38
|
+
g.displayName = "TabItem";
|
|
39
|
+
export {
|
|
40
|
+
N as InternalTabItem,
|
|
41
|
+
g as TabItem
|
|
42
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as b } from "react/jsx-runtime";
|
|
3
|
+
import { useState as m, Children as s, useEffect as w, isValidElement as u } from "react";
|
|
4
|
+
import { InternalTabItem as C } from "./tab-item.js";
|
|
5
|
+
const q = ({
|
|
6
|
+
children: r,
|
|
7
|
+
tabName: f
|
|
8
|
+
}) => {
|
|
9
|
+
const [c, o] = m(null), n = s.count(r);
|
|
10
|
+
w(() => {
|
|
11
|
+
let e = !1, a = 0;
|
|
12
|
+
s.forEach(r, (t, l) => {
|
|
13
|
+
u(t) && "checked" in t.props && t.props.checked === !0 && (a = l, e = !0);
|
|
14
|
+
}), o(e ? a : 0);
|
|
15
|
+
}, []);
|
|
16
|
+
const p = (e, a) => (t) => {
|
|
17
|
+
o(e);
|
|
18
|
+
const d = [
|
|
19
|
+
...document.querySelector(`#${f}`).querySelectorAll("[role=tabpanel]")
|
|
20
|
+
];
|
|
21
|
+
for (const y of d)
|
|
22
|
+
y.style.display = "none";
|
|
23
|
+
const i = t.currentTarget.getAttribute("aria-controls");
|
|
24
|
+
if (!i)
|
|
25
|
+
return;
|
|
26
|
+
const h = document.querySelector(
|
|
27
|
+
`#${i}`
|
|
28
|
+
);
|
|
29
|
+
h.style.display = "block", a && a(t);
|
|
30
|
+
}, T = (e) => {
|
|
31
|
+
let a = !1;
|
|
32
|
+
switch (e.key) {
|
|
33
|
+
case "ArrowLeft": {
|
|
34
|
+
let t = (c ?? 0) - 1;
|
|
35
|
+
t < 0 && (t = 0), o(t), a = !0;
|
|
36
|
+
break;
|
|
37
|
+
}
|
|
38
|
+
case "ArrowRight": {
|
|
39
|
+
let t = (c ?? 0) + 1;
|
|
40
|
+
t >= n && (t = n - 1), o(t), a = !0;
|
|
41
|
+
break;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
a && (e.stopPropagation(), e.preventDefault());
|
|
45
|
+
}, k = s.map(r, (e, a) => {
|
|
46
|
+
var t;
|
|
47
|
+
return u(e) ? /* @__PURE__ */ b(
|
|
48
|
+
C,
|
|
49
|
+
{
|
|
50
|
+
...e.props,
|
|
51
|
+
index: a,
|
|
52
|
+
checked: c === a,
|
|
53
|
+
onTabKeyDown: T,
|
|
54
|
+
onTabClick: p(a, (t = e == null ? void 0 : e.props) == null ? void 0 : t.onTabClick)
|
|
55
|
+
}
|
|
56
|
+
) : null;
|
|
57
|
+
});
|
|
58
|
+
return /* @__PURE__ */ b("div", { role: "tablist", className: "gi--mb-[1px]", children: k });
|
|
59
|
+
};
|
|
60
|
+
export {
|
|
61
|
+
q as TabList
|
|
62
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { slugify as n } from "../utilities.js";
|
|
3
|
+
function i({
|
|
4
|
+
value: e,
|
|
5
|
+
children: l
|
|
6
|
+
}) {
|
|
7
|
+
const a = n(e);
|
|
8
|
+
return /* @__PURE__ */ t(
|
|
9
|
+
"div",
|
|
10
|
+
{
|
|
11
|
+
role: "tabpanel",
|
|
12
|
+
"aria-labelledby": `tab-${a}`,
|
|
13
|
+
id: `tab-panel-${a}`,
|
|
14
|
+
tabIndex: 0,
|
|
15
|
+
className: "gi-tab-panel",
|
|
16
|
+
children: l
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
i as TabPanel
|
|
22
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const TabsContent: import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsxs as n, Fragment as r, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { TabItem as e } from "./tab-item.js";
|
|
3
|
+
import { TabList as b } from "./tab-list.js";
|
|
4
|
+
import { TabPanel as t } from "./tab-panel.js";
|
|
5
|
+
const m = /* @__PURE__ */ n(r, { children: [
|
|
6
|
+
/* @__PURE__ */ n(b, { tabName: "tab-1", children: [
|
|
7
|
+
/* @__PURE__ */ a(e, { value: "tab1", checked: !0, children: "Tab 1" }),
|
|
8
|
+
/* @__PURE__ */ a(e, { value: "tab2", children: "Tab 2" }),
|
|
9
|
+
/* @__PURE__ */ a(e, { value: "tab3", children: "Tab 3" })
|
|
10
|
+
] }),
|
|
11
|
+
/* @__PURE__ */ a(t, { value: "tab1", children: "Tab 1 Content" }),
|
|
12
|
+
/* @__PURE__ */ a(t, { value: "tab2", children: "Tab 2 Content" }),
|
|
13
|
+
/* @__PURE__ */ a(t, { value: "tab3", children: "Tab 3 Content" })
|
|
14
|
+
] });
|
|
15
|
+
export {
|
|
16
|
+
m as TabsContent
|
|
17
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { Children as o, isValidElement as d, cloneElement as l } from "react";
|
|
3
|
+
import { generateRandomId as s } from "../utilities.js";
|
|
4
|
+
function p({
|
|
5
|
+
id: a = s(),
|
|
6
|
+
ariaLabelledBy: t,
|
|
7
|
+
dataTestid: e,
|
|
8
|
+
children: i
|
|
9
|
+
}) {
|
|
10
|
+
const n = o.map(i, (r) => d(r) ? l(r, { tabName: a }) : r);
|
|
11
|
+
return /* @__PURE__ */ m(
|
|
12
|
+
"div",
|
|
13
|
+
{
|
|
14
|
+
"aria-labelledby": t,
|
|
15
|
+
className: "gi-tabs",
|
|
16
|
+
id: a,
|
|
17
|
+
"data-testid": e,
|
|
18
|
+
children: n
|
|
19
|
+
}
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
p as Tabs
|
|
24
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|