@rcarls/rc-slider 0.1.0

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.
package/dist/demo.css ADDED
@@ -0,0 +1,85 @@
1
+ *, *::before, *::after {
2
+ box-sizing: border-box;
3
+ }
4
+
5
+ :root {
6
+ color-scheme: light dark;
7
+ --rc-accent: Highlight; /* Chrome doesn't support AccentColor on the open web */
8
+ }
9
+
10
+ @supports (color: AccentColor) {
11
+ :root {
12
+ --rc-accent: AccentColor;
13
+ }
14
+ }
15
+
16
+ [data-theme="light"] { color-scheme: light; }
17
+ [data-theme="dark"] { color-scheme: dark; }
18
+
19
+ [data-theme="solarized-light"] {
20
+ color-scheme: light;
21
+ --rc-surface: #fdf6e3;
22
+ --rc-text: #657b83;
23
+ --rc-border: 1px solid #93a1a1;
24
+ --rc-shadow: 0 2px 8px rgba(0, 0, 0, .12);
25
+ }
26
+
27
+ [data-theme="solarized-dark"] {
28
+ color-scheme: dark;
29
+ --rc-surface: #002b36;
30
+ --rc-text: #839496;
31
+ --rc-border: 1px solid #586e75;
32
+ --rc-shadow: 0 2px 8px rgba(0, 0, 0, .3);
33
+ }
34
+
35
+ body {
36
+ font-family: system-ui, sans-serif;
37
+ margin: 0;
38
+ }
39
+
40
+ .demo-page {
41
+ max-width: 60rem;
42
+ margin: 0 auto;
43
+ padding: 2rem 1.5rem;
44
+ }
45
+
46
+ .demo-controls {
47
+ display: flex;
48
+ align-items: center;
49
+ gap: 1rem;
50
+ margin-bottom: 2rem;
51
+ padding-bottom: 1rem;
52
+ border-bottom: 1px solid ButtonBorder;
53
+ }
54
+
55
+ .demo-controls .demo-title {
56
+ flex: 1;
57
+ }
58
+
59
+ .demo-controls h1 {
60
+ margin: 0 0 0.15rem;
61
+ font-size: 1.5rem;
62
+ }
63
+
64
+ .demo-controls a {
65
+ font-size: 0.8rem;
66
+ }
67
+
68
+ .demo-section {
69
+ margin-bottom: 2rem;
70
+ }
71
+
72
+ .demo-section h2 {
73
+ margin: 0 0 0.5rem;
74
+ }
75
+
76
+ .theme-picker {
77
+ padding: 0.35em 0.75em;
78
+ font-family: inherit;
79
+ font-size: 0.8rem;
80
+ cursor: pointer;
81
+ border: 1px solid ButtonBorder;
82
+ border-radius: 4px;
83
+ background: Canvas;
84
+ color: CanvasText;
85
+ }
package/dist/demo.js ADDED
@@ -0,0 +1,40 @@
1
+ const THEMES = ['', 'light', 'dark', 'solarized-light', 'solarized-dark'];
2
+ const LABELS = ['Auto', 'Light', 'Dark', 'Solarized ☀', 'Solarized ☾'];
3
+
4
+ const stored = localStorage.getItem('rc-demo-theme') ?? '';
5
+ applyTheme(stored);
6
+
7
+ function applyTheme(theme) {
8
+ if (theme) {
9
+ document.documentElement.dataset.theme = theme;
10
+ } else {
11
+ delete document.documentElement.dataset.theme;
12
+ }
13
+ }
14
+
15
+ function currentIndex() {
16
+ const current = document.documentElement.dataset.theme ?? '';
17
+ const idx = THEMES.indexOf(current);
18
+ return idx === -1 ? 0 : idx;
19
+ }
20
+
21
+ function updateButtons() {
22
+ const label = LABELS[currentIndex()];
23
+ document.querySelectorAll('.theme-picker').forEach((btn) => {
24
+ btn.textContent = label;
25
+ });
26
+ }
27
+
28
+ window.cycleTheme = function () {
29
+ const next = THEMES[(currentIndex() + 1) % THEMES.length];
30
+ applyTheme(next);
31
+ localStorage.setItem('rc-demo-theme', next);
32
+ updateButtons();
33
+ };
34
+
35
+ document.addEventListener('DOMContentLoaded', () => {
36
+ updateButtons();
37
+ document.querySelectorAll('.theme-picker').forEach((btn) => {
38
+ btn.addEventListener('click', window.cycleTheme);
39
+ });
40
+ });
@@ -0,0 +1,337 @@
1
+ import { LitElement as f, css as m, nothing as o, html as h } from "lit";
2
+ import { property as s } from "lit/decorators.js";
3
+ import { ifDefined as y } from "lit/directives/if-defined.js";
4
+ import { valueToPercent as v } from "@rcarls/rc-common";
5
+ var b = Object.defineProperty, _ = Object.getOwnPropertyDescriptor, l = (r, t, e, n) => {
6
+ for (var i = n > 1 ? void 0 : n ? _(t, e) : t, u = r.length - 1, c; u >= 0; u--)
7
+ (c = r[u]) && (i = (n ? c(t, e, i) : c(i)) || i);
8
+ return n && i && b(t, e, i), i;
9
+ };
10
+ const g = {
11
+ fromAttribute(r) {
12
+ return r === null ? null : r === "" || r === "float" ? "float" : r === "inline-start" ? "inline-start" : r === "inline-end" ? "inline-end" : null;
13
+ },
14
+ toAttribute(r) {
15
+ return r;
16
+ }
17
+ };
18
+ function d(r, t) {
19
+ if (r === "") return t;
20
+ const e = parseFloat(r);
21
+ return isNaN(e) ? t : e;
22
+ }
23
+ const p = class p extends f {
24
+ constructor() {
25
+ super(...arguments), this.min = 0, this.max = 100, this.step = 1, this._valueInitialized = !1, this.disabled = !1, this.readonly = !1, this.display = null, this.valueText = "", this.orientation = "horizontal", this._nativeInput = null, this._onDefaultSlotChange = () => {
26
+ this._unwireInput(), this._findInput(), this.requestUpdate();
27
+ }, this._onInput = (t) => {
28
+ this._handleRangeEvent(t, "rc-slider-input");
29
+ }, this._onChange = (t) => {
30
+ this._handleRangeEvent(t, "rc-slider-change");
31
+ }, this._onKeydown = (t) => {
32
+ if (this.disabled || this.readonly || t.key !== "PageUp" && t.key !== "PageDown") return;
33
+ t.preventDefault();
34
+ const e = t.currentTarget;
35
+ t.key === "PageUp" ? e.stepUp(10) : e.stepDown(10), this._commitInputValue(e), this.dispatchEvent(
36
+ new CustomEvent("rc-slider-input", {
37
+ bubbles: !0,
38
+ composed: !0,
39
+ detail: { value: this.value }
40
+ })
41
+ );
42
+ };
43
+ }
44
+ get value() {
45
+ return this._value ?? this._defaultValue ?? this._nativeInputValue;
46
+ }
47
+ set value(t) {
48
+ const e = this._value;
49
+ this._value = t, this._valueInitialized = !0, this._applyValueToInput(t), this.requestUpdate("value", e);
50
+ }
51
+ get defaultValue() {
52
+ return this._defaultValue;
53
+ }
54
+ set defaultValue(t) {
55
+ const e = this._defaultValue;
56
+ this._defaultValue = t, !this._valueInitialized && this._value === void 0 && t !== void 0 && (this._applyValueToInput(t), this.requestUpdate("value", void 0)), this.requestUpdate("defaultValue", e);
57
+ }
58
+ connectedCallback() {
59
+ this._findInput(), super.connectedCallback();
60
+ }
61
+ disconnectedCallback() {
62
+ this._unwireInput(), super.disconnectedCallback();
63
+ }
64
+ updated() {
65
+ const t = this._nativeInput;
66
+ t && (t.disabled = this.disabled, this._syncAriaAttributes(t));
67
+ }
68
+ render() {
69
+ if (!this._nativeInput) return o;
70
+ const e = h`
71
+ <span
72
+ part="value-display"
73
+ class="rc-slider-value"
74
+ style=${y(
75
+ this.display === "float" ? this._floatStyle() : void 0
76
+ )}
77
+ aria-hidden="true"
78
+ >
79
+ <slot name="value-display">${this._displayText}</slot>
80
+ </span>
81
+ `;
82
+ return h`
83
+ <div
84
+ part="root"
85
+ class="rc-slider-root"
86
+ data-display=${this.display ?? o}
87
+ data-orientation=${this.orientation}
88
+ data-readonly=${this.readonly ? "" : o}
89
+ data-disabled=${this.disabled ? "" : o}
90
+ data-has-value-text=${this.valueText ? "" : o}
91
+ >
92
+ ${this.display === "inline-start" ? e : o}
93
+
94
+ <span part="control" class="rc-slider-control">
95
+ <span part="track" class="rc-slider-track" aria-hidden="true">
96
+ <slot name="track-background"></slot>
97
+ <span
98
+ part="progress"
99
+ class="rc-slider-progress"
100
+ style=${this._progressStyle()}
101
+ ></span>
102
+ </span>
103
+
104
+ <slot @slotchange=${this._onDefaultSlotChange}></slot>
105
+ ${this.display === "float" ? e : o}
106
+ </span>
107
+
108
+ ${this.display === "inline-end" ? e : o}
109
+ </div>
110
+ `;
111
+ }
112
+ get _displayText() {
113
+ return this.valueText || String(this.value);
114
+ }
115
+ get _nativeInputValue() {
116
+ const t = this._nativeInput?.valueAsNumber;
117
+ return t === void 0 || isNaN(t) ? 0 : t;
118
+ }
119
+ /**
120
+ * Finds the consumer-provided native input and wires event listeners.
121
+ * The input remains in the DOM permanently; the component enhances it
122
+ * rather than replacing it.
123
+ */
124
+ _findInput() {
125
+ const t = this.querySelector('input[type="range"]');
126
+ if (!t) {
127
+ console.warn(
128
+ '[rc-slider] Requires a child <input type="range"> element.'
129
+ );
130
+ return;
131
+ }
132
+ !this.hasAttribute("disabled") && t.disabled && (this.disabled = !0), this._nativeInput = t, this._applyInitialValueToInput(t), this._wireInput(t);
133
+ }
134
+ _applyInitialValueToInput(t) {
135
+ if (this._value !== void 0) {
136
+ this._applyValueToInput(this._value);
137
+ return;
138
+ }
139
+ if (this._defaultValue !== void 0) {
140
+ this._applyValueToInput(this._defaultValue);
141
+ return;
142
+ }
143
+ const e = t.valueAsNumber;
144
+ isNaN(e) || (this._defaultValue = e);
145
+ }
146
+ _applyValueToInput(t) {
147
+ this._nativeInput && (this._nativeInput.value = String(t));
148
+ }
149
+ _wireInput(t) {
150
+ t.addEventListener("input", this._onInput), t.addEventListener("change", this._onChange), t.addEventListener("keydown", this._onKeydown);
151
+ }
152
+ _unwireInput() {
153
+ this._nativeInput?.removeEventListener("input", this._onInput), this._nativeInput?.removeEventListener("change", this._onChange), this._nativeInput?.removeEventListener("keydown", this._onKeydown);
154
+ }
155
+ _syncAriaAttributes(t) {
156
+ this.valueText ? t.setAttribute("aria-valuetext", this.valueText) : t.removeAttribute("aria-valuetext"), this.orientation === "vertical" ? t.setAttribute("aria-orientation", "vertical") : t.removeAttribute("aria-orientation"), this.readonly ? t.setAttribute("aria-readonly", "true") : t.removeAttribute("aria-readonly");
157
+ }
158
+ _handleRangeEvent(t, e) {
159
+ const n = t.currentTarget;
160
+ if (this.readonly) {
161
+ n.value = String(this.value);
162
+ return;
163
+ }
164
+ this._commitInputValue(n), this.dispatchEvent(
165
+ new CustomEvent(e, {
166
+ bubbles: !0,
167
+ composed: !0,
168
+ detail: { value: this.value }
169
+ })
170
+ );
171
+ }
172
+ _commitInputValue(t) {
173
+ const e = this.value;
174
+ this._value = t.valueAsNumber, this._valueInitialized = !0, this.requestUpdate("value", e);
175
+ }
176
+ _progressStyle() {
177
+ const t = this._nativeInput;
178
+ if (!t) return "";
179
+ const e = d(t.min, 0), n = d(t.max, 100), i = v(t.valueAsNumber, e, n) * 100;
180
+ return this.orientation === "vertical" ? `bottom:0%;height:${i.toFixed(3)}%` : `left:0%;width:${i.toFixed(3)}%`;
181
+ }
182
+ _floatStyle() {
183
+ const t = this._nativeInput;
184
+ if (!t) return "";
185
+ const e = d(t.min, 0), n = d(t.max, 100), i = v(t.valueAsNumber, e, n), u = (1 - i * 2).toFixed(4);
186
+ return this.orientation === "vertical" ? `bottom:calc(${(i * 100).toFixed(3)}% + ${u} * var(--rc-thumb-radius, 9px))` : `left:calc(${(i * 100).toFixed(3)}% + ${u} * var(--rc-thumb-radius, 9px))`;
187
+ }
188
+ };
189
+ p.styles = m`
190
+ :host {
191
+ display: block;
192
+ }
193
+
194
+ .rc-slider-root {
195
+ display: grid;
196
+ gap: var(--rc-slider-gap, var(--rc-control-gap, 0.5rem));
197
+ align-items: center;
198
+ font-family: var(--rc-font-family, inherit);
199
+ font-size: var(--rc-font-size, inherit);
200
+ line-height: var(--rc-line-height, normal);
201
+ }
202
+
203
+ .rc-slider-root[data-display="inline-start"] {
204
+ grid-template-columns: auto minmax(0, 1fr);
205
+ }
206
+
207
+ .rc-slider-root[data-display="inline-end"] {
208
+ grid-template-columns: minmax(0, 1fr) auto;
209
+ }
210
+
211
+ .rc-slider-control {
212
+ position: relative;
213
+ display: block;
214
+ min-width: 0;
215
+ min-height: var(--rc-slider-control-size, var(--rc-control-block-size, 1.5rem));
216
+ }
217
+
218
+ .rc-slider-track,
219
+ .rc-slider-progress {
220
+ position: absolute;
221
+ pointer-events: none;
222
+ }
223
+
224
+ .rc-slider-track {
225
+ inset-inline: 0;
226
+ inset-block: calc(50% - var(--rc-slider-track-size, 0.1875rem) / 2);
227
+ block-size: var(--rc-slider-track-size, 0.1875rem);
228
+ background: var(--rc-slider-track-background, CanvasText);
229
+ opacity: var(--rc-slider-track-opacity, 0.25);
230
+ border-radius: var(--rc-slider-track-radius, var(--rc-control-radius, 0));
231
+ overflow: hidden;
232
+ z-index: 0;
233
+ }
234
+
235
+ ::slotted([slot="track-background"]) {
236
+ position: absolute;
237
+ inset: 0;
238
+ pointer-events: none;
239
+ }
240
+
241
+ .rc-slider-progress {
242
+ inset-block: 0;
243
+ background: var(--rc-slider-progress-background, var(--rc-accent, Highlight));
244
+ border-radius: inherit;
245
+ z-index: 1;
246
+ }
247
+
248
+ ::slotted(input[type="range"]) {
249
+ position: absolute;
250
+ inset: 0;
251
+ inline-size: 100%;
252
+ block-size: 100%;
253
+ margin: 0;
254
+ background: transparent;
255
+ z-index: 2;
256
+ }
257
+
258
+ .rc-slider-value {
259
+ font-variant-numeric: tabular-nums;
260
+ white-space: nowrap;
261
+ color: var(--rc-slider-value-color, var(--rc-text-disabled, GrayText));
262
+ }
263
+
264
+ .rc-slider-root[data-display="float"] .rc-slider-value {
265
+ position: absolute;
266
+ inset-block-start: var(--rc-slider-float-value-block-offset, -1.4em);
267
+ transform: translateX(-50%);
268
+ pointer-events: none;
269
+ z-index: 3;
270
+ }
271
+
272
+ :host([orientation="vertical"]) {
273
+ display: inline-block;
274
+ }
275
+
276
+ :host([orientation="vertical"]) .rc-slider-control {
277
+ inline-size: var(--rc-slider-control-size, var(--rc-control-block-size, 1.5rem));
278
+ block-size: var(--rc-slider-vertical-size, 12.5rem);
279
+ }
280
+
281
+ :host([orientation="vertical"]) .rc-slider-track {
282
+ inset-block: 0;
283
+ inset-inline: calc(50% - var(--rc-slider-track-size, 0.1875rem) / 2);
284
+ inline-size: var(--rc-slider-track-size, 0.1875rem);
285
+ block-size: auto;
286
+ }
287
+
288
+ :host([orientation="vertical"]) .rc-slider-progress {
289
+ inset-inline: 0;
290
+ }
291
+
292
+ :host([orientation="vertical"]) ::slotted(input[type="range"]) {
293
+ writing-mode: vertical-lr;
294
+ direction: rtl;
295
+ }
296
+
297
+ :host([orientation="vertical"]) .rc-slider-root[data-display="float"] .rc-slider-value {
298
+ inset-block-start: auto;
299
+ inset-inline-start: var(--rc-slider-float-value-inline-offset, calc(100% + 0.5rem));
300
+ transform: translateY(50%);
301
+ }
302
+ `;
303
+ let a = p;
304
+ l([
305
+ s({ type: Number })
306
+ ], a.prototype, "min", 2);
307
+ l([
308
+ s({ type: Number })
309
+ ], a.prototype, "max", 2);
310
+ l([
311
+ s({ type: Number })
312
+ ], a.prototype, "step", 2);
313
+ l([
314
+ s({ type: Number })
315
+ ], a.prototype, "value", 1);
316
+ l([
317
+ s({ type: Number, attribute: "default-value" })
318
+ ], a.prototype, "defaultValue", 1);
319
+ l([
320
+ s({ type: Boolean, reflect: !0 })
321
+ ], a.prototype, "disabled", 2);
322
+ l([
323
+ s({ type: Boolean, reflect: !0 })
324
+ ], a.prototype, "readonly", 2);
325
+ l([
326
+ s({ reflect: !0, converter: g })
327
+ ], a.prototype, "display", 2);
328
+ l([
329
+ s({ attribute: "value-text" })
330
+ ], a.prototype, "valueText", 2);
331
+ l([
332
+ s({ reflect: !0 })
333
+ ], a.prototype, "orientation", 2);
334
+ export {
335
+ a as R
336
+ };
337
+ //# sourceMappingURL=rc-slider-DOhtdJxO.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rc-slider-DOhtdJxO.js","sources":["../src/rc-slider.ts"],"sourcesContent":["import { LitElement, css, html, nothing } from \"lit\";\nimport type { ComplexAttributeConverter } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\nimport { valueToPercent } from \"@rcarls/rc-common\";\n\nexport interface RCSliderValueEvent {\n /** Current numeric slider value. */\n value: number;\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"rc-slider\": RCSlider;\n }\n\n interface HTMLElementEventMap {\n \"rc-slider-input\": CustomEvent<RCSliderValueEvent>;\n \"rc-slider-change\": CustomEvent<RCSliderValueEvent>;\n }\n}\n\ntype DisplayValue = \"float\" | \"inline-start\" | \"inline-end\" | null;\n\n/**\n * Normalises the `display` attribute.\n * A bare boolean attribute (`display` with no value) maps to `'float'` so\n * the reflected attribute is always an explicit string, never an empty string.\n */\nconst displayConverter: ComplexAttributeConverter<DisplayValue> = {\n fromAttribute(v: string | null): DisplayValue {\n if (v === null) return null;\n if (v === \"\" || v === \"float\") return \"float\";\n if (v === \"inline-start\") return \"inline-start\";\n if (v === \"inline-end\") return \"inline-end\";\n return null;\n },\n toAttribute(v: DisplayValue): string | null {\n return v;\n },\n};\n\n/**\n * Returns the numeric value of a range input's `min`, `max`, or `step`\n * attribute string, falling back to `defaultVal` when the attribute is absent\n * (empty string) or not a valid number.\n */\nfunction parseAttr(s: string, defaultVal: number): number {\n if (s === \"\") return defaultVal;\n const n = parseFloat(s);\n return isNaN(n) ? defaultVal : n;\n}\n\n/**\n * Progressive enhancement wrapper for a consumer-provided `<input type=\"range\">`.\n * The native input must be supplied as a direct child element — the component\n * adds a styled track, optional live value display, and the APG keyboard\n * enhancement (Page Up/Down, ±10 steps).\n *\n * Label association:\n * - Explicit `for`/`id`: `<label for=\"vol\">Volume</label><rc-slider><input id=\"vol\" …></rc-slider>`\n * - Direct `aria-label` on the input: `<input aria-label=\"Volume\" …>`\n *\n * These patterns all work without JavaScript. The component does not render a\n * label element itself — the consumer is responsible for accessible naming.\n *\n * Form participation is handled natively by the consumer-provided input's `name`\n * attribute; no `ElementInternals` setup is required.\n *\n * @slot track-background - Optional decorative content rendered inside the track before the progress fill.\n * @slot value-display - Optional replacement for the rendered value text.\n *\n * @fires rc-slider-input - Fires continuously while the value changes. Detail: `{ value }`.\n * @fires rc-slider-change - Fires when the committed value changes (on release). Detail: `{ value }`.\n *\n * @cssprop [--rc-thumb-radius=9px] - Half the thumb width; used to position the float value display.\n * @cssprop [--rc-slider-gap=var(--rc-control-gap)] - Gap between track and inline value display.\n * @cssprop [--rc-slider-control-size=var(--rc-control-block-size)] - Track hit-area block size.\n * @cssprop [--rc-slider-track-size=0.1875rem] - Visual track thickness.\n * @cssprop [--rc-slider-track-background=CanvasText] - Unfilled track color.\n * @cssprop [--rc-slider-track-opacity=0.25] - Unfilled track opacity.\n * @cssprop [--rc-slider-track-radius=var(--rc-control-radius)] - Track border radius.\n * @cssprop [--rc-slider-progress-background=var(--rc-accent)] - Filled track color.\n * @cssprop [--rc-slider-value-color=var(--rc-text-disabled)] - Value display text color.\n * @cssprop [--rc-slider-float-value-block-offset=-1.4em] - Block-axis offset for horizontal float value display.\n * @cssprop [--rc-slider-float-value-inline-offset=calc(100% + 0.5rem)] - Inline-axis offset for vertical float value display.\n *\n * @csspart root - Root layout wrapper.\n * @csspart control - Track/input positioning wrapper.\n * @csspart track - Visual slider track.\n * @csspart progress - Filled progress segment.\n * @csspart value-display - Rendered value text.\n */\nexport class RCSlider extends LitElement {\n static override styles = css`\n :host {\n display: block;\n }\n\n .rc-slider-root {\n display: grid;\n gap: var(--rc-slider-gap, var(--rc-control-gap, 0.5rem));\n align-items: center;\n font-family: var(--rc-font-family, inherit);\n font-size: var(--rc-font-size, inherit);\n line-height: var(--rc-line-height, normal);\n }\n\n .rc-slider-root[data-display=\"inline-start\"] {\n grid-template-columns: auto minmax(0, 1fr);\n }\n\n .rc-slider-root[data-display=\"inline-end\"] {\n grid-template-columns: minmax(0, 1fr) auto;\n }\n\n .rc-slider-control {\n position: relative;\n display: block;\n min-width: 0;\n min-height: var(--rc-slider-control-size, var(--rc-control-block-size, 1.5rem));\n }\n\n .rc-slider-track,\n .rc-slider-progress {\n position: absolute;\n pointer-events: none;\n }\n\n .rc-slider-track {\n inset-inline: 0;\n inset-block: calc(50% - var(--rc-slider-track-size, 0.1875rem) / 2);\n block-size: var(--rc-slider-track-size, 0.1875rem);\n background: var(--rc-slider-track-background, CanvasText);\n opacity: var(--rc-slider-track-opacity, 0.25);\n border-radius: var(--rc-slider-track-radius, var(--rc-control-radius, 0));\n overflow: hidden;\n z-index: 0;\n }\n\n ::slotted([slot=\"track-background\"]) {\n position: absolute;\n inset: 0;\n pointer-events: none;\n }\n\n .rc-slider-progress {\n inset-block: 0;\n background: var(--rc-slider-progress-background, var(--rc-accent, Highlight));\n border-radius: inherit;\n z-index: 1;\n }\n\n ::slotted(input[type=\"range\"]) {\n position: absolute;\n inset: 0;\n inline-size: 100%;\n block-size: 100%;\n margin: 0;\n background: transparent;\n z-index: 2;\n }\n\n .rc-slider-value {\n font-variant-numeric: tabular-nums;\n white-space: nowrap;\n color: var(--rc-slider-value-color, var(--rc-text-disabled, GrayText));\n }\n\n .rc-slider-root[data-display=\"float\"] .rc-slider-value {\n position: absolute;\n inset-block-start: var(--rc-slider-float-value-block-offset, -1.4em);\n transform: translateX(-50%);\n pointer-events: none;\n z-index: 3;\n }\n\n :host([orientation=\"vertical\"]) {\n display: inline-block;\n }\n\n :host([orientation=\"vertical\"]) .rc-slider-control {\n inline-size: var(--rc-slider-control-size, var(--rc-control-block-size, 1.5rem));\n block-size: var(--rc-slider-vertical-size, 12.5rem);\n }\n\n :host([orientation=\"vertical\"]) .rc-slider-track {\n inset-block: 0;\n inset-inline: calc(50% - var(--rc-slider-track-size, 0.1875rem) / 2);\n inline-size: var(--rc-slider-track-size, 0.1875rem);\n block-size: auto;\n }\n\n :host([orientation=\"vertical\"]) .rc-slider-progress {\n inset-inline: 0;\n }\n\n :host([orientation=\"vertical\"]) ::slotted(input[type=\"range\"]) {\n writing-mode: vertical-lr;\n direction: rtl;\n }\n\n :host([orientation=\"vertical\"]) .rc-slider-root[data-display=\"float\"] .rc-slider-value {\n inset-block-start: auto;\n inset-inline-start: var(--rc-slider-float-value-inline-offset, calc(100% + 0.5rem));\n transform: translateY(50%);\n }\n `;\n\n /** Minimum slider value. */\n @property({ type: Number }) min = 0;\n\n /** Maximum slider value. */\n @property({ type: Number }) max = 100;\n\n /** Slider step. */\n @property({ type: Number }) step = 1;\n\n private _value: number | undefined;\n private _defaultValue: number | undefined;\n private _valueInitialized = false;\n\n /** Current slider value. */\n @property({ type: Number })\n get value(): number {\n return this._value ?? this._defaultValue ?? this._nativeInputValue;\n }\n set value(v: number) {\n const old = this._value;\n this._value = v;\n this._valueInitialized = true;\n this._applyValueToInput(v);\n this.requestUpdate(\"value\", old);\n }\n\n /** Initial uncontrolled slider value. Has no effect after the first user interaction or `value` write. */\n @property({ type: Number, attribute: \"default-value\" })\n get defaultValue(): number | undefined {\n return this._defaultValue;\n }\n set defaultValue(v: number | undefined) {\n const old = this._defaultValue;\n this._defaultValue = v;\n if (\n !this._valueInitialized &&\n this._value === undefined &&\n v !== undefined\n ) {\n this._applyValueToInput(v);\n this.requestUpdate(\"value\", undefined);\n }\n this.requestUpdate(\"defaultValue\", old);\n }\n\n /** Disable the underlying input. */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n /** Prevents edits while preserving normal display. Not a native range attribute. */\n @property({ type: Boolean, reflect: true }) readonly = false;\n\n /**\n * Controls the live value display.\n *\n * - Absent (default) — no value shown.\n * - `display` or `display=\"float\"` — floats above the thumb.\n * - `display=\"inline-start\"` — rendered before the track, inline in the grid.\n * - `display=\"inline-end\"` — rendered after the track, inline in the grid.\n */\n @property({ reflect: true, converter: displayConverter })\n display: DisplayValue = null;\n\n /** Screen-reader value text. When set, forwarded as `aria-valuetext` on the native input. */\n @property({ attribute: \"value-text\" }) valueText = \"\";\n\n /** Orientation; reflected as an attribute and forwarded to `aria-orientation`. */\n @property({ reflect: true }) orientation: \"horizontal\" | \"vertical\" =\n \"horizontal\";\n\n private _nativeInput: HTMLInputElement | null = null;\n\n override connectedCallback(): void {\n this._findInput();\n super.connectedCallback();\n }\n\n override disconnectedCallback(): void {\n this._unwireInput();\n super.disconnectedCallback();\n }\n\n override updated(): void {\n const input = this._nativeInput;\n if (!input) return;\n\n input.disabled = this.disabled;\n this._syncAriaAttributes(input);\n }\n\n override render() {\n const input = this._nativeInput;\n if (!input) return nothing;\n\n const valueDisplay = html`\n <span\n part=\"value-display\"\n class=\"rc-slider-value\"\n style=${ifDefined(\n this.display === \"float\" ? this._floatStyle() : undefined,\n )}\n aria-hidden=\"true\"\n >\n <slot name=\"value-display\">${this._displayText}</slot>\n </span>\n `;\n\n return html`\n <div\n part=\"root\"\n class=\"rc-slider-root\"\n data-display=${this.display ?? nothing}\n data-orientation=${this.orientation}\n data-readonly=${this.readonly ? \"\" : nothing}\n data-disabled=${this.disabled ? \"\" : nothing}\n data-has-value-text=${this.valueText ? \"\" : nothing}\n >\n ${this.display === \"inline-start\" ? valueDisplay : nothing}\n\n <span part=\"control\" class=\"rc-slider-control\">\n <span part=\"track\" class=\"rc-slider-track\" aria-hidden=\"true\">\n <slot name=\"track-background\"></slot>\n <span\n part=\"progress\"\n class=\"rc-slider-progress\"\n style=${this._progressStyle()}\n ></span>\n </span>\n\n <slot @slotchange=${this._onDefaultSlotChange}></slot>\n ${this.display === \"float\" ? valueDisplay : nothing}\n </span>\n\n ${this.display === \"inline-end\" ? valueDisplay : nothing}\n </div>\n `;\n }\n\n private get _displayText(): string {\n return this.valueText || String(this.value);\n }\n\n private get _nativeInputValue(): number {\n const value = this._nativeInput?.valueAsNumber;\n return value === undefined || isNaN(value) ? 0 : value;\n }\n\n /**\n * Finds the consumer-provided native input and wires event listeners.\n * The input remains in the DOM permanently; the component enhances it\n * rather than replacing it.\n */\n private _findInput(): void {\n const input = this.querySelector<HTMLInputElement>('input[type=\"range\"]');\n if (!input) {\n console.warn(\n '[rc-slider] Requires a child <input type=\"range\"> element.',\n );\n return;\n }\n\n // Mirror disabled state from the native input if not explicitly set on the host.\n // Pre-upgrade markup may carry <input disabled> before the component upgrades.\n if (!this.hasAttribute(\"disabled\") && input.disabled) {\n this.disabled = true;\n }\n\n this._nativeInput = input;\n this._applyInitialValueToInput(input);\n this._wireInput(input);\n }\n\n private _onDefaultSlotChange = (): void => {\n this._unwireInput();\n this._findInput();\n this.requestUpdate();\n };\n\n private _applyInitialValueToInput(input: HTMLInputElement): void {\n if (this._value !== undefined) {\n this._applyValueToInput(this._value);\n return;\n }\n\n if (this._defaultValue !== undefined) {\n this._applyValueToInput(this._defaultValue);\n return;\n }\n\n const value = input.valueAsNumber;\n if (!isNaN(value)) {\n this._defaultValue = value;\n }\n }\n\n private _applyValueToInput(value: number): void {\n if (!this._nativeInput) return;\n\n this._nativeInput.value = String(value);\n }\n\n private _wireInput(input: HTMLInputElement): void {\n input.addEventListener(\"input\", this._onInput);\n input.addEventListener(\"change\", this._onChange);\n input.addEventListener(\"keydown\", this._onKeydown);\n }\n\n private _unwireInput(): void {\n this._nativeInput?.removeEventListener(\"input\", this._onInput);\n this._nativeInput?.removeEventListener(\"change\", this._onChange);\n this._nativeInput?.removeEventListener(\"keydown\", this._onKeydown);\n }\n\n private _syncAriaAttributes(input: HTMLInputElement): void {\n if (this.valueText) {\n input.setAttribute(\"aria-valuetext\", this.valueText);\n } else {\n input.removeAttribute(\"aria-valuetext\");\n }\n\n if (this.orientation === \"vertical\") {\n input.setAttribute(\"aria-orientation\", \"vertical\");\n } else {\n input.removeAttribute(\"aria-orientation\");\n }\n\n if (this.readonly) {\n input.setAttribute(\"aria-readonly\", \"true\");\n } else {\n input.removeAttribute(\"aria-readonly\");\n }\n }\n\n private readonly _onInput = (e: Event): void => {\n this._handleRangeEvent(e, \"rc-slider-input\");\n };\n\n private readonly _onChange = (e: Event): void => {\n this._handleRangeEvent(e, \"rc-slider-change\");\n };\n\n private _handleRangeEvent(\n e: Event,\n type: \"rc-slider-input\" | \"rc-slider-change\",\n ): void {\n const input = e.currentTarget as HTMLInputElement;\n\n if (this.readonly) {\n input.value = String(this.value);\n return;\n }\n\n this._commitInputValue(input);\n\n this.dispatchEvent(\n new CustomEvent<RCSliderValueEvent>(type, {\n bubbles: true,\n composed: true,\n detail: { value: this.value },\n }),\n );\n }\n\n private readonly _onKeydown = (e: KeyboardEvent): void => {\n if (this.disabled || this.readonly) return;\n if (e.key !== \"PageUp\" && e.key !== \"PageDown\") return;\n\n e.preventDefault();\n const input = e.currentTarget as HTMLInputElement;\n\n if (e.key === \"PageUp\") input.stepUp(10);\n else input.stepDown(10);\n\n this._commitInputValue(input);\n\n this.dispatchEvent(\n new CustomEvent<RCSliderValueEvent>(\"rc-slider-input\", {\n bubbles: true,\n composed: true,\n detail: { value: this.value },\n }),\n );\n };\n\n private _commitInputValue(input: HTMLInputElement): void {\n const old = this.value;\n\n this._value = input.valueAsNumber;\n this._valueInitialized = true;\n\n this.requestUpdate(\"value\", old);\n }\n\n private _progressStyle(): string {\n const input = this._nativeInput;\n if (!input) return \"\";\n\n const min = parseAttr(input.min, 0);\n const max = parseAttr(input.max, 100);\n const pct = valueToPercent(input.valueAsNumber, min, max) * 100;\n\n if (this.orientation === \"vertical\") {\n return `bottom:0%;height:${pct.toFixed(3)}%`;\n }\n\n return `left:0%;width:${pct.toFixed(3)}%`;\n }\n\n private _floatStyle(): string {\n const input = this._nativeInput;\n if (!input) return \"\";\n\n const min = parseAttr(input.min, 0);\n const max = parseAttr(input.max, 100);\n const pct = valueToPercent(input.valueAsNumber, min, max);\n const k = (1 - pct * 2).toFixed(4);\n\n if (this.orientation === \"vertical\") {\n return `bottom:calc(${(pct * 100).toFixed(3)}% + ${k} * var(--rc-thumb-radius, 9px))`;\n }\n\n return `left:calc(${(pct * 100).toFixed(3)}% + ${k} * var(--rc-thumb-radius, 9px))`;\n }\n}\n\nexport default RCSlider;\n"],"names":["displayConverter","v","parseAttr","s","defaultVal","n","_RCSlider","LitElement","e","input","old","nothing","valueDisplay","html","ifDefined","value","type","min","max","pct","valueToPercent","k","css","RCSlider","__decorateClass","property"],"mappings":";;;;;;;;;AA6BA,MAAMA,IAA4D;AAAA,EAChE,cAAcC,GAAgC;AAC5C,WAAIA,MAAM,OAAa,OACnBA,MAAM,MAAMA,MAAM,UAAgB,UAClCA,MAAM,iBAAuB,iBAC7BA,MAAM,eAAqB,eACxB;AAAA,EACT;AAAA,EACA,YAAYA,GAAgC;AAC1C,WAAOA;AAAA,EACT;AACF;AAOA,SAASC,EAAUC,GAAWC,GAA4B;AACxD,MAAID,MAAM,GAAI,QAAOC;AACrB,QAAMC,IAAI,WAAWF,CAAC;AACtB,SAAO,MAAME,CAAC,IAAID,IAAaC;AACj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S,EAAE,MAAM,OAAA,CAAQ;AAAA,GAxHfF,EAwHiB,WAAA,OAAA,CAAA;AAGAC,EAAA;AAAA,EAA3BC,EAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GA3HfF,EA2HiB,WAAA,QAAA,CAAA;AAQxBC,EAAA;AAAA,EADHC,EAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GAlIfF,EAmIP,WAAA,SAAA,CAAA;AAaAC,EAAA;AAAA,EADHC,EAAS,EAAE,MAAM,QAAQ,WAAW,iBAAiB;AAAA,GA/I3CF,EAgJP,WAAA,gBAAA,CAAA;AAkBwCC,EAAA;AAAA,EAA3CC,EAAS,EAAE,MAAM,SAAS,SAAS,IAAM;AAAA,GAlK/BF,EAkKiC,WAAA,YAAA,CAAA;AAGAC,EAAA;AAAA,EAA3CC,EAAS,EAAE,MAAM,SAAS,SAAS,IAAM;AAAA,GArK/BF,EAqKiC,WAAA,YAAA,CAAA;AAW5CC,EAAA;AAAA,EADCC,EAAS,EAAE,SAAS,IAAM,WAAWzB,GAAkB;AAAA,GA/K7CuB,EAgLX,WAAA,WAAA,CAAA;AAGuCC,EAAA;AAAA,EAAtCC,EAAS,EAAE,WAAW,aAAA,CAAc;AAAA,GAnL1BF,EAmL4B,WAAA,aAAA,CAAA;AAGVC,EAAA;AAAA,EAA5BC,EAAS,EAAE,SAAS,GAAA,CAAM;AAAA,GAtLhBF,EAsLkB,WAAA,eAAA,CAAA;"}
@@ -0,0 +1,6 @@
1
+ import { R as e } from "./rc-slider-DOhtdJxO.js";
2
+ customElements.get("rc-slider") || customElements.define("rc-slider", e);
3
+ export {
4
+ e as RCSlider
5
+ };
6
+ //# sourceMappingURL=rc-slider-define.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rc-slider-define.js","sources":["../src/define.ts"],"sourcesContent":["import { RCSlider } from './index.js';\n\ncustomElements.get('rc-slider') || customElements.define('rc-slider', RCSlider);\n\nexport * from './index.js';\n"],"names":["RCSlider"],"mappings":";AAEA,eAAe,IAAI,WAAW,KAAK,eAAe,OAAO,aAAaA,CAAQ;"}
@@ -0,0 +1,5 @@
1
+ import { R as o } from "./rc-slider-DOhtdJxO.js";
2
+ export {
3
+ o as RCSlider
4
+ };
5
+ //# sourceMappingURL=rc-slider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rc-slider.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -0,0 +1 @@
1
+ export * from './index.js';
@@ -0,0 +1 @@
1
+ export * from './rc-slider.js';
@@ -0,0 +1,117 @@
1
+ import { LitElement, nothing } from 'lit';
2
+ export interface RCSliderValueEvent {
3
+ /** Current numeric slider value. */
4
+ value: number;
5
+ }
6
+ declare global {
7
+ interface HTMLElementTagNameMap {
8
+ "rc-slider": RCSlider;
9
+ }
10
+ interface HTMLElementEventMap {
11
+ "rc-slider-input": CustomEvent<RCSliderValueEvent>;
12
+ "rc-slider-change": CustomEvent<RCSliderValueEvent>;
13
+ }
14
+ }
15
+ type DisplayValue = "float" | "inline-start" | "inline-end" | null;
16
+ /**
17
+ * Progressive enhancement wrapper for a consumer-provided `<input type="range">`.
18
+ * The native input must be supplied as a direct child element — the component
19
+ * adds a styled track, optional live value display, and the APG keyboard
20
+ * enhancement (Page Up/Down, ±10 steps).
21
+ *
22
+ * Label association:
23
+ * - Explicit `for`/`id`: `<label for="vol">Volume</label><rc-slider><input id="vol" …></rc-slider>`
24
+ * - Direct `aria-label` on the input: `<input aria-label="Volume" …>`
25
+ *
26
+ * These patterns all work without JavaScript. The component does not render a
27
+ * label element itself — the consumer is responsible for accessible naming.
28
+ *
29
+ * Form participation is handled natively by the consumer-provided input's `name`
30
+ * attribute; no `ElementInternals` setup is required.
31
+ *
32
+ * @slot track-background - Optional decorative content rendered inside the track before the progress fill.
33
+ * @slot value-display - Optional replacement for the rendered value text.
34
+ *
35
+ * @fires rc-slider-input - Fires continuously while the value changes. Detail: `{ value }`.
36
+ * @fires rc-slider-change - Fires when the committed value changes (on release). Detail: `{ value }`.
37
+ *
38
+ * @cssprop [--rc-thumb-radius=9px] - Half the thumb width; used to position the float value display.
39
+ * @cssprop [--rc-slider-gap=var(--rc-control-gap)] - Gap between track and inline value display.
40
+ * @cssprop [--rc-slider-control-size=var(--rc-control-block-size)] - Track hit-area block size.
41
+ * @cssprop [--rc-slider-track-size=0.1875rem] - Visual track thickness.
42
+ * @cssprop [--rc-slider-track-background=CanvasText] - Unfilled track color.
43
+ * @cssprop [--rc-slider-track-opacity=0.25] - Unfilled track opacity.
44
+ * @cssprop [--rc-slider-track-radius=var(--rc-control-radius)] - Track border radius.
45
+ * @cssprop [--rc-slider-progress-background=var(--rc-accent)] - Filled track color.
46
+ * @cssprop [--rc-slider-value-color=var(--rc-text-disabled)] - Value display text color.
47
+ * @cssprop [--rc-slider-float-value-block-offset=-1.4em] - Block-axis offset for horizontal float value display.
48
+ * @cssprop [--rc-slider-float-value-inline-offset=calc(100% + 0.5rem)] - Inline-axis offset for vertical float value display.
49
+ *
50
+ * @csspart root - Root layout wrapper.
51
+ * @csspart control - Track/input positioning wrapper.
52
+ * @csspart track - Visual slider track.
53
+ * @csspart progress - Filled progress segment.
54
+ * @csspart value-display - Rendered value text.
55
+ */
56
+ export declare class RCSlider extends LitElement {
57
+ static styles: import('lit').CSSResult;
58
+ /** Minimum slider value. */
59
+ min: number;
60
+ /** Maximum slider value. */
61
+ max: number;
62
+ /** Slider step. */
63
+ step: number;
64
+ private _value;
65
+ private _defaultValue;
66
+ private _valueInitialized;
67
+ /** Current slider value. */
68
+ get value(): number;
69
+ set value(v: number);
70
+ /** Initial uncontrolled slider value. Has no effect after the first user interaction or `value` write. */
71
+ get defaultValue(): number | undefined;
72
+ set defaultValue(v: number | undefined);
73
+ /** Disable the underlying input. */
74
+ disabled: boolean;
75
+ /** Prevents edits while preserving normal display. Not a native range attribute. */
76
+ readonly: boolean;
77
+ /**
78
+ * Controls the live value display.
79
+ *
80
+ * - Absent (default) — no value shown.
81
+ * - `display` or `display="float"` — floats above the thumb.
82
+ * - `display="inline-start"` — rendered before the track, inline in the grid.
83
+ * - `display="inline-end"` — rendered after the track, inline in the grid.
84
+ */
85
+ display: DisplayValue;
86
+ /** Screen-reader value text. When set, forwarded as `aria-valuetext` on the native input. */
87
+ valueText: string;
88
+ /** Orientation; reflected as an attribute and forwarded to `aria-orientation`. */
89
+ orientation: "horizontal" | "vertical";
90
+ private _nativeInput;
91
+ connectedCallback(): void;
92
+ disconnectedCallback(): void;
93
+ updated(): void;
94
+ render(): typeof nothing | import('lit').TemplateResult<1>;
95
+ private get _displayText();
96
+ private get _nativeInputValue();
97
+ /**
98
+ * Finds the consumer-provided native input and wires event listeners.
99
+ * The input remains in the DOM permanently; the component enhances it
100
+ * rather than replacing it.
101
+ */
102
+ private _findInput;
103
+ private _onDefaultSlotChange;
104
+ private _applyInitialValueToInput;
105
+ private _applyValueToInput;
106
+ private _wireInput;
107
+ private _unwireInput;
108
+ private _syncAriaAttributes;
109
+ private readonly _onInput;
110
+ private readonly _onChange;
111
+ private _handleRangeEvent;
112
+ private readonly _onKeydown;
113
+ private _commitInputValue;
114
+ private _progressStyle;
115
+ private _floatStyle;
116
+ }
117
+ export default RCSlider;