Skip to content

Commit 839d1f3

Browse files
leekelleheriOvergaard
authored andcommitted
Minor tweaks to uui-color-slider value type and story metadata
1 parent dfe823f commit 839d1f3

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export class UUIColorSliderElement extends LabelMixin('label', LitElement) {
8181
* @attr
8282
* @default 0
8383
*/
84-
@property() value = 0;
84+
@property({ type: Number }) value = 0;
8585

8686
/**
8787
* Sets the color slider to readonly mode.
@@ -265,7 +265,7 @@ export class UUIColorSliderElement extends LabelMixin('label', LitElement) {
265265
}
266266

267267
render() {
268-
return html` <div
268+
return html`<div
269269
part="slider"
270270
id="color-slider"
271271
role="slider"

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

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ export const Advanced: Story = {
9191
value: 0,
9292
min: 0,
9393
max: 360,
94+
precision: 1,
9495
},
9596
{
9697
label: 'S',
@@ -99,6 +100,7 @@ export const Advanced: Story = {
99100
value: 100,
100101
min: 0,
101102
max: 100,
103+
precision: 1,
102104
},
103105
{
104106
label: 'L',
@@ -107,6 +109,7 @@ export const Advanced: Story = {
107109
value: 50,
108110
min: 0,
109111
max: 100,
112+
precision: 1,
110113
},
111114
{
112115
label: 'A',
@@ -211,10 +214,12 @@ export const Advanced: Story = {
211214
.value=${slider.value}
212215
.min=${slider.min}
213216
.max=${slider.max}
214-
.color=${slider.type !== 'hue'
215-
? getHexString(value.h, value.s, value.l)
216-
: undefined}
217-
?precision=${ifDefined(slider.precision)}
217+
color=${ifDefined(
218+
slider.type !== 'hue'
219+
? getHexString(value.h, value.s, value.l)
220+
: undefined,
221+
)}
222+
.precision=${slider.precision}
218223
@change=${(e: Event) => handleSliderChange(e, slider)}
219224
style=${styleMap({
220225
'--uui-slider-background-image':

0 commit comments

Comments
 (0)