Skip to content
Merged
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
1 change: 1 addition & 0 deletions packages/uui-color-picker/lib/uui-color-picker.element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,7 @@ export class UUIColorPickerElement extends LabelMixin('label', LitElement) {
<div class="color-picker__controls">
<div class="color-picker__sliders">
<uui-color-slider
hide-value-label
label="hue"
class="hue-slider"
.value=${Math.round(this.hue)}
Expand Down
11 changes: 10 additions & 1 deletion packages/uui-color-slider/lib/uui-color-slider.element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,15 @@ export class UUIColorSliderElement extends LabelMixin('label', LitElement) {
@property({ type: Boolean, reflect: true })
disabled = false;

/**
* Hides the value label under the slider.
* @type {boolean}
* @attr 'hide-value-label'
* @default false
*/
@property({ type: Boolean, attribute: 'hide-value-label', reflect: true })
hideValueLabel = false;

private container!: HTMLElement;
private handle!: HTMLElement;

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

static styles = [
Expand Down
6 changes: 6 additions & 0 deletions packages/uui-color-slider/lib/uui-color-slider.story.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,3 +231,9 @@ export const Advanced: Story = {
</div>`;
},
};

export const HideValueLabel: Story = {
args: {
hideValueLabel: true,
},
};
Loading