@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,26 @@
|
|
|
1
|
+
import { Fragment, ReactElement } from 'react';
|
|
2
|
+
import { ButtonProps, ButtonSize } from '../button/types.js';
|
|
3
|
+
import { ModalProps, ModalWrapperProps } from '../modal/types.js';
|
|
4
|
+
type DrawerChildren = Array<ReactElement<typeof DrawerBody | typeof DrawerBody>> | ReactElement<typeof Fragment>;
|
|
5
|
+
export type DrawerPosition = 'left' | 'right' | 'bottom';
|
|
6
|
+
export type DrawerProps = Omit<ModalProps, 'closeOnClick' | 'closeOnOverlayClick' | 'size'> & {
|
|
7
|
+
position?: DrawerPosition;
|
|
8
|
+
closeButtonSize?: ButtonSize;
|
|
9
|
+
children: DrawerChildren;
|
|
10
|
+
};
|
|
11
|
+
type DrawerSectionProps = {
|
|
12
|
+
children: React.ReactElement<ButtonProps> | React.ReactElement<ButtonProps>[];
|
|
13
|
+
className?: string;
|
|
14
|
+
};
|
|
15
|
+
type DrawerBodySectionProps = {
|
|
16
|
+
children: React.ReactNode;
|
|
17
|
+
className?: string;
|
|
18
|
+
};
|
|
19
|
+
export type DrawerWrapperProps = ModalWrapperProps & {
|
|
20
|
+
children: DrawerChildren;
|
|
21
|
+
};
|
|
22
|
+
export declare const DrawerWrapper: ({ children, className, ...props }: DrawerWrapperProps) => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export declare const Drawer: ({ children, triggerButton, startsOpen, closeButtonLabel, position, className, closeButtonSize, }: DrawerProps) => import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export declare const DrawerBody: ({ children, className }: DrawerBodySectionProps) => import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export declare const DrawerFooter: ({ children, className }: DrawerSectionProps) => import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as r, jsxs as x, Fragment as y } from "react/jsx-runtime";
|
|
3
|
+
import { useState as D, cloneElement as O } from "react";
|
|
4
|
+
import { cn as n } from "../cn.js";
|
|
5
|
+
import { ModalWrapper as F, ModalBody as M, ModalFooter as N } from "../modal/modal.js";
|
|
6
|
+
const b = ({
|
|
7
|
+
children: o,
|
|
8
|
+
className: e,
|
|
9
|
+
...s
|
|
10
|
+
}) => /* @__PURE__ */ r(F, { className: n("gi-drawer-container", e), ...s, children: o }), S = ({
|
|
11
|
+
children: o,
|
|
12
|
+
triggerButton: e,
|
|
13
|
+
startsOpen: s,
|
|
14
|
+
closeButtonLabel: p,
|
|
15
|
+
position: i = "right",
|
|
16
|
+
className: m,
|
|
17
|
+
closeButtonSize: f
|
|
18
|
+
}) => {
|
|
19
|
+
const [t, a] = D(!!s), w = () => a(!0), C = () => a(!1), h = O(e, {
|
|
20
|
+
"data-testid": "drawer-trigger-button-container",
|
|
21
|
+
onClick: (k) => {
|
|
22
|
+
var l, d;
|
|
23
|
+
const c = typeof ((l = e == null ? void 0 : e.props) == null ? void 0 : l.onClick) == "function" ? (d = e == null ? void 0 : e.props) == null ? void 0 : d.onClick : void 0;
|
|
24
|
+
c && c(k), w();
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
return /* @__PURE__ */ x(y, { children: [
|
|
28
|
+
h,
|
|
29
|
+
/* @__PURE__ */ r(
|
|
30
|
+
b,
|
|
31
|
+
{
|
|
32
|
+
children: o,
|
|
33
|
+
closeButtonLabel: p,
|
|
34
|
+
position: i,
|
|
35
|
+
className: m,
|
|
36
|
+
isOpen: t,
|
|
37
|
+
onClose: C,
|
|
38
|
+
closeButtonSize: f
|
|
39
|
+
}
|
|
40
|
+
)
|
|
41
|
+
] });
|
|
42
|
+
}, T = ({ children: o, className: e }) => /* @__PURE__ */ r(M, { className: n("gi-drawer-body", e), children: o }), q = ({ children: o, className: e }) => /* @__PURE__ */ r(N, { className: n("gi-drawer-footer", e), children: o });
|
|
43
|
+
export {
|
|
44
|
+
S as Drawer,
|
|
45
|
+
T as DrawerBody,
|
|
46
|
+
q as DrawerFooter,
|
|
47
|
+
b as DrawerWrapper
|
|
48
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { jsxs as d, jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { act as l } from "react";
|
|
3
|
+
import { Button as g } from "../button/button.js";
|
|
4
|
+
import { c as m, w as a, r as B } from "../test-utilities-BS7B3BF-.js";
|
|
5
|
+
import { HtmlContent as n, TriggerButton as s } from "./drawer.content.js";
|
|
6
|
+
import { Drawer as u, DrawerBody as p, DrawerFooter as w } from "./drawer.js";
|
|
7
|
+
describe("drawer", () => {
|
|
8
|
+
afterEach(m);
|
|
9
|
+
const r = (t) => B(
|
|
10
|
+
/* @__PURE__ */ d(u, { ...t, children: [
|
|
11
|
+
/* @__PURE__ */ c(p, { children: "Here is the body content of the drawer." }),
|
|
12
|
+
/* @__PURE__ */ c(w, { children: /* @__PURE__ */ c(g, { children: "Close Drawer" }) })
|
|
13
|
+
] })
|
|
14
|
+
);
|
|
15
|
+
it("should render the drawer on load if startsOpen is true", () => {
|
|
16
|
+
const t = r({
|
|
17
|
+
children: n,
|
|
18
|
+
triggerButton: s,
|
|
19
|
+
startsOpen: !0
|
|
20
|
+
}), o = t.getByTestId("modal"), e = t.getByTestId("modal-container");
|
|
21
|
+
expect(o.classList.contains("gi-modal-open")).toBe(!0), expect(e).toBeTruthy();
|
|
22
|
+
}), it("should open the drawer on button trigger", async () => {
|
|
23
|
+
const t = r({
|
|
24
|
+
children: n,
|
|
25
|
+
triggerButton: s
|
|
26
|
+
});
|
|
27
|
+
t.getByTestId(
|
|
28
|
+
"drawer-trigger-button-container"
|
|
29
|
+
).click(), await a(() => {
|
|
30
|
+
const e = t.getByTestId("modal");
|
|
31
|
+
expect(e.classList.contains("gi-modal-open")).toBe(!0);
|
|
32
|
+
});
|
|
33
|
+
}), it("should close the drawer on icon click", async () => {
|
|
34
|
+
const t = r({
|
|
35
|
+
children: n,
|
|
36
|
+
triggerButton: s
|
|
37
|
+
}), o = t.getByTestId("modal"), e = t.getByTestId(
|
|
38
|
+
"drawer-trigger-button-container"
|
|
39
|
+
);
|
|
40
|
+
expect(o.classList.contains("gi-modal-open")).toBe(!1), await l(async () => {
|
|
41
|
+
e.click();
|
|
42
|
+
}), await a(() => {
|
|
43
|
+
expect(o.classList.contains("gi-modal-open")).toBe(!0);
|
|
44
|
+
});
|
|
45
|
+
const i = t.getByTestId("modal-container").querySelector(".gi-modal-icon");
|
|
46
|
+
expect(i).toBeVisible(), await l(async () => {
|
|
47
|
+
i.click();
|
|
48
|
+
});
|
|
49
|
+
}), it("should close the drawer on overlay click", async () => {
|
|
50
|
+
const t = r({
|
|
51
|
+
children: n,
|
|
52
|
+
triggerButton: s
|
|
53
|
+
});
|
|
54
|
+
t.getByTestId(
|
|
55
|
+
"drawer-trigger-button-container"
|
|
56
|
+
).click(), await a(() => {
|
|
57
|
+
const e = t.getByTestId("modal");
|
|
58
|
+
expect(e.classList.contains("gi-modal-open")).toBe(!0), e.click();
|
|
59
|
+
}), await a(() => {
|
|
60
|
+
const e = t.getByTestId("modal");
|
|
61
|
+
expect(e.classList.contains("gi-modal-open")).toBe(!1);
|
|
62
|
+
});
|
|
63
|
+
}), it("should pass axe accessibility tests", async () => {
|
|
64
|
+
await r({
|
|
65
|
+
children: n,
|
|
66
|
+
triggerButton: s
|
|
67
|
+
}).axe();
|
|
68
|
+
});
|
|
69
|
+
});
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { c as m } from "../index-DNkhmzZp.js";
|
|
3
|
+
const d = {
|
|
4
|
+
Small: "sm",
|
|
5
|
+
Medium: "md",
|
|
6
|
+
Large: "lg"
|
|
7
|
+
}, l = m({
|
|
8
|
+
base: "gi-error-text",
|
|
9
|
+
variants: {
|
|
10
|
+
size: {
|
|
11
|
+
sm: "gi-error-text-sm",
|
|
12
|
+
md: "gi-error-text-md",
|
|
13
|
+
lg: "gi-error-text-lg"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
defaultVariants: {
|
|
17
|
+
size: "md"
|
|
18
|
+
}
|
|
19
|
+
}), x = ({
|
|
20
|
+
text: r,
|
|
21
|
+
className: e,
|
|
22
|
+
size: t = d.Medium,
|
|
23
|
+
dataTestid: i,
|
|
24
|
+
children: o,
|
|
25
|
+
...s
|
|
26
|
+
}) => /* @__PURE__ */ a(
|
|
27
|
+
"div",
|
|
28
|
+
{
|
|
29
|
+
role: "alert",
|
|
30
|
+
className: l({ size: t, className: e }),
|
|
31
|
+
"data-testid": i,
|
|
32
|
+
...s,
|
|
33
|
+
children: o ?? r
|
|
34
|
+
}
|
|
35
|
+
);
|
|
36
|
+
x.displayName = "ErrorText";
|
|
37
|
+
export {
|
|
38
|
+
d as ErrorSize,
|
|
39
|
+
x as ErrorText
|
|
40
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { r as i } from "../test-utilities-BS7B3BF-.js";
|
|
3
|
+
import { ErrorText as n, ErrorSize as s } from "./error-text.js";
|
|
4
|
+
describe("govieErrorText", () => {
|
|
5
|
+
const t = (r) => i(/* @__PURE__ */ o(n, { ...r }));
|
|
6
|
+
it("should render error text with the correct content", () => {
|
|
7
|
+
const e = t({
|
|
8
|
+
text: "This is an error message",
|
|
9
|
+
size: s.Medium
|
|
10
|
+
}).getByText("This is an error message");
|
|
11
|
+
expect(e).toBeTruthy(), expect(e.tagName).toBe("DIV");
|
|
12
|
+
}), it('should render error text with "sm" size', () => {
|
|
13
|
+
const e = t({
|
|
14
|
+
text: "Small error message",
|
|
15
|
+
size: s.Small
|
|
16
|
+
}).getByText("Small error message");
|
|
17
|
+
expect(e.classList.contains("gi-error-text-sm")).toBe(!0);
|
|
18
|
+
}), it('should render error text with "lg" size', () => {
|
|
19
|
+
const e = t({
|
|
20
|
+
text: "Large error message",
|
|
21
|
+
size: s.Large
|
|
22
|
+
}).getByText("Large error message");
|
|
23
|
+
expect(e.classList.contains("gi-error-text-lg")).toBe(!0);
|
|
24
|
+
}), it("should pass axe accessibility tests", async () => {
|
|
25
|
+
await t({
|
|
26
|
+
text: "Accessible error message",
|
|
27
|
+
size: s.Medium
|
|
28
|
+
}).axe();
|
|
29
|
+
});
|
|
30
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
import { ErrorSize } from './error-text.js';
|
|
3
|
+
export type ErrorSizeType = (typeof ErrorSize)[keyof typeof ErrorSize];
|
|
4
|
+
export type ErrorTextProps = PropsWithChildren<React.HTMLAttributes<HTMLDivElement> & {
|
|
5
|
+
text?: string | React.ReactElement;
|
|
6
|
+
size?: ErrorSizeType;
|
|
7
|
+
dataTestid?: string;
|
|
8
|
+
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { InputFileProps } from '../input-file/types.js';
|
|
2
|
+
/**
|
|
3
|
+
* @deprecated Use FileUploadProps instead of `Radio`.
|
|
4
|
+
*/
|
|
5
|
+
export type FileUploadProps = InputFileProps;
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated Use <InputFile /> instead of <FileUpload />.
|
|
8
|
+
*/
|
|
9
|
+
export declare const FileUpload: import('react').ForwardRefExoticComponent<InputFileProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { default as React, ReactNode } from 'react';
|
|
2
|
+
import { LogoProps } from '../common/types.js';
|
|
3
|
+
export type FooterProps = {
|
|
4
|
+
primarySlot?: ReactNode;
|
|
5
|
+
secondarySlot?: ReactNode;
|
|
6
|
+
utilitySlot?: ReactNode;
|
|
7
|
+
logo?: LogoProps;
|
|
8
|
+
className?: string;
|
|
9
|
+
dataTestid?: string;
|
|
10
|
+
} & React.HTMLAttributes<HTMLDivElement>;
|
|
11
|
+
export declare function Footer({ primarySlot, secondarySlot, utilitySlot, logo, className, dataTestid, ...props }: FooterProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as i, jsx as t, Fragment as u } from "react/jsx-runtime";
|
|
3
|
+
import { renderToStaticMarkup as c } from "react-dom/server";
|
|
4
|
+
import h from "../assets/logos/gov-of-ireland/harp-gold-text-green.js";
|
|
5
|
+
import p from "../assets/logos/harp/harp-white.js";
|
|
6
|
+
import { cn as v } from "../cn.js";
|
|
7
|
+
import { Container as b } from "../container/container.js";
|
|
8
|
+
import { translate as a } from "../i18n/utility.js";
|
|
9
|
+
import g from "../primitives/anchor.js";
|
|
10
|
+
import { SectionBreak as k } from "../section-break/section-break.js";
|
|
11
|
+
function l({ logo: e }) {
|
|
12
|
+
const n = `data:image/svg+xml;base64,${btoa(c(/* @__PURE__ */ t(p, {})))}`, s = `data:image/svg+xml;base64,${btoa(
|
|
13
|
+
c(/* @__PURE__ */ t(h, {}))
|
|
14
|
+
)}`;
|
|
15
|
+
return /* @__PURE__ */ i("picture", { children: [
|
|
16
|
+
/* @__PURE__ */ t("source", { srcSet: (e == null ? void 0 : e.imageLarge) || s }),
|
|
17
|
+
/* @__PURE__ */ t(
|
|
18
|
+
"img",
|
|
19
|
+
{
|
|
20
|
+
className: "gi-h-16",
|
|
21
|
+
src: (e == null ? void 0 : e.imageSmall) || n,
|
|
22
|
+
alt: (e == null ? void 0 : e.alt) || a("logo.govieLogo", { defaultValue: "Gov.ie Logo" })
|
|
23
|
+
}
|
|
24
|
+
)
|
|
25
|
+
] });
|
|
26
|
+
}
|
|
27
|
+
function H({
|
|
28
|
+
primarySlot: e,
|
|
29
|
+
secondarySlot: o,
|
|
30
|
+
utilitySlot: n,
|
|
31
|
+
logo: r,
|
|
32
|
+
className: s = "",
|
|
33
|
+
dataTestid: d,
|
|
34
|
+
...m
|
|
35
|
+
}) {
|
|
36
|
+
const f = () => /* @__PURE__ */ i(u, { children: [
|
|
37
|
+
(r == null ? void 0 : r.href) && /* @__PURE__ */ t(
|
|
38
|
+
g,
|
|
39
|
+
{
|
|
40
|
+
href: r.href,
|
|
41
|
+
"aria-label": a("footer.goToHomePage", {
|
|
42
|
+
defaultValue: "Go to Home Page"
|
|
43
|
+
}),
|
|
44
|
+
"data-testid": "logo-link",
|
|
45
|
+
external: r.external,
|
|
46
|
+
children: l({ logo: r })
|
|
47
|
+
}
|
|
48
|
+
),
|
|
49
|
+
!(r != null && r.href) && l({ logo: r })
|
|
50
|
+
] });
|
|
51
|
+
return /* @__PURE__ */ i(
|
|
52
|
+
"footer",
|
|
53
|
+
{
|
|
54
|
+
className: v("gi-footer", s),
|
|
55
|
+
"data-module": "gieds-footer",
|
|
56
|
+
role: "contentinfo",
|
|
57
|
+
"aria-label": a("footer.footer", { defaultValue: "Footer" }),
|
|
58
|
+
"data-testid": d,
|
|
59
|
+
...m,
|
|
60
|
+
children: [
|
|
61
|
+
/* @__PURE__ */ t("div", { className: "gi-footer-container", children: /* @__PURE__ */ i(b, { children: [
|
|
62
|
+
e && /* @__PURE__ */ t(
|
|
63
|
+
"div",
|
|
64
|
+
{
|
|
65
|
+
"aria-label": a("footer.primarySlot", {
|
|
66
|
+
defaultValue: "Footer Primary Slot"
|
|
67
|
+
}),
|
|
68
|
+
children: e
|
|
69
|
+
}
|
|
70
|
+
),
|
|
71
|
+
e && o && /* @__PURE__ */ t(
|
|
72
|
+
k,
|
|
73
|
+
{
|
|
74
|
+
color: "gi-border-color-border-system-neutral-subtle",
|
|
75
|
+
size: "lg"
|
|
76
|
+
}
|
|
77
|
+
),
|
|
78
|
+
/* @__PURE__ */ i(
|
|
79
|
+
"div",
|
|
80
|
+
{
|
|
81
|
+
className: "gi-footer-secondary-slot",
|
|
82
|
+
"aria-label": a("footer.secondarySlot", {
|
|
83
|
+
defaultValue: "Footer Secondary Slot"
|
|
84
|
+
}),
|
|
85
|
+
children: [
|
|
86
|
+
/* @__PURE__ */ t("div", { className: "gi-footer-logo", children: f() }),
|
|
87
|
+
o && /* @__PURE__ */ t("div", { className: "gi-footer-secondary-slot-content", children: o })
|
|
88
|
+
]
|
|
89
|
+
}
|
|
90
|
+
)
|
|
91
|
+
] }) }),
|
|
92
|
+
n && /* @__PURE__ */ t(
|
|
93
|
+
"div",
|
|
94
|
+
{
|
|
95
|
+
className: "gi-footer-utility",
|
|
96
|
+
"aria-label": a("footer.utilityLinks", {
|
|
97
|
+
defaultValue: "Footer Utility Links"
|
|
98
|
+
}),
|
|
99
|
+
children: n
|
|
100
|
+
}
|
|
101
|
+
)
|
|
102
|
+
]
|
|
103
|
+
}
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
export {
|
|
107
|
+
H as Footer
|
|
108
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { c as r, s as e, r as s } from "../test-utilities-BS7B3BF-.js";
|
|
3
|
+
import { Footer as d } from "./footer.js";
|
|
4
|
+
describe("Footer", () => {
|
|
5
|
+
afterEach(r);
|
|
6
|
+
const o = (t = {}) => s(/* @__PURE__ */ n(d, { ...t }));
|
|
7
|
+
it("should render the footer with default props", () => {
|
|
8
|
+
o({
|
|
9
|
+
dataTestid: "govie-footer"
|
|
10
|
+
});
|
|
11
|
+
const t = e.getByRole("contentinfo");
|
|
12
|
+
expect(t).toBeInTheDocument(), expect(t).toHaveAttribute("aria-label", "Footer"), expect(t).toHaveAttribute("data-testid", "govie-footer"), expect(t).toHaveClass("gi-footer");
|
|
13
|
+
}), it("should render with custom className", () => {
|
|
14
|
+
o({ className: "custom-class" });
|
|
15
|
+
const t = e.getByRole("contentinfo");
|
|
16
|
+
expect(t).toHaveClass("gi-footer custom-class");
|
|
17
|
+
}), it("should not render primary nav when primarySlot is not provided", () => {
|
|
18
|
+
o({}), expect(
|
|
19
|
+
e.queryByLabelText("Primary footer navigation")
|
|
20
|
+
).not.toBeInTheDocument();
|
|
21
|
+
}), it("should render secondary slot when provided", () => {
|
|
22
|
+
o({ secondarySlot: /* @__PURE__ */ n("div", { "data-testid": "secondary-content", children: "Secondary Content" }) }), expect(e.getByTestId("secondary-content")).toBeInTheDocument();
|
|
23
|
+
}), it("should not render secondary nav when secondarySlot is not provided", () => {
|
|
24
|
+
o({}), expect(
|
|
25
|
+
e.queryByLabelText("Secondary footer navigation")
|
|
26
|
+
).not.toBeInTheDocument();
|
|
27
|
+
}), it("should render utility slot when provided", () => {
|
|
28
|
+
o({ utilitySlot: /* @__PURE__ */ n("div", { "data-testid": "utility-content", children: "Utility Content" }) });
|
|
29
|
+
const i = e.getByLabelText("Footer Utility Links");
|
|
30
|
+
expect(i).toBeInTheDocument(), expect(e.getByTestId("utility-content")).toBeInTheDocument();
|
|
31
|
+
}), it("should not render utility section when utilitySlot is not provided", () => {
|
|
32
|
+
o({}), expect(e.queryByLabelText("Utility links")).not.toBeInTheDocument();
|
|
33
|
+
}), it("should render all slots when provided", () => {
|
|
34
|
+
o({
|
|
35
|
+
primarySlot: /* @__PURE__ */ n("div", { "data-testid": "primary", children: "Primary" }),
|
|
36
|
+
secondarySlot: /* @__PURE__ */ n("div", { "data-testid": "secondary", children: "Secondary" }),
|
|
37
|
+
utilitySlot: /* @__PURE__ */ n("div", { "data-testid": "utility", children: "Utility" })
|
|
38
|
+
}), expect(e.getByTestId("primary")).toBeInTheDocument(), expect(e.getByTestId("secondary")).toBeInTheDocument(), expect(e.getByTestId("utility")).toBeInTheDocument();
|
|
39
|
+
}), it("should pass axe tests", async () => {
|
|
40
|
+
await o({}).axe();
|
|
41
|
+
});
|
|
42
|
+
});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ErrorTextProps } from '../../error-text/types.js';
|
|
3
|
+
import { HintTextProps } from '../../hint-text/types.js';
|
|
4
|
+
import { LabelTextProps } from '../../label/types.js';
|
|
5
|
+
import { TagProps } from '../../tag/tag.js';
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated This type is deprecated and will be removed in a future release.
|
|
8
|
+
* Please use the new FormFieldProps component instead.
|
|
9
|
+
*/
|
|
10
|
+
export type FormFieldWithTagProps = {
|
|
11
|
+
error?: ErrorTextProps;
|
|
12
|
+
hint?: HintTextProps;
|
|
13
|
+
label?: LabelTextProps;
|
|
14
|
+
className?: string;
|
|
15
|
+
tag?: TagProps;
|
|
16
|
+
} & React.FieldsetHTMLAttributes<HTMLFieldSetElement>;
|
|
17
|
+
/**
|
|
18
|
+
* @deprecated This component is deprecated and will be removed in a future release.
|
|
19
|
+
* Please use the new FormField component instead.
|
|
20
|
+
*/
|
|
21
|
+
export declare const FormFieldWithTag: {
|
|
22
|
+
({ label, hint, error, children, className, tag, }: FormFieldWithTagProps): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
displayName: string;
|
|
24
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { jsxs as o, jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { S as d } from "../../index-ntYL1VRC.js";
|
|
3
|
+
import { cn as c } from "../../cn.js";
|
|
4
|
+
import { ErrorText as l } from "../../error-text/error-text.js";
|
|
5
|
+
import { HintText as f } from "../../hint-text/hint-text.js";
|
|
6
|
+
import { translate as a } from "../../i18n/utility.js";
|
|
7
|
+
import { Label as p } from "../../label/label.js";
|
|
8
|
+
import { Tag as g } from "../../tag/tag.js";
|
|
9
|
+
const n = ({
|
|
10
|
+
label: e,
|
|
11
|
+
hint: s,
|
|
12
|
+
error: i,
|
|
13
|
+
children: x,
|
|
14
|
+
className: r,
|
|
15
|
+
tag: t
|
|
16
|
+
}) => /* @__PURE__ */ o("fieldset", { className: c({ "gi-error-state": i }, r), children: [
|
|
17
|
+
/* @__PURE__ */ o("div", { className: "gi-pb-3 gi-flex gi-flex-col gi-gap-1", children: [
|
|
18
|
+
/* @__PURE__ */ o("div", { children: [
|
|
19
|
+
/* @__PURE__ */ o("div", { className: "gi-flex gi-items-center gi-justify-between", children: [
|
|
20
|
+
(e == null ? void 0 : e.text) && /* @__PURE__ */ m(
|
|
21
|
+
p,
|
|
22
|
+
{
|
|
23
|
+
text: e.text,
|
|
24
|
+
size: e.size,
|
|
25
|
+
htmlFor: e.htmlFor,
|
|
26
|
+
className: "gi-font-bold",
|
|
27
|
+
children: e.children
|
|
28
|
+
}
|
|
29
|
+
),
|
|
30
|
+
(t == null ? void 0 : t.text) && t.type && /* @__PURE__ */ m(
|
|
31
|
+
"div",
|
|
32
|
+
{
|
|
33
|
+
"aria-label": a("formField.tag", {
|
|
34
|
+
tag: t.text,
|
|
35
|
+
defaultValue: `Tag: ${t.text}`
|
|
36
|
+
}),
|
|
37
|
+
children: /* @__PURE__ */ m(g, { text: t.text, type: t.type })
|
|
38
|
+
}
|
|
39
|
+
)
|
|
40
|
+
] }),
|
|
41
|
+
(s == null ? void 0 : s.text) && /* @__PURE__ */ m(f, { text: s.text, size: s.size, className: "gi-mb-1" })
|
|
42
|
+
] }),
|
|
43
|
+
(i == null ? void 0 : i.text) && /* @__PURE__ */ m(l, { text: i.text, size: i.size, className: "gi-mb-1" })
|
|
44
|
+
] }),
|
|
45
|
+
/* @__PURE__ */ m(d, { children: x })
|
|
46
|
+
] });
|
|
47
|
+
n.displayName = "FormFieldWithTag";
|
|
48
|
+
export {
|
|
49
|
+
n as FormFieldWithTag
|
|
50
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FieldsetHTMLAttributes } from 'react';
|
|
2
|
+
import { ErrorTextProps } from '../error-text/types.js';
|
|
3
|
+
import { HintTextProps } from '../hint-text/types.js';
|
|
4
|
+
import { LabelTextProps } from '../label/types.js';
|
|
5
|
+
export type FormFieldProps = {
|
|
6
|
+
error?: ErrorTextProps;
|
|
7
|
+
hint?: HintTextProps;
|
|
8
|
+
label?: LabelTextProps;
|
|
9
|
+
className?: string;
|
|
10
|
+
} & Omit<FieldsetHTMLAttributes<HTMLFieldSetElement>, 'style'>;
|
|
11
|
+
export declare const FormField: ({ label, hint, error, children, className, ...props }: FormFieldProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { jsxs as r, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { S as g } from "../index-ntYL1VRC.js";
|
|
3
|
+
import { cn as h } from "../cn.js";
|
|
4
|
+
import { ErrorText as l } from "../error-text/error-text.js";
|
|
5
|
+
import { HintText as a } from "../hint-text/hint-text.js";
|
|
6
|
+
import { Label as z } from "../label/label.js";
|
|
7
|
+
const C = ({
|
|
8
|
+
label: e,
|
|
9
|
+
hint: s,
|
|
10
|
+
error: m,
|
|
11
|
+
children: c,
|
|
12
|
+
className: x,
|
|
13
|
+
...d
|
|
14
|
+
}) => {
|
|
15
|
+
const n = (f, t) => {
|
|
16
|
+
const o = f === "error" ? l : a;
|
|
17
|
+
return t != null && t.text ? typeof t.text == "string" ? /* @__PURE__ */ i(o, { text: t.text, size: t.size, className: "gi-mb-1" }) : /* @__PURE__ */ i(o, { size: t.size, className: "gi-mb-1", children: t.text }) : null;
|
|
18
|
+
};
|
|
19
|
+
return /* @__PURE__ */ r("fieldset", { className: h({ "gi-error-state": m }, x), ...d, children: [
|
|
20
|
+
/* @__PURE__ */ r("div", { className: "gi-pb-3 gi-flex gi-flex-col gi-gap-1", children: [
|
|
21
|
+
/* @__PURE__ */ r("div", { children: [
|
|
22
|
+
(e == null ? void 0 : e.text) && /* @__PURE__ */ i(
|
|
23
|
+
z,
|
|
24
|
+
{
|
|
25
|
+
text: e.text,
|
|
26
|
+
size: e.size,
|
|
27
|
+
htmlFor: e.htmlFor,
|
|
28
|
+
className: "gi-font-bold",
|
|
29
|
+
children: e.children
|
|
30
|
+
}
|
|
31
|
+
),
|
|
32
|
+
n("hint", s)
|
|
33
|
+
] }),
|
|
34
|
+
n("error", m)
|
|
35
|
+
] }),
|
|
36
|
+
/* @__PURE__ */ i(g, { children: c })
|
|
37
|
+
] });
|
|
38
|
+
};
|
|
39
|
+
export {
|
|
40
|
+
C as FormField
|
|
41
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { HeaderProps } from '../types.js';
|
|
2
|
+
export type MobileHeaderMenuProps = Pick<HeaderProps, 'items' | 'secondaryLinks'>;
|
|
3
|
+
type MenuItemAccordionProps = {
|
|
4
|
+
index: number;
|
|
5
|
+
item: {
|
|
6
|
+
label?: string;
|
|
7
|
+
slot: React.ReactNode;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
export declare const MenuItemAccordion: ({ index, item }: MenuItemAccordionProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare const MobileHeaderMenuItems: ({ items, secondaryLinks, }: MobileHeaderMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
declare function HeaderMenu({ ...props }: MobileHeaderMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export default HeaderMenu;
|