From 081b9414f91e85011fa660196137b1ebfa46d851 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tu=C4=9F=C3=A7e=20K=C3=BC=C3=A7=C3=BCko=C4=9Flu?= Date: Thu, 21 Jul 2022 21:45:24 +0300 Subject: [PATCH] Accessibility for Chips --- api-generator/components/chips.js | 22 ++++++-- src/components/chips/Chips.d.ts | 20 +++++-- src/components/chips/Chips.vue | 78 ++++++++++++++++++++-------- src/views/chips/ChipsDoc.vue | 86 ++++++++++++++++++++++++++++--- 4 files changed, 170 insertions(+), 36 deletions(-) diff --git a/api-generator/components/chips.js b/api-generator/components/chips.js index 8eba176e7..f8377f013 100644 --- a/api-generator/components/chips.js +++ b/api-generator/components/chips.js @@ -30,16 +30,28 @@ const ChipsProps = [ description: "Whether to allow duplicate values or not." }, { - name: "class", + name: "inputId", type: "string", default: "null", - description: "Style class of the component." + description: "Identifier of the focus input to match a label defined for the chips." }, { - name: "style", - type: "any", + name: "disabled", + type: "boolean", + default: "false", + description: "When present, it specifies that the element should be disabled." + }, + { + name: "'aria-labelledby'", + type: "string", default: "null", - description: "Inline of the component." + description: "Establishes relationships between the component and label(s) where its value should be one or more element IDs." + }, + { + name: "'aria-label'", + type: "string", + default: "null", + description: "Establishes a string value that labels the component." } ]; diff --git a/src/components/chips/Chips.d.ts b/src/components/chips/Chips.d.ts index c0133073d..2e753f7ba 100755 --- a/src/components/chips/Chips.d.ts +++ b/src/components/chips/Chips.d.ts @@ -40,13 +40,25 @@ export interface ChipsProps { */ separator?: string | undefined; /** - * Style class of the component input field. + * Identifier of the focus input to match a label defined for the chips. */ - class?: any; + inputId?: string | undefined; /** - * Inline style of the component. + * */ - style?: any; + inputProps?: object | undefined; + /** + * When present, it specifies that the element should be disabled. + */ + disabled?: boolean | undefined; + /** + * Establishes relationships between the component and label(s) where its value should be one or more element IDs. + */ + 'aria-labelledby'?: string | undefined; + /** + * Establishes a string value that labels the component. + */ + 'aria-label'?: string | undefined; } export interface ChipsSlots { diff --git a/src/components/chips/Chips.vue b/src/components/chips/Chips.vue index fa165ca88..dfb7077d9 100755 --- a/src/components/chips/Chips.vue +++ b/src/components/chips/Chips.vue @@ -1,15 +1,15 @@