@fluentui/react-slider 9.75.1-experimental.positioning-engine.20261103-19efe125d1.0 → 9.75.2-experimental.css-modules.20261113-ba13c87438.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/CHANGELOG.md +11 -11
- package/README.md +8 -2
- package/lib/components/Slider/Slider.module.css +313 -0
- package/lib/components/Slider/useSlider.js +4 -1
- package/lib/components/Slider/useSlider.js.map +1 -1
- package/lib/components/Slider/useSliderStyles.styles.css.js +16 -0
- package/lib/components/Slider/useSliderStyles.styles.css.js.map +1 -0
- package/lib/components/Slider/useSliderStyles.styles.raw.css.js +16 -0
- package/lib/components/Slider/useSliderStyles.styles.raw.css.js.map +1 -0
- package/lib-commonjs/components/Slider/Slider.module.css +313 -0
- package/lib-commonjs/components/Slider/useSlider.cjs +4 -1
- package/lib-commonjs/components/Slider/useSlider.cjs.map +1 -1
- package/lib-commonjs/components/Slider/useSliderStyles.styles.css.cjs +35 -0
- package/lib-commonjs/components/Slider/useSliderStyles.styles.css.cjs.map +1 -0
- package/lib-commonjs/components/Slider/useSliderStyles.styles.raw.css.cjs +35 -0
- package/lib-commonjs/components/Slider/useSliderStyles.styles.raw.css.cjs.map +1 -0
- package/package.json +12 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
# Change Log - @fluentui/react-slider
|
|
2
2
|
|
|
3
|
-
<!-- This log was last generated on
|
|
3
|
+
<!-- This log was last generated on Fri, 13 Nov 2026 20:36:58 GMT and should not be manually modified. -->
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
-
## [9.75.
|
|
7
|
+
## [9.75.2-experimental.css-modules.20261113-ba13c87438.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-slider_v9.75.2-experimental.css-modules.20261113-ba13c87438.0)
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-slider_v9.6.8..@fluentui/react-slider_v9.75.
|
|
9
|
+
Fri, 13 Nov 2026 20:36:58 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-slider_v9.6.8..@fluentui/react-slider_v9.75.2-experimental.css-modules.20261113-ba13c87438.0)
|
|
11
11
|
|
|
12
12
|
### Changes
|
|
13
13
|
|
|
14
|
-
- Release 9.75.
|
|
15
|
-
- Bump @fluentui/react-field to v9.75.
|
|
16
|
-
- Bump @fluentui/react-jsx-runtime to v9.75.
|
|
17
|
-
- Bump @fluentui/react-shared-contexts to v9.75.
|
|
18
|
-
- Bump @fluentui/react-tabster to v9.75.
|
|
19
|
-
- Bump @fluentui/react-theme to v9.75.
|
|
20
|
-
- Bump @fluentui/react-utilities to v9.75.
|
|
14
|
+
- Release 9.75.2-experimental.css-modules.20261113-ba13c87438 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by 257645319+office-ogx-auth-helper[bot]@users.noreply.github.com)
|
|
15
|
+
- Bump @fluentui/react-field to v9.75.2-experimental.css-modules.20261113-ba13c87438.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
16
|
+
- Bump @fluentui/react-jsx-runtime to v9.75.2-experimental.css-modules.20261113-ba13c87438.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
17
|
+
- Bump @fluentui/react-shared-contexts to v9.75.2-experimental.css-modules.20261113-ba13c87438.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
18
|
+
- Bump @fluentui/react-tabster to v9.75.2-experimental.css-modules.20261113-ba13c87438.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
19
|
+
- Bump @fluentui/react-theme to v9.75.2-experimental.css-modules.20261113-ba13c87438.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
20
|
+
- Bump @fluentui/react-utilities to v9.75.2-experimental.css-modules.20261113-ba13c87438.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
21
21
|
|
|
22
22
|
## [9.6.8](https://github.com/microsoft/fluentui/tree/@fluentui/react-slider_v9.6.8)
|
|
23
23
|
|
package/README.md
CHANGED
|
@@ -34,8 +34,14 @@ Alternatively, run Storybook locally with:
|
|
|
34
34
|
|
|
35
35
|
### Specification
|
|
36
36
|
|
|
37
|
-
See [SPEC.md](./Spec.md).
|
|
37
|
+
See [SPEC.md](./docs/Spec.md).
|
|
38
38
|
|
|
39
39
|
### Migration Guide
|
|
40
40
|
|
|
41
|
-
If you're upgrading to Fluent UI v9 see [MIGRATION.md](./MIGRATION.md) for guidance on updating to the latest Slider implementation.
|
|
41
|
+
If you're upgrading to Fluent UI v9 see [MIGRATION.md](./docs/MIGRATION.md) for guidance on updating to the latest Slider implementation.
|
|
42
|
+
|
|
43
|
+
## Opt-in CSS Modules styles
|
|
44
|
+
|
|
45
|
+
CSS Modules alternatives are available for `Slider`. The default exports and component imports continue to use Griffel.
|
|
46
|
+
|
|
47
|
+
To opt in, configure your bundler to replace each `use<Component>Styles.styles.js` module with its adjacent `use<Component>Styles.styles.css.js` alternative (or `.styles.ts` with `.styles.css.ts` for source builds). Apply the replacement consistently to client and server bundles. The CSS loader must provide a default class-name map and retain the adjacent `.module.css` asset, including CSS from dependencies. Component rules are unlayered, like Griffel's, and use the theme custom properties supplied by `FluentProvider`.
|
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
.root {
|
|
2
|
+
position: relative;
|
|
3
|
+
display: inline-grid;
|
|
4
|
+
touch-action: none;
|
|
5
|
+
align-items: center;
|
|
6
|
+
justify-items: center;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.horizontal:focus {
|
|
10
|
+
outline-style: none;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.horizontal:focus-visible {
|
|
14
|
+
outline-style: none;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.horizontal[data-fui-focus-within]:focus-within::after {
|
|
18
|
+
content: '';
|
|
19
|
+
position: absolute;
|
|
20
|
+
pointer-events: none;
|
|
21
|
+
z-index: 1;
|
|
22
|
+
border: var(--strokeWidthThick) solid var(--colorStrokeFocus2);
|
|
23
|
+
border-radius: var(--borderRadiusMedium);
|
|
24
|
+
top: calc(0px - var(--strokeWidthThick) - calc(var(--strokeWidthThick) * -1));
|
|
25
|
+
inset-inline-end: calc(0px - var(--strokeWidthThick) - calc(var(--spacingHorizontalXS) * -1));
|
|
26
|
+
bottom: calc(0px - var(--strokeWidthThick) - calc(var(--strokeWidthThick) * -1));
|
|
27
|
+
inset-inline-start: calc(0px - var(--strokeWidthThick) - calc(var(--spacingHorizontalXS) * -1));
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.horizontal[data-fui-focus-within]:focus-within {
|
|
31
|
+
border-top-color: transparent;
|
|
32
|
+
border-inline-end-color: transparent;
|
|
33
|
+
border-bottom-color: transparent;
|
|
34
|
+
border-inline-start-color: transparent;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.vertical:focus {
|
|
38
|
+
outline-style: none;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.vertical:focus-visible {
|
|
42
|
+
outline-style: none;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.vertical[data-fui-focus-within]:focus-within::after {
|
|
46
|
+
content: '';
|
|
47
|
+
position: absolute;
|
|
48
|
+
pointer-events: none;
|
|
49
|
+
z-index: 1;
|
|
50
|
+
border: var(--strokeWidthThick) solid var(--colorStrokeFocus2);
|
|
51
|
+
border-radius: var(--borderRadiusMedium);
|
|
52
|
+
top: calc(0px - var(--strokeWidthThick) - calc(var(--strokeWidthThick) * -1));
|
|
53
|
+
inset-inline-end: calc(0px - var(--strokeWidthThick) - var(--spacingHorizontalXS));
|
|
54
|
+
bottom: calc(0px - var(--strokeWidthThick) - calc(var(--strokeWidthThick) * -1));
|
|
55
|
+
inset-inline-start: calc(0px - var(--strokeWidthThick) - var(--spacingHorizontalXS));
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.vertical[data-fui-focus-within]:focus-within {
|
|
59
|
+
border-top-color: transparent;
|
|
60
|
+
border-inline-end-color: transparent;
|
|
61
|
+
border-bottom-color: transparent;
|
|
62
|
+
border-inline-start-color: transparent;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.small {
|
|
66
|
+
--fui-Slider__thumb--size: var(--spacingHorizontalL);
|
|
67
|
+
--fui-Slider__inner-thumb--radius: calc(var(--spacingHorizontalXS) * 1.25);
|
|
68
|
+
--fui-Slider__rail--size: var(--strokeWidthThick);
|
|
69
|
+
min-height: var(--spacingHorizontalXXL);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.medium {
|
|
73
|
+
--fui-Slider__thumb--size: var(--spacingHorizontalXL);
|
|
74
|
+
--fui-Slider__inner-thumb--radius: var(--spacingHorizontalSNudge);
|
|
75
|
+
--fui-Slider__rail--size: var(--spacingHorizontalXS);
|
|
76
|
+
min-height: var(--spacingHorizontalXXXL);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.horizontal {
|
|
80
|
+
min-width: calc(var(--spacingHorizontalXS) * 30);
|
|
81
|
+
grid-template-rows: 1fr var(--fui-Slider__thumb--size) 1fr;
|
|
82
|
+
grid-template-columns: 1fr calc(100% - var(--fui-Slider__thumb--size)) 1fr;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.vertical {
|
|
86
|
+
min-height: calc(var(--spacingHorizontalXS) * 30);
|
|
87
|
+
grid-template-rows: 1fr calc(100% - var(--fui-Slider__thumb--size)) 1fr;
|
|
88
|
+
grid-template-columns: 1fr var(--fui-Slider__thumb--size) 1fr;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.enabled:hover {
|
|
92
|
+
--fui-Slider__thumb--color: var(--colorCompoundBrandBackgroundHover);
|
|
93
|
+
--fui-Slider__progress--color: var(--colorCompoundBrandBackgroundHover);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.enabled:active {
|
|
97
|
+
--fui-Slider__thumb--color: var(--colorCompoundBrandBackgroundPressed);
|
|
98
|
+
--fui-Slider__progress--color: var(--colorCompoundBrandBackgroundPressed);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.enabled {
|
|
102
|
+
--fui-Slider__rail--color: var(--colorNeutralStrokeAccessible);
|
|
103
|
+
--fui-Slider__progress--color: var(--colorCompoundBrandBackground);
|
|
104
|
+
--fui-Slider__thumb--color: var(--colorCompoundBrandBackground);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.disabled {
|
|
108
|
+
--fui-Slider__thumb--color: var(--colorNeutralForegroundDisabled);
|
|
109
|
+
--fui-Slider__rail--color: var(--colorNeutralBackgroundDisabled);
|
|
110
|
+
--fui-Slider__progress--color: var(--colorNeutralForegroundDisabled);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.rail::before {
|
|
114
|
+
content: '';
|
|
115
|
+
position: absolute;
|
|
116
|
+
background-image: repeating-linear-gradient(
|
|
117
|
+
var(--fui-Slider--direction),
|
|
118
|
+
transparent 0%,
|
|
119
|
+
transparent calc(var(--fui-Slider--steps-percent) - var(--strokeWidthThin)),
|
|
120
|
+
var(--colorNeutralBackground1) calc(var(--fui-Slider--steps-percent) - var(--strokeWidthThin)),
|
|
121
|
+
var(--colorNeutralBackground1) var(--fui-Slider--steps-percent)
|
|
122
|
+
);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.rail {
|
|
126
|
+
border-radius: var(--borderRadiusXLarge);
|
|
127
|
+
pointer-events: none;
|
|
128
|
+
grid-row-start: 2;
|
|
129
|
+
grid-row-end: 2;
|
|
130
|
+
grid-column-start: 2;
|
|
131
|
+
grid-column-end: 2;
|
|
132
|
+
position: relative;
|
|
133
|
+
forced-color-adjust: none;
|
|
134
|
+
background-image: linear-gradient(
|
|
135
|
+
var(--fui-Slider--direction),
|
|
136
|
+
var(--fui-Slider__progress--color) 0%,
|
|
137
|
+
var(--fui-Slider__progress--color) var(--fui-Slider--progress),
|
|
138
|
+
var(--fui-Slider__rail--color) var(--fui-Slider--progress)
|
|
139
|
+
);
|
|
140
|
+
outline-width: var(--strokeWidthThin);
|
|
141
|
+
outline-style: solid;
|
|
142
|
+
outline-color: var(--colorTransparentStroke);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
:where(.horizontal) > .rail::before {
|
|
146
|
+
inset-inline-start: calc(var(--strokeWidthThin) * -1);
|
|
147
|
+
inset-inline-end: calc(var(--strokeWidthThin) * -1);
|
|
148
|
+
height: var(--fui-Slider__rail--size);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
:where(.horizontal) > .rail {
|
|
152
|
+
width: 100%;
|
|
153
|
+
height: var(--fui-Slider__rail--size);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
:where(.vertical) > .rail::before {
|
|
157
|
+
width: var(--fui-Slider__rail--size);
|
|
158
|
+
top: calc(var(--strokeWidthThin) * -1);
|
|
159
|
+
bottom: calc(var(--strokeWidthThin) * -1);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
:where(.vertical) > .rail {
|
|
163
|
+
width: var(--fui-Slider__rail--size);
|
|
164
|
+
height: 100%;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.thumb::before {
|
|
168
|
+
position: absolute;
|
|
169
|
+
top: 0px;
|
|
170
|
+
inset-inline-start: 0px;
|
|
171
|
+
bottom: 0px;
|
|
172
|
+
inset-inline-end: 0px;
|
|
173
|
+
border-radius: var(--borderRadiusCircular);
|
|
174
|
+
box-sizing: border-box;
|
|
175
|
+
content: '';
|
|
176
|
+
border: calc(var(--fui-Slider__thumb--size) * 0.05) solid var(--colorNeutralStroke1);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.thumb {
|
|
180
|
+
--fui-Slider__thumb--position: clamp(
|
|
181
|
+
var(--fui-Slider__inner-thumb--radius),
|
|
182
|
+
var(--fui-Slider--progress),
|
|
183
|
+
calc(100% - var(--fui-Slider__inner-thumb--radius))
|
|
184
|
+
);
|
|
185
|
+
grid-row-start: 2;
|
|
186
|
+
grid-row-end: 2;
|
|
187
|
+
grid-column-start: 2;
|
|
188
|
+
grid-column-end: 2;
|
|
189
|
+
position: absolute;
|
|
190
|
+
width: var(--fui-Slider__thumb--size);
|
|
191
|
+
height: var(--fui-Slider__thumb--size);
|
|
192
|
+
pointer-events: none;
|
|
193
|
+
outline-style: none;
|
|
194
|
+
forced-color-adjust: none;
|
|
195
|
+
border-radius: var(--borderRadiusCircular);
|
|
196
|
+
box-shadow: 0 0 0 calc(var(--fui-Slider__thumb--size) * 0.2) var(--colorNeutralBackground1) inset;
|
|
197
|
+
background-color: var(--fui-Slider__thumb--color);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
:where(.horizontal) > .thumb {
|
|
201
|
+
transform: translateX(-50%);
|
|
202
|
+
inset-inline-start: var(--fui-Slider__thumb--position);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
:where(.horizontal) > .thumb:where(:dir(rtl)) {
|
|
206
|
+
transform: translateX(50%);
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
:where(.vertical) > .thumb {
|
|
210
|
+
transform: translateY(50%);
|
|
211
|
+
bottom: var(--fui-Slider__thumb--position);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
:where(.disabled) > .thumb::before {
|
|
215
|
+
border: calc(var(--fui-Slider__thumb--size) * 0.05) solid var(--colorNeutralForegroundDisabled);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.input {
|
|
219
|
+
cursor: pointer;
|
|
220
|
+
opacity: 0;
|
|
221
|
+
grid-row-start: 1;
|
|
222
|
+
grid-row-end: -1;
|
|
223
|
+
grid-column-start: 1;
|
|
224
|
+
grid-column-end: -1;
|
|
225
|
+
padding: 0;
|
|
226
|
+
margin: 0;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
:where(.horizontal) > .input {
|
|
230
|
+
height: var(--fui-Slider__thumb--size);
|
|
231
|
+
width: 100%;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
:where(.vertical) > .input {
|
|
235
|
+
height: 100%;
|
|
236
|
+
width: var(--fui-Slider__thumb--size);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
:where(.disabled) > .input {
|
|
240
|
+
cursor: default;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
@media (forced-colors: active) {
|
|
244
|
+
.horizontal[data-fui-focus-within]:focus-within::after {
|
|
245
|
+
border-top-color: Highlight;
|
|
246
|
+
border-inline-end-color: Highlight;
|
|
247
|
+
border-bottom-color: Highlight;
|
|
248
|
+
border-inline-start-color: Highlight;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
@media (forced-colors: active) {
|
|
253
|
+
.vertical[data-fui-focus-within]:focus-within::after {
|
|
254
|
+
border-top-color: Highlight;
|
|
255
|
+
border-inline-end-color: Highlight;
|
|
256
|
+
border-bottom-color: Highlight;
|
|
257
|
+
border-inline-start-color: Highlight;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
@media (forced-colors: active) {
|
|
262
|
+
.enabled:hover {
|
|
263
|
+
--fui-Slider__thumb--color: Highlight;
|
|
264
|
+
--fui-Slider__progress--color: Highlight;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
@media (forced-colors: active) {
|
|
269
|
+
.enabled {
|
|
270
|
+
--fui-Slider__rail--color: CanvasText;
|
|
271
|
+
--fui-Slider__thumb--color: Highlight;
|
|
272
|
+
--fui-Slider__progress--color: Highlight;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
@media (forced-colors: active) {
|
|
277
|
+
.disabled {
|
|
278
|
+
--fui-Slider__rail--color: GrayText;
|
|
279
|
+
--fui-Slider__thumb--color: GrayText;
|
|
280
|
+
--fui-Slider__progress--color: GrayText;
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
@media (forced-colors: active) {
|
|
285
|
+
.rail::before {
|
|
286
|
+
background-image: repeating-linear-gradient(
|
|
287
|
+
var(--fui-Slider--direction),
|
|
288
|
+
transparent 0%,
|
|
289
|
+
transparent calc(var(--fui-Slider--steps-percent) - var(--strokeWidthThin)),
|
|
290
|
+
HighlightText calc(var(--fui-Slider--steps-percent) - var(--strokeWidthThin)),
|
|
291
|
+
HighlightText var(--fui-Slider--steps-percent)
|
|
292
|
+
);
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
@supports (writing-mode: sideways-lr) {
|
|
297
|
+
:where(.vertical) > .input {
|
|
298
|
+
writing-mode: vertical-lr;
|
|
299
|
+
direction: rtl;
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
@supports (writing-mode: sideways-lr) {
|
|
304
|
+
:where(.vertical) > .input:where(:dir(rtl)) {
|
|
305
|
+
direction: ltr;
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
@supports not (writing-mode: sideways-lr) {
|
|
310
|
+
:where(.vertical) > .input {
|
|
311
|
+
-webkit-appearance: slider-vertical;
|
|
312
|
+
}
|
|
313
|
+
}
|
|
@@ -6,6 +6,10 @@ import { useFocusWithin } from "@fluentui/react-tabster";
|
|
|
6
6
|
export const useSlider_unstable = (props, ref)=>{
|
|
7
7
|
const { size = 'medium', ...baseProps } = props;
|
|
8
8
|
const baseState = useSliderBase_unstable(baseProps, ref);
|
|
9
|
+
// Focus-within ref drives the styled focus outline; applied here rather than in the base hook
|
|
10
|
+
// so the base hook does not depend on react-tabster (keyborg).
|
|
11
|
+
// eslint-disable-next-line react-hooks/immutability
|
|
12
|
+
baseState.root.ref = useMergedRefs(baseState.root.ref, useFocusWithin());
|
|
9
13
|
return {
|
|
10
14
|
...baseState,
|
|
11
15
|
size
|
|
@@ -65,7 +69,6 @@ export const useSlider_unstable = (props, ref)=>{
|
|
|
65
69
|
if (state.input['aria-orientation'] === undefined) {
|
|
66
70
|
state.input['aria-orientation'] = state.vertical ? 'vertical' : 'horizontal';
|
|
67
71
|
}
|
|
68
|
-
state.root.ref = useMergedRefs(state.root.ref, useFocusWithin());
|
|
69
72
|
useSliderState_unstable(state, props);
|
|
70
73
|
return state;
|
|
71
74
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/Slider/useSlider.ts"],"sourcesContent":["'use client';\n\nimport type * as React from 'react';\nimport { useFieldControlProps_unstable } from '@fluentui/react-field';\nimport { getPartitionedNativeProps, useId, useMergedRefs, slot } from '@fluentui/react-utilities';\nimport { useSliderState_unstable } from './useSliderState';\nimport type { SliderBaseProps, SliderBaseState, SliderProps, SliderState } from './Slider.types';\nimport { useFocusWithin } from '@fluentui/react-tabster';\n\nexport const useSlider_unstable = (props: SliderProps, ref: React.Ref<HTMLInputElement>): SliderState => {\n const { size = 'medium', ...baseProps } = props;\n\n const baseState = useSliderBase_unstable(baseProps, ref);\n\n return {\n ...baseState,\n size,\n };\n};\n\n/**\n * Base hook for Slider component, which manages state related to slots structure, ARIA attributes,\n * keyboard handling, and controlled/uncontrolled value state.\n *\n * @param props - User provided props to the Slider component.\n * @param ref - User provided ref to be passed to the Slider input element.\n */\nexport const useSliderBase_unstable = (props: SliderBaseProps, ref: React.Ref<HTMLInputElement>): SliderBaseState => {\n // Merge props from surrounding <Field>, if any\n props = useFieldControlProps_unstable(props, { supportsLabelFor: true });\n\n const nativeProps = getPartitionedNativeProps({\n props,\n primarySlotTagName: 'input',\n excludedPropNames: ['onChange'],\n });\n\n const {\n disabled,\n vertical,\n // Slots\n root,\n input,\n rail,\n thumb,\n } = props;\n\n const state: SliderBaseState = {\n disabled,\n vertical,\n components: {\n input: 'input',\n rail: 'div',\n root: 'div',\n thumb: 'div',\n },\n root: slot.always(root, {\n defaultProps: nativeProps.root,\n elementType: 'div',\n }),\n input: slot.always(input, {\n defaultProps: {\n id: useId('slider-', props.id),\n ref,\n ...nativeProps.primary,\n type: 'range',\n orient: vertical ? 'vertical' : undefined,\n },\n elementType: 'input',\n }),\n rail: slot.always(rail, { elementType: 'div' }),\n thumb: slot.always(thumb, { elementType: 'div' }),\n };\n\n // Apply after slot resolution so an explicitly undefined slot attribute also receives the default.\n if (state.input['aria-orientation'] === undefined) {\n state.input['aria-orientation'] = state.vertical ? 'vertical' : 'horizontal';\n }\n\n
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Slider/useSlider.ts"],"sourcesContent":["'use client';\n\nimport type * as React from 'react';\nimport { useFieldControlProps_unstable } from '@fluentui/react-field';\nimport { getPartitionedNativeProps, useId, useMergedRefs, slot } from '@fluentui/react-utilities';\nimport { useSliderState_unstable } from './useSliderState';\nimport type { SliderBaseProps, SliderBaseState, SliderProps, SliderState } from './Slider.types';\nimport { useFocusWithin } from '@fluentui/react-tabster';\n\nexport const useSlider_unstable = (props: SliderProps, ref: React.Ref<HTMLInputElement>): SliderState => {\n const { size = 'medium', ...baseProps } = props;\n\n const baseState = useSliderBase_unstable(baseProps, ref);\n\n // Focus-within ref drives the styled focus outline; applied here rather than in the base hook\n // so the base hook does not depend on react-tabster (keyborg).\n // eslint-disable-next-line react-hooks/immutability\n baseState.root.ref = useMergedRefs(baseState.root.ref, useFocusWithin<HTMLDivElement>());\n\n return {\n ...baseState,\n size,\n };\n};\n\n/**\n * Base hook for Slider component, which manages state related to slots structure, ARIA attributes,\n * keyboard handling, and controlled/uncontrolled value state.\n *\n * @param props - User provided props to the Slider component.\n * @param ref - User provided ref to be passed to the Slider input element.\n */\nexport const useSliderBase_unstable = (props: SliderBaseProps, ref: React.Ref<HTMLInputElement>): SliderBaseState => {\n // Merge props from surrounding <Field>, if any\n props = useFieldControlProps_unstable(props, { supportsLabelFor: true });\n\n const nativeProps = getPartitionedNativeProps({\n props,\n primarySlotTagName: 'input',\n excludedPropNames: ['onChange'],\n });\n\n const {\n disabled,\n vertical,\n // Slots\n root,\n input,\n rail,\n thumb,\n } = props;\n\n const state: SliderBaseState = {\n disabled,\n vertical,\n components: {\n input: 'input',\n rail: 'div',\n root: 'div',\n thumb: 'div',\n },\n root: slot.always(root, {\n defaultProps: nativeProps.root,\n elementType: 'div',\n }),\n input: slot.always(input, {\n defaultProps: {\n id: useId('slider-', props.id),\n ref,\n ...nativeProps.primary,\n type: 'range',\n orient: vertical ? 'vertical' : undefined,\n },\n elementType: 'input',\n }),\n rail: slot.always(rail, { elementType: 'div' }),\n thumb: slot.always(thumb, { elementType: 'div' }),\n };\n\n // Apply after slot resolution so an explicitly undefined slot attribute also receives the default.\n if (state.input['aria-orientation'] === undefined) {\n state.input['aria-orientation'] = state.vertical ? 'vertical' : 'horizontal';\n }\n\n useSliderState_unstable(state, props);\n\n return state;\n};\n"],"names":["useFieldControlProps_unstable","getPartitionedNativeProps","useId","useMergedRefs","slot","useSliderState_unstable","useFocusWithin","useSlider_unstable","props","ref","size","baseProps","baseState","useSliderBase_unstable","root","supportsLabelFor","nativeProps","primarySlotTagName","excludedPropNames","disabled","vertical","input","rail","thumb","state","components","always","defaultProps","elementType","id","primary","type","orient","undefined"],"mappings":"AAAA;AAGA,SAASA,6BAA6B,QAAQ,wBAAwB;AACtE,SAASC,yBAAyB,EAAEC,KAAK,EAAEC,aAAa,EAAEC,IAAI,QAAQ,4BAA4B;AAClG,SAASC,uBAAuB,QAAQ,sBAAmB;AAE3D,SAASC,cAAc,QAAQ,0BAA0B;AAEzD,OAAO,MAAMC,qBAAqB,CAACC,OAAoBC;IACrD,MAAM,EAAEC,OAAO,QAAQ,EAAE,GAAGC,WAAW,GAAGH;IAE1C,MAAMI,YAAYC,uBAAuBF,WAAWF;IAEpD,8FAA8F;IAC9F,+DAA+D;IAC/D,oDAAoD;IACpDG,UAAUE,IAAI,CAACL,GAAG,GAAGN,cAAcS,UAAUE,IAAI,CAACL,GAAG,EAAEH;IAEvD,OAAO;QACL,GAAGM,SAAS;QACZF;IACF;AACF,EAAE;AAEF;;;;;;CAMC,GACD,OAAO,MAAMG,yBAAyB,CAACL,OAAwBC;IAC7D,+CAA+C;IAC/CD,QAAQR,8BAA8BQ,OAAO;QAAEO,kBAAkB;IAAK;IAEtE,MAAMC,cAAcf,0BAA0B;QAC5CO;QACAS,oBAAoB;QACpBC,mBAAmB;YAAC;SAAW;IACjC;IAEA,MAAM,EACJC,QAAQ,EACRC,QAAQ,EACR,QAAQ;IACRN,IAAI,EACJO,KAAK,EACLC,IAAI,EACJC,KAAK,EACN,GAAGf;IAEJ,MAAMgB,QAAyB;QAC7BL;QACAC;QACAK,YAAY;YACVJ,OAAO;YACPC,MAAM;YACNR,MAAM;YACNS,OAAO;QACT;QACAT,MAAMV,KAAKsB,MAAM,CAACZ,MAAM;YACtBa,cAAcX,YAAYF,IAAI;YAC9Bc,aAAa;QACf;QACAP,OAAOjB,KAAKsB,MAAM,CAACL,OAAO;YACxBM,cAAc;gBACZE,IAAI3B,MAAM,WAAWM,MAAMqB,EAAE;gBAC7BpB;gBACA,GAAGO,YAAYc,OAAO;gBACtBC,MAAM;gBACNC,QAAQZ,WAAW,aAAaa;YAClC;YACAL,aAAa;QACf;QACAN,MAAMlB,KAAKsB,MAAM,CAACJ,MAAM;YAAEM,aAAa;QAAM;QAC7CL,OAAOnB,KAAKsB,MAAM,CAACH,OAAO;YAAEK,aAAa;QAAM;IACjD;IAEA,mGAAmG;IACnG,IAAIJ,MAAMH,KAAK,CAAC,mBAAmB,KAAKY,WAAW;QACjDT,MAAMH,KAAK,CAAC,mBAAmB,GAAGG,MAAMJ,QAAQ,GAAG,aAAa;IAClE;IAEAf,wBAAwBmB,OAAOhB;IAE/B,OAAOgB;AACT,EAAE"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { clsx } from "clsx";
|
|
2
|
+
import styles from "./Slider.module.css";
|
|
3
|
+
export const sliderClassNames = {
|
|
4
|
+
root: 'fui-Slider',
|
|
5
|
+
rail: 'fui-Slider__rail',
|
|
6
|
+
thumb: 'fui-Slider__thumb',
|
|
7
|
+
input: 'fui-Slider__input'
|
|
8
|
+
};
|
|
9
|
+
export const useSliderStyles_unstable = (state)=>{
|
|
10
|
+
var _state_size;
|
|
11
|
+
state.root.className = clsx(sliderClassNames.root, styles.root, styles[(_state_size = state.size) !== null && _state_size !== void 0 ? _state_size : 'medium'], state.vertical ? styles.vertical : styles.horizontal, state.disabled ? styles.disabled : styles.enabled, state.root.className);
|
|
12
|
+
state.rail.className = clsx(sliderClassNames.rail, styles.rail, state.rail.className);
|
|
13
|
+
state.thumb.className = clsx(sliderClassNames.thumb, styles.thumb, state.thumb.className);
|
|
14
|
+
state.input.className = clsx(sliderClassNames.input, styles.input, state.input.className);
|
|
15
|
+
return state;
|
|
16
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Slider/useSliderStyles.styles.css.ts"],"sourcesContent":["import { clsx } from 'clsx';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { SliderState, SliderSlots } from './Slider.types';\nimport styles from './Slider.module.css';\n\nexport const sliderClassNames: SlotClassNames<SliderSlots> = {\n root: 'fui-Slider',\n rail: 'fui-Slider__rail',\n thumb: 'fui-Slider__thumb',\n input: 'fui-Slider__input',\n};\n\nexport const useSliderStyles_unstable = (state: SliderState): SliderState => {\n state.root.className = clsx(\n sliderClassNames.root,\n styles.root,\n styles[state.size ?? 'medium'],\n state.vertical ? styles.vertical : styles.horizontal,\n state.disabled ? styles.disabled : styles.enabled,\n state.root.className,\n );\n state.rail.className = clsx(sliderClassNames.rail, styles.rail, state.rail.className);\n state.thumb.className = clsx(sliderClassNames.thumb, styles.thumb, state.thumb.className);\n state.input.className = clsx(sliderClassNames.input, styles.input, state.input.className);\n return state;\n};\n"],"names":["clsx","styles","sliderClassNames","root","rail","thumb","input","useSliderStyles_unstable","state","className","size","vertical","horizontal","disabled","enabled"],"mappings":"AAAA,SAASA,IAAI,QAAQ,OAAO;AAG5B,OAAOC,YAAY,sBAAsB;AAEzC,OAAO,MAAMC,mBAAgD;IAC3DC,MAAM;IACNC,MAAM;IACNC,OAAO;IACPC,OAAO;AACT,EAAE;AAEF,OAAO,MAAMC,2BAA2B,CAACC;QAI9BA;IAHTA,MAAML,IAAI,CAACM,SAAS,GAAGT,KACrBE,iBAAiBC,IAAI,EACrBF,OAAOE,IAAI,EACXF,MAAM,EAACO,cAAAA,MAAME,IAAI,cAAVF,yBAAAA,cAAc,SAAS,EAC9BA,MAAMG,QAAQ,GAAGV,OAAOU,QAAQ,GAAGV,OAAOW,UAAU,EACpDJ,MAAMK,QAAQ,GAAGZ,OAAOY,QAAQ,GAAGZ,OAAOa,OAAO,EACjDN,MAAML,IAAI,CAACM,SAAS;IAEtBD,MAAMJ,IAAI,CAACK,SAAS,GAAGT,KAAKE,iBAAiBE,IAAI,EAAEH,OAAOG,IAAI,EAAEI,MAAMJ,IAAI,CAACK,SAAS;IACpFD,MAAMH,KAAK,CAACI,SAAS,GAAGT,KAAKE,iBAAiBG,KAAK,EAAEJ,OAAOI,KAAK,EAAEG,MAAMH,KAAK,CAACI,SAAS;IACxFD,MAAMF,KAAK,CAACG,SAAS,GAAGT,KAAKE,iBAAiBI,KAAK,EAAEL,OAAOK,KAAK,EAAEE,MAAMF,KAAK,CAACG,SAAS;IACxF,OAAOD;AACT,EAAE"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { clsx } from "clsx";
|
|
2
|
+
import styles from "./Slider.module.css";
|
|
3
|
+
export const sliderClassNames = {
|
|
4
|
+
root: 'fui-Slider',
|
|
5
|
+
rail: 'fui-Slider__rail',
|
|
6
|
+
thumb: 'fui-Slider__thumb',
|
|
7
|
+
input: 'fui-Slider__input'
|
|
8
|
+
};
|
|
9
|
+
export const useSliderStyles_unstable = (state)=>{
|
|
10
|
+
var _state_size;
|
|
11
|
+
state.root.className = clsx(sliderClassNames.root, styles.root, styles[(_state_size = state.size) !== null && _state_size !== void 0 ? _state_size : 'medium'], state.vertical ? styles.vertical : styles.horizontal, state.disabled ? styles.disabled : styles.enabled, state.root.className);
|
|
12
|
+
state.rail.className = clsx(sliderClassNames.rail, styles.rail, state.rail.className);
|
|
13
|
+
state.thumb.className = clsx(sliderClassNames.thumb, styles.thumb, state.thumb.className);
|
|
14
|
+
state.input.className = clsx(sliderClassNames.input, styles.input, state.input.className);
|
|
15
|
+
return state;
|
|
16
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Slider/useSliderStyles.styles.css.ts"],"sourcesContent":["import { clsx } from 'clsx';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { SliderState, SliderSlots } from './Slider.types';\nimport styles from './Slider.module.css';\n\nexport const sliderClassNames: SlotClassNames<SliderSlots> = {\n root: 'fui-Slider',\n rail: 'fui-Slider__rail',\n thumb: 'fui-Slider__thumb',\n input: 'fui-Slider__input',\n};\n\nexport const useSliderStyles_unstable = (state: SliderState): SliderState => {\n state.root.className = clsx(\n sliderClassNames.root,\n styles.root,\n styles[state.size ?? 'medium'],\n state.vertical ? styles.vertical : styles.horizontal,\n state.disabled ? styles.disabled : styles.enabled,\n state.root.className,\n );\n state.rail.className = clsx(sliderClassNames.rail, styles.rail, state.rail.className);\n state.thumb.className = clsx(sliderClassNames.thumb, styles.thumb, state.thumb.className);\n state.input.className = clsx(sliderClassNames.input, styles.input, state.input.className);\n return state;\n};\n"],"names":["clsx","styles","sliderClassNames","root","rail","thumb","input","useSliderStyles_unstable","state","className","size","vertical","horizontal","disabled","enabled"],"mappings":"AAAA,SAASA,IAAI,QAAQ,OAAO;AAG5B,OAAOC,YAAY,sBAAsB;AAEzC,OAAO,MAAMC,mBAAgD;IAC3DC,MAAM;IACNC,MAAM;IACNC,OAAO;IACPC,OAAO;AACT,EAAE;AAEF,OAAO,MAAMC,2BAA2B,CAACC;QAI9BA;IAHTA,MAAML,IAAI,CAACM,SAAS,GAAGT,KACrBE,iBAAiBC,IAAI,EACrBF,OAAOE,IAAI,EACXF,MAAM,EAACO,cAAAA,MAAME,IAAI,cAAVF,yBAAAA,cAAc,SAAS,EAC9BA,MAAMG,QAAQ,GAAGV,OAAOU,QAAQ,GAAGV,OAAOW,UAAU,EACpDJ,MAAMK,QAAQ,GAAGZ,OAAOY,QAAQ,GAAGZ,OAAOa,OAAO,EACjDN,MAAML,IAAI,CAACM,SAAS;IAEtBD,MAAMJ,IAAI,CAACK,SAAS,GAAGT,KAAKE,iBAAiBE,IAAI,EAAEH,OAAOG,IAAI,EAAEI,MAAMJ,IAAI,CAACK,SAAS;IACpFD,MAAMH,KAAK,CAACI,SAAS,GAAGT,KAAKE,iBAAiBG,KAAK,EAAEJ,OAAOI,KAAK,EAAEG,MAAMH,KAAK,CAACI,SAAS;IACxFD,MAAMF,KAAK,CAACG,SAAS,GAAGT,KAAKE,iBAAiBI,KAAK,EAAEL,OAAOK,KAAK,EAAEE,MAAMF,KAAK,CAACG,SAAS;IACxF,OAAOD;AACT,EAAE"}
|
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
.root {
|
|
2
|
+
position: relative;
|
|
3
|
+
display: inline-grid;
|
|
4
|
+
touch-action: none;
|
|
5
|
+
align-items: center;
|
|
6
|
+
justify-items: center;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.horizontal:focus {
|
|
10
|
+
outline-style: none;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.horizontal:focus-visible {
|
|
14
|
+
outline-style: none;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.horizontal[data-fui-focus-within]:focus-within::after {
|
|
18
|
+
content: '';
|
|
19
|
+
position: absolute;
|
|
20
|
+
pointer-events: none;
|
|
21
|
+
z-index: 1;
|
|
22
|
+
border: var(--strokeWidthThick) solid var(--colorStrokeFocus2);
|
|
23
|
+
border-radius: var(--borderRadiusMedium);
|
|
24
|
+
top: calc(0px - var(--strokeWidthThick) - calc(var(--strokeWidthThick) * -1));
|
|
25
|
+
inset-inline-end: calc(0px - var(--strokeWidthThick) - calc(var(--spacingHorizontalXS) * -1));
|
|
26
|
+
bottom: calc(0px - var(--strokeWidthThick) - calc(var(--strokeWidthThick) * -1));
|
|
27
|
+
inset-inline-start: calc(0px - var(--strokeWidthThick) - calc(var(--spacingHorizontalXS) * -1));
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.horizontal[data-fui-focus-within]:focus-within {
|
|
31
|
+
border-top-color: transparent;
|
|
32
|
+
border-inline-end-color: transparent;
|
|
33
|
+
border-bottom-color: transparent;
|
|
34
|
+
border-inline-start-color: transparent;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.vertical:focus {
|
|
38
|
+
outline-style: none;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.vertical:focus-visible {
|
|
42
|
+
outline-style: none;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.vertical[data-fui-focus-within]:focus-within::after {
|
|
46
|
+
content: '';
|
|
47
|
+
position: absolute;
|
|
48
|
+
pointer-events: none;
|
|
49
|
+
z-index: 1;
|
|
50
|
+
border: var(--strokeWidthThick) solid var(--colorStrokeFocus2);
|
|
51
|
+
border-radius: var(--borderRadiusMedium);
|
|
52
|
+
top: calc(0px - var(--strokeWidthThick) - calc(var(--strokeWidthThick) * -1));
|
|
53
|
+
inset-inline-end: calc(0px - var(--strokeWidthThick) - var(--spacingHorizontalXS));
|
|
54
|
+
bottom: calc(0px - var(--strokeWidthThick) - calc(var(--strokeWidthThick) * -1));
|
|
55
|
+
inset-inline-start: calc(0px - var(--strokeWidthThick) - var(--spacingHorizontalXS));
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.vertical[data-fui-focus-within]:focus-within {
|
|
59
|
+
border-top-color: transparent;
|
|
60
|
+
border-inline-end-color: transparent;
|
|
61
|
+
border-bottom-color: transparent;
|
|
62
|
+
border-inline-start-color: transparent;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.small {
|
|
66
|
+
--fui-Slider__thumb--size: var(--spacingHorizontalL);
|
|
67
|
+
--fui-Slider__inner-thumb--radius: calc(var(--spacingHorizontalXS) * 1.25);
|
|
68
|
+
--fui-Slider__rail--size: var(--strokeWidthThick);
|
|
69
|
+
min-height: var(--spacingHorizontalXXL);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.medium {
|
|
73
|
+
--fui-Slider__thumb--size: var(--spacingHorizontalXL);
|
|
74
|
+
--fui-Slider__inner-thumb--radius: var(--spacingHorizontalSNudge);
|
|
75
|
+
--fui-Slider__rail--size: var(--spacingHorizontalXS);
|
|
76
|
+
min-height: var(--spacingHorizontalXXXL);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.horizontal {
|
|
80
|
+
min-width: calc(var(--spacingHorizontalXS) * 30);
|
|
81
|
+
grid-template-rows: 1fr var(--fui-Slider__thumb--size) 1fr;
|
|
82
|
+
grid-template-columns: 1fr calc(100% - var(--fui-Slider__thumb--size)) 1fr;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.vertical {
|
|
86
|
+
min-height: calc(var(--spacingHorizontalXS) * 30);
|
|
87
|
+
grid-template-rows: 1fr calc(100% - var(--fui-Slider__thumb--size)) 1fr;
|
|
88
|
+
grid-template-columns: 1fr var(--fui-Slider__thumb--size) 1fr;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.enabled:hover {
|
|
92
|
+
--fui-Slider__thumb--color: var(--colorCompoundBrandBackgroundHover);
|
|
93
|
+
--fui-Slider__progress--color: var(--colorCompoundBrandBackgroundHover);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.enabled:active {
|
|
97
|
+
--fui-Slider__thumb--color: var(--colorCompoundBrandBackgroundPressed);
|
|
98
|
+
--fui-Slider__progress--color: var(--colorCompoundBrandBackgroundPressed);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.enabled {
|
|
102
|
+
--fui-Slider__rail--color: var(--colorNeutralStrokeAccessible);
|
|
103
|
+
--fui-Slider__progress--color: var(--colorCompoundBrandBackground);
|
|
104
|
+
--fui-Slider__thumb--color: var(--colorCompoundBrandBackground);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.disabled {
|
|
108
|
+
--fui-Slider__thumb--color: var(--colorNeutralForegroundDisabled);
|
|
109
|
+
--fui-Slider__rail--color: var(--colorNeutralBackgroundDisabled);
|
|
110
|
+
--fui-Slider__progress--color: var(--colorNeutralForegroundDisabled);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.rail::before {
|
|
114
|
+
content: '';
|
|
115
|
+
position: absolute;
|
|
116
|
+
background-image: repeating-linear-gradient(
|
|
117
|
+
var(--fui-Slider--direction),
|
|
118
|
+
transparent 0%,
|
|
119
|
+
transparent calc(var(--fui-Slider--steps-percent) - var(--strokeWidthThin)),
|
|
120
|
+
var(--colorNeutralBackground1) calc(var(--fui-Slider--steps-percent) - var(--strokeWidthThin)),
|
|
121
|
+
var(--colorNeutralBackground1) var(--fui-Slider--steps-percent)
|
|
122
|
+
);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.rail {
|
|
126
|
+
border-radius: var(--borderRadiusXLarge);
|
|
127
|
+
pointer-events: none;
|
|
128
|
+
grid-row-start: 2;
|
|
129
|
+
grid-row-end: 2;
|
|
130
|
+
grid-column-start: 2;
|
|
131
|
+
grid-column-end: 2;
|
|
132
|
+
position: relative;
|
|
133
|
+
forced-color-adjust: none;
|
|
134
|
+
background-image: linear-gradient(
|
|
135
|
+
var(--fui-Slider--direction),
|
|
136
|
+
var(--fui-Slider__progress--color) 0%,
|
|
137
|
+
var(--fui-Slider__progress--color) var(--fui-Slider--progress),
|
|
138
|
+
var(--fui-Slider__rail--color) var(--fui-Slider--progress)
|
|
139
|
+
);
|
|
140
|
+
outline-width: var(--strokeWidthThin);
|
|
141
|
+
outline-style: solid;
|
|
142
|
+
outline-color: var(--colorTransparentStroke);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
:where(.horizontal) > .rail::before {
|
|
146
|
+
inset-inline-start: calc(var(--strokeWidthThin) * -1);
|
|
147
|
+
inset-inline-end: calc(var(--strokeWidthThin) * -1);
|
|
148
|
+
height: var(--fui-Slider__rail--size);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
:where(.horizontal) > .rail {
|
|
152
|
+
width: 100%;
|
|
153
|
+
height: var(--fui-Slider__rail--size);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
:where(.vertical) > .rail::before {
|
|
157
|
+
width: var(--fui-Slider__rail--size);
|
|
158
|
+
top: calc(var(--strokeWidthThin) * -1);
|
|
159
|
+
bottom: calc(var(--strokeWidthThin) * -1);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
:where(.vertical) > .rail {
|
|
163
|
+
width: var(--fui-Slider__rail--size);
|
|
164
|
+
height: 100%;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.thumb::before {
|
|
168
|
+
position: absolute;
|
|
169
|
+
top: 0px;
|
|
170
|
+
inset-inline-start: 0px;
|
|
171
|
+
bottom: 0px;
|
|
172
|
+
inset-inline-end: 0px;
|
|
173
|
+
border-radius: var(--borderRadiusCircular);
|
|
174
|
+
box-sizing: border-box;
|
|
175
|
+
content: '';
|
|
176
|
+
border: calc(var(--fui-Slider__thumb--size) * 0.05) solid var(--colorNeutralStroke1);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.thumb {
|
|
180
|
+
--fui-Slider__thumb--position: clamp(
|
|
181
|
+
var(--fui-Slider__inner-thumb--radius),
|
|
182
|
+
var(--fui-Slider--progress),
|
|
183
|
+
calc(100% - var(--fui-Slider__inner-thumb--radius))
|
|
184
|
+
);
|
|
185
|
+
grid-row-start: 2;
|
|
186
|
+
grid-row-end: 2;
|
|
187
|
+
grid-column-start: 2;
|
|
188
|
+
grid-column-end: 2;
|
|
189
|
+
position: absolute;
|
|
190
|
+
width: var(--fui-Slider__thumb--size);
|
|
191
|
+
height: var(--fui-Slider__thumb--size);
|
|
192
|
+
pointer-events: none;
|
|
193
|
+
outline-style: none;
|
|
194
|
+
forced-color-adjust: none;
|
|
195
|
+
border-radius: var(--borderRadiusCircular);
|
|
196
|
+
box-shadow: 0 0 0 calc(var(--fui-Slider__thumb--size) * 0.2) var(--colorNeutralBackground1) inset;
|
|
197
|
+
background-color: var(--fui-Slider__thumb--color);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
:where(.horizontal) > .thumb {
|
|
201
|
+
transform: translateX(-50%);
|
|
202
|
+
inset-inline-start: var(--fui-Slider__thumb--position);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
:where(.horizontal) > .thumb:where(:dir(rtl)) {
|
|
206
|
+
transform: translateX(50%);
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
:where(.vertical) > .thumb {
|
|
210
|
+
transform: translateY(50%);
|
|
211
|
+
bottom: var(--fui-Slider__thumb--position);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
:where(.disabled) > .thumb::before {
|
|
215
|
+
border: calc(var(--fui-Slider__thumb--size) * 0.05) solid var(--colorNeutralForegroundDisabled);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.input {
|
|
219
|
+
cursor: pointer;
|
|
220
|
+
opacity: 0;
|
|
221
|
+
grid-row-start: 1;
|
|
222
|
+
grid-row-end: -1;
|
|
223
|
+
grid-column-start: 1;
|
|
224
|
+
grid-column-end: -1;
|
|
225
|
+
padding: 0;
|
|
226
|
+
margin: 0;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
:where(.horizontal) > .input {
|
|
230
|
+
height: var(--fui-Slider__thumb--size);
|
|
231
|
+
width: 100%;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
:where(.vertical) > .input {
|
|
235
|
+
height: 100%;
|
|
236
|
+
width: var(--fui-Slider__thumb--size);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
:where(.disabled) > .input {
|
|
240
|
+
cursor: default;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
@media (forced-colors: active) {
|
|
244
|
+
.horizontal[data-fui-focus-within]:focus-within::after {
|
|
245
|
+
border-top-color: Highlight;
|
|
246
|
+
border-inline-end-color: Highlight;
|
|
247
|
+
border-bottom-color: Highlight;
|
|
248
|
+
border-inline-start-color: Highlight;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
@media (forced-colors: active) {
|
|
253
|
+
.vertical[data-fui-focus-within]:focus-within::after {
|
|
254
|
+
border-top-color: Highlight;
|
|
255
|
+
border-inline-end-color: Highlight;
|
|
256
|
+
border-bottom-color: Highlight;
|
|
257
|
+
border-inline-start-color: Highlight;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
@media (forced-colors: active) {
|
|
262
|
+
.enabled:hover {
|
|
263
|
+
--fui-Slider__thumb--color: Highlight;
|
|
264
|
+
--fui-Slider__progress--color: Highlight;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
@media (forced-colors: active) {
|
|
269
|
+
.enabled {
|
|
270
|
+
--fui-Slider__rail--color: CanvasText;
|
|
271
|
+
--fui-Slider__thumb--color: Highlight;
|
|
272
|
+
--fui-Slider__progress--color: Highlight;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
@media (forced-colors: active) {
|
|
277
|
+
.disabled {
|
|
278
|
+
--fui-Slider__rail--color: GrayText;
|
|
279
|
+
--fui-Slider__thumb--color: GrayText;
|
|
280
|
+
--fui-Slider__progress--color: GrayText;
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
@media (forced-colors: active) {
|
|
285
|
+
.rail::before {
|
|
286
|
+
background-image: repeating-linear-gradient(
|
|
287
|
+
var(--fui-Slider--direction),
|
|
288
|
+
transparent 0%,
|
|
289
|
+
transparent calc(var(--fui-Slider--steps-percent) - var(--strokeWidthThin)),
|
|
290
|
+
HighlightText calc(var(--fui-Slider--steps-percent) - var(--strokeWidthThin)),
|
|
291
|
+
HighlightText var(--fui-Slider--steps-percent)
|
|
292
|
+
);
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
@supports (writing-mode: sideways-lr) {
|
|
297
|
+
:where(.vertical) > .input {
|
|
298
|
+
writing-mode: vertical-lr;
|
|
299
|
+
direction: rtl;
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
@supports (writing-mode: sideways-lr) {
|
|
304
|
+
:where(.vertical) > .input:where(:dir(rtl)) {
|
|
305
|
+
direction: ltr;
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
@supports not (writing-mode: sideways-lr) {
|
|
310
|
+
:where(.vertical) > .input {
|
|
311
|
+
-webkit-appearance: slider-vertical;
|
|
312
|
+
}
|
|
313
|
+
}
|
|
@@ -24,6 +24,10 @@ const _reacttabster = require("@fluentui/react-tabster");
|
|
|
24
24
|
const useSlider_unstable = (props, ref)=>{
|
|
25
25
|
const { size = 'medium', ...baseProps } = props;
|
|
26
26
|
const baseState = useSliderBase_unstable(baseProps, ref);
|
|
27
|
+
// Focus-within ref drives the styled focus outline; applied here rather than in the base hook
|
|
28
|
+
// so the base hook does not depend on react-tabster (keyborg).
|
|
29
|
+
// eslint-disable-next-line react-hooks/immutability
|
|
30
|
+
baseState.root.ref = (0, _reactutilities.useMergedRefs)(baseState.root.ref, (0, _reacttabster.useFocusWithin)());
|
|
27
31
|
return {
|
|
28
32
|
...baseState,
|
|
29
33
|
size
|
|
@@ -76,7 +80,6 @@ const useSliderBase_unstable = (props, ref)=>{
|
|
|
76
80
|
if (state.input['aria-orientation'] === undefined) {
|
|
77
81
|
state.input['aria-orientation'] = state.vertical ? 'vertical' : 'horizontal';
|
|
78
82
|
}
|
|
79
|
-
state.root.ref = (0, _reactutilities.useMergedRefs)(state.root.ref, (0, _reacttabster.useFocusWithin)());
|
|
80
83
|
(0, _useSliderState.useSliderState_unstable)(state, props);
|
|
81
84
|
return state;
|
|
82
85
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/Slider/useSlider.ts"],"sourcesContent":["'use client';\n\nimport type * as React from 'react';\nimport { useFieldControlProps_unstable } from '@fluentui/react-field';\nimport { getPartitionedNativeProps, useId, useMergedRefs, slot } from '@fluentui/react-utilities';\nimport { useSliderState_unstable } from './useSliderState';\nimport type { SliderBaseProps, SliderBaseState, SliderProps, SliderState } from './Slider.types';\nimport { useFocusWithin } from '@fluentui/react-tabster';\n\nexport const useSlider_unstable = (props: SliderProps, ref: React.Ref<HTMLInputElement>): SliderState => {\n const { size = 'medium', ...baseProps } = props;\n\n const baseState = useSliderBase_unstable(baseProps, ref);\n\n return {\n ...baseState,\n size,\n };\n};\n\n/**\n * Base hook for Slider component, which manages state related to slots structure, ARIA attributes,\n * keyboard handling, and controlled/uncontrolled value state.\n *\n * @param props - User provided props to the Slider component.\n * @param ref - User provided ref to be passed to the Slider input element.\n */\nexport const useSliderBase_unstable = (props: SliderBaseProps, ref: React.Ref<HTMLInputElement>): SliderBaseState => {\n // Merge props from surrounding <Field>, if any\n props = useFieldControlProps_unstable(props, { supportsLabelFor: true });\n\n const nativeProps = getPartitionedNativeProps({\n props,\n primarySlotTagName: 'input',\n excludedPropNames: ['onChange'],\n });\n\n const {\n disabled,\n vertical,\n // Slots\n root,\n input,\n rail,\n thumb,\n } = props;\n\n const state: SliderBaseState = {\n disabled,\n vertical,\n components: {\n input: 'input',\n rail: 'div',\n root: 'div',\n thumb: 'div',\n },\n root: slot.always(root, {\n defaultProps: nativeProps.root,\n elementType: 'div',\n }),\n input: slot.always(input, {\n defaultProps: {\n id: useId('slider-', props.id),\n ref,\n ...nativeProps.primary,\n type: 'range',\n orient: vertical ? 'vertical' : undefined,\n },\n elementType: 'input',\n }),\n rail: slot.always(rail, { elementType: 'div' }),\n thumb: slot.always(thumb, { elementType: 'div' }),\n };\n\n // Apply after slot resolution so an explicitly undefined slot attribute also receives the default.\n if (state.input['aria-orientation'] === undefined) {\n state.input['aria-orientation'] = state.vertical ? 'vertical' : 'horizontal';\n }\n\n
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Slider/useSlider.ts"],"sourcesContent":["'use client';\n\nimport type * as React from 'react';\nimport { useFieldControlProps_unstable } from '@fluentui/react-field';\nimport { getPartitionedNativeProps, useId, useMergedRefs, slot } from '@fluentui/react-utilities';\nimport { useSliderState_unstable } from './useSliderState';\nimport type { SliderBaseProps, SliderBaseState, SliderProps, SliderState } from './Slider.types';\nimport { useFocusWithin } from '@fluentui/react-tabster';\n\nexport const useSlider_unstable = (props: SliderProps, ref: React.Ref<HTMLInputElement>): SliderState => {\n const { size = 'medium', ...baseProps } = props;\n\n const baseState = useSliderBase_unstable(baseProps, ref);\n\n // Focus-within ref drives the styled focus outline; applied here rather than in the base hook\n // so the base hook does not depend on react-tabster (keyborg).\n // eslint-disable-next-line react-hooks/immutability\n baseState.root.ref = useMergedRefs(baseState.root.ref, useFocusWithin<HTMLDivElement>());\n\n return {\n ...baseState,\n size,\n };\n};\n\n/**\n * Base hook for Slider component, which manages state related to slots structure, ARIA attributes,\n * keyboard handling, and controlled/uncontrolled value state.\n *\n * @param props - User provided props to the Slider component.\n * @param ref - User provided ref to be passed to the Slider input element.\n */\nexport const useSliderBase_unstable = (props: SliderBaseProps, ref: React.Ref<HTMLInputElement>): SliderBaseState => {\n // Merge props from surrounding <Field>, if any\n props = useFieldControlProps_unstable(props, { supportsLabelFor: true });\n\n const nativeProps = getPartitionedNativeProps({\n props,\n primarySlotTagName: 'input',\n excludedPropNames: ['onChange'],\n });\n\n const {\n disabled,\n vertical,\n // Slots\n root,\n input,\n rail,\n thumb,\n } = props;\n\n const state: SliderBaseState = {\n disabled,\n vertical,\n components: {\n input: 'input',\n rail: 'div',\n root: 'div',\n thumb: 'div',\n },\n root: slot.always(root, {\n defaultProps: nativeProps.root,\n elementType: 'div',\n }),\n input: slot.always(input, {\n defaultProps: {\n id: useId('slider-', props.id),\n ref,\n ...nativeProps.primary,\n type: 'range',\n orient: vertical ? 'vertical' : undefined,\n },\n elementType: 'input',\n }),\n rail: slot.always(rail, { elementType: 'div' }),\n thumb: slot.always(thumb, { elementType: 'div' }),\n };\n\n // Apply after slot resolution so an explicitly undefined slot attribute also receives the default.\n if (state.input['aria-orientation'] === undefined) {\n state.input['aria-orientation'] = state.vertical ? 'vertical' : 'horizontal';\n }\n\n useSliderState_unstable(state, props);\n\n return state;\n};\n"],"names":["useFieldControlProps_unstable","getPartitionedNativeProps","useId","useMergedRefs","slot","useSliderState_unstable","useFocusWithin","useSlider_unstable","props","ref","size","baseProps","baseState","useSliderBase_unstable","root","supportsLabelFor","nativeProps","primarySlotTagName","excludedPropNames","disabled","vertical","input","rail","thumb","state","components","always","defaultProps","elementType","id","primary","type","orient","undefined"],"mappings":"AAAA;;;;;;;;;;;;;eAgCaa;;QAvBAN;;;;4BANiC,wBAAwB;gCACA,4BAA4B;gCAC1D,sBAAmB;8BAE5B,0BAA0B;AAElD,2BAA2B,CAACC,OAAoBC;IACrD,MAAM,EAAEC,OAAO,QAAQ,EAAE,GAAGC,WAAW,GAAGH;IAE1C,MAAMI,YAAYC,uBAAuBF,WAAWF;IAEpD,8FAA8F;IAC9F,+DAA+D;IAC/D,oDAAoD;IACpDG,UAAUE,IAAI,CAACL,GAAG,OAAGN,6BAAAA,EAAcS,UAAUE,IAAI,CAACL,GAAG,MAAEH,4BAAAA;IAEvD,OAAO;QACL,GAAGM,SAAS;QACZF;IACF;AACF,EAAE;AASK,+BAA+B,CAACF,OAAwBC;IAC7D,+CAA+C;IAC/CD,QAAQR,6CAAAA,EAA8BQ,OAAO;QAAEO,kBAAkB;IAAK;IAEtE,MAAMC,kBAAcf,yCAAAA,EAA0B;QAC5CO;QACAS,oBAAoB;QACpBC,mBAAmB;YAAC;SAAW;IACjC;IAEA,MAAM,EACJC,QAAQ,EACRC,QAAQ,EACR,AACAN,IAAI,EACJO,EAFQ,GAEH,EACLC,IAAI,EACJC,KAAK,EACN,GAAGf;IAEJ,MAAMgB,QAAyB;QAC7BL;QACAC;QACAK,YAAY;YACVJ,OAAO;YACPC,MAAM;YACNR,MAAM;YACNS,OAAO;QACT;QACAT,MAAMV,oBAAAA,CAAKsB,MAAM,CAACZ,MAAM;YACtBa,cAAcX,YAAYF,IAAI;YAC9Bc,aAAa;QACf;QACAP,OAAOjB,oBAAAA,CAAKsB,MAAM,CAACL,OAAO;YACxBM,cAAc;gBACZE,QAAI3B,qBAAAA,EAAM,WAAWM,MAAMqB,EAAE;gBAC7BpB;gBACA,GAAGO,YAAYc,OAAO;gBACtBC,MAAM;gBACNC,QAAQZ,WAAW,aAAaa;YAClC;YACAL,aAAa;QACf;QACAN,MAAMlB,oBAAAA,CAAKsB,MAAM,CAACJ,MAAM;YAAEM,aAAa;QAAM;QAC7CL,OAAOnB,oBAAAA,CAAKsB,MAAM,CAACH,OAAO;YAAEK,aAAa;QAAM;IACjD;IAEA,mGAAmG;IACnG,IAAIJ,MAAMH,KAAK,CAAC,mBAAmB,KAAKY,WAAW;QACjDT,MAAMH,KAAK,CAAC,mBAAmB,GAAGG,MAAMJ,QAAQ,GAAG,aAAa;IAClE;QAEAf,uCAAAA,EAAwBmB,OAAOhB;IAE/B,OAAOgB;AACT,EAAE"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
get sliderClassNames () {
|
|
13
|
+
return sliderClassNames;
|
|
14
|
+
},
|
|
15
|
+
get useSliderStyles_unstable () {
|
|
16
|
+
return useSliderStyles_unstable;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
20
|
+
const _clsx = require("clsx");
|
|
21
|
+
const _Slidermodulecss = /*#__PURE__*/ _interop_require_default._(require("./Slider.module.css"));
|
|
22
|
+
const sliderClassNames = {
|
|
23
|
+
root: 'fui-Slider',
|
|
24
|
+
rail: 'fui-Slider__rail',
|
|
25
|
+
thumb: 'fui-Slider__thumb',
|
|
26
|
+
input: 'fui-Slider__input'
|
|
27
|
+
};
|
|
28
|
+
const useSliderStyles_unstable = (state)=>{
|
|
29
|
+
var _state_size;
|
|
30
|
+
state.root.className = (0, _clsx.clsx)(sliderClassNames.root, _Slidermodulecss.default.root, _Slidermodulecss.default[(_state_size = state.size) !== null && _state_size !== void 0 ? _state_size : 'medium'], state.vertical ? _Slidermodulecss.default.vertical : _Slidermodulecss.default.horizontal, state.disabled ? _Slidermodulecss.default.disabled : _Slidermodulecss.default.enabled, state.root.className);
|
|
31
|
+
state.rail.className = (0, _clsx.clsx)(sliderClassNames.rail, _Slidermodulecss.default.rail, state.rail.className);
|
|
32
|
+
state.thumb.className = (0, _clsx.clsx)(sliderClassNames.thumb, _Slidermodulecss.default.thumb, state.thumb.className);
|
|
33
|
+
state.input.className = (0, _clsx.clsx)(sliderClassNames.input, _Slidermodulecss.default.input, state.input.className);
|
|
34
|
+
return state;
|
|
35
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Slider/useSliderStyles.styles.css.ts"],"sourcesContent":["import { clsx } from 'clsx';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { SliderState, SliderSlots } from './Slider.types';\nimport styles from './Slider.module.css';\n\nexport const sliderClassNames: SlotClassNames<SliderSlots> = {\n root: 'fui-Slider',\n rail: 'fui-Slider__rail',\n thumb: 'fui-Slider__thumb',\n input: 'fui-Slider__input',\n};\n\nexport const useSliderStyles_unstable = (state: SliderState): SliderState => {\n state.root.className = clsx(\n sliderClassNames.root,\n styles.root,\n styles[state.size ?? 'medium'],\n state.vertical ? styles.vertical : styles.horizontal,\n state.disabled ? styles.disabled : styles.enabled,\n state.root.className,\n );\n state.rail.className = clsx(sliderClassNames.rail, styles.rail, state.rail.className);\n state.thumb.className = clsx(sliderClassNames.thumb, styles.thumb, state.thumb.className);\n state.input.className = clsx(sliderClassNames.input, styles.input, state.input.className);\n return state;\n};\n"],"names":["clsx","styles","sliderClassNames","root","rail","thumb","input","useSliderStyles_unstable","state","className","size","vertical","horizontal","disabled","enabled"],"mappings":";;;;;;;;;;;QAKaE;;;QAOAK;;;;;sBAZQ,OAAO;0EAGT,sBAAsB;AAElC,yBAAsD;IAC3DJ,MAAM;IACNC,MAAM;IACNC,OAAO;IACPC,OAAO;AACT,EAAE;AAEK,iCAAiC,CAACE;QAI9BA;IAHTA,MAAML,IAAI,CAACM,SAAS,OAAGT,UAAAA,EACrBE,iBAAiBC,IAAI,EACrBF,wBAAAA,CAAOE,IAAI,EACXF,wBAAM,CAAA,CAACO,cAAAA,MAAME,IAAI,AAAJA,MAAI,QAAVF,gBAAAA,KAAAA,IAAAA,cAAc,SAAS,EAC9BA,MAAMG,QAAQ,GAAGV,wBAAAA,CAAOU,QAAQ,GAAGV,wBAAAA,CAAOW,UAAU,EACpDJ,MAAMK,QAAQ,GAAGZ,wBAAAA,CAAOY,QAAQ,GAAGZ,wBAAAA,CAAOa,OAAO,EACjDN,MAAML,IAAI,CAACM,SAAS;IAEtBD,MAAMJ,IAAI,CAACK,SAAS,OAAGT,UAAAA,EAAKE,iBAAiBE,IAAI,EAAEH,wBAAAA,CAAOG,IAAI,EAAEI,MAAMJ,IAAI,CAACK,SAAS;IACpFD,MAAMH,KAAK,CAACI,SAAS,OAAGT,UAAAA,EAAKE,iBAAiBG,KAAK,EAAEJ,wBAAAA,CAAOI,KAAK,EAAEG,MAAMH,KAAK,CAACI,SAAS;IACxFD,MAAMF,KAAK,CAACG,SAAS,OAAGT,UAAAA,EAAKE,iBAAiBI,KAAK,EAAEL,wBAAAA,CAAOK,KAAK,EAAEE,MAAMF,KAAK,CAACG,SAAS;IACxF,OAAOD;AACT,EAAE"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
get sliderClassNames () {
|
|
13
|
+
return sliderClassNames;
|
|
14
|
+
},
|
|
15
|
+
get useSliderStyles_unstable () {
|
|
16
|
+
return useSliderStyles_unstable;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
20
|
+
const _clsx = require("clsx");
|
|
21
|
+
const _Slidermodulecss = /*#__PURE__*/ _interop_require_default._(require("./Slider.module.css"));
|
|
22
|
+
const sliderClassNames = {
|
|
23
|
+
root: 'fui-Slider',
|
|
24
|
+
rail: 'fui-Slider__rail',
|
|
25
|
+
thumb: 'fui-Slider__thumb',
|
|
26
|
+
input: 'fui-Slider__input'
|
|
27
|
+
};
|
|
28
|
+
const useSliderStyles_unstable = (state)=>{
|
|
29
|
+
var _state_size;
|
|
30
|
+
state.root.className = (0, _clsx.clsx)(sliderClassNames.root, _Slidermodulecss.default.root, _Slidermodulecss.default[(_state_size = state.size) !== null && _state_size !== void 0 ? _state_size : 'medium'], state.vertical ? _Slidermodulecss.default.vertical : _Slidermodulecss.default.horizontal, state.disabled ? _Slidermodulecss.default.disabled : _Slidermodulecss.default.enabled, state.root.className);
|
|
31
|
+
state.rail.className = (0, _clsx.clsx)(sliderClassNames.rail, _Slidermodulecss.default.rail, state.rail.className);
|
|
32
|
+
state.thumb.className = (0, _clsx.clsx)(sliderClassNames.thumb, _Slidermodulecss.default.thumb, state.thumb.className);
|
|
33
|
+
state.input.className = (0, _clsx.clsx)(sliderClassNames.input, _Slidermodulecss.default.input, state.input.className);
|
|
34
|
+
return state;
|
|
35
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Slider/useSliderStyles.styles.css.ts"],"sourcesContent":["import { clsx } from 'clsx';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { SliderState, SliderSlots } from './Slider.types';\nimport styles from './Slider.module.css';\n\nexport const sliderClassNames: SlotClassNames<SliderSlots> = {\n root: 'fui-Slider',\n rail: 'fui-Slider__rail',\n thumb: 'fui-Slider__thumb',\n input: 'fui-Slider__input',\n};\n\nexport const useSliderStyles_unstable = (state: SliderState): SliderState => {\n state.root.className = clsx(\n sliderClassNames.root,\n styles.root,\n styles[state.size ?? 'medium'],\n state.vertical ? styles.vertical : styles.horizontal,\n state.disabled ? styles.disabled : styles.enabled,\n state.root.className,\n );\n state.rail.className = clsx(sliderClassNames.rail, styles.rail, state.rail.className);\n state.thumb.className = clsx(sliderClassNames.thumb, styles.thumb, state.thumb.className);\n state.input.className = clsx(sliderClassNames.input, styles.input, state.input.className);\n return state;\n};\n"],"names":["clsx","styles","sliderClassNames","root","rail","thumb","input","useSliderStyles_unstable","state","className","size","vertical","horizontal","disabled","enabled"],"mappings":";;;;;;;;;;;QAKaE;;;QAOAK;;;;;sBAZQ,OAAO;0EAGT,sBAAsB;AAElC,yBAAsD;IAC3DJ,MAAM;IACNC,MAAM;IACNC,OAAO;IACPC,OAAO;AACT,EAAE;AAEK,iCAAiC,CAACE;QAI9BA;IAHTA,MAAML,IAAI,CAACM,SAAS,OAAGT,UAAAA,EACrBE,iBAAiBC,IAAI,EACrBF,wBAAAA,CAAOE,IAAI,EACXF,wBAAM,CAAA,CAACO,cAAAA,MAAME,IAAI,AAAJA,MAAI,QAAVF,gBAAAA,KAAAA,IAAAA,cAAc,SAAS,EAC9BA,MAAMG,QAAQ,GAAGV,wBAAAA,CAAOU,QAAQ,GAAGV,wBAAAA,CAAOW,UAAU,EACpDJ,MAAMK,QAAQ,GAAGZ,wBAAAA,CAAOY,QAAQ,GAAGZ,wBAAAA,CAAOa,OAAO,EACjDN,MAAML,IAAI,CAACM,SAAS;IAEtBD,MAAMJ,IAAI,CAACK,SAAS,OAAGT,UAAAA,EAAKE,iBAAiBE,IAAI,EAAEH,wBAAAA,CAAOG,IAAI,EAAEI,MAAMJ,IAAI,CAACK,SAAS;IACpFD,MAAMH,KAAK,CAACI,SAAS,OAAGT,UAAAA,EAAKE,iBAAiBG,KAAK,EAAEJ,wBAAAA,CAAOI,KAAK,EAAEG,MAAMH,KAAK,CAACI,SAAS;IACxFD,MAAMF,KAAK,CAACG,SAAS,OAAGT,UAAAA,EAAKE,iBAAiBI,KAAK,EAAEL,wBAAAA,CAAOK,KAAK,EAAEE,MAAMF,KAAK,CAACG,SAAS;IACxF,OAAOD;AACT,EAAE"}
|
package/package.json
CHANGED
|
@@ -1,25 +1,28 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui/react-slider",
|
|
3
|
-
"version": "9.75.
|
|
3
|
+
"version": "9.75.2-experimental.css-modules.20261113-ba13c87438.0",
|
|
4
4
|
"description": "Fluent UI React Slider component.",
|
|
5
5
|
"main": "lib-commonjs/index.cjs",
|
|
6
6
|
"module": "lib/index.js",
|
|
7
7
|
"typings": "./dist/index.d.ts",
|
|
8
|
-
"sideEffects":
|
|
8
|
+
"sideEffects": [
|
|
9
|
+
"**/*.css"
|
|
10
|
+
],
|
|
9
11
|
"repository": {
|
|
10
12
|
"type": "git",
|
|
11
13
|
"url": "https://github.com/microsoft/fluentui"
|
|
12
14
|
},
|
|
13
15
|
"license": "MIT",
|
|
14
16
|
"dependencies": {
|
|
15
|
-
"@fluentui/react-field": "9.75.
|
|
16
|
-
"@fluentui/react-jsx-runtime": "9.75.
|
|
17
|
-
"@fluentui/react-shared-contexts": "9.75.
|
|
18
|
-
"@fluentui/react-tabster": "9.75.
|
|
19
|
-
"@fluentui/react-theme": "9.75.
|
|
20
|
-
"@fluentui/react-utilities": "9.75.
|
|
17
|
+
"@fluentui/react-field": "9.75.2-experimental.css-modules.20261113-ba13c87438.0",
|
|
18
|
+
"@fluentui/react-jsx-runtime": "9.75.2-experimental.css-modules.20261113-ba13c87438.0",
|
|
19
|
+
"@fluentui/react-shared-contexts": "9.75.2-experimental.css-modules.20261113-ba13c87438.0",
|
|
20
|
+
"@fluentui/react-tabster": "9.75.2-experimental.css-modules.20261113-ba13c87438.0",
|
|
21
|
+
"@fluentui/react-theme": "9.75.2-experimental.css-modules.20261113-ba13c87438.0",
|
|
22
|
+
"@fluentui/react-utilities": "9.75.2-experimental.css-modules.20261113-ba13c87438.0",
|
|
21
23
|
"@griffel/react": "^1.5.32",
|
|
22
|
-
"@swc/helpers": "^0.5.1"
|
|
24
|
+
"@swc/helpers": "^0.5.1",
|
|
25
|
+
"clsx": "^2.1.1"
|
|
23
26
|
},
|
|
24
27
|
"peerDependencies": {
|
|
25
28
|
"@types/react": ">=16.14.0 <20.0.0",
|