Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions packages/main/src/ColorPicker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ import type Input from "./Input.js";
import type Slider from "./Slider.js";

import {
COLORPICKER_LABEL,
COLORPICKER_SLIDER_GROUP,
COLORPICKER_ALPHA_SLIDER,
COLORPICKER_HUE_SLIDER,
COLORPICKER_HEX,
Expand Down Expand Up @@ -531,6 +533,14 @@ class ColorPicker extends UI5Element implements IFormInputElement {
&& this._colorValue.B === value.b;
}

get colorPickerLabel() {
return ColorPicker.i18nBundle.getText(COLORPICKER_LABEL);
}

get sliderGroupLabel() {
return ColorPicker.i18nBundle.getText(COLORPICKER_SLIDER_GROUP);
}

get hueSliderLabel() {
return ColorPicker.i18nBundle.getText(COLORPICKER_HUE_SLIDER);
}
Expand Down
12 changes: 10 additions & 2 deletions packages/main/src/ColorPickerTemplate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ import Button from "./Button.js";

export default function ColorPickerTemplate(this: ColorPicker) {
return (
<section class="ui5-color-picker-root">
<section
class="ui5-color-picker-root"
role="group"
aria-label={this.colorPickerLabel}
>
<div
class="ui5-color-picker-main-color"
style={{ "background-color": `rgb(${this._mainValue.r}, ${this._mainValue.g}, ${this._mainValue.b})` }}
Expand All @@ -24,7 +28,11 @@ export default function ColorPickerTemplate(this: ColorPicker) {
></div>
</div>

<div class="ui5-color-picker-sliders-wrapper">
<div
class="ui5-color-picker-sliders-wrapper"
role="group"
aria-label={this.sliderGroupLabel}
>
<Slider
disabled={this.inputsDisabled}
class="ui5-color-picker-hue-slider"
Expand Down
10 changes: 8 additions & 2 deletions packages/main/src/i18n/messagebundle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,17 @@ COLOR_PALETTE_MORE_COLORS_TEXT=More Colors...
#XTIT: Color Palette dialog button text to set the default color
COLOR_PALETTE_DEFAULT_COLOR_TEXT=Default Color

#XACT: ARIA information for the ColorPicker slider group
COLORPICKER_LABEL= Color Picker

#XACT: ARIA information for the ColorPicker slider group
COLORPICKER_SLIDER_GROUP=Color Sliders

#XACT: ARIA information for the ColorPicker Alpha slider
COLORPICKER_ALPHA_SLIDER=Alpha control
COLORPICKER_ALPHA_SLIDER=Alpha slider

#XACT: ARIA information for the ColorPicker Hue slider
COLORPICKER_HUE_SLIDER=Hue control
COLORPICKER_HUE_SLIDER=Hue slider

#XTOL: Six symbol hexadecimal group representing CSS color hex string
COLORPICKER_HEX=Hexadecimal
Expand Down
Loading