From 725c7371c502d837e3cc12c252ae665cfa81dd18 Mon Sep 17 00:00:00 2001 From: J-Michalek <71264422+J-Michalek@users.noreply.github.com> Date: Sun, 12 Jan 2025 20:10:46 +0100 Subject: [PATCH] feat(button): add a11yAttrs to slot types Ideally the types would only suggest it when the asChild option is set to true, but I suspect that we cannot do that without composition API and the generic types - even then it could be very messy. --- packages/primevue/src/button/Button.d.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/primevue/src/button/Button.d.ts b/packages/primevue/src/button/Button.d.ts index a1605914c..a33a3c481 100755 --- a/packages/primevue/src/button/Button.d.ts +++ b/packages/primevue/src/button/Button.d.ts @@ -227,7 +227,13 @@ export interface ButtonSlots { /** * Custom content such as icons, images and text can be placed inside the button via the default slot. Note that when slot is used, label, icon and badge properties are not included. */ - default(): VNode[]; + default(scope: { + /** + * Object containing the accessibility attributes. + * @remarks Only available when {@link ButtonProps.asChild} is set to true. + */ + a11yAttrs?: Record + }): VNode[]; /** * Custom icon template. * @param {Object} scope - icon slot's params.