@abgov/react-components 6.8.0-alpha.1 → 6.8.0-alpha.2
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/index.d.ts +2 -0
- package/index.js +34 -0
- package/index.js.map +1 -1
- package/index.mjs +34 -0
- package/index.mjs.map +1 -1
- package/lib/menu-button/menu-action.d.ts +23 -0
- package/lib/menu-button/menu-button.d.ts +71 -0
- package/lib/popover/popover.d.ts +3 -1
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -42,6 +42,8 @@ export * from './lib/icon/icon';
|
|
|
42
42
|
export * from './lib/input/input';
|
|
43
43
|
export * from './lib/link/link';
|
|
44
44
|
export * from './lib/link-button/link-button';
|
|
45
|
+
export * from './lib/menu-button/menu-button';
|
|
46
|
+
export * from './lib/menu-button/menu-action';
|
|
45
47
|
export * from './lib/microsite-header/microsite-header';
|
|
46
48
|
export * from './lib/modal/modal';
|
|
47
49
|
export * from './lib/notification/notification';
|
package/index.js
CHANGED
|
@@ -3295,6 +3295,36 @@ function GoALinkButton({ type = "primary", ...props }) {
|
|
|
3295
3295
|
}
|
|
3296
3296
|
);
|
|
3297
3297
|
}
|
|
3298
|
+
function GoabMenuButton({
|
|
3299
|
+
text,
|
|
3300
|
+
type = "primary",
|
|
3301
|
+
testId,
|
|
3302
|
+
onAction,
|
|
3303
|
+
children
|
|
3304
|
+
}) {
|
|
3305
|
+
const el = react.useRef(null);
|
|
3306
|
+
react.useEffect(() => {
|
|
3307
|
+
if (!el.current) {
|
|
3308
|
+
return;
|
|
3309
|
+
}
|
|
3310
|
+
if (!onAction) {
|
|
3311
|
+
return;
|
|
3312
|
+
}
|
|
3313
|
+
const current = el.current;
|
|
3314
|
+
const listener = (e) => {
|
|
3315
|
+
const detail = e.detail;
|
|
3316
|
+
onAction(detail.action);
|
|
3317
|
+
};
|
|
3318
|
+
current.addEventListener("_action", listener);
|
|
3319
|
+
return () => {
|
|
3320
|
+
current.removeEventListener("_action", listener);
|
|
3321
|
+
};
|
|
3322
|
+
}, [el, onAction]);
|
|
3323
|
+
return /* @__PURE__ */ jsxRuntime.jsx("goa-menu-button", { ref: el, text, type, testid: testId, children });
|
|
3324
|
+
}
|
|
3325
|
+
function GoabMenuAction({ text, icon: icon2, action, testId }) {
|
|
3326
|
+
return /* @__PURE__ */ jsxRuntime.jsx("goa-menu-action", { text, action, icon: icon2, testid: testId });
|
|
3327
|
+
}
|
|
3298
3328
|
function GoabMicrositeHeader({
|
|
3299
3329
|
type,
|
|
3300
3330
|
version,
|
|
@@ -3476,6 +3506,7 @@ function GoabPopover({
|
|
|
3476
3506
|
position,
|
|
3477
3507
|
relative,
|
|
3478
3508
|
children,
|
|
3509
|
+
tabIndex = -1,
|
|
3479
3510
|
mt,
|
|
3480
3511
|
mr,
|
|
3481
3512
|
mb,
|
|
@@ -3490,6 +3521,7 @@ function GoabPopover({
|
|
|
3490
3521
|
padded: typeof padded === "undefined" ? void 0 : padded ? "true" : "false",
|
|
3491
3522
|
position,
|
|
3492
3523
|
relative: relative ? "true" : void 0,
|
|
3524
|
+
tabindex: tabIndex,
|
|
3493
3525
|
mt,
|
|
3494
3526
|
mr,
|
|
3495
3527
|
mb,
|
|
@@ -4403,6 +4435,8 @@ exports.GoabInputText = GoabInputText;
|
|
|
4403
4435
|
exports.GoabInputTime = GoabInputTime;
|
|
4404
4436
|
exports.GoabInputUrl = GoabInputUrl;
|
|
4405
4437
|
exports.GoabLink = GoabLink;
|
|
4438
|
+
exports.GoabMenuAction = GoabMenuAction;
|
|
4439
|
+
exports.GoabMenuButton = GoabMenuButton;
|
|
4406
4440
|
exports.GoabMicrositeHeader = GoabMicrositeHeader;
|
|
4407
4441
|
exports.GoabModal = GoabModal;
|
|
4408
4442
|
exports.GoabNotification = GoabNotification;
|