Skip to content

Commit c1f0dfe

Browse files
committed
Minor tweaks to uui-color-slider value type and story metadata
1 parent d31195b commit c1f0dfe

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.
@@ -258,7 +258,7 @@ export class UUIColorSliderElement extends LabelMixin('label', LitElement) {
258258
}
259259

260260
render() {
261-
return html` <div
261+
return html`<div
262262
part="slider"
263263
id="color-slider"
264264
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
@@ -72,6 +72,7 @@ export const Advanced: Story = {
7272
value: 0,
7373
min: 0,
7474
max: 360,
75+
precision: 1,
7576
},
7677
{
7778
label: 'S',
@@ -80,6 +81,7 @@ export const Advanced: Story = {
8081
value: 100,
8182
min: 0,
8283
max: 100,
84+
precision: 1,
8385
},
8486
{
8587
label: 'L',
@@ -88,6 +90,7 @@ export const Advanced: Story = {
8890
value: 50,
8991
min: 0,
9092
max: 100,
93+
precision: 1,
9194
},
9295
{
9396
label: 'A',
@@ -192,10 +195,12 @@ export const Advanced: Story = {
192195
.value=${slider.value}
193196
.min=${slider.min}
194197
.max=${slider.max}
195-
.color=${slider.type !== 'hue'
196-
? getHexString(value.h, value.s, value.l)
197-
: undefined}
198-
?precision=${ifDefined(slider.precision)}
198+
color=${ifDefined(
199+
slider.type !== 'hue'
200+
? getHexString(value.h, value.s, value.l)
201+
: undefined,
202+
)}
203+
.precision=${slider.precision}
199204
@change=${(e: Event) => handleSliderChange(e, slider)}
200205
style=${styleMap({
201206
'--uui-slider-background-image':

0 commit comments

Comments
 (0)