@ogcio/design-system-react 1.11.1 → 1.11.3
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/alert/alert.d.ts +89 -0
- package/dist/alert/alert.js +115 -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/breadcrumbs/breadcrumbs.d.ts +5 -0
- package/dist/breadcrumbs/breadcrumbs.js +38 -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/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/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/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/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/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/details/details.d.ts +4 -0
- package/dist/details/details.js +55 -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/error-text/error-text.d.ts +7 -0
- package/dist/error-text/error-text.js +40 -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/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/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/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/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/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/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/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/list/list.d.ts +13 -0
- package/dist/list/list.js +44 -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/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/paragraph/paragraph.d.ts +17 -0
- package/dist/paragraph/paragraph.js +60 -0
- package/dist/phase-banner/phase-banner.d.ts +5 -0
- package/dist/phase-banner/phase-banner.js +10 -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/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-stepper/progress-stepper.d.ts +5 -0
- package/dist/progress-stepper/progress-stepper.js +198 -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/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/stack/stack.d.ts +3 -0
- package/dist/stack/stack.js +186 -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/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/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/tag/tag.d.ts +19 -0
- package/dist/tag/tag.js +27 -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/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/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/package.json +4 -4
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as G, jsx as E } from "react/jsx-runtime";
|
|
3
|
+
import { useRef as C, useReducer as H, useEffect as m, createElement as j, isValidElement as K, Children as X } from "react";
|
|
4
|
+
import { cn as N } from "../cn.js";
|
|
5
|
+
import { InputText as $ } from "../input-text/input-text.js";
|
|
6
|
+
import { Popover as q } from "../popover/popover.js";
|
|
7
|
+
import { SelectMenu as z, SelectMenuOption as F } from "../select/select-menu.js";
|
|
8
|
+
import { AUTOCOMPLETE_ACTIONS as J } from "./types.js";
|
|
9
|
+
const {
|
|
10
|
+
ON_RESET: v,
|
|
11
|
+
ON_SELECT_ITEM: L,
|
|
12
|
+
SET_INPUT_VALUE: h,
|
|
13
|
+
SET_IS_OPEN: u,
|
|
14
|
+
SET_OPTIONS: T,
|
|
15
|
+
TOGGLE_CLEAR_BUTTON: O,
|
|
16
|
+
SET_VALUE: R,
|
|
17
|
+
SET_HIGHLIGHTED_INDEX: b
|
|
18
|
+
} = J, Q = (t, o) => {
|
|
19
|
+
switch (o.type) {
|
|
20
|
+
case u:
|
|
21
|
+
return { ...t, isOpen: o.payload };
|
|
22
|
+
case h:
|
|
23
|
+
return { ...t, inputValue: o.payload };
|
|
24
|
+
case T:
|
|
25
|
+
return { ...t, autocompleteOptions: o.payload };
|
|
26
|
+
case R:
|
|
27
|
+
return { ...t, value: o.payload };
|
|
28
|
+
case O:
|
|
29
|
+
return {
|
|
30
|
+
...t,
|
|
31
|
+
isClearButtonEnabled: o.payload || !!t.inputValue
|
|
32
|
+
};
|
|
33
|
+
case v:
|
|
34
|
+
return {
|
|
35
|
+
...t,
|
|
36
|
+
value: "",
|
|
37
|
+
inputValue: "",
|
|
38
|
+
isClearButtonEnabled: !1,
|
|
39
|
+
highlightedIndex: -1
|
|
40
|
+
};
|
|
41
|
+
case L:
|
|
42
|
+
return {
|
|
43
|
+
...t,
|
|
44
|
+
inputValue: o.payload.inputValue,
|
|
45
|
+
value: o.payload.value,
|
|
46
|
+
isOpen: !1,
|
|
47
|
+
isClearButtonEnabled: !0
|
|
48
|
+
};
|
|
49
|
+
case b:
|
|
50
|
+
return { ...t, highlightedIndex: o.payload, isOpen: !0 };
|
|
51
|
+
default:
|
|
52
|
+
return t;
|
|
53
|
+
}
|
|
54
|
+
}, W = (t, o) => {
|
|
55
|
+
var l, y;
|
|
56
|
+
const r = ((l = t.props.children) == null ? void 0 : l.toString().toLowerCase()) || "", s = (y = t.props.value) == null ? void 0 : y.toLowerCase(), c = o.toLowerCase();
|
|
57
|
+
return r.includes(c) || s.includes(c);
|
|
58
|
+
}, _ = (t) => {
|
|
59
|
+
var r, s;
|
|
60
|
+
const o = ((r = t == null ? void 0 : t.type) == null ? void 0 : r.componentType) || ((s = t == null ? void 0 : t.props) == null ? void 0 : s.__mdxType);
|
|
61
|
+
return K(t) && o === "AutocompleteItem";
|
|
62
|
+
}, S = (t) => X.toArray(t).filter((o) => _(o)) || [], I = (t, o) => {
|
|
63
|
+
var r;
|
|
64
|
+
return (((r = S(t).find((s) => s.props.value === o)) == null ? void 0 : r.props.children) || "").toString();
|
|
65
|
+
}, re = ({
|
|
66
|
+
disabled: t,
|
|
67
|
+
children: o,
|
|
68
|
+
defaultValue: r = "",
|
|
69
|
+
onChange: s,
|
|
70
|
+
...c
|
|
71
|
+
}) => {
|
|
72
|
+
const l = C(null), y = C(null), x = C(!1), [n, a] = H(Q, {
|
|
73
|
+
isOpen: !1,
|
|
74
|
+
value: r,
|
|
75
|
+
inputValue: r ? I(o, r) : "",
|
|
76
|
+
autocompleteOptions: o,
|
|
77
|
+
isClearButtonEnabled: !1,
|
|
78
|
+
highlightedIndex: -1
|
|
79
|
+
}), f = S(n.autocompleteOptions), V = (e) => {
|
|
80
|
+
if (s && l.current) {
|
|
81
|
+
const p = {
|
|
82
|
+
target: {
|
|
83
|
+
...l.current,
|
|
84
|
+
value: e
|
|
85
|
+
},
|
|
86
|
+
currentTarget: l.current,
|
|
87
|
+
bubbles: !0,
|
|
88
|
+
isTrusted: !0
|
|
89
|
+
};
|
|
90
|
+
s(p);
|
|
91
|
+
}
|
|
92
|
+
}, k = (e) => {
|
|
93
|
+
a({ type: u, payload: e }), e || a({ type: O, payload: !1 });
|
|
94
|
+
}, B = (e) => {
|
|
95
|
+
const {
|
|
96
|
+
target: { value: p }
|
|
97
|
+
} = e;
|
|
98
|
+
e.__origin === "clear_button" ? (a({ type: v }), a({ type: u, payload: !1 }), V("")) : (a({ type: h, payload: p }), p && a({ type: u, payload: !0 })), a({ type: O }), setTimeout(() => {
|
|
99
|
+
var i;
|
|
100
|
+
return (i = l.current) == null ? void 0 : i.focus();
|
|
101
|
+
});
|
|
102
|
+
}, P = () => {
|
|
103
|
+
var e;
|
|
104
|
+
a({ type: u, payload: !n.isOpen }), (e = l.current) == null || e.focus();
|
|
105
|
+
}, D = () => {
|
|
106
|
+
n.isOpen || a({
|
|
107
|
+
type: u,
|
|
108
|
+
payload: !0
|
|
109
|
+
});
|
|
110
|
+
}, w = (e) => {
|
|
111
|
+
a({
|
|
112
|
+
type: L,
|
|
113
|
+
payload: {
|
|
114
|
+
inputValue: I(o, e),
|
|
115
|
+
value: e
|
|
116
|
+
}
|
|
117
|
+
}), V(e);
|
|
118
|
+
};
|
|
119
|
+
m(() => {
|
|
120
|
+
var p;
|
|
121
|
+
const e = f.find(
|
|
122
|
+
(i) => _(i) && i.props.value === n.value
|
|
123
|
+
);
|
|
124
|
+
e && a({
|
|
125
|
+
type: h,
|
|
126
|
+
payload: ((p = e.props.children) == null ? void 0 : p.toString()) || ""
|
|
127
|
+
});
|
|
128
|
+
}, [n.value]), m(() => {
|
|
129
|
+
var p;
|
|
130
|
+
if (!x.current) {
|
|
131
|
+
x.current = !0;
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
n.inputValue === "" && n.value === "" && ((p = l.current) == null || p.focus());
|
|
135
|
+
}, [n.isClearButtonEnabled]), m(() => {
|
|
136
|
+
var e;
|
|
137
|
+
if (n.isOpen)
|
|
138
|
+
(e = l.current) == null || e.focus();
|
|
139
|
+
else {
|
|
140
|
+
const p = I(o, n.value);
|
|
141
|
+
p && n.value ? (a({
|
|
142
|
+
type: h,
|
|
143
|
+
payload: p
|
|
144
|
+
}), a({ type: u, payload: !1 })) : a({ type: v }), a({ type: O });
|
|
145
|
+
}
|
|
146
|
+
}, [n.isOpen]), m(() => {
|
|
147
|
+
if (n.inputValue && o) {
|
|
148
|
+
const e = S(o).filter(
|
|
149
|
+
(p) => W(p, n.inputValue)
|
|
150
|
+
);
|
|
151
|
+
a({ type: T, payload: e }), !n.isOpen && !n.value && a({ type: u, payload: !0 });
|
|
152
|
+
} else
|
|
153
|
+
a({ type: R, payload: "" }), a({ type: T, payload: o });
|
|
154
|
+
}, [n.inputValue]);
|
|
155
|
+
const U = (e) => {
|
|
156
|
+
const p = f.length, i = (d, M) => {
|
|
157
|
+
let g = d;
|
|
158
|
+
for (let A = 0; A < p; A++)
|
|
159
|
+
if (g = (g + M + p) % p, !f[g].props.disabled)
|
|
160
|
+
return g;
|
|
161
|
+
return -1;
|
|
162
|
+
};
|
|
163
|
+
if (e.key === "ArrowDown")
|
|
164
|
+
e.preventDefault(), a({
|
|
165
|
+
type: b,
|
|
166
|
+
payload: n.isOpen ? i(n.highlightedIndex, 1) : 0
|
|
167
|
+
});
|
|
168
|
+
else if (e.key === "ArrowUp")
|
|
169
|
+
e.preventDefault(), a({
|
|
170
|
+
type: b,
|
|
171
|
+
payload: i(n.highlightedIndex, -1)
|
|
172
|
+
});
|
|
173
|
+
else if (e.key === "Enter" && n.highlightedIndex >= 0) {
|
|
174
|
+
const d = f[n.highlightedIndex];
|
|
175
|
+
d && d.props.value && !d.props.disabled && w(d.props.value);
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
return /* @__PURE__ */ G(
|
|
179
|
+
"div",
|
|
180
|
+
{
|
|
181
|
+
...c,
|
|
182
|
+
"aria-disabled": t,
|
|
183
|
+
className: N("gi-autocomplete gi-not-prose", c.className),
|
|
184
|
+
children: [
|
|
185
|
+
/* @__PURE__ */ E(
|
|
186
|
+
$,
|
|
187
|
+
{
|
|
188
|
+
onKeyDown: U,
|
|
189
|
+
onIconEndClick: P,
|
|
190
|
+
onChange: B,
|
|
191
|
+
onClick: D,
|
|
192
|
+
clearButtonEnabled: n.isClearButtonEnabled,
|
|
193
|
+
inputActionPosition: "beforeSuffix",
|
|
194
|
+
"aria-label": "Type to Search",
|
|
195
|
+
"aria-disabled": t,
|
|
196
|
+
disabled: t,
|
|
197
|
+
placeholder: n.inputValue || "Type to Search",
|
|
198
|
+
iconEndClassName: N({
|
|
199
|
+
"gi-cursor-pointer": !t,
|
|
200
|
+
"gi-cursor-not-allowed gi-pointer-events-none": t
|
|
201
|
+
}),
|
|
202
|
+
iconEnd: n.isOpen ? "arrow_drop_up" : "arrow_drop_down",
|
|
203
|
+
ref: l,
|
|
204
|
+
iconEndRef: y,
|
|
205
|
+
value: n.inputValue,
|
|
206
|
+
"data-highlighted-index": n.highlightedIndex
|
|
207
|
+
}
|
|
208
|
+
),
|
|
209
|
+
/* @__PURE__ */ E(
|
|
210
|
+
q,
|
|
211
|
+
{
|
|
212
|
+
onOpenChange: k,
|
|
213
|
+
triggerRef: l,
|
|
214
|
+
extraRefs: [y],
|
|
215
|
+
open: n.isOpen,
|
|
216
|
+
options: {
|
|
217
|
+
placement: "bottom-start",
|
|
218
|
+
strategy: "absolute",
|
|
219
|
+
modifiers: [
|
|
220
|
+
{ name: "preventOverflow", options: { padding: 8 } },
|
|
221
|
+
{
|
|
222
|
+
name: "flip",
|
|
223
|
+
options: { fallbackPlacements: ["top", "right", "left"] }
|
|
224
|
+
}
|
|
225
|
+
]
|
|
226
|
+
},
|
|
227
|
+
children: /* @__PURE__ */ E(z, { onChange: w, children: f.map(
|
|
228
|
+
(e, p) => _(e) ? /* @__PURE__ */ j(
|
|
229
|
+
F,
|
|
230
|
+
{
|
|
231
|
+
...e.props,
|
|
232
|
+
key: `AutocompleteItem-${e.props.value}`,
|
|
233
|
+
selected: n.value === e.props.value,
|
|
234
|
+
isHighlighted: p === n.highlightedIndex
|
|
235
|
+
}
|
|
236
|
+
) : null
|
|
237
|
+
) })
|
|
238
|
+
}
|
|
239
|
+
)
|
|
240
|
+
]
|
|
241
|
+
}
|
|
242
|
+
);
|
|
243
|
+
}, Y = () => null;
|
|
244
|
+
Object.defineProperty(Y, "componentType", {
|
|
245
|
+
value: "AutocompleteItem",
|
|
246
|
+
writable: !1,
|
|
247
|
+
enumerable: !1
|
|
248
|
+
});
|
|
249
|
+
export {
|
|
250
|
+
re as Autocomplete,
|
|
251
|
+
Y as AutocompleteItem
|
|
252
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { SelectMenuOptionProps } from '../select/types.js';
|
|
3
|
+
export declare const AUTOCOMPLETE_ACTIONS: {
|
|
4
|
+
readonly SET_IS_OPEN: "SET_IS_OPEN";
|
|
5
|
+
readonly SET_INPUT_VALUE: "SET_INPUT_VALUE";
|
|
6
|
+
readonly SET_OPTIONS: "SET_OPTIONS";
|
|
7
|
+
readonly SET_VALUE: "SET_VALUE";
|
|
8
|
+
readonly ON_RESET: "ON_RESET";
|
|
9
|
+
readonly TOGGLE_CLEAR_BUTTON: "TOGGLE_CLEAR_BUTTON";
|
|
10
|
+
readonly ON_SELECT_ITEM: "ON_SELECT_ITEM";
|
|
11
|
+
readonly SET_HIGHLIGHTED_INDEX: "SET_HIGHLIGHTED_INDEX";
|
|
12
|
+
};
|
|
13
|
+
export type AutocompleteState = {
|
|
14
|
+
isOpen: boolean;
|
|
15
|
+
value: string;
|
|
16
|
+
inputValue: string;
|
|
17
|
+
isClearButtonEnabled: boolean;
|
|
18
|
+
autocompleteOptions: React.ReactNode;
|
|
19
|
+
highlightedIndex: number;
|
|
20
|
+
};
|
|
21
|
+
export type AutocompleteAction = {
|
|
22
|
+
type: typeof AUTOCOMPLETE_ACTIONS.SET_IS_OPEN;
|
|
23
|
+
payload: boolean;
|
|
24
|
+
} | {
|
|
25
|
+
type: typeof AUTOCOMPLETE_ACTIONS.SET_INPUT_VALUE;
|
|
26
|
+
payload: string;
|
|
27
|
+
} | {
|
|
28
|
+
type: typeof AUTOCOMPLETE_ACTIONS.SET_OPTIONS;
|
|
29
|
+
payload: React.ReactNode;
|
|
30
|
+
} | {
|
|
31
|
+
type: typeof AUTOCOMPLETE_ACTIONS.SET_VALUE;
|
|
32
|
+
payload: string;
|
|
33
|
+
} | {
|
|
34
|
+
type: typeof AUTOCOMPLETE_ACTIONS.ON_RESET;
|
|
35
|
+
} | {
|
|
36
|
+
type: typeof AUTOCOMPLETE_ACTIONS.TOGGLE_CLEAR_BUTTON;
|
|
37
|
+
payload?: boolean;
|
|
38
|
+
} | {
|
|
39
|
+
type: typeof AUTOCOMPLETE_ACTIONS.ON_SELECT_ITEM;
|
|
40
|
+
payload: {
|
|
41
|
+
inputValue: string;
|
|
42
|
+
value: string;
|
|
43
|
+
};
|
|
44
|
+
} | {
|
|
45
|
+
type: typeof AUTOCOMPLETE_ACTIONS.SET_HIGHLIGHTED_INDEX;
|
|
46
|
+
payload: number;
|
|
47
|
+
};
|
|
48
|
+
export type AutocompleteOptionItemElement = ReactElement<SelectMenuOptionProps & {
|
|
49
|
+
selectedValue: string;
|
|
50
|
+
}>;
|
|
51
|
+
export type AutocompleteProps = {
|
|
52
|
+
defaultValue?: string;
|
|
53
|
+
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
54
|
+
children: ReactElement<AutocompleteItemProps> | ReactElement<AutocompleteItemProps>[];
|
|
55
|
+
} & Omit<React.InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'defaultChecked'>;
|
|
56
|
+
export type AutocompleteItemProps = {
|
|
57
|
+
children: string;
|
|
58
|
+
className?: string;
|
|
59
|
+
value: string;
|
|
60
|
+
disabled?: boolean;
|
|
61
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const E = {
|
|
2
|
+
SET_IS_OPEN: "SET_IS_OPEN",
|
|
3
|
+
SET_INPUT_VALUE: "SET_INPUT_VALUE",
|
|
4
|
+
SET_OPTIONS: "SET_OPTIONS",
|
|
5
|
+
SET_VALUE: "SET_VALUE",
|
|
6
|
+
ON_RESET: "ON_RESET",
|
|
7
|
+
TOGGLE_CLEAR_BUTTON: "TOGGLE_CLEAR_BUTTON",
|
|
8
|
+
ON_SELECT_ITEM: "ON_SELECT_ITEM",
|
|
9
|
+
SET_HIGHLIGHTED_INDEX: "SET_HIGHLIGHTED_INDEX"
|
|
10
|
+
};
|
|
11
|
+
export {
|
|
12
|
+
E as AUTOCOMPLETE_ACTIONS
|
|
13
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { BreadcrumbLinkProps, BreadcrumbProps } from './types.js';
|
|
2
|
+
export declare const BreadcrumbEllipsis: () => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare const BreadcrumbLink: ({ href, children, asChild, ...ariaProps }: BreadcrumbLinkProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export declare const BreadcrumbCurrentLink: (props: BreadcrumbLinkProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare const Breadcrumbs: ({ children, iconStart }: BreadcrumbProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsx as r, jsxs as m } from "react/jsx-runtime";
|
|
2
|
+
import { translate as o } from "../i18n/utility.js";
|
|
3
|
+
import { Icon as l } from "../icon/icon.js";
|
|
4
|
+
import { Link as t } from "../link/link.js";
|
|
5
|
+
const p = () => /* @__PURE__ */ r("div", { "aria-hidden": "true", children: /* @__PURE__ */ r(l, { className: "gi-text-gray-700", icon: "more_horiz" }) }), c = ({
|
|
6
|
+
href: e,
|
|
7
|
+
children: a,
|
|
8
|
+
asChild: i,
|
|
9
|
+
...s
|
|
10
|
+
}) => /* @__PURE__ */ r(
|
|
11
|
+
t,
|
|
12
|
+
{
|
|
13
|
+
noColor: !0,
|
|
14
|
+
asChild: i,
|
|
15
|
+
href: e,
|
|
16
|
+
"aria-label": `${a} page`,
|
|
17
|
+
size: "sm",
|
|
18
|
+
className: "gi-breadcrumbs-link",
|
|
19
|
+
...s,
|
|
20
|
+
children: a
|
|
21
|
+
}
|
|
22
|
+
), f = (e) => /* @__PURE__ */ r(c, { ...e, "aria-current": "page" }), g = ({ children: e, iconStart: a }) => /* @__PURE__ */ m(
|
|
23
|
+
"nav",
|
|
24
|
+
{
|
|
25
|
+
"aria-label": o("breadcrumbs.breadcrumbs", { defaultValue: "Breadcrumbs" }),
|
|
26
|
+
className: "gi-breadcrumbs",
|
|
27
|
+
children: [
|
|
28
|
+
a && /* @__PURE__ */ r(l, { "aria-label": "chevron-left", icon: "chevron_left", size: "sm" }),
|
|
29
|
+
/* @__PURE__ */ r("ol", { role: "list", children: Array.isArray(e) ? e.map((i, s) => /* @__PURE__ */ r("li", { role: "listitem", children: i }, `breadcrumb_item_${s}`)) : /* @__PURE__ */ r("li", { role: "listitem", children: e }) })
|
|
30
|
+
]
|
|
31
|
+
}
|
|
32
|
+
);
|
|
33
|
+
export {
|
|
34
|
+
f as BreadcrumbCurrentLink,
|
|
35
|
+
p as BreadcrumbEllipsis,
|
|
36
|
+
c as BreadcrumbLink,
|
|
37
|
+
g as Breadcrumbs
|
|
38
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
import { BreadcrumbCurrentLink, BreadcrumbEllipsis, BreadcrumbLink } from './breadcrumbs.js';
|
|
3
|
+
type BreadcrumbLinkBaseProps = PropsWithChildren<{
|
|
4
|
+
asChild?: false;
|
|
5
|
+
href: string;
|
|
6
|
+
}> & React.AriaAttributes;
|
|
7
|
+
type BreadcrumbLinkAsChildProps = PropsWithChildren<{
|
|
8
|
+
asChild: true;
|
|
9
|
+
href?: string;
|
|
10
|
+
}> & React.AriaAttributes;
|
|
11
|
+
export type BreadcrumbLinkProps = BreadcrumbLinkBaseProps | BreadcrumbLinkAsChildProps;
|
|
12
|
+
type BreadcrumbChildrenType = React.ReactElement<typeof BreadcrumbLink | typeof BreadcrumbCurrentLink | typeof BreadcrumbEllipsis>;
|
|
13
|
+
export type BreadcrumbProps = {
|
|
14
|
+
iconStart?: boolean;
|
|
15
|
+
children: BreadcrumbChildrenType[] | BreadcrumbChildrenType;
|
|
16
|
+
};
|
|
17
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const Button: import('react').ForwardRefExoticComponent<import('react').ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
2
|
+
variant?: import('./types.js').ButtonVariant;
|
|
3
|
+
appearance?: import('./types.js').ButtonAppearance;
|
|
4
|
+
size?: import('./types.js').ButtonSize;
|
|
5
|
+
form?: string;
|
|
6
|
+
value?: string;
|
|
7
|
+
className?: string;
|
|
8
|
+
dataTestid?: string;
|
|
9
|
+
} & import('react').RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef as f } from "react";
|
|
4
|
+
import { cn as p } from "../cn.js";
|
|
5
|
+
import { isButtonDisabled as c, getSizeClass as g, getVariantAppearanceClass as l } from "./helpers.js";
|
|
6
|
+
const B = f(
|
|
7
|
+
({
|
|
8
|
+
variant: o,
|
|
9
|
+
appearance: r,
|
|
10
|
+
size: e,
|
|
11
|
+
disabled: t,
|
|
12
|
+
className: i,
|
|
13
|
+
children: s,
|
|
14
|
+
dataTestid: m,
|
|
15
|
+
...n
|
|
16
|
+
}, a) => /* @__PURE__ */ u(
|
|
17
|
+
"button",
|
|
18
|
+
{
|
|
19
|
+
...n,
|
|
20
|
+
"data-testid": m || "govie-button",
|
|
21
|
+
ref: a,
|
|
22
|
+
"aria-disabled": t,
|
|
23
|
+
disabled: t,
|
|
24
|
+
className: p(
|
|
25
|
+
"gi-btn",
|
|
26
|
+
l({ disabled: t, variant: o, appearance: r }),
|
|
27
|
+
g(e),
|
|
28
|
+
c({ disabled: t, variant: o, appearance: r }),
|
|
29
|
+
i
|
|
30
|
+
),
|
|
31
|
+
children: s
|
|
32
|
+
}
|
|
33
|
+
)
|
|
34
|
+
);
|
|
35
|
+
B.displayName = "Button";
|
|
36
|
+
export {
|
|
37
|
+
B as Button
|
|
38
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ButtonAppearance, ButtonVariant, ButtonSize } from './types.js';
|
|
2
|
+
export declare const getVariantAppearanceClass: ({ disabled, variant, appearance, }: {
|
|
3
|
+
disabled?: boolean;
|
|
4
|
+
variant?: ButtonVariant;
|
|
5
|
+
appearance?: ButtonAppearance;
|
|
6
|
+
}) => string | undefined;
|
|
7
|
+
export declare const getSizeClass: (size?: ButtonSize) => "gi-btn-small" | "gi-btn-large" | "gi-btn-regular";
|
|
8
|
+
export declare const getButtonIconSizeClass: (size?: ButtonSize) => "gi-icon-btn-small" | "gi-icon-btn-large" | "gi-icon-btn-regular";
|
|
9
|
+
export declare const isButtonDisabled: ({ disabled, variant, appearance, }: {
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
variant?: ButtonVariant;
|
|
12
|
+
appearance?: ButtonAppearance;
|
|
13
|
+
}) => string | undefined;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
const s = ({
|
|
2
|
+
disabled: t,
|
|
3
|
+
variant: e,
|
|
4
|
+
appearance: l
|
|
5
|
+
}) => {
|
|
6
|
+
let i;
|
|
7
|
+
return t || (e === "secondary" ? l === "dark" ? i = "gi-btn-secondary-dark" : l === "light" ? i = "gi-btn-secondary-light" : i = "gi-btn-secondary" : e === "flat" ? l === "dark" ? i = "gi-btn-flat-dark" : l === "light" ? i = "gi-btn-flat-light" : i = "gi-btn-flat" : l === "dark" ? i = "gi-btn-primary-dark" : l === "light" ? i = "gi-btn-primary-light" : i = "gi-btn-primary"), i;
|
|
8
|
+
}, r = (t) => {
|
|
9
|
+
switch (t) {
|
|
10
|
+
case "small":
|
|
11
|
+
return "gi-btn-small";
|
|
12
|
+
case "large":
|
|
13
|
+
return "gi-btn-large";
|
|
14
|
+
default:
|
|
15
|
+
return "gi-btn-regular";
|
|
16
|
+
}
|
|
17
|
+
}, g = (t) => {
|
|
18
|
+
switch (t) {
|
|
19
|
+
case "small":
|
|
20
|
+
return "gi-icon-btn-small";
|
|
21
|
+
case "large":
|
|
22
|
+
return "gi-icon-btn-large";
|
|
23
|
+
default:
|
|
24
|
+
return "gi-icon-btn-regular";
|
|
25
|
+
}
|
|
26
|
+
}, d = ({
|
|
27
|
+
disabled: t,
|
|
28
|
+
variant: e,
|
|
29
|
+
appearance: l
|
|
30
|
+
}) => {
|
|
31
|
+
let i;
|
|
32
|
+
return t && (e === "secondary" ? l === "dark" ? i = "gi-btn-secondary-dark-disabled" : l === "light" ? i = "gi-btn-secondary-light-disabled" : i = "gi-btn-secondary-disabled" : e === "flat" ? l === "dark" ? i = "gi-btn-flat-dark-disabled" : l === "light" ? i = "gi-btn-flat-light-disabled" : i = "gi-btn-flat-disabled" : l === "dark" ? i = "gi-btn-primary-dark-disabled" : l === "light" ? i = "gi-btn-primary-light-disabled" : i = "gi-btn-primary-disabled"), i;
|
|
33
|
+
};
|
|
34
|
+
export {
|
|
35
|
+
g as getButtonIconSizeClass,
|
|
36
|
+
r as getSizeClass,
|
|
37
|
+
s as getVariantAppearanceClass,
|
|
38
|
+
d as isButtonDisabled
|
|
39
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const ButtonVariants: readonly ["primary", "secondary", "flat"];
|
|
2
|
+
export type ButtonVariant = (typeof ButtonVariants)[number];
|
|
3
|
+
export type ButtonAppearance = 'default' | 'dark' | 'light';
|
|
4
|
+
export type ButtonSize = 'medium' | 'small' | 'large';
|
|
5
|
+
export type ButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
6
|
+
variant?: ButtonVariant;
|
|
7
|
+
appearance?: ButtonAppearance;
|
|
8
|
+
size?: ButtonSize;
|
|
9
|
+
form?: string;
|
|
10
|
+
value?: string;
|
|
11
|
+
className?: string;
|
|
12
|
+
dataTestid?: string;
|
|
13
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { FC, PropsWithChildren } from 'react';
|
|
2
|
+
import { ButtonAppearance, ButtonSize } from '../button/types.js';
|
|
3
|
+
type ButtonGroupItemProps = PropsWithChildren<{
|
|
4
|
+
value: string;
|
|
5
|
+
role?: string;
|
|
6
|
+
'aria-checked'?: boolean;
|
|
7
|
+
'aria-label'?: string;
|
|
8
|
+
}>;
|
|
9
|
+
export declare const ButtonGroupItem: FC<ButtonGroupItemProps>;
|
|
10
|
+
type ButtonGroupProps = PropsWithChildren<{
|
|
11
|
+
name: string;
|
|
12
|
+
size?: ButtonSize;
|
|
13
|
+
appearance?: ButtonAppearance;
|
|
14
|
+
onChange?: (value: string) => void;
|
|
15
|
+
defaultValue?: string;
|
|
16
|
+
role?: string;
|
|
17
|
+
'aria-labelledby'?: string;
|
|
18
|
+
'aria-describedby'?: string;
|
|
19
|
+
}>;
|
|
20
|
+
export declare const ButtonGroup: FC<ButtonGroupProps>;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as p } from "react/jsx-runtime";
|
|
3
|
+
import { createContext as x, useContext as B, useState as I } from "react";
|
|
4
|
+
import { Button as G } from "../button/button.js";
|
|
5
|
+
import { useDomId as g } from "../hooks/use-dom-id.js";
|
|
6
|
+
const b = x(
|
|
7
|
+
void 0
|
|
8
|
+
), w = ({
|
|
9
|
+
value: e,
|
|
10
|
+
children: a,
|
|
11
|
+
role: n,
|
|
12
|
+
"aria-checked": r,
|
|
13
|
+
"aria-label": i
|
|
14
|
+
}) => {
|
|
15
|
+
const o = B(b);
|
|
16
|
+
if (!o)
|
|
17
|
+
throw new Error("ButtonGroupItem must be used within a ButtonGroup");
|
|
18
|
+
const {
|
|
19
|
+
selectedValue: d,
|
|
20
|
+
setSelectedValue: c,
|
|
21
|
+
size: u,
|
|
22
|
+
onChange: t,
|
|
23
|
+
groupId: s,
|
|
24
|
+
appearance: l
|
|
25
|
+
} = o, m = d === e, f = () => {
|
|
26
|
+
c(e), t == null || t(e);
|
|
27
|
+
}, y = `${s}-${e}`;
|
|
28
|
+
return /* @__PURE__ */ p(
|
|
29
|
+
G,
|
|
30
|
+
{
|
|
31
|
+
variant: m ? "primary" : "secondary",
|
|
32
|
+
size: u,
|
|
33
|
+
appearance: l,
|
|
34
|
+
onClick: f,
|
|
35
|
+
id: y,
|
|
36
|
+
role: n || "radio",
|
|
37
|
+
"aria-checked": r === void 0 ? m : r,
|
|
38
|
+
"aria-label": i,
|
|
39
|
+
type: "button",
|
|
40
|
+
children: a
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
}, C = ({
|
|
44
|
+
name: e,
|
|
45
|
+
size: a = "medium",
|
|
46
|
+
appearance: n = "dark",
|
|
47
|
+
onChange: r,
|
|
48
|
+
defaultValue: i,
|
|
49
|
+
children: o,
|
|
50
|
+
role: d,
|
|
51
|
+
"aria-labelledby": c,
|
|
52
|
+
"aria-describedby": u
|
|
53
|
+
}) => {
|
|
54
|
+
const [t, s] = I(
|
|
55
|
+
i
|
|
56
|
+
), l = g();
|
|
57
|
+
return /* @__PURE__ */ p(
|
|
58
|
+
b.Provider,
|
|
59
|
+
{
|
|
60
|
+
value: {
|
|
61
|
+
selectedValue: t,
|
|
62
|
+
setSelectedValue: s,
|
|
63
|
+
name: e,
|
|
64
|
+
size: a,
|
|
65
|
+
onChange: r,
|
|
66
|
+
groupId: l,
|
|
67
|
+
appearance: n
|
|
68
|
+
},
|
|
69
|
+
children: /* @__PURE__ */ p(
|
|
70
|
+
"div",
|
|
71
|
+
{
|
|
72
|
+
className: "gi-btn-group",
|
|
73
|
+
role: d || "radiogroup",
|
|
74
|
+
"aria-labelledby": c,
|
|
75
|
+
"aria-describedby": u,
|
|
76
|
+
children: o
|
|
77
|
+
}
|
|
78
|
+
)
|
|
79
|
+
}
|
|
80
|
+
);
|
|
81
|
+
};
|
|
82
|
+
export {
|
|
83
|
+
C as ButtonGroup,
|
|
84
|
+
w as ButtonGroupItem
|
|
85
|
+
};
|