@abgov/react-components 6.11.0-dev.1 → 6.11.0-dev.10
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/experimental/checkbox-list/checkbox-list.d.ts +33 -0
- package/experimental/index.d.ts +4 -0
- package/experimental/menu-action/menu-action.d.ts +10 -0
- package/experimental/menu-button/menu-button.d.ts +16 -0
- package/experimental/tab/tab.d.ts +21 -0
- package/experimental/tabs/tabs.d.ts +5 -3
- package/experimental/work-side-menu-group/work-side-menu-group.d.ts +2 -0
- package/experimental.js +108 -2
- package/experimental.js.map +1 -1
- package/experimental.mjs +109 -3
- package/experimental.mjs.map +1 -1
- package/index.d.ts +1 -0
- package/index.js +37 -0
- package/index.js.map +1 -1
- package/index.mjs +37 -0
- package/index.mjs.map +1 -1
- package/lib/checkbox-list/checkbox-list.d.ts +0 -16
- package/lib/push-drawer/push-drawer.d.ts +26 -0
- package/package.json +1 -1
package/experimental.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { t as transformProps, l as lowercase, f as format, p as parseISO, i as isValid } from "./parseISO-BHUUf1QW.mjs";
|
|
2
|
+
import { t as transformProps, l as lowercase, f as format, p as parseISO, i as isValid, k as kebab } from "./parseISO-BHUUf1QW.mjs";
|
|
3
3
|
import { useRef, useEffect } from "react";
|
|
4
4
|
function getIconValue(icon, iconType) {
|
|
5
5
|
if (icon !== void 0) {
|
|
@@ -174,6 +174,54 @@ function GoabxCheckbox({
|
|
|
174
174
|
}
|
|
175
175
|
);
|
|
176
176
|
}
|
|
177
|
+
function GoabxCheckboxList({
|
|
178
|
+
name,
|
|
179
|
+
value = [],
|
|
180
|
+
disabled,
|
|
181
|
+
error,
|
|
182
|
+
testId,
|
|
183
|
+
maxWidth,
|
|
184
|
+
size = "default",
|
|
185
|
+
children,
|
|
186
|
+
onChange,
|
|
187
|
+
mt,
|
|
188
|
+
mr,
|
|
189
|
+
mb,
|
|
190
|
+
ml
|
|
191
|
+
}) {
|
|
192
|
+
const el = useRef(null);
|
|
193
|
+
useEffect(() => {
|
|
194
|
+
if (!el.current) return;
|
|
195
|
+
const current = el.current;
|
|
196
|
+
const listener = (e) => {
|
|
197
|
+
const detail = e.detail;
|
|
198
|
+
onChange == null ? void 0 : onChange({ ...detail, event: e });
|
|
199
|
+
};
|
|
200
|
+
current.addEventListener("_change", listener);
|
|
201
|
+
return () => {
|
|
202
|
+
current.removeEventListener("_change", listener);
|
|
203
|
+
};
|
|
204
|
+
}, [onChange]);
|
|
205
|
+
return /* @__PURE__ */ jsx(
|
|
206
|
+
"goa-checkbox-list",
|
|
207
|
+
{
|
|
208
|
+
ref: el,
|
|
209
|
+
name,
|
|
210
|
+
value,
|
|
211
|
+
disabled: disabled ? "true" : void 0,
|
|
212
|
+
error: error ? "true" : void 0,
|
|
213
|
+
testid: testId,
|
|
214
|
+
maxwidth: maxWidth,
|
|
215
|
+
version: "2",
|
|
216
|
+
size,
|
|
217
|
+
mt,
|
|
218
|
+
mr,
|
|
219
|
+
mb,
|
|
220
|
+
ml,
|
|
221
|
+
children
|
|
222
|
+
}
|
|
223
|
+
);
|
|
224
|
+
}
|
|
177
225
|
function GoabxDatePicker({
|
|
178
226
|
value,
|
|
179
227
|
error,
|
|
@@ -744,6 +792,44 @@ function GoabxLink({
|
|
|
744
792
|
}
|
|
745
793
|
);
|
|
746
794
|
}
|
|
795
|
+
function GoabxMenuAction(props) {
|
|
796
|
+
const _props = transformProps(props, lowercase);
|
|
797
|
+
return /* @__PURE__ */ jsx("goa-menu-action", { ..._props });
|
|
798
|
+
}
|
|
799
|
+
function GoabxMenuButton({
|
|
800
|
+
type = "primary",
|
|
801
|
+
testId,
|
|
802
|
+
onAction,
|
|
803
|
+
children,
|
|
804
|
+
...rest
|
|
805
|
+
}) {
|
|
806
|
+
const el = useRef(null);
|
|
807
|
+
const _props = transformProps(
|
|
808
|
+
{ type, testid: testId, ...rest },
|
|
809
|
+
kebab
|
|
810
|
+
);
|
|
811
|
+
useEffect(() => {
|
|
812
|
+
if (!el.current) {
|
|
813
|
+
return;
|
|
814
|
+
}
|
|
815
|
+
if (!onAction) {
|
|
816
|
+
return;
|
|
817
|
+
}
|
|
818
|
+
const current = el.current;
|
|
819
|
+
const listener = (e) => {
|
|
820
|
+
const detail = e.detail;
|
|
821
|
+
onAction == null ? void 0 : onAction(detail);
|
|
822
|
+
};
|
|
823
|
+
current.addEventListener("_action", listener);
|
|
824
|
+
return () => {
|
|
825
|
+
current.removeEventListener("_action", listener);
|
|
826
|
+
};
|
|
827
|
+
}, [el, onAction]);
|
|
828
|
+
return (
|
|
829
|
+
// @ts-expect-error - stable WCProps requires text, but experimental supports icon-only mode
|
|
830
|
+
/* @__PURE__ */ jsx("goa-menu-button", { ..._props, version: "2", ref: el, children })
|
|
831
|
+
);
|
|
832
|
+
}
|
|
747
833
|
function GoabxModal({
|
|
748
834
|
heading,
|
|
749
835
|
children,
|
|
@@ -1040,13 +1126,27 @@ function GoabxTableSortHeader({
|
|
|
1040
1126
|
const _props = transformProps(rest, lowercase);
|
|
1041
1127
|
return /* @__PURE__ */ jsx("goa-table-sort-header", { ..._props, children });
|
|
1042
1128
|
}
|
|
1129
|
+
function GoabxTab({ heading, disabled, slug, children }) {
|
|
1130
|
+
return /* @__PURE__ */ jsxs(
|
|
1131
|
+
"goa-tab",
|
|
1132
|
+
{
|
|
1133
|
+
slug,
|
|
1134
|
+
disabled: disabled ? "true" : void 0,
|
|
1135
|
+
heading: typeof heading === "string" ? heading : void 0,
|
|
1136
|
+
children: [
|
|
1137
|
+
typeof heading !== "string" && /* @__PURE__ */ jsx("span", { slot: "heading", children: heading }),
|
|
1138
|
+
children
|
|
1139
|
+
]
|
|
1140
|
+
}
|
|
1141
|
+
);
|
|
1142
|
+
}
|
|
1043
1143
|
function GoabxTabs({
|
|
1044
1144
|
initialTab,
|
|
1045
1145
|
children,
|
|
1046
1146
|
testId,
|
|
1047
1147
|
onChange,
|
|
1048
1148
|
variant,
|
|
1049
|
-
|
|
1149
|
+
orientation
|
|
1050
1150
|
}) {
|
|
1051
1151
|
const ref = useRef(null);
|
|
1052
1152
|
useEffect(() => {
|
|
@@ -1069,7 +1169,8 @@ function GoabxTabs({
|
|
|
1069
1169
|
initialtab: initialTab,
|
|
1070
1170
|
testid: testId,
|
|
1071
1171
|
variant,
|
|
1072
|
-
version,
|
|
1172
|
+
version: "2",
|
|
1173
|
+
orientation,
|
|
1073
1174
|
children
|
|
1074
1175
|
}
|
|
1075
1176
|
);
|
|
@@ -1188,6 +1289,7 @@ function GoabxWorkSideMenuGroup(props) {
|
|
|
1188
1289
|
{
|
|
1189
1290
|
heading: props.heading,
|
|
1190
1291
|
icon: props.icon,
|
|
1292
|
+
open: props.open ? true : void 0,
|
|
1191
1293
|
testid: props.testId,
|
|
1192
1294
|
children: props.children
|
|
1193
1295
|
}
|
|
@@ -1202,6 +1304,7 @@ export {
|
|
|
1202
1304
|
GoabxCalendar,
|
|
1203
1305
|
GoabxCallout,
|
|
1204
1306
|
GoabxCheckbox,
|
|
1307
|
+
GoabxCheckboxList,
|
|
1205
1308
|
GoabxDatePicker,
|
|
1206
1309
|
GoabxDrawer,
|
|
1207
1310
|
GoabxDropdown,
|
|
@@ -1226,6 +1329,8 @@ export {
|
|
|
1226
1329
|
GoabxInputTime,
|
|
1227
1330
|
GoabxInputUrl,
|
|
1228
1331
|
GoabxLink,
|
|
1332
|
+
GoabxMenuAction,
|
|
1333
|
+
GoabxMenuButton,
|
|
1229
1334
|
GoabxModal,
|
|
1230
1335
|
GoabxNotification,
|
|
1231
1336
|
GoabxPagination,
|
|
@@ -1234,6 +1339,7 @@ export {
|
|
|
1234
1339
|
GoabxSideMenu,
|
|
1235
1340
|
GoabxSideMenuGroup,
|
|
1236
1341
|
GoabxSideMenuHeading,
|
|
1342
|
+
GoabxTab,
|
|
1237
1343
|
GoabxTable,
|
|
1238
1344
|
GoabxTableSortHeader,
|
|
1239
1345
|
GoabxTabs,
|