@ogcio/design-system-react 1.11.0 → 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 +4 -5
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
const i = "gi-hidden", d = "gi-block", f = () => {
|
|
2
|
+
const e = document.querySelectorAll(
|
|
3
|
+
"[id^='ItemActionTrigger-']"
|
|
4
|
+
), a = document.querySelectorAll("[id^='SlotContainer-']"), c = document.querySelector(
|
|
5
|
+
"#SearchTrigger"
|
|
6
|
+
);
|
|
7
|
+
return {
|
|
8
|
+
itemSlotActions: e,
|
|
9
|
+
slotContainers: a,
|
|
10
|
+
searchTrigger: c
|
|
11
|
+
};
|
|
12
|
+
}, A = (e) => {
|
|
13
|
+
const { itemSlotActions: a } = f();
|
|
14
|
+
if (e.checked)
|
|
15
|
+
for (const c of a) {
|
|
16
|
+
const h = c;
|
|
17
|
+
h.checked = !1, h.dispatchEvent(
|
|
18
|
+
new CustomEvent("change", {
|
|
19
|
+
detail: {
|
|
20
|
+
fromSearchTrigger: !0
|
|
21
|
+
}
|
|
22
|
+
})
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
}, v = (e) => {
|
|
26
|
+
A(e.target);
|
|
27
|
+
}, T = () => {
|
|
28
|
+
const { itemSlotActions: e, slotContainers: a, searchTrigger: c } = f();
|
|
29
|
+
if (e.length > 0) {
|
|
30
|
+
const h = (t, o, m) => {
|
|
31
|
+
const l = t.dataset.index || "", s = document.querySelector(
|
|
32
|
+
`#ItemIconActionTrigger-${l}`
|
|
33
|
+
), r = document.querySelector(
|
|
34
|
+
`#ItemCloseTrigger-${l}`
|
|
35
|
+
), { itemSlotActions: g } = f(), u = document.querySelector(
|
|
36
|
+
`#SlotContainer-${l}`
|
|
37
|
+
);
|
|
38
|
+
if (!o || m)
|
|
39
|
+
for (const n of a)
|
|
40
|
+
n.classList.remove(d), n.classList.add(i);
|
|
41
|
+
if (t.checked && !o)
|
|
42
|
+
s.classList.add(i), r.classList.add(d), r.classList.remove(i), u.classList.remove(i), u.classList.add(d);
|
|
43
|
+
else {
|
|
44
|
+
r.classList.add(i), r.classList.remove(d), s.classList.add(d), s.classList.remove(i);
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
const L = [...g].filter(
|
|
48
|
+
(n) => n.checked && n.id !== t.id
|
|
49
|
+
);
|
|
50
|
+
for (const n of L)
|
|
51
|
+
n.checked = !1, n.dispatchEvent(
|
|
52
|
+
new CustomEvent("change", {
|
|
53
|
+
detail: {
|
|
54
|
+
fromFilteredItems: !0
|
|
55
|
+
}
|
|
56
|
+
})
|
|
57
|
+
);
|
|
58
|
+
}, S = (t) => {
|
|
59
|
+
var r, g;
|
|
60
|
+
const o = t, m = (r = o == null ? void 0 : o.detail) == null ? void 0 : r.fromFilteredItems, l = (g = o == null ? void 0 : o.detail) == null ? void 0 : g.fromSearchTrigger, s = t.target;
|
|
61
|
+
h(s, m, l), c != null && c.checked && (s != null && s.checked) && (c.checked = !1, c.dispatchEvent(new Event("change", { bubbles: !0 })));
|
|
62
|
+
};
|
|
63
|
+
for (const t of e)
|
|
64
|
+
t == null || t.addEventListener("change", S);
|
|
65
|
+
return () => {
|
|
66
|
+
for (const t of e)
|
|
67
|
+
t == null || t.removeEventListener("change", S);
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
}, k = () => {
|
|
71
|
+
const e = document.querySelector("#SearchTrigger");
|
|
72
|
+
return e && e.addEventListener("change", v), () => {
|
|
73
|
+
e && e.removeEventListener("change", v);
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
export {
|
|
77
|
+
T as attachEventsToItemActionTriggers,
|
|
78
|
+
k as attachEventsToSearchTrigger
|
|
79
|
+
};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { LogoProps } from '../common/types.js';
|
|
2
|
+
import { DrawerPosition } from '../drawer/drawer.js';
|
|
3
|
+
import { IconId } from '../icon/icon.js';
|
|
4
|
+
export type HeaderItemMode = 'always' | 'mobile-only' | 'desktop-only';
|
|
5
|
+
export type HeaderItemAppearance = 'dropdown' | 'drawer';
|
|
6
|
+
export type HeaderItemType = 'slot' | 'divider' | 'link' | 'custom-link';
|
|
7
|
+
type CommonProps = {
|
|
8
|
+
showItemMode?: HeaderItemMode;
|
|
9
|
+
};
|
|
10
|
+
type ConditionalProps = {
|
|
11
|
+
label?: string;
|
|
12
|
+
ariaLabel?: string;
|
|
13
|
+
icon?: IconId;
|
|
14
|
+
component: React.ReactNode;
|
|
15
|
+
href?: never;
|
|
16
|
+
external?: never;
|
|
17
|
+
onClick?: never;
|
|
18
|
+
slotAppearance?: HeaderItemAppearance;
|
|
19
|
+
drawerPosition?: DrawerPosition;
|
|
20
|
+
itemType: 'slot';
|
|
21
|
+
} | {
|
|
22
|
+
label?: never;
|
|
23
|
+
ariaLabel?: string;
|
|
24
|
+
icon?: never;
|
|
25
|
+
component?: never;
|
|
26
|
+
href?: never;
|
|
27
|
+
external?: never;
|
|
28
|
+
onClick?: never;
|
|
29
|
+
slotAppearance?: never;
|
|
30
|
+
drawerPosition?: never;
|
|
31
|
+
itemType: 'divider';
|
|
32
|
+
} | {
|
|
33
|
+
label?: string;
|
|
34
|
+
ariaLabel?: string;
|
|
35
|
+
icon?: IconId;
|
|
36
|
+
component?: never;
|
|
37
|
+
href?: string;
|
|
38
|
+
external?: boolean;
|
|
39
|
+
onClick?: React.MouseEventHandler<HTMLElement>;
|
|
40
|
+
slotAppearance?: never;
|
|
41
|
+
drawerPosition?: never;
|
|
42
|
+
itemType: 'link';
|
|
43
|
+
} | {
|
|
44
|
+
label?: never;
|
|
45
|
+
ariaLabel?: string;
|
|
46
|
+
icon?: never;
|
|
47
|
+
component: React.ReactNode;
|
|
48
|
+
href?: never;
|
|
49
|
+
external?: never;
|
|
50
|
+
onClick?: never;
|
|
51
|
+
slotAppearance?: never;
|
|
52
|
+
drawerPosition?: never;
|
|
53
|
+
itemType: 'custom-link';
|
|
54
|
+
};
|
|
55
|
+
export type HeaderItem = CommonProps & ConditionalProps;
|
|
56
|
+
export type SecondaryLink = {
|
|
57
|
+
href: string;
|
|
58
|
+
label: string;
|
|
59
|
+
slot?: undefined;
|
|
60
|
+
} | {
|
|
61
|
+
slot: React.ReactNode;
|
|
62
|
+
href?: undefined;
|
|
63
|
+
label?: undefined;
|
|
64
|
+
};
|
|
65
|
+
export type HeaderProps = {
|
|
66
|
+
title?: string;
|
|
67
|
+
logo?: LogoProps;
|
|
68
|
+
addDefaultMobileMenu?: boolean;
|
|
69
|
+
mobileMenuLabel?: string;
|
|
70
|
+
items?: HeaderItem[];
|
|
71
|
+
secondaryLinks?: SecondaryLink[];
|
|
72
|
+
fullWidth?: boolean;
|
|
73
|
+
showTitleOnMobile?: boolean;
|
|
74
|
+
dataTestid?: string;
|
|
75
|
+
};
|
|
76
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { VariantProps } from 'tailwind-variants';
|
|
2
|
+
export declare const sizeVariants: {
|
|
3
|
+
xl: string;
|
|
4
|
+
lg: string;
|
|
5
|
+
md: string;
|
|
6
|
+
sm: string;
|
|
7
|
+
xs: string;
|
|
8
|
+
'2xs': string;
|
|
9
|
+
};
|
|
10
|
+
export declare const asVariants: {
|
|
11
|
+
h1: string;
|
|
12
|
+
h2: string;
|
|
13
|
+
h3: string;
|
|
14
|
+
h4: string;
|
|
15
|
+
h5: string;
|
|
16
|
+
h6: string;
|
|
17
|
+
};
|
|
18
|
+
export declare const headingVariants: import('tailwind-variants').TVReturnType<{
|
|
19
|
+
size: {
|
|
20
|
+
xl: string;
|
|
21
|
+
lg: string;
|
|
22
|
+
md: string;
|
|
23
|
+
sm: string;
|
|
24
|
+
xs: string;
|
|
25
|
+
'2xs': string;
|
|
26
|
+
};
|
|
27
|
+
as: {
|
|
28
|
+
h1: string;
|
|
29
|
+
h2: string;
|
|
30
|
+
h3: string;
|
|
31
|
+
h4: string;
|
|
32
|
+
h5: string;
|
|
33
|
+
h6: string;
|
|
34
|
+
};
|
|
35
|
+
}, {
|
|
36
|
+
text: string;
|
|
37
|
+
base: string;
|
|
38
|
+
}, undefined, TVConfig<V, EV>, {
|
|
39
|
+
size: {
|
|
40
|
+
xl: string;
|
|
41
|
+
lg: string;
|
|
42
|
+
md: string;
|
|
43
|
+
sm: string;
|
|
44
|
+
xs: string;
|
|
45
|
+
'2xs': string;
|
|
46
|
+
};
|
|
47
|
+
as: {
|
|
48
|
+
h1: string;
|
|
49
|
+
h2: string;
|
|
50
|
+
h3: string;
|
|
51
|
+
h4: string;
|
|
52
|
+
h5: string;
|
|
53
|
+
h6: string;
|
|
54
|
+
};
|
|
55
|
+
}, {
|
|
56
|
+
text: string;
|
|
57
|
+
base: string;
|
|
58
|
+
}, import('tailwind-variants').TVReturnType<{
|
|
59
|
+
size: {
|
|
60
|
+
xl: string;
|
|
61
|
+
lg: string;
|
|
62
|
+
md: string;
|
|
63
|
+
sm: string;
|
|
64
|
+
xs: string;
|
|
65
|
+
'2xs': string;
|
|
66
|
+
};
|
|
67
|
+
as: {
|
|
68
|
+
h1: string;
|
|
69
|
+
h2: string;
|
|
70
|
+
h3: string;
|
|
71
|
+
h4: string;
|
|
72
|
+
h5: string;
|
|
73
|
+
h6: string;
|
|
74
|
+
};
|
|
75
|
+
}, {
|
|
76
|
+
text: string;
|
|
77
|
+
base: string;
|
|
78
|
+
}, undefined, TVConfig<V, EV>, unknown, unknown, undefined>>;
|
|
79
|
+
export type HeadingProps = VariantProps<typeof headingVariants> & {
|
|
80
|
+
caption?: string;
|
|
81
|
+
} & React.HTMLAttributes<HTMLHeadingElement>;
|
|
82
|
+
export declare function Heading({ as, size, children, caption, className, ...props }: HeadingProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { jsxs as x, Fragment as o, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { c as l } from "../index-DNkhmzZp.js";
|
|
3
|
+
import { cn as e } from "../cn.js";
|
|
4
|
+
const c = {
|
|
5
|
+
xl: "gi-heading-xl",
|
|
6
|
+
lg: "gi-heading-lg",
|
|
7
|
+
md: "gi-heading-md",
|
|
8
|
+
sm: "gi-heading-sm",
|
|
9
|
+
xs: "gi-heading-xs",
|
|
10
|
+
"2xs": "gi-heading-2xs"
|
|
11
|
+
}, f = {
|
|
12
|
+
h1: "gi-heading-xl",
|
|
13
|
+
h2: "gi-heading-lg",
|
|
14
|
+
h3: "gi-heading-md",
|
|
15
|
+
h4: "gi-heading-sm",
|
|
16
|
+
h5: "gi-heading-xs",
|
|
17
|
+
h6: "gi-heading-2xs"
|
|
18
|
+
}, p = l({
|
|
19
|
+
slots: {
|
|
20
|
+
text: "gi-text-gray-600",
|
|
21
|
+
base: ""
|
|
22
|
+
},
|
|
23
|
+
variants: {
|
|
24
|
+
size: c,
|
|
25
|
+
as: f
|
|
26
|
+
},
|
|
27
|
+
defaultVariants: {
|
|
28
|
+
as: "h1"
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
function j({
|
|
32
|
+
as: i,
|
|
33
|
+
size: g,
|
|
34
|
+
children: n,
|
|
35
|
+
caption: a,
|
|
36
|
+
className: t,
|
|
37
|
+
...h
|
|
38
|
+
}) {
|
|
39
|
+
const d = i || "h1", { text: r, base: m } = p({ as: i, size: g });
|
|
40
|
+
return /* @__PURE__ */ x(o, { children: [
|
|
41
|
+
a && /* @__PURE__ */ s("span", { className: e(r()), "aria-hidden": "true", children: a }),
|
|
42
|
+
/* @__PURE__ */ s(d, { className: e(m(), t), ...h, children: n })
|
|
43
|
+
] });
|
|
44
|
+
}
|
|
45
|
+
export {
|
|
46
|
+
j as Heading,
|
|
47
|
+
f as asVariants,
|
|
48
|
+
p as headingVariants,
|
|
49
|
+
c as sizeVariants
|
|
50
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { c as a } from "../index-DNkhmzZp.js";
|
|
3
|
+
const d = {
|
|
4
|
+
Small: "sm",
|
|
5
|
+
Medium: "md",
|
|
6
|
+
Large: "lg"
|
|
7
|
+
}, l = a({
|
|
8
|
+
base: "gi-hint-text",
|
|
9
|
+
variants: {
|
|
10
|
+
size: {
|
|
11
|
+
sm: "gi-hint-text-sm",
|
|
12
|
+
md: "gi-hint-text-md",
|
|
13
|
+
lg: "gi-hint-text-lg"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
defaultVariants: {
|
|
17
|
+
size: "md"
|
|
18
|
+
}
|
|
19
|
+
}), r = ({
|
|
20
|
+
text: t,
|
|
21
|
+
children: i,
|
|
22
|
+
className: e,
|
|
23
|
+
size: m = d.Medium,
|
|
24
|
+
...s
|
|
25
|
+
}) => /* @__PURE__ */ n("div", { className: l({ size: m, className: e }), ...s, children: i ?? t });
|
|
26
|
+
r.displayName = "HintText";
|
|
27
|
+
export {
|
|
28
|
+
d as HintSize,
|
|
29
|
+
r as HintText
|
|
30
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { c, r } from "../test-utilities-BS7B3BF-.js";
|
|
3
|
+
import { HintText as h, HintSize as i } from "./hint-text.js";
|
|
4
|
+
describe("govieHintText", () => {
|
|
5
|
+
afterEach(c);
|
|
6
|
+
const s = (e) => r(/* @__PURE__ */ n(h, { ...e }));
|
|
7
|
+
it('should render hint text with the correct content for size "md"', () => {
|
|
8
|
+
const t = s({
|
|
9
|
+
size: i.Medium,
|
|
10
|
+
text: "This is medium hint text"
|
|
11
|
+
}).getByText("This is medium hint text");
|
|
12
|
+
expect(t).toBeTruthy(), expect(t.tagName).toBe("DIV");
|
|
13
|
+
}), it("should render small hint text with the correct class", () => {
|
|
14
|
+
const t = s({
|
|
15
|
+
size: i.Small,
|
|
16
|
+
text: "This is small hint text"
|
|
17
|
+
}).getByText("This is small hint text");
|
|
18
|
+
expect(t).toBeTruthy(), expect(t.classList.contains("gi-hint-text-sm")).toBe(!0);
|
|
19
|
+
}), it("should render large hint text with the correct class", () => {
|
|
20
|
+
const t = s({
|
|
21
|
+
size: i.Large,
|
|
22
|
+
text: "This is large hint text"
|
|
23
|
+
}).getByText("This is large hint text");
|
|
24
|
+
expect(t).toBeTruthy(), expect(t.classList.contains("gi-hint-text-lg")).toBe(!0);
|
|
25
|
+
}), it("should pass axe accessibility tests", async () => {
|
|
26
|
+
await s({
|
|
27
|
+
size: i.Medium,
|
|
28
|
+
text: "Accessible hint text"
|
|
29
|
+
}).axe();
|
|
30
|
+
});
|
|
31
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
import { HintSize } from './hint-text.js';
|
|
3
|
+
export type HintSizeType = (typeof HintSize)[keyof typeof HintSize];
|
|
4
|
+
export type HintTextProps = PropsWithChildren<React.HTMLAttributes<HTMLElement> & {
|
|
5
|
+
text?: string | React.ReactElement;
|
|
6
|
+
size?: HintSizeType;
|
|
7
|
+
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const Breakpoint: {
|
|
2
|
+
readonly ExtraSmall: "xs";
|
|
3
|
+
readonly Small: "sm";
|
|
4
|
+
readonly Medium: "md";
|
|
5
|
+
readonly Large: "lg";
|
|
6
|
+
readonly ExtraLarge: "xl";
|
|
7
|
+
};
|
|
8
|
+
export type BreakpointType = (typeof Breakpoint)[keyof typeof Breakpoint];
|
|
9
|
+
export declare const useBreakpoint: () => {
|
|
10
|
+
breakpoint: BreakpointType | null;
|
|
11
|
+
width: number | null;
|
|
12
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useState as i, useEffect as o } from "react";
|
|
3
|
+
const r = {
|
|
4
|
+
ExtraSmall: "xs",
|
|
5
|
+
Small: "sm",
|
|
6
|
+
Medium: "md",
|
|
7
|
+
Large: "lg",
|
|
8
|
+
ExtraLarge: "xl"
|
|
9
|
+
}, u = (e) => e < 480 ? r.ExtraSmall : e < 640 ? r.Small : e < 768 ? r.Medium : e < 1024 ? r.Large : r.ExtraLarge, c = () => {
|
|
10
|
+
const [e, a] = i(null), [s, l] = i(null);
|
|
11
|
+
return o(() => {
|
|
12
|
+
const t = () => {
|
|
13
|
+
const n = globalThis.window.innerWidth;
|
|
14
|
+
l(n), a(u(n));
|
|
15
|
+
};
|
|
16
|
+
return t(), globalThis.window.addEventListener("resize", t), () => {
|
|
17
|
+
globalThis.window.removeEventListener("resize", t);
|
|
18
|
+
};
|
|
19
|
+
}, []), { breakpoint: e, width: s };
|
|
20
|
+
};
|
|
21
|
+
export {
|
|
22
|
+
r as Breakpoint,
|
|
23
|
+
c as useBreakpoint
|
|
24
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useDomId(): string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { a as n } from "../i18next-DxWa09nx.js";
|
|
2
|
+
import { i as l } from "../i18next-DxWa09nx.js";
|
|
3
|
+
const a = (e) => {
|
|
4
|
+
n({
|
|
5
|
+
resources: e.resources,
|
|
6
|
+
lng: e.lng || "en",
|
|
7
|
+
fallbackLng: e.fallbackLng || "en"
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
export {
|
|
11
|
+
l as i18next,
|
|
12
|
+
a as initI18n
|
|
13
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const translate: (key: string, options?: Record<string, any>) => any;
|