@sky.ui/core 0.0.59 → 0.0.61

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,12 +1,70 @@
1
- import{css as t,LitElement as e,nothing as i,html as s}from"lit";import{property as a,state as r,query as o,customElement as n}from"lit/decorators.js";import{live as l}from"lit/directives/live.js";import{hsva as h,parseCssColor as p,hsvaToCss as d,hsvaToHex6 as c,clamp as v,hexToHsva as u,hsvaToRgba as m,rgbaToHsva as y,hueCss as _}from"./color-model.js";var b=Object.defineProperty,g=Object.getOwnPropertyDescriptor,f=(t,e,i,s)=>{for(var a,r=s>1?void 0:s?g(e,i):e,o=t.length-1;o>=0;o--)(a=t[o])&&(r=(s?a(e,i,r):a(r))||r);return s&&r&&b(e,i,r),r};let k=class extends e{constructor(){super(...arguments),this.value="#000000",this.format="hex",this.alpha=!0,this.eyedropper=!0,this.actions=!0,this._hsva=h(0,1,1,1),this._hexDraft="#000000",this._drag=null,this._origin="",this._syncedFromProp="",this._onSvDown=t=>{t.preventDefault(),this._drag="sv",t.currentTarget.setPointerCapture?.(t.pointerId),this._svFromEvent(t)},this._onHueDown=t=>{t.preventDefault(),this._drag="hue",t.currentTarget.setPointerCapture?.(t.pointerId),this._hueFromEvent(t)},this._onAlphaDown=t=>{t.preventDefault(),this._drag="alpha",t.currentTarget.setPointerCapture?.(t.pointerId),this._alphaFromEvent(t)},this._onWinMove=t=>{this._drag&&("sv"===this._drag?this._svFromEvent(t):"hue"===this._drag?this._hueFromEvent(t):this._alphaFromEvent(t))},this._onWinUp=()=>{this._drag&&(this._drag=null,this.actions||this._emit("color-change",!0))},this._stopBubble=t=>{t.stopPropagation()}}connectedCallback(){super.connectedCallback(),this._origin=this.value,this._applyValue(this.value,!0),window.addEventListener("pointermove",this._onWinMove),window.addEventListener("pointerup",this._onWinUp),window.addEventListener("pointercancel",this._onWinUp)}disconnectedCallback(){window.removeEventListener("pointermove",this._onWinMove),window.removeEventListener("pointerup",this._onWinUp),window.removeEventListener("pointercancel",this._onWinUp),super.disconnectedCallback()}willUpdate(t){t.has("value")&&null==this._drag&&this.value!==this._syncedFromProp&&this._applyValue(this.value,!1)}_hsvaEq(t,e){return t.h===e.h&&t.s===e.s&&t.v===e.v&&t.a===e.a}_applyValue(t,e){const i=p(t)??h(0,0,0,1),s=d(i);this._hsvaEq(this._hsva,i)||(this._hsva=i),this._hexDraft!==s&&(this._hexDraft=s),this._syncedFromProp=s,e&&(this._origin=t)}get _css(){return this.alpha?d(this._hsva):c(this._hsva)}_emit(t,e){const i=this._css;this._syncedFromProp=i,this.dispatchEvent(new CustomEvent(t,{detail:{value:i},bubbles:!0,composed:!0})),!e&&this.actions||this.dispatchEvent(new CustomEvent("color-change",{detail:{value:i},bubbles:!0,composed:!0}))}_setHsva(t,e){const i=d(t);this._hsvaEq(this._hsva,t)&&this._hexDraft===i||(this._hsva=t,this._hexDraft=i,this._emit("color-input",!this.actions&&e))}_ratio(t,e,i){if(!t)return 0;const s=t.getBoundingClientRect();return v("x"===i?(e.clientX-s.left)/s.width:(e.clientY-s.top)/s.height,0,1)}_svFromEvent(t){const e=this._ratio(this._svEl,t,"x"),i=1-this._ratio(this._svEl,t,"y");this._setHsva({...this._hsva,s:e,v:i},!0)}_hueFromEvent(t){const e=360*this._ratio(this._hueEl,t,"x");this._setHsva({...this._hsva,h:e},!0)}_alphaFromEvent(t){const e=this._ratio(this._alphaEl,t,"x");this._setHsva({...this._hsva,a:e},!0)}_eventValue(t){const e=t.detail;return String(e&&"value"in e?e.value??"":t.target?.value??"")}_onHexInput(t){if(this._drag)return;const e=this._eventValue(t);this._hexDraft=e;const i=u(e.startsWith("#")?e:`#${e}`);i&&this._setHsva(i,!0)}_onRgb(t,e){if(this._drag)return;const i=v(Number(this._eventValue(e)),0,255),s=m(this._hsva);s[t]=i,this._setHsva(y(s),!0)}_onHsb(t,e){if(this._drag)return;const i=Number(this._eventValue(e));"h"===t?this._setHsva({...this._hsva,h:v(i,0,360)},!0):this._setHsva({...this._hsva,[t]:v(i,0,100)/100},!0)}_onPct(t){if(this._drag)return;const e=v(Number(this._eventValue(t)),0,100);this._setHsva({...this._hsva,a:e/100},!0)}async _eyedrop(){const t=window.EyeDropper;if(t)try{const{sRGBHex:e}=await(new t).open(),i=p(e);i&&this._setHsva({...i,a:this._hsva.a},!0)}catch{}}_done(){this._origin=this._css,this._emit("color-done",!0)}_cancel(){this._applyValue(this._origin,!1),this.dispatchEvent(new CustomEvent("color-cancel",{detail:{value:this._origin},bubbles:!0,composed:!0}))}_onFormatSelect(t){t.stopPropagation();const e=t.detail?.value;"hex"!==e&&"hsb"!==e&&"rgb"!==e||(this.format=e)}get _formatLabel(){return"hex"===this.format?"Hex":"hsb"===this.format?"HSB":"RGB"}get _canEye(){return this.eyedropper&&"undefined"!=typeof window&&"EyeDropper"in window}render(){const{h:t,s:e,v:a,a:r}=this._hsva,o=m(this._hsva),n=_(t),h=c(this._hsva);return s`
2
- <div class="root" style="--cp-hue:${n}">
1
+ import{css as t,LitElement as e,html as i,nothing as r}from"lit";import{property as s,state as a,query as n,customElement as o}from"lit/decorators.js";import{live as l}from"lit/directives/live.js";import{hsva as h,parseCssColor as p,hsvaToCss as d,hsvaToHex6 as c,clamp as m,hexToHsva as v,hsvaToRgba as u,rgbaToHsva as y,hueCss as _}from"./color-model.js";var g=Object.defineProperty,b=Object.getOwnPropertyDescriptor,x=(t,e,i,r)=>{for(var s,a=r>1?void 0:r?b(e,i):e,n=t.length-1;n>=0;n--)(s=t[n])&&(a=(r?s(e,i,a):s(a))||a);return r&&a&&g(e,i,a),a};let f=class extends e{constructor(){super(...arguments),this.value="#000000",this.format="hex",this.alpha=!0,this.eyedropper=!0,this.actions=!0,this._hsva=h(0,1,1,1),this._hexDraft="#000000",this._drag=null,this._origin="",this._syncedFromProp="",this._onSvDown=t=>{t.preventDefault(),this._drag="sv",t.currentTarget.setPointerCapture?.(t.pointerId),this._svFromEvent(t)},this._onHueDown=t=>{t.preventDefault(),this._drag="hue",t.currentTarget.setPointerCapture?.(t.pointerId),this._hueFromEvent(t)},this._onAlphaDown=t=>{t.preventDefault(),this._drag="alpha",t.currentTarget.setPointerCapture?.(t.pointerId),this._alphaFromEvent(t)},this._onWinMove=t=>{this._drag&&("sv"===this._drag?this._svFromEvent(t):"hue"===this._drag?this._hueFromEvent(t):this._alphaFromEvent(t))},this._onWinUp=()=>{this._drag&&(this._drag=null,this.actions||this._emit("color-change",!0))},this._stopBubble=t=>{t.stopPropagation()}}connectedCallback(){super.connectedCallback(),this._origin=this.value,this._applyValue(this.value,!0),window.addEventListener("pointermove",this._onWinMove),window.addEventListener("pointerup",this._onWinUp),window.addEventListener("pointercancel",this._onWinUp)}disconnectedCallback(){window.removeEventListener("pointermove",this._onWinMove),window.removeEventListener("pointerup",this._onWinUp),window.removeEventListener("pointercancel",this._onWinUp),super.disconnectedCallback()}willUpdate(t){t.has("value")&&null==this._drag&&this.value!==this._syncedFromProp&&this._applyValue(this.value,!1)}_hsvaEq(t,e){return t.h===e.h&&t.s===e.s&&t.v===e.v&&t.a===e.a}_applyValue(t,e){const i=p(t)??h(0,0,0,1),r=d(i);this._hsvaEq(this._hsva,i)||(this._hsva=i),this._hexDraft!==r&&(this._hexDraft=r),this._syncedFromProp=r,e&&(this._origin=t)}get _css(){return this.alpha?d(this._hsva):c(this._hsva)}_emit(t,e){const i=this._css;this._syncedFromProp=i,this.dispatchEvent(new CustomEvent(t,{detail:{value:i},bubbles:!0,composed:!0})),!e&&this.actions||this.dispatchEvent(new CustomEvent("color-change",{detail:{value:i},bubbles:!0,composed:!0}))}_setHsva(t,e){const i=d(t);this._hsvaEq(this._hsva,t)&&this._hexDraft===i||(this._hsva=t,this._hexDraft=i,this._emit("color-input",!this.actions&&e))}_ratio(t,e,i){if(!t)return 0;const r=t.getBoundingClientRect();return m("x"===i?(e.clientX-r.left)/r.width:(e.clientY-r.top)/r.height,0,1)}_svFromEvent(t){const e=this._ratio(this._svEl,t,"x"),i=1-this._ratio(this._svEl,t,"y");this._setHsva({...this._hsva,s:e,v:i},!0)}_hueFromEvent(t){const e=360*this._ratio(this._hueEl,t,"x");this._setHsva({...this._hsva,h:e},!0)}_alphaFromEvent(t){const e=this._ratio(this._alphaEl,t,"x");this._setHsva({...this._hsva,a:e},!0)}_eventValue(t){const e=t.detail;return String(e&&"value"in e?e.value??"":t.target?.value??"")}_onHexInput(t){if(this._drag)return;const e=this._eventValue(t);this._hexDraft=e;const i=v(e.startsWith("#")?e:`#${e}`);i&&this._setHsva(i,!0)}_onRgb(t,e){if(this._drag)return;const i=m(Number(this._eventValue(e)),0,255),r=u(this._hsva);r[t]=i,this._setHsva(y(r),!0)}_onHsb(t,e){if(this._drag)return;const i=Number(this._eventValue(e));"h"===t?this._setHsva({...this._hsva,h:m(i,0,360)},!0):this._setHsva({...this._hsva,[t]:m(i,0,100)/100},!0)}_onPct(t){if(this._drag)return;const e=m(Number(this._eventValue(t)),0,100);this._setHsva({...this._hsva,a:e/100},!0)}async _eyedrop(){const t=window.EyeDropper;if(t)try{const{sRGBHex:e}=await(new t).open(),i=p(e);i&&this._setHsva({...i,a:this._hsva.a},!0)}catch{}}_done(){this._origin=this._css,this._emit("color-done",!0)}_cancel(){this._applyValue(this._origin,!1),this.dispatchEvent(new CustomEvent("color-cancel",{detail:{value:this._origin},bubbles:!0,composed:!0}))}_onFormatSelect(t){t.stopPropagation();const e=t.detail?.value;"hex"!==e&&"hsb"!==e&&"rgb"!==e||(this.format=e)}get _formatLabel(){return"hex"===this.format?"Hex":"hsb"===this.format?"HSB":"RGB"}_formatTrigger(){return i`
2
+ <sky-dropdown
3
+ part="format"
4
+ class="format-dd"
5
+ trigger="click"
6
+ placement="bottom"
7
+ align="start"
8
+ .width=${"auto"}
9
+ .closeOnClick=${!0}
10
+ .maxHeight=${"none"}
11
+ .value=${this.format}
12
+ @open=${this._stopBubble}
13
+ @close=${this._stopBubble}
14
+ @open-change=${this._stopBubble}
15
+ @dropdown-item-click=${this._stopBubble}
16
+ @dropdown-select=${this._onFormatSelect}
17
+ >
18
+ <sky-button
19
+ slot="trigger"
20
+ type="button"
21
+ size="xs"
22
+ variant="transparent"
23
+ color="default"
24
+ animation="none"
25
+ .iconR=${"mdi:chevron-down"}
26
+ .label=${this._formatLabel}
27
+ ></sky-button>
28
+ <sky-dropdown-item
29
+ value="hex"
30
+ label="Hex"
31
+ size="sm"
32
+ ?selected=${"hex"===this.format}
33
+ ></sky-dropdown-item>
34
+ <sky-dropdown-item
35
+ value="hsb"
36
+ label="HSB"
37
+ size="sm"
38
+ ?selected=${"hsb"===this.format}
39
+ ></sky-dropdown-item>
40
+ <sky-dropdown-item
41
+ value="rgb"
42
+ label="RGB"
43
+ size="sm"
44
+ ?selected=${"rgb"===this.format}
45
+ ></sky-dropdown-item>
46
+ </sky-dropdown>
47
+ `}_num(t,e,r,s,a){return i`
48
+ <input
49
+ class="num"
50
+ type="number"
51
+ inputmode="numeric"
52
+ min=${r}
53
+ max=${s}
54
+ step="1"
55
+ aria-label=${t}
56
+ .value=${l(e)}
57
+ @input=${a}
58
+ />
59
+ `}get _canEye(){return this.eyedropper&&"undefined"!=typeof window&&"EyeDropper"in window}render(){const{h:t,s:e,v:s,a:a}=this._hsva,n=u(this._hsva),o=_(t),h=c(this._hsva);return i`
60
+ <div class="root" style="--cp-hue:${o}">
3
61
  <div
4
62
  part="field"
5
63
  class="sv checker"
6
64
  @pointerdown=${this._onSvDown}
7
65
  >
8
- <div class="sv-fill" style="opacity:${this.alpha?r:1}"></div>
9
- <div class="thumb" style="left:${100*e}%;top:${100*(1-a)}%"></div>
66
+ <div class="sv-fill" style="opacity:${this.alpha?a:1}"></div>
67
+ <div class="thumb" style="left:${100*e}%;top:${100*(1-s)}%"></div>
10
68
  </div>
11
69
 
12
70
  <div class="tools">
@@ -31,161 +89,59 @@ import{css as t,LitElement as e,nothing as i,html as s}from"lit";import{property
31
89
  </div>
32
90
 
33
91
  <div class="values">
34
- <sky-dropdown
35
- part="format"
36
- class="format-dd"
37
- trigger="click"
38
- placement="bottom"
39
- align="start"
40
- .width=${"trigger"}
41
- .closeOnClick=${!0}
42
- .maxHeight=${"none"}
43
- .value=${this.format}
44
- @open=${this._stopBubble}
45
- @close=${this._stopBubble}
46
- @open-change=${this._stopBubble}
47
- @dropdown-item-click=${this._stopBubble}
48
- @dropdown-select=${this._onFormatSelect}
49
- >
50
- <sky-button
51
- slot="trigger"
52
- type="button"
53
- size="xs"
54
- variant="bordered"
55
- color="default"
56
- animation="none"
57
- .iconR=${"mdi:chevron-down"}
58
- .label=${this._formatLabel}
59
- ></sky-button>
60
- <sky-dropdown-item
61
- value="hex"
62
- label="Hex"
63
- size="sm"
64
- ?selected=${"hex"===this.format}
65
- ></sky-dropdown-item>
66
- <sky-dropdown-item
67
- value="hsb"
68
- label="HSB"
69
- size="sm"
70
- ?selected=${"hsb"===this.format}
71
- ></sky-dropdown-item>
72
- <sky-dropdown-item
73
- value="rgb"
74
- label="RGB"
75
- size="sm"
76
- ?selected=${"rgb"===this.format}
77
- ></sky-dropdown-item>
78
- </sky-dropdown>
79
-
80
- ${"hex"===this.format?s`
81
- <sky-input
82
- class="field"
83
- .compact=${!0}
84
- spellcheck="false"
85
- .ariaLabel=${"Hex color"}
86
- .value=${l(this._hexDraft)}
87
- @value-changed=${this._onHexInput}
88
- ></sky-input>
89
- `:"hsb"===this.format?s`
90
- <div class="triple">
91
- <sky-input
92
- class="field"
93
- .compact=${!0}
94
- type="number"
95
- min="0"
96
- max="360"
97
- step="1"
98
- .ariaLabel=${"Hue"}
99
- .value=${String(Math.round(t))}
100
- @value-changed=${t=>this._onHsb("h",t)}
101
- ></sky-input>
102
- <sky-input
103
- class="field"
104
- .compact=${!0}
105
- type="number"
106
- min="0"
107
- max="100"
108
- step="1"
109
- .ariaLabel=${"Saturation"}
110
- .value=${String(Math.round(100*e))}
111
- @value-changed=${t=>this._onHsb("s",t)}
112
- ></sky-input>
113
- <sky-input
114
- class="field"
115
- .compact=${!0}
116
- type="number"
117
- min="0"
118
- max="100"
119
- step="1"
120
- .ariaLabel=${"Brightness"}
121
- .value=${String(Math.round(100*a))}
122
- @value-changed=${t=>this._onHsb("v",t)}
123
- ></sky-input>
124
- </div>
125
- `:s`
126
- <div class="triple">
127
- <sky-input
128
- class="field"
129
- .compact=${!0}
130
- type="number"
131
- min="0"
132
- max="255"
133
- step="1"
134
- .ariaLabel=${"Red"}
135
- .value=${String(o.r)}
136
- @value-changed=${t=>this._onRgb("r",t)}
137
- ></sky-input>
138
- <sky-input
139
- class="field"
140
- .compact=${!0}
141
- type="number"
142
- min="0"
143
- max="255"
144
- step="1"
145
- .ariaLabel=${"Green"}
146
- .value=${String(o.g)}
147
- @value-changed=${t=>this._onRgb("g",t)}
148
- ></sky-input>
149
- <sky-input
150
- class="field"
151
- .compact=${!0}
152
- type="number"
153
- min="0"
154
- max="255"
155
- step="1"
156
- .ariaLabel=${"Blue"}
157
- .value=${String(o.b)}
158
- @value-changed=${t=>this._onRgb("b",t)}
159
- ></sky-input>
160
- </div>
161
- `}
92
+ <div class="channel">
93
+ ${this._formatTrigger()}
94
+ ${"hex"===this.format?i`
95
+ <input
96
+ class="num hex"
97
+ spellcheck="false"
98
+ aria-label="Hex color"
99
+ .value=${l(this._hexDraft)}
100
+ @input=${this._onHexInput}
101
+ />
102
+ `:"hsb"===this.format?i`
103
+ <div class="splits">
104
+ ${this._num("Hue",String(Math.round(t)),0,360,t=>this._onHsb("h",t))}
105
+ ${this._num("Saturation",String(Math.round(100*e)),0,100,t=>this._onHsb("s",t))}
106
+ ${this._num("Brightness",String(Math.round(100*s)),0,100,t=>this._onHsb("v",t))}
107
+ </div>
108
+ `:i`
109
+ <div class="splits">
110
+ ${this._num("Red",String(n.r),0,255,t=>this._onRgb("r",t))}
111
+ ${this._num("Green",String(n.g),0,255,t=>this._onRgb("g",t))}
112
+ ${this._num("Blue",String(n.b),0,255,t=>this._onRgb("b",t))}
113
+ </div>
114
+ `}
115
+ </div>
162
116
 
163
- ${this.alpha?s`
117
+ ${this.alpha?i`
164
118
  <div class="alpha-row">
165
119
  <div part="alpha" class="track checker" @pointerdown=${this._onAlphaDown}>
166
120
  <div
167
121
  class="track-fill"
168
122
  style="background:linear-gradient(to right, transparent, ${h})"
169
123
  ></div>
170
- <div class="thumb" style="left:${100*r}%"></div>
124
+ <div class="thumb" style="left:${100*a}%"></div>
125
+ </div>
126
+ <div class="pct">
127
+ <input
128
+ class="num"
129
+ type="number"
130
+ inputmode="numeric"
131
+ min="0"
132
+ max="100"
133
+ step="1"
134
+ aria-label="Opacity percent"
135
+ .value=${l(String(Math.round(100*a)))}
136
+ @input=${this._onPct}
137
+ />
138
+ <span class="unit">%</span>
171
139
  </div>
172
- <sky-input
173
- class="pct"
174
- .compact=${!0}
175
- type="number"
176
- min="0"
177
- max="100"
178
- step="1"
179
- suffix="%"
180
- .ariaLabel=${"Opacity percent"}
181
- .value=${String(Math.round(100*r))}
182
- @value-changed=${this._onPct}
183
- ></sky-input>
184
140
  </div>
185
- `:i}
141
+ `:r}
186
142
  </div>
187
143
 
188
- ${this.actions?s`
144
+ ${this.actions?i`
189
145
  <div class="actions">
190
146
  <sky-button
191
147
  type="button"
@@ -207,9 +163,9 @@ import{css as t,LitElement as e,nothing as i,html as s}from"lit";import{property
207
163
  @click=${this._done}
208
164
  ></sky-button>
209
165
  </div>
210
- `:i}
166
+ `:r}
211
167
  </div>
212
- `}};k.styles=t`
168
+ `}};f.styles=t`
213
169
  :host {
214
170
  display: block;
215
171
  width: 100%;
@@ -262,6 +218,7 @@ import{css as t,LitElement as e,nothing as i,html as s}from"lit";import{property
262
218
  position: relative;
263
219
  width: 100%;
264
220
  aspect-ratio: 1.2 / 1;
221
+ max-height: var(--sky-color-sv-max-h, none);
265
222
  border-radius: var(--sky-radius-secondary, 8px);
266
223
  overflow: hidden;
267
224
  cursor: crosshair;
@@ -338,40 +295,97 @@ import{css as t,LitElement as e,nothing as i,html as s}from"lit";import{property
338
295
 
339
296
  .values {
340
297
  display: grid;
341
- grid-template-columns: auto minmax(0, 1fr);
298
+ grid-template-columns: minmax(0, 1fr);
342
299
  gap: var(--sky-space-1, 4px) var(--sky-space-2, 8px);
343
300
  align-items: center;
344
301
  min-width: 0;
345
302
  }
346
303
 
304
+ .channel {
305
+ display: flex;
306
+ align-items: stretch;
307
+ min-width: 0;
308
+ height: 28px;
309
+ border: var(--sky-border-primary, 1px solid color-mix(in oklch, var(--sky-text-primary) 16%, transparent));
310
+ border-radius: var(--sky-radius-primary, 6px);
311
+ background: var(--sky-glass-primary, transparent);
312
+ overflow: hidden;
313
+ }
314
+
315
+ .channel:focus-within {
316
+ box-shadow: var(--sky-focus-ring);
317
+ }
318
+
319
+ .splits {
320
+ display: grid;
321
+ grid-template-columns: repeat(3, minmax(0, 1fr));
322
+ flex: 1;
323
+ min-width: 0;
324
+ }
325
+
326
+ .num {
327
+ width: 100%;
328
+ min-width: 0;
329
+ height: 100%;
330
+ margin: 0;
331
+ border: 0;
332
+ outline: none;
333
+ background: transparent;
334
+ color: inherit;
335
+ font: inherit;
336
+ text-align: center;
337
+ padding: 0 0.35rem;
338
+ appearance: textfield;
339
+ -moz-appearance: textfield;
340
+ }
341
+
342
+ .num.hex {
343
+ flex: 1;
344
+ text-align: start;
345
+ padding-inline: 0.5rem 0.65rem;
346
+ }
347
+
348
+ .splits .num + .num {
349
+ border-inline-start: var(--sky-border-tertiary, 1px solid color-mix(in oklch, var(--sky-text-primary) 12%, transparent));
350
+ }
351
+
352
+ .num::-webkit-outer-spin-button,
353
+ .num::-webkit-inner-spin-button {
354
+ -webkit-appearance: none;
355
+ margin: 0;
356
+ }
357
+
347
358
  .format-dd {
348
- display: block;
349
- min-width: 4.5rem;
359
+ display: inline-flex;
360
+ flex: 0 0 auto;
361
+ align-items: center;
362
+ width: auto;
363
+ min-width: 0;
364
+ border-inline-end: var(--sky-border-tertiary, 1px solid color-mix(in oklch, var(--sky-text-primary) 12%, transparent));
350
365
  }
351
366
 
352
367
  .format-dd::part(trigger) {
353
- display: block;
354
- width: 100%;
368
+ display: inline-flex;
369
+ width: auto;
355
370
  }
356
371
 
357
372
  .format-dd sky-button {
358
- display: block;
359
- width: 100%;
360
- box-sizing: border-box;
373
+ display: inline-flex;
374
+ width: auto;
361
375
  }
362
376
 
363
377
  .format-dd::part(content) {
364
378
  box-sizing: border-box;
365
379
  padding: var(--sky-space-2, 8px);
366
- width: var(--sky-dd-width, max-content);
367
- min-width: var(--sky-dd-width, auto);
368
- max-width: var(--sky-dd-width, none);
380
+ width: max-content;
381
+ min-width: 8.5rem;
382
+ max-width: none;
369
383
  }
370
384
 
371
385
  .format-dd::part(content-inner) {
372
386
  overflow: visible;
373
387
  max-height: none;
374
- max-width: 100%;
388
+ max-width: none;
375
389
  }
376
390
 
377
391
  .format-dd sky-dropdown-item {
@@ -379,23 +393,42 @@ import{css as t,LitElement as e,nothing as i,html as s}from"lit";import{property
379
393
  --di-pad-y: 6px;
380
394
  }
381
395
 
396
+ .format-dd sky-dropdown-item::part(label) {
397
+ overflow: visible;
398
+ text-overflow: clip;
399
+ }
400
+
382
401
  .format-dd sky-dropdown-item::part(root) {
383
402
  padding: 0.4rem 0.75rem;
384
403
  border-radius: 6px;
385
404
  }
386
405
 
387
- .field,
388
406
  .pct {
389
- display: block;
390
- width: 100%;
407
+ display: flex;
408
+ align-items: center;
409
+ width: 5rem;
391
410
  min-width: 0;
411
+ height: 28px;
412
+ border: var(--sky-border-primary, 1px solid color-mix(in oklch, var(--sky-text-primary) 16%, transparent));
413
+ border-radius: var(--sky-radius-primary, 6px);
414
+ background: var(--sky-glass-primary, transparent);
415
+ overflow: hidden;
392
416
  }
393
417
 
394
- .triple {
395
- display: grid;
396
- grid-template-columns: repeat(3, minmax(0, 1fr));
397
- gap: var(--sky-space-1, 4px);
398
- min-width: 0;
418
+ .pct:focus-within {
419
+ box-shadow: var(--sky-focus-ring);
420
+ }
421
+
422
+ .pct .num {
423
+ text-align: end;
424
+ padding-inline-end: 0;
425
+ }
426
+
427
+ .unit {
428
+ flex: 0 0 auto;
429
+ padding-inline: 0.2rem 0.45rem;
430
+ color: var(--sky-text-secondary, inherit);
431
+ font-size: var(--sky-font-size-xs, 0.75rem);
399
432
  }
400
433
 
401
434
  .alpha-row {
@@ -413,5 +446,5 @@ import{css as t,LitElement as e,nothing as i,html as s}from"lit";import{property
413
446
  align-items: center;
414
447
  gap: var(--sky-space-1, 4px);
415
448
  }
416
- `,f([a({type:String})],k.prototype,"value",2),f([a({type:String,reflect:!0})],k.prototype,"format",2),f([a({type:Boolean})],k.prototype,"alpha",2),f([a({type:Boolean})],k.prototype,"eyedropper",2),f([a({type:Boolean})],k.prototype,"actions",2),f([r()],k.prototype,"_hsva",2),f([r()],k.prototype,"_hexDraft",2),f([o('[part="field"]')],k.prototype,"_svEl",2),f([o('[part="hue"]')],k.prototype,"_hueEl",2),f([o('[part="alpha"]')],k.prototype,"_alphaEl",2),k=f([n("sky-color-picker")],k);export{k as SkyColorPicker};
449
+ `,x([s({type:String})],f.prototype,"value",2),x([s({type:String,reflect:!0})],f.prototype,"format",2),x([s({type:Boolean})],f.prototype,"alpha",2),x([s({type:Boolean})],f.prototype,"eyedropper",2),x([s({type:Boolean})],f.prototype,"actions",2),x([a()],f.prototype,"_hsva",2),x([a()],f.prototype,"_hexDraft",2),x([n('[part="field"]')],f.prototype,"_svEl",2),x([n('[part="hue"]')],f.prototype,"_hueEl",2),x([n('[part="alpha"]')],f.prototype,"_alphaEl",2),f=x([o("sky-color-picker")],f);export{f as SkyColorPicker};
417
450
  //# sourceMappingURL=sky-color-picker.js.map