@plasmicpkgs/react-aria 0.0.43 → 0.0.45
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/.tsbuildinfo +1 -1
- package/dist/contexts.d.ts +3 -1
- package/dist/react-aria.esm.js +227 -206
- package/dist/react-aria.esm.js.map +1 -1
- package/dist/react-aria.js +226 -205
- package/dist/react-aria.js.map +1 -1
- package/dist/registerSlider.d.ts +3 -20
- package/dist/registerSliderOutput.d.ts +1 -1
- package/dist/registerSliderThumb.d.ts +2 -2
- package/dist/registerSliderTrack.d.ts +3 -1
- package/package.json +2 -2
- package/skinny/contexts-3a98471a.cjs.js.map +1 -1
- package/skinny/contexts-87c261f6.esm.js.map +1 -1
- package/skinny/contexts.d.ts +3 -1
- package/skinny/registerSlider.cjs.js +305 -15
- package/skinny/registerSlider.cjs.js.map +1 -1
- package/skinny/registerSlider.d.ts +3 -20
- package/skinny/registerSlider.esm.js +303 -11
- package/skinny/registerSlider.esm.js.map +1 -1
- package/skinny/registerSliderOutput.cjs.js +1 -1
- package/skinny/registerSliderOutput.cjs.js.map +1 -1
- package/skinny/registerSliderOutput.d.ts +1 -1
- package/skinny/registerSliderOutput.esm.js +1 -1
- package/skinny/registerSliderOutput.esm.js.map +1 -1
- package/skinny/registerSliderThumb.cjs.js +1 -1
- package/skinny/registerSliderThumb.cjs.js.map +1 -1
- package/skinny/registerSliderThumb.d.ts +2 -2
- package/skinny/registerSliderThumb.esm.js +1 -1
- package/skinny/registerSliderThumb.esm.js.map +1 -1
- package/skinny/registerSliderTrack.cjs.js +189 -16
- package/skinny/registerSliderTrack.cjs.js.map +1 -1
- package/skinny/registerSliderTrack.d.ts +3 -1
- package/skinny/registerSliderTrack.esm.js +185 -13
- package/skinny/registerSliderTrack.esm.js.map +1 -1
- package/skinny/registerSlider-cd08b960.cjs.js +0 -473
- package/skinny/registerSlider-cd08b960.cjs.js.map +0 -1
- package/skinny/registerSlider-df0fdf82.esm.js +0 -460
- package/skinny/registerSlider-df0fdf82.esm.js.map +0 -1
|
@@ -1,460 +0,0 @@
|
|
|
1
|
-
import React, { useMemo, useRef, useEffect } from 'react';
|
|
2
|
-
import { mergeProps } from 'react-aria';
|
|
3
|
-
import { SliderTrack, Slider } from 'react-aria-components';
|
|
4
|
-
import { g as getCommonProps } from './common-96be13c3.esm.js';
|
|
5
|
-
import { h as PlasmicSliderContext } from './contexts-87c261f6.esm.js';
|
|
6
|
-
import { p as pickAriaComponentVariants } from './interaction-variant-utils-abd0c319.esm.js';
|
|
7
|
-
import { LABEL_COMPONENT_NAME } from './registerLabel.esm.js';
|
|
8
|
-
import { registerSliderOutput, SLIDER_OUTPUT_COMPONENT_NAME } from './registerSliderOutput.esm.js';
|
|
9
|
-
import { SLIDER_THUMB_COMPONENT_NAME, registerSliderThumb } from './registerSliderThumb.esm.js';
|
|
10
|
-
import flattenChildren from 'react-keyed-flatten-children';
|
|
11
|
-
import { E as ErrorBoundary } from './ErrorBoundary-c6b111d3.esm.js';
|
|
12
|
-
import { a as makeComponentName, r as registerComponentHelper, m as makeChildComponentName } from './utils-a1785802.esm.js';
|
|
13
|
-
|
|
14
|
-
var __defProp$1 = Object.defineProperty;
|
|
15
|
-
var __getOwnPropSymbols$1 = Object.getOwnPropertySymbols;
|
|
16
|
-
var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
|
|
17
|
-
var __propIsEnum$1 = Object.prototype.propertyIsEnumerable;
|
|
18
|
-
var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
19
|
-
var __spreadValues$1 = (a, b) => {
|
|
20
|
-
for (var prop in b || (b = {}))
|
|
21
|
-
if (__hasOwnProp$1.call(b, prop))
|
|
22
|
-
__defNormalProp$1(a, prop, b[prop]);
|
|
23
|
-
if (__getOwnPropSymbols$1)
|
|
24
|
-
for (var prop of __getOwnPropSymbols$1(b)) {
|
|
25
|
-
if (__propIsEnum$1.call(b, prop))
|
|
26
|
-
__defNormalProp$1(a, prop, b[prop]);
|
|
27
|
-
}
|
|
28
|
-
return a;
|
|
29
|
-
};
|
|
30
|
-
var __objRest$1 = (source, exclude) => {
|
|
31
|
-
var target = {};
|
|
32
|
-
for (var prop in source)
|
|
33
|
-
if (__hasOwnProp$1.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
34
|
-
target[prop] = source[prop];
|
|
35
|
-
if (source != null && __getOwnPropSymbols$1)
|
|
36
|
-
for (var prop of __getOwnPropSymbols$1(source)) {
|
|
37
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$1.call(source, prop))
|
|
38
|
-
target[prop] = source[prop];
|
|
39
|
-
}
|
|
40
|
-
return target;
|
|
41
|
-
};
|
|
42
|
-
const SLIDER_TRACK_INTERACTION_VARIANTS = ["hovered"];
|
|
43
|
-
const { interactionVariants: interactionVariants$1, withObservedValues: withObservedValues$1 } = pickAriaComponentVariants(
|
|
44
|
-
SLIDER_TRACK_INTERACTION_VARIANTS
|
|
45
|
-
);
|
|
46
|
-
function findMinMaxIndices(values) {
|
|
47
|
-
if (typeof values === "number" || (values == null ? void 0 : values.length) === 0 || !Array.isArray(values)) {
|
|
48
|
-
return { minIndex: 0, maxIndex: 0 };
|
|
49
|
-
}
|
|
50
|
-
let minIndex = 0;
|
|
51
|
-
let maxIndex = 0;
|
|
52
|
-
for (let i = 1; i < values.length; i++) {
|
|
53
|
-
if (values[i] < values[minIndex]) {
|
|
54
|
-
minIndex = i;
|
|
55
|
-
}
|
|
56
|
-
if (values[i] > values[maxIndex]) {
|
|
57
|
-
maxIndex = i;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
return { minIndex, maxIndex };
|
|
61
|
-
}
|
|
62
|
-
function BaseSliderTrack(props) {
|
|
63
|
-
const context = React.useContext(PlasmicSliderContext);
|
|
64
|
-
const mergedProps = mergeProps(context, props);
|
|
65
|
-
const _a = mergedProps, {
|
|
66
|
-
children,
|
|
67
|
-
progressBar,
|
|
68
|
-
updateInteractionVariant,
|
|
69
|
-
isMultiValue
|
|
70
|
-
} = _a, rest = __objRest$1(_a, [
|
|
71
|
-
"children",
|
|
72
|
-
"progressBar",
|
|
73
|
-
"updateInteractionVariant",
|
|
74
|
-
"isMultiValue"
|
|
75
|
-
]);
|
|
76
|
-
const { minIndex, maxIndex } = useMemo(
|
|
77
|
-
() => findMinMaxIndices(mergedProps.value),
|
|
78
|
-
[mergedProps.value]
|
|
79
|
-
);
|
|
80
|
-
const thumbs = useMemo(() => {
|
|
81
|
-
const rawThumbs = flattenChildren(children);
|
|
82
|
-
const values = Array.isArray(mergedProps == null ? void 0 : mergedProps.value) ? mergedProps.value : [mergedProps.value].filter((v) => v !== void 0);
|
|
83
|
-
const difference = values.length - rawThumbs.length;
|
|
84
|
-
if (!difference) {
|
|
85
|
-
return rawThumbs;
|
|
86
|
-
}
|
|
87
|
-
if (difference < 0) {
|
|
88
|
-
return rawThumbs.slice(0, values.length);
|
|
89
|
-
}
|
|
90
|
-
const lastThumb = rawThumbs[rawThumbs.length - 1];
|
|
91
|
-
return rawThumbs.concat(new Array(difference).fill(lastThumb));
|
|
92
|
-
}, [children, mergedProps.value]);
|
|
93
|
-
const track = /* @__PURE__ */ React.createElement(SliderTrack, __spreadValues$1({ style: { position: "relative" } }, rest), ({ state, isHovered }) => /* @__PURE__ */ React.createElement(React.Fragment, null, withObservedValues$1(
|
|
94
|
-
/* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
95
|
-
"div",
|
|
96
|
-
{
|
|
97
|
-
style: {
|
|
98
|
-
width: `${(!isMultiValue ? state.getThumbPercent(minIndex) : state.getThumbPercent(maxIndex) - state.getThumbPercent(minIndex)) * 100}%`,
|
|
99
|
-
height: "100%",
|
|
100
|
-
position: "absolute",
|
|
101
|
-
top: 0,
|
|
102
|
-
left: !isMultiValue ? 0 : state.getThumbPercent(minIndex) * 100 + "%"
|
|
103
|
-
}
|
|
104
|
-
},
|
|
105
|
-
progressBar
|
|
106
|
-
), thumbs.map(
|
|
107
|
-
(thumb, i) => React.isValidElement(thumb) && React.cloneElement(thumb, {
|
|
108
|
-
// sets the index of the thumb, so that each thumb reflects the correct value
|
|
109
|
-
index: i
|
|
110
|
-
})
|
|
111
|
-
)),
|
|
112
|
-
{
|
|
113
|
-
hovered: isHovered
|
|
114
|
-
},
|
|
115
|
-
updateInteractionVariant
|
|
116
|
-
)));
|
|
117
|
-
return /* @__PURE__ */ React.createElement(
|
|
118
|
-
ErrorBoundary,
|
|
119
|
-
{
|
|
120
|
-
fallback: /* @__PURE__ */ React.createElement(Slider, { style: { height: "100%", width: "100%" } }, track)
|
|
121
|
-
},
|
|
122
|
-
track
|
|
123
|
-
);
|
|
124
|
-
}
|
|
125
|
-
const SLIDER_TRACK_COMPONENT_NAME = makeComponentName("sliderTrack");
|
|
126
|
-
function registerSliderTrack(loader, overrides) {
|
|
127
|
-
registerComponentHelper(
|
|
128
|
-
loader,
|
|
129
|
-
BaseSliderTrack,
|
|
130
|
-
{
|
|
131
|
-
name: SLIDER_TRACK_COMPONENT_NAME,
|
|
132
|
-
displayName: "Aria Slider Track",
|
|
133
|
-
importPath: "@plasmicpkgs/react-aria/skinny/registerSliderTrack",
|
|
134
|
-
importName: "BaseSliderTrack",
|
|
135
|
-
interactionVariants: interactionVariants$1,
|
|
136
|
-
defaultStyles: {
|
|
137
|
-
width: "stretch",
|
|
138
|
-
backgroundColor: "#aaa",
|
|
139
|
-
position: "relative",
|
|
140
|
-
height: "10px",
|
|
141
|
-
padding: 0
|
|
142
|
-
},
|
|
143
|
-
props: {
|
|
144
|
-
children: {
|
|
145
|
-
type: "slot",
|
|
146
|
-
description: "The thumbs of the slider",
|
|
147
|
-
defaultValue: [
|
|
148
|
-
{
|
|
149
|
-
type: "component",
|
|
150
|
-
name: makeChildComponentName(
|
|
151
|
-
SLIDER_COMPONENT_NAME,
|
|
152
|
-
SLIDER_THUMB_COMPONENT_NAME
|
|
153
|
-
)
|
|
154
|
-
}
|
|
155
|
-
]
|
|
156
|
-
},
|
|
157
|
-
progressBar: {
|
|
158
|
-
type: "slot",
|
|
159
|
-
displayName: "Progress Bar",
|
|
160
|
-
defaultValue: [
|
|
161
|
-
{
|
|
162
|
-
type: "box",
|
|
163
|
-
styles: {
|
|
164
|
-
height: "100%",
|
|
165
|
-
width: "100%",
|
|
166
|
-
backgroundColor: "#ffa6a6",
|
|
167
|
-
padding: 0
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
]
|
|
171
|
-
},
|
|
172
|
-
onHoverStart: {
|
|
173
|
-
type: "eventHandler",
|
|
174
|
-
argTypes: [{ name: "event", type: "object" }]
|
|
175
|
-
},
|
|
176
|
-
onHoverEnd: {
|
|
177
|
-
type: "eventHandler",
|
|
178
|
-
argTypes: [{ name: "event", type: "object" }]
|
|
179
|
-
},
|
|
180
|
-
onHoverChange: {
|
|
181
|
-
type: "eventHandler",
|
|
182
|
-
argTypes: [{ name: "isHovering", type: "boolean" }]
|
|
183
|
-
}
|
|
184
|
-
},
|
|
185
|
-
trapsFocus: true
|
|
186
|
-
},
|
|
187
|
-
overrides
|
|
188
|
-
);
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
var __defProp = Object.defineProperty;
|
|
192
|
-
var __defProps = Object.defineProperties;
|
|
193
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
194
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
195
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
196
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
197
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
198
|
-
var __spreadValues = (a, b) => {
|
|
199
|
-
for (var prop in b || (b = {}))
|
|
200
|
-
if (__hasOwnProp.call(b, prop))
|
|
201
|
-
__defNormalProp(a, prop, b[prop]);
|
|
202
|
-
if (__getOwnPropSymbols)
|
|
203
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
204
|
-
if (__propIsEnum.call(b, prop))
|
|
205
|
-
__defNormalProp(a, prop, b[prop]);
|
|
206
|
-
}
|
|
207
|
-
return a;
|
|
208
|
-
};
|
|
209
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
210
|
-
var __objRest = (source, exclude) => {
|
|
211
|
-
var target = {};
|
|
212
|
-
for (var prop in source)
|
|
213
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
214
|
-
target[prop] = source[prop];
|
|
215
|
-
if (source != null && __getOwnPropSymbols)
|
|
216
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
217
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
218
|
-
target[prop] = source[prop];
|
|
219
|
-
}
|
|
220
|
-
return target;
|
|
221
|
-
};
|
|
222
|
-
const SLIDER_COMPONENT_NAME = makeComponentName("slider");
|
|
223
|
-
const SLIDER_INTERACTION_VARIANTS = ["disabled"];
|
|
224
|
-
const { interactionVariants, withObservedValues } = pickAriaComponentVariants(
|
|
225
|
-
SLIDER_INTERACTION_VARIANTS
|
|
226
|
-
);
|
|
227
|
-
const sliderHelpers = {
|
|
228
|
-
states: {
|
|
229
|
-
range: {
|
|
230
|
-
onChangeArgsToValue: (value, isMultiValue) => {
|
|
231
|
-
if (isMultiValue) {
|
|
232
|
-
return Array.isArray(value) ? value : [value, value + 10];
|
|
233
|
-
}
|
|
234
|
-
return void 0;
|
|
235
|
-
}
|
|
236
|
-
},
|
|
237
|
-
value: {
|
|
238
|
-
onChangeArgsToValue: (value, isMultiValue) => {
|
|
239
|
-
if (isMultiValue) {
|
|
240
|
-
return void 0;
|
|
241
|
-
}
|
|
242
|
-
return Array.isArray(value) ? value[0] : value;
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
};
|
|
247
|
-
function BaseSlider(props) {
|
|
248
|
-
const _a = props, {
|
|
249
|
-
range,
|
|
250
|
-
value,
|
|
251
|
-
defaultRange,
|
|
252
|
-
children,
|
|
253
|
-
updateInteractionVariant,
|
|
254
|
-
defaultValue,
|
|
255
|
-
onChange
|
|
256
|
-
} = _a, rest = __objRest(_a, [
|
|
257
|
-
"range",
|
|
258
|
-
"value",
|
|
259
|
-
"defaultRange",
|
|
260
|
-
"children",
|
|
261
|
-
"updateInteractionVariant",
|
|
262
|
-
"defaultValue",
|
|
263
|
-
"onChange"
|
|
264
|
-
]);
|
|
265
|
-
const isFirstRender = useRef(true);
|
|
266
|
-
useEffect(() => {
|
|
267
|
-
var _a2, _b, _c;
|
|
268
|
-
if (isFirstRender.current) {
|
|
269
|
-
isFirstRender.current = false;
|
|
270
|
-
return;
|
|
271
|
-
}
|
|
272
|
-
if (props.isMultiValue) {
|
|
273
|
-
const minValue = (_a2 = props.minValue) != null ? _a2 : 0;
|
|
274
|
-
(_b = props.onChange) == null ? void 0 : _b.call(
|
|
275
|
-
props,
|
|
276
|
-
Array.isArray(range) && range.length > 1 ? range : [minValue, minValue + 10],
|
|
277
|
-
true
|
|
278
|
-
);
|
|
279
|
-
return;
|
|
280
|
-
}
|
|
281
|
-
(_c = props.onChange) == null ? void 0 : _c.call(props, Array.isArray(value) ? 0 : value != null ? value : 0, false);
|
|
282
|
-
}, [props.isMultiValue]);
|
|
283
|
-
const mergedProps = mergeProps(rest, {
|
|
284
|
-
value: props.isMultiValue ? range : value,
|
|
285
|
-
defaultValue: props.isMultiValue ? defaultRange : defaultValue
|
|
286
|
-
});
|
|
287
|
-
return /* @__PURE__ */ React.createElement(PlasmicSliderContext.Provider, { value: mergedProps }, /* @__PURE__ */ React.createElement(
|
|
288
|
-
Slider,
|
|
289
|
-
__spreadValues({
|
|
290
|
-
key: props.isMultiValue ? "multi" : "single",
|
|
291
|
-
onChange: (newValue) => {
|
|
292
|
-
onChange == null ? void 0 : onChange(newValue, props.isMultiValue);
|
|
293
|
-
}
|
|
294
|
-
}, mergedProps),
|
|
295
|
-
({ isDisabled }) => withObservedValues(
|
|
296
|
-
children,
|
|
297
|
-
{
|
|
298
|
-
disabled: isDisabled
|
|
299
|
-
},
|
|
300
|
-
updateInteractionVariant
|
|
301
|
-
)
|
|
302
|
-
));
|
|
303
|
-
}
|
|
304
|
-
function registerSlider(loader, overrides) {
|
|
305
|
-
registerComponentHelper(
|
|
306
|
-
loader,
|
|
307
|
-
BaseSlider,
|
|
308
|
-
{
|
|
309
|
-
name: SLIDER_COMPONENT_NAME,
|
|
310
|
-
displayName: "Aria Slider",
|
|
311
|
-
importPath: "@plasmicpkgs/react-aria/skinny/registerSlider",
|
|
312
|
-
importName: "BaseSlider",
|
|
313
|
-
interactionVariants,
|
|
314
|
-
defaultStyles: {
|
|
315
|
-
width: "300px"
|
|
316
|
-
},
|
|
317
|
-
props: __spreadProps(__spreadValues({}, getCommonProps("slider", [
|
|
318
|
-
"isDisabled",
|
|
319
|
-
"name",
|
|
320
|
-
"autoFocus",
|
|
321
|
-
"aria-label"
|
|
322
|
-
])), {
|
|
323
|
-
children: {
|
|
324
|
-
type: "slot",
|
|
325
|
-
defaultValue: [
|
|
326
|
-
{
|
|
327
|
-
type: "hbox",
|
|
328
|
-
styles: {
|
|
329
|
-
width: "stretch",
|
|
330
|
-
justifyContent: "space-between",
|
|
331
|
-
padding: "8px 0px"
|
|
332
|
-
},
|
|
333
|
-
children: [
|
|
334
|
-
{
|
|
335
|
-
type: "component",
|
|
336
|
-
name: LABEL_COMPONENT_NAME,
|
|
337
|
-
props: {
|
|
338
|
-
children: {
|
|
339
|
-
type: "text",
|
|
340
|
-
value: "Label"
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
|
-
},
|
|
344
|
-
{
|
|
345
|
-
type: "component",
|
|
346
|
-
name: makeChildComponentName(
|
|
347
|
-
SLIDER_COMPONENT_NAME,
|
|
348
|
-
SLIDER_OUTPUT_COMPONENT_NAME
|
|
349
|
-
),
|
|
350
|
-
props: {
|
|
351
|
-
children: {
|
|
352
|
-
type: "text",
|
|
353
|
-
value: "Output"
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
]
|
|
358
|
-
},
|
|
359
|
-
{
|
|
360
|
-
type: "component",
|
|
361
|
-
name: makeChildComponentName(
|
|
362
|
-
SLIDER_COMPONENT_NAME,
|
|
363
|
-
SLIDER_TRACK_COMPONENT_NAME
|
|
364
|
-
)
|
|
365
|
-
}
|
|
366
|
-
]
|
|
367
|
-
},
|
|
368
|
-
orientation: {
|
|
369
|
-
type: "choice",
|
|
370
|
-
options: ["horizontal", "vertical"],
|
|
371
|
-
defaultValueHint: "horizontal",
|
|
372
|
-
defaultValue: "horizontal"
|
|
373
|
-
},
|
|
374
|
-
minValue: {
|
|
375
|
-
type: "number",
|
|
376
|
-
description: "The minimum value of the slider",
|
|
377
|
-
defaultValueHint: 0
|
|
378
|
-
},
|
|
379
|
-
maxValue: {
|
|
380
|
-
type: "number",
|
|
381
|
-
description: "The maximum value of the slider",
|
|
382
|
-
defaultValueHint: 100
|
|
383
|
-
},
|
|
384
|
-
step: {
|
|
385
|
-
type: "number",
|
|
386
|
-
description: "The step value of the slider",
|
|
387
|
-
defaultValueHint: 1
|
|
388
|
-
},
|
|
389
|
-
isMultiValue: {
|
|
390
|
-
type: "boolean",
|
|
391
|
-
displayName: "Multi-valued",
|
|
392
|
-
description: "Whether the slider supports range (multiple thumbs)",
|
|
393
|
-
defaultValue: false,
|
|
394
|
-
defaultValueHint: false
|
|
395
|
-
},
|
|
396
|
-
range: {
|
|
397
|
-
type: "array",
|
|
398
|
-
editOnly: true,
|
|
399
|
-
uncontrolledProp: "defaultRange",
|
|
400
|
-
description: "The default range of the slider",
|
|
401
|
-
defaultValueHint: [10, 20],
|
|
402
|
-
defaultValue: [10, 20],
|
|
403
|
-
hidden: (ps) => !ps.isMultiValue
|
|
404
|
-
},
|
|
405
|
-
value: {
|
|
406
|
-
type: "number",
|
|
407
|
-
editOnly: true,
|
|
408
|
-
uncontrolledProp: "defaultValue",
|
|
409
|
-
description: "The default value of the slider",
|
|
410
|
-
defaultValueHint: 0,
|
|
411
|
-
defaultValue: 0,
|
|
412
|
-
hidden: (ps) => Boolean(ps.isMultiValue)
|
|
413
|
-
},
|
|
414
|
-
onChange: {
|
|
415
|
-
type: "eventHandler",
|
|
416
|
-
argTypes: [{ name: "value", type: "object" }]
|
|
417
|
-
},
|
|
418
|
-
onChangeEnd: {
|
|
419
|
-
type: "eventHandler",
|
|
420
|
-
argTypes: [{ name: "value", type: "object" }]
|
|
421
|
-
}
|
|
422
|
-
}),
|
|
423
|
-
states: {
|
|
424
|
-
range: __spreadValues({
|
|
425
|
-
type: "writable",
|
|
426
|
-
valueProp: "range",
|
|
427
|
-
onChangeProp: "onChange",
|
|
428
|
-
variableType: "array",
|
|
429
|
-
hidden: (ps) => !ps.isMultiValue
|
|
430
|
-
}, sliderHelpers.states.range),
|
|
431
|
-
value: __spreadValues({
|
|
432
|
-
type: "writable",
|
|
433
|
-
valueProp: "value",
|
|
434
|
-
onChangeProp: "onChange",
|
|
435
|
-
variableType: "number",
|
|
436
|
-
hidden: (ps) => Boolean(ps.isMultiValue)
|
|
437
|
-
}, sliderHelpers.states.value)
|
|
438
|
-
},
|
|
439
|
-
componentHelpers: {
|
|
440
|
-
helpers: sliderHelpers,
|
|
441
|
-
importName: "sliderHelpers",
|
|
442
|
-
importPath: "@plasmicpkgs/react-aria/skinny/registerSlider"
|
|
443
|
-
},
|
|
444
|
-
trapsFocus: true
|
|
445
|
-
},
|
|
446
|
-
overrides
|
|
447
|
-
);
|
|
448
|
-
registerSliderOutput(loader, {
|
|
449
|
-
parentComponentName: SLIDER_COMPONENT_NAME
|
|
450
|
-
});
|
|
451
|
-
registerSliderThumb(loader, {
|
|
452
|
-
parentComponentName: SLIDER_COMPONENT_NAME
|
|
453
|
-
});
|
|
454
|
-
registerSliderTrack(loader, {
|
|
455
|
-
parentComponentName: SLIDER_COMPONENT_NAME
|
|
456
|
-
});
|
|
457
|
-
}
|
|
458
|
-
|
|
459
|
-
export { BaseSliderTrack as B, SLIDER_TRACK_COMPONENT_NAME as S, SLIDER_COMPONENT_NAME as a, BaseSlider as b, registerSlider as c, registerSliderTrack as r, sliderHelpers as s };
|
|
460
|
-
//# sourceMappingURL=registerSlider-df0fdf82.esm.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"registerSlider-df0fdf82.esm.js","sources":["../src/registerSliderTrack.tsx","../src/registerSlider.tsx"],"sourcesContent":["import React, { useMemo } from \"react\";\nimport { mergeProps } from \"react-aria\";\nimport { Slider, SliderThumbProps, SliderTrack } from \"react-aria-components\";\nimport flattenChildren from \"react-keyed-flatten-children\";\nimport { PlasmicSliderContext } from \"./contexts\";\nimport ErrorBoundary from \"./ErrorBoundary\";\nimport {\n UpdateInteractionVariant,\n pickAriaComponentVariants,\n} from \"./interaction-variant-utils\";\nimport { SLIDER_COMPONENT_NAME } from \"./registerSlider\";\nimport { SLIDER_THUMB_COMPONENT_NAME } from \"./registerSliderThumb\";\nimport {\n CodeComponentMetaOverrides,\n Registerable,\n makeChildComponentName,\n makeComponentName,\n registerComponentHelper,\n} from \"./utils\";\n\nconst SLIDER_TRACK_INTERACTION_VARIANTS = [\"hovered\" as const];\n\nconst { interactionVariants, withObservedValues } = pickAriaComponentVariants(\n SLIDER_TRACK_INTERACTION_VARIANTS\n);\n\nexport interface BaseSliderTrackProps\n extends React.ComponentProps<typeof SliderTrack> {\n progressBar?: React.ReactNode;\n // Optional callback to update the interaction variant state\n // as it's only provided if the component is the root of a Studio component\n updateInteractionVariant?: UpdateInteractionVariant<\n typeof SLIDER_TRACK_INTERACTION_VARIANTS\n >;\n children?: React.ReactElement<HTMLElement>;\n}\n\n/**\n * Finds the index of the minimum and maximum values in the slider\n * @param values\n * @returns\n */\nfunction findMinMaxIndices(values?: number | number[]): {\n minIndex: number;\n maxIndex: number;\n} {\n if (\n typeof values === \"number\" ||\n values?.length === 0 ||\n !Array.isArray(values)\n ) {\n return { minIndex: 0, maxIndex: 0 };\n }\n\n let minIndex = 0;\n let maxIndex = 0;\n\n for (let i = 1; i < values.length; i++) {\n if (values[i] < values[minIndex]) {\n minIndex = i;\n }\n if (values[i] > values[maxIndex]) {\n maxIndex = i;\n }\n }\n\n return { minIndex, maxIndex };\n}\n\nexport function BaseSliderTrack(props: BaseSliderTrackProps) {\n const context = React.useContext(PlasmicSliderContext);\n const mergedProps = mergeProps(context, props);\n const {\n children,\n progressBar,\n updateInteractionVariant,\n isMultiValue,\n ...rest\n } = mergedProps;\n\n const { minIndex, maxIndex } = useMemo(\n () => findMinMaxIndices(mergedProps.value),\n [mergedProps.value]\n );\n\n /**\n * Generates the thumb components based on the number of thumbs\n * and the number of values in the slider\n *\n * If the number of thumbs is less than the number of values, then\n * the last thumb is repeated for the remaining values\n *\n * If the number of thumbs is greater than the number of values, then\n * the additional thumbs are omitted\n */\n const thumbs = useMemo(() => {\n const rawThumbs = flattenChildren(children);\n const values = Array.isArray(mergedProps?.value)\n ? mergedProps.value\n : [mergedProps.value].filter((v) => v !== undefined);\n const difference = values.length - rawThumbs.length;\n if (!difference) {\n return rawThumbs;\n }\n if (difference < 0) {\n return rawThumbs.slice(0, values.length);\n }\n const lastThumb = rawThumbs[rawThumbs.length - 1];\n return rawThumbs.concat(new Array(difference).fill(lastThumb));\n }, [children, mergedProps.value]);\n\n const track = (\n <SliderTrack style={{ position: \"relative\" }} {...rest}>\n {({ state, isHovered }) => (\n <>\n {withObservedValues(\n <>\n <div\n style={{\n width: `${\n (!isMultiValue\n ? state.getThumbPercent(minIndex)\n : state.getThumbPercent(maxIndex) -\n state.getThumbPercent(minIndex)) * 100\n }%`,\n height: \"100%\",\n position: \"absolute\",\n top: 0,\n left: !isMultiValue\n ? 0\n : state.getThumbPercent(minIndex) * 100 + \"%\",\n }}\n >\n {progressBar}\n </div>\n {thumbs.map(\n (thumb, i) =>\n React.isValidElement(thumb) &&\n React.cloneElement(thumb, {\n // sets the index of the thumb, so that each thumb reflects the correct value\n index: i,\n } as SliderThumbProps)\n )}\n </>,\n {\n hovered: isHovered,\n },\n updateInteractionVariant\n )}\n </>\n )}\n </SliderTrack>\n );\n\n return (\n <ErrorBoundary\n // If the Slider Track is the root of a Studio component, then we need to wrap the track in a slider\n // to ensure that the track gets the required Slider context\n fallback={\n <Slider style={{ height: \"100%\", width: \"100%\" }}>{track}</Slider>\n }\n >\n {track}\n </ErrorBoundary>\n );\n}\n\nexport const SLIDER_TRACK_COMPONENT_NAME = makeComponentName(\"sliderTrack\");\n\nexport function registerSliderTrack(\n loader?: Registerable,\n overrides?: CodeComponentMetaOverrides<typeof BaseSliderTrack>\n) {\n registerComponentHelper(\n loader,\n BaseSliderTrack,\n {\n name: SLIDER_TRACK_COMPONENT_NAME,\n displayName: \"Aria Slider Track\",\n importPath: \"@plasmicpkgs/react-aria/skinny/registerSliderTrack\",\n importName: \"BaseSliderTrack\",\n interactionVariants,\n defaultStyles: {\n width: \"stretch\",\n backgroundColor: \"#aaa\",\n position: \"relative\",\n height: \"10px\",\n padding: 0,\n },\n props: {\n children: {\n type: \"slot\",\n description: \"The thumbs of the slider\",\n defaultValue: [\n {\n type: \"component\",\n name: makeChildComponentName(\n SLIDER_COMPONENT_NAME,\n SLIDER_THUMB_COMPONENT_NAME\n ),\n },\n ],\n },\n progressBar: {\n type: \"slot\",\n displayName: \"Progress Bar\",\n defaultValue: [\n {\n type: \"box\",\n styles: {\n height: \"100%\",\n width: \"100%\",\n backgroundColor: \"#ffa6a6\",\n padding: 0,\n },\n },\n ],\n },\n onHoverStart: {\n type: \"eventHandler\",\n argTypes: [{ name: \"event\", type: \"object\" }],\n },\n onHoverEnd: {\n type: \"eventHandler\",\n argTypes: [{ name: \"event\", type: \"object\" }],\n },\n onHoverChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"isHovering\", type: \"boolean\" }],\n },\n },\n trapsFocus: true,\n },\n overrides\n );\n}\n","import React, { useEffect, useRef } from \"react\";\nimport { mergeProps } from \"react-aria\";\nimport { Slider, type SliderProps } from \"react-aria-components\";\nimport { getCommonProps } from \"./common\";\nimport { PlasmicSliderContext } from \"./contexts\";\nimport {\n UpdateInteractionVariant,\n pickAriaComponentVariants,\n} from \"./interaction-variant-utils\";\nimport { LABEL_COMPONENT_NAME } from \"./registerLabel\";\nimport {\n SLIDER_OUTPUT_COMPONENT_NAME,\n registerSliderOutput,\n} from \"./registerSliderOutput\";\nimport { registerSliderThumb } from \"./registerSliderThumb\";\nimport {\n SLIDER_TRACK_COMPONENT_NAME,\n registerSliderTrack,\n} from \"./registerSliderTrack\";\nimport {\n CodeComponentMetaOverrides,\n Registerable,\n makeChildComponentName,\n makeComponentName,\n registerComponentHelper,\n} from \"./utils\";\n\nexport const SLIDER_COMPONENT_NAME = makeComponentName(\"slider\");\n\nconst SLIDER_INTERACTION_VARIANTS = [\"disabled\" as const];\n\nexport interface BaseSliderProps\n extends Omit<SliderProps<number | number[]>, \"onChange\"> {\n // Passed down to Slider Thumb via context\n name?: string;\n autoFocus?: boolean;\n isMultiValue?: boolean;\n range?: number[];\n defaultRange?: number[];\n children?: React.ReactNode;\n onChange?: (value: number | number[], isMultiValue?: boolean) => void;\n // Optional callback to update the interaction variant state\n // as it's only provided if the component is the root of a Studio component\n updateInteractionVariant?: UpdateInteractionVariant<\n typeof SLIDER_INTERACTION_VARIANTS\n >;\n}\n\nconst { interactionVariants, withObservedValues } = pickAriaComponentVariants(\n SLIDER_INTERACTION_VARIANTS\n);\n\nexport const sliderHelpers = {\n states: {\n range: {\n onChangeArgsToValue: (value: number[], isMultiValue: boolean) => {\n if (isMultiValue) {\n return Array.isArray(value) ? value : [value, value + 10];\n }\n return undefined;\n },\n },\n value: {\n onChangeArgsToValue: (value: number, isMultiValue: boolean) => {\n if (isMultiValue) {\n return undefined;\n }\n return Array.isArray(value) ? value[0] : value;\n },\n },\n },\n};\n\nexport function BaseSlider(props: BaseSliderProps) {\n const {\n range,\n value,\n defaultRange,\n children,\n updateInteractionVariant,\n defaultValue,\n onChange,\n ...rest\n } = props;\n const isFirstRender = useRef(true);\n\n useEffect(() => {\n if (isFirstRender.current) {\n isFirstRender.current = false;\n return;\n }\n if (props.isMultiValue) {\n const minValue = props.minValue ?? 0;\n props.onChange?.(\n Array.isArray(range) && range.length > 1\n ? range\n : [minValue, minValue + 10],\n true\n );\n return;\n }\n props.onChange?.(Array.isArray(value) ? 0 : value ?? 0, false);\n }, [props.isMultiValue]);\n\n const mergedProps = mergeProps(rest, {\n value: props.isMultiValue ? range : value,\n defaultValue: props.isMultiValue ? defaultRange : defaultValue,\n });\n return (\n <PlasmicSliderContext.Provider value={mergedProps}>\n <Slider\n key={props.isMultiValue ? \"multi\" : \"single\"}\n onChange={(newValue) => {\n onChange?.(newValue, props.isMultiValue);\n }}\n {...mergedProps}\n >\n {({ isDisabled }) =>\n withObservedValues(\n children,\n {\n disabled: isDisabled,\n },\n updateInteractionVariant\n )\n }\n </Slider>\n </PlasmicSliderContext.Provider>\n );\n}\n\nexport function registerSlider(\n loader?: Registerable,\n overrides?: CodeComponentMetaOverrides<typeof BaseSlider>\n) {\n registerComponentHelper(\n loader,\n BaseSlider,\n {\n name: SLIDER_COMPONENT_NAME,\n displayName: \"Aria Slider\",\n importPath: \"@plasmicpkgs/react-aria/skinny/registerSlider\",\n importName: \"BaseSlider\",\n interactionVariants,\n defaultStyles: {\n width: \"300px\",\n },\n props: {\n ...getCommonProps<BaseSliderProps>(\"slider\", [\n \"isDisabled\",\n \"name\",\n \"autoFocus\",\n \"aria-label\",\n ]),\n children: {\n type: \"slot\",\n defaultValue: [\n {\n type: \"hbox\",\n styles: {\n width: \"stretch\",\n justifyContent: \"space-between\",\n padding: \"8px 0px\",\n },\n children: [\n {\n type: \"component\",\n name: LABEL_COMPONENT_NAME,\n props: {\n children: {\n type: \"text\",\n value: \"Label\",\n },\n },\n },\n {\n type: \"component\",\n name: makeChildComponentName(\n SLIDER_COMPONENT_NAME,\n SLIDER_OUTPUT_COMPONENT_NAME\n ),\n props: {\n children: {\n type: \"text\",\n value: \"Output\",\n },\n },\n },\n ],\n },\n {\n type: \"component\",\n name: makeChildComponentName(\n SLIDER_COMPONENT_NAME,\n SLIDER_TRACK_COMPONENT_NAME\n ),\n },\n ],\n },\n orientation: {\n type: \"choice\",\n options: [\"horizontal\", \"vertical\"],\n defaultValueHint: \"horizontal\",\n defaultValue: \"horizontal\",\n },\n minValue: {\n type: \"number\",\n description: \"The minimum value of the slider\",\n defaultValueHint: 0,\n },\n maxValue: {\n type: \"number\",\n description: \"The maximum value of the slider\",\n defaultValueHint: 100,\n },\n step: {\n type: \"number\",\n description: \"The step value of the slider\",\n defaultValueHint: 1,\n },\n isMultiValue: {\n type: \"boolean\",\n displayName: \"Multi-valued\",\n description: \"Whether the slider supports range (multiple thumbs)\",\n defaultValue: false,\n defaultValueHint: false,\n },\n range: {\n type: \"array\",\n editOnly: true,\n uncontrolledProp: \"defaultRange\",\n description: \"The default range of the slider\",\n defaultValueHint: [10, 20],\n defaultValue: [10, 20],\n hidden: (ps: BaseSliderProps) => !ps.isMultiValue,\n },\n value: {\n type: \"number\",\n editOnly: true,\n uncontrolledProp: \"defaultValue\",\n description: \"The default value of the slider\",\n defaultValueHint: 0,\n defaultValue: 0,\n hidden: (ps: BaseSliderProps) => Boolean(ps.isMultiValue),\n },\n onChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"value\", type: \"object\" }],\n },\n onChangeEnd: {\n type: \"eventHandler\",\n argTypes: [{ name: \"value\", type: \"object\" }],\n },\n },\n states: {\n range: {\n type: \"writable\",\n valueProp: \"range\",\n onChangeProp: \"onChange\",\n variableType: \"array\",\n hidden: (ps: BaseSliderProps) => !ps.isMultiValue,\n ...sliderHelpers.states.range,\n },\n value: {\n type: \"writable\",\n valueProp: \"value\",\n onChangeProp: \"onChange\",\n variableType: \"number\",\n hidden: (ps: BaseSliderProps) => Boolean(ps.isMultiValue),\n ...sliderHelpers.states.value,\n },\n },\n componentHelpers: {\n helpers: sliderHelpers,\n importName: \"sliderHelpers\",\n importPath: \"@plasmicpkgs/react-aria/skinny/registerSlider\",\n },\n trapsFocus: true,\n },\n overrides\n );\n\n registerSliderOutput(loader, {\n parentComponentName: SLIDER_COMPONENT_NAME,\n });\n\n registerSliderThumb(loader, {\n parentComponentName: SLIDER_COMPONENT_NAME,\n });\n registerSliderTrack(loader, {\n parentComponentName: SLIDER_COMPONENT_NAME,\n });\n}\n"],"names":["interactionVariants","withObservedValues","__objRest","__spreadValues","_a"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBA,MAAM,iCAAA,GAAoC,CAAC,SAAkB,CAAA,CAAA;AAE7D,MAAM,uBAAEA,qBAAqB,sBAAAC,oBAAA,EAAuB,GAAA,yBAAA;AAAA,EAClD,iCAAA;AACF,CAAA,CAAA;AAkBA,SAAS,kBAAkB,MAGzB,EAAA;AACA,EACE,IAAA,OAAO,MAAW,KAAA,QAAA,IAAA,CAClB,MAAQ,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,MAAA,CAAA,MAAA,MAAW,KACnB,CAAC,KAAA,CAAM,OAAQ,CAAA,MAAM,CACrB,EAAA;AACA,IAAA,OAAO,EAAE,QAAA,EAAU,CAAG,EAAA,QAAA,EAAU,CAAE,EAAA,CAAA;AAAA,GACpC;AAEA,EAAA,IAAI,QAAW,GAAA,CAAA,CAAA;AACf,EAAA,IAAI,QAAW,GAAA,CAAA,CAAA;AAEf,EAAA,KAAA,IAAS,CAAI,GAAA,CAAA,EAAG,CAAI,GAAA,MAAA,CAAO,QAAQ,CAAK,EAAA,EAAA;AACtC,IAAA,IAAI,MAAO,CAAA,CAAC,CAAI,GAAA,MAAA,CAAO,QAAQ,CAAG,EAAA;AAChC,MAAW,QAAA,GAAA,CAAA,CAAA;AAAA,KACb;AACA,IAAA,IAAI,MAAO,CAAA,CAAC,CAAI,GAAA,MAAA,CAAO,QAAQ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