@plasmicpkgs/react-aria 0.0.27 → 0.0.29
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 -7
- package/dist/interaction-variant-utils.d.ts +4 -0
- package/dist/option-utils.d.ts +4 -13
- package/dist/react-aria.esm.js +1193 -686
- package/dist/react-aria.esm.js.map +1 -1
- package/dist/react-aria.js +1190 -683
- package/dist/react-aria.js.map +1 -1
- package/dist/registerDialogTrigger.d.ts +10 -0
- package/dist/registerLabel.d.ts +1 -0
- package/dist/registerListBox.d.ts +7 -5
- package/dist/registerListBoxItem.d.ts +2 -4
- package/dist/registerPopover.d.ts +4 -2
- package/dist/registerSection.d.ts +1 -3
- package/dist/registerSelect.d.ts +1 -1
- package/dist/registerSlider.d.ts +14 -0
- package/dist/registerSliderOutput.d.ts +5 -0
- package/dist/registerSliderThumb.d.ts +13 -0
- package/dist/registerSliderTrack.d.ts +14 -0
- package/package.json +3 -3
- package/skinny/ErrorBoundary-c6b111d3.esm.js +20 -0
- package/skinny/ErrorBoundary-c6b111d3.esm.js.map +1 -0
- package/skinny/ErrorBoundary-e9b86248.cjs.js +22 -0
- package/skinny/ErrorBoundary-e9b86248.cjs.js.map +1 -0
- package/skinny/{contexts-49f6c298.esm.js → contexts-8a2a183b.esm.js} +3 -2
- package/skinny/contexts-8a2a183b.esm.js.map +1 -0
- package/skinny/{contexts-3e42cdf9.cjs.js → contexts-dd0ce341.cjs.js} +3 -1
- package/skinny/contexts-dd0ce341.cjs.js.map +1 -0
- package/skinny/contexts.d.ts +3 -7
- package/skinny/{interaction-variant-utils-80bf1cfd.cjs.js → interaction-variant-utils-244b74fb.cjs.js} +20 -2
- package/skinny/interaction-variant-utils-244b74fb.cjs.js.map +1 -0
- package/skinny/{interaction-variant-utils-608d984b.esm.js → interaction-variant-utils-c44a9d56.esm.js} +20 -2
- package/skinny/interaction-variant-utils-c44a9d56.esm.js.map +1 -0
- package/skinny/interaction-variant-utils.d.ts +4 -0
- package/skinny/{option-utils-765a1782.esm.js → option-utils-4f037568.esm.js} +22 -22
- package/skinny/option-utils-4f037568.esm.js.map +1 -0
- package/skinny/{option-utils-0db61f6d.cjs.js → option-utils-5e4e85bd.cjs.js} +22 -22
- package/skinny/option-utils-5e4e85bd.cjs.js.map +1 -0
- package/skinny/option-utils.d.ts +4 -13
- package/skinny/registerButton.cjs.js +5 -1
- package/skinny/registerButton.cjs.js.map +1 -1
- package/skinny/registerButton.esm.js +5 -1
- package/skinny/registerButton.esm.js.map +1 -1
- package/skinny/registerCheckbox.cjs.js +1 -1
- package/skinny/registerCheckbox.esm.js +1 -1
- package/skinny/registerCheckboxGroup.cjs.js +1 -1
- package/skinny/registerCheckboxGroup.esm.js +1 -1
- package/skinny/registerComboBox.cjs.js +11 -19
- package/skinny/registerComboBox.cjs.js.map +1 -1
- package/skinny/registerComboBox.esm.js +11 -19
- package/skinny/registerComboBox.esm.js.map +1 -1
- package/skinny/registerDialogTrigger.cjs.js +88 -0
- package/skinny/registerDialogTrigger.cjs.js.map +1 -0
- package/skinny/registerDialogTrigger.d.ts +10 -0
- package/skinny/registerDialogTrigger.esm.js +81 -0
- package/skinny/registerDialogTrigger.esm.js.map +1 -0
- package/skinny/registerHeader.cjs.js +1 -1
- package/skinny/registerHeader.esm.js +1 -1
- package/skinny/registerInput.cjs.js +1 -1
- package/skinny/registerInput.esm.js +1 -1
- package/skinny/registerLabel.cjs.js +6 -1
- package/skinny/registerLabel.cjs.js.map +1 -1
- package/skinny/registerLabel.d.ts +1 -0
- package/skinny/registerLabel.esm.js +7 -3
- package/skinny/registerLabel.esm.js.map +1 -1
- package/skinny/registerListBox.cjs.js +30 -74
- package/skinny/registerListBox.cjs.js.map +1 -1
- package/skinny/registerListBox.d.ts +7 -5
- package/skinny/registerListBox.esm.js +30 -74
- package/skinny/registerListBox.esm.js.map +1 -1
- package/skinny/registerListBoxItem.cjs.js +4 -20
- package/skinny/registerListBoxItem.cjs.js.map +1 -1
- package/skinny/registerListBoxItem.d.ts +2 -4
- package/skinny/registerListBoxItem.esm.js +4 -20
- package/skinny/registerListBoxItem.esm.js.map +1 -1
- package/skinny/registerPopover.cjs.js +8 -33
- package/skinny/registerPopover.cjs.js.map +1 -1
- package/skinny/registerPopover.d.ts +4 -2
- package/skinny/registerPopover.esm.js +8 -33
- package/skinny/registerPopover.esm.js.map +1 -1
- package/skinny/registerRadio.cjs.js +3 -18
- package/skinny/registerRadio.cjs.js.map +1 -1
- package/skinny/registerRadio.esm.js +3 -18
- package/skinny/registerRadio.esm.js.map +1 -1
- package/skinny/registerRadioGroup.cjs.js +2 -1
- package/skinny/registerRadioGroup.cjs.js.map +1 -1
- package/skinny/registerRadioGroup.esm.js +2 -1
- package/skinny/registerRadioGroup.esm.js.map +1 -1
- package/skinny/registerSection.cjs.js +5 -34
- package/skinny/registerSection.cjs.js.map +1 -1
- package/skinny/registerSection.d.ts +1 -3
- package/skinny/registerSection.esm.js +5 -34
- package/skinny/registerSection.esm.js.map +1 -1
- package/skinny/registerSelect.cjs.js +5 -16
- package/skinny/registerSelect.cjs.js.map +1 -1
- package/skinny/registerSelect.d.ts +1 -1
- package/skinny/registerSelect.esm.js +5 -16
- package/skinny/registerSelect.esm.js.map +1 -1
- package/skinny/registerSlider-73e80194.cjs.js +437 -0
- package/skinny/registerSlider-73e80194.cjs.js.map +1 -0
- package/skinny/registerSlider-efdba013.esm.js +425 -0
- package/skinny/registerSlider-efdba013.esm.js.map +1 -0
- package/skinny/registerSlider.cjs.js +23 -0
- package/skinny/registerSlider.cjs.js.map +1 -0
- package/skinny/registerSlider.d.ts +14 -0
- package/skinny/registerSlider.esm.js +15 -0
- package/skinny/registerSlider.esm.js.map +1 -0
- package/skinny/registerSliderOutput.cjs.js +30 -0
- package/skinny/registerSliderOutput.cjs.js.map +1 -0
- package/skinny/registerSliderOutput.d.ts +5 -0
- package/skinny/registerSliderOutput.esm.js +26 -0
- package/skinny/registerSliderOutput.esm.js.map +1 -0
- package/skinny/registerSliderThumb.cjs.js +119 -0
- package/skinny/registerSliderThumb.cjs.js.map +1 -0
- package/skinny/registerSliderThumb.d.ts +13 -0
- package/skinny/registerSliderThumb.esm.js +111 -0
- package/skinny/registerSliderThumb.esm.js.map +1 -0
- package/skinny/registerSliderTrack.cjs.js +23 -0
- package/skinny/registerSliderTrack.cjs.js.map +1 -0
- package/skinny/registerSliderTrack.d.ts +14 -0
- package/skinny/registerSliderTrack.esm.js +15 -0
- package/skinny/registerSliderTrack.esm.js.map +1 -0
- package/skinny/registerSwitch.cjs.js +1 -1
- package/skinny/registerSwitch.esm.js +1 -1
- package/skinny/registerTextArea.cjs.js +1 -1
- package/skinny/registerTextArea.esm.js +1 -1
- package/skinny/registerTextField.cjs.js +1 -1
- package/skinny/registerTextField.esm.js +1 -1
- package/skinny/registerTooltip.cjs.js +13 -6
- package/skinny/registerTooltip.cjs.js.map +1 -1
- package/skinny/registerTooltip.esm.js +13 -6
- package/skinny/registerTooltip.esm.js.map +1 -1
- package/skinny/contexts-3e42cdf9.cjs.js.map +0 -1
- package/skinny/contexts-49f6c298.esm.js.map +0 -1
- package/skinny/interaction-variant-utils-608d984b.esm.js.map +0 -1
- package/skinny/interaction-variant-utils-80bf1cfd.cjs.js.map +0 -1
- package/skinny/option-utils-0db61f6d.cjs.js.map +0 -1
- package/skinny/option-utils-765a1782.esm.js.map +0 -1
package/dist/react-aria.js
CHANGED
|
@@ -82,9 +82,17 @@ const ARIA_COMPONENTS_INTERACTION_VARIANTS = {
|
|
|
82
82
|
focusVisible: {
|
|
83
83
|
cssSelector: "[data-focus-visible]",
|
|
84
84
|
displayName: "Focus Visible"
|
|
85
|
+
},
|
|
86
|
+
dragging: {
|
|
87
|
+
cssSelector: "[data-dragging]",
|
|
88
|
+
displayName: "Dragging"
|
|
85
89
|
}
|
|
86
90
|
};
|
|
87
|
-
function
|
|
91
|
+
function ChangesObserver({
|
|
92
|
+
children,
|
|
93
|
+
changes,
|
|
94
|
+
updateInteractionVariant
|
|
95
|
+
}) {
|
|
88
96
|
React__default.default.useEffect(() => {
|
|
89
97
|
if (updateInteractionVariant) {
|
|
90
98
|
updateInteractionVariant(changes);
|
|
@@ -92,6 +100,16 @@ function realWithObservedValues(children, changes, updateInteractionVariant) {
|
|
|
92
100
|
}, [changes, updateInteractionVariant]);
|
|
93
101
|
return children;
|
|
94
102
|
}
|
|
103
|
+
function realWithObservedValues(children, changes, updateInteractionVariant) {
|
|
104
|
+
return /* @__PURE__ */ React__default.default.createElement(
|
|
105
|
+
ChangesObserver,
|
|
106
|
+
{
|
|
107
|
+
changes,
|
|
108
|
+
updateInteractionVariant
|
|
109
|
+
},
|
|
110
|
+
children
|
|
111
|
+
);
|
|
112
|
+
}
|
|
95
113
|
function pickAriaComponentVariants(keys) {
|
|
96
114
|
return {
|
|
97
115
|
interactionVariants: Object.fromEntries(
|
|
@@ -101,29 +119,29 @@ function pickAriaComponentVariants(keys) {
|
|
|
101
119
|
};
|
|
102
120
|
}
|
|
103
121
|
|
|
104
|
-
var __defProp$
|
|
122
|
+
var __defProp$p = Object.defineProperty;
|
|
105
123
|
var __defProps$d = Object.defineProperties;
|
|
106
124
|
var __getOwnPropDescs$d = Object.getOwnPropertyDescriptors;
|
|
107
|
-
var __getOwnPropSymbols$
|
|
108
|
-
var __hasOwnProp$
|
|
109
|
-
var __propIsEnum$
|
|
110
|
-
var __defNormalProp$
|
|
111
|
-
var __spreadValues$
|
|
125
|
+
var __getOwnPropSymbols$p = Object.getOwnPropertySymbols;
|
|
126
|
+
var __hasOwnProp$p = Object.prototype.hasOwnProperty;
|
|
127
|
+
var __propIsEnum$p = Object.prototype.propertyIsEnumerable;
|
|
128
|
+
var __defNormalProp$p = (obj, key, value) => key in obj ? __defProp$p(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
129
|
+
var __spreadValues$p = (a, b) => {
|
|
112
130
|
for (var prop in b || (b = {}))
|
|
113
|
-
if (__hasOwnProp$
|
|
114
|
-
__defNormalProp$
|
|
115
|
-
if (__getOwnPropSymbols$
|
|
116
|
-
for (var prop of __getOwnPropSymbols$
|
|
117
|
-
if (__propIsEnum$
|
|
118
|
-
__defNormalProp$
|
|
131
|
+
if (__hasOwnProp$p.call(b, prop))
|
|
132
|
+
__defNormalProp$p(a, prop, b[prop]);
|
|
133
|
+
if (__getOwnPropSymbols$p)
|
|
134
|
+
for (var prop of __getOwnPropSymbols$p(b)) {
|
|
135
|
+
if (__propIsEnum$p.call(b, prop))
|
|
136
|
+
__defNormalProp$p(a, prop, b[prop]);
|
|
119
137
|
}
|
|
120
138
|
return a;
|
|
121
139
|
};
|
|
122
140
|
var __spreadProps$d = (a, b) => __defProps$d(a, __getOwnPropDescs$d(b));
|
|
123
141
|
function registerComponentHelper(loader, component, meta, overrides) {
|
|
124
142
|
if (overrides) {
|
|
125
|
-
meta = __spreadProps$d(__spreadValues$
|
|
126
|
-
props: __spreadValues$
|
|
143
|
+
meta = __spreadProps$d(__spreadValues$p(__spreadValues$p({}, meta), overrides), {
|
|
144
|
+
props: __spreadValues$p(__spreadValues$p({}, meta.props), overrides.props)
|
|
127
145
|
});
|
|
128
146
|
if (overrides.parentComponentName) {
|
|
129
147
|
meta.name = makeChildComponentName(
|
|
@@ -159,33 +177,33 @@ function withoutNils(array) {
|
|
|
159
177
|
return array.filter((x) => x != null);
|
|
160
178
|
}
|
|
161
179
|
|
|
162
|
-
var __defProp$
|
|
180
|
+
var __defProp$o = Object.defineProperty;
|
|
163
181
|
var __defProps$c = Object.defineProperties;
|
|
164
182
|
var __getOwnPropDescs$c = Object.getOwnPropertyDescriptors;
|
|
165
|
-
var __getOwnPropSymbols$
|
|
166
|
-
var __hasOwnProp$
|
|
167
|
-
var __propIsEnum$
|
|
168
|
-
var __defNormalProp$
|
|
169
|
-
var __spreadValues$
|
|
183
|
+
var __getOwnPropSymbols$o = Object.getOwnPropertySymbols;
|
|
184
|
+
var __hasOwnProp$o = Object.prototype.hasOwnProperty;
|
|
185
|
+
var __propIsEnum$o = Object.prototype.propertyIsEnumerable;
|
|
186
|
+
var __defNormalProp$o = (obj, key, value) => key in obj ? __defProp$o(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
187
|
+
var __spreadValues$o = (a, b) => {
|
|
170
188
|
for (var prop in b || (b = {}))
|
|
171
|
-
if (__hasOwnProp$
|
|
172
|
-
__defNormalProp$
|
|
173
|
-
if (__getOwnPropSymbols$
|
|
174
|
-
for (var prop of __getOwnPropSymbols$
|
|
175
|
-
if (__propIsEnum$
|
|
176
|
-
__defNormalProp$
|
|
189
|
+
if (__hasOwnProp$o.call(b, prop))
|
|
190
|
+
__defNormalProp$o(a, prop, b[prop]);
|
|
191
|
+
if (__getOwnPropSymbols$o)
|
|
192
|
+
for (var prop of __getOwnPropSymbols$o(b)) {
|
|
193
|
+
if (__propIsEnum$o.call(b, prop))
|
|
194
|
+
__defNormalProp$o(a, prop, b[prop]);
|
|
177
195
|
}
|
|
178
196
|
return a;
|
|
179
197
|
};
|
|
180
198
|
var __spreadProps$c = (a, b) => __defProps$c(a, __getOwnPropDescs$c(b));
|
|
181
|
-
var __objRest$
|
|
199
|
+
var __objRest$h = (source, exclude) => {
|
|
182
200
|
var target = {};
|
|
183
201
|
for (var prop in source)
|
|
184
|
-
if (__hasOwnProp$
|
|
202
|
+
if (__hasOwnProp$o.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
185
203
|
target[prop] = source[prop];
|
|
186
|
-
if (source != null && __getOwnPropSymbols$
|
|
187
|
-
for (var prop of __getOwnPropSymbols$
|
|
188
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
204
|
+
if (source != null && __getOwnPropSymbols$o)
|
|
205
|
+
for (var prop of __getOwnPropSymbols$o(source)) {
|
|
206
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$o.call(source, prop))
|
|
189
207
|
target[prop] = source[prop];
|
|
190
208
|
}
|
|
191
209
|
return target;
|
|
@@ -196,7 +214,7 @@ const BUTTON_INTERACTION_VARIANTS = [
|
|
|
196
214
|
"focused",
|
|
197
215
|
"focusVisible"
|
|
198
216
|
];
|
|
199
|
-
const { interactionVariants: interactionVariants$
|
|
217
|
+
const { interactionVariants: interactionVariants$7, withObservedValues: withObservedValues$5 } = pickAriaComponentVariants(
|
|
200
218
|
BUTTON_INTERACTION_VARIANTS
|
|
201
219
|
);
|
|
202
220
|
function BaseButton(props) {
|
|
@@ -205,14 +223,14 @@ function BaseButton(props) {
|
|
|
205
223
|
resetsForm,
|
|
206
224
|
children,
|
|
207
225
|
updateInteractionVariant
|
|
208
|
-
} = _a, rest = __objRest$
|
|
226
|
+
} = _a, rest = __objRest$h(_a, [
|
|
209
227
|
"submitsForm",
|
|
210
228
|
"resetsForm",
|
|
211
229
|
"children",
|
|
212
230
|
"updateInteractionVariant"
|
|
213
231
|
]);
|
|
214
232
|
const type = submitsForm ? "submit" : resetsForm ? "reset" : "button";
|
|
215
|
-
return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Button, __spreadValues$
|
|
233
|
+
return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Button, __spreadValues$o({ type }, rest), ({ isHovered, isPressed, isFocused, isFocusVisible }) => withObservedValues$5(
|
|
216
234
|
children,
|
|
217
235
|
{
|
|
218
236
|
hovered: isHovered,
|
|
@@ -232,8 +250,8 @@ function registerButton(loader, overrides) {
|
|
|
232
250
|
displayName: "Aria Button",
|
|
233
251
|
importPath: "@plasmicpkgs/react-aria/skinny/registerButton",
|
|
234
252
|
importName: "BaseButton",
|
|
235
|
-
interactionVariants: interactionVariants$
|
|
236
|
-
props: __spreadProps$c(__spreadValues$
|
|
253
|
+
interactionVariants: interactionVariants$7,
|
|
254
|
+
props: __spreadProps$c(__spreadValues$o({}, getCommonInputProps("button", [
|
|
237
255
|
"isDisabled",
|
|
238
256
|
"aria-label",
|
|
239
257
|
"children"
|
|
@@ -253,6 +271,10 @@ function registerButton(loader, overrides) {
|
|
|
253
271
|
hidden: (ps) => Boolean(ps.submitsForm),
|
|
254
272
|
description: "Whether clicking this button should reset the enclosing form.",
|
|
255
273
|
advanced: true
|
|
274
|
+
},
|
|
275
|
+
onPress: {
|
|
276
|
+
type: "eventHandler",
|
|
277
|
+
argTypes: [{ name: "event", type: "object" }]
|
|
256
278
|
}
|
|
257
279
|
}),
|
|
258
280
|
trapsFocus: true
|
|
@@ -261,33 +283,33 @@ function registerButton(loader, overrides) {
|
|
|
261
283
|
);
|
|
262
284
|
}
|
|
263
285
|
|
|
264
|
-
var __defProp$
|
|
286
|
+
var __defProp$n = Object.defineProperty;
|
|
265
287
|
var __defProps$b = Object.defineProperties;
|
|
266
288
|
var __getOwnPropDescs$b = Object.getOwnPropertyDescriptors;
|
|
267
|
-
var __getOwnPropSymbols$
|
|
268
|
-
var __hasOwnProp$
|
|
269
|
-
var __propIsEnum$
|
|
270
|
-
var __defNormalProp$
|
|
271
|
-
var __spreadValues$
|
|
289
|
+
var __getOwnPropSymbols$n = Object.getOwnPropertySymbols;
|
|
290
|
+
var __hasOwnProp$n = Object.prototype.hasOwnProperty;
|
|
291
|
+
var __propIsEnum$n = Object.prototype.propertyIsEnumerable;
|
|
292
|
+
var __defNormalProp$n = (obj, key, value) => key in obj ? __defProp$n(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
293
|
+
var __spreadValues$n = (a, b) => {
|
|
272
294
|
for (var prop in b || (b = {}))
|
|
273
|
-
if (__hasOwnProp$
|
|
274
|
-
__defNormalProp$
|
|
275
|
-
if (__getOwnPropSymbols$
|
|
276
|
-
for (var prop of __getOwnPropSymbols$
|
|
277
|
-
if (__propIsEnum$
|
|
278
|
-
__defNormalProp$
|
|
295
|
+
if (__hasOwnProp$n.call(b, prop))
|
|
296
|
+
__defNormalProp$n(a, prop, b[prop]);
|
|
297
|
+
if (__getOwnPropSymbols$n)
|
|
298
|
+
for (var prop of __getOwnPropSymbols$n(b)) {
|
|
299
|
+
if (__propIsEnum$n.call(b, prop))
|
|
300
|
+
__defNormalProp$n(a, prop, b[prop]);
|
|
279
301
|
}
|
|
280
302
|
return a;
|
|
281
303
|
};
|
|
282
304
|
var __spreadProps$b = (a, b) => __defProps$b(a, __getOwnPropDescs$b(b));
|
|
283
|
-
var __objRest$
|
|
305
|
+
var __objRest$g = (source, exclude) => {
|
|
284
306
|
var target = {};
|
|
285
307
|
for (var prop in source)
|
|
286
|
-
if (__hasOwnProp$
|
|
308
|
+
if (__hasOwnProp$n.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
287
309
|
target[prop] = source[prop];
|
|
288
|
-
if (source != null && __getOwnPropSymbols$
|
|
289
|
-
for (var prop of __getOwnPropSymbols$
|
|
290
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
310
|
+
if (source != null && __getOwnPropSymbols$n)
|
|
311
|
+
for (var prop of __getOwnPropSymbols$n(source)) {
|
|
312
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$n.call(source, prop))
|
|
291
313
|
target[prop] = source[prop];
|
|
292
314
|
}
|
|
293
315
|
return target;
|
|
@@ -298,12 +320,12 @@ const CHECKBOX_INTERACTION_VARIANTS = [
|
|
|
298
320
|
"focused",
|
|
299
321
|
"focusVisible"
|
|
300
322
|
];
|
|
301
|
-
const { interactionVariants: interactionVariants$
|
|
323
|
+
const { interactionVariants: interactionVariants$6, withObservedValues: withObservedValues$4 } = pickAriaComponentVariants(
|
|
302
324
|
CHECKBOX_INTERACTION_VARIANTS
|
|
303
325
|
);
|
|
304
326
|
function BaseCheckbox(props) {
|
|
305
|
-
const _a = props, { children, updateInteractionVariant } = _a, rest = __objRest$
|
|
306
|
-
return /* @__PURE__ */ React__default.default.createElement(React__default.default.Fragment, null, /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Checkbox, __spreadValues$
|
|
327
|
+
const _a = props, { children, updateInteractionVariant } = _a, rest = __objRest$g(_a, ["children", "updateInteractionVariant"]);
|
|
328
|
+
return /* @__PURE__ */ React__default.default.createElement(React__default.default.Fragment, null, /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Checkbox, __spreadValues$n({}, rest), ({ isHovered, isPressed, isFocused, isFocusVisible }) => withObservedValues$4(
|
|
307
329
|
children,
|
|
308
330
|
{
|
|
309
331
|
hovered: isHovered,
|
|
@@ -323,8 +345,8 @@ function registerCheckbox(loader, overrides) {
|
|
|
323
345
|
displayName: "Aria Checkbox",
|
|
324
346
|
importPath: "@plasmicpkgs/react-aria/skinny/registerCheckbox",
|
|
325
347
|
importName: "BaseCheckbox",
|
|
326
|
-
interactionVariants: interactionVariants$
|
|
327
|
-
props: __spreadProps$b(__spreadValues$
|
|
348
|
+
interactionVariants: interactionVariants$6,
|
|
349
|
+
props: __spreadProps$b(__spreadValues$n({}, getCommonInputProps("checkbox", [
|
|
328
350
|
"name",
|
|
329
351
|
"isDisabled",
|
|
330
352
|
"isReadOnly",
|
|
@@ -381,37 +403,37 @@ function registerCheckbox(loader, overrides) {
|
|
|
381
403
|
);
|
|
382
404
|
}
|
|
383
405
|
|
|
384
|
-
var __defProp$
|
|
385
|
-
var __getOwnPropSymbols$
|
|
386
|
-
var __hasOwnProp$
|
|
387
|
-
var __propIsEnum$
|
|
388
|
-
var __defNormalProp$
|
|
389
|
-
var __spreadValues$
|
|
406
|
+
var __defProp$m = Object.defineProperty;
|
|
407
|
+
var __getOwnPropSymbols$m = Object.getOwnPropertySymbols;
|
|
408
|
+
var __hasOwnProp$m = Object.prototype.hasOwnProperty;
|
|
409
|
+
var __propIsEnum$m = Object.prototype.propertyIsEnumerable;
|
|
410
|
+
var __defNormalProp$m = (obj, key, value) => key in obj ? __defProp$m(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
411
|
+
var __spreadValues$m = (a, b) => {
|
|
390
412
|
for (var prop in b || (b = {}))
|
|
391
|
-
if (__hasOwnProp$
|
|
392
|
-
__defNormalProp$
|
|
393
|
-
if (__getOwnPropSymbols$
|
|
394
|
-
for (var prop of __getOwnPropSymbols$
|
|
395
|
-
if (__propIsEnum$
|
|
396
|
-
__defNormalProp$
|
|
413
|
+
if (__hasOwnProp$m.call(b, prop))
|
|
414
|
+
__defNormalProp$m(a, prop, b[prop]);
|
|
415
|
+
if (__getOwnPropSymbols$m)
|
|
416
|
+
for (var prop of __getOwnPropSymbols$m(b)) {
|
|
417
|
+
if (__propIsEnum$m.call(b, prop))
|
|
418
|
+
__defNormalProp$m(a, prop, b[prop]);
|
|
397
419
|
}
|
|
398
420
|
return a;
|
|
399
421
|
};
|
|
400
|
-
var __objRest$
|
|
422
|
+
var __objRest$f = (source, exclude) => {
|
|
401
423
|
var target = {};
|
|
402
424
|
for (var prop in source)
|
|
403
|
-
if (__hasOwnProp$
|
|
425
|
+
if (__hasOwnProp$m.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
404
426
|
target[prop] = source[prop];
|
|
405
|
-
if (source != null && __getOwnPropSymbols$
|
|
406
|
-
for (var prop of __getOwnPropSymbols$
|
|
407
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
427
|
+
if (source != null && __getOwnPropSymbols$m)
|
|
428
|
+
for (var prop of __getOwnPropSymbols$m(source)) {
|
|
429
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$m.call(source, prop))
|
|
408
430
|
target[prop] = source[prop];
|
|
409
431
|
}
|
|
410
432
|
return target;
|
|
411
433
|
};
|
|
412
434
|
function BaseText(_a) {
|
|
413
|
-
var _b = _a, { children } = _b, rest = __objRest$
|
|
414
|
-
return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Text, __spreadValues$
|
|
435
|
+
var _b = _a, { children } = _b, rest = __objRest$f(_b, ["children"]);
|
|
436
|
+
return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Text, __spreadValues$m({}, rest), children);
|
|
415
437
|
}
|
|
416
438
|
function registerText(loader, overrides) {
|
|
417
439
|
registerComponentHelper(
|
|
@@ -436,27 +458,27 @@ function registerText(loader, overrides) {
|
|
|
436
458
|
);
|
|
437
459
|
}
|
|
438
460
|
|
|
439
|
-
var __defProp$
|
|
461
|
+
var __defProp$l = Object.defineProperty;
|
|
440
462
|
var __defProps$a = Object.defineProperties;
|
|
441
463
|
var __getOwnPropDescs$a = Object.getOwnPropertyDescriptors;
|
|
442
|
-
var __getOwnPropSymbols$
|
|
443
|
-
var __hasOwnProp$
|
|
444
|
-
var __propIsEnum$
|
|
445
|
-
var __defNormalProp$
|
|
446
|
-
var __spreadValues$
|
|
464
|
+
var __getOwnPropSymbols$l = Object.getOwnPropertySymbols;
|
|
465
|
+
var __hasOwnProp$l = Object.prototype.hasOwnProperty;
|
|
466
|
+
var __propIsEnum$l = Object.prototype.propertyIsEnumerable;
|
|
467
|
+
var __defNormalProp$l = (obj, key, value) => key in obj ? __defProp$l(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
468
|
+
var __spreadValues$l = (a, b) => {
|
|
447
469
|
for (var prop in b || (b = {}))
|
|
448
|
-
if (__hasOwnProp$
|
|
449
|
-
__defNormalProp$
|
|
450
|
-
if (__getOwnPropSymbols$
|
|
451
|
-
for (var prop of __getOwnPropSymbols$
|
|
452
|
-
if (__propIsEnum$
|
|
453
|
-
__defNormalProp$
|
|
470
|
+
if (__hasOwnProp$l.call(b, prop))
|
|
471
|
+
__defNormalProp$l(a, prop, b[prop]);
|
|
472
|
+
if (__getOwnPropSymbols$l)
|
|
473
|
+
for (var prop of __getOwnPropSymbols$l(b)) {
|
|
474
|
+
if (__propIsEnum$l.call(b, prop))
|
|
475
|
+
__defNormalProp$l(a, prop, b[prop]);
|
|
454
476
|
}
|
|
455
477
|
return a;
|
|
456
478
|
};
|
|
457
479
|
var __spreadProps$a = (a, b) => __defProps$a(a, __getOwnPropDescs$a(b));
|
|
458
480
|
function registerDescription(loader, overrides) {
|
|
459
|
-
registerText(loader, __spreadProps$a(__spreadValues$
|
|
481
|
+
registerText(loader, __spreadProps$a(__spreadValues$l({}, overrides), {
|
|
460
482
|
displayName: "Aria Description",
|
|
461
483
|
props: {
|
|
462
484
|
slot: { type: "string", hidden: () => true, defaultValue: "description" }
|
|
@@ -464,30 +486,30 @@ function registerDescription(loader, overrides) {
|
|
|
464
486
|
}));
|
|
465
487
|
}
|
|
466
488
|
|
|
467
|
-
var __defProp$
|
|
468
|
-
var __getOwnPropSymbols$
|
|
469
|
-
var __hasOwnProp$
|
|
470
|
-
var __propIsEnum$
|
|
471
|
-
var __defNormalProp$
|
|
472
|
-
var __spreadValues$
|
|
489
|
+
var __defProp$k = Object.defineProperty;
|
|
490
|
+
var __getOwnPropSymbols$k = Object.getOwnPropertySymbols;
|
|
491
|
+
var __hasOwnProp$k = Object.prototype.hasOwnProperty;
|
|
492
|
+
var __propIsEnum$k = Object.prototype.propertyIsEnumerable;
|
|
493
|
+
var __defNormalProp$k = (obj, key, value) => key in obj ? __defProp$k(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
494
|
+
var __spreadValues$k = (a, b) => {
|
|
473
495
|
for (var prop in b || (b = {}))
|
|
474
|
-
if (__hasOwnProp$
|
|
475
|
-
__defNormalProp$
|
|
476
|
-
if (__getOwnPropSymbols$
|
|
477
|
-
for (var prop of __getOwnPropSymbols$
|
|
478
|
-
if (__propIsEnum$
|
|
479
|
-
__defNormalProp$
|
|
496
|
+
if (__hasOwnProp$k.call(b, prop))
|
|
497
|
+
__defNormalProp$k(a, prop, b[prop]);
|
|
498
|
+
if (__getOwnPropSymbols$k)
|
|
499
|
+
for (var prop of __getOwnPropSymbols$k(b)) {
|
|
500
|
+
if (__propIsEnum$k.call(b, prop))
|
|
501
|
+
__defNormalProp$k(a, prop, b[prop]);
|
|
480
502
|
}
|
|
481
503
|
return a;
|
|
482
504
|
};
|
|
483
|
-
var __objRest$
|
|
505
|
+
var __objRest$e = (source, exclude) => {
|
|
484
506
|
var target = {};
|
|
485
507
|
for (var prop in source)
|
|
486
|
-
if (__hasOwnProp$
|
|
508
|
+
if (__hasOwnProp$k.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
487
509
|
target[prop] = source[prop];
|
|
488
|
-
if (source != null && __getOwnPropSymbols$
|
|
489
|
-
for (var prop of __getOwnPropSymbols$
|
|
490
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
510
|
+
if (source != null && __getOwnPropSymbols$k)
|
|
511
|
+
for (var prop of __getOwnPropSymbols$k(source)) {
|
|
512
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$k.call(source, prop))
|
|
491
513
|
target[prop] = source[prop];
|
|
492
514
|
}
|
|
493
515
|
return target;
|
|
@@ -504,7 +526,7 @@ function BaseFieldError(_a) {
|
|
|
504
526
|
tooShort,
|
|
505
527
|
typeMismatch,
|
|
506
528
|
valueMissing
|
|
507
|
-
} = _b, rest = __objRest$
|
|
529
|
+
} = _b, rest = __objRest$e(_b, [
|
|
508
530
|
"badInput",
|
|
509
531
|
"customError",
|
|
510
532
|
"patternMismatch",
|
|
@@ -516,7 +538,7 @@ function BaseFieldError(_a) {
|
|
|
516
538
|
"typeMismatch",
|
|
517
539
|
"valueMissing"
|
|
518
540
|
]);
|
|
519
|
-
return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.FieldError, __spreadValues$
|
|
541
|
+
return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.FieldError, __spreadValues$k({}, rest), ({ validationDetails, validationErrors }) => {
|
|
520
542
|
if (validationDetails.badInput && badInput)
|
|
521
543
|
return badInput;
|
|
522
544
|
if (validationDetails.customError && customError)
|
|
@@ -614,15 +636,19 @@ function registerFieldError(loader, overrides) {
|
|
|
614
636
|
}
|
|
615
637
|
|
|
616
638
|
const BaseLabel = reactAriaComponents.Label;
|
|
639
|
+
const LABEL_COMPONENT_NAME = makeComponentName("label");
|
|
617
640
|
function registerLabel(loader, overrides) {
|
|
618
641
|
registerComponentHelper(
|
|
619
642
|
loader,
|
|
620
643
|
BaseLabel,
|
|
621
644
|
{
|
|
622
|
-
name:
|
|
645
|
+
name: LABEL_COMPONENT_NAME,
|
|
623
646
|
displayName: "Aria Label",
|
|
624
647
|
importPath: "@plasmicpkgs/react-aria/skinny/registerLabel",
|
|
625
648
|
importName: "BaseLabel",
|
|
649
|
+
defaultStyles: {
|
|
650
|
+
cursor: "pointer"
|
|
651
|
+
},
|
|
626
652
|
props: {
|
|
627
653
|
children: {
|
|
628
654
|
type: "slot"
|
|
@@ -634,21 +660,21 @@ function registerLabel(loader, overrides) {
|
|
|
634
660
|
);
|
|
635
661
|
}
|
|
636
662
|
|
|
637
|
-
var __defProp$
|
|
663
|
+
var __defProp$j = Object.defineProperty;
|
|
638
664
|
var __defProps$9 = Object.defineProperties;
|
|
639
665
|
var __getOwnPropDescs$9 = Object.getOwnPropertyDescriptors;
|
|
640
|
-
var __getOwnPropSymbols$
|
|
641
|
-
var __hasOwnProp$
|
|
642
|
-
var __propIsEnum$
|
|
643
|
-
var __defNormalProp$
|
|
644
|
-
var __spreadValues$
|
|
666
|
+
var __getOwnPropSymbols$j = Object.getOwnPropertySymbols;
|
|
667
|
+
var __hasOwnProp$j = Object.prototype.hasOwnProperty;
|
|
668
|
+
var __propIsEnum$j = Object.prototype.propertyIsEnumerable;
|
|
669
|
+
var __defNormalProp$j = (obj, key, value) => key in obj ? __defProp$j(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
670
|
+
var __spreadValues$j = (a, b) => {
|
|
645
671
|
for (var prop in b || (b = {}))
|
|
646
|
-
if (__hasOwnProp$
|
|
647
|
-
__defNormalProp$
|
|
648
|
-
if (__getOwnPropSymbols$
|
|
649
|
-
for (var prop of __getOwnPropSymbols$
|
|
650
|
-
if (__propIsEnum$
|
|
651
|
-
__defNormalProp$
|
|
672
|
+
if (__hasOwnProp$j.call(b, prop))
|
|
673
|
+
__defNormalProp$j(a, prop, b[prop]);
|
|
674
|
+
if (__getOwnPropSymbols$j)
|
|
675
|
+
for (var prop of __getOwnPropSymbols$j(b)) {
|
|
676
|
+
if (__propIsEnum$j.call(b, prop))
|
|
677
|
+
__defNormalProp$j(a, prop, b[prop]);
|
|
652
678
|
}
|
|
653
679
|
return a;
|
|
654
680
|
};
|
|
@@ -664,7 +690,7 @@ function registerCheckboxGroup(loader, overrides) {
|
|
|
664
690
|
displayName: "Aria Checkbox Group",
|
|
665
691
|
importPath: "@plasmicpkgs/react-aria/skinny/registerCheckboxGroup",
|
|
666
692
|
importName: "BaseCheckboxGroup",
|
|
667
|
-
props: __spreadProps$9(__spreadValues$
|
|
693
|
+
props: __spreadProps$9(__spreadValues$j({}, getCommonInputProps("checkbox group", [
|
|
668
694
|
"name",
|
|
669
695
|
"isDisabled",
|
|
670
696
|
"isReadOnly",
|
|
@@ -719,6 +745,7 @@ function registerCheckboxGroup(loader, overrides) {
|
|
|
719
745
|
});
|
|
720
746
|
}
|
|
721
747
|
|
|
748
|
+
const PlasmicSliderContext = React__default.default.createContext(void 0);
|
|
722
749
|
React__default.default.createContext(void 0);
|
|
723
750
|
const PlasmicListBoxContext = React__default.default.createContext(void 0);
|
|
724
751
|
const PlasmicPopoverContext = React__default.default.createContext(void 0);
|
|
@@ -743,26 +770,26 @@ function deriveStrictOptions(props) {
|
|
|
743
770
|
return void 0;
|
|
744
771
|
} else if (typeof op === "string" || typeof op === "number") {
|
|
745
772
|
const item = {
|
|
746
|
-
|
|
773
|
+
id: op
|
|
747
774
|
};
|
|
748
775
|
return item;
|
|
749
776
|
} else if (optionInfo) {
|
|
750
777
|
const info = optionInfo(op);
|
|
751
|
-
if (info.type === "
|
|
778
|
+
if (info.type === "option-group") {
|
|
752
779
|
const section = {
|
|
753
|
-
type: "
|
|
780
|
+
type: "option-group",
|
|
754
781
|
items: (_c = (_b = (_a2 = info.items) == null ? void 0 : _a2.map) == null ? void 0 : _b.call(_a2, (item) => makeStrict(item))) == null ? void 0 : _c.filter((x) => !!x),
|
|
755
782
|
label: info.label,
|
|
756
|
-
key: `
|
|
783
|
+
key: `option-group-${sectionCount}`
|
|
757
784
|
};
|
|
758
785
|
sectionCount += 1;
|
|
759
786
|
return section;
|
|
760
787
|
} else {
|
|
761
788
|
let item = info;
|
|
762
|
-
if (!("
|
|
789
|
+
if (!("id" in item)) {
|
|
763
790
|
item = {
|
|
764
|
-
type: "
|
|
765
|
-
|
|
791
|
+
type: "option",
|
|
792
|
+
id: JSON.stringify(item)
|
|
766
793
|
};
|
|
767
794
|
}
|
|
768
795
|
return item;
|
|
@@ -770,19 +797,19 @@ function deriveStrictOptions(props) {
|
|
|
770
797
|
} else if (typeof op === "object") {
|
|
771
798
|
if ("items" in op) {
|
|
772
799
|
const section = {
|
|
773
|
-
type: "
|
|
800
|
+
type: "option-group",
|
|
774
801
|
items: (_f = (_e = (_d = op.items) == null ? void 0 : _d.map) == null ? void 0 : _e.call(_d, (item) => makeStrict(item))) == null ? void 0 : _f.filter((x) => !!x),
|
|
775
802
|
label: op.label,
|
|
776
|
-
key: `
|
|
803
|
+
key: `option-group-${sectionCount}`
|
|
777
804
|
};
|
|
778
805
|
sectionCount += 1;
|
|
779
806
|
return section;
|
|
780
807
|
} else {
|
|
781
808
|
let item = op;
|
|
782
|
-
if (!("
|
|
809
|
+
if (!("id" in item)) {
|
|
783
810
|
item = {
|
|
784
|
-
type: "
|
|
785
|
-
|
|
811
|
+
type: "option",
|
|
812
|
+
id: JSON.stringify(item)
|
|
786
813
|
};
|
|
787
814
|
}
|
|
788
815
|
return item;
|
|
@@ -794,7 +821,7 @@ function deriveStrictOptions(props) {
|
|
|
794
821
|
const strictOptions = (_a = options == null ? void 0 : options.map(makeStrict)) == null ? void 0 : _a.filter((x) => !!x);
|
|
795
822
|
const optionText = (op) => {
|
|
796
823
|
var _a2;
|
|
797
|
-
return (_a2 = op.label) != null ? _a2 : op.
|
|
824
|
+
return (_a2 = op.label) != null ? _a2 : op.id;
|
|
798
825
|
};
|
|
799
826
|
return { options: strictOptions, optionText };
|
|
800
827
|
}
|
|
@@ -805,7 +832,7 @@ function flattenOptions(options) {
|
|
|
805
832
|
return options.flatMap(
|
|
806
833
|
(op) => {
|
|
807
834
|
var _a;
|
|
808
|
-
return op.type === "
|
|
835
|
+
return op.type === "option-group" ? (_a = op.items) != null ? _a : [] : op;
|
|
809
836
|
}
|
|
810
837
|
);
|
|
811
838
|
}
|
|
@@ -815,7 +842,7 @@ function makeOptionsPropType() {
|
|
|
815
842
|
type: "array",
|
|
816
843
|
itemType: {
|
|
817
844
|
type: "object",
|
|
818
|
-
nameFunc: (item) => item.label || item.
|
|
845
|
+
nameFunc: (item) => item.label || item.id,
|
|
819
846
|
fields: {
|
|
820
847
|
type: {
|
|
821
848
|
type: "choice",
|
|
@@ -825,7 +852,7 @@ function makeOptionsPropType() {
|
|
|
825
852
|
],
|
|
826
853
|
defaultValue: "option"
|
|
827
854
|
},
|
|
828
|
-
|
|
855
|
+
id: {
|
|
829
856
|
type: "string",
|
|
830
857
|
hidden: (_ps, _ctx, { item }) => item.type !== "option"
|
|
831
858
|
},
|
|
@@ -838,9 +865,9 @@ function makeOptionsPropType() {
|
|
|
838
865
|
},
|
|
839
866
|
itemType: {
|
|
840
867
|
type: "object",
|
|
841
|
-
nameFunc: (item) => item.label || item.
|
|
868
|
+
nameFunc: (item) => item.label || item.id,
|
|
842
869
|
fields: {
|
|
843
|
-
|
|
870
|
+
id: "string",
|
|
844
871
|
label: "string"
|
|
845
872
|
}
|
|
846
873
|
}
|
|
@@ -849,12 +876,12 @@ function makeOptionsPropType() {
|
|
|
849
876
|
},
|
|
850
877
|
defaultValue: [
|
|
851
878
|
{
|
|
852
|
-
|
|
879
|
+
id: "option1",
|
|
853
880
|
label: "Option 1",
|
|
854
881
|
type: "option"
|
|
855
882
|
},
|
|
856
883
|
{
|
|
857
|
-
|
|
884
|
+
id: "option2",
|
|
858
885
|
label: "Option 2",
|
|
859
886
|
type: "option"
|
|
860
887
|
}
|
|
@@ -868,7 +895,7 @@ function makeValuePropType() {
|
|
|
868
895
|
options: (ps) => {
|
|
869
896
|
const { options, optionText } = deriveStrictOptions(ps);
|
|
870
897
|
return flattenOptions(options).map((op) => ({
|
|
871
|
-
value: op.
|
|
898
|
+
value: op.id,
|
|
872
899
|
label: optionText(op)
|
|
873
900
|
}));
|
|
874
901
|
}
|
|
@@ -876,21 +903,21 @@ function makeValuePropType() {
|
|
|
876
903
|
return type;
|
|
877
904
|
}
|
|
878
905
|
|
|
879
|
-
var __defProp$
|
|
906
|
+
var __defProp$i = Object.defineProperty;
|
|
880
907
|
var __defProps$8 = Object.defineProperties;
|
|
881
908
|
var __getOwnPropDescs$8 = Object.getOwnPropertyDescriptors;
|
|
882
|
-
var __getOwnPropSymbols$
|
|
883
|
-
var __hasOwnProp$
|
|
884
|
-
var __propIsEnum$
|
|
885
|
-
var __defNormalProp$
|
|
886
|
-
var __spreadValues$
|
|
909
|
+
var __getOwnPropSymbols$i = Object.getOwnPropertySymbols;
|
|
910
|
+
var __hasOwnProp$i = Object.prototype.hasOwnProperty;
|
|
911
|
+
var __propIsEnum$i = Object.prototype.propertyIsEnumerable;
|
|
912
|
+
var __defNormalProp$i = (obj, key, value) => key in obj ? __defProp$i(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
913
|
+
var __spreadValues$i = (a, b) => {
|
|
887
914
|
for (var prop in b || (b = {}))
|
|
888
|
-
if (__hasOwnProp$
|
|
889
|
-
__defNormalProp$
|
|
890
|
-
if (__getOwnPropSymbols$
|
|
891
|
-
for (var prop of __getOwnPropSymbols$
|
|
892
|
-
if (__propIsEnum$
|
|
893
|
-
__defNormalProp$
|
|
915
|
+
if (__hasOwnProp$i.call(b, prop))
|
|
916
|
+
__defNormalProp$i(a, prop, b[prop]);
|
|
917
|
+
if (__getOwnPropSymbols$i)
|
|
918
|
+
for (var prop of __getOwnPropSymbols$i(b)) {
|
|
919
|
+
if (__propIsEnum$i.call(b, prop))
|
|
920
|
+
__defNormalProp$i(a, prop, b[prop]);
|
|
894
921
|
}
|
|
895
922
|
return a;
|
|
896
923
|
};
|
|
@@ -926,8 +953,8 @@ function BaseComboBox(props) {
|
|
|
926
953
|
const filterOptions = (opts) => {
|
|
927
954
|
return withoutNils(
|
|
928
955
|
opts.map((op) => {
|
|
929
|
-
if (op.type === "
|
|
930
|
-
return __spreadProps$8(__spreadValues$
|
|
956
|
+
if (op.type === "option-group") {
|
|
957
|
+
return __spreadProps$8(__spreadValues$i({}, op), {
|
|
931
958
|
items: op.items ? filterOptions(op.items) : void 0
|
|
932
959
|
});
|
|
933
960
|
} else {
|
|
@@ -941,18 +968,18 @@ function BaseComboBox(props) {
|
|
|
941
968
|
);
|
|
942
969
|
};
|
|
943
970
|
return filterOptions(options);
|
|
944
|
-
}, [options,
|
|
971
|
+
}, [filterValue, options, contains, optionText]);
|
|
945
972
|
const flattenedOptions = React__default.default.useMemo(
|
|
946
973
|
() => flattenOptions(options),
|
|
947
974
|
[options]
|
|
948
975
|
);
|
|
949
|
-
const disabledKeys = flattenedOptions.filter((op) => op.isDisabled).map((op) => op.
|
|
976
|
+
const disabledKeys = flattenedOptions.filter((op) => op.isDisabled).map((op) => op.id);
|
|
950
977
|
const onSelectionChange = React__default.default.useCallback(
|
|
951
978
|
(key) => {
|
|
952
979
|
if (key === null) {
|
|
953
980
|
return;
|
|
954
981
|
}
|
|
955
|
-
const selectedOption = flattenedOptions == null ? void 0 : flattenedOptions.find((op) => op.
|
|
982
|
+
const selectedOption = flattenedOptions == null ? void 0 : flattenedOptions.find((op) => op.id === key);
|
|
956
983
|
if (valueType === "text") {
|
|
957
984
|
if (selectedOption) {
|
|
958
985
|
onChange == null ? void 0 : onChange(optionText(selectedOption));
|
|
@@ -964,7 +991,7 @@ function BaseComboBox(props) {
|
|
|
964
991
|
onFilterValueChange == null ? void 0 : onFilterValueChange(optionText(selectedOption));
|
|
965
992
|
}
|
|
966
993
|
},
|
|
967
|
-
[
|
|
994
|
+
[flattenedOptions, valueType, onChange, optionText, onFilterValueChange]
|
|
968
995
|
);
|
|
969
996
|
const onInputValueChange = React__default.default.useCallback(
|
|
970
997
|
(newValue) => {
|
|
@@ -995,7 +1022,7 @@ function BaseComboBox(props) {
|
|
|
995
1022
|
const onBlur = React__default.default.useCallback(() => {
|
|
996
1023
|
if (!allowsCustomValue) {
|
|
997
1024
|
const selectedOption = flattenedOptions == null ? void 0 : flattenedOptions.find(
|
|
998
|
-
(op) => valueType === "text" ? optionText(op) === value : op.
|
|
1025
|
+
(op) => valueType === "text" ? optionText(op) === value : op.id === value
|
|
999
1026
|
);
|
|
1000
1027
|
if (selectedOption) {
|
|
1001
1028
|
const selectedOptionText = optionText(selectedOption);
|
|
@@ -1006,15 +1033,16 @@ function BaseComboBox(props) {
|
|
|
1006
1033
|
}
|
|
1007
1034
|
}, [
|
|
1008
1035
|
allowsCustomValue,
|
|
1009
|
-
valueType,
|
|
1010
1036
|
flattenedOptions,
|
|
1011
|
-
|
|
1037
|
+
valueType,
|
|
1012
1038
|
optionText,
|
|
1039
|
+
value,
|
|
1040
|
+
filterValue,
|
|
1013
1041
|
onFilterValueChange
|
|
1014
1042
|
]);
|
|
1015
1043
|
return /* @__PURE__ */ React__default.default.createElement(
|
|
1016
1044
|
reactAriaComponents.ComboBox,
|
|
1017
|
-
__spreadValues$
|
|
1045
|
+
__spreadValues$i({
|
|
1018
1046
|
selectedKey: value,
|
|
1019
1047
|
onSelectionChange,
|
|
1020
1048
|
isDisabled,
|
|
@@ -1042,15 +1070,6 @@ function BaseComboBox(props) {
|
|
|
1042
1070
|
PlasmicListBoxContext.Provider,
|
|
1043
1071
|
{
|
|
1044
1072
|
value: {
|
|
1045
|
-
makeItemProps: (item) => ({
|
|
1046
|
-
key: item.value,
|
|
1047
|
-
textValue: optionText(item),
|
|
1048
|
-
children: optionText(item)
|
|
1049
|
-
}),
|
|
1050
|
-
makeSectionProps: (section) => ({
|
|
1051
|
-
section,
|
|
1052
|
-
key: section.key
|
|
1053
|
-
}),
|
|
1054
1073
|
getItemType: (option) => option.type === "section" ? "section" : "item"
|
|
1055
1074
|
}
|
|
1056
1075
|
},
|
|
@@ -1153,71 +1172,145 @@ function registerComboBox(loader) {
|
|
|
1153
1172
|
});
|
|
1154
1173
|
}
|
|
1155
1174
|
|
|
1156
|
-
var __defProp$
|
|
1157
|
-
var __getOwnPropSymbols$
|
|
1158
|
-
var __hasOwnProp$
|
|
1159
|
-
var __propIsEnum$
|
|
1160
|
-
var __defNormalProp$
|
|
1161
|
-
var __spreadValues$
|
|
1175
|
+
var __defProp$h = Object.defineProperty;
|
|
1176
|
+
var __getOwnPropSymbols$h = Object.getOwnPropertySymbols;
|
|
1177
|
+
var __hasOwnProp$h = Object.prototype.hasOwnProperty;
|
|
1178
|
+
var __propIsEnum$h = Object.prototype.propertyIsEnumerable;
|
|
1179
|
+
var __defNormalProp$h = (obj, key, value) => key in obj ? __defProp$h(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1180
|
+
var __spreadValues$h = (a, b) => {
|
|
1162
1181
|
for (var prop in b || (b = {}))
|
|
1163
|
-
if (__hasOwnProp$
|
|
1164
|
-
__defNormalProp$
|
|
1165
|
-
if (__getOwnPropSymbols$
|
|
1166
|
-
for (var prop of __getOwnPropSymbols$
|
|
1167
|
-
if (__propIsEnum$
|
|
1168
|
-
__defNormalProp$
|
|
1182
|
+
if (__hasOwnProp$h.call(b, prop))
|
|
1183
|
+
__defNormalProp$h(a, prop, b[prop]);
|
|
1184
|
+
if (__getOwnPropSymbols$h)
|
|
1185
|
+
for (var prop of __getOwnPropSymbols$h(b)) {
|
|
1186
|
+
if (__propIsEnum$h.call(b, prop))
|
|
1187
|
+
__defNormalProp$h(a, prop, b[prop]);
|
|
1169
1188
|
}
|
|
1170
1189
|
return a;
|
|
1171
1190
|
};
|
|
1172
|
-
var __objRest$
|
|
1191
|
+
var __objRest$d = (source, exclude) => {
|
|
1173
1192
|
var target = {};
|
|
1174
1193
|
for (var prop in source)
|
|
1175
|
-
if (__hasOwnProp$
|
|
1194
|
+
if (__hasOwnProp$h.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
1176
1195
|
target[prop] = source[prop];
|
|
1177
|
-
if (source != null && __getOwnPropSymbols$
|
|
1178
|
-
for (var prop of __getOwnPropSymbols$
|
|
1179
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
1196
|
+
if (source != null && __getOwnPropSymbols$h)
|
|
1197
|
+
for (var prop of __getOwnPropSymbols$h(source)) {
|
|
1198
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$h.call(source, prop))
|
|
1180
1199
|
target[prop] = source[prop];
|
|
1181
1200
|
}
|
|
1182
1201
|
return target;
|
|
1183
1202
|
};
|
|
1184
|
-
function
|
|
1185
|
-
const _a = props, {
|
|
1186
|
-
return /* @__PURE__ */ React__default.default.createElement(
|
|
1187
|
-
reactAriaComponents.Form,
|
|
1188
|
-
__spreadValues$e({
|
|
1189
|
-
onSubmit: (e) => {
|
|
1190
|
-
e.preventDefault();
|
|
1191
|
-
const formData = new FormData(e.currentTarget);
|
|
1192
|
-
const formValues = {};
|
|
1193
|
-
formData.forEach((value, key) => {
|
|
1194
|
-
const field = e.currentTarget.elements.namedItem(key);
|
|
1195
|
-
if (field instanceof RadioNodeList && Array.from(field.values()).every(
|
|
1196
|
-
(f) => f.type === "checkbox"
|
|
1197
|
-
)) {
|
|
1198
|
-
formValues[key] = formData.getAll(key);
|
|
1199
|
-
} else {
|
|
1200
|
-
field.type;
|
|
1201
|
-
formValues[key] = formData.get(key);
|
|
1202
|
-
}
|
|
1203
|
-
});
|
|
1204
|
-
onSubmit == null ? void 0 : onSubmit(formValues);
|
|
1205
|
-
}
|
|
1206
|
-
}, rest),
|
|
1207
|
-
children
|
|
1208
|
-
);
|
|
1203
|
+
function BaseDialogTrigger(props) {
|
|
1204
|
+
const _a = props, { trigger, dialog } = _a, rest = __objRest$d(_a, ["trigger", "dialog"]);
|
|
1205
|
+
return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.DialogTrigger, __spreadValues$h({}, rest), trigger, dialog);
|
|
1209
1206
|
}
|
|
1210
|
-
function
|
|
1207
|
+
function registerDialogTrigger(loader, overrides) {
|
|
1211
1208
|
registerComponentHelper(
|
|
1212
1209
|
loader,
|
|
1213
|
-
|
|
1210
|
+
BaseDialogTrigger,
|
|
1214
1211
|
{
|
|
1215
|
-
name: makeComponentName("
|
|
1216
|
-
displayName: "Aria
|
|
1217
|
-
importPath: "@plasmicpkgs/react-aria/skinny/
|
|
1218
|
-
importName: "
|
|
1212
|
+
name: makeComponentName("dialogTrigger"),
|
|
1213
|
+
displayName: "Aria Dialog Trigger",
|
|
1214
|
+
importPath: "@plasmicpkgs/react-aria/skinny/registerDialogTrigger",
|
|
1215
|
+
importName: "BaseDialogTrigger",
|
|
1216
|
+
isAttachment: true,
|
|
1219
1217
|
props: {
|
|
1220
|
-
|
|
1218
|
+
trigger: {
|
|
1219
|
+
type: "slot"
|
|
1220
|
+
},
|
|
1221
|
+
dialog: {
|
|
1222
|
+
type: "slot"
|
|
1223
|
+
},
|
|
1224
|
+
isOpen: {
|
|
1225
|
+
type: "boolean",
|
|
1226
|
+
defaultValueHint: false,
|
|
1227
|
+
editOnly: true,
|
|
1228
|
+
uncontrolledProp: "defaultOpen"
|
|
1229
|
+
},
|
|
1230
|
+
onOpenChange: {
|
|
1231
|
+
type: "eventHandler",
|
|
1232
|
+
argTypes: [{ name: "isOpen", type: "boolean" }]
|
|
1233
|
+
}
|
|
1234
|
+
},
|
|
1235
|
+
states: {
|
|
1236
|
+
isOpen: {
|
|
1237
|
+
type: "writable",
|
|
1238
|
+
valueProp: "isOpen",
|
|
1239
|
+
onChangeProp: "onOpenChange",
|
|
1240
|
+
variableType: "boolean"
|
|
1241
|
+
}
|
|
1242
|
+
},
|
|
1243
|
+
trapsFocus: true
|
|
1244
|
+
},
|
|
1245
|
+
overrides
|
|
1246
|
+
);
|
|
1247
|
+
}
|
|
1248
|
+
|
|
1249
|
+
var __defProp$g = Object.defineProperty;
|
|
1250
|
+
var __getOwnPropSymbols$g = Object.getOwnPropertySymbols;
|
|
1251
|
+
var __hasOwnProp$g = Object.prototype.hasOwnProperty;
|
|
1252
|
+
var __propIsEnum$g = Object.prototype.propertyIsEnumerable;
|
|
1253
|
+
var __defNormalProp$g = (obj, key, value) => key in obj ? __defProp$g(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1254
|
+
var __spreadValues$g = (a, b) => {
|
|
1255
|
+
for (var prop in b || (b = {}))
|
|
1256
|
+
if (__hasOwnProp$g.call(b, prop))
|
|
1257
|
+
__defNormalProp$g(a, prop, b[prop]);
|
|
1258
|
+
if (__getOwnPropSymbols$g)
|
|
1259
|
+
for (var prop of __getOwnPropSymbols$g(b)) {
|
|
1260
|
+
if (__propIsEnum$g.call(b, prop))
|
|
1261
|
+
__defNormalProp$g(a, prop, b[prop]);
|
|
1262
|
+
}
|
|
1263
|
+
return a;
|
|
1264
|
+
};
|
|
1265
|
+
var __objRest$c = (source, exclude) => {
|
|
1266
|
+
var target = {};
|
|
1267
|
+
for (var prop in source)
|
|
1268
|
+
if (__hasOwnProp$g.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
1269
|
+
target[prop] = source[prop];
|
|
1270
|
+
if (source != null && __getOwnPropSymbols$g)
|
|
1271
|
+
for (var prop of __getOwnPropSymbols$g(source)) {
|
|
1272
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$g.call(source, prop))
|
|
1273
|
+
target[prop] = source[prop];
|
|
1274
|
+
}
|
|
1275
|
+
return target;
|
|
1276
|
+
};
|
|
1277
|
+
function BaseForm(props) {
|
|
1278
|
+
const _a = props, { onSubmit, children } = _a, rest = __objRest$c(_a, ["onSubmit", "children"]);
|
|
1279
|
+
return /* @__PURE__ */ React__default.default.createElement(
|
|
1280
|
+
reactAriaComponents.Form,
|
|
1281
|
+
__spreadValues$g({
|
|
1282
|
+
onSubmit: (e) => {
|
|
1283
|
+
e.preventDefault();
|
|
1284
|
+
const formData = new FormData(e.currentTarget);
|
|
1285
|
+
const formValues = {};
|
|
1286
|
+
formData.forEach((value, key) => {
|
|
1287
|
+
const field = e.currentTarget.elements.namedItem(key);
|
|
1288
|
+
if (field instanceof RadioNodeList && Array.from(field.values()).every(
|
|
1289
|
+
(f) => f.type === "checkbox"
|
|
1290
|
+
)) {
|
|
1291
|
+
formValues[key] = formData.getAll(key);
|
|
1292
|
+
} else {
|
|
1293
|
+
field.type;
|
|
1294
|
+
formValues[key] = formData.get(key);
|
|
1295
|
+
}
|
|
1296
|
+
});
|
|
1297
|
+
onSubmit == null ? void 0 : onSubmit(formValues);
|
|
1298
|
+
}
|
|
1299
|
+
}, rest),
|
|
1300
|
+
children
|
|
1301
|
+
);
|
|
1302
|
+
}
|
|
1303
|
+
function registerForm(loader, overrides) {
|
|
1304
|
+
registerComponentHelper(
|
|
1305
|
+
loader,
|
|
1306
|
+
BaseForm,
|
|
1307
|
+
{
|
|
1308
|
+
name: makeComponentName("form"),
|
|
1309
|
+
displayName: "Aria Form",
|
|
1310
|
+
importPath: "@plasmicpkgs/react-aria/skinny/registerForm",
|
|
1311
|
+
importName: "BaseForm",
|
|
1312
|
+
props: {
|
|
1313
|
+
children: {
|
|
1221
1314
|
type: "slot"
|
|
1222
1315
|
},
|
|
1223
1316
|
onSubmit: {
|
|
@@ -1235,43 +1328,43 @@ function registerForm(loader, overrides) {
|
|
|
1235
1328
|
);
|
|
1236
1329
|
}
|
|
1237
1330
|
|
|
1238
|
-
var __defProp$
|
|
1239
|
-
var __getOwnPropSymbols$
|
|
1240
|
-
var __hasOwnProp$
|
|
1241
|
-
var __propIsEnum$
|
|
1242
|
-
var __defNormalProp$
|
|
1243
|
-
var __spreadValues$
|
|
1331
|
+
var __defProp$f = Object.defineProperty;
|
|
1332
|
+
var __getOwnPropSymbols$f = Object.getOwnPropertySymbols;
|
|
1333
|
+
var __hasOwnProp$f = Object.prototype.hasOwnProperty;
|
|
1334
|
+
var __propIsEnum$f = Object.prototype.propertyIsEnumerable;
|
|
1335
|
+
var __defNormalProp$f = (obj, key, value) => key in obj ? __defProp$f(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1336
|
+
var __spreadValues$f = (a, b) => {
|
|
1244
1337
|
for (var prop in b || (b = {}))
|
|
1245
|
-
if (__hasOwnProp$
|
|
1246
|
-
__defNormalProp$
|
|
1247
|
-
if (__getOwnPropSymbols$
|
|
1248
|
-
for (var prop of __getOwnPropSymbols$
|
|
1249
|
-
if (__propIsEnum$
|
|
1250
|
-
__defNormalProp$
|
|
1338
|
+
if (__hasOwnProp$f.call(b, prop))
|
|
1339
|
+
__defNormalProp$f(a, prop, b[prop]);
|
|
1340
|
+
if (__getOwnPropSymbols$f)
|
|
1341
|
+
for (var prop of __getOwnPropSymbols$f(b)) {
|
|
1342
|
+
if (__propIsEnum$f.call(b, prop))
|
|
1343
|
+
__defNormalProp$f(a, prop, b[prop]);
|
|
1251
1344
|
}
|
|
1252
1345
|
return a;
|
|
1253
1346
|
};
|
|
1254
|
-
var __objRest$
|
|
1347
|
+
var __objRest$b = (source, exclude) => {
|
|
1255
1348
|
var target = {};
|
|
1256
1349
|
for (var prop in source)
|
|
1257
|
-
if (__hasOwnProp$
|
|
1350
|
+
if (__hasOwnProp$f.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
1258
1351
|
target[prop] = source[prop];
|
|
1259
|
-
if (source != null && __getOwnPropSymbols$
|
|
1260
|
-
for (var prop of __getOwnPropSymbols$
|
|
1261
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
1352
|
+
if (source != null && __getOwnPropSymbols$f)
|
|
1353
|
+
for (var prop of __getOwnPropSymbols$f(source)) {
|
|
1354
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$f.call(source, prop))
|
|
1262
1355
|
target[prop] = source[prop];
|
|
1263
1356
|
}
|
|
1264
1357
|
return target;
|
|
1265
1358
|
};
|
|
1266
1359
|
const INPUT_INTERACTION_VARIANTS = ["focused", "hovered"];
|
|
1267
|
-
const { interactionVariants: interactionVariants$
|
|
1360
|
+
const { interactionVariants: interactionVariants$5 } = pickAriaComponentVariants(
|
|
1268
1361
|
INPUT_INTERACTION_VARIANTS
|
|
1269
1362
|
);
|
|
1270
1363
|
function BaseInput(props) {
|
|
1271
|
-
const _a = props, { updateInteractionVariant } = _a, rest = __objRest$
|
|
1364
|
+
const _a = props, { updateInteractionVariant } = _a, rest = __objRest$b(_a, ["updateInteractionVariant"]);
|
|
1272
1365
|
return /* @__PURE__ */ React__default.default.createElement(
|
|
1273
1366
|
reactAriaComponents.Input,
|
|
1274
|
-
__spreadValues$
|
|
1367
|
+
__spreadValues$f({
|
|
1275
1368
|
onHoverChange: (isHovered) => {
|
|
1276
1369
|
updateInteractionVariant == null ? void 0 : updateInteractionVariant({
|
|
1277
1370
|
hovered: isHovered
|
|
@@ -1299,7 +1392,7 @@ function registerInput(loader, overrides) {
|
|
|
1299
1392
|
displayName: "Aria Input",
|
|
1300
1393
|
importPath: "@plasmicpkgs/react-aria/skinny/registerInput",
|
|
1301
1394
|
importName: "BaseInput",
|
|
1302
|
-
interactionVariants: interactionVariants$
|
|
1395
|
+
interactionVariants: interactionVariants$5,
|
|
1303
1396
|
props: {
|
|
1304
1397
|
placeholder: {
|
|
1305
1398
|
type: "string"
|
|
@@ -1311,27 +1404,26 @@ function registerInput(loader, overrides) {
|
|
|
1311
1404
|
);
|
|
1312
1405
|
}
|
|
1313
1406
|
|
|
1314
|
-
var __defProp$
|
|
1315
|
-
var __getOwnPropSymbols$
|
|
1316
|
-
var __hasOwnProp$
|
|
1317
|
-
var __propIsEnum$
|
|
1318
|
-
var __defNormalProp$
|
|
1319
|
-
var __spreadValues$
|
|
1407
|
+
var __defProp$e = Object.defineProperty;
|
|
1408
|
+
var __getOwnPropSymbols$e = Object.getOwnPropertySymbols;
|
|
1409
|
+
var __hasOwnProp$e = Object.prototype.hasOwnProperty;
|
|
1410
|
+
var __propIsEnum$e = Object.prototype.propertyIsEnumerable;
|
|
1411
|
+
var __defNormalProp$e = (obj, key, value) => key in obj ? __defProp$e(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1412
|
+
var __spreadValues$e = (a, b) => {
|
|
1320
1413
|
for (var prop in b || (b = {}))
|
|
1321
|
-
if (__hasOwnProp$
|
|
1322
|
-
__defNormalProp$
|
|
1323
|
-
if (__getOwnPropSymbols$
|
|
1324
|
-
for (var prop of __getOwnPropSymbols$
|
|
1325
|
-
if (__propIsEnum$
|
|
1326
|
-
__defNormalProp$
|
|
1414
|
+
if (__hasOwnProp$e.call(b, prop))
|
|
1415
|
+
__defNormalProp$e(a, prop, b[prop]);
|
|
1416
|
+
if (__getOwnPropSymbols$e)
|
|
1417
|
+
for (var prop of __getOwnPropSymbols$e(b)) {
|
|
1418
|
+
if (__propIsEnum$e.call(b, prop))
|
|
1419
|
+
__defNormalProp$e(a, prop, b[prop]);
|
|
1327
1420
|
}
|
|
1328
1421
|
return a;
|
|
1329
1422
|
};
|
|
1330
1423
|
function BaseListBoxItem(props) {
|
|
1331
|
-
var _a;
|
|
1332
1424
|
const contextProps = React__default.default.useContext(PlasmicItemContext);
|
|
1333
1425
|
const mergedProps = utils.mergeProps(contextProps, props);
|
|
1334
|
-
return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.ListBoxItem, __spreadValues$
|
|
1426
|
+
return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.ListBoxItem, __spreadValues$e({}, mergedProps), mergedProps.children);
|
|
1335
1427
|
}
|
|
1336
1428
|
function registerListBoxItem(loader, overrides) {
|
|
1337
1429
|
registerComponentHelper(
|
|
@@ -1343,23 +1435,8 @@ function registerListBoxItem(loader, overrides) {
|
|
|
1343
1435
|
importPath: "@plasmicpkgs/react-aria/skinny/registerListBoxItem",
|
|
1344
1436
|
importName: "BaseListBoxItem",
|
|
1345
1437
|
props: {
|
|
1346
|
-
|
|
1347
|
-
type: "
|
|
1348
|
-
displayName: "Additional states",
|
|
1349
|
-
selectors: [
|
|
1350
|
-
{
|
|
1351
|
-
selector: ":self[data-selected]",
|
|
1352
|
-
label: "Selected"
|
|
1353
|
-
},
|
|
1354
|
-
{
|
|
1355
|
-
selector: ":self[data-focused], :self[data-hovered]",
|
|
1356
|
-
label: "Focused"
|
|
1357
|
-
},
|
|
1358
|
-
{
|
|
1359
|
-
selector: ":self[data-disabled]",
|
|
1360
|
-
label: "Disabled"
|
|
1361
|
-
}
|
|
1362
|
-
]
|
|
1438
|
+
children: {
|
|
1439
|
+
type: "slot"
|
|
1363
1440
|
}
|
|
1364
1441
|
}
|
|
1365
1442
|
},
|
|
@@ -1367,102 +1444,67 @@ function registerListBoxItem(loader, overrides) {
|
|
|
1367
1444
|
);
|
|
1368
1445
|
}
|
|
1369
1446
|
|
|
1370
|
-
var __defProp$
|
|
1447
|
+
var __defProp$d = Object.defineProperty;
|
|
1371
1448
|
var __defProps$7 = Object.defineProperties;
|
|
1372
1449
|
var __getOwnPropDescs$7 = Object.getOwnPropertyDescriptors;
|
|
1373
|
-
var __getOwnPropSymbols$
|
|
1374
|
-
var __hasOwnProp$
|
|
1375
|
-
var __propIsEnum$
|
|
1376
|
-
var __defNormalProp$
|
|
1377
|
-
var __spreadValues$
|
|
1450
|
+
var __getOwnPropSymbols$d = Object.getOwnPropertySymbols;
|
|
1451
|
+
var __hasOwnProp$d = Object.prototype.hasOwnProperty;
|
|
1452
|
+
var __propIsEnum$d = Object.prototype.propertyIsEnumerable;
|
|
1453
|
+
var __defNormalProp$d = (obj, key, value) => key in obj ? __defProp$d(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1454
|
+
var __spreadValues$d = (a, b) => {
|
|
1378
1455
|
for (var prop in b || (b = {}))
|
|
1379
|
-
if (__hasOwnProp$
|
|
1380
|
-
__defNormalProp$
|
|
1381
|
-
if (__getOwnPropSymbols$
|
|
1382
|
-
for (var prop of __getOwnPropSymbols$
|
|
1383
|
-
if (__propIsEnum$
|
|
1384
|
-
__defNormalProp$
|
|
1456
|
+
if (__hasOwnProp$d.call(b, prop))
|
|
1457
|
+
__defNormalProp$d(a, prop, b[prop]);
|
|
1458
|
+
if (__getOwnPropSymbols$d)
|
|
1459
|
+
for (var prop of __getOwnPropSymbols$d(b)) {
|
|
1460
|
+
if (__propIsEnum$d.call(b, prop))
|
|
1461
|
+
__defNormalProp$d(a, prop, b[prop]);
|
|
1385
1462
|
}
|
|
1386
1463
|
return a;
|
|
1387
1464
|
};
|
|
1388
1465
|
var __spreadProps$7 = (a, b) => __defProps$7(a, __getOwnPropDescs$7(b));
|
|
1389
|
-
var __objRest$
|
|
1466
|
+
var __objRest$a = (source, exclude) => {
|
|
1390
1467
|
var target = {};
|
|
1391
1468
|
for (var prop in source)
|
|
1392
|
-
if (__hasOwnProp$
|
|
1469
|
+
if (__hasOwnProp$d.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
1393
1470
|
target[prop] = source[prop];
|
|
1394
|
-
if (source != null && __getOwnPropSymbols$
|
|
1395
|
-
for (var prop of __getOwnPropSymbols$
|
|
1396
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
1471
|
+
if (source != null && __getOwnPropSymbols$d)
|
|
1472
|
+
for (var prop of __getOwnPropSymbols$d(source)) {
|
|
1473
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$d.call(source, prop))
|
|
1397
1474
|
target[prop] = source[prop];
|
|
1398
1475
|
}
|
|
1399
1476
|
return target;
|
|
1400
1477
|
};
|
|
1401
|
-
const STANDALONE_PROPS = {
|
|
1402
|
-
getItemType: (item) => item.type,
|
|
1403
|
-
items: [
|
|
1404
|
-
{ type: "item", value: "op1", label: "Option 1" },
|
|
1405
|
-
{ type: "item", value: "op2", label: "Option 2" },
|
|
1406
|
-
{ type: "item", value: "op3", label: "Option 3" },
|
|
1407
|
-
{
|
|
1408
|
-
type: "section",
|
|
1409
|
-
label: "Section 1",
|
|
1410
|
-
items: [
|
|
1411
|
-
{ type: "item", value: "s1op1", label: "Section 1 Option 1" },
|
|
1412
|
-
{ type: "item", value: "s1op2", label: "Section 1 Option 2" },
|
|
1413
|
-
{ type: "item", value: "s1op3", label: "Section 1 Option 3" }
|
|
1414
|
-
]
|
|
1415
|
-
},
|
|
1416
|
-
{
|
|
1417
|
-
type: "section",
|
|
1418
|
-
label: "Section 2",
|
|
1419
|
-
items: [
|
|
1420
|
-
{ type: "item", value: "s2op1", label: "Section 2 Option 1" },
|
|
1421
|
-
{ type: "item", value: "s2op2", label: "Section 2 Option 2" },
|
|
1422
|
-
{ type: "item", value: "s2op3", label: "Section 2 Option 3" }
|
|
1423
|
-
]
|
|
1424
|
-
}
|
|
1425
|
-
],
|
|
1426
|
-
makeItemProps: (item) => ({
|
|
1427
|
-
key: item.value,
|
|
1428
|
-
textValue: item.label,
|
|
1429
|
-
children: item.label
|
|
1430
|
-
}),
|
|
1431
|
-
makeSectionProps: (section) => ({
|
|
1432
|
-
section,
|
|
1433
|
-
key: section.label
|
|
1434
|
-
})
|
|
1435
|
-
};
|
|
1436
1478
|
function BaseListBox(props) {
|
|
1479
|
+
var _c;
|
|
1437
1480
|
const contextProps = React__default.default.useContext(PlasmicListBoxContext);
|
|
1438
1481
|
const isStandalone = !contextProps;
|
|
1439
|
-
const _a =
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
} =
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
if ((getItemType == null ? void 0 : getItemType(item)) === "section") {
|
|
1454
|
-
const sectionProps = makeSectionProps == null ? void 0 : makeSectionProps(item);
|
|
1455
|
-
return /* @__PURE__ */ React__default.default.createElement(
|
|
1482
|
+
const _a = props, rest = __objRest$a(_a, ["options"]);
|
|
1483
|
+
const { options } = useStrictOptions(props);
|
|
1484
|
+
const _b = utils.mergeProps(
|
|
1485
|
+
contextProps,
|
|
1486
|
+
rest,
|
|
1487
|
+
isStandalone ? { items: options } : {}
|
|
1488
|
+
), { renderItem, renderSection } = _b, mergedProps = __objRest$a(_b, ["renderItem", "renderSection"]);
|
|
1489
|
+
(_c = props.setControlContextData) == null ? void 0 : _c.call(props, {
|
|
1490
|
+
isStandalone
|
|
1491
|
+
});
|
|
1492
|
+
return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.ListBox, __spreadValues$d({}, mergedProps), (item) => {
|
|
1493
|
+
var _a2;
|
|
1494
|
+
if (item.type === "option-group") {
|
|
1495
|
+
return /* @__PURE__ */ React__default.default.createElement(React__default.default.Fragment, null, /* @__PURE__ */ React__default.default.createElement(
|
|
1456
1496
|
PlasmicSectionContext.Provider,
|
|
1457
1497
|
{
|
|
1458
|
-
|
|
1459
|
-
|
|
1498
|
+
value: {
|
|
1499
|
+
renderItem,
|
|
1500
|
+
key: (_a2 = item.key) != null ? _a2 : item.label,
|
|
1501
|
+
section: item
|
|
1502
|
+
}
|
|
1460
1503
|
},
|
|
1461
1504
|
renderSection == null ? void 0 : renderSection(item)
|
|
1462
|
-
);
|
|
1505
|
+
));
|
|
1463
1506
|
} else {
|
|
1464
|
-
|
|
1465
|
-
return /* @__PURE__ */ React__default.default.createElement(PlasmicItemContext.Provider, { key: itemProps == null ? void 0 : itemProps.key, value: itemProps }, renderItem == null ? void 0 : renderItem(item));
|
|
1507
|
+
return /* @__PURE__ */ React__default.default.createElement(PlasmicItemContext.Provider, { value: item }, renderItem == null ? void 0 : renderItem(item));
|
|
1466
1508
|
}
|
|
1467
1509
|
});
|
|
1468
1510
|
}
|
|
@@ -1476,29 +1518,19 @@ function registerListBox(loader, overrides) {
|
|
|
1476
1518
|
importPath: "@plasmicpkgs/react-aria/skinny/registerListBox",
|
|
1477
1519
|
importName: "BaseListBox",
|
|
1478
1520
|
props: {
|
|
1521
|
+
options: __spreadProps$7(__spreadValues$d({}, makeOptionsPropType()), {
|
|
1522
|
+
displayName: "Items",
|
|
1523
|
+
hidden: (_ps, ctx) => !(ctx == null ? void 0 : ctx.isStandalone)
|
|
1524
|
+
}),
|
|
1479
1525
|
renderItem: {
|
|
1480
1526
|
type: "slot",
|
|
1481
1527
|
displayName: "Render Item",
|
|
1482
|
-
renderPropParams: ["
|
|
1528
|
+
renderPropParams: ["itemProps"]
|
|
1483
1529
|
},
|
|
1484
1530
|
renderSection: {
|
|
1485
1531
|
type: "slot",
|
|
1486
1532
|
displayName: "Render Section",
|
|
1487
|
-
renderPropParams: ["
|
|
1488
|
-
},
|
|
1489
|
-
className: {
|
|
1490
|
-
type: "class",
|
|
1491
|
-
displayName: "Additional states",
|
|
1492
|
-
selectors: [
|
|
1493
|
-
{
|
|
1494
|
-
selector: ":self[data-focused]",
|
|
1495
|
-
label: "Focused"
|
|
1496
|
-
},
|
|
1497
|
-
{
|
|
1498
|
-
selector: ":self[data-focus-visible]",
|
|
1499
|
-
label: "Focused by keyboard"
|
|
1500
|
-
}
|
|
1501
|
-
]
|
|
1533
|
+
renderPropParams: ["sectionProps"]
|
|
1502
1534
|
}
|
|
1503
1535
|
}
|
|
1504
1536
|
},
|
|
@@ -1509,33 +1541,33 @@ function registerListBox(loader, overrides) {
|
|
|
1509
1541
|
});
|
|
1510
1542
|
}
|
|
1511
1543
|
|
|
1512
|
-
var __defProp$
|
|
1544
|
+
var __defProp$c = Object.defineProperty;
|
|
1513
1545
|
var __defProps$6 = Object.defineProperties;
|
|
1514
1546
|
var __getOwnPropDescs$6 = Object.getOwnPropertyDescriptors;
|
|
1515
|
-
var __getOwnPropSymbols$
|
|
1516
|
-
var __hasOwnProp$
|
|
1517
|
-
var __propIsEnum$
|
|
1518
|
-
var __defNormalProp$
|
|
1519
|
-
var __spreadValues$
|
|
1547
|
+
var __getOwnPropSymbols$c = Object.getOwnPropertySymbols;
|
|
1548
|
+
var __hasOwnProp$c = Object.prototype.hasOwnProperty;
|
|
1549
|
+
var __propIsEnum$c = Object.prototype.propertyIsEnumerable;
|
|
1550
|
+
var __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$c(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1551
|
+
var __spreadValues$c = (a, b) => {
|
|
1520
1552
|
for (var prop in b || (b = {}))
|
|
1521
|
-
if (__hasOwnProp$
|
|
1522
|
-
__defNormalProp$
|
|
1523
|
-
if (__getOwnPropSymbols$
|
|
1524
|
-
for (var prop of __getOwnPropSymbols$
|
|
1525
|
-
if (__propIsEnum$
|
|
1526
|
-
__defNormalProp$
|
|
1553
|
+
if (__hasOwnProp$c.call(b, prop))
|
|
1554
|
+
__defNormalProp$c(a, prop, b[prop]);
|
|
1555
|
+
if (__getOwnPropSymbols$c)
|
|
1556
|
+
for (var prop of __getOwnPropSymbols$c(b)) {
|
|
1557
|
+
if (__propIsEnum$c.call(b, prop))
|
|
1558
|
+
__defNormalProp$c(a, prop, b[prop]);
|
|
1527
1559
|
}
|
|
1528
1560
|
return a;
|
|
1529
1561
|
};
|
|
1530
1562
|
var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));
|
|
1531
|
-
var __objRest$
|
|
1563
|
+
var __objRest$9 = (source, exclude) => {
|
|
1532
1564
|
var target = {};
|
|
1533
1565
|
for (var prop in source)
|
|
1534
|
-
if (__hasOwnProp$
|
|
1566
|
+
if (__hasOwnProp$c.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
1535
1567
|
target[prop] = source[prop];
|
|
1536
|
-
if (source != null && __getOwnPropSymbols$
|
|
1537
|
-
for (var prop of __getOwnPropSymbols$
|
|
1538
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
1568
|
+
if (source != null && __getOwnPropSymbols$c)
|
|
1569
|
+
for (var prop of __getOwnPropSymbols$c(source)) {
|
|
1570
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$c.call(source, prop))
|
|
1539
1571
|
target[prop] = source[prop];
|
|
1540
1572
|
}
|
|
1541
1573
|
return target;
|
|
@@ -1548,7 +1580,7 @@ const BaseModal = React.forwardRef(
|
|
|
1548
1580
|
modalOverlayClass,
|
|
1549
1581
|
onOpenChange,
|
|
1550
1582
|
className
|
|
1551
|
-
} = _a, rest = __objRest$
|
|
1583
|
+
} = _a, rest = __objRest$9(_a, [
|
|
1552
1584
|
"children",
|
|
1553
1585
|
"heading",
|
|
1554
1586
|
"modalOverlayClass",
|
|
@@ -1567,7 +1599,7 @@ const BaseModal = React.forwardRef(
|
|
|
1567
1599
|
const body = /* @__PURE__ */ React__default.default.createElement(React__default.default.Fragment, null, heading && /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Heading, { slot: "title" }, heading), children);
|
|
1568
1600
|
return /* @__PURE__ */ React__default.default.createElement(
|
|
1569
1601
|
reactAriaComponents.ModalOverlay,
|
|
1570
|
-
__spreadProps$6(__spreadValues$
|
|
1602
|
+
__spreadProps$6(__spreadValues$c({}, rest), {
|
|
1571
1603
|
className: modalOverlayClass,
|
|
1572
1604
|
onOpenChange
|
|
1573
1605
|
}),
|
|
@@ -1639,58 +1671,48 @@ function registerModal(loader, overrides) {
|
|
|
1639
1671
|
);
|
|
1640
1672
|
}
|
|
1641
1673
|
|
|
1642
|
-
var __defProp$
|
|
1643
|
-
var
|
|
1644
|
-
var
|
|
1645
|
-
var
|
|
1646
|
-
var
|
|
1647
|
-
var
|
|
1648
|
-
var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$9(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1649
|
-
var __spreadValues$9 = (a, b) => {
|
|
1674
|
+
var __defProp$b = Object.defineProperty;
|
|
1675
|
+
var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
|
|
1676
|
+
var __hasOwnProp$b = Object.prototype.hasOwnProperty;
|
|
1677
|
+
var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
|
|
1678
|
+
var __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$b(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1679
|
+
var __spreadValues$b = (a, b) => {
|
|
1650
1680
|
for (var prop in b || (b = {}))
|
|
1651
|
-
if (__hasOwnProp$
|
|
1652
|
-
__defNormalProp$
|
|
1653
|
-
if (__getOwnPropSymbols$
|
|
1654
|
-
for (var prop of __getOwnPropSymbols$
|
|
1655
|
-
if (__propIsEnum$
|
|
1656
|
-
__defNormalProp$
|
|
1657
|
-
}
|
|
1681
|
+
if (__hasOwnProp$b.call(b, prop))
|
|
1682
|
+
__defNormalProp$b(a, prop, b[prop]);
|
|
1683
|
+
if (__getOwnPropSymbols$b)
|
|
1684
|
+
for (var prop of __getOwnPropSymbols$b(b)) {
|
|
1685
|
+
if (__propIsEnum$b.call(b, prop))
|
|
1686
|
+
__defNormalProp$b(a, prop, b[prop]);
|
|
1687
|
+
}
|
|
1658
1688
|
return a;
|
|
1659
1689
|
};
|
|
1660
|
-
var
|
|
1661
|
-
var __objRest$6 = (source, exclude) => {
|
|
1690
|
+
var __objRest$8 = (source, exclude) => {
|
|
1662
1691
|
var target = {};
|
|
1663
1692
|
for (var prop in source)
|
|
1664
|
-
if (__hasOwnProp$
|
|
1693
|
+
if (__hasOwnProp$b.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
1665
1694
|
target[prop] = source[prop];
|
|
1666
|
-
if (source != null && __getOwnPropSymbols$
|
|
1667
|
-
for (var prop of __getOwnPropSymbols$
|
|
1668
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
1695
|
+
if (source != null && __getOwnPropSymbols$b)
|
|
1696
|
+
for (var prop of __getOwnPropSymbols$b(source)) {
|
|
1697
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$b.call(source, prop))
|
|
1669
1698
|
target[prop] = source[prop];
|
|
1670
1699
|
}
|
|
1671
1700
|
return target;
|
|
1672
1701
|
};
|
|
1673
1702
|
function BasePopover(props) {
|
|
1674
|
-
const _a = props, { resetClassName } = _a, restProps = __objRest$
|
|
1703
|
+
const _a = props, { resetClassName } = _a, restProps = __objRest$8(_a, ["resetClassName"]);
|
|
1675
1704
|
const isStandalone = !React__default.default.useContext(reactAriaComponents.PopoverContext);
|
|
1676
1705
|
const contextProps = React__default.default.useContext(PlasmicPopoverContext);
|
|
1677
|
-
const canvas = host.usePlasmicCanvasContext();
|
|
1678
1706
|
const mergedProps = utils.mergeProps(contextProps, restProps, {
|
|
1679
1707
|
className: `${resetClassName}`
|
|
1680
1708
|
});
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
isOpen: true
|
|
1689
|
-
})
|
|
1690
|
-
));
|
|
1691
|
-
} else {
|
|
1692
|
-
return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Popover, __spreadProps$5(__spreadValues$9({}, mergedProps), { isNonModal: !!canvas }));
|
|
1693
|
-
}
|
|
1709
|
+
const triggerRef = React__default.default.useRef(null);
|
|
1710
|
+
const standaloneProps = isStandalone ? {
|
|
1711
|
+
triggerRef,
|
|
1712
|
+
isNonModal: true,
|
|
1713
|
+
isOpen: true
|
|
1714
|
+
} : {};
|
|
1715
|
+
return /* @__PURE__ */ React__default.default.createElement(React__default.default.Fragment, null, isStandalone && /* @__PURE__ */ React__default.default.createElement("div", { ref: triggerRef }), /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Popover, __spreadValues$b(__spreadValues$b({}, mergedProps), standaloneProps)));
|
|
1694
1716
|
}
|
|
1695
1717
|
function registerPopover(loader, overrides) {
|
|
1696
1718
|
registerComponentHelper(
|
|
@@ -1726,20 +1748,6 @@ function registerPopover(loader, overrides) {
|
|
|
1726
1748
|
resetClassName: {
|
|
1727
1749
|
type: "themeResetClass"
|
|
1728
1750
|
}
|
|
1729
|
-
// className: {
|
|
1730
|
-
// type: "class",
|
|
1731
|
-
// displayName: "Additional states",
|
|
1732
|
-
// selectors: [
|
|
1733
|
-
// {
|
|
1734
|
-
// selector: ":self[data-entering]",
|
|
1735
|
-
// label: "Entering",
|
|
1736
|
-
// },
|
|
1737
|
-
// {
|
|
1738
|
-
// selector: ":self[data-exiting]",
|
|
1739
|
-
// label: "Exiting",
|
|
1740
|
-
// },
|
|
1741
|
-
// ],
|
|
1742
|
-
// },
|
|
1743
1751
|
},
|
|
1744
1752
|
styleSections: true
|
|
1745
1753
|
},
|
|
@@ -1763,33 +1771,33 @@ class ErrorBoundary extends React.Component {
|
|
|
1763
1771
|
}
|
|
1764
1772
|
}
|
|
1765
1773
|
|
|
1766
|
-
var __defProp$
|
|
1767
|
-
var __defProps$
|
|
1768
|
-
var __getOwnPropDescs$
|
|
1769
|
-
var __getOwnPropSymbols$
|
|
1770
|
-
var __hasOwnProp$
|
|
1771
|
-
var __propIsEnum$
|
|
1772
|
-
var __defNormalProp$
|
|
1773
|
-
var __spreadValues$
|
|
1774
|
+
var __defProp$a = Object.defineProperty;
|
|
1775
|
+
var __defProps$5 = Object.defineProperties;
|
|
1776
|
+
var __getOwnPropDescs$5 = Object.getOwnPropertyDescriptors;
|
|
1777
|
+
var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
|
|
1778
|
+
var __hasOwnProp$a = Object.prototype.hasOwnProperty;
|
|
1779
|
+
var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
|
|
1780
|
+
var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$a(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1781
|
+
var __spreadValues$a = (a, b) => {
|
|
1774
1782
|
for (var prop in b || (b = {}))
|
|
1775
|
-
if (__hasOwnProp$
|
|
1776
|
-
__defNormalProp$
|
|
1777
|
-
if (__getOwnPropSymbols$
|
|
1778
|
-
for (var prop of __getOwnPropSymbols$
|
|
1779
|
-
if (__propIsEnum$
|
|
1780
|
-
__defNormalProp$
|
|
1783
|
+
if (__hasOwnProp$a.call(b, prop))
|
|
1784
|
+
__defNormalProp$a(a, prop, b[prop]);
|
|
1785
|
+
if (__getOwnPropSymbols$a)
|
|
1786
|
+
for (var prop of __getOwnPropSymbols$a(b)) {
|
|
1787
|
+
if (__propIsEnum$a.call(b, prop))
|
|
1788
|
+
__defNormalProp$a(a, prop, b[prop]);
|
|
1781
1789
|
}
|
|
1782
1790
|
return a;
|
|
1783
1791
|
};
|
|
1784
|
-
var __spreadProps$
|
|
1785
|
-
var __objRest$
|
|
1792
|
+
var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));
|
|
1793
|
+
var __objRest$7 = (source, exclude) => {
|
|
1786
1794
|
var target = {};
|
|
1787
1795
|
for (var prop in source)
|
|
1788
|
-
if (__hasOwnProp$
|
|
1796
|
+
if (__hasOwnProp$a.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
1789
1797
|
target[prop] = source[prop];
|
|
1790
|
-
if (source != null && __getOwnPropSymbols$
|
|
1791
|
-
for (var prop of __getOwnPropSymbols$
|
|
1792
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
1798
|
+
if (source != null && __getOwnPropSymbols$a)
|
|
1799
|
+
for (var prop of __getOwnPropSymbols$a(source)) {
|
|
1800
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$a.call(source, prop))
|
|
1793
1801
|
target[prop] = source[prop];
|
|
1794
1802
|
}
|
|
1795
1803
|
return target;
|
|
@@ -1800,12 +1808,12 @@ const RADIO_INTERACTION_VARIANTS = [
|
|
|
1800
1808
|
"focused",
|
|
1801
1809
|
"focusVisible"
|
|
1802
1810
|
];
|
|
1803
|
-
const { interactionVariants: interactionVariants$
|
|
1811
|
+
const { interactionVariants: interactionVariants$4, withObservedValues: withObservedValues$3 } = pickAriaComponentVariants(
|
|
1804
1812
|
RADIO_INTERACTION_VARIANTS
|
|
1805
1813
|
);
|
|
1806
1814
|
function BaseRadio(props) {
|
|
1807
|
-
const _a = props, { children, updateInteractionVariant } = _a, rest = __objRest$
|
|
1808
|
-
const radio = /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Radio, __spreadValues$
|
|
1815
|
+
const _a = props, { children, updateInteractionVariant } = _a, rest = __objRest$7(_a, ["children", "updateInteractionVariant"]);
|
|
1816
|
+
const radio = /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Radio, __spreadValues$a({}, rest), ({ isHovered, isPressed, isFocused, isFocusVisible }) => withObservedValues$3(
|
|
1809
1817
|
children,
|
|
1810
1818
|
{
|
|
1811
1819
|
hovered: isHovered,
|
|
@@ -1826,8 +1834,8 @@ function registerRadio(loader, overrides) {
|
|
|
1826
1834
|
displayName: "Aria Radio",
|
|
1827
1835
|
importPath: "@plasmicpkgs/react-aria/skinny/registerRadio",
|
|
1828
1836
|
importName: "BaseRadio",
|
|
1829
|
-
interactionVariants: interactionVariants$
|
|
1830
|
-
props: __spreadProps$
|
|
1837
|
+
interactionVariants: interactionVariants$4,
|
|
1838
|
+
props: __spreadProps$5(__spreadValues$a({}, getCommonInputProps("radio", [
|
|
1831
1839
|
"isDisabled",
|
|
1832
1840
|
"autoFocus",
|
|
1833
1841
|
"aria-label",
|
|
@@ -1855,25 +1863,25 @@ function registerRadio(loader, overrides) {
|
|
|
1855
1863
|
);
|
|
1856
1864
|
}
|
|
1857
1865
|
|
|
1858
|
-
var __defProp$
|
|
1859
|
-
var __defProps$
|
|
1860
|
-
var __getOwnPropDescs$
|
|
1861
|
-
var __getOwnPropSymbols$
|
|
1862
|
-
var __hasOwnProp$
|
|
1863
|
-
var __propIsEnum$
|
|
1864
|
-
var __defNormalProp$
|
|
1865
|
-
var __spreadValues$
|
|
1866
|
+
var __defProp$9 = Object.defineProperty;
|
|
1867
|
+
var __defProps$4 = Object.defineProperties;
|
|
1868
|
+
var __getOwnPropDescs$4 = Object.getOwnPropertyDescriptors;
|
|
1869
|
+
var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
|
|
1870
|
+
var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
|
|
1871
|
+
var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
|
|
1872
|
+
var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$9(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1873
|
+
var __spreadValues$9 = (a, b) => {
|
|
1866
1874
|
for (var prop in b || (b = {}))
|
|
1867
|
-
if (__hasOwnProp$
|
|
1868
|
-
__defNormalProp$
|
|
1869
|
-
if (__getOwnPropSymbols$
|
|
1870
|
-
for (var prop of __getOwnPropSymbols$
|
|
1871
|
-
if (__propIsEnum$
|
|
1872
|
-
__defNormalProp$
|
|
1875
|
+
if (__hasOwnProp$9.call(b, prop))
|
|
1876
|
+
__defNormalProp$9(a, prop, b[prop]);
|
|
1877
|
+
if (__getOwnPropSymbols$9)
|
|
1878
|
+
for (var prop of __getOwnPropSymbols$9(b)) {
|
|
1879
|
+
if (__propIsEnum$9.call(b, prop))
|
|
1880
|
+
__defNormalProp$9(a, prop, b[prop]);
|
|
1873
1881
|
}
|
|
1874
1882
|
return a;
|
|
1875
1883
|
};
|
|
1876
|
-
var __spreadProps$
|
|
1884
|
+
var __spreadProps$4 = (a, b) => __defProps$4(a, __getOwnPropDescs$4(b));
|
|
1877
1885
|
const BaseRadioGroup = reactAriaComponents.RadioGroup;
|
|
1878
1886
|
const componentName$1 = makeComponentName("radioGroup");
|
|
1879
1887
|
function registerRadioGroup(loader, overrides) {
|
|
@@ -1885,7 +1893,7 @@ function registerRadioGroup(loader, overrides) {
|
|
|
1885
1893
|
displayName: "Aria RadioGroup",
|
|
1886
1894
|
importPath: "@plasmicpkgs/react-aria/skinny/registerRadioGroup",
|
|
1887
1895
|
importName: "BaseRadioGroup",
|
|
1888
|
-
props: __spreadProps$
|
|
1896
|
+
props: __spreadProps$4(__spreadValues$9({}, getCommonInputProps("radio group", [
|
|
1889
1897
|
"name",
|
|
1890
1898
|
"isDisabled",
|
|
1891
1899
|
"isReadOnly",
|
|
@@ -1940,6 +1948,274 @@ function registerRadioGroup(loader, overrides) {
|
|
|
1940
1948
|
});
|
|
1941
1949
|
}
|
|
1942
1950
|
|
|
1951
|
+
var __defProp$8 = Object.defineProperty;
|
|
1952
|
+
var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
|
|
1953
|
+
var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
|
|
1954
|
+
var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
|
|
1955
|
+
var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$8(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1956
|
+
var __spreadValues$8 = (a, b) => {
|
|
1957
|
+
for (var prop in b || (b = {}))
|
|
1958
|
+
if (__hasOwnProp$8.call(b, prop))
|
|
1959
|
+
__defNormalProp$8(a, prop, b[prop]);
|
|
1960
|
+
if (__getOwnPropSymbols$8)
|
|
1961
|
+
for (var prop of __getOwnPropSymbols$8(b)) {
|
|
1962
|
+
if (__propIsEnum$8.call(b, prop))
|
|
1963
|
+
__defNormalProp$8(a, prop, b[prop]);
|
|
1964
|
+
}
|
|
1965
|
+
return a;
|
|
1966
|
+
};
|
|
1967
|
+
function BaseHeader(props) {
|
|
1968
|
+
const contextProps = React__default.default.useContext(PlasmicHeaderContext);
|
|
1969
|
+
return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Header, __spreadValues$8({}, utils.mergeProps(contextProps, props)));
|
|
1970
|
+
}
|
|
1971
|
+
function registerHeader(loader, overrides) {
|
|
1972
|
+
registerComponentHelper(
|
|
1973
|
+
loader,
|
|
1974
|
+
BaseHeader,
|
|
1975
|
+
{
|
|
1976
|
+
name: makeComponentName("header"),
|
|
1977
|
+
displayName: "Aria Header",
|
|
1978
|
+
importPath: "@plasmicpkgs/react-aria/skinny/registerHeader",
|
|
1979
|
+
importName: "BaseHeader",
|
|
1980
|
+
props: {}
|
|
1981
|
+
},
|
|
1982
|
+
overrides
|
|
1983
|
+
);
|
|
1984
|
+
}
|
|
1985
|
+
|
|
1986
|
+
function BaseSection(props) {
|
|
1987
|
+
const contextProps = React__default.default.useContext(PlasmicSectionContext);
|
|
1988
|
+
const mergedProps = utils.mergeProps(contextProps, props);
|
|
1989
|
+
const { section, renderHeader, key, renderItem } = mergedProps;
|
|
1990
|
+
return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Section, { id: key }, /* @__PURE__ */ React__default.default.createElement(PlasmicHeaderContext.Provider, { value: { children: section == null ? void 0 : section.label } }, renderHeader == null ? void 0 : renderHeader(section)), /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Collection, { items: section == null ? void 0 : section.items }, (item) => {
|
|
1991
|
+
return /* @__PURE__ */ React__default.default.createElement(PlasmicItemContext.Provider, { value: item }, renderItem == null ? void 0 : renderItem(item));
|
|
1992
|
+
}));
|
|
1993
|
+
}
|
|
1994
|
+
function registerSection(loader, overrides) {
|
|
1995
|
+
registerComponentHelper(
|
|
1996
|
+
loader,
|
|
1997
|
+
BaseSection,
|
|
1998
|
+
{
|
|
1999
|
+
name: makeComponentName("section"),
|
|
2000
|
+
displayName: "Aria Section",
|
|
2001
|
+
importPath: "@plasmicpkgs/react-aria/skinny/registerSection",
|
|
2002
|
+
importName: "BaseSection",
|
|
2003
|
+
props: {
|
|
2004
|
+
renderHeader: {
|
|
2005
|
+
type: "slot",
|
|
2006
|
+
displayName: "Render section header",
|
|
2007
|
+
renderPropParams: ["sectionProps"]
|
|
2008
|
+
}
|
|
2009
|
+
}
|
|
2010
|
+
},
|
|
2011
|
+
overrides
|
|
2012
|
+
);
|
|
2013
|
+
const thisName = makeChildComponentName(
|
|
2014
|
+
overrides == null ? void 0 : overrides.parentComponentName,
|
|
2015
|
+
makeComponentName("section")
|
|
2016
|
+
);
|
|
2017
|
+
registerHeader(loader, {
|
|
2018
|
+
parentComponentName: thisName
|
|
2019
|
+
});
|
|
2020
|
+
}
|
|
2021
|
+
|
|
2022
|
+
var __defProp$7 = Object.defineProperty;
|
|
2023
|
+
var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
|
|
2024
|
+
var __hasOwnProp$7 = Object.prototype.hasOwnProperty;
|
|
2025
|
+
var __propIsEnum$7 = Object.prototype.propertyIsEnumerable;
|
|
2026
|
+
var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
2027
|
+
var __spreadValues$7 = (a, b) => {
|
|
2028
|
+
for (var prop in b || (b = {}))
|
|
2029
|
+
if (__hasOwnProp$7.call(b, prop))
|
|
2030
|
+
__defNormalProp$7(a, prop, b[prop]);
|
|
2031
|
+
if (__getOwnPropSymbols$7)
|
|
2032
|
+
for (var prop of __getOwnPropSymbols$7(b)) {
|
|
2033
|
+
if (__propIsEnum$7.call(b, prop))
|
|
2034
|
+
__defNormalProp$7(a, prop, b[prop]);
|
|
2035
|
+
}
|
|
2036
|
+
return a;
|
|
2037
|
+
};
|
|
2038
|
+
const SELECT_NAME = makeComponentName("select");
|
|
2039
|
+
function BaseSelect(props) {
|
|
2040
|
+
const {
|
|
2041
|
+
value,
|
|
2042
|
+
onChange,
|
|
2043
|
+
placeholder,
|
|
2044
|
+
previewOpen,
|
|
2045
|
+
onOpenChange,
|
|
2046
|
+
isDisabled,
|
|
2047
|
+
className,
|
|
2048
|
+
style,
|
|
2049
|
+
structure,
|
|
2050
|
+
name,
|
|
2051
|
+
"aria-label": ariaLabel
|
|
2052
|
+
} = props;
|
|
2053
|
+
const { options } = useStrictOptions(props);
|
|
2054
|
+
const canvas = host.usePlasmicCanvasContext();
|
|
2055
|
+
const disabledKeys = flattenOptions(options).filter((op) => op.isDisabled).map((op) => op.id);
|
|
2056
|
+
return /* @__PURE__ */ React__default.default.createElement(
|
|
2057
|
+
reactAriaComponents.Select,
|
|
2058
|
+
__spreadValues$7(__spreadValues$7({
|
|
2059
|
+
placeholder,
|
|
2060
|
+
selectedKey: value,
|
|
2061
|
+
onSelectionChange: onChange,
|
|
2062
|
+
onOpenChange,
|
|
2063
|
+
isDisabled,
|
|
2064
|
+
className,
|
|
2065
|
+
style,
|
|
2066
|
+
name,
|
|
2067
|
+
"aria-label": ariaLabel
|
|
2068
|
+
}, previewOpen && canvas ? { isOpen: previewOpen } : void 0), extractPlasmicDataProps(props)),
|
|
2069
|
+
/* @__PURE__ */ React__default.default.createElement(
|
|
2070
|
+
PlasmicListBoxContext.Provider,
|
|
2071
|
+
{
|
|
2072
|
+
value: {
|
|
2073
|
+
items: options,
|
|
2074
|
+
disabledKeys
|
|
2075
|
+
}
|
|
2076
|
+
},
|
|
2077
|
+
structure
|
|
2078
|
+
)
|
|
2079
|
+
);
|
|
2080
|
+
}
|
|
2081
|
+
function registerSelect(loader) {
|
|
2082
|
+
registerComponentHelper(loader, BaseSelect, {
|
|
2083
|
+
name: SELECT_NAME,
|
|
2084
|
+
displayName: "Aria Select",
|
|
2085
|
+
importPath: "@plasmicpkgs/react-aria/skinny/registerSelect",
|
|
2086
|
+
importName: "BaseSelect",
|
|
2087
|
+
props: {
|
|
2088
|
+
options: makeOptionsPropType(),
|
|
2089
|
+
placeholder: {
|
|
2090
|
+
type: "string"
|
|
2091
|
+
},
|
|
2092
|
+
isDisabled: {
|
|
2093
|
+
type: "boolean"
|
|
2094
|
+
},
|
|
2095
|
+
value: makeValuePropType(),
|
|
2096
|
+
onChange: {
|
|
2097
|
+
type: "eventHandler",
|
|
2098
|
+
argTypes: [{ name: "value", type: "string" }]
|
|
2099
|
+
},
|
|
2100
|
+
previewOpen: {
|
|
2101
|
+
type: "boolean",
|
|
2102
|
+
displayName: "Preview opened?",
|
|
2103
|
+
description: "Preview opened state while designing in Plasmic editor",
|
|
2104
|
+
editOnly: true
|
|
2105
|
+
},
|
|
2106
|
+
onOpenChange: {
|
|
2107
|
+
type: "eventHandler",
|
|
2108
|
+
argTypes: [{ name: "isOpen", type: "boolean" }]
|
|
2109
|
+
},
|
|
2110
|
+
// optionValue: {
|
|
2111
|
+
// type: "string",
|
|
2112
|
+
// displayName: "Field key for an option's value",
|
|
2113
|
+
// hidden: (ps) =>
|
|
2114
|
+
// !ps.options ||
|
|
2115
|
+
// !ps.options[0] ||
|
|
2116
|
+
// typeof ps.options[0] === "string" ||
|
|
2117
|
+
// "value" in ps.options[0],
|
|
2118
|
+
// exprHint:
|
|
2119
|
+
// "Return a function that takes in an option object, and returns the key to use",
|
|
2120
|
+
// },
|
|
2121
|
+
// optionText: {
|
|
2122
|
+
// type: "string",
|
|
2123
|
+
// displayName: "Field key for an option's text value",
|
|
2124
|
+
// hidden: (ps) =>
|
|
2125
|
+
// !ps.options ||
|
|
2126
|
+
// !ps.options[0] ||
|
|
2127
|
+
// typeof ps.options[0] === "string" ||
|
|
2128
|
+
// "value" in ps.options[0],
|
|
2129
|
+
// exprHint:
|
|
2130
|
+
// "Return a function that takes in an option object, and returns the text value to use",
|
|
2131
|
+
// },
|
|
2132
|
+
// optionDisabled: {
|
|
2133
|
+
// type: "string",
|
|
2134
|
+
// displayName: "Field key for whether an option is disabled",
|
|
2135
|
+
// hidden: (ps) =>
|
|
2136
|
+
// !ps.options ||
|
|
2137
|
+
// !ps.options[0] ||
|
|
2138
|
+
// typeof ps.options[0] === "string" ||
|
|
2139
|
+
// "value" in ps.options[0],
|
|
2140
|
+
// exprHint:
|
|
2141
|
+
// "Return a function that takes in an option object, and returns true if option should be disabled",
|
|
2142
|
+
// },
|
|
2143
|
+
structure: {
|
|
2144
|
+
type: "slot"
|
|
2145
|
+
},
|
|
2146
|
+
// renderOption: {
|
|
2147
|
+
// type: "slot",
|
|
2148
|
+
// displayName: "Custom render option",
|
|
2149
|
+
// renderPropParams: ["item"],
|
|
2150
|
+
// hidePlaceholder: true
|
|
2151
|
+
// },
|
|
2152
|
+
name: {
|
|
2153
|
+
type: "string",
|
|
2154
|
+
displayName: "Form field key",
|
|
2155
|
+
description: "Name of the input, when submitting in an HTML form",
|
|
2156
|
+
advanced: true
|
|
2157
|
+
},
|
|
2158
|
+
"aria-label": {
|
|
2159
|
+
type: "string",
|
|
2160
|
+
displayName: "Aria Label",
|
|
2161
|
+
description: "Label for this input, if no visible label is used",
|
|
2162
|
+
advanced: true
|
|
2163
|
+
}
|
|
2164
|
+
},
|
|
2165
|
+
states: {
|
|
2166
|
+
value: {
|
|
2167
|
+
type: "writable",
|
|
2168
|
+
valueProp: "value",
|
|
2169
|
+
onChangeProp: "onChange",
|
|
2170
|
+
variableType: "text"
|
|
2171
|
+
},
|
|
2172
|
+
isOpen: {
|
|
2173
|
+
type: "readonly",
|
|
2174
|
+
onChangeProp: "onOpenChange",
|
|
2175
|
+
variableType: "boolean"
|
|
2176
|
+
}
|
|
2177
|
+
}
|
|
2178
|
+
});
|
|
2179
|
+
registerComponentHelper(loader, reactAriaComponents.SelectValue, {
|
|
2180
|
+
name: makeComponentName("select-value"),
|
|
2181
|
+
displayName: "Aria Selected Value",
|
|
2182
|
+
importPath: "@plasmicpkgs/react-aria/registerSelect",
|
|
2183
|
+
importName: "SelectValue",
|
|
2184
|
+
parentComponentName: SELECT_NAME,
|
|
2185
|
+
props: {
|
|
2186
|
+
className: {
|
|
2187
|
+
type: "class",
|
|
2188
|
+
selectors: [
|
|
2189
|
+
{
|
|
2190
|
+
selector: ":self[data-placeholder]",
|
|
2191
|
+
label: "Placeholder"
|
|
2192
|
+
}
|
|
2193
|
+
]
|
|
2194
|
+
}
|
|
2195
|
+
}
|
|
2196
|
+
});
|
|
2197
|
+
}
|
|
2198
|
+
|
|
2199
|
+
const BaseSliderOutput = reactAriaComponents.SliderOutput;
|
|
2200
|
+
const SLIDER_OUTPUT_COMPONENT_NAME = makeComponentName("sliderOutput");
|
|
2201
|
+
function registerSliderOutput(loader, overrides) {
|
|
2202
|
+
registerComponentHelper(
|
|
2203
|
+
loader,
|
|
2204
|
+
BaseSliderOutput,
|
|
2205
|
+
{
|
|
2206
|
+
name: SLIDER_OUTPUT_COMPONENT_NAME,
|
|
2207
|
+
displayName: "Aria Slider Output",
|
|
2208
|
+
importPath: "@plasmicpkgs/react-aria/skinny/registerSliderOutput",
|
|
2209
|
+
importName: "BaseSliderOutput",
|
|
2210
|
+
props: {
|
|
2211
|
+
children: { type: "slot" }
|
|
2212
|
+
},
|
|
2213
|
+
trapsFocus: true
|
|
2214
|
+
},
|
|
2215
|
+
overrides
|
|
2216
|
+
);
|
|
2217
|
+
}
|
|
2218
|
+
|
|
1943
2219
|
var __defProp$6 = Object.defineProperty;
|
|
1944
2220
|
var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
|
|
1945
2221
|
var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
|
|
@@ -1956,20 +2232,85 @@ var __spreadValues$6 = (a, b) => {
|
|
|
1956
2232
|
}
|
|
1957
2233
|
return a;
|
|
1958
2234
|
};
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
2235
|
+
var __objRest$6 = (source, exclude) => {
|
|
2236
|
+
var target = {};
|
|
2237
|
+
for (var prop in source)
|
|
2238
|
+
if (__hasOwnProp$6.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
2239
|
+
target[prop] = source[prop];
|
|
2240
|
+
if (source != null && __getOwnPropSymbols$6)
|
|
2241
|
+
for (var prop of __getOwnPropSymbols$6(source)) {
|
|
2242
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$6.call(source, prop))
|
|
2243
|
+
target[prop] = source[prop];
|
|
2244
|
+
}
|
|
2245
|
+
return target;
|
|
2246
|
+
};
|
|
2247
|
+
const SLIDER_THUMB_INTERACTION_VARIANTS = [
|
|
2248
|
+
"dragging",
|
|
2249
|
+
"hovered",
|
|
2250
|
+
"focused",
|
|
2251
|
+
"focusVisible"
|
|
2252
|
+
];
|
|
2253
|
+
const { interactionVariants: interactionVariants$3, withObservedValues: withObservedValues$2 } = pickAriaComponentVariants(
|
|
2254
|
+
SLIDER_THUMB_INTERACTION_VARIANTS
|
|
2255
|
+
);
|
|
2256
|
+
function BaseSliderThumb(_a) {
|
|
2257
|
+
var _b = _a, {
|
|
2258
|
+
children,
|
|
2259
|
+
advanced,
|
|
2260
|
+
updateInteractionVariant
|
|
2261
|
+
} = _b, rest = __objRest$6(_b, [
|
|
2262
|
+
"children",
|
|
2263
|
+
"advanced",
|
|
2264
|
+
"updateInteractionVariant"
|
|
2265
|
+
]);
|
|
2266
|
+
const context = React__default.default.useContext(PlasmicSliderContext);
|
|
2267
|
+
const mergedProps = reactAria.mergeProps(context, rest);
|
|
2268
|
+
const thumb = /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.SliderThumb, __spreadValues$6({}, mergedProps), ({ isDragging, isHovered, isFocused, isFocusVisible }) => withObservedValues$2(
|
|
2269
|
+
/* @__PURE__ */ React__default.default.createElement(React__default.default.Fragment, null, advanced ? children : void 0),
|
|
2270
|
+
{
|
|
2271
|
+
dragging: isDragging,
|
|
2272
|
+
hovered: isHovered,
|
|
2273
|
+
focused: isFocused,
|
|
2274
|
+
focusVisible: isFocusVisible
|
|
2275
|
+
},
|
|
2276
|
+
updateInteractionVariant
|
|
2277
|
+
));
|
|
2278
|
+
return /* @__PURE__ */ React__default.default.createElement(
|
|
2279
|
+
ErrorBoundary,
|
|
2280
|
+
{
|
|
2281
|
+
fallback: /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Slider, { style: { height: "100%", width: "100%" } }, /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.SliderTrack, null, thumb))
|
|
2282
|
+
},
|
|
2283
|
+
thumb
|
|
2284
|
+
);
|
|
1962
2285
|
}
|
|
1963
|
-
|
|
2286
|
+
const SLIDER_THUMB_COMPONENT_NAME = makeComponentName("sliderThumb");
|
|
2287
|
+
function registerSliderThumb(loader, overrides) {
|
|
1964
2288
|
registerComponentHelper(
|
|
1965
2289
|
loader,
|
|
1966
|
-
|
|
2290
|
+
BaseSliderThumb,
|
|
1967
2291
|
{
|
|
1968
|
-
name:
|
|
1969
|
-
displayName: "Aria
|
|
1970
|
-
importPath: "@plasmicpkgs/react-aria/skinny/
|
|
1971
|
-
importName: "
|
|
1972
|
-
|
|
2292
|
+
name: SLIDER_THUMB_COMPONENT_NAME,
|
|
2293
|
+
displayName: "Aria Slider Thumb",
|
|
2294
|
+
importPath: "@plasmicpkgs/react-aria/skinny/registerSliderThumb",
|
|
2295
|
+
importName: "BaseSliderThumb",
|
|
2296
|
+
defaultStyles: {
|
|
2297
|
+
position: "absolute",
|
|
2298
|
+
top: "5px",
|
|
2299
|
+
width: "20px",
|
|
2300
|
+
height: "20px",
|
|
2301
|
+
backgroundColor: "#C80101",
|
|
2302
|
+
borderRadius: "100%",
|
|
2303
|
+
cursor: "pointer"
|
|
2304
|
+
},
|
|
2305
|
+
interactionVariants: interactionVariants$3,
|
|
2306
|
+
props: {
|
|
2307
|
+
advanced: "boolean",
|
|
2308
|
+
children: {
|
|
2309
|
+
type: "slot",
|
|
2310
|
+
hidden: (ps) => !ps.advanced
|
|
2311
|
+
}
|
|
2312
|
+
},
|
|
2313
|
+
trapsFocus: true
|
|
1973
2314
|
},
|
|
1974
2315
|
overrides
|
|
1975
2316
|
);
|
|
@@ -1991,7 +2332,7 @@ var __spreadValues$5 = (a, b) => {
|
|
|
1991
2332
|
}
|
|
1992
2333
|
return a;
|
|
1993
2334
|
};
|
|
1994
|
-
var __objRest$
|
|
2335
|
+
var __objRest$5 = (source, exclude) => {
|
|
1995
2336
|
var target = {};
|
|
1996
2337
|
for (var prop in source)
|
|
1997
2338
|
if (__hasOwnProp$5.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
@@ -2003,44 +2344,151 @@ var __objRest$4 = (source, exclude) => {
|
|
|
2003
2344
|
}
|
|
2004
2345
|
return target;
|
|
2005
2346
|
};
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
return
|
|
2013
|
-
}
|
|
2347
|
+
const SLIDER_TRACK_INTERACTION_VARIANTS = ["hovered"];
|
|
2348
|
+
const { interactionVariants: interactionVariants$2, withObservedValues: withObservedValues$1 } = pickAriaComponentVariants(
|
|
2349
|
+
SLIDER_TRACK_INTERACTION_VARIANTS
|
|
2350
|
+
);
|
|
2351
|
+
function findMinMaxIndices(values) {
|
|
2352
|
+
if (typeof values === "number" || (values == null ? void 0 : values.length) === 0 || !Array.isArray(values)) {
|
|
2353
|
+
return { minIndex: 0, maxIndex: 0 };
|
|
2354
|
+
}
|
|
2355
|
+
let minIndex = 0;
|
|
2356
|
+
let maxIndex = 0;
|
|
2357
|
+
for (let i = 1; i < values.length; i++) {
|
|
2358
|
+
if (values[i] < values[minIndex]) {
|
|
2359
|
+
minIndex = i;
|
|
2360
|
+
}
|
|
2361
|
+
if (values[i] > values[maxIndex]) {
|
|
2362
|
+
maxIndex = i;
|
|
2363
|
+
}
|
|
2364
|
+
}
|
|
2365
|
+
return { minIndex, maxIndex };
|
|
2014
2366
|
}
|
|
2015
|
-
function
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2367
|
+
function BaseSliderTrack(props) {
|
|
2368
|
+
const context = React__default.default.useContext(PlasmicSliderContext);
|
|
2369
|
+
const mergedProps = reactAria.mergeProps(context, props);
|
|
2370
|
+
const _a = mergedProps, {
|
|
2371
|
+
children,
|
|
2372
|
+
progressBar,
|
|
2373
|
+
updateInteractionVariant,
|
|
2374
|
+
isMultiValue
|
|
2375
|
+
} = _a, rest = __objRest$5(_a, [
|
|
2376
|
+
"children",
|
|
2377
|
+
"progressBar",
|
|
2378
|
+
"updateInteractionVariant",
|
|
2379
|
+
"isMultiValue"
|
|
2380
|
+
]);
|
|
2381
|
+
const { minIndex, maxIndex } = React.useMemo(
|
|
2382
|
+
() => findMinMaxIndices(mergedProps.value),
|
|
2383
|
+
[mergedProps.value]
|
|
2384
|
+
);
|
|
2385
|
+
const thumbs = React.useMemo(() => {
|
|
2386
|
+
const rawThumbs = flattenChildren__default.default(children);
|
|
2387
|
+
if (mergedProps.value === void 0) {
|
|
2388
|
+
return [];
|
|
2389
|
+
}
|
|
2390
|
+
if (!Array.isArray(mergedProps == null ? void 0 : mergedProps.value)) {
|
|
2391
|
+
return rawThumbs;
|
|
2392
|
+
}
|
|
2393
|
+
const difference = mergedProps.value.length - rawThumbs.length;
|
|
2394
|
+
if (!difference) {
|
|
2395
|
+
return rawThumbs;
|
|
2396
|
+
}
|
|
2397
|
+
if (difference < 0) {
|
|
2398
|
+
return rawThumbs.slice(0, mergedProps.value.length);
|
|
2399
|
+
}
|
|
2400
|
+
const lastThumb = rawThumbs[rawThumbs.length - 1];
|
|
2401
|
+
return rawThumbs.concat(new Array(difference).fill(lastThumb));
|
|
2402
|
+
}, [children, mergedProps.value]);
|
|
2403
|
+
const track = /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.SliderTrack, __spreadValues$5({ style: { position: "relative" } }, rest), ({ state, isHovered }) => /* @__PURE__ */ React__default.default.createElement(React__default.default.Fragment, null, withObservedValues$1(
|
|
2404
|
+
/* @__PURE__ */ React__default.default.createElement(React__default.default.Fragment, null, /* @__PURE__ */ React__default.default.createElement(
|
|
2405
|
+
"div",
|
|
2406
|
+
{
|
|
2407
|
+
style: {
|
|
2408
|
+
width: `${(!isMultiValue ? state.getThumbPercent(minIndex) : state.getThumbPercent(maxIndex) - state.getThumbPercent(minIndex)) * 100}%`,
|
|
2409
|
+
height: "100%",
|
|
2410
|
+
position: "absolute",
|
|
2411
|
+
top: 0,
|
|
2412
|
+
left: !isMultiValue ? 0 : state.getThumbPercent(minIndex) * 100 + "%"
|
|
2413
|
+
}
|
|
2414
|
+
},
|
|
2415
|
+
progressBar
|
|
2416
|
+
), thumbs.map(
|
|
2417
|
+
(thumb, i) => React__default.default.isValidElement(thumb) && React__default.default.cloneElement(thumb, {
|
|
2418
|
+
// sets the index of the thumb, so that each thumb reflects the correct value
|
|
2419
|
+
index: i
|
|
2420
|
+
})
|
|
2421
|
+
)),
|
|
2019
2422
|
{
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2423
|
+
hovered: isHovered
|
|
2424
|
+
},
|
|
2425
|
+
updateInteractionVariant
|
|
2426
|
+
)));
|
|
2427
|
+
return /* @__PURE__ */ React__default.default.createElement(
|
|
2428
|
+
ErrorBoundary,
|
|
2429
|
+
{
|
|
2430
|
+
fallback: /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Slider, { style: { height: "100%", width: "100%" } }, track)
|
|
2431
|
+
},
|
|
2432
|
+
track
|
|
2433
|
+
);
|
|
2434
|
+
}
|
|
2435
|
+
const SLIDER_TRACK_COMPONENT_NAME = makeComponentName("sliderTrack");
|
|
2436
|
+
function registerSliderTrack(loader, overrides) {
|
|
2437
|
+
registerComponentHelper(
|
|
2438
|
+
loader,
|
|
2439
|
+
BaseSliderTrack,
|
|
2440
|
+
{
|
|
2441
|
+
name: SLIDER_TRACK_COMPONENT_NAME,
|
|
2442
|
+
displayName: "Aria Slider Track",
|
|
2443
|
+
importPath: "@plasmicpkgs/react-aria/skinny/registerSliderTrack",
|
|
2444
|
+
importName: "BaseSliderTrack",
|
|
2445
|
+
defaultStyles: {
|
|
2446
|
+
width: "stretch",
|
|
2447
|
+
backgroundColor: "#aaa",
|
|
2448
|
+
position: "relative",
|
|
2449
|
+
height: "10px",
|
|
2450
|
+
padding: 0
|
|
2451
|
+
},
|
|
2452
|
+
interactionVariants: interactionVariants$2,
|
|
2024
2453
|
props: {
|
|
2025
|
-
|
|
2454
|
+
children: {
|
|
2026
2455
|
type: "slot",
|
|
2027
|
-
|
|
2028
|
-
|
|
2456
|
+
description: "The thumbs of the slider",
|
|
2457
|
+
defaultValue: [
|
|
2458
|
+
{
|
|
2459
|
+
type: "component",
|
|
2460
|
+
name: makeChildComponentName(
|
|
2461
|
+
SLIDER_COMPONENT_NAME,
|
|
2462
|
+
SLIDER_THUMB_COMPONENT_NAME
|
|
2463
|
+
)
|
|
2464
|
+
}
|
|
2465
|
+
]
|
|
2466
|
+
},
|
|
2467
|
+
progressBar: {
|
|
2468
|
+
type: "slot",
|
|
2469
|
+
displayName: "Progress Bar",
|
|
2470
|
+
defaultValue: [
|
|
2471
|
+
{
|
|
2472
|
+
type: "box",
|
|
2473
|
+
styles: {
|
|
2474
|
+
height: "100%",
|
|
2475
|
+
width: "100%",
|
|
2476
|
+
backgroundColor: "#ffa6a6",
|
|
2477
|
+
padding: 0
|
|
2478
|
+
}
|
|
2479
|
+
}
|
|
2480
|
+
]
|
|
2029
2481
|
}
|
|
2030
|
-
}
|
|
2482
|
+
},
|
|
2483
|
+
trapsFocus: true
|
|
2031
2484
|
},
|
|
2032
2485
|
overrides
|
|
2033
2486
|
);
|
|
2034
|
-
const thisName = makeChildComponentName(
|
|
2035
|
-
overrides == null ? void 0 : overrides.parentComponentName,
|
|
2036
|
-
makeComponentName("section")
|
|
2037
|
-
);
|
|
2038
|
-
registerHeader(loader, {
|
|
2039
|
-
parentComponentName: thisName
|
|
2040
|
-
});
|
|
2041
2487
|
}
|
|
2042
2488
|
|
|
2043
2489
|
var __defProp$4 = Object.defineProperty;
|
|
2490
|
+
var __defProps$3 = Object.defineProperties;
|
|
2491
|
+
var __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors;
|
|
2044
2492
|
var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
|
|
2045
2493
|
var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
|
|
2046
2494
|
var __propIsEnum$4 = Object.prototype.propertyIsEnumerable;
|
|
@@ -2056,175 +2504,225 @@ var __spreadValues$4 = (a, b) => {
|
|
|
2056
2504
|
}
|
|
2057
2505
|
return a;
|
|
2058
2506
|
};
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
reactAriaComponents.Select,
|
|
2080
|
-
__spreadValues$4(__spreadValues$4({
|
|
2081
|
-
placeholder,
|
|
2082
|
-
selectedKey: value,
|
|
2083
|
-
onSelectionChange: onChange,
|
|
2084
|
-
onOpenChange,
|
|
2085
|
-
isDisabled,
|
|
2086
|
-
className,
|
|
2087
|
-
style,
|
|
2088
|
-
name,
|
|
2089
|
-
"aria-label": ariaLabel
|
|
2090
|
-
}, previewOpen && canvas ? { isOpen: previewOpen } : void 0), extractPlasmicDataProps(props)),
|
|
2091
|
-
/* @__PURE__ */ React__default.default.createElement(
|
|
2092
|
-
PlasmicListBoxContext.Provider,
|
|
2093
|
-
{
|
|
2094
|
-
value: {
|
|
2095
|
-
items: options,
|
|
2096
|
-
disabledKeys,
|
|
2097
|
-
makeItemProps: (item) => ({
|
|
2098
|
-
key: item.value,
|
|
2099
|
-
textValue: optionText(item),
|
|
2100
|
-
children: renderOption ? renderOption(item) : optionText(item)
|
|
2101
|
-
}),
|
|
2102
|
-
makeSectionProps: (section) => ({
|
|
2103
|
-
section,
|
|
2104
|
-
key: section.key
|
|
2105
|
-
}),
|
|
2106
|
-
getItemType: (option) => option.type === "section" ? "section" : "item"
|
|
2507
|
+
var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b));
|
|
2508
|
+
var __objRest$4 = (source, exclude) => {
|
|
2509
|
+
var target = {};
|
|
2510
|
+
for (var prop in source)
|
|
2511
|
+
if (__hasOwnProp$4.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
2512
|
+
target[prop] = source[prop];
|
|
2513
|
+
if (source != null && __getOwnPropSymbols$4)
|
|
2514
|
+
for (var prop of __getOwnPropSymbols$4(source)) {
|
|
2515
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$4.call(source, prop))
|
|
2516
|
+
target[prop] = source[prop];
|
|
2517
|
+
}
|
|
2518
|
+
return target;
|
|
2519
|
+
};
|
|
2520
|
+
const SLIDER_COMPONENT_NAME = makeComponentName("slider");
|
|
2521
|
+
const sliderHelpers = {
|
|
2522
|
+
states: {
|
|
2523
|
+
range: {
|
|
2524
|
+
onChangeArgsToValue: (value, isMultiValue) => {
|
|
2525
|
+
if (isMultiValue) {
|
|
2526
|
+
return Array.isArray(value) ? value : [value, value + 10];
|
|
2107
2527
|
}
|
|
2108
|
-
|
|
2109
|
-
structure
|
|
2110
|
-
)
|
|
2111
|
-
);
|
|
2112
|
-
}
|
|
2113
|
-
function registerSelect(loader) {
|
|
2114
|
-
registerComponentHelper(loader, BaseSelect, {
|
|
2115
|
-
name: SELECT_NAME,
|
|
2116
|
-
displayName: "Aria Select",
|
|
2117
|
-
importPath: "@plasmicpkgs/react-aria/skinny/registerSelect",
|
|
2118
|
-
importName: "BaseSelect",
|
|
2119
|
-
props: {
|
|
2120
|
-
options: makeOptionsPropType(),
|
|
2121
|
-
placeholder: {
|
|
2122
|
-
type: "string"
|
|
2123
|
-
},
|
|
2124
|
-
isDisabled: {
|
|
2125
|
-
type: "boolean"
|
|
2126
|
-
},
|
|
2127
|
-
value: makeValuePropType(),
|
|
2128
|
-
onChange: {
|
|
2129
|
-
type: "eventHandler",
|
|
2130
|
-
argTypes: [{ name: "value", type: "string" }]
|
|
2131
|
-
},
|
|
2132
|
-
previewOpen: {
|
|
2133
|
-
type: "boolean",
|
|
2134
|
-
displayName: "Preview opened?",
|
|
2135
|
-
description: "Preview opened state while designing in Plasmic editor",
|
|
2136
|
-
editOnly: true
|
|
2137
|
-
},
|
|
2138
|
-
onOpenChange: {
|
|
2139
|
-
type: "eventHandler",
|
|
2140
|
-
argTypes: [{ name: "isOpen", type: "boolean" }]
|
|
2141
|
-
},
|
|
2142
|
-
// optionValue: {
|
|
2143
|
-
// type: "string",
|
|
2144
|
-
// displayName: "Field key for an option's value",
|
|
2145
|
-
// hidden: (ps) =>
|
|
2146
|
-
// !ps.options ||
|
|
2147
|
-
// !ps.options[0] ||
|
|
2148
|
-
// typeof ps.options[0] === "string" ||
|
|
2149
|
-
// "value" in ps.options[0],
|
|
2150
|
-
// exprHint:
|
|
2151
|
-
// "Return a function that takes in an option object, and returns the key to use",
|
|
2152
|
-
// },
|
|
2153
|
-
// optionText: {
|
|
2154
|
-
// type: "string",
|
|
2155
|
-
// displayName: "Field key for an option's text value",
|
|
2156
|
-
// hidden: (ps) =>
|
|
2157
|
-
// !ps.options ||
|
|
2158
|
-
// !ps.options[0] ||
|
|
2159
|
-
// typeof ps.options[0] === "string" ||
|
|
2160
|
-
// "value" in ps.options[0],
|
|
2161
|
-
// exprHint:
|
|
2162
|
-
// "Return a function that takes in an option object, and returns the text value to use",
|
|
2163
|
-
// },
|
|
2164
|
-
// optionDisabled: {
|
|
2165
|
-
// type: "string",
|
|
2166
|
-
// displayName: "Field key for whether an option is disabled",
|
|
2167
|
-
// hidden: (ps) =>
|
|
2168
|
-
// !ps.options ||
|
|
2169
|
-
// !ps.options[0] ||
|
|
2170
|
-
// typeof ps.options[0] === "string" ||
|
|
2171
|
-
// "value" in ps.options[0],
|
|
2172
|
-
// exprHint:
|
|
2173
|
-
// "Return a function that takes in an option object, and returns true if option should be disabled",
|
|
2174
|
-
// },
|
|
2175
|
-
structure: {
|
|
2176
|
-
type: "slot"
|
|
2177
|
-
},
|
|
2178
|
-
// renderOption: {
|
|
2179
|
-
// type: "slot",
|
|
2180
|
-
// displayName: "Custom render option",
|
|
2181
|
-
// renderPropParams: ["item"],
|
|
2182
|
-
// hidePlaceholder: true
|
|
2183
|
-
// },
|
|
2184
|
-
name: {
|
|
2185
|
-
type: "string",
|
|
2186
|
-
displayName: "Form field key",
|
|
2187
|
-
description: "Name of the input, when submitting in an HTML form",
|
|
2188
|
-
advanced: true
|
|
2189
|
-
},
|
|
2190
|
-
"aria-label": {
|
|
2191
|
-
type: "string",
|
|
2192
|
-
displayName: "Aria Label",
|
|
2193
|
-
description: "Label for this input, if no visible label is used",
|
|
2194
|
-
advanced: true
|
|
2528
|
+
return void 0;
|
|
2195
2529
|
}
|
|
2196
2530
|
},
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
},
|
|
2204
|
-
isOpen: {
|
|
2205
|
-
type: "readonly",
|
|
2206
|
-
onChangeProp: "onOpenChange",
|
|
2207
|
-
variableType: "boolean"
|
|
2531
|
+
value: {
|
|
2532
|
+
onChangeArgsToValue: (value, isMultiValue) => {
|
|
2533
|
+
if (isMultiValue) {
|
|
2534
|
+
return void 0;
|
|
2535
|
+
}
|
|
2536
|
+
return Array.isArray(value) ? value[0] : value;
|
|
2208
2537
|
}
|
|
2209
2538
|
}
|
|
2539
|
+
}
|
|
2540
|
+
};
|
|
2541
|
+
function BaseSlider(props) {
|
|
2542
|
+
const _a = props, { range, value, defaultRange, defaultValue, onChange } = _a, rest = __objRest$4(_a, ["range", "value", "defaultRange", "defaultValue", "onChange"]);
|
|
2543
|
+
const isFirstRender = React.useRef(true);
|
|
2544
|
+
React.useEffect(() => {
|
|
2545
|
+
var _a2, _b, _c;
|
|
2546
|
+
if (isFirstRender.current) {
|
|
2547
|
+
isFirstRender.current = false;
|
|
2548
|
+
return;
|
|
2549
|
+
}
|
|
2550
|
+
if (props.isMultiValue) {
|
|
2551
|
+
const minValue = (_a2 = props.minValue) != null ? _a2 : 0;
|
|
2552
|
+
(_b = props.onChange) == null ? void 0 : _b.call(
|
|
2553
|
+
props,
|
|
2554
|
+
Array.isArray(range) && range.length > 1 ? range : [minValue, minValue + 10],
|
|
2555
|
+
true
|
|
2556
|
+
);
|
|
2557
|
+
return;
|
|
2558
|
+
}
|
|
2559
|
+
(_c = props.onChange) == null ? void 0 : _c.call(props, Array.isArray(value) ? 0 : value != null ? value : 0, false);
|
|
2560
|
+
}, [props.isMultiValue]);
|
|
2561
|
+
const mergedProps = reactAria.mergeProps(rest, {
|
|
2562
|
+
value: props.isMultiValue ? range : value,
|
|
2563
|
+
defaultValue: props.isMultiValue ? defaultRange : defaultValue
|
|
2210
2564
|
});
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
props: {
|
|
2218
|
-
className: {
|
|
2219
|
-
type: "class",
|
|
2220
|
-
selectors: [
|
|
2221
|
-
{
|
|
2222
|
-
selector: ":self[data-placeholder]",
|
|
2223
|
-
label: "Placeholder"
|
|
2224
|
-
}
|
|
2225
|
-
]
|
|
2565
|
+
return /* @__PURE__ */ React__default.default.createElement(PlasmicSliderContext.Provider, { value: mergedProps }, /* @__PURE__ */ React__default.default.createElement(
|
|
2566
|
+
reactAriaComponents.Slider,
|
|
2567
|
+
__spreadValues$4({
|
|
2568
|
+
key: props.isMultiValue ? "multi" : "single",
|
|
2569
|
+
onChange: (newValue) => {
|
|
2570
|
+
onChange == null ? void 0 : onChange(newValue, props.isMultiValue);
|
|
2226
2571
|
}
|
|
2227
|
-
}
|
|
2572
|
+
}, mergedProps)
|
|
2573
|
+
));
|
|
2574
|
+
}
|
|
2575
|
+
function registerSlider(loader, overrides) {
|
|
2576
|
+
registerComponentHelper(
|
|
2577
|
+
loader,
|
|
2578
|
+
BaseSlider,
|
|
2579
|
+
{
|
|
2580
|
+
name: SLIDER_COMPONENT_NAME,
|
|
2581
|
+
displayName: "Aria Slider",
|
|
2582
|
+
importPath: "@plasmicpkgs/react-aria/skinny/registerSlider",
|
|
2583
|
+
importName: "BaseSlider",
|
|
2584
|
+
defaultStyles: {
|
|
2585
|
+
width: "300px"
|
|
2586
|
+
},
|
|
2587
|
+
props: __spreadProps$3(__spreadValues$4({}, getCommonInputProps("slider", [
|
|
2588
|
+
"isDisabled",
|
|
2589
|
+
"name",
|
|
2590
|
+
"autoFocus",
|
|
2591
|
+
"aria-label"
|
|
2592
|
+
])), {
|
|
2593
|
+
children: {
|
|
2594
|
+
type: "slot",
|
|
2595
|
+
defaultValue: [
|
|
2596
|
+
{
|
|
2597
|
+
type: "hbox",
|
|
2598
|
+
styles: {
|
|
2599
|
+
width: "stretch",
|
|
2600
|
+
justifyContent: "space-between",
|
|
2601
|
+
padding: "8px 0px"
|
|
2602
|
+
},
|
|
2603
|
+
children: [
|
|
2604
|
+
{
|
|
2605
|
+
type: "component",
|
|
2606
|
+
name: LABEL_COMPONENT_NAME,
|
|
2607
|
+
props: {
|
|
2608
|
+
children: {
|
|
2609
|
+
type: "text",
|
|
2610
|
+
value: "Label"
|
|
2611
|
+
}
|
|
2612
|
+
}
|
|
2613
|
+
},
|
|
2614
|
+
{
|
|
2615
|
+
type: "component",
|
|
2616
|
+
name: makeChildComponentName(
|
|
2617
|
+
SLIDER_COMPONENT_NAME,
|
|
2618
|
+
SLIDER_OUTPUT_COMPONENT_NAME
|
|
2619
|
+
),
|
|
2620
|
+
props: {
|
|
2621
|
+
children: {
|
|
2622
|
+
type: "text",
|
|
2623
|
+
value: "Output"
|
|
2624
|
+
}
|
|
2625
|
+
}
|
|
2626
|
+
}
|
|
2627
|
+
]
|
|
2628
|
+
},
|
|
2629
|
+
{
|
|
2630
|
+
type: "component",
|
|
2631
|
+
name: makeChildComponentName(
|
|
2632
|
+
SLIDER_COMPONENT_NAME,
|
|
2633
|
+
SLIDER_TRACK_COMPONENT_NAME
|
|
2634
|
+
)
|
|
2635
|
+
}
|
|
2636
|
+
]
|
|
2637
|
+
},
|
|
2638
|
+
orientation: {
|
|
2639
|
+
type: "choice",
|
|
2640
|
+
options: ["horizontal", "vertical"],
|
|
2641
|
+
defaultValueHint: "horizontal",
|
|
2642
|
+
defaultValue: "horizontal"
|
|
2643
|
+
},
|
|
2644
|
+
minValue: {
|
|
2645
|
+
type: "number",
|
|
2646
|
+
description: "The minimum value of the slider",
|
|
2647
|
+
defaultValueHint: 0
|
|
2648
|
+
},
|
|
2649
|
+
maxValue: {
|
|
2650
|
+
type: "number",
|
|
2651
|
+
description: "The maximum value of the slider",
|
|
2652
|
+
defaultValueHint: 100
|
|
2653
|
+
},
|
|
2654
|
+
step: {
|
|
2655
|
+
type: "number",
|
|
2656
|
+
description: "The step value of the slider",
|
|
2657
|
+
defaultValueHint: 1
|
|
2658
|
+
},
|
|
2659
|
+
isMultiValue: {
|
|
2660
|
+
type: "boolean",
|
|
2661
|
+
displayName: "Multi-valued",
|
|
2662
|
+
description: "Whether the slider supports range (multiple thumbs)",
|
|
2663
|
+
defaultValue: false,
|
|
2664
|
+
defaultValueHint: false
|
|
2665
|
+
},
|
|
2666
|
+
range: {
|
|
2667
|
+
type: "array",
|
|
2668
|
+
editOnly: true,
|
|
2669
|
+
uncontrolledProp: "defaultRange",
|
|
2670
|
+
description: "The default range of the slider",
|
|
2671
|
+
defaultValueHint: [10, 20],
|
|
2672
|
+
defaultValue: [10, 20],
|
|
2673
|
+
hidden: (ps) => !ps.isMultiValue
|
|
2674
|
+
},
|
|
2675
|
+
value: {
|
|
2676
|
+
type: "number",
|
|
2677
|
+
editOnly: true,
|
|
2678
|
+
uncontrolledProp: "defaultValue",
|
|
2679
|
+
description: "The default value of the slider",
|
|
2680
|
+
defaultValueHint: 0,
|
|
2681
|
+
defaultValue: 0,
|
|
2682
|
+
hidden: (ps) => Boolean(ps.isMultiValue)
|
|
2683
|
+
},
|
|
2684
|
+
onChange: {
|
|
2685
|
+
type: "eventHandler",
|
|
2686
|
+
argTypes: [{ name: "value", type: "object" }]
|
|
2687
|
+
},
|
|
2688
|
+
onChangeEnd: {
|
|
2689
|
+
type: "eventHandler",
|
|
2690
|
+
argTypes: [{ name: "value", type: "object" }]
|
|
2691
|
+
}
|
|
2692
|
+
}),
|
|
2693
|
+
states: {
|
|
2694
|
+
range: __spreadValues$4({
|
|
2695
|
+
type: "writable",
|
|
2696
|
+
valueProp: "range",
|
|
2697
|
+
onChangeProp: "onChange",
|
|
2698
|
+
variableType: "array",
|
|
2699
|
+
hidden: (ps) => !ps.isMultiValue
|
|
2700
|
+
}, sliderHelpers.states.range),
|
|
2701
|
+
value: __spreadValues$4({
|
|
2702
|
+
type: "writable",
|
|
2703
|
+
valueProp: "value",
|
|
2704
|
+
onChangeProp: "onChange",
|
|
2705
|
+
variableType: "number",
|
|
2706
|
+
hidden: (ps) => Boolean(ps.isMultiValue)
|
|
2707
|
+
}, sliderHelpers.states.value)
|
|
2708
|
+
},
|
|
2709
|
+
componentHelpers: {
|
|
2710
|
+
helpers: sliderHelpers,
|
|
2711
|
+
importName: "sliderHelpers",
|
|
2712
|
+
importPath: "@plasmicpkgs/react-aria/skinny/registerSlider"
|
|
2713
|
+
},
|
|
2714
|
+
trapsFocus: true
|
|
2715
|
+
},
|
|
2716
|
+
overrides
|
|
2717
|
+
);
|
|
2718
|
+
registerSliderOutput(loader, {
|
|
2719
|
+
parentComponentName: SLIDER_COMPONENT_NAME
|
|
2720
|
+
});
|
|
2721
|
+
registerSliderThumb(loader, {
|
|
2722
|
+
parentComponentName: SLIDER_COMPONENT_NAME
|
|
2723
|
+
});
|
|
2724
|
+
registerSliderTrack(loader, {
|
|
2725
|
+
parentComponentName: SLIDER_COMPONENT_NAME
|
|
2228
2726
|
});
|
|
2229
2727
|
}
|
|
2230
2728
|
|
|
@@ -2748,12 +3246,19 @@ function BaseTooltip(props) {
|
|
|
2748
3246
|
ref
|
|
2749
3247
|
);
|
|
2750
3248
|
const focusableChild = flattenChildren__default.default(children)[0];
|
|
2751
|
-
return /* @__PURE__ */ React__default.default.createElement(
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
3249
|
+
return /* @__PURE__ */ React__default.default.createElement(
|
|
3250
|
+
"div",
|
|
3251
|
+
{
|
|
3252
|
+
style: { position: "relative" }
|
|
3253
|
+
},
|
|
3254
|
+
React__default.default.isValidElement(focusableChild) ? React__default.default.cloneElement(focusableChild, __spreadValues({
|
|
3255
|
+
ref
|
|
3256
|
+
}, utils.mergeProps(
|
|
3257
|
+
focusableChild.props,
|
|
3258
|
+
triggerProps
|
|
3259
|
+
))) : null,
|
|
3260
|
+
state.isOpen && /* @__PURE__ */ React__default.default.createElement("span", __spreadProps(__spreadValues({}, tooltipProps), { className: `${className} ${resetClassName}` }), tooltipContent)
|
|
3261
|
+
);
|
|
2757
3262
|
}
|
|
2758
3263
|
function registerTooltip(loader, overrides) {
|
|
2759
3264
|
registerComponentHelper(
|
|
@@ -2846,6 +3351,8 @@ function registerAll(loader) {
|
|
|
2846
3351
|
registerTextField(loader);
|
|
2847
3352
|
registerModal(loader);
|
|
2848
3353
|
registerTooltip(loader);
|
|
3354
|
+
registerDialogTrigger(loader);
|
|
3355
|
+
registerSlider(loader);
|
|
2849
3356
|
}
|
|
2850
3357
|
|
|
2851
3358
|
exports.registerAll = registerAll;
|