@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,68 @@
|
|
|
1
|
+
import { jsxs as i, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { Button as b } from "../button/button.js";
|
|
3
|
+
import { translate as c } from "../i18n/utility.js";
|
|
4
|
+
import { Link as u } from "../link/link.js";
|
|
5
|
+
import { CardNext as k, CardMedia as T, CardContainer as L, CardHeader as V, CardTitle as $, CardSubtitle as j, CardTag as A, CardDescription as B, CardAction as H } from "./card-next.js";
|
|
6
|
+
const N = ({
|
|
7
|
+
type: C = "vertical",
|
|
8
|
+
title: d,
|
|
9
|
+
inset: t = "none",
|
|
10
|
+
subTitle: p,
|
|
11
|
+
media: o,
|
|
12
|
+
content: m,
|
|
13
|
+
action: h,
|
|
14
|
+
href: n,
|
|
15
|
+
tag: l,
|
|
16
|
+
dataTestid: s,
|
|
17
|
+
titleAsChild: a,
|
|
18
|
+
children: y
|
|
19
|
+
}) => {
|
|
20
|
+
const f = () => !d || !n && !a ? d || "" : /* @__PURE__ */ e(
|
|
21
|
+
u,
|
|
22
|
+
{
|
|
23
|
+
href: n,
|
|
24
|
+
asChild: a,
|
|
25
|
+
"aria-label": c("card.cardHeader", {
|
|
26
|
+
title: d,
|
|
27
|
+
defaultValue: `Card link: ${d}`
|
|
28
|
+
}),
|
|
29
|
+
children: a ? y : d
|
|
30
|
+
}
|
|
31
|
+
), x = (r) => r.type === "link" ? /* @__PURE__ */ e(
|
|
32
|
+
u,
|
|
33
|
+
{
|
|
34
|
+
...r,
|
|
35
|
+
"aria-label": c("card.actionLink", {
|
|
36
|
+
children: r.children,
|
|
37
|
+
defaultValue: `Action link: ${r.children}`
|
|
38
|
+
}),
|
|
39
|
+
children: r.children
|
|
40
|
+
}
|
|
41
|
+
) : /* @__PURE__ */ e(
|
|
42
|
+
b,
|
|
43
|
+
{
|
|
44
|
+
...r,
|
|
45
|
+
"aria-label": c("card.actionButton", {
|
|
46
|
+
children: r.children,
|
|
47
|
+
defaultValue: `Action button: ${r.children}`
|
|
48
|
+
}),
|
|
49
|
+
children: r.children
|
|
50
|
+
}
|
|
51
|
+
);
|
|
52
|
+
return /* @__PURE__ */ i(k, { inset: t, type: C, dataTestid: s, children: [
|
|
53
|
+
o && /* @__PURE__ */ e(T, { media: o, href: n }),
|
|
54
|
+
/* @__PURE__ */ i(L, { inset: t, children: [
|
|
55
|
+
/* @__PURE__ */ i(V, { children: [
|
|
56
|
+
/* @__PURE__ */ e($, { children: f() }),
|
|
57
|
+
/* @__PURE__ */ e(j, { children: p }),
|
|
58
|
+
l && /* @__PURE__ */ e(A, { text: l.text, type: l.type })
|
|
59
|
+
] }),
|
|
60
|
+
/* @__PURE__ */ e(B, { children: m }),
|
|
61
|
+
h && /* @__PURE__ */ e(H, { children: x(h) })
|
|
62
|
+
] })
|
|
63
|
+
] });
|
|
64
|
+
};
|
|
65
|
+
N.displayName = "CardLegacy";
|
|
66
|
+
export {
|
|
67
|
+
N as CardLegacy
|
|
68
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Context, FC } from 'react';
|
|
2
|
+
import { TagProps } from '../tag/tag.js';
|
|
3
|
+
import { CardDescriptionProps, CardContainerProps, CardActionProps, CardHeaderProps, CardMediaProps, CardNextProps, CardSubtitleProps, CardTitleProps } from './types.js';
|
|
4
|
+
export declare function useRequiredContext(context: Context<boolean>, componentName: string, parentName: string): true;
|
|
5
|
+
export declare const CardNext: FC<CardNextProps>;
|
|
6
|
+
export declare const CardMedia: FC<CardMediaProps>;
|
|
7
|
+
export declare const CardContainer: FC<CardContainerProps>;
|
|
8
|
+
export declare const CardTitle: FC<CardTitleProps>;
|
|
9
|
+
export declare const CardSubtitle: FC<CardSubtitleProps>;
|
|
10
|
+
export declare const CardTag: FC<TagProps>;
|
|
11
|
+
export declare const CardHeader: FC<CardHeaderProps>;
|
|
12
|
+
export declare const CardDescription: FC<CardDescriptionProps>;
|
|
13
|
+
export declare const CardAction: FC<CardActionProps>;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as r, jsxs as g } from "react/jsx-runtime";
|
|
3
|
+
import { createContext as l, useContext as m, useMemo as f, Children as p, isValidElement as v } from "react";
|
|
4
|
+
import { Icon as N } from "../icon/icon.js";
|
|
5
|
+
import { Paragraph as h } from "../paragraph/paragraph.js";
|
|
6
|
+
import { Tag as x } from "../tag/tag.js";
|
|
7
|
+
const u = l(!1), c = l(!1), o = l(!1);
|
|
8
|
+
function i(e, a, t) {
|
|
9
|
+
if (!m(e))
|
|
10
|
+
throw new Error(`${a} must be used inside <${t}>`);
|
|
11
|
+
return !0;
|
|
12
|
+
}
|
|
13
|
+
const P = ({
|
|
14
|
+
children: e,
|
|
15
|
+
inset: a,
|
|
16
|
+
type: t = "vertical",
|
|
17
|
+
dataTestid: n
|
|
18
|
+
}) => {
|
|
19
|
+
const d = f(() => {
|
|
20
|
+
const s = `gi-card-inset-${a || "none"}`;
|
|
21
|
+
return `gi-card gi-card-${t} ${s} gi-not-prose`;
|
|
22
|
+
}, [t, a]);
|
|
23
|
+
return /* @__PURE__ */ r(u.Provider, { value: !0, children: /* @__PURE__ */ r("div", { className: d, "data-testid": n, children: e }) });
|
|
24
|
+
}, j = ({ media: e, href: a }) => {
|
|
25
|
+
if (i(u, "CardMedia", "Card"), !e)
|
|
26
|
+
return null;
|
|
27
|
+
switch (e.type) {
|
|
28
|
+
case "image": {
|
|
29
|
+
const { src: t, alt: n, aspectRatio: d } = e.config;
|
|
30
|
+
return /* @__PURE__ */ r("div", { className: "gi-card-image", children: /* @__PURE__ */ r("a", { href: a, children: /* @__PURE__ */ r(
|
|
31
|
+
"img",
|
|
32
|
+
{
|
|
33
|
+
src: t,
|
|
34
|
+
alt: n,
|
|
35
|
+
style: d ? { aspectRatio: d } : void 0,
|
|
36
|
+
className: d ? "gi-w-full" : void 0
|
|
37
|
+
}
|
|
38
|
+
) }) });
|
|
39
|
+
}
|
|
40
|
+
case "icon":
|
|
41
|
+
return /* @__PURE__ */ r("div", { className: "gi-card-icon", "aria-hidden": "true", children: /* @__PURE__ */ r("a", { href: a, children: /* @__PURE__ */ r(N, { ...e.config }) }) });
|
|
42
|
+
case "iframe":
|
|
43
|
+
return /* @__PURE__ */ r("div", { className: "gi-card-iframe", children: /* @__PURE__ */ r("iframe", { ...e.config }) });
|
|
44
|
+
default:
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
}, E = ({
|
|
48
|
+
children: e,
|
|
49
|
+
inset: a = "none"
|
|
50
|
+
}) => (i(u, "CardContainer", "Card"), /* @__PURE__ */ r(o.Provider, { value: !0, children: /* @__PURE__ */ r("div", { className: `gi-card-content gi-card-inset-${a || "none"}`, children: e }) })), M = ({ children: e }) => (i(c, "CardTitle", "CardHeader"), e ? /* @__PURE__ */ r("div", { className: "gi-card-title", children: e }) : null), A = ({ children: e }) => (i(c, "CardSubtitle", "CardHeader"), e ? /* @__PURE__ */ r("div", { className: "gi-card-subheading", children: e }) : null), T = ({ text: e, type: a }) => (i(c, "CardTag", "CardHeader"), /* @__PURE__ */ r("div", { className: "gi-card-tag", children: /* @__PURE__ */ r(x, { text: e, type: a }) }));
|
|
51
|
+
Object.defineProperty(T, "componentType", {
|
|
52
|
+
value: "CardTag",
|
|
53
|
+
writable: !1,
|
|
54
|
+
enumerable: !1
|
|
55
|
+
});
|
|
56
|
+
const D = ({ children: e }) => {
|
|
57
|
+
i(o, "CardHeader", "CardContainer");
|
|
58
|
+
const a = [], t = [];
|
|
59
|
+
return p.forEach(e, (n) => {
|
|
60
|
+
var s, C;
|
|
61
|
+
if (!v(n))
|
|
62
|
+
return;
|
|
63
|
+
(((s = n == null ? void 0 : n.type) == null ? void 0 : s.componentType) || ((C = n.props) == null ? void 0 : C.__mdxType)) === "CardTag" ? t.push(n) : a.push(n);
|
|
64
|
+
}), /* @__PURE__ */ r(c.Provider, { value: !0, children: /* @__PURE__ */ g("div", { className: "gi-card-header", children: [
|
|
65
|
+
/* @__PURE__ */ r("div", { className: "gi-card-heading", children: a }),
|
|
66
|
+
t
|
|
67
|
+
] }) });
|
|
68
|
+
}, R = ({
|
|
69
|
+
children: e
|
|
70
|
+
}) => (i(o, "CardDescription", "CardContainer"), e ? /* @__PURE__ */ r("div", { className: "gi-card-paragraph", children: /* @__PURE__ */ r(h, { size: "sm", children: e }) }) : null), S = ({
|
|
71
|
+
children: e
|
|
72
|
+
}) => (i(o, "CardAction", "CardContainer"), /* @__PURE__ */ r("div", { className: "gi-card-action", children: e }));
|
|
73
|
+
export {
|
|
74
|
+
S as CardAction,
|
|
75
|
+
E as CardContainer,
|
|
76
|
+
R as CardDescription,
|
|
77
|
+
D as CardHeader,
|
|
78
|
+
j as CardMedia,
|
|
79
|
+
P as CardNext,
|
|
80
|
+
A as CardSubtitle,
|
|
81
|
+
T as CardTag,
|
|
82
|
+
M as CardTitle,
|
|
83
|
+
i as useRequiredContext
|
|
84
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { CardLegacy as a } from "./card-legacy.js";
|
|
3
|
+
import { CardNext as n } from "./card-next.js";
|
|
4
|
+
const r = [
|
|
5
|
+
"title",
|
|
6
|
+
"subTitle",
|
|
7
|
+
"href",
|
|
8
|
+
"media",
|
|
9
|
+
"tag",
|
|
10
|
+
"content",
|
|
11
|
+
"action",
|
|
12
|
+
"titleAsChild"
|
|
13
|
+
], l = (e) => r.some((i) => i in e) ? (console.warn(
|
|
14
|
+
"[Card] Using legacy props. Please migrate to the new composable API."
|
|
15
|
+
), /* @__PURE__ */ t(a, { ...e })) : /* @__PURE__ */ t(
|
|
16
|
+
n,
|
|
17
|
+
{
|
|
18
|
+
inset: e.inset,
|
|
19
|
+
type: e.type,
|
|
20
|
+
dataTestid: e.dataTestid,
|
|
21
|
+
children: e.children
|
|
22
|
+
}
|
|
23
|
+
);
|
|
24
|
+
export {
|
|
25
|
+
l as Card
|
|
26
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { c as n, r as o } from "../test-utilities-BS7B3BF-.js";
|
|
3
|
+
import { Card as a } from "./card.js";
|
|
4
|
+
describe("govieCard", () => {
|
|
5
|
+
afterEach(n);
|
|
6
|
+
const i = (t) => o(/* @__PURE__ */ c(a, { ...t }));
|
|
7
|
+
it("should render a card with title and content", () => {
|
|
8
|
+
const t = i({
|
|
9
|
+
type: "vertical",
|
|
10
|
+
title: "Card Title",
|
|
11
|
+
content: "This is the card content."
|
|
12
|
+
}), e = t.getByText("Card Title"), r = t.getByText("This is the card content.");
|
|
13
|
+
expect(e).toBeTruthy(), expect(r).toBeTruthy(), expect(e.tagName).toBe("DIV"), expect(r.tagName).toBe("P");
|
|
14
|
+
}), it("should render a horizontal card layout", () => {
|
|
15
|
+
const e = i({
|
|
16
|
+
type: "horizontal",
|
|
17
|
+
title: "Horizontal Card",
|
|
18
|
+
content: "This is the content of a horizontal card."
|
|
19
|
+
}).container.querySelector(".gi-card-horizontal");
|
|
20
|
+
expect(e).toBeTruthy();
|
|
21
|
+
}), it("should render a vertical card layout", () => {
|
|
22
|
+
const e = i({
|
|
23
|
+
type: "vertical",
|
|
24
|
+
title: "Vertical Card",
|
|
25
|
+
content: "This is the content of a vertical card."
|
|
26
|
+
}).container.querySelector(".gi-card-vertical");
|
|
27
|
+
expect(e).toBeTruthy();
|
|
28
|
+
}), it('should render an image when media type is "image"', () => {
|
|
29
|
+
const { container: t } = i({
|
|
30
|
+
type: "vertical",
|
|
31
|
+
title: "Card with Image",
|
|
32
|
+
media: {
|
|
33
|
+
type: "image",
|
|
34
|
+
config: {
|
|
35
|
+
src: "SOME_PATH",
|
|
36
|
+
alt: "Test image"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
href: "#"
|
|
40
|
+
}), e = t.querySelector("img");
|
|
41
|
+
expect(e).toBeTruthy(), expect(e.getAttribute("src")).toBe("SOME_PATH"), expect(e.getAttribute("alt")).toBe("Test image");
|
|
42
|
+
}), it("should render an image with aspect ratio when provided", () => {
|
|
43
|
+
const { container: t } = i({
|
|
44
|
+
type: "vertical",
|
|
45
|
+
title: "Card with Image",
|
|
46
|
+
media: {
|
|
47
|
+
type: "image",
|
|
48
|
+
config: {
|
|
49
|
+
src: "SOME_PATH",
|
|
50
|
+
alt: "Test image",
|
|
51
|
+
aspectRatio: "16/9"
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
href: "#"
|
|
55
|
+
}), e = t.querySelector("img");
|
|
56
|
+
expect(e).toBeTruthy(), expect(e.getAttribute("style")).toBe("aspect-ratio: 16/9;");
|
|
57
|
+
}), it('should render an icon when media type is "icon"', () => {
|
|
58
|
+
var r;
|
|
59
|
+
const e = i({
|
|
60
|
+
type: "horizontal",
|
|
61
|
+
title: "Card with Icon",
|
|
62
|
+
media: {
|
|
63
|
+
type: "icon",
|
|
64
|
+
config: {
|
|
65
|
+
icon: "download",
|
|
66
|
+
size: "xl",
|
|
67
|
+
className: "gi-text-gray-500"
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}).getByTestId("govie-icon");
|
|
71
|
+
expect(e).toBeTruthy(), expect((r = e.textContent) == null ? void 0 : r.trim()).toBe("download"), expect(e.classList.contains("gi-text-gray-500")).toBe(!0);
|
|
72
|
+
}), it('should render an iframe when media type is "iframe"', () => {
|
|
73
|
+
const { container: t } = i({
|
|
74
|
+
type: "vertical",
|
|
75
|
+
title: "Card with Iframe",
|
|
76
|
+
media: {
|
|
77
|
+
type: "iframe",
|
|
78
|
+
config: {
|
|
79
|
+
src: "https://www.youtube.com/embed/test",
|
|
80
|
+
title: "Test video",
|
|
81
|
+
allowFullScreen: !0
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}), e = t.querySelector("iframe");
|
|
85
|
+
expect(e).toBeTruthy(), expect(e.getAttribute("src")).toBe(
|
|
86
|
+
"https://www.youtube.com/embed/test"
|
|
87
|
+
), expect(e.getAttribute("title")).toBe("Test video"), expect(e.getAttribute("allowFullScreen")).not.toBeNull();
|
|
88
|
+
}), it("should render actions if actions prop is provided", () => {
|
|
89
|
+
const e = i({
|
|
90
|
+
type: "vertical",
|
|
91
|
+
title: "Card with Actions",
|
|
92
|
+
content: "This is the card content with actions.",
|
|
93
|
+
action: { type: "link", href: "#", children: "Action 1" }
|
|
94
|
+
}).getByText("Action 1");
|
|
95
|
+
expect(e).toBeTruthy(), expect(e.getAttribute("href")).toBe("#");
|
|
96
|
+
}), it('should render a link if "href" prop is provided for title', () => {
|
|
97
|
+
const e = i({
|
|
98
|
+
type: "vertical",
|
|
99
|
+
title: "Linked Title",
|
|
100
|
+
href: "#",
|
|
101
|
+
content: "Content for a card with a link."
|
|
102
|
+
}).getByText("Linked Title");
|
|
103
|
+
expect(e.tagName).toBe("A"), expect(e.getAttribute("href")).toBe("#");
|
|
104
|
+
}), it('should render a subtitle if "subTitle" prop is provided', () => {
|
|
105
|
+
const e = i({
|
|
106
|
+
type: "vertical",
|
|
107
|
+
title: "Card with Subtitle",
|
|
108
|
+
subTitle: "This is the subtitle",
|
|
109
|
+
content: "Content for a card with a subtitle."
|
|
110
|
+
}).getByText("This is the subtitle");
|
|
111
|
+
expect(e.tagName).toBe("DIV"), expect(e.classList.contains("gi-card-subheading")).toBe(!0);
|
|
112
|
+
}), it('should render a tag if "tag" prop is provided', () => {
|
|
113
|
+
const e = i({
|
|
114
|
+
type: "vertical",
|
|
115
|
+
title: "Card with Tag",
|
|
116
|
+
content: "Content for a card with a tag.",
|
|
117
|
+
tag: {
|
|
118
|
+
text: "New",
|
|
119
|
+
type: "success"
|
|
120
|
+
}
|
|
121
|
+
}).getByText("New");
|
|
122
|
+
expect(e).toBeTruthy();
|
|
123
|
+
}), it("should pass axe accessibility tests", async () => {
|
|
124
|
+
await i({
|
|
125
|
+
type: "vertical",
|
|
126
|
+
title: "Accessible Card",
|
|
127
|
+
content: "Accessible content for the card."
|
|
128
|
+
}).axe();
|
|
129
|
+
});
|
|
130
|
+
});
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { Button } from '../button/button.js';
|
|
3
|
+
import { ButtonProps } from '../button/types.js';
|
|
4
|
+
import { IconProps } from '../icon/icon.js';
|
|
5
|
+
import { Link, LinkProps } from '../link/link.js';
|
|
6
|
+
import { TagProps } from '../tag/tag.js';
|
|
7
|
+
import { CardAction, CardContainer, CardDescription, CardMedia, CardHeader, CardTitle, CardSubtitle, CardTag } from './card-next.js';
|
|
8
|
+
type CardNextChild = ReactElement<typeof CardMedia> | ReactElement<typeof CardContainer> | ReactElement | undefined | null;
|
|
9
|
+
type CardContainerChild = ReactElement<typeof CardHeader> | ReactElement<typeof CardDescription> | ReactElement<typeof CardAction> | undefined;
|
|
10
|
+
type CardHeaderChild = ReactElement<typeof CardTitle> | ReactElement<typeof CardSubtitle> | ReactElement<typeof CardTag> | undefined;
|
|
11
|
+
type CardActionChild = ReactElement<typeof Button> | ReactElement<typeof Link>;
|
|
12
|
+
type CardTitleChild = ReactElement<typeof Link> | string;
|
|
13
|
+
type InsetProps = 'body' | 'full' | 'none';
|
|
14
|
+
type TypeProps = 'vertical' | 'horizontal';
|
|
15
|
+
export type Action = (ButtonProps & {
|
|
16
|
+
type: 'button';
|
|
17
|
+
}) | (LinkProps & {
|
|
18
|
+
type: 'link';
|
|
19
|
+
});
|
|
20
|
+
export type ImagePropTypes = {
|
|
21
|
+
src: string;
|
|
22
|
+
alt?: string;
|
|
23
|
+
aspectRatio?: '4/3' | '1/1' | `${number}/${number}`;
|
|
24
|
+
};
|
|
25
|
+
export type IframePropTypes = {
|
|
26
|
+
src: string;
|
|
27
|
+
title?: string;
|
|
28
|
+
allowFullScreen?: boolean;
|
|
29
|
+
allow?: string;
|
|
30
|
+
};
|
|
31
|
+
export type MediaContent = {
|
|
32
|
+
type: 'image';
|
|
33
|
+
config: ImagePropTypes;
|
|
34
|
+
} | {
|
|
35
|
+
type: 'icon';
|
|
36
|
+
config: IconProps;
|
|
37
|
+
} | {
|
|
38
|
+
type: 'iframe';
|
|
39
|
+
config: IframePropTypes;
|
|
40
|
+
};
|
|
41
|
+
export type CardProps = {
|
|
42
|
+
type?: TypeProps;
|
|
43
|
+
inset?: InsetProps;
|
|
44
|
+
children?: CardNextChild | CardNextChild[] | null;
|
|
45
|
+
dataTestid?: string;
|
|
46
|
+
/** @deprecated Use <CardTitle> instead */
|
|
47
|
+
title?: string;
|
|
48
|
+
/** @deprecated Use <CardTitle subtitle=""> instead */
|
|
49
|
+
subTitle?: string;
|
|
50
|
+
/** @deprecated Use <CardAction> with a n action component (e.g: Button, Link) instead */
|
|
51
|
+
action?: Action;
|
|
52
|
+
/** @deprecated Use <CardDescription> instead */
|
|
53
|
+
content?: string;
|
|
54
|
+
/** @deprecated Use <CardMedia> instead */
|
|
55
|
+
media?: MediaContent;
|
|
56
|
+
/** @deprecated Use <CardHeader tag={}> instead */
|
|
57
|
+
tag?: TagProps;
|
|
58
|
+
/** @deprecated Use <Link> around <CardTitle> instead */
|
|
59
|
+
href?: string;
|
|
60
|
+
/** @deprecated Use <CardTitle> */
|
|
61
|
+
titleAsChild?: boolean;
|
|
62
|
+
};
|
|
63
|
+
export type CardContainerProps = {
|
|
64
|
+
children: CardContainerChild | CardContainerChild[];
|
|
65
|
+
inset?: InsetProps;
|
|
66
|
+
};
|
|
67
|
+
export type CardDescriptionProps = {
|
|
68
|
+
children?: string;
|
|
69
|
+
};
|
|
70
|
+
export type CardActionProps = {
|
|
71
|
+
children: CardActionChild | CardActionChild[];
|
|
72
|
+
};
|
|
73
|
+
export type CardNextProps = {
|
|
74
|
+
children: CardNextChild | CardNextChild[];
|
|
75
|
+
inset?: InsetProps;
|
|
76
|
+
type?: TypeProps;
|
|
77
|
+
dataTestid?: string;
|
|
78
|
+
};
|
|
79
|
+
export type CardHeaderProps = {
|
|
80
|
+
children: CardHeaderChild | CardHeaderChild[];
|
|
81
|
+
};
|
|
82
|
+
export type CardTitleProps = {
|
|
83
|
+
children: CardTitleChild;
|
|
84
|
+
};
|
|
85
|
+
export type CardSubtitleProps = {
|
|
86
|
+
children?: string;
|
|
87
|
+
};
|
|
88
|
+
export type CardMediaProps = {
|
|
89
|
+
media: MediaContent;
|
|
90
|
+
href?: string;
|
|
91
|
+
};
|
|
92
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { InputCheckboxProps, InputCheckboxSizeEnumType } from '../input-checkbox/types.js';
|
|
2
|
+
import { InputCheckboxGroupProps } from '../input-checkbox-group/types.js';
|
|
3
|
+
/** @deprecated Use InputCheckboxSizeEnum instead */
|
|
4
|
+
export declare const CheckboxSizeEnum: {
|
|
5
|
+
readonly Large: "lg";
|
|
6
|
+
readonly Medium: "md";
|
|
7
|
+
readonly Small: "sm";
|
|
8
|
+
};
|
|
9
|
+
/** @deprecated Use InputCheckboxSizeEnumType instead */
|
|
10
|
+
export type CheckboxSizeEnumType = InputCheckboxSizeEnumType;
|
|
11
|
+
/** @deprecated Use InputCheckboxProps instead */
|
|
12
|
+
export type CheckboxProps = InputCheckboxProps;
|
|
13
|
+
/** @deprecated Use InputCheckboxGroupProps instead */
|
|
14
|
+
export type CheckboxGroupProps = InputCheckboxGroupProps;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type ChipProps = {
|
|
2
|
+
label: string;
|
|
3
|
+
onClose: (event: React.MouseEvent<HTMLDivElement> | React.KeyboardEvent<HTMLDivElement>) => void;
|
|
4
|
+
className?: string;
|
|
5
|
+
};
|
|
6
|
+
export declare const Chip: {
|
|
7
|
+
({ label, className, onClose }: ChipProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
displayName: string;
|
|
9
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as d, jsx as r } from "react/jsx-runtime";
|
|
3
|
+
import { useId as l } from "react";
|
|
4
|
+
import { cn as p } from "../cn.js";
|
|
5
|
+
import { translate as c } from "../i18n/utility.js";
|
|
6
|
+
import { Icon as s } from "../icon/icon.js";
|
|
7
|
+
const m = ({ label: i, className: t, onClose: n = () => null }) => {
|
|
8
|
+
const o = `chip-description-${l()}`, a = (e) => {
|
|
9
|
+
["Enter", " "].includes(e.key) && (e.preventDefault(), n(e));
|
|
10
|
+
};
|
|
11
|
+
return /* @__PURE__ */ d(
|
|
12
|
+
"div",
|
|
13
|
+
{
|
|
14
|
+
className: p(t, "gi-chip"),
|
|
15
|
+
"aria-label": c("chip.label", { label: i, defaultValue: `chip: ${i}` }),
|
|
16
|
+
"aria-describedby": o,
|
|
17
|
+
tabIndex: 0,
|
|
18
|
+
onKeyDown: a,
|
|
19
|
+
children: [
|
|
20
|
+
/* @__PURE__ */ r("span", { id: o, children: i }),
|
|
21
|
+
/* @__PURE__ */ r(
|
|
22
|
+
"div",
|
|
23
|
+
{
|
|
24
|
+
role: "button",
|
|
25
|
+
"aria-label": c("chip.removeChip", { defaultValue: "remove chip" }),
|
|
26
|
+
onClick: n,
|
|
27
|
+
children: /* @__PURE__ */ r(s, { icon: "close", size: "sm" })
|
|
28
|
+
}
|
|
29
|
+
)
|
|
30
|
+
]
|
|
31
|
+
}
|
|
32
|
+
);
|
|
33
|
+
};
|
|
34
|
+
m.displayName = "Chip";
|
|
35
|
+
export {
|
|
36
|
+
m as Chip
|
|
37
|
+
};
|
package/dist/cn.d.ts
ADDED
package/dist/cn.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
function i(r) {
|
|
2
|
+
var f, n, t = "";
|
|
3
|
+
if (typeof r == "string" || typeof r == "number") t += r;
|
|
4
|
+
else if (typeof r == "object") if (Array.isArray(r)) {
|
|
5
|
+
var o = r.length;
|
|
6
|
+
for (f = 0; f < o; f++) r[f] && (n = i(r[f])) && (t && (t += " "), t += n);
|
|
7
|
+
} else for (n in r) r[n] && (t && (t += " "), t += n);
|
|
8
|
+
return t;
|
|
9
|
+
}
|
|
10
|
+
function u() {
|
|
11
|
+
for (var r, f, n = 0, t = "", o = arguments.length; n < o; n++) (r = arguments[n]) && (f = i(r)) && (t && (t += " "), t += f);
|
|
12
|
+
return t;
|
|
13
|
+
}
|
|
14
|
+
function a(...r) {
|
|
15
|
+
return u(r);
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
a as cn
|
|
19
|
+
};
|