@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,28 +1,35 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { useState as
|
|
4
|
-
const
|
|
5
|
-
groupId:
|
|
6
|
-
inline:
|
|
7
|
-
onChange:
|
|
8
|
-
|
|
2
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
3
|
+
import { useState as a, useEffect as g, Children as m, isValidElement as v, cloneElement as f } from "react";
|
|
4
|
+
const N = ({
|
|
5
|
+
groupId: s,
|
|
6
|
+
inline: c,
|
|
7
|
+
onChange: n,
|
|
8
|
+
value: o,
|
|
9
|
+
children: p
|
|
9
10
|
}) => {
|
|
10
|
-
const [
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
const [u, t] = a(
|
|
12
|
+
o || null
|
|
13
|
+
);
|
|
14
|
+
g(() => {
|
|
15
|
+
t(o || null);
|
|
16
|
+
}, [o]);
|
|
17
|
+
const d = o === void 0 ? u : o, e = (i) => {
|
|
18
|
+
o === void 0 && t(i.target.value), n == null || n(i);
|
|
19
|
+
}, l = m.map(p, (i) => v(i) ? f(i, {
|
|
20
|
+
onChange: e,
|
|
21
|
+
checked: d === i.props.value,
|
|
22
|
+
name: s
|
|
16
23
|
}) : i);
|
|
17
|
-
return /* @__PURE__ */
|
|
24
|
+
return /* @__PURE__ */ r("div", { className: "gi-input-group-container", children: /* @__PURE__ */ r("div", { className: "gi-input-group-options-container", children: /* @__PURE__ */ r(
|
|
18
25
|
"div",
|
|
19
26
|
{
|
|
20
27
|
role: "radiogroup",
|
|
21
|
-
className:
|
|
22
|
-
children:
|
|
28
|
+
className: c ? "gi-input-group-options-inline" : "gi-input-group-options-stacked",
|
|
29
|
+
children: l
|
|
23
30
|
}
|
|
24
31
|
) }) });
|
|
25
32
|
};
|
|
26
33
|
export {
|
|
27
|
-
|
|
34
|
+
N as InputRadioGroup
|
|
28
35
|
};
|
|
@@ -16,4 +16,26 @@ export declare const InputText: import('react').ForwardRefExoticComponent<import
|
|
|
16
16
|
type?: "text" | "date" | "datetime-local" | "email" | "month" | "number" | "password" | "tel" | "time" | "url" | "week" | "search";
|
|
17
17
|
halfFluid?: boolean;
|
|
18
18
|
clearButtonEnabled?: boolean;
|
|
19
|
+
containerProps?: any;
|
|
20
|
+
} & import('react').RefAttributes<HTMLInputElement>>;
|
|
21
|
+
export declare const InputTextTableCell: import('react').ForwardRefExoticComponent<import('react').InputHTMLAttributes<HTMLInputElement> & {
|
|
22
|
+
prefix?: React.ReactNode;
|
|
23
|
+
suffix?: React.ReactNode;
|
|
24
|
+
inputClassName?: string;
|
|
25
|
+
iconStart?: import('../icon/icon.js').IconId;
|
|
26
|
+
onIconStartClick?: () => void;
|
|
27
|
+
iconStartClassName?: string;
|
|
28
|
+
iconEnd?: import('../icon/icon.js').IconId;
|
|
29
|
+
iconEndClassName?: string;
|
|
30
|
+
onIconEndClick?: () => void;
|
|
31
|
+
inputActionButton?: InputActionButtonProps;
|
|
32
|
+
iconEndRef?: any;
|
|
33
|
+
inputActionPosition?: "beforeSuffix" | "afterSuffix";
|
|
34
|
+
type?: "text" | "date" | "datetime-local" | "email" | "month" | "number" | "password" | "tel" | "time" | "url" | "week" | "search";
|
|
35
|
+
halfFluid?: boolean;
|
|
36
|
+
clearButtonEnabled?: boolean;
|
|
37
|
+
containerProps?: any;
|
|
38
|
+
} & {
|
|
39
|
+
error?: boolean;
|
|
40
|
+
disabled?: boolean;
|
|
19
41
|
} & import('react').RefAttributes<HTMLInputElement>>;
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { cn as
|
|
5
|
-
import { Icon as
|
|
6
|
-
import { IconButton as
|
|
7
|
-
import { Input as
|
|
8
|
-
const
|
|
9
|
-
({ onChange: a, ...
|
|
10
|
-
const
|
|
11
|
-
return
|
|
2
|
+
import { jsx as n, jsxs as f } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef as u, useRef as S, useImperativeHandle as W, useMemo as _ } from "react";
|
|
4
|
+
import { cn as l } from "../cn.js";
|
|
5
|
+
import { Icon as m } from "../icon/icon.js";
|
|
6
|
+
import { IconButton as j } from "../icon-button/icon-button.js";
|
|
7
|
+
import { Input as O } from "../primitives/input.js";
|
|
8
|
+
const H = u(
|
|
9
|
+
({ onChange: a, ...e }, r) => {
|
|
10
|
+
const t = S(null);
|
|
11
|
+
return W(r, () => t.current), /* @__PURE__ */ n(
|
|
12
12
|
p,
|
|
13
13
|
{
|
|
14
|
-
...
|
|
14
|
+
...e,
|
|
15
15
|
onChange: a,
|
|
16
|
-
ref:
|
|
16
|
+
ref: t,
|
|
17
17
|
inputActionButton: {
|
|
18
18
|
icon: "close",
|
|
19
19
|
onClick: () => {
|
|
20
|
-
|
|
20
|
+
t != null && t.current && (t.current.value = "", t.current.focus());
|
|
21
21
|
const d = {
|
|
22
|
-
target:
|
|
23
|
-
currentTarget:
|
|
22
|
+
target: t.current,
|
|
23
|
+
currentTarget: t.current,
|
|
24
24
|
__origin: "clear_button"
|
|
25
25
|
};
|
|
26
26
|
a && a(d);
|
|
@@ -29,112 +29,133 @@ const b = f(
|
|
|
29
29
|
}
|
|
30
30
|
);
|
|
31
31
|
}
|
|
32
|
-
), p =
|
|
32
|
+
), p = u(
|
|
33
33
|
({
|
|
34
34
|
prefix: a,
|
|
35
|
-
inputActionButton:
|
|
36
|
-
inputActionPosition:
|
|
37
|
-
suffix:
|
|
38
|
-
halfFluid:
|
|
35
|
+
inputActionButton: e,
|
|
36
|
+
inputActionPosition: r = "beforeSuffix",
|
|
37
|
+
suffix: t,
|
|
38
|
+
halfFluid: c = !1,
|
|
39
39
|
className: d,
|
|
40
|
-
type:
|
|
41
|
-
iconStart:
|
|
42
|
-
iconStartClassName:
|
|
43
|
-
onIconStartClick:
|
|
44
|
-
iconEnd:
|
|
45
|
-
iconEndClassName:
|
|
46
|
-
onIconEndClick:
|
|
40
|
+
type: I = "text",
|
|
41
|
+
iconStart: o,
|
|
42
|
+
iconStartClassName: g,
|
|
43
|
+
onIconStartClick: v,
|
|
44
|
+
iconEnd: s,
|
|
45
|
+
iconEndClassName: N,
|
|
46
|
+
onIconEndClick: T,
|
|
47
47
|
disabled: i,
|
|
48
|
-
inputClassName:
|
|
49
|
-
iconEndRef:
|
|
50
|
-
|
|
48
|
+
inputClassName: w,
|
|
49
|
+
iconEndRef: C,
|
|
50
|
+
containerProps: b,
|
|
51
|
+
...k
|
|
51
52
|
}, z) => {
|
|
52
|
-
const R =
|
|
53
|
+
const R = _(() => e && r === "beforeSuffix" ? /* @__PURE__ */ n(
|
|
53
54
|
"div",
|
|
54
55
|
{
|
|
55
56
|
className: "gi-input-text-action-before-suffix",
|
|
56
|
-
"data-suffix": !!
|
|
57
|
-
"data-has-icon-end": !!
|
|
58
|
-
children: /* @__PURE__ */
|
|
57
|
+
"data-suffix": !!t,
|
|
58
|
+
"data-has-icon-end": !!s,
|
|
59
|
+
children: /* @__PURE__ */ n(x, { ...e, disabled: i })
|
|
59
60
|
}
|
|
60
|
-
) : null, [
|
|
61
|
-
return /* @__PURE__ */
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
"
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
"
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
61
|
+
) : null, [e]);
|
|
62
|
+
return /* @__PURE__ */ f(
|
|
63
|
+
"div",
|
|
64
|
+
{
|
|
65
|
+
className: l(d, "gi-input-text-container"),
|
|
66
|
+
...b,
|
|
67
|
+
children: [
|
|
68
|
+
a && /* @__PURE__ */ n("div", { className: "gi-input-text-prefix", "data-disabled": i, children: a }),
|
|
69
|
+
/* @__PURE__ */ f(
|
|
70
|
+
"div",
|
|
71
|
+
{
|
|
72
|
+
className: l("gi-input-text-inner", {
|
|
73
|
+
"gi-input-half-width": c
|
|
74
|
+
}),
|
|
75
|
+
children: [
|
|
76
|
+
o && /* @__PURE__ */ n(
|
|
77
|
+
"div",
|
|
78
|
+
{
|
|
79
|
+
className: l("gi-input-text-icon-start", g),
|
|
80
|
+
onClick: v,
|
|
81
|
+
"data-prefix": !!a,
|
|
82
|
+
children: /* @__PURE__ */ n(m, { icon: o, size: "md", disabled: i })
|
|
83
|
+
}
|
|
84
|
+
),
|
|
85
|
+
/* @__PURE__ */ n(
|
|
86
|
+
O,
|
|
87
|
+
{
|
|
88
|
+
type: I,
|
|
89
|
+
"data-icon-start": !!o,
|
|
90
|
+
"data-icon-end": !!s,
|
|
91
|
+
"data-end-element": !!e,
|
|
92
|
+
"data-prefix": !!a,
|
|
93
|
+
"data-suffix": !!t,
|
|
94
|
+
className: l("gi-input-text", w),
|
|
95
|
+
ref: z,
|
|
96
|
+
disabled: i,
|
|
97
|
+
...k
|
|
98
|
+
}
|
|
99
|
+
),
|
|
100
|
+
s && /* @__PURE__ */ n(
|
|
101
|
+
"div",
|
|
102
|
+
{
|
|
103
|
+
className: l("gi-input-text-icon-end", N),
|
|
104
|
+
"data-end-element": !!e && r === "afterSuffix",
|
|
105
|
+
"data-suffix": !!t,
|
|
106
|
+
onClick: T,
|
|
107
|
+
ref: C,
|
|
108
|
+
children: /* @__PURE__ */ n(m, { icon: s, size: "md", disabled: i })
|
|
109
|
+
}
|
|
110
|
+
),
|
|
111
|
+
R
|
|
112
|
+
]
|
|
113
|
+
}
|
|
114
|
+
),
|
|
115
|
+
e && r === "afterSuffix" && /* @__PURE__ */ n("div", { className: "gi-input-text-end-element", "data-suffix": !!t, children: /* @__PURE__ */ n(x, { ...e, disabled: i }) }),
|
|
116
|
+
t && /* @__PURE__ */ n("div", { className: "gi-input-text-suffix", "data-disabled": i, children: t })
|
|
117
|
+
]
|
|
118
|
+
}
|
|
119
|
+
);
|
|
112
120
|
}
|
|
113
121
|
), x = ({
|
|
114
122
|
onClick: a,
|
|
115
|
-
ariaLabel:
|
|
116
|
-
icon:
|
|
117
|
-
dataTestId:
|
|
118
|
-
...
|
|
119
|
-
}) => /* @__PURE__ */
|
|
120
|
-
|
|
123
|
+
ariaLabel: e,
|
|
124
|
+
icon: r,
|
|
125
|
+
dataTestId: t,
|
|
126
|
+
...c
|
|
127
|
+
}) => /* @__PURE__ */ n(
|
|
128
|
+
j,
|
|
121
129
|
{
|
|
122
|
-
...
|
|
130
|
+
...c,
|
|
123
131
|
icon: {
|
|
124
|
-
icon:
|
|
132
|
+
icon: r
|
|
125
133
|
},
|
|
126
|
-
"data-testid":
|
|
127
|
-
"aria-label":
|
|
134
|
+
"data-testid": t,
|
|
135
|
+
"aria-label": e || "",
|
|
128
136
|
onClick: a,
|
|
129
137
|
variant: "flat",
|
|
130
138
|
size: "small",
|
|
131
139
|
appearance: "dark"
|
|
132
140
|
}
|
|
133
|
-
),
|
|
134
|
-
({ type: a = "text", clearButtonEnabled:
|
|
141
|
+
), h = u(
|
|
142
|
+
({ type: a = "text", clearButtonEnabled: e, ...r }, t) => e || a === "search" ? /* @__PURE__ */ n(H, { ref: t, type: a, ...r }) : /* @__PURE__ */ n(p, { ref: t, type: a, ...r })
|
|
135
143
|
);
|
|
136
|
-
|
|
144
|
+
h.displayName = "InputText";
|
|
145
|
+
const G = u(({ type: a = "text", error: e, ...r }, t) => /* @__PURE__ */ n(
|
|
146
|
+
h,
|
|
147
|
+
{
|
|
148
|
+
...r,
|
|
149
|
+
containerProps: {
|
|
150
|
+
"data-table-cell": !0,
|
|
151
|
+
"data-table-cell-error-state": e == null ? void 0 : e.toString()
|
|
152
|
+
},
|
|
153
|
+
ref: t,
|
|
154
|
+
type: a
|
|
155
|
+
}
|
|
156
|
+
));
|
|
137
157
|
export {
|
|
138
158
|
x as InputActionButton,
|
|
139
|
-
|
|
159
|
+
h as InputText,
|
|
160
|
+
G as InputTextTableCell
|
|
140
161
|
};
|
|
@@ -24,4 +24,9 @@ export type InputTextProps = React.InputHTMLAttributes<HTMLInputElement> & {
|
|
|
24
24
|
type?: 'text' | 'date' | 'datetime-local' | 'email' | 'month' | 'number' | 'password' | 'tel' | 'time' | 'url' | 'week' | 'search';
|
|
25
25
|
halfFluid?: boolean;
|
|
26
26
|
clearButtonEnabled?: boolean;
|
|
27
|
+
containerProps?: any;
|
|
28
|
+
};
|
|
29
|
+
export type InputTextTableCellProps = InputTextProps & {
|
|
30
|
+
error?: boolean;
|
|
31
|
+
disabled?: boolean;
|
|
27
32
|
};
|
package/dist/label/label.js
CHANGED
package/dist/link/link.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as n, jsxs as S, Fragment as b } from "react/jsx-runtime";
|
|
2
|
-
import { a as j } from "../index-
|
|
2
|
+
import { a as j } from "../index-2sRBqKFV.js";
|
|
3
3
|
import { forwardRef as w } from "react";
|
|
4
4
|
import { getVariantAppearanceClass as I, getSizeClass as L } from "../button/helpers.js";
|
|
5
5
|
import { cn as A } from "../cn.js";
|
package/dist/list/list.js
CHANGED
|
@@ -21,7 +21,7 @@ const s = {
|
|
|
21
21
|
}
|
|
22
22
|
return i && e.push("gi-list-spaced"), e.join(" ");
|
|
23
23
|
};
|
|
24
|
-
function
|
|
24
|
+
function c({
|
|
25
25
|
items: i,
|
|
26
26
|
type: t = s.None,
|
|
27
27
|
spaced: e,
|
|
@@ -39,6 +39,6 @@ function o({
|
|
|
39
39
|
);
|
|
40
40
|
}
|
|
41
41
|
export {
|
|
42
|
-
|
|
42
|
+
c as List,
|
|
43
43
|
s as ListTypeEnum
|
|
44
44
|
};
|