Skip to content

Commit 912bbf6

Browse files
committed
feat(uui-color-slider): adds hideValueLabel option
1 parent 03bb157 commit 912bbf6

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

packages/uui-color-picker/lib/uui-color-picker.element.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,7 @@ export class UUIColorPickerElement extends LabelMixin('label', LitElement) {
446446
<div class="color-picker__controls">
447447
<div class="color-picker__sliders">
448448
<uui-color-slider
449+
hide-value-label
449450
label="hue"
450451
class="hue-slider"
451452
.value=${Math.round(this.hue)}

packages/uui-color-slider/lib/uui-color-slider.element.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,15 @@ export class UUIColorSliderElement extends LabelMixin('label', LitElement) {
101101
@property({ type: Boolean, reflect: true })
102102
disabled = false;
103103

104+
/**
105+
* Hides the value label under the slider.
106+
* @type {boolean}
107+
* @attr 'hide-value-label'
108+
* @default false
109+
*/
110+
@property({ type: Boolean, attribute: 'hide-value-label' })
111+
hideValueLabel = false;
112+
104113
private container!: HTMLElement;
105114
private handle!: HTMLElement;
106115

@@ -290,7 +299,7 @@ export class UUIColorSliderElement extends LabelMixin('label', LitElement) {
290299
tabindex=${ifDefined(this.disabled ? undefined : '0')}>
291300
</span>
292301
</div>
293-
${Math.round(this.value)}`;
302+
${this.hideValueLabel ? null : Math.round(this.value)}`;
294303
}
295304

296305
static styles = [

packages/uui-color-slider/lib/uui-color-slider.story.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,3 +231,9 @@ export const Advanced: Story = {
231231
</div>`;
232232
},
233233
};
234+
235+
export const HideValueLabel: Story = {
236+
args: {
237+
hideValueLabel: true,
238+
},
239+
};

0 commit comments

Comments
 (0)