From c93d00074b7ddbf4cccc151fa9728842e356a479 Mon Sep 17 00:00:00 2001 From: Vrishabhsk Date: Fri, 1 Nov 2024 16:54:53 +0400 Subject: [PATCH 1/3] Improve docs for showTooltip prop --- packages/components/src/button/README.md | 10 ++++++++++ .../toggle-group-control-option-base/README.md | 10 ++++++++++ .../toggle-group-control-option/README.md | 10 ++++++++++ 3 files changed, 30 insertions(+) diff --git a/packages/components/src/button/README.md b/packages/components/src/button/README.md index d458771494a338..3ff7c12fbaeb32 100644 --- a/packages/components/src/button/README.md +++ b/packages/components/src/button/README.md @@ -253,6 +253,16 @@ If provided with `showTooltip`, appends the Shortcut label to the tooltip conten If provided, renders a [Tooltip](/packages/components/src/tooltip/README.md) component for the button. +##### Usage Guidelines: + +1. Interaction with `showIconLabels`: + - When the 'Show button text labels' preference (`showIconLabels`) is enabled, icon buttons display visible text labels. + - In this case, showing a tooltip that merely repeats the visible text is unnecessary and can create visual clutter. + +2. Accessibility Considerations: + - Tooltips should provide additional, helpful information beyond what's visible. + - For users relying on screen readers, ensure that the tooltip content complements rather than duplicates the button's accessible name. + - Required: No #### `size`: `'default'` | `'compact'` | `'small'` diff --git a/packages/components/src/toggle-group-control/toggle-group-control-option-base/README.md b/packages/components/src/toggle-group-control/toggle-group-control-option-base/README.md index e673a1ed45bbf6..0090fe9ea31f7c 100644 --- a/packages/components/src/toggle-group-control/toggle-group-control-option-base/README.md +++ b/packages/components/src/toggle-group-control/toggle-group-control-option-base/README.md @@ -24,4 +24,14 @@ The value of the `ToggleGroupControlOptionBase`. Whether to show a tooltip when hovering over the option. The tooltip will only show if a label for it is provided using the `aria-label` prop. +#### Usage Guidelines: + +1. Interaction with `showIconLabels`: + - When the 'Show button text labels' preference (`showIconLabels`) is enabled, components typically display visible text labels. + - In such cases, showing a tooltip that merely repeats the visible text is unnecessary and can create visual clutter. + +2. Accessibility Considerations: + - Tooltips should provide additional, helpful information beyond what's visible on the screen. + - For users relying on screen readers, ensure that the tooltip content complements rather than duplicates the component's accessible name or visible text. + - Required: No diff --git a/packages/components/src/toggle-group-control/toggle-group-control-option/README.md b/packages/components/src/toggle-group-control/toggle-group-control-option/README.md index 2e7c55bd688361..48cca0cff091b5 100644 --- a/packages/components/src/toggle-group-control/toggle-group-control-option/README.md +++ b/packages/components/src/toggle-group-control/toggle-group-control-option/README.md @@ -52,4 +52,14 @@ The value of the `ToggleGroupControlOption`. Whether to show a tooltip when hovering over the option. The tooltip will attempt to use the `aria-label` prop text first, then the `label` prop text if no `aria-label` prop is found. +#### Usage Guidelines: + +1. Interaction with `showIconLabels`: + - When the 'Show button text labels' preference (`showIconLabels`) is enabled, components typically display visible text labels. + - In such cases, showing a tooltip that merely repeats the visible text is unnecessary and can create visual clutter. + +2. Accessibility Considerations: + - Tooltips should provide additional, helpful information beyond what's visible on the screen. + - For users relying on screen readers, ensure that the tooltip content complements rather than duplicates the component's accessible name or visible text. + - Required: No From 649f0b186f8c783a64c849cda6321cd76f911b7f Mon Sep 17 00:00:00 2001 From: Vrishabhsk Date: Fri, 8 Nov 2024 15:48:21 +0400 Subject: [PATCH 2/3] Update docs --- packages/components/src/button/README.md | 9 ++------- .../toggle-group-control-option-base/README.md | 9 ++------- .../toggle-group-control-option/README.md | 9 ++------- 3 files changed, 6 insertions(+), 21 deletions(-) diff --git a/packages/components/src/button/README.md b/packages/components/src/button/README.md index 3ff7c12fbaeb32..b5fc2833fadce8 100644 --- a/packages/components/src/button/README.md +++ b/packages/components/src/button/README.md @@ -255,13 +255,8 @@ If provided, renders a [Tooltip](/packages/components/src/tooltip/README.md) com ##### Usage Guidelines: -1. Interaction with `showIconLabels`: - - When the 'Show button text labels' preference (`showIconLabels`) is enabled, icon buttons display visible text labels. - - In this case, showing a tooltip that merely repeats the visible text is unnecessary and can create visual clutter. - -2. Accessibility Considerations: - - Tooltips should provide additional, helpful information beyond what's visible. - - For users relying on screen readers, ensure that the tooltip content complements rather than duplicates the button's accessible name. +1. Tooltips must be used only to visually expose the label of controls that don't show visible text. +2. Tooltips usage must take into account the showIconLabels preference: when enabled ant the control shows visible text, the tooltip must be disabled. - Required: No diff --git a/packages/components/src/toggle-group-control/toggle-group-control-option-base/README.md b/packages/components/src/toggle-group-control/toggle-group-control-option-base/README.md index 0090fe9ea31f7c..96f485383e9855 100644 --- a/packages/components/src/toggle-group-control/toggle-group-control-option-base/README.md +++ b/packages/components/src/toggle-group-control/toggle-group-control-option-base/README.md @@ -26,12 +26,7 @@ Whether to show a tooltip when hovering over the option. The tooltip will only s #### Usage Guidelines: -1. Interaction with `showIconLabels`: - - When the 'Show button text labels' preference (`showIconLabels`) is enabled, components typically display visible text labels. - - In such cases, showing a tooltip that merely repeats the visible text is unnecessary and can create visual clutter. - -2. Accessibility Considerations: - - Tooltips should provide additional, helpful information beyond what's visible on the screen. - - For users relying on screen readers, ensure that the tooltip content complements rather than duplicates the component's accessible name or visible text. +1. Tooltips must be used only to visually expose the label of controls that don't show visible text. +2. Tooltips usage must take into account the showIconLabels preference: when enabled ant the control shows visible text, the tooltip must be disabled. - Required: No diff --git a/packages/components/src/toggle-group-control/toggle-group-control-option/README.md b/packages/components/src/toggle-group-control/toggle-group-control-option/README.md index 48cca0cff091b5..8b9c1cb762013a 100644 --- a/packages/components/src/toggle-group-control/toggle-group-control-option/README.md +++ b/packages/components/src/toggle-group-control/toggle-group-control-option/README.md @@ -54,12 +54,7 @@ Whether to show a tooltip when hovering over the option. The tooltip will attemp #### Usage Guidelines: -1. Interaction with `showIconLabels`: - - When the 'Show button text labels' preference (`showIconLabels`) is enabled, components typically display visible text labels. - - In such cases, showing a tooltip that merely repeats the visible text is unnecessary and can create visual clutter. - -2. Accessibility Considerations: - - Tooltips should provide additional, helpful information beyond what's visible on the screen. - - For users relying on screen readers, ensure that the tooltip content complements rather than duplicates the component's accessible name or visible text. +1. Tooltips must be used only to visually expose the label of controls that don't show visible text. +2. Tooltips usage must take into account the showIconLabels preference: when enabled ant the control shows visible text, the tooltip must be disabled. - Required: No From 8b77e595c8e680caa819101e9db4b69629cb41e7 Mon Sep 17 00:00:00 2001 From: Vrishabhsk Date: Fri, 8 Nov 2024 15:50:18 +0400 Subject: [PATCH 3/3] Fix typo --- packages/components/src/button/README.md | 2 +- .../toggle-group-control-option-base/README.md | 2 +- .../toggle-group-control/toggle-group-control-option/README.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/components/src/button/README.md b/packages/components/src/button/README.md index b5fc2833fadce8..93cb0e6146a6bd 100644 --- a/packages/components/src/button/README.md +++ b/packages/components/src/button/README.md @@ -256,7 +256,7 @@ If provided, renders a [Tooltip](/packages/components/src/tooltip/README.md) com ##### Usage Guidelines: 1. Tooltips must be used only to visually expose the label of controls that don't show visible text. -2. Tooltips usage must take into account the showIconLabels preference: when enabled ant the control shows visible text, the tooltip must be disabled. +2. Tooltips usage must take into account the showIconLabels preference: when enabled and the control shows visible text, the tooltip must be disabled. - Required: No diff --git a/packages/components/src/toggle-group-control/toggle-group-control-option-base/README.md b/packages/components/src/toggle-group-control/toggle-group-control-option-base/README.md index 96f485383e9855..13ab0c931d7d8c 100644 --- a/packages/components/src/toggle-group-control/toggle-group-control-option-base/README.md +++ b/packages/components/src/toggle-group-control/toggle-group-control-option-base/README.md @@ -27,6 +27,6 @@ Whether to show a tooltip when hovering over the option. The tooltip will only s #### Usage Guidelines: 1. Tooltips must be used only to visually expose the label of controls that don't show visible text. -2. Tooltips usage must take into account the showIconLabels preference: when enabled ant the control shows visible text, the tooltip must be disabled. +2. Tooltips usage must take into account the showIconLabels preference: when enabled and the control shows visible text, the tooltip must be disabled. - Required: No diff --git a/packages/components/src/toggle-group-control/toggle-group-control-option/README.md b/packages/components/src/toggle-group-control/toggle-group-control-option/README.md index 8b9c1cb762013a..7d8ee683b7689d 100644 --- a/packages/components/src/toggle-group-control/toggle-group-control-option/README.md +++ b/packages/components/src/toggle-group-control/toggle-group-control-option/README.md @@ -55,6 +55,6 @@ Whether to show a tooltip when hovering over the option. The tooltip will attemp #### Usage Guidelines: 1. Tooltips must be used only to visually expose the label of controls that don't show visible text. -2. Tooltips usage must take into account the showIconLabels preference: when enabled ant the control shows visible text, the tooltip must be disabled. +2. Tooltips usage must take into account the showIconLabels preference: when enabled and the control shows visible text, the tooltip must be disabled. - Required: No