@ogcio/design-system-react 1.22.0 → 1.23.0
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/_commonjsHelpers-DaMA6jEr.js +8 -0
- package/dist/accordion/accordion-item.js +14 -15
- package/dist/alert/alert.js +19 -20
- package/dist/autocomplete/autocomplete.js +167 -169
- package/dist/autocomplete/use-autocomplete-controller.js +1 -1
- package/dist/browser-support/runtime.js +2 -3
- package/dist/button/button.js +11 -12
- package/dist/button-group/button-group.js +4 -5
- package/dist/card/card-next.js +122 -125
- package/dist/card/card.js +4 -5
- package/dist/checkbox/checkbox-group.js +3 -4
- package/dist/checkbox/checkbox.js +4 -5
- package/dist/chip/chip.js +11 -12
- package/dist/combo-box/dropdown-item.js +2 -3
- package/dist/cookie-banner/cookie-banner.js +6 -7
- package/dist/data-table/data-table-header.d.ts +0 -1
- package/dist/data-table/data-table-header.js +43 -60
- package/dist/data-table/editable-table-cell.js +3 -4
- package/dist/data-table/index.d.ts +7 -0
- package/dist/data-table/index.js +20 -0
- package/dist/data-table/tanstack/tanstack-helpers.d.ts +1 -0
- package/dist/data-table/tanstack/tanstack-helpers.js +31 -30
- package/dist/details/details.js +6 -7
- package/dist/drawer/drawer.js +18 -19
- package/dist/footer/footer.js +2 -3
- package/dist/forms/form-field/form-field.js +2 -3
- package/dist/header/components/header-menu.js +17 -18
- package/dist/header/header-legacy.js +2 -3
- package/dist/header/header-next/components/header-logo.js +3 -4
- package/dist/header/header-next/components/header-title.js +0 -1
- package/dist/header/header-next/components/menu/components/header-menu-item-button.js +4 -5
- package/dist/header/header-next/components/menu/components/header-menu-item-link.js +0 -1
- package/dist/header/header-next/components/menu/components/header-menu-item-separator.js +4 -5
- package/dist/header/header-next/components/menu/components/header-menu-item-slot.js +0 -1
- package/dist/header/header-next/components/menu/header-menu-context.js +9 -10
- package/dist/header/header-next/components/menu/header-primary-menu.js +4 -5
- package/dist/header/header-next/components/menu/header-secondary-menu.js +0 -1
- package/dist/header/header-next/header-context.js +4 -5
- package/dist/header/header-next/header-next.js +2 -3
- package/dist/hooks/use-breakpoint.js +7 -8
- package/dist/hooks/use-toggle-map.js +12 -13
- package/dist/i18n/config.d.ts +1 -1
- package/dist/i18n/config.js +14 -11
- package/dist/i18n/utility.js +1 -1
- package/dist/i18nInstance-D_96ADqd.js +48 -0
- package/dist/i18next-B_GQfCrJ.js +1362 -0
- package/dist/icon/icon.js +2 -3
- package/dist/icon-button/icon-button.js +4 -5
- package/dist/index.d.ts +1 -4
- package/dist/index.js +231 -220
- package/dist/input-checkbox/input-checkbox.js +36 -37
- package/dist/input-checkbox-group/input-checkbox-group.js +9 -10
- package/dist/input-password/input-password.js +0 -1
- package/dist/input-radio/input-radio.js +31 -34
- package/dist/input-radio-group/input-radio-group.js +8 -9
- package/dist/input-text/input-text.js +2 -3
- package/dist/{lodash-D1c5hFAM.js → lodash-LsP9-6SV.js} +1343 -1342
- package/dist/modal/modal.js +4 -5
- package/dist/pagination/pagination.js +713 -58
- package/dist/phase-banner/phase-banner.js +2 -3
- package/dist/popover/popover.js +2 -3
- package/dist/radio/radio-group.js +0 -1
- package/dist/radio/radio.js +0 -1
- package/dist/score-select/score-select.js +3 -4
- package/dist/select/select-menu.js +43 -41
- package/dist/select/select-next.js +190 -161
- package/dist/select/select.js +3 -4
- package/dist/side-nav/side-nav.js +9 -10
- package/dist/spinner/spinner.js +2 -3
- package/dist/stack/stack.js +20 -21
- package/dist/styles.css +1 -1
- package/dist/summary-list/summary-list-action.js +6 -7
- package/dist/summary-list/summary-list-context.js +4 -5
- package/dist/summary-list/summary-list-header.js +12 -13
- package/dist/summary-list/summary-list-row.js +17 -18
- package/dist/summary-list/summary-list-value.js +0 -1
- package/dist/summary-list/summary-list.js +4 -5
- package/dist/table/table-data.js +11 -12
- package/dist/table/table-header.js +2 -3
- package/dist/tabs/tab-item.d.ts +3 -2
- package/dist/tabs/tab-item.js +89 -67
- package/dist/tabs/tab-list.js +81 -66
- package/dist/tabs/tabs.d.ts +1 -1
- package/dist/tabs/tabs.js +12 -12
- package/dist/tabs/types.d.ts +9 -2
- package/dist/text-input/text-input.js +0 -1
- package/dist/textarea/textarea.js +12 -13
- package/dist/toast/ds-toast.js +10 -11
- package/dist/toast/toast.js +15 -16
- package/dist/tooltip/tooltip.js +12 -13
- package/dist/utilities.d.ts +4 -1
- package/dist/utilities.js +29 -16
- package/package.json +7 -6
- package/dist/i18next-DxWa09nx.js +0 -1395
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
var o = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
2
|
+
function l(e) {
|
|
3
|
+
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
4
|
+
}
|
|
5
|
+
export {
|
|
6
|
+
o as c,
|
|
7
|
+
l as g
|
|
8
|
+
};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import "
|
|
3
|
-
import { jsxs as r, Fragment as u, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { jsxs as d, Fragment as u, jsx as i } from "react/jsx-runtime";
|
|
4
3
|
import { useState as y, useRef as b } from "react";
|
|
5
4
|
import { c as h } from "../index-CB-zPpNk.js";
|
|
6
|
-
import { cn as
|
|
5
|
+
import { cn as r } from "../cn.js";
|
|
7
6
|
import { Icon as w } from "../icon/icon.js";
|
|
8
7
|
const I = h({
|
|
9
8
|
variants: {
|
|
@@ -12,18 +11,18 @@ const I = h({
|
|
|
12
11
|
small: "gi-py-2 gi-px-2 gi-text-sm gi-font-bold"
|
|
13
12
|
}
|
|
14
13
|
}
|
|
15
|
-
}),
|
|
14
|
+
}), N = ({
|
|
16
15
|
defaultExpanded: c,
|
|
17
16
|
children: s,
|
|
18
17
|
label: t,
|
|
19
18
|
disabled: e,
|
|
20
19
|
dataTestid: l,
|
|
21
20
|
iconStart: m,
|
|
22
|
-
variant:
|
|
21
|
+
variant: n = "default"
|
|
23
22
|
}) => {
|
|
24
23
|
const [o, a] = y(c), g = b(null), p = `${t}-button`, f = `${t}-panel`;
|
|
25
|
-
return /* @__PURE__ */
|
|
26
|
-
/* @__PURE__ */
|
|
24
|
+
return /* @__PURE__ */ d(u, { children: [
|
|
25
|
+
/* @__PURE__ */ i(
|
|
27
26
|
"div",
|
|
28
27
|
{
|
|
29
28
|
ref: g,
|
|
@@ -36,14 +35,14 @@ const I = h({
|
|
|
36
35
|
},
|
|
37
36
|
tabIndex: 0,
|
|
38
37
|
className: "gi-accordion",
|
|
39
|
-
children: /* @__PURE__ */
|
|
38
|
+
children: /* @__PURE__ */ d(
|
|
40
39
|
"div",
|
|
41
40
|
{
|
|
42
|
-
className:
|
|
41
|
+
className: r("gi-accordion-header", I({ variant: n })),
|
|
43
42
|
children: [
|
|
44
43
|
t,
|
|
45
44
|
" ",
|
|
46
|
-
/* @__PURE__ */
|
|
45
|
+
/* @__PURE__ */ i(
|
|
47
46
|
w,
|
|
48
47
|
{
|
|
49
48
|
icon: o ? "keyboard_arrow_up" : "keyboard_arrow_down"
|
|
@@ -54,17 +53,17 @@ const I = h({
|
|
|
54
53
|
)
|
|
55
54
|
}
|
|
56
55
|
),
|
|
57
|
-
/* @__PURE__ */
|
|
56
|
+
/* @__PURE__ */ i(
|
|
58
57
|
"div",
|
|
59
58
|
{
|
|
60
59
|
id: f,
|
|
61
60
|
role: "region",
|
|
62
61
|
"aria-labelledby": p,
|
|
63
|
-
className:
|
|
62
|
+
className: r("gi-px-2 gi-pb-4 gi-pt-2 gi-font-normal", {
|
|
64
63
|
"gi-block": o,
|
|
65
64
|
"gi-hidden": !o,
|
|
66
|
-
"gi-text-md":
|
|
67
|
-
"gi-text-sm":
|
|
65
|
+
"gi-text-md": n === "default",
|
|
66
|
+
"gi-text-sm": n === "small"
|
|
68
67
|
}),
|
|
69
68
|
children: s
|
|
70
69
|
}
|
|
@@ -72,5 +71,5 @@ const I = h({
|
|
|
72
71
|
] });
|
|
73
72
|
};
|
|
74
73
|
export {
|
|
75
|
-
|
|
74
|
+
N as AccordionItem
|
|
76
75
|
};
|
package/dist/alert/alert.js
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import "
|
|
3
|
-
import { jsxs as n, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { jsxs as n, jsx as i } from "react/jsx-runtime";
|
|
4
3
|
import { useState as v } from "react";
|
|
5
4
|
import { cn as c } from "../cn.js";
|
|
6
5
|
import { translate as D } from "../i18n/utility.js";
|
|
7
6
|
import { Icon as w } from "../icon/icon.js";
|
|
8
7
|
import { IconButton as x } from "../icon-button/icon-button.js";
|
|
9
8
|
import { alertVariants as I } from "./variants.js";
|
|
10
|
-
const V = ({ variant:
|
|
9
|
+
const V = ({ variant: e }) => {
|
|
11
10
|
let a;
|
|
12
|
-
switch (
|
|
11
|
+
switch (e) {
|
|
13
12
|
case "warning": {
|
|
14
13
|
a = "warning";
|
|
15
14
|
break;
|
|
@@ -27,53 +26,53 @@ const V = ({ variant: r }) => {
|
|
|
27
26
|
}
|
|
28
27
|
return a;
|
|
29
28
|
};
|
|
30
|
-
function
|
|
31
|
-
title:
|
|
29
|
+
function q({
|
|
30
|
+
title: e,
|
|
32
31
|
children: a,
|
|
33
|
-
variant:
|
|
34
|
-
showIcon:
|
|
32
|
+
variant: r = "info",
|
|
33
|
+
showIcon: l = !0,
|
|
35
34
|
dismissible: t,
|
|
36
|
-
onClose:
|
|
37
|
-
className:
|
|
35
|
+
onClose: s,
|
|
36
|
+
className: o,
|
|
38
37
|
...m
|
|
39
38
|
}) {
|
|
40
39
|
const [d, u] = v(!1), { base: f, heading: p, container: g, dismiss: b, baseDismissible: h } = I({
|
|
41
|
-
variant:
|
|
40
|
+
variant: r
|
|
42
41
|
}), k = t ? h : f;
|
|
43
42
|
return d ? null : /* @__PURE__ */ n(
|
|
44
43
|
"div",
|
|
45
44
|
{
|
|
46
|
-
className: c(k(),
|
|
45
|
+
className: c(k(), o, "gi-not-prose"),
|
|
47
46
|
role: "alert",
|
|
48
47
|
"aria-live": "assertive",
|
|
49
48
|
...m,
|
|
50
49
|
children: [
|
|
51
|
-
|
|
50
|
+
l ? /* @__PURE__ */ i(
|
|
52
51
|
w,
|
|
53
52
|
{
|
|
54
|
-
icon: V({ variant:
|
|
53
|
+
icon: V({ variant: r }),
|
|
55
54
|
ariaHidden: !0,
|
|
56
55
|
className: "gi-alert-icon",
|
|
57
|
-
"data-variant":
|
|
56
|
+
"data-variant": r
|
|
58
57
|
}
|
|
59
58
|
) : null,
|
|
60
59
|
/* @__PURE__ */ n(
|
|
61
60
|
"div",
|
|
62
61
|
{
|
|
63
62
|
className: c(g(), {
|
|
64
|
-
"gi-gap-1":
|
|
63
|
+
"gi-gap-1": e
|
|
65
64
|
}),
|
|
66
65
|
children: [
|
|
67
|
-
|
|
66
|
+
e && /* @__PURE__ */ i("p", { className: p(), children: e }),
|
|
68
67
|
a
|
|
69
68
|
]
|
|
70
69
|
}
|
|
71
70
|
),
|
|
72
|
-
t && /* @__PURE__ */
|
|
71
|
+
t && /* @__PURE__ */ i(
|
|
73
72
|
x,
|
|
74
73
|
{
|
|
75
74
|
onClick: (N) => {
|
|
76
|
-
u(!0),
|
|
75
|
+
u(!0), s == null || s(N);
|
|
77
76
|
},
|
|
78
77
|
className: b(),
|
|
79
78
|
size: "small",
|
|
@@ -90,5 +89,5 @@ function y({
|
|
|
90
89
|
);
|
|
91
90
|
}
|
|
92
91
|
export {
|
|
93
|
-
|
|
92
|
+
q as Alert
|
|
94
93
|
};
|
|
@@ -1,190 +1,188 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import "
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { jsxs as q, jsx as f } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef as z, useRef as N, useImperativeHandle as J, useEffect as Q, useCallback as W, createElement as Y, Children as Z, isValidElement as ee } from "react";
|
|
4
|
+
import { cn as D } from "../cn.js";
|
|
5
|
+
import { useDomId as te } from "../hooks/use-dom-id.js";
|
|
6
6
|
import { translate as P } from "../i18n/utility.js";
|
|
7
7
|
import { InputText as oe } from "../input-text/input-text.js";
|
|
8
8
|
import { Popover as ne } from "../popover/popover.js";
|
|
9
|
-
import { SelectMenu as ae, SelectMenuOption as
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
9
|
+
import { SelectMenu as ae, SelectMenuOption as G, SelectMenuGroupItem as re } from "../select/select-menu.js";
|
|
10
|
+
import { cycleEnabledIndex as le } from "../utilities.js";
|
|
11
|
+
import { AUTOCOMPLETE_ACTIONS as pe } from "./types.js";
|
|
12
|
+
import { useAutocompleteController as ie } from "./use-autocomplete-controller.js";
|
|
12
13
|
const {
|
|
13
|
-
ON_RESET:
|
|
14
|
-
ON_SELECT_ITEM:
|
|
15
|
-
SET_INPUT_VALUE:
|
|
16
|
-
SET_IS_OPEN:
|
|
17
|
-
TOGGLE_CLEAR_BUTTON:
|
|
18
|
-
SET_HIGHLIGHTED_INDEX:
|
|
19
|
-
SET_VALUE:
|
|
20
|
-
} =
|
|
21
|
-
|
|
22
|
-
target: { name:
|
|
23
|
-
currentTarget: { name:
|
|
14
|
+
ON_RESET: se,
|
|
15
|
+
ON_SELECT_ITEM: ce,
|
|
16
|
+
SET_INPUT_VALUE: L,
|
|
17
|
+
SET_IS_OPEN: s,
|
|
18
|
+
TOGGLE_CLEAR_BUTTON: C,
|
|
19
|
+
SET_HIGHLIGHTED_INDEX: ue,
|
|
20
|
+
SET_VALUE: de
|
|
21
|
+
} = pe, me = (a) => a ? "keyboard_arrow_up" : "keyboard_arrow_down", O = (a, r) => (p) => {
|
|
22
|
+
a && a({
|
|
23
|
+
target: { name: r, value: p },
|
|
24
|
+
currentTarget: { name: r, value: p },
|
|
24
25
|
type: "change",
|
|
25
26
|
bubbles: !0,
|
|
26
27
|
isTrusted: !0
|
|
27
28
|
});
|
|
28
|
-
},
|
|
29
|
-
|
|
30
|
-
target: { name:
|
|
31
|
-
currentTarget: { name:
|
|
29
|
+
}, fe = (a, r) => (p) => {
|
|
30
|
+
a && a({
|
|
31
|
+
target: { name: r, value: p },
|
|
32
|
+
currentTarget: { name: r, value: p },
|
|
32
33
|
type: "blur",
|
|
33
34
|
bubbles: !0,
|
|
34
35
|
isTrusted: !0
|
|
35
36
|
});
|
|
36
|
-
},
|
|
37
|
-
(
|
|
38
|
-
var
|
|
39
|
-
const p =
|
|
40
|
-
disabled:
|
|
41
|
-
children:
|
|
37
|
+
}, xe = z(
|
|
38
|
+
(a, r) => {
|
|
39
|
+
var x;
|
|
40
|
+
const p = N(null), {
|
|
41
|
+
disabled: l,
|
|
42
|
+
children: u,
|
|
42
43
|
placeholder: h,
|
|
43
44
|
onSelectItem: y,
|
|
44
45
|
isLoading: g,
|
|
45
|
-
freeSolo:
|
|
46
|
-
onChange:
|
|
47
|
-
onBlur:
|
|
48
|
-
name:
|
|
49
|
-
value:
|
|
50
|
-
id:
|
|
51
|
-
} =
|
|
46
|
+
freeSolo: i = !1,
|
|
47
|
+
onChange: b,
|
|
48
|
+
onBlur: R,
|
|
49
|
+
name: d,
|
|
50
|
+
value: E,
|
|
51
|
+
id: B
|
|
52
|
+
} = a, v = N(!1), {
|
|
52
53
|
state: t,
|
|
53
54
|
dispatch: o,
|
|
54
|
-
inputRef:
|
|
55
|
-
getOptionLabelByValue:
|
|
56
|
-
listRef:
|
|
57
|
-
debouncedFilter:
|
|
58
|
-
} =
|
|
59
|
-
...
|
|
60
|
-
onChange:
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
type:
|
|
65
|
-
payload:
|
|
66
|
-
}), o({ type:
|
|
67
|
-
}, [
|
|
68
|
-
const
|
|
69
|
-
o({ type:
|
|
70
|
-
},
|
|
71
|
-
o({ type:
|
|
72
|
-
},
|
|
73
|
-
o({ type:
|
|
74
|
-
},
|
|
55
|
+
inputRef: m,
|
|
56
|
+
getOptionLabelByValue: S,
|
|
57
|
+
listRef: A,
|
|
58
|
+
debouncedFilter: M
|
|
59
|
+
} = ie({
|
|
60
|
+
...a,
|
|
61
|
+
onChange: O(b, d)
|
|
62
|
+
}), _ = te();
|
|
63
|
+
J(r, () => m.current), Q(() => {
|
|
64
|
+
E !== void 0 && (o({ type: de, payload: E }), o({
|
|
65
|
+
type: L,
|
|
66
|
+
payload: S(u, E)
|
|
67
|
+
}), o({ type: C }));
|
|
68
|
+
}, [E]);
|
|
69
|
+
const w = a["aria-label"] ?? P("autocomplete.placeholder", { defaultValue: "Type to Search" }), U = (e) => {
|
|
70
|
+
o({ type: s, payload: e }), e || o({ type: C, payload: !1 });
|
|
71
|
+
}, V = () => {
|
|
72
|
+
o({ type: se }), o({ type: s, payload: !1 }), O(b, d)("");
|
|
73
|
+
}, H = (e) => {
|
|
74
|
+
o({ type: L, payload: e }), i && O(b, d)(e), e && o({ type: s, payload: !0 }), M(e);
|
|
75
|
+
}, j = (e) => {
|
|
75
76
|
const {
|
|
76
|
-
target: { value:
|
|
77
|
+
target: { value: n }
|
|
77
78
|
} = e;
|
|
78
|
-
e.__origin === "clear_button" ?
|
|
79
|
-
var
|
|
80
|
-
return (
|
|
79
|
+
e.__origin === "clear_button" ? V() : H(n), o({ type: C }), setTimeout(() => {
|
|
80
|
+
var c;
|
|
81
|
+
return (c = m.current) == null ? void 0 : c.focus();
|
|
81
82
|
});
|
|
82
|
-
},
|
|
83
|
+
}, $ = () => {
|
|
83
84
|
var e;
|
|
84
|
-
o({ type:
|
|
85
|
-
},
|
|
85
|
+
o({ type: s, payload: !t.isOpen }), (e = m.current) == null || e.focus();
|
|
86
|
+
}, K = () => {
|
|
86
87
|
t.isOpen || o({
|
|
87
|
-
type:
|
|
88
|
+
type: s,
|
|
88
89
|
payload: !0
|
|
89
90
|
});
|
|
90
|
-
},
|
|
91
|
+
}, T = (e) => {
|
|
91
92
|
o({
|
|
92
|
-
type:
|
|
93
|
+
type: ce,
|
|
93
94
|
payload: {
|
|
94
|
-
inputValue:
|
|
95
|
+
inputValue: S(u, e),
|
|
95
96
|
value: e
|
|
96
97
|
}
|
|
97
|
-
}),
|
|
98
|
-
var
|
|
99
|
-
|
|
98
|
+
}), O(b, d)(e), setTimeout(() => {
|
|
99
|
+
var n;
|
|
100
|
+
(n = m.current) == null || n.focus();
|
|
100
101
|
}, 0), y == null || y(e);
|
|
101
|
-
},
|
|
102
|
-
var
|
|
103
|
-
const { relatedTarget:
|
|
104
|
-
if (
|
|
105
|
-
setTimeout(() =>
|
|
102
|
+
}, F = (e) => {
|
|
103
|
+
var I, k;
|
|
104
|
+
const { relatedTarget: n } = e;
|
|
105
|
+
if (n && ((I = A.current) != null && I.contains(n) || (k = p.current) != null && k.contains(n)) || v.current) {
|
|
106
|
+
setTimeout(() => v.current = !1, 0);
|
|
106
107
|
return;
|
|
107
108
|
}
|
|
108
|
-
const
|
|
109
|
-
|
|
110
|
-
},
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
type:
|
|
122
|
-
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
109
|
+
const c = t.value ?? t.inputValue ?? "";
|
|
110
|
+
fe(R, d)(c);
|
|
111
|
+
}, X = W(
|
|
112
|
+
(e) => {
|
|
113
|
+
switch (e.key) {
|
|
114
|
+
case "ArrowDown":
|
|
115
|
+
case "ArrowUp": {
|
|
116
|
+
e.preventDefault();
|
|
117
|
+
const n = () => t.highlightedIndex === -1 ? c === -1 ? 0 : -1 : t.highlightedIndex, c = e.key === "ArrowDown" ? 1 : -1, I = le(
|
|
118
|
+
t.autocompleteOptions,
|
|
119
|
+
n(),
|
|
120
|
+
c
|
|
121
|
+
);
|
|
122
|
+
o({ type: ue, payload: I }), o({ type: s, payload: !0 });
|
|
123
|
+
break;
|
|
124
|
+
}
|
|
125
|
+
case "Enter":
|
|
126
|
+
case "NumpadEnter": {
|
|
127
|
+
if (e.preventDefault(), t.highlightedIndex >= 0) {
|
|
128
|
+
const n = t.autocompleteOptions[t.highlightedIndex];
|
|
129
|
+
n && n.props.value && !n.props.disabled && T(n.props.value);
|
|
130
|
+
}
|
|
131
|
+
break;
|
|
132
|
+
}
|
|
133
|
+
case "Tab": {
|
|
134
|
+
o({ type: s, payload: !1 });
|
|
135
|
+
break;
|
|
136
|
+
}
|
|
137
|
+
case "Escape": {
|
|
138
|
+
o({ type: s, payload: !1 });
|
|
139
|
+
break;
|
|
138
140
|
}
|
|
139
|
-
break;
|
|
140
|
-
}
|
|
141
|
-
case "Escape": {
|
|
142
|
-
o({ type: c, payload: !1 });
|
|
143
|
-
break;
|
|
144
141
|
}
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
|
|
142
|
+
},
|
|
143
|
+
[t.highlightedIndex]
|
|
144
|
+
);
|
|
145
|
+
return /* @__PURE__ */ q(
|
|
148
146
|
"div",
|
|
149
147
|
{
|
|
150
|
-
"aria-disabled":
|
|
151
|
-
className:
|
|
148
|
+
"aria-disabled": l,
|
|
149
|
+
className: D("gi-autocomplete gi-not-prose", a.className),
|
|
152
150
|
children: [
|
|
153
|
-
/* @__PURE__ */
|
|
151
|
+
/* @__PURE__ */ f("span", { id: _, className: "gi-sr-only", children: w }),
|
|
152
|
+
/* @__PURE__ */ f(
|
|
154
153
|
oe,
|
|
155
154
|
{
|
|
156
155
|
autoComplete: "off",
|
|
157
|
-
id:
|
|
158
|
-
name:
|
|
159
|
-
onKeyDown:
|
|
160
|
-
onIconEndClick:
|
|
161
|
-
onChange:
|
|
162
|
-
onClick:
|
|
163
|
-
onBlur:
|
|
156
|
+
id: B,
|
|
157
|
+
name: d,
|
|
158
|
+
onKeyDown: X,
|
|
159
|
+
onIconEndClick: $,
|
|
160
|
+
onChange: j,
|
|
161
|
+
onClick: K,
|
|
162
|
+
onBlur: F,
|
|
164
163
|
clearButtonEnabled: t.isClearButtonEnabled,
|
|
165
164
|
inputActionPosition: "beforeSuffix",
|
|
166
|
-
"aria-label":
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
disabled: r,
|
|
165
|
+
"aria-label": w,
|
|
166
|
+
"aria-labelledby": _,
|
|
167
|
+
"aria-disabled": l,
|
|
168
|
+
disabled: l,
|
|
171
169
|
placeholder: h ?? P("autocomplete.placeholder", { defaultValue: "Type to Search" }),
|
|
172
|
-
iconEndClassName:
|
|
173
|
-
"gi-cursor-pointer": !
|
|
174
|
-
"gi-cursor-not-allowed gi-pointer-events-none":
|
|
170
|
+
iconEndClassName: D({
|
|
171
|
+
"gi-cursor-pointer": !l && !i,
|
|
172
|
+
"gi-cursor-not-allowed gi-pointer-events-none": l && !i
|
|
175
173
|
}),
|
|
176
|
-
iconEnd:
|
|
177
|
-
ref:
|
|
174
|
+
iconEnd: i ? void 0 : me(t.isOpen),
|
|
175
|
+
ref: m,
|
|
178
176
|
iconEndRef: p,
|
|
179
177
|
value: t.inputValue,
|
|
180
178
|
"data-highlighted-index": t.highlightedIndex
|
|
181
179
|
}
|
|
182
180
|
),
|
|
183
|
-
/* @__PURE__ */
|
|
181
|
+
/* @__PURE__ */ f(
|
|
184
182
|
ne,
|
|
185
183
|
{
|
|
186
|
-
onOpenChange:
|
|
187
|
-
triggerRef:
|
|
184
|
+
onOpenChange: U,
|
|
185
|
+
triggerRef: m,
|
|
188
186
|
extraRefs: [p],
|
|
189
187
|
open: t.isOpen,
|
|
190
188
|
maxHeight: 304,
|
|
@@ -199,17 +197,17 @@ const {
|
|
|
199
197
|
}
|
|
200
198
|
]
|
|
201
199
|
},
|
|
202
|
-
children: /* @__PURE__ */
|
|
200
|
+
children: /* @__PURE__ */ f(
|
|
203
201
|
ae,
|
|
204
202
|
{
|
|
205
|
-
onChange:
|
|
203
|
+
onChange: T,
|
|
206
204
|
isLoading: g,
|
|
207
|
-
showNoData: !((
|
|
208
|
-
ref:
|
|
209
|
-
children:
|
|
205
|
+
showNoData: !((x = t.autocompleteOptions) != null && x.length),
|
|
206
|
+
ref: A,
|
|
207
|
+
children: he(
|
|
210
208
|
t.autocompleteOptions,
|
|
211
209
|
t,
|
|
212
|
-
|
|
210
|
+
T
|
|
213
211
|
)
|
|
214
212
|
}
|
|
215
213
|
)
|
|
@@ -219,33 +217,33 @@ const {
|
|
|
219
217
|
}
|
|
220
218
|
);
|
|
221
219
|
}
|
|
222
|
-
),
|
|
223
|
-
if (
|
|
224
|
-
return /* @__PURE__ */
|
|
225
|
-
|
|
220
|
+
), he = (a, r, p) => a.map((l, u) => {
|
|
221
|
+
if (r.optionType === "AutocompleteItem")
|
|
222
|
+
return /* @__PURE__ */ Y(
|
|
223
|
+
G,
|
|
226
224
|
{
|
|
227
|
-
...
|
|
228
|
-
key: `AutocompleteItem-${
|
|
229
|
-
selected:
|
|
230
|
-
isHighlighted:
|
|
231
|
-
index:
|
|
225
|
+
...l.props,
|
|
226
|
+
key: `AutocompleteItem-${l.props.value}`,
|
|
227
|
+
selected: r.value === l.props.value,
|
|
228
|
+
isHighlighted: u === r.highlightedIndex,
|
|
229
|
+
index: u
|
|
232
230
|
}
|
|
233
231
|
);
|
|
234
|
-
if (
|
|
235
|
-
const h =
|
|
236
|
-
const
|
|
237
|
-
return /* @__PURE__ */
|
|
238
|
-
|
|
232
|
+
if (r.optionType === "AutocompleteGroupItem") {
|
|
233
|
+
const h = l, y = Z.toArray(h.props.children).filter((g) => ee(g)).map((g) => {
|
|
234
|
+
const i = g.props;
|
|
235
|
+
return /* @__PURE__ */ f(
|
|
236
|
+
G,
|
|
239
237
|
{
|
|
240
|
-
...
|
|
241
|
-
selected:
|
|
238
|
+
...i,
|
|
239
|
+
selected: r.value.toString() === i.value.toString(),
|
|
242
240
|
onChange: p,
|
|
243
|
-
index:
|
|
241
|
+
index: u
|
|
244
242
|
},
|
|
245
|
-
`SelectGroupItemNext-SelectItemNext-${
|
|
243
|
+
`SelectGroupItemNext-SelectItemNext-${i.value.toString()}`
|
|
246
244
|
);
|
|
247
245
|
});
|
|
248
|
-
return /* @__PURE__ */
|
|
246
|
+
return /* @__PURE__ */ f(
|
|
249
247
|
re,
|
|
250
248
|
{
|
|
251
249
|
label: h.props.label,
|
|
@@ -255,21 +253,21 @@ const {
|
|
|
255
253
|
);
|
|
256
254
|
}
|
|
257
255
|
return null;
|
|
258
|
-
}),
|
|
259
|
-
Object.defineProperty(
|
|
256
|
+
}), ye = () => null;
|
|
257
|
+
Object.defineProperty(ye, "componentType", {
|
|
260
258
|
value: "AutocompleteItem",
|
|
261
259
|
writable: !1,
|
|
262
260
|
enumerable: !1
|
|
263
261
|
});
|
|
264
|
-
const
|
|
265
|
-
Object.defineProperty(
|
|
262
|
+
const ge = () => null;
|
|
263
|
+
Object.defineProperty(ge, "componentType", {
|
|
266
264
|
value: "AutocompleteGroupItem",
|
|
267
265
|
writable: !1,
|
|
268
266
|
enumerable: !1
|
|
269
267
|
});
|
|
270
268
|
export {
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
269
|
+
xe as Autocomplete,
|
|
270
|
+
ge as AutocompleteGroupItem,
|
|
271
|
+
ye as AutocompleteItem,
|
|
272
|
+
he as renderSelectMenuOptions
|
|
275
273
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { l as F } from "../lodash-
|
|
1
|
+
import { l as F } from "../lodash-LsP9-6SV.js";
|
|
2
2
|
import { useRef as g, useMemo as G, Children as C, useReducer as X, useEffect as A, isValidElement as h } from "react";
|
|
3
3
|
import { useScrollHighlightedItem as Y } from "../hooks/use-scroll-highlighted-item.js";
|
|
4
4
|
import { safeCloneElement as j } from "../utils/utilities.js";
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import "@ogcio/design-system-react/browser-check";
|
|
3
2
|
const w = {
|
|
4
3
|
desktop: { chromium: 109, gecko: 128, webkit: 16 },
|
|
5
4
|
mobile: { chromium: 114, gecko: 128, webkit: 16 }
|
|
@@ -269,7 +268,7 @@ typeof document < "u" && queueMicrotask(() => {
|
|
|
269
268
|
console.error("[browser-check] failed to run", e);
|
|
270
269
|
});
|
|
271
270
|
});
|
|
272
|
-
const
|
|
271
|
+
const I = {
|
|
273
272
|
extractFirefoxMajorVersion: B,
|
|
274
273
|
extractSafariMajorVersion: L,
|
|
275
274
|
normalizeBrand: V,
|
|
@@ -279,5 +278,5 @@ const U = {
|
|
|
279
278
|
SUPPORT_POLICY: w
|
|
280
279
|
};
|
|
281
280
|
export {
|
|
282
|
-
|
|
281
|
+
I as __test
|
|
283
282
|
};
|