@abgov/react-components 6.11.0-dev.5 → 6.11.0-dev.7

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.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,
@@ -1217,6 +1303,7 @@ export {
1217
1303
  GoabxCalendar,
1218
1304
  GoabxCallout,
1219
1305
  GoabxCheckbox,
1306
+ GoabxCheckboxList,
1220
1307
  GoabxDatePicker,
1221
1308
  GoabxDrawer,
1222
1309
  GoabxDropdown,
@@ -1241,6 +1328,8 @@ export {
1241
1328
  GoabxInputTime,
1242
1329
  GoabxInputUrl,
1243
1330
  GoabxLink,
1331
+ GoabxMenuAction,
1332
+ GoabxMenuButton,
1244
1333
  GoabxModal,
1245
1334
  GoabxNotification,
1246
1335
  GoabxPagination,