@ogcio/design-system-react 1.12.3 → 1.13.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/accordion/accordion-item.js +1 -1
- package/dist/alert/alert.js +1 -1
- package/dist/autocomplete/autocomplete.js +124 -198
- package/dist/autocomplete/types.d.ts +23 -5
- package/dist/autocomplete/use-autocomplete-controller.d.ts +10 -0
- package/dist/autocomplete/use-autocomplete-controller.js +125 -0
- package/dist/button/helpers.d.ts +1 -1
- package/dist/button/helpers.js +14 -12
- package/dist/button/types.d.ts +1 -1
- package/dist/button-group/button-group.d.ts +1 -0
- package/dist/button-group/button-group.js +67 -60
- package/dist/card/card-next.js +28 -28
- package/dist/checkbox/checkbox.d.ts +7 -1
- package/dist/combo-box/dropdown-item.js +30 -30
- package/dist/data-grid/editable-table-cell.d.ts +3 -0
- package/dist/data-grid/editable-table-cell.js +73 -0
- package/dist/data-grid/tanstack/tanstack-helpers.d.ts +11 -0
- package/dist/data-grid/tanstack/tanstack-helpers.js +1799 -0
- package/dist/data-grid/types.d.ts +20 -0
- package/dist/data-grid/types.js +1 -0
- package/dist/drawer/drawer.content.js +6 -6
- package/dist/drawer/drawer.js +8 -8
- package/dist/error-text/error-text.js +1 -1
- package/dist/forms/form-field/form-field.js +15 -15
- package/dist/forms/form-field-with-tag/form-field-with-tag.js +1 -1
- package/dist/header/components/header-slot.js +38 -27
- package/dist/header/header.js +5 -5
- package/dist/heading/heading.js +1 -1
- package/dist/hint-text/hint-text.js +1 -1
- package/dist/hooks/use-aria-hider.d.ts +1 -0
- package/dist/hooks/use-aria-hider.js +20 -0
- package/dist/hooks/use-focus-trap.d.ts +2 -0
- package/dist/hooks/use-focus-trap.js +678 -0
- package/dist/icon/icon.js +32 -32
- package/dist/icon/icons.d.ts +2 -2
- package/dist/icon/icons.js +5 -1
- package/dist/icon/svgs/placeholder.js +2 -2
- package/dist/icon-button/icon-button.js +17 -17
- package/dist/index-2sRBqKFV.js +78 -0
- package/dist/{index-DNkhmzZp.js → index-CB-zPpNk.js} +44 -44
- package/dist/index.d.ts +6 -4
- package/dist/index.js +135 -130
- package/dist/input-checkbox/input-checkbox.d.ts +9 -2
- package/dist/input-checkbox/input-checkbox.js +65 -42
- package/dist/input-checkbox/types.d.ts +5 -0
- package/dist/input-checkbox-group/input-checkbox-group.js +22 -16
- package/dist/input-checkbox-group/types.d.ts +1 -0
- package/dist/input-radio/input-radio.js +15 -15
- package/dist/input-radio-group/input-radio-group.js +24 -17
- package/dist/input-radio-group/types.d.ts +1 -0
- package/dist/input-text/input-text.d.ts +22 -0
- package/dist/input-text/input-text.js +121 -100
- package/dist/input-text/type.d.ts +5 -0
- package/dist/label/label.js +1 -1
- package/dist/link/link.js +1 -1
- package/dist/list/list.js +2 -2
- package/dist/lodash-D1c5hFAM.js +3677 -0
- package/dist/modal/modal.content.js +1 -1
- package/dist/modal/modal.js +141 -127
- package/dist/popover/popover.js +464 -466
- package/dist/primitives/anchor.js +1 -1
- package/dist/progress-bar/progress-bar.js +8 -8
- package/dist/progress-stepper/progress-stepper.js +12 -12
- package/dist/score-select/score-select.js +3 -3
- package/dist/select/select-menu.d.ts +1 -1
- package/dist/select/select-menu.js +96 -90
- package/dist/select/select-native.d.ts +5 -2
- package/dist/select/select-native.js +45 -15
- package/dist/select/select-next.d.ts +3 -2
- package/dist/select/select-next.js +125 -92
- package/dist/select/select-search.d.ts +3 -0
- package/dist/select/select-search.js +24 -0
- package/dist/select/select.d.ts +4 -2
- package/dist/select/select.js +3 -2
- package/dist/select/types.d.ts +22 -0
- package/dist/side-nav/side-nav.js +23 -23
- package/dist/spinner/spinner.js +1 -1
- package/dist/stack/stack.js +40 -49
- package/dist/styles.css +2 -3
- package/dist/table/index.d.ts +8 -0
- package/dist/table/index.js +19 -0
- package/dist/table/table-data.d.ts +16 -2
- package/dist/table/table-data.js +64 -17
- package/dist/table/table-header.d.ts +4 -1
- package/dist/table/table-header.js +58 -18
- package/dist/table/table-pagination.d.ts +8 -0
- package/dist/table/table-pagination.js +97 -0
- package/dist/table/table-row.js +7 -6
- package/dist/table/table.d.ts +4 -1
- package/dist/table/table.js +22 -15
- package/dist/text-input/text-input.d.ts +1 -0
- package/dist/textarea/textarea.js +18 -17
- package/dist/toast/ds-toast.js +1 -1
- package/dist/tooltip/tooltip.js +1 -1
- package/package.json +5 -5
- package/dist/index-ntYL1VRC.js +0 -64
|
@@ -1,141 +1,159 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import { useRef as
|
|
4
|
-
import { cn as
|
|
5
|
-
import { InputText as
|
|
6
|
-
import { Popover as
|
|
7
|
-
import { SelectMenu as
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
defaultValue:
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
2
|
+
import { jsx as r, jsxs as M } from "react/jsx-runtime";
|
|
3
|
+
import { useRef as _, useState as h, Children as O, isValidElement as b, useEffect as G } from "react";
|
|
4
|
+
import { cn as P } from "../cn.js";
|
|
5
|
+
import { InputText as q } from "../input-text/input-text.js";
|
|
6
|
+
import { Popover as z } from "../popover/popover.js";
|
|
7
|
+
import { SelectMenu as B, SelectMenuOption as j, SelectMenuGroupItem as F } from "./select-menu.js";
|
|
8
|
+
import { SelectSearch as H } from "./select-search.js";
|
|
9
|
+
const J = ({
|
|
10
|
+
children: c,
|
|
11
|
+
value: o,
|
|
12
|
+
defaultValue: g = "",
|
|
13
|
+
onChange: s,
|
|
14
|
+
onMenuClose: a,
|
|
15
|
+
enableSearch: u,
|
|
16
|
+
disabled: t,
|
|
17
|
+
...S
|
|
16
18
|
}) => {
|
|
17
|
-
const
|
|
18
|
-
(e) =>
|
|
19
|
-
)
|
|
19
|
+
const y = _(null), [A, w] = h(g), m = o === void 0 ? A : o, [R, I] = h(!1), [C, T] = h(""), x = O.toArray(c).filter(
|
|
20
|
+
(e) => b(e)
|
|
21
|
+
);
|
|
22
|
+
G(() => {
|
|
23
|
+
o !== void 0 && w(o);
|
|
24
|
+
}, [o]);
|
|
25
|
+
const N = () => {
|
|
20
26
|
var e;
|
|
21
|
-
|
|
22
|
-
},
|
|
23
|
-
|
|
24
|
-
},
|
|
25
|
-
if (
|
|
27
|
+
I(!0), (e = y.current) == null || e.focus();
|
|
28
|
+
}, D = (e) => {
|
|
29
|
+
I(e), a && !e && a();
|
|
30
|
+
}, k = (e) => {
|
|
31
|
+
if (I(!1), o === void 0 && w(e), s) {
|
|
26
32
|
const l = {
|
|
27
33
|
...new Event("change", { bubbles: !0 }),
|
|
28
34
|
target: {
|
|
29
|
-
...
|
|
35
|
+
...y.current,
|
|
30
36
|
value: e
|
|
31
37
|
}
|
|
32
38
|
};
|
|
33
|
-
|
|
39
|
+
s(l);
|
|
34
40
|
}
|
|
35
41
|
};
|
|
36
|
-
|
|
37
|
-
var l,
|
|
42
|
+
G(() => {
|
|
43
|
+
var l, f;
|
|
38
44
|
let e;
|
|
39
|
-
for (const
|
|
40
|
-
const
|
|
41
|
-
if (
|
|
42
|
-
const
|
|
43
|
-
if (
|
|
44
|
-
e =
|
|
45
|
+
for (const n of x) {
|
|
46
|
+
const v = (l = n.type) == null ? void 0 : l.componentType;
|
|
47
|
+
if (v === "SelectItemNext") {
|
|
48
|
+
const p = n;
|
|
49
|
+
if (p.props.value === m) {
|
|
50
|
+
e = p;
|
|
45
51
|
break;
|
|
46
52
|
}
|
|
47
53
|
}
|
|
48
|
-
if (
|
|
49
|
-
const
|
|
50
|
-
(
|
|
51
|
-
var
|
|
52
|
-
return ((
|
|
54
|
+
if (v === "SelectGroupItemNext") {
|
|
55
|
+
const p = n, i = O.toArray(p.props.children).find(
|
|
56
|
+
(d) => {
|
|
57
|
+
var E;
|
|
58
|
+
return ((E = d == null ? void 0 : d.type) == null ? void 0 : E.componentType) === "SelectItemNext" && d.props.value === m;
|
|
53
59
|
}
|
|
54
60
|
);
|
|
55
|
-
if (
|
|
56
|
-
e =
|
|
61
|
+
if (i && b(i)) {
|
|
62
|
+
e = i;
|
|
57
63
|
break;
|
|
58
64
|
}
|
|
59
65
|
}
|
|
60
66
|
}
|
|
61
|
-
e &&
|
|
62
|
-
}, [
|
|
63
|
-
const
|
|
64
|
-
e.key === "Enter" && !
|
|
67
|
+
T(e && ((f = e.props.children) == null ? void 0 : f.toString()) || "");
|
|
68
|
+
}, [m, x]);
|
|
69
|
+
const K = (e) => {
|
|
70
|
+
e.key === "Enter" && !t && N();
|
|
65
71
|
};
|
|
66
|
-
return /* @__PURE__ */
|
|
72
|
+
return u ? /* @__PURE__ */ r(
|
|
73
|
+
H,
|
|
74
|
+
{
|
|
75
|
+
...S,
|
|
76
|
+
value: o,
|
|
77
|
+
defaultValue: g,
|
|
78
|
+
onChange: s,
|
|
79
|
+
disabled: t,
|
|
80
|
+
children: c
|
|
81
|
+
}
|
|
82
|
+
) : /* @__PURE__ */ M(
|
|
67
83
|
"div",
|
|
68
84
|
{
|
|
69
|
-
...
|
|
70
|
-
"aria-disabled":
|
|
71
|
-
className:
|
|
85
|
+
...S,
|
|
86
|
+
"aria-disabled": t,
|
|
87
|
+
className: P("gi-select-next", S.className),
|
|
72
88
|
children: [
|
|
73
|
-
/* @__PURE__ */
|
|
74
|
-
|
|
89
|
+
/* @__PURE__ */ r(
|
|
90
|
+
q,
|
|
75
91
|
{
|
|
92
|
+
id: S.id,
|
|
76
93
|
"aria-label": "Select an option",
|
|
77
|
-
"aria-disabled":
|
|
78
|
-
disabled:
|
|
79
|
-
placeholder:
|
|
94
|
+
"aria-disabled": t,
|
|
95
|
+
disabled: t,
|
|
96
|
+
placeholder: C || "Select",
|
|
80
97
|
readOnly: !0,
|
|
81
98
|
inputClassName: "gi-cursor-pointer",
|
|
82
|
-
iconEndClassName:
|
|
83
|
-
"gi-cursor-pointer": !
|
|
84
|
-
"gi-cursor-not-allowed":
|
|
85
|
-
"gi-pointer-events-none":
|
|
99
|
+
iconEndClassName: P({
|
|
100
|
+
"gi-cursor-pointer": !t,
|
|
101
|
+
"gi-cursor-not-allowed": t,
|
|
102
|
+
"gi-pointer-events-none": t
|
|
86
103
|
}),
|
|
87
104
|
iconEnd: "arrow_drop_down",
|
|
88
|
-
onIconEndClick:
|
|
89
|
-
ref:
|
|
90
|
-
value:
|
|
91
|
-
onClick:
|
|
92
|
-
onKeyDown:
|
|
105
|
+
onIconEndClick: N,
|
|
106
|
+
ref: y,
|
|
107
|
+
value: C,
|
|
108
|
+
onClick: N,
|
|
109
|
+
onKeyDown: K
|
|
93
110
|
}
|
|
94
111
|
),
|
|
95
|
-
/* @__PURE__ */
|
|
96
|
-
|
|
112
|
+
/* @__PURE__ */ r(
|
|
113
|
+
z,
|
|
97
114
|
{
|
|
98
|
-
triggerRef:
|
|
99
|
-
onOpenChange:
|
|
100
|
-
open:
|
|
115
|
+
triggerRef: y,
|
|
116
|
+
onOpenChange: D,
|
|
117
|
+
open: R,
|
|
101
118
|
options: {
|
|
102
119
|
placement: "bottom-start",
|
|
103
120
|
strategy: "absolute",
|
|
104
121
|
modifiers: [
|
|
105
|
-
{ name: "
|
|
122
|
+
{ name: "offset", options: { offset: [0, 4] } },
|
|
123
|
+
{ name: "preventOverflow", options: { padding: 10 } },
|
|
106
124
|
{
|
|
107
125
|
name: "flip",
|
|
108
126
|
options: { fallbackPlacements: ["top", "right", "left"] }
|
|
109
127
|
}
|
|
110
128
|
]
|
|
111
129
|
},
|
|
112
|
-
children: /* @__PURE__ */
|
|
113
|
-
var
|
|
114
|
-
const l = (
|
|
130
|
+
children: /* @__PURE__ */ r(B, { onChange: k, enableSearch: u, children: x.map((e) => {
|
|
131
|
+
var f;
|
|
132
|
+
const l = (f = e == null ? void 0 : e.type) == null ? void 0 : f.componentType;
|
|
115
133
|
if (l === "SelectItemNext") {
|
|
116
|
-
const
|
|
117
|
-
return /* @__PURE__ */
|
|
118
|
-
|
|
134
|
+
const n = e;
|
|
135
|
+
return /* @__PURE__ */ r(
|
|
136
|
+
j,
|
|
119
137
|
{
|
|
120
|
-
...
|
|
121
|
-
selected:
|
|
138
|
+
...n.props,
|
|
139
|
+
selected: m.toString() === n.props.value.toString()
|
|
122
140
|
},
|
|
123
|
-
`SelectItemNext-${
|
|
141
|
+
`SelectItemNext-${n.props.value.toString()}`
|
|
124
142
|
);
|
|
125
143
|
} else if (l === "SelectGroupItemNext") {
|
|
126
|
-
const
|
|
127
|
-
const
|
|
128
|
-
return /* @__PURE__ */
|
|
129
|
-
|
|
144
|
+
const n = e, v = O.toArray(n.props.children).filter((p) => b(p)).map((p) => {
|
|
145
|
+
const i = p.props;
|
|
146
|
+
return /* @__PURE__ */ r(
|
|
147
|
+
j,
|
|
130
148
|
{
|
|
131
|
-
...
|
|
132
|
-
selected:
|
|
133
|
-
onChange:
|
|
149
|
+
...i,
|
|
150
|
+
selected: m.toString() === i.value.toString(),
|
|
151
|
+
onChange: k
|
|
134
152
|
},
|
|
135
|
-
`SelectGroupItemNext-SelectItemNext-${
|
|
153
|
+
`SelectGroupItemNext-SelectItemNext-${i.value.toString()}`
|
|
136
154
|
);
|
|
137
155
|
});
|
|
138
|
-
return /* @__PURE__ */
|
|
156
|
+
return /* @__PURE__ */ r(F, { label: n.props.label, children: v });
|
|
139
157
|
}
|
|
140
158
|
return null;
|
|
141
159
|
}) })
|
|
@@ -144,20 +162,35 @@ const X = ({
|
|
|
144
162
|
]
|
|
145
163
|
}
|
|
146
164
|
);
|
|
147
|
-
},
|
|
148
|
-
Object.defineProperty(
|
|
165
|
+
}, $ = () => null;
|
|
166
|
+
Object.defineProperty($, "componentType", {
|
|
149
167
|
value: "SelectItemNext",
|
|
150
168
|
writable: !1,
|
|
151
169
|
enumerable: !1
|
|
152
170
|
});
|
|
153
|
-
const
|
|
154
|
-
Object.defineProperty(
|
|
171
|
+
const L = () => null;
|
|
172
|
+
Object.defineProperty(L, "componentType", {
|
|
155
173
|
value: "SelectGroupItemNext",
|
|
156
174
|
writable: !1,
|
|
157
175
|
enumerable: !1
|
|
158
176
|
});
|
|
177
|
+
const te = (c) => {
|
|
178
|
+
const { options: o, defaultValue: g, onChange: s, error: a } = c;
|
|
179
|
+
return /* @__PURE__ */ r(
|
|
180
|
+
J,
|
|
181
|
+
{
|
|
182
|
+
...c,
|
|
183
|
+
defaultValue: g,
|
|
184
|
+
onChange: s,
|
|
185
|
+
"data-table-cell": "true",
|
|
186
|
+
"data-table-cell-error-state": a == null ? void 0 : a.toString(),
|
|
187
|
+
children: o.map(({ value: u, label: t }) => /* @__PURE__ */ r($, { value: u, children: t }, `${u}-${t}`))
|
|
188
|
+
}
|
|
189
|
+
);
|
|
190
|
+
};
|
|
159
191
|
export {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
192
|
+
L as SelectGroupItemNext,
|
|
193
|
+
$ as SelectItemNext,
|
|
194
|
+
J as SelectNext,
|
|
195
|
+
te as SelectNextTableCell
|
|
163
196
|
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as p } from "react/jsx-runtime";
|
|
2
|
+
import { Children as s, isValidElement as a } from "react";
|
|
3
|
+
import { AutocompleteItem as f, Autocomplete as h } from "../autocomplete/autocomplete.js";
|
|
4
|
+
const S = ({
|
|
5
|
+
children: n,
|
|
6
|
+
onChange: m,
|
|
7
|
+
...c
|
|
8
|
+
}) => {
|
|
9
|
+
const t = [];
|
|
10
|
+
return s.forEach(n, (e) => {
|
|
11
|
+
var r;
|
|
12
|
+
if (!a(e))
|
|
13
|
+
return;
|
|
14
|
+
if (((r = e.type) == null ? void 0 : r.componentType) === "SelectItemNext") {
|
|
15
|
+
const { value: o, children: l, ...i } = e.props || {};
|
|
16
|
+
t.push(
|
|
17
|
+
/* @__PURE__ */ p(f, { value: o, ...i, children: l }, o)
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
}), /* @__PURE__ */ p(h, { ...c, onChange: m, children: t });
|
|
21
|
+
};
|
|
22
|
+
export {
|
|
23
|
+
S as SelectSearch
|
|
24
|
+
};
|
package/dist/select/select.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
export { SelectGroupItem, SelectItem } from './select-native.js';
|
|
1
|
+
export { SelectGroupItem, SelectItem, SelectTableCell, } from './select-native.js';
|
|
2
2
|
/**
|
|
3
3
|
* @deprecated Use `<SelectNext />` instead of `<Select />`.
|
|
4
4
|
*/
|
|
5
|
-
export declare const Select: import('react').FC<import('
|
|
5
|
+
export declare const Select: import('react').FC<import('react').ClassAttributes<HTMLSelectElement> & import('react').SelectHTMLAttributes<HTMLSelectElement> & {
|
|
6
|
+
containerProps?: any;
|
|
7
|
+
}>;
|
package/dist/select/select.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { SelectNative as e } from "./select-native.js";
|
|
3
|
-
import { SelectGroupItem as m, SelectItem as r } from "./select-native.js";
|
|
3
|
+
import { SelectGroupItem as m, SelectItem as r, SelectTableCell as S } from "./select-native.js";
|
|
4
4
|
const t = e;
|
|
5
5
|
t.displayName = "Select";
|
|
6
6
|
export {
|
|
7
7
|
t as Select,
|
|
8
8
|
m as SelectGroupItem,
|
|
9
|
-
r as SelectItem
|
|
9
|
+
r as SelectItem,
|
|
10
|
+
S as SelectTableCell
|
|
10
11
|
};
|
package/dist/select/types.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ChangeEvent, DetailedHTMLProps, HTMLAttributes, OptgroupHTMLAttributes, OptionHTMLAttributes, PropsWithChildren, ReactElement, ReactNode, SelectHTMLAttributes } from 'react';
|
|
2
|
+
import { InputTextProps } from '../input-text/type.js';
|
|
2
3
|
/**
|
|
3
4
|
* @deprecated Use `SelectNextProps` instead of `SelectProps`.
|
|
4
5
|
*/
|
|
@@ -13,6 +14,8 @@ export type SelectMenuProps = {
|
|
|
13
14
|
className?: string;
|
|
14
15
|
onChange?: (value: string) => void;
|
|
15
16
|
enableSearch?: boolean;
|
|
17
|
+
isLoading?: boolean;
|
|
18
|
+
showNoData?: boolean;
|
|
16
19
|
};
|
|
17
20
|
export type SelectMenuOptionReactElement = ReactElement<{
|
|
18
21
|
value: string;
|
|
@@ -46,8 +49,13 @@ export type SelectNextProps = PropsWithChildren<{
|
|
|
46
49
|
onChange?: (event: ChangeEvent<HTMLSelectElement>) => void;
|
|
47
50
|
onMenuClose?: () => void;
|
|
48
51
|
defaultValue?: string;
|
|
52
|
+
value?: string;
|
|
49
53
|
enableSearch?: boolean;
|
|
50
54
|
disabled?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Works only when `enableSearch` is set to `true`
|
|
57
|
+
*/
|
|
58
|
+
placeholder?: string;
|
|
51
59
|
} & Omit<HTMLAttributes<HTMLDivElement>, `on${string}`>>;
|
|
52
60
|
export type SelectNextOptionProps = PropsWithChildren<{
|
|
53
61
|
className?: string;
|
|
@@ -60,3 +68,17 @@ export type SelectNextGroupProps = PropsWithChildren<{
|
|
|
60
68
|
label?: string;
|
|
61
69
|
children: ReactNode;
|
|
62
70
|
}>;
|
|
71
|
+
export type SelectTableCellProps = Omit<SelectProps, 'children'> & {
|
|
72
|
+
options: {
|
|
73
|
+
label: string;
|
|
74
|
+
value: string;
|
|
75
|
+
}[];
|
|
76
|
+
error?: boolean;
|
|
77
|
+
};
|
|
78
|
+
export type SelectNextTableCellProps = SelectNextProps & {
|
|
79
|
+
options: {
|
|
80
|
+
label: string;
|
|
81
|
+
value: string;
|
|
82
|
+
}[];
|
|
83
|
+
error?: boolean;
|
|
84
|
+
} & Pick<InputTextProps, 'iconEnd' | 'iconStart'>;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as w, Fragment as V, jsx as s } from "react/jsx-runtime";
|
|
3
|
-
import
|
|
3
|
+
import f, { memo as B, useEffect as q, useCallback as v, useState as _ } from "react";
|
|
4
4
|
import { Button as A } from "../button/button.js";
|
|
5
|
-
import { cn as
|
|
5
|
+
import { cn as N } from "../cn.js";
|
|
6
6
|
import { Icon as $ } from "../icon/icon.js";
|
|
7
7
|
import { Link as G } from "../link/link.js";
|
|
8
8
|
import { Paragraph as H } from "../paragraph/paragraph.js";
|
|
9
|
-
const j =
|
|
9
|
+
const j = f.createContext(
|
|
10
10
|
void 0
|
|
11
11
|
), z = B(
|
|
12
12
|
({
|
|
@@ -22,41 +22,41 @@ const j = N.createContext(
|
|
|
22
22
|
c && /* @__PURE__ */ s("div", { className: "gi-side-nav-expandable-icon", children: /* @__PURE__ */ s(
|
|
23
23
|
$,
|
|
24
24
|
{
|
|
25
|
-
className:
|
|
25
|
+
className: N(e && "gi-rotate-180"),
|
|
26
26
|
icon: "keyboard_arrow_down"
|
|
27
27
|
}
|
|
28
28
|
) })
|
|
29
29
|
] })
|
|
30
|
-
), J =
|
|
30
|
+
), J = f.memo(
|
|
31
31
|
({
|
|
32
32
|
children: n,
|
|
33
33
|
primary: i,
|
|
34
34
|
secondary: c,
|
|
35
35
|
expandable: e,
|
|
36
|
-
label:
|
|
36
|
+
label: a,
|
|
37
37
|
value: t,
|
|
38
38
|
icon: u,
|
|
39
39
|
href: m,
|
|
40
40
|
asChild: g,
|
|
41
41
|
open: r
|
|
42
42
|
}) => {
|
|
43
|
-
const l =
|
|
43
|
+
const l = f.useContext(j);
|
|
44
44
|
if (!l)
|
|
45
45
|
throw new Error("SideNavItem must be used within a SideNav");
|
|
46
46
|
const {
|
|
47
|
-
openItemIds:
|
|
47
|
+
openItemIds: o,
|
|
48
48
|
selectedItemId: S,
|
|
49
49
|
setOpenItemIds: p,
|
|
50
50
|
setSelectedItemId: C,
|
|
51
51
|
navId: P
|
|
52
|
-
} = l, I =
|
|
52
|
+
} = l, I = o.includes(t), x = S === t;
|
|
53
53
|
q(() => {
|
|
54
54
|
r && p((d) => d.includes(t) ? d : [...d, t]);
|
|
55
55
|
}, [r, p, t]);
|
|
56
56
|
const h = v(() => {
|
|
57
|
-
const d = I ?
|
|
57
|
+
const d = I ? o.filter((R) => R !== t) : [...o, t];
|
|
58
58
|
p(d);
|
|
59
|
-
}, [I,
|
|
59
|
+
}, [I, o, p, t]), k = v(() => {
|
|
60
60
|
C(t);
|
|
61
61
|
}, [C, t]), E = `${P}-${t}`, O = i && e, b = m !== void 0, D = v(() => {
|
|
62
62
|
i && e && h(), k();
|
|
@@ -65,11 +65,11 @@ const j = N.createContext(
|
|
|
65
65
|
d.preventDefault(), i && e ? h() : k();
|
|
66
66
|
},
|
|
67
67
|
[i, e, h, k]
|
|
68
|
-
), L =
|
|
68
|
+
), L = N("gi-side-nav-item", {
|
|
69
69
|
"gi-side-nav-item-selected": x,
|
|
70
70
|
"gi-side-nav-item-primary": i,
|
|
71
71
|
"gi-side-nav-item-secondary": c
|
|
72
|
-
}), M =
|
|
72
|
+
}), M = N("gi-side-nav-item", {
|
|
73
73
|
"gi-side-nav-item-selected": x,
|
|
74
74
|
"gi-side-nav-item-primary": i,
|
|
75
75
|
"gi-side-nav-item-secondary": c
|
|
@@ -78,7 +78,7 @@ const j = N.createContext(
|
|
|
78
78
|
"div",
|
|
79
79
|
{
|
|
80
80
|
role: "group",
|
|
81
|
-
"aria-label": `${
|
|
81
|
+
"aria-label": `${a} ${i && e ? "dropdown" : "item"}`,
|
|
82
82
|
children: [
|
|
83
83
|
b ? /* @__PURE__ */ s(
|
|
84
84
|
G,
|
|
@@ -97,7 +97,7 @@ const j = N.createContext(
|
|
|
97
97
|
z,
|
|
98
98
|
{
|
|
99
99
|
icon: u,
|
|
100
|
-
label:
|
|
100
|
+
label: a,
|
|
101
101
|
showExpandableIcon: O,
|
|
102
102
|
isOpen: I
|
|
103
103
|
}
|
|
@@ -116,7 +116,7 @@ const j = N.createContext(
|
|
|
116
116
|
z,
|
|
117
117
|
{
|
|
118
118
|
icon: u,
|
|
119
|
-
label:
|
|
119
|
+
label: a,
|
|
120
120
|
showExpandableIcon: O,
|
|
121
121
|
isOpen: I
|
|
122
122
|
}
|
|
@@ -126,7 +126,7 @@ const j = N.createContext(
|
|
|
126
126
|
e && i && /* @__PURE__ */ s(
|
|
127
127
|
"div",
|
|
128
128
|
{
|
|
129
|
-
className:
|
|
129
|
+
className: N(I ? "gi-side-nav-item-content" : "gi-hidden"),
|
|
130
130
|
children: n
|
|
131
131
|
}
|
|
132
132
|
)
|
|
@@ -135,15 +135,15 @@ const j = N.createContext(
|
|
|
135
135
|
);
|
|
136
136
|
}
|
|
137
137
|
), K = B(
|
|
138
|
-
({ children: n, className: i, dataTestid: c, onChange: e, value:
|
|
138
|
+
({ children: n, className: i, dataTestid: c, onChange: e, value: a }) => {
|
|
139
139
|
const [t, u] = _([]), [m, g] = _(
|
|
140
|
-
|
|
141
|
-
), r =
|
|
140
|
+
a
|
|
141
|
+
), r = f.useId(), l = v(
|
|
142
142
|
(S) => {
|
|
143
143
|
g(S), e == null || e(S);
|
|
144
144
|
},
|
|
145
145
|
[e]
|
|
146
|
-
),
|
|
146
|
+
), o = f.useMemo(
|
|
147
147
|
() => ({
|
|
148
148
|
openItemIds: t,
|
|
149
149
|
selectedItemId: m,
|
|
@@ -153,10 +153,10 @@ const j = N.createContext(
|
|
|
153
153
|
}),
|
|
154
154
|
[t, m, l, r]
|
|
155
155
|
);
|
|
156
|
-
return /* @__PURE__ */ s(j.Provider, { value:
|
|
156
|
+
return /* @__PURE__ */ s(j.Provider, { value: o, children: /* @__PURE__ */ s(
|
|
157
157
|
"div",
|
|
158
158
|
{
|
|
159
|
-
className:
|
|
159
|
+
className: N("gi-side-nav-container", i),
|
|
160
160
|
"data-testid": c,
|
|
161
161
|
children: n
|
|
162
162
|
}
|
package/dist/spinner/spinner.js
CHANGED