@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,8 @@
|
|
|
1
|
+
import { RenderOptions, RenderResult } from '@testing-library/react';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
export * from '@testing-library/react';
|
|
4
|
+
interface CustomRenderResult extends RenderResult {
|
|
5
|
+
axe: () => Promise<void>;
|
|
6
|
+
}
|
|
7
|
+
export declare function renderComponent(component: React.ReactNode, options?: RenderOptions): CustomRenderResult;
|
|
8
|
+
export declare const testVariantsAxe: (variants: any, renderFunction: (variant: any) => CustomRenderResult) => void;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { a as l, j as s, c as t, b as y, k as r, l as i, m as B, n as u, o as n, p as d, q as o, u as T, v as g, x as A, y as x, z as f, A as q, B as p, C as c, D as m, E as b, f as h, F as D, G as R, H as E, I as Q, J as I, K as V, L as F, M as L, N as P, O as k, P as w, Q as S, R as v, S as M, T as C, U as H, d as N, V as O, W, X as j, Y as z, Z as G, _ as Z, $ as J, a0 as K, a1 as U, a2 as X, a3 as Y, a4 as _, a5 as $, a6 as ee, i as ae, a7 as le, a8 as se, a9 as te, aa as ye, ab as re, ac as ie, ad as Be, ae as ue, af as ne, ag as de, ah as oe, ai as Te, aj as ge, ak as Ae, al as xe, am as fe, an as qe, ao as pe, ap as ce, aq as me, e as be, r as he, h as De, s as Re, t as Ee, w as Qe, ar as Ie, Z as Ve, as as Fe, at as Le } from "./test-utilities-BS7B3BF-.js";
|
|
2
|
+
export {
|
|
3
|
+
l as act,
|
|
4
|
+
s as buildQueries,
|
|
5
|
+
t as cleanup,
|
|
6
|
+
y as configure,
|
|
7
|
+
r as createEvent,
|
|
8
|
+
i as findAllByAltText,
|
|
9
|
+
B as findAllByDisplayValue,
|
|
10
|
+
u as findAllByLabelText,
|
|
11
|
+
n as findAllByPlaceholderText,
|
|
12
|
+
d as findAllByRole,
|
|
13
|
+
o as findAllByTestId,
|
|
14
|
+
T as findAllByText,
|
|
15
|
+
g as findAllByTitle,
|
|
16
|
+
A as findByAltText,
|
|
17
|
+
x as findByDisplayValue,
|
|
18
|
+
f as findByLabelText,
|
|
19
|
+
q as findByPlaceholderText,
|
|
20
|
+
p as findByRole,
|
|
21
|
+
c as findByTestId,
|
|
22
|
+
m as findByText,
|
|
23
|
+
b as findByTitle,
|
|
24
|
+
h as fireEvent,
|
|
25
|
+
D as getAllByAltText,
|
|
26
|
+
R as getAllByDisplayValue,
|
|
27
|
+
E as getAllByLabelText,
|
|
28
|
+
Q as getAllByPlaceholderText,
|
|
29
|
+
I as getAllByRole,
|
|
30
|
+
V as getAllByTestId,
|
|
31
|
+
F as getAllByText,
|
|
32
|
+
L as getAllByTitle,
|
|
33
|
+
P as getByAltText,
|
|
34
|
+
k as getByDisplayValue,
|
|
35
|
+
w as getByLabelText,
|
|
36
|
+
S as getByPlaceholderText,
|
|
37
|
+
v as getByRole,
|
|
38
|
+
M as getByTestId,
|
|
39
|
+
C as getByText,
|
|
40
|
+
H as getByTitle,
|
|
41
|
+
N as getConfig,
|
|
42
|
+
O as getDefaultNormalizer,
|
|
43
|
+
W as getElementError,
|
|
44
|
+
j as getMultipleElementsFoundError,
|
|
45
|
+
z as getNodeText,
|
|
46
|
+
G as getQueriesForElement,
|
|
47
|
+
Z as getRoles,
|
|
48
|
+
J as getSuggestedQuery,
|
|
49
|
+
K as isInaccessible,
|
|
50
|
+
U as logDOM,
|
|
51
|
+
X as logRoles,
|
|
52
|
+
Y as makeFindQuery,
|
|
53
|
+
_ as makeGetAllQuery,
|
|
54
|
+
$ as makeSingleQuery,
|
|
55
|
+
ee as prettyDOM,
|
|
56
|
+
ae as prettyFormat,
|
|
57
|
+
le as queries,
|
|
58
|
+
se as queryAllByAltText,
|
|
59
|
+
te as queryAllByAttribute,
|
|
60
|
+
ye as queryAllByDisplayValue,
|
|
61
|
+
re as queryAllByLabelText,
|
|
62
|
+
ie as queryAllByPlaceholderText,
|
|
63
|
+
Be as queryAllByRole,
|
|
64
|
+
ue as queryAllByTestId,
|
|
65
|
+
ne as queryAllByText,
|
|
66
|
+
de as queryAllByTitle,
|
|
67
|
+
oe as queryByAltText,
|
|
68
|
+
Te as queryByAttribute,
|
|
69
|
+
ge as queryByDisplayValue,
|
|
70
|
+
Ae as queryByLabelText,
|
|
71
|
+
xe as queryByPlaceholderText,
|
|
72
|
+
fe as queryByRole,
|
|
73
|
+
qe as queryByTestId,
|
|
74
|
+
pe as queryByText,
|
|
75
|
+
ce as queryByTitle,
|
|
76
|
+
me as queryHelpers,
|
|
77
|
+
be as render,
|
|
78
|
+
he as renderComponent,
|
|
79
|
+
De as renderHook,
|
|
80
|
+
Re as screen,
|
|
81
|
+
Ee as testVariantsAxe,
|
|
82
|
+
Qe as waitFor,
|
|
83
|
+
Ie as waitForElementToBeRemoved,
|
|
84
|
+
Ve as within,
|
|
85
|
+
Fe as wrapAllByQueryWithSuggestion,
|
|
86
|
+
Le as wrapSingleQueryWithSuggestion
|
|
87
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { InputTextProps } from '../input-text/type.js';
|
|
2
|
+
/**
|
|
3
|
+
* @deprecated Use `<InputText />` instead of `<TextInput />`.
|
|
4
|
+
*/
|
|
5
|
+
export declare const TextInput: import('react').ForwardRefExoticComponent<import('react').InputHTMLAttributes<HTMLInputElement> & {
|
|
6
|
+
prefix?: React.ReactNode;
|
|
7
|
+
suffix?: React.ReactNode;
|
|
8
|
+
inputClassName?: string;
|
|
9
|
+
iconStart?: import('../icon/icon.js').IconId;
|
|
10
|
+
onIconStartClick?: () => void;
|
|
11
|
+
iconStartClassName?: string;
|
|
12
|
+
iconEnd?: import('../icon/icon.js').IconId;
|
|
13
|
+
iconEndClassName?: string;
|
|
14
|
+
onIconEndClick?: () => void;
|
|
15
|
+
inputActionButton?: import('../input-text/type.js').InputActionButtonProps;
|
|
16
|
+
iconEndRef?: any;
|
|
17
|
+
inputActionPosition?: "beforeSuffix" | "afterSuffix";
|
|
18
|
+
type?: "text" | "date" | "datetime-local" | "email" | "month" | "number" | "password" | "tel" | "time" | "url" | "week" | "search";
|
|
19
|
+
halfFluid?: boolean;
|
|
20
|
+
clearButtonEnabled?: boolean;
|
|
21
|
+
} & import('react').RefAttributes<HTMLInputElement>>;
|
|
22
|
+
/** @deprecated Use InputTextProps instead */
|
|
23
|
+
export type TextInputProps = InputTextProps;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { default as React, TextareaHTMLAttributes } from 'react';
|
|
2
|
+
import { IconId } from '../icon/icon.js';
|
|
3
|
+
export type TextAreaProps = React.DetailedHTMLProps<TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement> & {
|
|
4
|
+
ref?: React.Ref<HTMLTextAreaElement>;
|
|
5
|
+
rows?: number;
|
|
6
|
+
cols?: number;
|
|
7
|
+
autoComplete?: string;
|
|
8
|
+
maxChars?: number;
|
|
9
|
+
halfFluid?: boolean;
|
|
10
|
+
iconStart?: IconId;
|
|
11
|
+
clearButtonEnabled?: boolean;
|
|
12
|
+
};
|
|
13
|
+
export declare const TextArea: React.ForwardRefExoticComponent<Omit<TextAreaProps, "ref"> & React.RefAttributes<unknown>>;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as d, Fragment as k, jsx as n } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef as R, useRef as j, useState as m, useImperativeHandle as p, useEffect as y } from "react";
|
|
4
|
+
import { cn as u } from "../cn.js";
|
|
5
|
+
import { HintText as z } from "../hint-text/hint-text.js";
|
|
6
|
+
import { translate as A } from "../i18n/utility.js";
|
|
7
|
+
import { Icon as H } from "../icon/icon.js";
|
|
8
|
+
import { IconButton as O } from "../icon-button/icon-button.js";
|
|
9
|
+
const E = R(
|
|
10
|
+
({
|
|
11
|
+
value: i,
|
|
12
|
+
rows: f = 4,
|
|
13
|
+
cols: g = 100,
|
|
14
|
+
autoComplete: h = "on",
|
|
15
|
+
maxChars: t,
|
|
16
|
+
halfFluid: x = !1,
|
|
17
|
+
iconStart: c,
|
|
18
|
+
className: v,
|
|
19
|
+
clearButtonEnabled: l,
|
|
20
|
+
...a
|
|
21
|
+
}, N) => {
|
|
22
|
+
const e = j(null), [s, C] = m(
|
|
23
|
+
t
|
|
24
|
+
);
|
|
25
|
+
p(N, () => e.current);
|
|
26
|
+
const [I, V] = m(""), o = typeof i == "string" ? i : I;
|
|
27
|
+
y(() => {
|
|
28
|
+
t !== void 0 && C(t - o.length);
|
|
29
|
+
}, [o, t]);
|
|
30
|
+
const b = (r) => {
|
|
31
|
+
const T = r.target.value;
|
|
32
|
+
i === void 0 && V(T), a.onChange && a.onChange(r);
|
|
33
|
+
}, w = () => {
|
|
34
|
+
if (e != null && e.current) {
|
|
35
|
+
e.current.value = "", e.current.focus();
|
|
36
|
+
const r = {
|
|
37
|
+
target: e.current,
|
|
38
|
+
currentTarget: e.current
|
|
39
|
+
};
|
|
40
|
+
a.onChange && a.onChange(r);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
return /* @__PURE__ */ d(k, { children: [
|
|
44
|
+
/* @__PURE__ */ n("div", { className: "gi-textarea-container", children: /* @__PURE__ */ d(
|
|
45
|
+
"div",
|
|
46
|
+
{
|
|
47
|
+
className: u("gi-textarea-inner", {
|
|
48
|
+
"gi-input-half-width": x
|
|
49
|
+
}),
|
|
50
|
+
children: [
|
|
51
|
+
c && /* @__PURE__ */ n("div", { className: "gi-text-area-icon-start", children: /* @__PURE__ */ n(H, { icon: c, size: "md", disabled: a.disabled }) }),
|
|
52
|
+
/* @__PURE__ */ n(
|
|
53
|
+
"textarea",
|
|
54
|
+
{
|
|
55
|
+
rows: f,
|
|
56
|
+
cols: g,
|
|
57
|
+
autoComplete: h,
|
|
58
|
+
className: u(v, "gi-textarea"),
|
|
59
|
+
ref: e,
|
|
60
|
+
"data-icon-start": !!c,
|
|
61
|
+
"data-clear-enabled": l,
|
|
62
|
+
maxLength: t,
|
|
63
|
+
onChange: b,
|
|
64
|
+
...a
|
|
65
|
+
}
|
|
66
|
+
),
|
|
67
|
+
l ? /* @__PURE__ */ n("div", { className: "gi-text-area-end-element", children: /* @__PURE__ */ n(
|
|
68
|
+
O,
|
|
69
|
+
{
|
|
70
|
+
disabled: a.disabled,
|
|
71
|
+
icon: {
|
|
72
|
+
icon: "close"
|
|
73
|
+
},
|
|
74
|
+
onClick: w,
|
|
75
|
+
variant: "flat",
|
|
76
|
+
size: "small",
|
|
77
|
+
appearance: "dark"
|
|
78
|
+
}
|
|
79
|
+
) }) : null
|
|
80
|
+
]
|
|
81
|
+
}
|
|
82
|
+
) }),
|
|
83
|
+
t && /* @__PURE__ */ n("div", { className: "gi-textarea-remaining-chars", children: /* @__PURE__ */ n(
|
|
84
|
+
z,
|
|
85
|
+
{
|
|
86
|
+
text: A("textarea.remainingChars", {
|
|
87
|
+
remainingChars: s,
|
|
88
|
+
defaultValue: `You have ${s} characters remaining`
|
|
89
|
+
})
|
|
90
|
+
}
|
|
91
|
+
) })
|
|
92
|
+
] });
|
|
93
|
+
}
|
|
94
|
+
);
|
|
95
|
+
E.displayName = "TextArea";
|
|
96
|
+
export {
|
|
97
|
+
E as TextArea
|
|
98
|
+
};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { ToastProps } from './types.js';
|
|
2
|
+
declare const toastVariants: import('tailwind-variants').TVReturnType<{
|
|
3
|
+
variant: {
|
|
4
|
+
info: {
|
|
5
|
+
base: string;
|
|
6
|
+
baseDismissible: string;
|
|
7
|
+
};
|
|
8
|
+
danger: {
|
|
9
|
+
base: string;
|
|
10
|
+
baseDismissible: string;
|
|
11
|
+
};
|
|
12
|
+
success: {
|
|
13
|
+
base: string;
|
|
14
|
+
baseDismissible: string;
|
|
15
|
+
};
|
|
16
|
+
warning: {
|
|
17
|
+
base: string;
|
|
18
|
+
baseDismissible: string;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
}, {
|
|
22
|
+
base: string;
|
|
23
|
+
baseDismissible: string;
|
|
24
|
+
container: string;
|
|
25
|
+
heading: string;
|
|
26
|
+
dismiss: string;
|
|
27
|
+
innerContainer: string;
|
|
28
|
+
}, undefined, TVConfig<V, EV>, {
|
|
29
|
+
variant: {
|
|
30
|
+
info: {
|
|
31
|
+
base: string;
|
|
32
|
+
baseDismissible: string;
|
|
33
|
+
};
|
|
34
|
+
danger: {
|
|
35
|
+
base: string;
|
|
36
|
+
baseDismissible: string;
|
|
37
|
+
};
|
|
38
|
+
success: {
|
|
39
|
+
base: string;
|
|
40
|
+
baseDismissible: string;
|
|
41
|
+
};
|
|
42
|
+
warning: {
|
|
43
|
+
base: string;
|
|
44
|
+
baseDismissible: string;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
}, {
|
|
48
|
+
base: string;
|
|
49
|
+
baseDismissible: string;
|
|
50
|
+
container: string;
|
|
51
|
+
heading: string;
|
|
52
|
+
dismiss: string;
|
|
53
|
+
innerContainer: string;
|
|
54
|
+
}, import('tailwind-variants').TVReturnType<{
|
|
55
|
+
variant: {
|
|
56
|
+
info: {
|
|
57
|
+
base: string;
|
|
58
|
+
baseDismissible: string;
|
|
59
|
+
};
|
|
60
|
+
danger: {
|
|
61
|
+
base: string;
|
|
62
|
+
baseDismissible: string;
|
|
63
|
+
};
|
|
64
|
+
success: {
|
|
65
|
+
base: string;
|
|
66
|
+
baseDismissible: string;
|
|
67
|
+
};
|
|
68
|
+
warning: {
|
|
69
|
+
base: string;
|
|
70
|
+
baseDismissible: string;
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
}, {
|
|
74
|
+
base: string;
|
|
75
|
+
baseDismissible: string;
|
|
76
|
+
container: string;
|
|
77
|
+
heading: string;
|
|
78
|
+
dismiss: string;
|
|
79
|
+
innerContainer: string;
|
|
80
|
+
}, undefined, TVConfig<V, EV>, unknown, unknown, undefined>>;
|
|
81
|
+
declare function Toast({ title, description, action, variant, dismissible, onClose, dataTestid, slotAction, }: ToastProps): import("react/jsx-runtime").JSX.Element;
|
|
82
|
+
export { Toast, toastVariants };
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as n, jsx as i } from "react/jsx-runtime";
|
|
3
|
+
import { c as u } from "../index-DNkhmzZp.js";
|
|
4
|
+
import { Icon as p } from "../icon/icon.js";
|
|
5
|
+
import { IconButton as v } from "../icon-button/icon-button.js";
|
|
6
|
+
import { Link as w } from "../link/link.js";
|
|
7
|
+
import { Paragraph as k } from "../paragraph/paragraph.js";
|
|
8
|
+
const N = u({
|
|
9
|
+
slots: {
|
|
10
|
+
base: "gi-toast-base",
|
|
11
|
+
baseDismissible: "gi-toast-base-dismissible",
|
|
12
|
+
container: "gi-toast-container",
|
|
13
|
+
heading: "gi-toast-title",
|
|
14
|
+
dismiss: "gi-toast-dismiss",
|
|
15
|
+
innerContainer: "gi-flex gi-justify-between gi-w-full"
|
|
16
|
+
},
|
|
17
|
+
variants: {
|
|
18
|
+
variant: {
|
|
19
|
+
info: {
|
|
20
|
+
base: "gi-toast-info",
|
|
21
|
+
baseDismissible: "gi-toast-info"
|
|
22
|
+
},
|
|
23
|
+
danger: {
|
|
24
|
+
base: "gi-toast-danger",
|
|
25
|
+
baseDismissible: "gi-toast-danger"
|
|
26
|
+
},
|
|
27
|
+
success: {
|
|
28
|
+
base: "gi-toast-success",
|
|
29
|
+
baseDismissible: "gi-toast-success"
|
|
30
|
+
},
|
|
31
|
+
warning: {
|
|
32
|
+
base: "gi-toast-warning",
|
|
33
|
+
baseDismissible: "gi-toast-warning"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
defaultVariants: {
|
|
38
|
+
variant: "info"
|
|
39
|
+
}
|
|
40
|
+
}), C = ({ variant: e }) => {
|
|
41
|
+
let s;
|
|
42
|
+
switch (e) {
|
|
43
|
+
case "warning": {
|
|
44
|
+
s = "warning";
|
|
45
|
+
break;
|
|
46
|
+
}
|
|
47
|
+
case "success": {
|
|
48
|
+
s = "check_circle";
|
|
49
|
+
break;
|
|
50
|
+
}
|
|
51
|
+
case "danger": {
|
|
52
|
+
s = "error";
|
|
53
|
+
break;
|
|
54
|
+
}
|
|
55
|
+
default:
|
|
56
|
+
s = "info";
|
|
57
|
+
}
|
|
58
|
+
return s;
|
|
59
|
+
};
|
|
60
|
+
function y({
|
|
61
|
+
title: e,
|
|
62
|
+
description: s,
|
|
63
|
+
action: a,
|
|
64
|
+
variant: r = "info",
|
|
65
|
+
dismissible: o,
|
|
66
|
+
onClose: l,
|
|
67
|
+
dataTestid: c,
|
|
68
|
+
slotAction: t
|
|
69
|
+
}) {
|
|
70
|
+
const { base: m, heading: b, container: g, innerContainer: d, dismiss: f, baseDismissible: h } = N({
|
|
71
|
+
variant: r
|
|
72
|
+
});
|
|
73
|
+
return /* @__PURE__ */ n(
|
|
74
|
+
"div",
|
|
75
|
+
{
|
|
76
|
+
className: (o ? h : m)(),
|
|
77
|
+
role: "alert",
|
|
78
|
+
"aria-live": "assertive",
|
|
79
|
+
"aria-atomic": "true",
|
|
80
|
+
"aria-label": e,
|
|
81
|
+
"data-testid": c,
|
|
82
|
+
children: [
|
|
83
|
+
/* @__PURE__ */ i(
|
|
84
|
+
p,
|
|
85
|
+
{
|
|
86
|
+
icon: C({ variant: r }),
|
|
87
|
+
className: "gi-toast-icon",
|
|
88
|
+
"data-variant": r
|
|
89
|
+
}
|
|
90
|
+
),
|
|
91
|
+
/* @__PURE__ */ n("div", { className: g(), children: [
|
|
92
|
+
/* @__PURE__ */ n("div", { className: d(), children: [
|
|
93
|
+
/* @__PURE__ */ i("p", { className: b(), children: e }),
|
|
94
|
+
o && /* @__PURE__ */ i("div", { className: f(), children: /* @__PURE__ */ i(
|
|
95
|
+
v,
|
|
96
|
+
{
|
|
97
|
+
onClick: l,
|
|
98
|
+
size: "small",
|
|
99
|
+
appearance: "dark",
|
|
100
|
+
variant: "flat",
|
|
101
|
+
icon: { icon: "close" },
|
|
102
|
+
"aria-label": "Close toast"
|
|
103
|
+
}
|
|
104
|
+
) })
|
|
105
|
+
] }),
|
|
106
|
+
/* @__PURE__ */ i(k, { ariaLabel: s, children: s }),
|
|
107
|
+
(a || t) && /* @__PURE__ */ i("div", { className: "gi-toast-action", children: /* @__PURE__ */ i(w, { href: a == null ? void 0 : a.href, noColor: !0, size: "md", asChild: !!t, children: t || (a == null ? void 0 : a.label) }) })
|
|
108
|
+
] })
|
|
109
|
+
]
|
|
110
|
+
}
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
export {
|
|
114
|
+
y as Toast,
|
|
115
|
+
N as toastVariants
|
|
116
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ToastProps } from './types.js';
|
|
2
|
+
export declare const ToastProvider: () => import("react/jsx-runtime").JSX.Element | null;
|
|
3
|
+
export declare const toaster: {
|
|
4
|
+
create: ({ position, ...props }: ToastProps) => void;
|
|
5
|
+
};
|
|
6
|
+
export declare const Toast: ({ variant, title, description, action, dismissible, duration, animation, slotAction, }: ToastProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as o, Fragment as v } from "react/jsx-runtime";
|
|
3
|
+
import { useState as i, useEffect as m } from "react";
|
|
4
|
+
import { createPortal as h } from "react-dom";
|
|
5
|
+
import { cn as T } from "../cn.js";
|
|
6
|
+
import { translate as $ } from "../i18n/utility.js";
|
|
7
|
+
import { Toast as w } from "./ds-toast.js";
|
|
8
|
+
const b = [
|
|
9
|
+
{ x: "left", y: "top" },
|
|
10
|
+
{ x: "left", y: "center" },
|
|
11
|
+
{ x: "left", y: "bottom" },
|
|
12
|
+
{ x: "center", y: "top" },
|
|
13
|
+
{ x: "center", y: "center" },
|
|
14
|
+
{ x: "center", y: "bottom" },
|
|
15
|
+
{ x: "right", y: "top" },
|
|
16
|
+
{ x: "right", y: "center" },
|
|
17
|
+
{ x: "right", y: "bottom" }
|
|
18
|
+
], u = {
|
|
19
|
+
isMounted: !1
|
|
20
|
+
}, O = () => {
|
|
21
|
+
const [e, r] = i([]), [l, c] = i(!1);
|
|
22
|
+
return m(() => {
|
|
23
|
+
c(!0);
|
|
24
|
+
const t = (d) => {
|
|
25
|
+
const a = d;
|
|
26
|
+
r((s) => [...s, a.detail]);
|
|
27
|
+
};
|
|
28
|
+
return globalThis.window.addEventListener("govie:add-toast", t), u.isMounted = !0, () => {
|
|
29
|
+
globalThis.window.removeEventListener(
|
|
30
|
+
"govie:add-toast",
|
|
31
|
+
t
|
|
32
|
+
), u.isMounted = !1;
|
|
33
|
+
};
|
|
34
|
+
}, []), l ? /* @__PURE__ */ o(v, { children: b.map((t) => {
|
|
35
|
+
const d = e.filter(
|
|
36
|
+
(a) => {
|
|
37
|
+
var s, n;
|
|
38
|
+
return ((s = a.position) == null ? void 0 : s.x) === t.x && ((n = a.position) == null ? void 0 : n.y) === t.y;
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
return h(
|
|
42
|
+
/* @__PURE__ */ o(
|
|
43
|
+
"div",
|
|
44
|
+
{
|
|
45
|
+
id: `toast-portal-${t.x}-${t.y}`,
|
|
46
|
+
role: "region",
|
|
47
|
+
"aria-label": $("toast.position", {
|
|
48
|
+
x: t.x,
|
|
49
|
+
y: t.y,
|
|
50
|
+
defaultValue: `Toasts-${t.y}-${t.x}`
|
|
51
|
+
}),
|
|
52
|
+
"data-position": `${t.y}-${t.x}`,
|
|
53
|
+
className: "gi-toast-portal",
|
|
54
|
+
children: d.map((a, s) => /* @__PURE__ */ o(p, { ...a }, `toast-${s}`))
|
|
55
|
+
},
|
|
56
|
+
`toast-${t.x}-${t.y}`
|
|
57
|
+
),
|
|
58
|
+
document.body
|
|
59
|
+
);
|
|
60
|
+
}) }) : null;
|
|
61
|
+
}, k = {
|
|
62
|
+
create: ({ position: e, ...r }) => {
|
|
63
|
+
if (u.isMounted) {
|
|
64
|
+
const l = new CustomEvent("govie:add-toast", {
|
|
65
|
+
detail: {
|
|
66
|
+
...r,
|
|
67
|
+
position: {
|
|
68
|
+
x: (e == null ? void 0 : e.x) || "right",
|
|
69
|
+
y: (e == null ? void 0 : e.y) || "bottom"
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
globalThis.window.dispatchEvent(l);
|
|
74
|
+
} else
|
|
75
|
+
console.warn("ToastProvider not found. Cannot dispatch toast event.");
|
|
76
|
+
}
|
|
77
|
+
}, p = ({
|
|
78
|
+
variant: e,
|
|
79
|
+
title: r,
|
|
80
|
+
description: l,
|
|
81
|
+
action: c,
|
|
82
|
+
dismissible: t,
|
|
83
|
+
duration: d = 5e3,
|
|
84
|
+
animation: a = "fadeinup",
|
|
85
|
+
slotAction: s
|
|
86
|
+
}) => {
|
|
87
|
+
const [n, x] = i(!0), [y, g] = i(!1);
|
|
88
|
+
m(() => {
|
|
89
|
+
setTimeout(() => {
|
|
90
|
+
f();
|
|
91
|
+
}, d);
|
|
92
|
+
}, []), m(() => {
|
|
93
|
+
n || setTimeout(() => {
|
|
94
|
+
g(!0);
|
|
95
|
+
}, 300);
|
|
96
|
+
}, [n]);
|
|
97
|
+
const f = () => x(!1);
|
|
98
|
+
return y ? null : /* @__PURE__ */ o(
|
|
99
|
+
"div",
|
|
100
|
+
{
|
|
101
|
+
"data-testid": `${r}-${e || "info"}`,
|
|
102
|
+
"data-animation": a || "no-animation",
|
|
103
|
+
className: T("gi-toast gi-toast-lower", {
|
|
104
|
+
"gi-toast-disappear": !n
|
|
105
|
+
}),
|
|
106
|
+
children: /* @__PURE__ */ o("div", { className: "gi-wrapper", children: /* @__PURE__ */ o("div", { className: "gi-message", children: /* @__PURE__ */ o(
|
|
107
|
+
w,
|
|
108
|
+
{
|
|
109
|
+
onClose: f,
|
|
110
|
+
title: r,
|
|
111
|
+
action: c,
|
|
112
|
+
variant: e,
|
|
113
|
+
description: l,
|
|
114
|
+
dismissible: t,
|
|
115
|
+
slotAction: s
|
|
116
|
+
}
|
|
117
|
+
) }) })
|
|
118
|
+
}
|
|
119
|
+
);
|
|
120
|
+
};
|
|
121
|
+
export {
|
|
122
|
+
p as Toast,
|
|
123
|
+
O as ToastProvider,
|
|
124
|
+
k as toaster
|
|
125
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { c as l, r as n, w as T } from "../test-utilities-BS7B3BF-.js";
|
|
3
|
+
import { toaster as i, ToastProvider as c } from "./toast.js";
|
|
4
|
+
const d = [
|
|
5
|
+
"info",
|
|
6
|
+
"success",
|
|
7
|
+
"warning",
|
|
8
|
+
"danger"
|
|
9
|
+
];
|
|
10
|
+
describe("Toast", () => {
|
|
11
|
+
afterEach(l);
|
|
12
|
+
const s = (t) => {
|
|
13
|
+
const e = n(/* @__PURE__ */ o(c, {}));
|
|
14
|
+
return i.create(t), e;
|
|
15
|
+
};
|
|
16
|
+
it("should render toast with title and message", async () => {
|
|
17
|
+
const t = s({
|
|
18
|
+
title: "Toast Title",
|
|
19
|
+
description: "This is the toast content"
|
|
20
|
+
});
|
|
21
|
+
expect(await t.findByText("Toast Title")).toBeInTheDocument(), expect(
|
|
22
|
+
await t.findByText("This is the toast content")
|
|
23
|
+
).toBeInTheDocument();
|
|
24
|
+
}), it("should render all different variants", async () => {
|
|
25
|
+
const t = n(/* @__PURE__ */ o(c, {}));
|
|
26
|
+
for (const e of d) {
|
|
27
|
+
const a = "Toast";
|
|
28
|
+
i.create({
|
|
29
|
+
variant: e,
|
|
30
|
+
title: a,
|
|
31
|
+
description: "This is a Toast"
|
|
32
|
+
}), await T(() => {
|
|
33
|
+
const r = t.getByTestId(`${a}-${e}`);
|
|
34
|
+
expect(r).not.toBeNull();
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
}), it("should pass axe accessibility tests", async () => {
|
|
38
|
+
await s({
|
|
39
|
+
variant: "success",
|
|
40
|
+
title: "Accessible Toast",
|
|
41
|
+
description: "This toast should be accessible"
|
|
42
|
+
}).axe();
|
|
43
|
+
});
|
|
44
|
+
});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export type ToastHorizontalPosition = 'left' | 'center' | 'right';
|
|
2
|
+
export type ToastVerticalPosition = 'top' | 'center' | 'bottom';
|
|
3
|
+
export type ToastVariant = 'success' | 'info' | 'warning' | 'danger';
|
|
4
|
+
export type ToastAnimation = 'fadeinup' | 'fadeinleft' | 'fadeinright';
|
|
5
|
+
export type ToastPosition = {
|
|
6
|
+
x: ToastHorizontalPosition;
|
|
7
|
+
y: ToastVerticalPosition;
|
|
8
|
+
};
|
|
9
|
+
export type ToastProps = {
|
|
10
|
+
title: string;
|
|
11
|
+
variant?: ToastVariant;
|
|
12
|
+
animation?: ToastAnimation;
|
|
13
|
+
description?: string;
|
|
14
|
+
action?: {
|
|
15
|
+
href: string;
|
|
16
|
+
label: string;
|
|
17
|
+
};
|
|
18
|
+
dismissible?: boolean;
|
|
19
|
+
onClose?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
20
|
+
duration?: number;
|
|
21
|
+
position?: ToastPosition;
|
|
22
|
+
dataTestid?: string;
|
|
23
|
+
slotAction?: React.ReactNode;
|
|
24
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export declare const positionVariants: string[];
|
|
3
|
+
export type Position = 'top' | 'bottom' | 'left' | 'right';
|
|
4
|
+
export type TooltipProps = {
|
|
5
|
+
text: string;
|
|
6
|
+
position?: Position;
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
dataTestid?: string;
|
|
9
|
+
};
|
|
10
|
+
export declare const Tooltip: ({ text, position, dataTestid, children, }: TooltipProps) => import("react/jsx-runtime").JSX.Element;
|