@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,10 @@
|
|
|
1
|
+
import { Options as PopperOptions } from '@popperjs/core';
|
|
2
|
+
export type PopoverProps = {
|
|
3
|
+
triggerRef: React.RefObject<any> | null;
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
className?: string;
|
|
6
|
+
open: boolean;
|
|
7
|
+
onOpenChange: (open: boolean) => void;
|
|
8
|
+
options?: PopperOptions;
|
|
9
|
+
extraRefs?: React.RefObject<any>[];
|
|
10
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export type AnchorProps = React.AnchorHTMLAttributes<HTMLAnchorElement> & {
|
|
3
|
+
external?: boolean;
|
|
4
|
+
asChild?: boolean;
|
|
5
|
+
};
|
|
6
|
+
declare const Anchor: ({ external, asChild, children, ...props }: AnchorProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default Anchor;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { a } from "../index-ntYL1VRC.js";
|
|
3
|
+
const f = ({
|
|
4
|
+
external: o = !1,
|
|
5
|
+
asChild: r,
|
|
6
|
+
children: e,
|
|
7
|
+
...n
|
|
8
|
+
}) => /* @__PURE__ */ t(r ? a : "a", { ...n, ...o && {
|
|
9
|
+
target: "_blank",
|
|
10
|
+
rel: "noreferrer noopener"
|
|
11
|
+
}, children: e });
|
|
12
|
+
export {
|
|
13
|
+
f as default
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { c as o, r as c } from "../test-utilities-BS7B3BF-.js";
|
|
3
|
+
import l from "./anchor.js";
|
|
4
|
+
describe("anchor", () => {
|
|
5
|
+
afterEach(o);
|
|
6
|
+
const n = (e) => c(/* @__PURE__ */ r(l, { ...e }));
|
|
7
|
+
it("should render link text", () => {
|
|
8
|
+
const e = n({
|
|
9
|
+
href: "https://example.com",
|
|
10
|
+
children: "Example Link"
|
|
11
|
+
});
|
|
12
|
+
expect(e.getByText("Example Link")).toBeTruthy();
|
|
13
|
+
}), it("should have correct href", () => {
|
|
14
|
+
const t = n({
|
|
15
|
+
href: "https://example.com",
|
|
16
|
+
children: "Example Link"
|
|
17
|
+
}).getByRole("link");
|
|
18
|
+
expect(t.getAttribute("href")).toBe("https://example.com");
|
|
19
|
+
}), it("should open in a new tab if external", () => {
|
|
20
|
+
const t = n({
|
|
21
|
+
href: "https://example.com",
|
|
22
|
+
children: "Example Link",
|
|
23
|
+
external: !0
|
|
24
|
+
}).getByRole("link");
|
|
25
|
+
expect(t.getAttribute("target")).toBe("_blank"), expect(t.getAttribute("rel")).toBe("noreferrer noopener");
|
|
26
|
+
}), it("should not open in a new tab if not external", () => {
|
|
27
|
+
const t = n({
|
|
28
|
+
href: "https://example.com",
|
|
29
|
+
children: "Example Link",
|
|
30
|
+
external: !1
|
|
31
|
+
}).getByRole("link");
|
|
32
|
+
expect(t.getAttribute("target")).not.toBe("_blank");
|
|
33
|
+
}), it("should pass axe tests", async () => {
|
|
34
|
+
await n({
|
|
35
|
+
href: "https://example.com",
|
|
36
|
+
children: "Example Link"
|
|
37
|
+
}).axe();
|
|
38
|
+
});
|
|
39
|
+
});
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsxs as l, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { cn as n } from "../cn.js";
|
|
3
|
+
import { translate as t } from "../i18n/utility.js";
|
|
4
|
+
function d({
|
|
5
|
+
value: s = 0,
|
|
6
|
+
max: e = 100,
|
|
7
|
+
isIndeterminate: r,
|
|
8
|
+
label: i
|
|
9
|
+
}) {
|
|
10
|
+
const o = s * 100 / e;
|
|
11
|
+
return /* @__PURE__ */ l("div", { className: "gi-progress-bar-container", children: [
|
|
12
|
+
/* @__PURE__ */ a(
|
|
13
|
+
"div",
|
|
14
|
+
{
|
|
15
|
+
role: "progressbar",
|
|
16
|
+
"aria-valuenow": r ? void 0 : s,
|
|
17
|
+
"aria-valuemin": 0,
|
|
18
|
+
"aria-valuemax": e,
|
|
19
|
+
"aria-label": t("progressBar.progressBar", {
|
|
20
|
+
defaultValue: "Progress bar"
|
|
21
|
+
}),
|
|
22
|
+
"data-testid": "progress-bar",
|
|
23
|
+
className: "gi-progress-bar",
|
|
24
|
+
children: /* @__PURE__ */ a(
|
|
25
|
+
"div",
|
|
26
|
+
{
|
|
27
|
+
className: n({
|
|
28
|
+
"gi-progress-bar-indeterminate": r
|
|
29
|
+
}),
|
|
30
|
+
style: r ? {} : { width: `${o}%` }
|
|
31
|
+
}
|
|
32
|
+
)
|
|
33
|
+
}
|
|
34
|
+
),
|
|
35
|
+
i && /* @__PURE__ */ a("span", { children: i })
|
|
36
|
+
] });
|
|
37
|
+
}
|
|
38
|
+
export {
|
|
39
|
+
d as ProgressBar
|
|
40
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { c as a, r as n } from "../test-utilities-BS7B3BF-.js";
|
|
3
|
+
import { ProgressBar as c } from "./progress-bar.js";
|
|
4
|
+
describe("ProgressBar", () => {
|
|
5
|
+
afterEach(a);
|
|
6
|
+
const t = (s) => n(/* @__PURE__ */ o(c, { ...s }));
|
|
7
|
+
it("should render a progress bar with a specified value", () => {
|
|
8
|
+
const e = t({
|
|
9
|
+
value: 50
|
|
10
|
+
}).getByTestId("progress-bar");
|
|
11
|
+
expect(e).toBeTruthy();
|
|
12
|
+
const r = e.firstElementChild;
|
|
13
|
+
expect(r).toBeTruthy(), expect(r).toHaveStyle("width: 50%");
|
|
14
|
+
}), it("should render an indeterminate progress bar correctly", () => {
|
|
15
|
+
const e = t({
|
|
16
|
+
isIndeterminate: !0
|
|
17
|
+
}).getByTestId("progress-bar");
|
|
18
|
+
expect(e).toBeTruthy();
|
|
19
|
+
const r = e.firstElementChild;
|
|
20
|
+
expect(r).toBeTruthy(), expect(r).toHaveClass("gi-progress-bar-indeterminate");
|
|
21
|
+
}), it("should render progress bar with final value set", () => {
|
|
22
|
+
const e = t({
|
|
23
|
+
max: 500,
|
|
24
|
+
value: 200
|
|
25
|
+
}).getByTestId("progress-bar");
|
|
26
|
+
expect(e).toBeTruthy();
|
|
27
|
+
const r = e.firstElementChild;
|
|
28
|
+
expect(r).toBeTruthy(), expect(r).toHaveStyle("width: 40%");
|
|
29
|
+
}), it("should pass axe accessibility tests", async () => {
|
|
30
|
+
await t({
|
|
31
|
+
value: 75
|
|
32
|
+
}).axe();
|
|
33
|
+
});
|
|
34
|
+
});
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { InnerStepProps, ProgressStepperProps, StepItemProps } from './types.js';
|
|
3
|
+
export declare const Step: ({ isCurrentStep, isCompleted, isLastStep, stepNumber, orientation, children, indicator, verticalSlot, defaultOpen, dataTestId, ariaLabel, verticalGap, }: InnerStepProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export declare const StepItem: FC<StepItemProps>;
|
|
5
|
+
export declare const ProgressStepper: ({ children, currentStepIndex, orientation, indicator, completeAll, dataTestId, className, verticalGap, }: ProgressStepperProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import { jsxs as f, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { Children as P } from "react";
|
|
3
|
+
import { cn as $ } from "../cn.js";
|
|
4
|
+
import { Icon as z } from "../icon/icon.js";
|
|
5
|
+
import { ProgressStepperIndicator as v } from "./types.js";
|
|
6
|
+
const j = (e) => `calc(100% + ${e * 4 - 36}px)`, k = ({
|
|
7
|
+
isNextStep: e,
|
|
8
|
+
orientation: t = "horizontal",
|
|
9
|
+
isCurrentStep: s,
|
|
10
|
+
isCompleted: a,
|
|
11
|
+
verticalGap: l
|
|
12
|
+
}) => {
|
|
13
|
+
const o = t === "vertical" ? { height: j(l) } : void 0;
|
|
14
|
+
return /* @__PURE__ */ f(
|
|
15
|
+
"div",
|
|
16
|
+
{
|
|
17
|
+
"data-orientation": t,
|
|
18
|
+
"data-next": e,
|
|
19
|
+
"data-completed": a,
|
|
20
|
+
"data-current": s,
|
|
21
|
+
className: "gi-progress-stepper-step-connector",
|
|
22
|
+
"aria-hidden": "true",
|
|
23
|
+
style: o,
|
|
24
|
+
children: [
|
|
25
|
+
/* @__PURE__ */ r("span", {}),
|
|
26
|
+
s ? /* @__PURE__ */ r("span", {}) : null
|
|
27
|
+
]
|
|
28
|
+
}
|
|
29
|
+
);
|
|
30
|
+
}, x = (e) => ({
|
|
31
|
+
[v.Hashtag]: {
|
|
32
|
+
completed: /* @__PURE__ */ r(z, { icon: "check" }),
|
|
33
|
+
current: () => "#",
|
|
34
|
+
next: () => "#"
|
|
35
|
+
},
|
|
36
|
+
[v.Number]: {
|
|
37
|
+
completed: /* @__PURE__ */ r(z, { icon: "check" }),
|
|
38
|
+
current: (s) => s,
|
|
39
|
+
next: (s) => s
|
|
40
|
+
}
|
|
41
|
+
})[e], V = (e, t, s, a) => {
|
|
42
|
+
const { current: l, completed: o, next: i } = x(
|
|
43
|
+
e || v.Hashtag
|
|
44
|
+
);
|
|
45
|
+
return s ? o : a ? l(t) : i(t);
|
|
46
|
+
}, B = ({
|
|
47
|
+
isCurrentStep: e,
|
|
48
|
+
isCompleted: t,
|
|
49
|
+
isLastStep: s,
|
|
50
|
+
stepNumber: a,
|
|
51
|
+
orientation: l,
|
|
52
|
+
children: o,
|
|
53
|
+
indicator: i,
|
|
54
|
+
verticalSlot: n,
|
|
55
|
+
defaultOpen: d,
|
|
56
|
+
dataTestId: u,
|
|
57
|
+
ariaLabel: g,
|
|
58
|
+
verticalGap: h
|
|
59
|
+
}) => {
|
|
60
|
+
const m = !t && !e, c = l === "vertical" && (e || d || t), p = !!o;
|
|
61
|
+
return /* @__PURE__ */ f("div", { className: "gi-relative", children: [
|
|
62
|
+
/* @__PURE__ */ f(
|
|
63
|
+
"div",
|
|
64
|
+
{
|
|
65
|
+
className: "gi-progress-stepper-step-container",
|
|
66
|
+
"data-orientation": l,
|
|
67
|
+
"data-current": e,
|
|
68
|
+
"data-completed": t,
|
|
69
|
+
"data-next": m,
|
|
70
|
+
"data-indicator": i,
|
|
71
|
+
role: "listitem",
|
|
72
|
+
"aria-labelledby": `step-label-${a}`,
|
|
73
|
+
"data-testid": u || `step-label-${a}`,
|
|
74
|
+
"aria-label": p ? void 0 : g,
|
|
75
|
+
children: [
|
|
76
|
+
/* @__PURE__ */ r("div", { className: "gi-progress-stepper-step", "data-indicator": i, children: V(
|
|
77
|
+
i || v.Hashtag,
|
|
78
|
+
a,
|
|
79
|
+
t,
|
|
80
|
+
e
|
|
81
|
+
) }),
|
|
82
|
+
p && /* @__PURE__ */ r(
|
|
83
|
+
"div",
|
|
84
|
+
{
|
|
85
|
+
className: "gi-progress-stepper-step-label",
|
|
86
|
+
"data-orientation": l,
|
|
87
|
+
id: `step-label-${a}`,
|
|
88
|
+
children: o
|
|
89
|
+
}
|
|
90
|
+
)
|
|
91
|
+
]
|
|
92
|
+
}
|
|
93
|
+
),
|
|
94
|
+
s ? null : /* @__PURE__ */ r(
|
|
95
|
+
k,
|
|
96
|
+
{
|
|
97
|
+
isCurrentStep: e,
|
|
98
|
+
isNextStep: m,
|
|
99
|
+
isCompleted: t,
|
|
100
|
+
orientation: l,
|
|
101
|
+
stepNumber: a,
|
|
102
|
+
verticalGap: h
|
|
103
|
+
}
|
|
104
|
+
),
|
|
105
|
+
c && n && /* @__PURE__ */ r(
|
|
106
|
+
"div",
|
|
107
|
+
{
|
|
108
|
+
"data-testid": `vertical-step-slot-${a - 1}`,
|
|
109
|
+
className: $("gi-ml-10", {
|
|
110
|
+
"gi-pt-5": p,
|
|
111
|
+
"-gi-mt-[34px]": !p && n
|
|
112
|
+
}),
|
|
113
|
+
children: n
|
|
114
|
+
}
|
|
115
|
+
)
|
|
116
|
+
] });
|
|
117
|
+
}, I = () => null, J = ({
|
|
118
|
+
children: e,
|
|
119
|
+
currentStepIndex: t = 0,
|
|
120
|
+
orientation: s = "horizontal",
|
|
121
|
+
indicator: a = "number",
|
|
122
|
+
completeAll: l,
|
|
123
|
+
dataTestId: o,
|
|
124
|
+
className: i,
|
|
125
|
+
verticalGap: n = 14
|
|
126
|
+
}) => {
|
|
127
|
+
var g, h;
|
|
128
|
+
const d = (h = (g = e[t]) == null ? void 0 : g.props) == null ? void 0 : h.children, u = s === "horizontal" && d;
|
|
129
|
+
return /* @__PURE__ */ f(
|
|
130
|
+
"div",
|
|
131
|
+
{
|
|
132
|
+
className: $("gi-w-full", {
|
|
133
|
+
"gi-flex": s === "vertical"
|
|
134
|
+
}),
|
|
135
|
+
children: [
|
|
136
|
+
/* @__PURE__ */ r(
|
|
137
|
+
"div",
|
|
138
|
+
{
|
|
139
|
+
"data-testid": "progress-stepper",
|
|
140
|
+
className: $(
|
|
141
|
+
"gi-progress-stepper",
|
|
142
|
+
{
|
|
143
|
+
[`gi-gap-${n}`]: s === "vertical"
|
|
144
|
+
},
|
|
145
|
+
i
|
|
146
|
+
),
|
|
147
|
+
"data-orientation": s,
|
|
148
|
+
role: "list",
|
|
149
|
+
"aria-live": "polite",
|
|
150
|
+
children: P.map(e, (m, c) => {
|
|
151
|
+
var b, N;
|
|
152
|
+
const {
|
|
153
|
+
label: p = "",
|
|
154
|
+
defaultOpen: H,
|
|
155
|
+
ariaLabel: w
|
|
156
|
+
} = m.props, [y, L, O] = [
|
|
157
|
+
!l && t === c,
|
|
158
|
+
c === e.length - 1,
|
|
159
|
+
l || c < t && c !== t
|
|
160
|
+
];
|
|
161
|
+
return /* @__PURE__ */ r("div", { className: "gi-w-full", children: /* @__PURE__ */ r(
|
|
162
|
+
B,
|
|
163
|
+
{
|
|
164
|
+
stepNumber: c + 1,
|
|
165
|
+
isCurrentStep: y,
|
|
166
|
+
isCompleted: O,
|
|
167
|
+
orientation: s,
|
|
168
|
+
isLastStep: L,
|
|
169
|
+
verticalSlot: (N = (b = e[c]) == null ? void 0 : b.props) == null ? void 0 : N.children,
|
|
170
|
+
defaultOpen: H,
|
|
171
|
+
indicator: a,
|
|
172
|
+
dataTestId: o,
|
|
173
|
+
ariaLabel: w,
|
|
174
|
+
verticalGap: n,
|
|
175
|
+
children: p
|
|
176
|
+
},
|
|
177
|
+
o || `progress-stepper-step-${c}`
|
|
178
|
+
) });
|
|
179
|
+
})
|
|
180
|
+
}
|
|
181
|
+
),
|
|
182
|
+
u && /* @__PURE__ */ r(
|
|
183
|
+
"div",
|
|
184
|
+
{
|
|
185
|
+
className: "gi-h-full",
|
|
186
|
+
"data-testid": `horizontal-step-slot-${t}`,
|
|
187
|
+
children: d
|
|
188
|
+
}
|
|
189
|
+
)
|
|
190
|
+
]
|
|
191
|
+
}
|
|
192
|
+
);
|
|
193
|
+
};
|
|
194
|
+
export {
|
|
195
|
+
J as ProgressStepper,
|
|
196
|
+
B as Step,
|
|
197
|
+
I as StepItem
|
|
198
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { c as d, r as h } from "../test-utilities-BS7B3BF-.js";
|
|
3
|
+
import { ProgressStepper as a, StepItem as t } from "./progress-stepper.js";
|
|
4
|
+
describe("govieProgressStepper", () => {
|
|
5
|
+
afterEach(d);
|
|
6
|
+
const c = (n) => h(/* @__PURE__ */ e(a, { ...n }));
|
|
7
|
+
it("should render a horizontal progress stepper correctly", () => {
|
|
8
|
+
const r = [
|
|
9
|
+
...c({
|
|
10
|
+
children: [
|
|
11
|
+
/* @__PURE__ */ e(t, { label: "Step 1", children: /* @__PURE__ */ e("div", { children: "Step 1 Content" }) }, "step-1"),
|
|
12
|
+
/* @__PURE__ */ e(t, { label: "Step 2", children: /* @__PURE__ */ e("div", { children: "Step 2 Content" }) }, "step-2"),
|
|
13
|
+
/* @__PURE__ */ e(t, { label: "Step 3", children: /* @__PURE__ */ e("div", { children: "Step 3 Content" }) }, "step-3")
|
|
14
|
+
],
|
|
15
|
+
currentStepIndex: 1
|
|
16
|
+
}).getByTestId("progress-stepper").querySelectorAll(".gi-progress-stepper-step-container")
|
|
17
|
+
];
|
|
18
|
+
expect(r.length).toBe(3), expect(r[0].dataset.completed).toBe("true"), expect(r[1].dataset.current).toBe("true"), expect(r[2].dataset.next).toBe("true");
|
|
19
|
+
}), it("should render a vertical progress stepper correctly", () => {
|
|
20
|
+
const r = [
|
|
21
|
+
...c({
|
|
22
|
+
children: [
|
|
23
|
+
/* @__PURE__ */ e(t, { label: "Step 1", children: /* @__PURE__ */ e("div", { children: "Step 1 Content" }) }, "step-1"),
|
|
24
|
+
/* @__PURE__ */ e(t, { label: "Step 2", children: /* @__PURE__ */ e("div", { children: "Step 2 Content" }) }, "step-2"),
|
|
25
|
+
/* @__PURE__ */ e(t, { label: "Step 3", children: /* @__PURE__ */ e("div", { children: "Step 3 Content" }) }, "step-3")
|
|
26
|
+
],
|
|
27
|
+
currentStepIndex: 2,
|
|
28
|
+
orientation: "vertical"
|
|
29
|
+
}).getByTestId("progress-stepper").querySelectorAll(".gi-progress-stepper-step-container")
|
|
30
|
+
];
|
|
31
|
+
expect(r[2].dataset.current).toBe("true");
|
|
32
|
+
}), it("should mark all steps as completed when completeAll is true", () => {
|
|
33
|
+
const r = [
|
|
34
|
+
...c({
|
|
35
|
+
children: [
|
|
36
|
+
/* @__PURE__ */ e(t, { label: "Step 1", children: /* @__PURE__ */ e("div", { children: "Step 1 Content" }) }, "step-1"),
|
|
37
|
+
/* @__PURE__ */ e(t, { label: "Step 2", children: /* @__PURE__ */ e("div", { children: "Step 2 Content" }) }, "step-2"),
|
|
38
|
+
/* @__PURE__ */ e(t, { label: "Step 3", children: /* @__PURE__ */ e("div", { children: "Step 3 Content" }) }, "step-3")
|
|
39
|
+
],
|
|
40
|
+
completeAll: !0
|
|
41
|
+
}).getByTestId("progress-stepper").querySelectorAll(".gi-progress-stepper-step-container")
|
|
42
|
+
];
|
|
43
|
+
for (const l of r)
|
|
44
|
+
expect(l.dataset.completed).toBe("true"), expect(l.dataset.current).not.toBe("true"), expect(l.dataset.next).not.toBe("true");
|
|
45
|
+
expect(r.length).toBe(3);
|
|
46
|
+
}), it("should show slot content for the current and previous step index when vertical orientation", async () => {
|
|
47
|
+
const n = c({
|
|
48
|
+
currentStepIndex: 1,
|
|
49
|
+
children: [
|
|
50
|
+
/* @__PURE__ */ e(t, { label: "Step 1", children: /* @__PURE__ */ e("div", { children: "Step 1 Content" }) }),
|
|
51
|
+
/* @__PURE__ */ e(t, { label: "Step 2", children: /* @__PURE__ */ e("div", { children: "Step 2 Content" }) }),
|
|
52
|
+
/* @__PURE__ */ e(t, { label: "Step 3", children: /* @__PURE__ */ e("div", { children: "Step 3 Content" }) })
|
|
53
|
+
],
|
|
54
|
+
orientation: "vertical"
|
|
55
|
+
}), p = n.getByTestId("vertical-step-slot-0"), r = n.getByTestId("vertical-step-slot-1"), l = n.queryByTestId("vertical-step-slot-2");
|
|
56
|
+
expect(p).toBeInTheDocument(), expect(r).toBeInTheDocument(), expect(l).toBeNull();
|
|
57
|
+
}), it("should show slot content for the current step index", async () => {
|
|
58
|
+
const n = c({
|
|
59
|
+
currentStepIndex: 0,
|
|
60
|
+
children: [
|
|
61
|
+
/* @__PURE__ */ e(t, { label: "Step 1", children: /* @__PURE__ */ e("div", { children: "Step 1 Content" }) }),
|
|
62
|
+
/* @__PURE__ */ e(t, { label: "Step 2", children: /* @__PURE__ */ e("div", { children: "Step 2 Content" }) }),
|
|
63
|
+
/* @__PURE__ */ e(t, { label: "Step 3", children: /* @__PURE__ */ e("div", { children: "Step 3 Content" }) })
|
|
64
|
+
]
|
|
65
|
+
}), p = n.getByTestId("horizontal-step-slot-0"), r = n.queryByTestId("horizontal-step-slot-1"), l = n.queryByTestId("horizontal-step-slot-2");
|
|
66
|
+
expect(p).toBeInTheDocument(), expect(r).toBeNull(), expect(l).toBeNull();
|
|
67
|
+
}), it('should default open slot content while vertical orientation when "defaultOpen" is true', () => {
|
|
68
|
+
const n = c({
|
|
69
|
+
children: [
|
|
70
|
+
/* @__PURE__ */ e(t, { label: "Step 1", defaultOpen: !0, children: /* @__PURE__ */ e("div", { children: "Step 1 Content" }) }),
|
|
71
|
+
/* @__PURE__ */ e(t, { label: "Step 2", defaultOpen: !0, children: /* @__PURE__ */ e("div", { children: "Step 2 Content" }) }),
|
|
72
|
+
/* @__PURE__ */ e(t, { label: "Step 3", defaultOpen: !0, children: /* @__PURE__ */ e("div", { children: "Step 3 Content" }) })
|
|
73
|
+
],
|
|
74
|
+
orientation: "vertical"
|
|
75
|
+
}), p = n.getByTestId("vertical-step-slot-0"), r = n.getByTestId("vertical-step-slot-1"), l = n.getByTestId("vertical-step-slot-2");
|
|
76
|
+
expect(p).toBeInTheDocument(), expect(r).toBeInTheDocument(), expect(l).toBeInTheDocument();
|
|
77
|
+
}), it('should check step numbers when "indicator" is a number', () => {
|
|
78
|
+
var r, l;
|
|
79
|
+
const p = c({
|
|
80
|
+
indicator: "number",
|
|
81
|
+
children: [
|
|
82
|
+
/* @__PURE__ */ e(t, { label: "Step 1", children: /* @__PURE__ */ e("div", { children: "Step 1 Content" }) }),
|
|
83
|
+
/* @__PURE__ */ e(t, { label: "Step 2", children: /* @__PURE__ */ e("div", { children: "Step 2 Content" }) }),
|
|
84
|
+
/* @__PURE__ */ e(t, { label: "Step 3", children: /* @__PURE__ */ e("div", { children: "Step 3 Content" }) })
|
|
85
|
+
]
|
|
86
|
+
}).getAllByRole("listitem");
|
|
87
|
+
for (const o of p) {
|
|
88
|
+
const s = (l = (r = o.querySelector(".gi-progress-stepper-step")) == null ? void 0 : r.textContent) == null ? void 0 : l.trim();
|
|
89
|
+
expect(!Number.isNaN(Number(s))).toBe(!0);
|
|
90
|
+
}
|
|
91
|
+
}), it('should have a check icon for the completed steps when "indicator" is a number', () => {
|
|
92
|
+
const n = c({
|
|
93
|
+
indicator: "number",
|
|
94
|
+
currentStepIndex: 2,
|
|
95
|
+
children: [
|
|
96
|
+
/* @__PURE__ */ e(t, { label: "Step 1", children: /* @__PURE__ */ e("div", { children: "Step 1 Content" }) }),
|
|
97
|
+
/* @__PURE__ */ e(t, { label: "Step 2", children: /* @__PURE__ */ e("div", { children: "Step 2 Content" }) }),
|
|
98
|
+
/* @__PURE__ */ e(t, { label: "Step 3", children: /* @__PURE__ */ e("div", { children: "Step 3 Content" }) })
|
|
99
|
+
]
|
|
100
|
+
}), [p, r, l] = n.getAllByRole("listitem").map(
|
|
101
|
+
(o) => {
|
|
102
|
+
var s, i;
|
|
103
|
+
return (i = (s = o.querySelector(".gi-progress-stepper-step")) == null ? void 0 : s.textContent) == null ? void 0 : i.trim();
|
|
104
|
+
}
|
|
105
|
+
);
|
|
106
|
+
expect(p).toBe("check"), expect(r).toBe("check"), expect(l).toBe("3");
|
|
107
|
+
}), it("should pass axe accessibility tests", async () => {
|
|
108
|
+
await c({
|
|
109
|
+
children: [
|
|
110
|
+
/* @__PURE__ */ e(t, { label: "Step 1", children: /* @__PURE__ */ e("div", { children: "Step 1 Content" }) }, "step-1"),
|
|
111
|
+
/* @__PURE__ */ e(t, { label: "Step 2", children: /* @__PURE__ */ e("div", { children: "Step 2 Content" }) }, "step-2"),
|
|
112
|
+
/* @__PURE__ */ e(t, { label: "Step 3", children: /* @__PURE__ */ e("div", { children: "Step 3 Content" }) }, "step-3")
|
|
113
|
+
],
|
|
114
|
+
currentStepIndex: 0
|
|
115
|
+
}).axe();
|
|
116
|
+
});
|
|
117
|
+
});
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
type Orientation = 'vertical' | 'horizontal';
|
|
2
|
+
export declare const ProgressStepperIndicator: {
|
|
3
|
+
readonly Hashtag: "hashtag";
|
|
4
|
+
readonly Number: "number";
|
|
5
|
+
};
|
|
6
|
+
export type ProgressStepperIndicatorType = (typeof ProgressStepperIndicator)[keyof typeof ProgressStepperIndicator];
|
|
7
|
+
export type Step = {
|
|
8
|
+
label: string;
|
|
9
|
+
slot: React.ReactElement;
|
|
10
|
+
};
|
|
11
|
+
export type StepItemProps = {
|
|
12
|
+
label?: string;
|
|
13
|
+
children?: React.ReactNode;
|
|
14
|
+
defaultOpen?: boolean;
|
|
15
|
+
ariaLabel?: string;
|
|
16
|
+
};
|
|
17
|
+
export type ProgressStepperProps = {
|
|
18
|
+
children: React.ReactElement<InnerStepProps>[];
|
|
19
|
+
currentStepIndex?: number;
|
|
20
|
+
orientation?: Orientation;
|
|
21
|
+
completeAll?: boolean;
|
|
22
|
+
dataTestId?: string;
|
|
23
|
+
indicator?: ProgressStepperIndicatorType;
|
|
24
|
+
className?: string;
|
|
25
|
+
verticalGap?: number;
|
|
26
|
+
};
|
|
27
|
+
export type InnerStepProps = {
|
|
28
|
+
children: string;
|
|
29
|
+
isCurrentStep: boolean;
|
|
30
|
+
isLastStep: boolean;
|
|
31
|
+
isCompleted: boolean;
|
|
32
|
+
stepNumber: number;
|
|
33
|
+
orientation?: Orientation;
|
|
34
|
+
indicator?: ProgressStepperIndicatorType;
|
|
35
|
+
verticalSlot?: React.ReactNode;
|
|
36
|
+
defaultOpen?: boolean;
|
|
37
|
+
dataTestId?: string;
|
|
38
|
+
ariaLabel?: string;
|
|
39
|
+
verticalGap: number;
|
|
40
|
+
};
|
|
41
|
+
export type ConnectorProps = {
|
|
42
|
+
stepNumber: number;
|
|
43
|
+
isNextStep: boolean;
|
|
44
|
+
isCurrentStep: boolean;
|
|
45
|
+
isCompleted: boolean;
|
|
46
|
+
orientation?: Orientation;
|
|
47
|
+
verticalGap: number;
|
|
48
|
+
};
|
|
49
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { InputRadioSizeType, InputRadioProps } from '../input-radio/types.js';
|
|
2
|
+
import { InputRadioGroupProps } from '../input-radio-group/types.js';
|
|
3
|
+
/** @deprecated Use InputRadioSizeType instead */
|
|
4
|
+
export type RadioSizeType = InputRadioSizeType;
|
|
5
|
+
/** @deprecated Use InputRadioProps instead */
|
|
6
|
+
export type RadioProps = InputRadioProps;
|
|
7
|
+
/** @deprecated Use InputRadioSizeEnum instead */
|
|
8
|
+
export declare const RadioSizeEnum: {
|
|
9
|
+
readonly Large: "lg";
|
|
10
|
+
readonly Medium: "md";
|
|
11
|
+
readonly Small: "sm";
|
|
12
|
+
};
|
|
13
|
+
/** @deprecated Use InputRadioGroupProps instead */
|
|
14
|
+
export type RadioGroupProps = InputRadioGroupProps;
|