@plasmicpkgs/react-aria 0.0.29 → 0.0.30
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 -0
- package/dist/react-aria.esm.js +1712 -878
- package/dist/react-aria.esm.js.map +1 -1
- package/dist/react-aria.js +1711 -877
- package/dist/react-aria.js.map +1 -1
- package/dist/registerButton.d.ts +1 -0
- package/dist/registerCheckbox.d.ts +8 -2
- package/dist/registerCheckboxGroup.d.ts +2 -2
- package/dist/registerDescription.d.ts +2 -1
- package/dist/registerDialogTrigger.d.ts +1 -2
- package/dist/registerHeader.d.ts +1 -1
- package/dist/registerInput.d.ts +1 -0
- package/dist/registerListBox.d.ts +3 -6
- package/dist/registerListBoxItem.d.ts +3 -1
- package/dist/registerModal.d.ts +3 -1
- package/dist/registerPopover.d.ts +3 -0
- package/dist/registerRadio.d.ts +5 -2
- package/dist/registerRadioGroup.d.ts +3 -3
- package/dist/registerSection.d.ts +1 -1
- package/dist/registerSelect.d.ts +5 -2
- package/dist/registerText.d.ts +2 -1
- package/dist/registerTextField.d.ts +1 -0
- package/dist/utils.d.ts +9 -2
- package/package.json +2 -2
- package/skinny/contexts-9475faad.esm.js +16 -0
- package/skinny/contexts-9475faad.esm.js.map +1 -0
- package/skinny/{contexts-dd0ce341.cjs.js → contexts-b21f6b12.cjs.js} +7 -1
- package/skinny/contexts-b21f6b12.cjs.js.map +1 -0
- package/skinny/contexts.d.ts +3 -0
- package/skinny/registerButton.cjs.js +19 -4
- package/skinny/registerButton.cjs.js.map +1 -1
- package/skinny/registerButton.d.ts +1 -0
- package/skinny/registerButton.esm.js +19 -5
- package/skinny/registerButton.esm.js.map +1 -1
- package/skinny/registerCheckbox.cjs.js +75 -6
- package/skinny/registerCheckbox.cjs.js.map +1 -1
- package/skinny/registerCheckbox.d.ts +8 -2
- package/skinny/registerCheckbox.esm.js +75 -7
- package/skinny/registerCheckbox.esm.js.map +1 -1
- package/skinny/registerCheckboxGroup.cjs.js +89 -13
- package/skinny/registerCheckboxGroup.cjs.js.map +1 -1
- package/skinny/registerCheckboxGroup.d.ts +2 -2
- package/skinny/registerCheckboxGroup.esm.js +88 -16
- package/skinny/registerCheckboxGroup.esm.js.map +1 -1
- package/skinny/registerComboBox.cjs.js +113 -8
- package/skinny/registerComboBox.cjs.js.map +1 -1
- package/skinny/registerComboBox.esm.js +109 -4
- package/skinny/registerComboBox.esm.js.map +1 -1
- package/skinny/registerDescription.cjs.js +10 -3
- package/skinny/registerDescription.cjs.js.map +1 -1
- package/skinny/registerDescription.d.ts +2 -1
- package/skinny/registerDescription.esm.js +10 -4
- package/skinny/registerDescription.esm.js.map +1 -1
- package/skinny/registerDialogTrigger.cjs.js +25 -4
- package/skinny/registerDialogTrigger.cjs.js.map +1 -1
- package/skinny/registerDialogTrigger.d.ts +1 -2
- package/skinny/registerDialogTrigger.esm.js +25 -4
- package/skinny/registerDialogTrigger.esm.js.map +1 -1
- package/skinny/registerFieldError.cjs.js +21 -11
- package/skinny/registerFieldError.cjs.js.map +1 -1
- package/skinny/registerFieldError.esm.js +21 -11
- package/skinny/registerFieldError.esm.js.map +1 -1
- package/skinny/registerForm.cjs.js +1 -1
- package/skinny/registerForm.esm.js +1 -1
- package/skinny/registerHeader.cjs.js +7 -3
- package/skinny/registerHeader.cjs.js.map +1 -1
- package/skinny/registerHeader.d.ts +1 -1
- package/skinny/registerHeader.esm.js +7 -3
- package/skinny/registerHeader.esm.js.map +1 -1
- package/skinny/registerInput.cjs.js +11 -2
- package/skinny/registerInput.cjs.js.map +1 -1
- package/skinny/registerInput.d.ts +1 -0
- package/skinny/registerInput.esm.js +11 -3
- package/skinny/registerInput.esm.js.map +1 -1
- package/skinny/registerLabel.cjs.js +1 -1
- package/skinny/registerLabel.esm.js +1 -1
- package/skinny/registerListBox-1effa43d.esm.js +299 -0
- package/skinny/registerListBox-1effa43d.esm.js.map +1 -0
- package/skinny/registerListBox-837b90d8.cjs.js +311 -0
- package/skinny/registerListBox-837b90d8.cjs.js.map +1 -0
- package/skinny/registerListBox.cjs.js +14 -108
- package/skinny/registerListBox.cjs.js.map +1 -1
- package/skinny/registerListBox.d.ts +3 -6
- package/skinny/registerListBox.esm.js +11 -106
- package/skinny/registerListBox.esm.js.map +1 -1
- package/skinny/registerListBoxItem.cjs.js +49 -5
- package/skinny/registerListBoxItem.cjs.js.map +1 -1
- package/skinny/registerListBoxItem.d.ts +3 -1
- package/skinny/registerListBoxItem.esm.js +49 -6
- package/skinny/registerListBoxItem.esm.js.map +1 -1
- package/skinny/registerModal.cjs.js +78 -9
- package/skinny/registerModal.cjs.js.map +1 -1
- package/skinny/registerModal.d.ts +3 -1
- package/skinny/registerModal.esm.js +78 -10
- package/skinny/registerModal.esm.js.map +1 -1
- package/skinny/registerPopover.cjs.js +56 -4
- package/skinny/registerPopover.cjs.js.map +1 -1
- package/skinny/registerPopover.d.ts +3 -0
- package/skinny/registerPopover.esm.js +55 -5
- package/skinny/registerPopover.esm.js.map +1 -1
- package/skinny/registerRadio.cjs.js +51 -6
- package/skinny/registerRadio.cjs.js.map +1 -1
- package/skinny/registerRadio.d.ts +5 -2
- package/skinny/registerRadio.esm.js +51 -7
- package/skinny/registerRadio.esm.js.map +1 -1
- package/skinny/registerRadioGroup.cjs.js +80 -16
- package/skinny/registerRadioGroup.cjs.js.map +1 -1
- package/skinny/registerRadioGroup.d.ts +3 -3
- package/skinny/registerRadioGroup.esm.js +79 -19
- package/skinny/registerRadioGroup.esm.js.map +1 -1
- package/skinny/registerSection.cjs.js +36 -12
- package/skinny/registerSection.cjs.js.map +1 -1
- package/skinny/registerSection.d.ts +1 -1
- package/skinny/registerSection.esm.js +36 -12
- package/skinny/registerSection.esm.js.map +1 -1
- package/skinny/registerSelect.cjs.js +133 -30
- package/skinny/registerSelect.cjs.js.map +1 -1
- package/skinny/registerSelect.d.ts +5 -2
- package/skinny/registerSelect.esm.js +130 -25
- package/skinny/registerSelect.esm.js.map +1 -1
- package/skinny/{registerSlider-efdba013.esm.js → registerSlider-39783c91.esm.js} +3 -3
- package/skinny/{registerSlider-efdba013.esm.js.map → registerSlider-39783c91.esm.js.map} +1 -1
- package/skinny/{registerSlider-73e80194.cjs.js → registerSlider-ac9f3b1e.cjs.js} +3 -3
- package/skinny/{registerSlider-73e80194.cjs.js.map → registerSlider-ac9f3b1e.cjs.js.map} +1 -1
- package/skinny/registerSlider.cjs.js +3 -3
- package/skinny/registerSlider.esm.js +3 -3
- package/skinny/registerSliderOutput.cjs.js +1 -1
- package/skinny/registerSliderOutput.esm.js +1 -1
- package/skinny/registerSliderThumb.cjs.js +2 -2
- package/skinny/registerSliderThumb.esm.js +2 -2
- package/skinny/registerSliderTrack.cjs.js +3 -3
- package/skinny/registerSliderTrack.esm.js +3 -3
- package/skinny/registerSwitch.cjs.js +83 -3
- package/skinny/registerSwitch.cjs.js.map +1 -1
- package/skinny/registerSwitch.esm.js +83 -3
- package/skinny/registerSwitch.esm.js.map +1 -1
- package/skinny/registerText.cjs.js +11 -4
- package/skinny/registerText.cjs.js.map +1 -1
- package/skinny/registerText.d.ts +2 -1
- package/skinny/registerText.esm.js +11 -5
- package/skinny/registerText.esm.js.map +1 -1
- package/skinny/registerTextArea.cjs.js +1 -1
- package/skinny/registerTextArea.esm.js +1 -1
- package/skinny/registerTextField.cjs.js +47 -6
- package/skinny/registerTextField.cjs.js.map +1 -1
- package/skinny/registerTextField.d.ts +1 -0
- package/skinny/registerTextField.esm.js +50 -10
- package/skinny/registerTextField.esm.js.map +1 -1
- package/skinny/registerTooltip.cjs.js +1 -1
- package/skinny/registerTooltip.esm.js +1 -1
- package/skinny/{utils-cf2632c9.esm.js → utils-5051df41.esm.js} +3 -2
- package/skinny/utils-5051df41.esm.js.map +1 -0
- package/skinny/{utils-18b2465b.cjs.js → utils-745db876.cjs.js} +2 -1
- package/skinny/utils-745db876.cjs.js.map +1 -0
- package/skinny/utils.d.ts +9 -2
- package/skinny/contexts-8a2a183b.esm.js +0 -13
- package/skinny/contexts-8a2a183b.esm.js.map +0 -1
- package/skinny/contexts-dd0ce341.cjs.js.map +0 -1
- package/skinny/option-utils-4f037568.esm.js +0 -153
- package/skinny/option-utils-4f037568.esm.js.map +0 -1
- package/skinny/option-utils-5e4e85bd.cjs.js +0 -162
- package/skinny/option-utils-5e4e85bd.cjs.js.map +0 -1
- package/skinny/utils-18b2465b.cjs.js.map +0 -1
- package/skinny/utils-cf2632c9.esm.js.map +0 -1
package/dist/react-aria.js
CHANGED
|
@@ -119,29 +119,29 @@ function pickAriaComponentVariants(keys) {
|
|
|
119
119
|
};
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
-
var __defProp$
|
|
123
|
-
var __defProps$
|
|
124
|
-
var __getOwnPropDescs$
|
|
125
|
-
var __getOwnPropSymbols$
|
|
126
|
-
var __hasOwnProp$
|
|
127
|
-
var __propIsEnum$
|
|
128
|
-
var __defNormalProp$
|
|
129
|
-
var __spreadValues$
|
|
122
|
+
var __defProp$q = Object.defineProperty;
|
|
123
|
+
var __defProps$e = Object.defineProperties;
|
|
124
|
+
var __getOwnPropDescs$e = Object.getOwnPropertyDescriptors;
|
|
125
|
+
var __getOwnPropSymbols$q = Object.getOwnPropertySymbols;
|
|
126
|
+
var __hasOwnProp$q = Object.prototype.hasOwnProperty;
|
|
127
|
+
var __propIsEnum$q = Object.prototype.propertyIsEnumerable;
|
|
128
|
+
var __defNormalProp$q = (obj, key, value) => key in obj ? __defProp$q(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
129
|
+
var __spreadValues$q = (a, b) => {
|
|
130
130
|
for (var prop in b || (b = {}))
|
|
131
|
-
if (__hasOwnProp$
|
|
132
|
-
__defNormalProp$
|
|
133
|
-
if (__getOwnPropSymbols$
|
|
134
|
-
for (var prop of __getOwnPropSymbols$
|
|
135
|
-
if (__propIsEnum$
|
|
136
|
-
__defNormalProp$
|
|
131
|
+
if (__hasOwnProp$q.call(b, prop))
|
|
132
|
+
__defNormalProp$q(a, prop, b[prop]);
|
|
133
|
+
if (__getOwnPropSymbols$q)
|
|
134
|
+
for (var prop of __getOwnPropSymbols$q(b)) {
|
|
135
|
+
if (__propIsEnum$q.call(b, prop))
|
|
136
|
+
__defNormalProp$q(a, prop, b[prop]);
|
|
137
137
|
}
|
|
138
138
|
return a;
|
|
139
139
|
};
|
|
140
|
-
var __spreadProps$
|
|
140
|
+
var __spreadProps$e = (a, b) => __defProps$e(a, __getOwnPropDescs$e(b));
|
|
141
141
|
function registerComponentHelper(loader, component, meta, overrides) {
|
|
142
142
|
if (overrides) {
|
|
143
|
-
meta = __spreadProps$
|
|
144
|
-
props: __spreadValues$
|
|
143
|
+
meta = __spreadProps$e(__spreadValues$q(__spreadValues$q({}, meta), overrides), {
|
|
144
|
+
props: __spreadValues$q(__spreadValues$q({}, meta.props), overrides.props)
|
|
145
145
|
});
|
|
146
146
|
if (overrides.parentComponentName) {
|
|
147
147
|
meta.name = makeChildComponentName(
|
|
@@ -155,6 +155,7 @@ function registerComponentHelper(loader, component, meta, overrides) {
|
|
|
155
155
|
} else {
|
|
156
156
|
registerComponent__default.default(component, meta);
|
|
157
157
|
}
|
|
158
|
+
return meta;
|
|
158
159
|
}
|
|
159
160
|
function makeComponentName(name) {
|
|
160
161
|
return `plasmic-react-aria-${name}`;
|
|
@@ -177,33 +178,33 @@ function withoutNils(array) {
|
|
|
177
178
|
return array.filter((x) => x != null);
|
|
178
179
|
}
|
|
179
180
|
|
|
180
|
-
var __defProp$
|
|
181
|
-
var __defProps$
|
|
182
|
-
var __getOwnPropDescs$
|
|
183
|
-
var __getOwnPropSymbols$
|
|
184
|
-
var __hasOwnProp$
|
|
185
|
-
var __propIsEnum$
|
|
186
|
-
var __defNormalProp$
|
|
187
|
-
var __spreadValues$
|
|
181
|
+
var __defProp$p = Object.defineProperty;
|
|
182
|
+
var __defProps$d = Object.defineProperties;
|
|
183
|
+
var __getOwnPropDescs$d = Object.getOwnPropertyDescriptors;
|
|
184
|
+
var __getOwnPropSymbols$p = Object.getOwnPropertySymbols;
|
|
185
|
+
var __hasOwnProp$p = Object.prototype.hasOwnProperty;
|
|
186
|
+
var __propIsEnum$p = Object.prototype.propertyIsEnumerable;
|
|
187
|
+
var __defNormalProp$p = (obj, key, value) => key in obj ? __defProp$p(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
188
|
+
var __spreadValues$p = (a, b) => {
|
|
188
189
|
for (var prop in b || (b = {}))
|
|
189
|
-
if (__hasOwnProp$
|
|
190
|
-
__defNormalProp$
|
|
191
|
-
if (__getOwnPropSymbols$
|
|
192
|
-
for (var prop of __getOwnPropSymbols$
|
|
193
|
-
if (__propIsEnum$
|
|
194
|
-
__defNormalProp$
|
|
190
|
+
if (__hasOwnProp$p.call(b, prop))
|
|
191
|
+
__defNormalProp$p(a, prop, b[prop]);
|
|
192
|
+
if (__getOwnPropSymbols$p)
|
|
193
|
+
for (var prop of __getOwnPropSymbols$p(b)) {
|
|
194
|
+
if (__propIsEnum$p.call(b, prop))
|
|
195
|
+
__defNormalProp$p(a, prop, b[prop]);
|
|
195
196
|
}
|
|
196
197
|
return a;
|
|
197
198
|
};
|
|
198
|
-
var __spreadProps$
|
|
199
|
+
var __spreadProps$d = (a, b) => __defProps$d(a, __getOwnPropDescs$d(b));
|
|
199
200
|
var __objRest$h = (source, exclude) => {
|
|
200
201
|
var target = {};
|
|
201
202
|
for (var prop in source)
|
|
202
|
-
if (__hasOwnProp$
|
|
203
|
+
if (__hasOwnProp$p.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
203
204
|
target[prop] = source[prop];
|
|
204
|
-
if (source != null && __getOwnPropSymbols$
|
|
205
|
-
for (var prop of __getOwnPropSymbols$
|
|
206
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
205
|
+
if (source != null && __getOwnPropSymbols$p)
|
|
206
|
+
for (var prop of __getOwnPropSymbols$p(source)) {
|
|
207
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$p.call(source, prop))
|
|
207
208
|
target[prop] = source[prop];
|
|
208
209
|
}
|
|
209
210
|
return target;
|
|
@@ -230,7 +231,7 @@ function BaseButton(props) {
|
|
|
230
231
|
"updateInteractionVariant"
|
|
231
232
|
]);
|
|
232
233
|
const type = submitsForm ? "submit" : resetsForm ? "reset" : "button";
|
|
233
|
-
return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Button, __spreadValues$
|
|
234
|
+
return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Button, __spreadValues$p({ type }, rest), ({ isHovered, isPressed, isFocused, isFocusVisible }) => withObservedValues$5(
|
|
234
235
|
children,
|
|
235
236
|
{
|
|
236
237
|
hovered: isHovered,
|
|
@@ -241,21 +242,35 @@ function BaseButton(props) {
|
|
|
241
242
|
updateInteractionVariant
|
|
242
243
|
));
|
|
243
244
|
}
|
|
245
|
+
const BUTTON_COMPONENT_NAME = makeComponentName("button");
|
|
244
246
|
function registerButton(loader, overrides) {
|
|
245
247
|
registerComponentHelper(
|
|
246
248
|
loader,
|
|
247
249
|
BaseButton,
|
|
248
250
|
{
|
|
249
|
-
name:
|
|
251
|
+
name: BUTTON_COMPONENT_NAME,
|
|
250
252
|
displayName: "Aria Button",
|
|
251
253
|
importPath: "@plasmicpkgs/react-aria/skinny/registerButton",
|
|
252
254
|
importName: "BaseButton",
|
|
253
255
|
interactionVariants: interactionVariants$7,
|
|
254
|
-
|
|
256
|
+
defaultStyles: {
|
|
257
|
+
borderWidth: "1px",
|
|
258
|
+
borderStyle: "solid",
|
|
259
|
+
borderColor: "black",
|
|
260
|
+
padding: "2px 10px"
|
|
261
|
+
},
|
|
262
|
+
props: __spreadProps$d(__spreadValues$p({}, getCommonInputProps("button", [
|
|
255
263
|
"isDisabled",
|
|
256
|
-
"aria-label"
|
|
257
|
-
"children"
|
|
264
|
+
"aria-label"
|
|
258
265
|
])), {
|
|
266
|
+
children: {
|
|
267
|
+
type: "slot",
|
|
268
|
+
mergeWithParent: true,
|
|
269
|
+
defaultValue: {
|
|
270
|
+
type: "text",
|
|
271
|
+
value: "Button"
|
|
272
|
+
}
|
|
273
|
+
},
|
|
259
274
|
submitsForm: {
|
|
260
275
|
type: "boolean",
|
|
261
276
|
displayName: "Submits form?",
|
|
@@ -283,33 +298,70 @@ function registerButton(loader, overrides) {
|
|
|
283
298
|
);
|
|
284
299
|
}
|
|
285
300
|
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
301
|
+
const PlasmicCheckboxGroupContext = React__default.default.createContext(void 0);
|
|
302
|
+
const PlasmicRadioGroupContext = React__default.default.createContext(void 0);
|
|
303
|
+
const PlasmicDialogTriggerContext = React__default.default.createContext(void 0);
|
|
304
|
+
const PlasmicSliderContext = React__default.default.createContext(void 0);
|
|
305
|
+
React__default.default.createContext(void 0);
|
|
306
|
+
const PlasmicListBoxContext = React__default.default.createContext(void 0);
|
|
307
|
+
const PlasmicPopoverContext = React__default.default.createContext(void 0);
|
|
308
|
+
const PlasmicItemContext = React__default.default.createContext(void 0);
|
|
309
|
+
const PlasmicSectionContext = React__default.default.createContext(void 0);
|
|
310
|
+
const PlasmicHeaderContext = React__default.default.createContext(void 0);
|
|
311
|
+
const PlasmicInputContext = React__default.default.createContext(void 0);
|
|
312
|
+
|
|
313
|
+
const BaseLabel = reactAriaComponents.Label;
|
|
314
|
+
const LABEL_COMPONENT_NAME = makeComponentName("label");
|
|
315
|
+
function registerLabel(loader, overrides) {
|
|
316
|
+
registerComponentHelper(
|
|
317
|
+
loader,
|
|
318
|
+
BaseLabel,
|
|
319
|
+
{
|
|
320
|
+
name: LABEL_COMPONENT_NAME,
|
|
321
|
+
displayName: "Aria Label",
|
|
322
|
+
importPath: "@plasmicpkgs/react-aria/skinny/registerLabel",
|
|
323
|
+
importName: "BaseLabel",
|
|
324
|
+
defaultStyles: {
|
|
325
|
+
cursor: "pointer"
|
|
326
|
+
},
|
|
327
|
+
props: {
|
|
328
|
+
children: {
|
|
329
|
+
type: "slot"
|
|
330
|
+
}
|
|
331
|
+
},
|
|
332
|
+
trapsFocus: true
|
|
333
|
+
},
|
|
334
|
+
overrides
|
|
335
|
+
);
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
var __defProp$o = Object.defineProperty;
|
|
339
|
+
var __defProps$c = Object.defineProperties;
|
|
340
|
+
var __getOwnPropDescs$c = Object.getOwnPropertyDescriptors;
|
|
341
|
+
var __getOwnPropSymbols$o = Object.getOwnPropertySymbols;
|
|
342
|
+
var __hasOwnProp$o = Object.prototype.hasOwnProperty;
|
|
343
|
+
var __propIsEnum$o = Object.prototype.propertyIsEnumerable;
|
|
344
|
+
var __defNormalProp$o = (obj, key, value) => key in obj ? __defProp$o(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
345
|
+
var __spreadValues$o = (a, b) => {
|
|
294
346
|
for (var prop in b || (b = {}))
|
|
295
|
-
if (__hasOwnProp$
|
|
296
|
-
__defNormalProp$
|
|
297
|
-
if (__getOwnPropSymbols$
|
|
298
|
-
for (var prop of __getOwnPropSymbols$
|
|
299
|
-
if (__propIsEnum$
|
|
300
|
-
__defNormalProp$
|
|
347
|
+
if (__hasOwnProp$o.call(b, prop))
|
|
348
|
+
__defNormalProp$o(a, prop, b[prop]);
|
|
349
|
+
if (__getOwnPropSymbols$o)
|
|
350
|
+
for (var prop of __getOwnPropSymbols$o(b)) {
|
|
351
|
+
if (__propIsEnum$o.call(b, prop))
|
|
352
|
+
__defNormalProp$o(a, prop, b[prop]);
|
|
301
353
|
}
|
|
302
354
|
return a;
|
|
303
355
|
};
|
|
304
|
-
var __spreadProps$
|
|
356
|
+
var __spreadProps$c = (a, b) => __defProps$c(a, __getOwnPropDescs$c(b));
|
|
305
357
|
var __objRest$g = (source, exclude) => {
|
|
306
358
|
var target = {};
|
|
307
359
|
for (var prop in source)
|
|
308
|
-
if (__hasOwnProp$
|
|
360
|
+
if (__hasOwnProp$o.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
309
361
|
target[prop] = source[prop];
|
|
310
|
-
if (source != null && __getOwnPropSymbols$
|
|
311
|
-
for (var prop of __getOwnPropSymbols$
|
|
312
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
362
|
+
if (source != null && __getOwnPropSymbols$o)
|
|
363
|
+
for (var prop of __getOwnPropSymbols$o(source)) {
|
|
364
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$o.call(source, prop))
|
|
313
365
|
target[prop] = source[prop];
|
|
314
366
|
}
|
|
315
367
|
return target;
|
|
@@ -324,8 +376,13 @@ const { interactionVariants: interactionVariants$6, withObservedValues: withObse
|
|
|
324
376
|
CHECKBOX_INTERACTION_VARIANTS
|
|
325
377
|
);
|
|
326
378
|
function BaseCheckbox(props) {
|
|
327
|
-
const _a = props, { children, updateInteractionVariant } = _a, rest = __objRest$g(_a, ["children", "updateInteractionVariant"]);
|
|
328
|
-
|
|
379
|
+
const _a = props, { children, updateInteractionVariant, setControlContextData } = _a, rest = __objRest$g(_a, ["children", "updateInteractionVariant", "setControlContextData"]);
|
|
380
|
+
const contextProps = React__default.default.useContext(PlasmicCheckboxGroupContext);
|
|
381
|
+
const isStandalone = !contextProps;
|
|
382
|
+
setControlContextData == null ? void 0 : setControlContextData({
|
|
383
|
+
isStandalone
|
|
384
|
+
});
|
|
385
|
+
return /* @__PURE__ */ React__default.default.createElement(React__default.default.Fragment, null, /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Checkbox, __spreadValues$o({}, rest), ({ isHovered, isPressed, isFocused, isFocusVisible }) => withObservedValues$4(
|
|
329
386
|
children,
|
|
330
387
|
{
|
|
331
388
|
hovered: isHovered,
|
|
@@ -336,8 +393,60 @@ function BaseCheckbox(props) {
|
|
|
336
393
|
updateInteractionVariant
|
|
337
394
|
)));
|
|
338
395
|
}
|
|
396
|
+
const makeDefaultCheckboxChildren = ({
|
|
397
|
+
label,
|
|
398
|
+
showDocs
|
|
399
|
+
}) => ({
|
|
400
|
+
type: "vbox",
|
|
401
|
+
styles: {
|
|
402
|
+
display: "flex",
|
|
403
|
+
alignItems: "center",
|
|
404
|
+
gap: "2px",
|
|
405
|
+
padding: 0
|
|
406
|
+
},
|
|
407
|
+
children: [
|
|
408
|
+
{
|
|
409
|
+
type: "hbox",
|
|
410
|
+
styles: {
|
|
411
|
+
display: "flex",
|
|
412
|
+
alignItems: "center",
|
|
413
|
+
gap: "10px",
|
|
414
|
+
padding: 0
|
|
415
|
+
},
|
|
416
|
+
children: [
|
|
417
|
+
{
|
|
418
|
+
type: "box",
|
|
419
|
+
styles: {
|
|
420
|
+
width: "7px",
|
|
421
|
+
height: "7px",
|
|
422
|
+
borderRadius: "3px",
|
|
423
|
+
borderWidth: "1px",
|
|
424
|
+
borderStyle: "solid",
|
|
425
|
+
borderColor: "black"
|
|
426
|
+
}
|
|
427
|
+
},
|
|
428
|
+
{
|
|
429
|
+
type: "component",
|
|
430
|
+
name: LABEL_COMPONENT_NAME,
|
|
431
|
+
props: {
|
|
432
|
+
children: {
|
|
433
|
+
type: "text",
|
|
434
|
+
value: label
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
]
|
|
439
|
+
},
|
|
440
|
+
...showDocs ? [
|
|
441
|
+
{
|
|
442
|
+
type: "text",
|
|
443
|
+
value: "Add interaction variants to see it in action..."
|
|
444
|
+
}
|
|
445
|
+
] : []
|
|
446
|
+
]
|
|
447
|
+
});
|
|
339
448
|
function registerCheckbox(loader, overrides) {
|
|
340
|
-
registerComponentHelper(
|
|
449
|
+
return registerComponentHelper(
|
|
341
450
|
loader,
|
|
342
451
|
BaseCheckbox,
|
|
343
452
|
{
|
|
@@ -346,15 +455,22 @@ function registerCheckbox(loader, overrides) {
|
|
|
346
455
|
importPath: "@plasmicpkgs/react-aria/skinny/registerCheckbox",
|
|
347
456
|
importName: "BaseCheckbox",
|
|
348
457
|
interactionVariants: interactionVariants$6,
|
|
349
|
-
props: __spreadProps$
|
|
458
|
+
props: __spreadProps$c(__spreadValues$o({}, getCommonInputProps("checkbox", [
|
|
350
459
|
"name",
|
|
351
460
|
"isDisabled",
|
|
352
461
|
"isReadOnly",
|
|
353
462
|
"aria-label",
|
|
354
|
-
"children",
|
|
355
463
|
"isRequired",
|
|
356
464
|
"autoFocus"
|
|
357
465
|
])), {
|
|
466
|
+
children: {
|
|
467
|
+
type: "slot",
|
|
468
|
+
mergeWithParent: true,
|
|
469
|
+
defaultValue: makeDefaultCheckboxChildren({
|
|
470
|
+
label: "Label",
|
|
471
|
+
showDocs: true
|
|
472
|
+
})
|
|
473
|
+
},
|
|
358
474
|
value: {
|
|
359
475
|
type: "string",
|
|
360
476
|
description: "The value of the input element, used when submitting an HTML form."
|
|
@@ -364,7 +480,8 @@ function registerCheckbox(loader, overrides) {
|
|
|
364
480
|
editOnly: true,
|
|
365
481
|
uncontrolledProp: "defaultSelected",
|
|
366
482
|
description: "Whether the checkbox is toggled on",
|
|
367
|
-
defaultValueHint: false
|
|
483
|
+
defaultValueHint: false,
|
|
484
|
+
defaultValue: false
|
|
368
485
|
},
|
|
369
486
|
isIndeterminate: {
|
|
370
487
|
displayName: "Indeterminate",
|
|
@@ -394,7 +511,8 @@ function registerCheckbox(loader, overrides) {
|
|
|
394
511
|
type: "writable",
|
|
395
512
|
valueProp: "isSelected",
|
|
396
513
|
onChangeProp: "onChange",
|
|
397
|
-
variableType: "boolean"
|
|
514
|
+
variableType: "boolean",
|
|
515
|
+
hidden: (_ps, ctx) => !(ctx == null ? void 0 : ctx.isStandalone)
|
|
398
516
|
}
|
|
399
517
|
},
|
|
400
518
|
trapsFocus: true
|
|
@@ -403,50 +521,56 @@ function registerCheckbox(loader, overrides) {
|
|
|
403
521
|
);
|
|
404
522
|
}
|
|
405
523
|
|
|
406
|
-
var __defProp$
|
|
407
|
-
var __getOwnPropSymbols$
|
|
408
|
-
var __hasOwnProp$
|
|
409
|
-
var __propIsEnum$
|
|
410
|
-
var __defNormalProp$
|
|
411
|
-
var __spreadValues$
|
|
524
|
+
var __defProp$n = Object.defineProperty;
|
|
525
|
+
var __getOwnPropSymbols$n = Object.getOwnPropertySymbols;
|
|
526
|
+
var __hasOwnProp$n = Object.prototype.hasOwnProperty;
|
|
527
|
+
var __propIsEnum$n = Object.prototype.propertyIsEnumerable;
|
|
528
|
+
var __defNormalProp$n = (obj, key, value) => key in obj ? __defProp$n(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
529
|
+
var __spreadValues$n = (a, b) => {
|
|
412
530
|
for (var prop in b || (b = {}))
|
|
413
|
-
if (__hasOwnProp$
|
|
414
|
-
__defNormalProp$
|
|
415
|
-
if (__getOwnPropSymbols$
|
|
416
|
-
for (var prop of __getOwnPropSymbols$
|
|
417
|
-
if (__propIsEnum$
|
|
418
|
-
__defNormalProp$
|
|
531
|
+
if (__hasOwnProp$n.call(b, prop))
|
|
532
|
+
__defNormalProp$n(a, prop, b[prop]);
|
|
533
|
+
if (__getOwnPropSymbols$n)
|
|
534
|
+
for (var prop of __getOwnPropSymbols$n(b)) {
|
|
535
|
+
if (__propIsEnum$n.call(b, prop))
|
|
536
|
+
__defNormalProp$n(a, prop, b[prop]);
|
|
419
537
|
}
|
|
420
538
|
return a;
|
|
421
539
|
};
|
|
422
540
|
var __objRest$f = (source, exclude) => {
|
|
423
541
|
var target = {};
|
|
424
542
|
for (var prop in source)
|
|
425
|
-
if (__hasOwnProp$
|
|
543
|
+
if (__hasOwnProp$n.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
426
544
|
target[prop] = source[prop];
|
|
427
|
-
if (source != null && __getOwnPropSymbols$
|
|
428
|
-
for (var prop of __getOwnPropSymbols$
|
|
429
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
545
|
+
if (source != null && __getOwnPropSymbols$n)
|
|
546
|
+
for (var prop of __getOwnPropSymbols$n(source)) {
|
|
547
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$n.call(source, prop))
|
|
430
548
|
target[prop] = source[prop];
|
|
431
549
|
}
|
|
432
550
|
return target;
|
|
433
551
|
};
|
|
434
552
|
function BaseText(_a) {
|
|
435
553
|
var _b = _a, { children } = _b, rest = __objRest$f(_b, ["children"]);
|
|
436
|
-
return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Text, __spreadValues$
|
|
554
|
+
return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Text, __spreadValues$n({}, rest), children);
|
|
437
555
|
}
|
|
556
|
+
const TEXT_COMPONENT_NAME = makeComponentName("text");
|
|
438
557
|
function registerText(loader, overrides) {
|
|
439
|
-
registerComponentHelper(
|
|
558
|
+
return registerComponentHelper(
|
|
440
559
|
loader,
|
|
441
560
|
BaseText,
|
|
442
561
|
{
|
|
443
|
-
name:
|
|
562
|
+
name: TEXT_COMPONENT_NAME,
|
|
444
563
|
displayName: "Aria Text",
|
|
445
564
|
importPath: "@plasmicpkgs/react-aria/skinny/registerText",
|
|
446
565
|
importName: "BaseText",
|
|
447
566
|
props: {
|
|
448
567
|
children: {
|
|
449
|
-
type: "slot"
|
|
568
|
+
type: "slot",
|
|
569
|
+
mergeWithParent: true,
|
|
570
|
+
defaultValue: {
|
|
571
|
+
type: "text",
|
|
572
|
+
value: "Some text..."
|
|
573
|
+
}
|
|
450
574
|
},
|
|
451
575
|
slot: {
|
|
452
576
|
type: "string"
|
|
@@ -458,9 +582,41 @@ function registerText(loader, overrides) {
|
|
|
458
582
|
);
|
|
459
583
|
}
|
|
460
584
|
|
|
585
|
+
var __defProp$m = Object.defineProperty;
|
|
586
|
+
var __defProps$b = Object.defineProperties;
|
|
587
|
+
var __getOwnPropDescs$b = Object.getOwnPropertyDescriptors;
|
|
588
|
+
var __getOwnPropSymbols$m = Object.getOwnPropertySymbols;
|
|
589
|
+
var __hasOwnProp$m = Object.prototype.hasOwnProperty;
|
|
590
|
+
var __propIsEnum$m = Object.prototype.propertyIsEnumerable;
|
|
591
|
+
var __defNormalProp$m = (obj, key, value) => key in obj ? __defProp$m(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
592
|
+
var __spreadValues$m = (a, b) => {
|
|
593
|
+
for (var prop in b || (b = {}))
|
|
594
|
+
if (__hasOwnProp$m.call(b, prop))
|
|
595
|
+
__defNormalProp$m(a, prop, b[prop]);
|
|
596
|
+
if (__getOwnPropSymbols$m)
|
|
597
|
+
for (var prop of __getOwnPropSymbols$m(b)) {
|
|
598
|
+
if (__propIsEnum$m.call(b, prop))
|
|
599
|
+
__defNormalProp$m(a, prop, b[prop]);
|
|
600
|
+
}
|
|
601
|
+
return a;
|
|
602
|
+
};
|
|
603
|
+
var __spreadProps$b = (a, b) => __defProps$b(a, __getOwnPropDescs$b(b));
|
|
604
|
+
const DESCRIPTION_COMPONENT_NAME = makeComponentName("description");
|
|
605
|
+
function registerDescription(loader, overrides) {
|
|
606
|
+
return registerText(loader, __spreadProps$b(__spreadValues$m({}, overrides), {
|
|
607
|
+
name: DESCRIPTION_COMPONENT_NAME,
|
|
608
|
+
displayName: "Aria Description",
|
|
609
|
+
props: {
|
|
610
|
+
slot: {
|
|
611
|
+
type: "string",
|
|
612
|
+
hidden: () => true,
|
|
613
|
+
defaultValue: "description"
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
}));
|
|
617
|
+
}
|
|
618
|
+
|
|
461
619
|
var __defProp$l = Object.defineProperty;
|
|
462
|
-
var __defProps$a = Object.defineProperties;
|
|
463
|
-
var __getOwnPropDescs$a = Object.getOwnPropertyDescriptors;
|
|
464
620
|
var __getOwnPropSymbols$l = Object.getOwnPropertySymbols;
|
|
465
621
|
var __hasOwnProp$l = Object.prototype.hasOwnProperty;
|
|
466
622
|
var __propIsEnum$l = Object.prototype.propertyIsEnumerable;
|
|
@@ -476,40 +632,14 @@ var __spreadValues$l = (a, b) => {
|
|
|
476
632
|
}
|
|
477
633
|
return a;
|
|
478
634
|
};
|
|
479
|
-
var __spreadProps$a = (a, b) => __defProps$a(a, __getOwnPropDescs$a(b));
|
|
480
|
-
function registerDescription(loader, overrides) {
|
|
481
|
-
registerText(loader, __spreadProps$a(__spreadValues$l({}, overrides), {
|
|
482
|
-
displayName: "Aria Description",
|
|
483
|
-
props: {
|
|
484
|
-
slot: { type: "string", hidden: () => true, defaultValue: "description" }
|
|
485
|
-
}
|
|
486
|
-
}));
|
|
487
|
-
}
|
|
488
|
-
|
|
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) => {
|
|
495
|
-
for (var prop in b || (b = {}))
|
|
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]);
|
|
502
|
-
}
|
|
503
|
-
return a;
|
|
504
|
-
};
|
|
505
635
|
var __objRest$e = (source, exclude) => {
|
|
506
636
|
var target = {};
|
|
507
637
|
for (var prop in source)
|
|
508
|
-
if (__hasOwnProp$
|
|
638
|
+
if (__hasOwnProp$l.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
509
639
|
target[prop] = source[prop];
|
|
510
|
-
if (source != null && __getOwnPropSymbols$
|
|
511
|
-
for (var prop of __getOwnPropSymbols$
|
|
512
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
640
|
+
if (source != null && __getOwnPropSymbols$l)
|
|
641
|
+
for (var prop of __getOwnPropSymbols$l(source)) {
|
|
642
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$l.call(source, prop))
|
|
513
643
|
target[prop] = source[prop];
|
|
514
644
|
}
|
|
515
645
|
return target;
|
|
@@ -538,27 +668,37 @@ function BaseFieldError(_a) {
|
|
|
538
668
|
"typeMismatch",
|
|
539
669
|
"valueMissing"
|
|
540
670
|
]);
|
|
541
|
-
return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.FieldError, __spreadValues$
|
|
542
|
-
if (validationDetails.badInput && badInput)
|
|
671
|
+
return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.FieldError, __spreadValues$l({}, rest), ({ validationDetails, validationErrors }) => {
|
|
672
|
+
if (validationDetails.badInput && badInput) {
|
|
543
673
|
return badInput;
|
|
544
|
-
|
|
674
|
+
}
|
|
675
|
+
if (validationDetails.customError && customError) {
|
|
545
676
|
return customError;
|
|
546
|
-
|
|
677
|
+
}
|
|
678
|
+
if (validationDetails.patternMismatch && patternMismatch) {
|
|
547
679
|
return patternMismatch;
|
|
548
|
-
|
|
680
|
+
}
|
|
681
|
+
if (validationDetails.rangeOverflow && rangeOverflow) {
|
|
549
682
|
return rangeOverflow;
|
|
550
|
-
|
|
683
|
+
}
|
|
684
|
+
if (validationDetails.rangeUnderflow && rangeUnderflow) {
|
|
551
685
|
return rangeUnderflow;
|
|
552
|
-
|
|
686
|
+
}
|
|
687
|
+
if (validationDetails.stepMismatch && stepMismatch) {
|
|
553
688
|
return stepMismatch;
|
|
554
|
-
|
|
689
|
+
}
|
|
690
|
+
if (validationDetails.tooLong && tooLong) {
|
|
555
691
|
return tooLong;
|
|
556
|
-
|
|
692
|
+
}
|
|
693
|
+
if (validationDetails.tooShort && tooShort) {
|
|
557
694
|
return tooShort;
|
|
558
|
-
|
|
695
|
+
}
|
|
696
|
+
if (validationDetails.typeMismatch && typeMismatch) {
|
|
559
697
|
return typeMismatch;
|
|
560
|
-
|
|
698
|
+
}
|
|
699
|
+
if (validationDetails.valueMissing && valueMissing) {
|
|
561
700
|
return valueMissing;
|
|
701
|
+
}
|
|
562
702
|
return validationErrors;
|
|
563
703
|
});
|
|
564
704
|
}
|
|
@@ -635,62 +775,48 @@ function registerFieldError(loader, overrides) {
|
|
|
635
775
|
);
|
|
636
776
|
}
|
|
637
777
|
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
displayName: "Aria Label",
|
|
647
|
-
importPath: "@plasmicpkgs/react-aria/skinny/registerLabel",
|
|
648
|
-
importName: "BaseLabel",
|
|
649
|
-
defaultStyles: {
|
|
650
|
-
cursor: "pointer"
|
|
651
|
-
},
|
|
652
|
-
props: {
|
|
653
|
-
children: {
|
|
654
|
-
type: "slot"
|
|
655
|
-
}
|
|
656
|
-
},
|
|
657
|
-
trapsFocus: true
|
|
658
|
-
},
|
|
659
|
-
overrides
|
|
660
|
-
);
|
|
661
|
-
}
|
|
662
|
-
|
|
663
|
-
var __defProp$j = Object.defineProperty;
|
|
664
|
-
var __defProps$9 = Object.defineProperties;
|
|
665
|
-
var __getOwnPropDescs$9 = Object.getOwnPropertyDescriptors;
|
|
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) => {
|
|
778
|
+
var __defProp$k = Object.defineProperty;
|
|
779
|
+
var __defProps$a = Object.defineProperties;
|
|
780
|
+
var __getOwnPropDescs$a = Object.getOwnPropertyDescriptors;
|
|
781
|
+
var __getOwnPropSymbols$k = Object.getOwnPropertySymbols;
|
|
782
|
+
var __hasOwnProp$k = Object.prototype.hasOwnProperty;
|
|
783
|
+
var __propIsEnum$k = Object.prototype.propertyIsEnumerable;
|
|
784
|
+
var __defNormalProp$k = (obj, key, value) => key in obj ? __defProp$k(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
785
|
+
var __spreadValues$k = (a, b) => {
|
|
671
786
|
for (var prop in b || (b = {}))
|
|
672
|
-
if (__hasOwnProp$
|
|
673
|
-
__defNormalProp$
|
|
674
|
-
if (__getOwnPropSymbols$
|
|
675
|
-
for (var prop of __getOwnPropSymbols$
|
|
676
|
-
if (__propIsEnum$
|
|
677
|
-
__defNormalProp$
|
|
787
|
+
if (__hasOwnProp$k.call(b, prop))
|
|
788
|
+
__defNormalProp$k(a, prop, b[prop]);
|
|
789
|
+
if (__getOwnPropSymbols$k)
|
|
790
|
+
for (var prop of __getOwnPropSymbols$k(b)) {
|
|
791
|
+
if (__propIsEnum$k.call(b, prop))
|
|
792
|
+
__defNormalProp$k(a, prop, b[prop]);
|
|
678
793
|
}
|
|
679
794
|
return a;
|
|
680
795
|
};
|
|
681
|
-
var __spreadProps$
|
|
682
|
-
|
|
683
|
-
|
|
796
|
+
var __spreadProps$a = (a, b) => __defProps$a(a, __getOwnPropDescs$a(b));
|
|
797
|
+
function BaseCheckboxGroup(props) {
|
|
798
|
+
return /* @__PURE__ */ React__default.default.createElement(PlasmicCheckboxGroupContext.Provider, { value: props }, /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.CheckboxGroup, __spreadValues$k({}, props)));
|
|
799
|
+
}
|
|
800
|
+
const componentName = makeComponentName("checkboxGroup");
|
|
684
801
|
function registerCheckboxGroup(loader, overrides) {
|
|
802
|
+
const thisName = makeChildComponentName(
|
|
803
|
+
overrides == null ? void 0 : overrides.parentComponentName,
|
|
804
|
+
componentName
|
|
805
|
+
);
|
|
806
|
+
registerFieldError(loader, { parentComponentName: thisName });
|
|
807
|
+
const checkboxMeta = registerCheckbox(loader, {
|
|
808
|
+
parentComponentName: thisName
|
|
809
|
+
});
|
|
810
|
+
registerLabel(loader, { parentComponentName: thisName });
|
|
685
811
|
registerComponentHelper(
|
|
686
812
|
loader,
|
|
687
813
|
BaseCheckboxGroup,
|
|
688
814
|
{
|
|
689
|
-
name: componentName
|
|
815
|
+
name: componentName,
|
|
690
816
|
displayName: "Aria Checkbox Group",
|
|
691
817
|
importPath: "@plasmicpkgs/react-aria/skinny/registerCheckboxGroup",
|
|
692
818
|
importName: "BaseCheckboxGroup",
|
|
693
|
-
props: __spreadProps$
|
|
819
|
+
props: __spreadProps$a(__spreadValues$k({}, getCommonInputProps("checkbox group", [
|
|
694
820
|
"name",
|
|
695
821
|
"isDisabled",
|
|
696
822
|
"isReadOnly",
|
|
@@ -698,6 +824,76 @@ function registerCheckboxGroup(loader, overrides) {
|
|
|
698
824
|
"children",
|
|
699
825
|
"isRequired"
|
|
700
826
|
])), {
|
|
827
|
+
children: {
|
|
828
|
+
type: "slot",
|
|
829
|
+
mergeWithParent: true,
|
|
830
|
+
defaultValue: [
|
|
831
|
+
{
|
|
832
|
+
type: "vbox",
|
|
833
|
+
styles: {
|
|
834
|
+
display: "flex",
|
|
835
|
+
gap: "5px",
|
|
836
|
+
padding: 0,
|
|
837
|
+
alignItems: "flex-start"
|
|
838
|
+
},
|
|
839
|
+
children: [
|
|
840
|
+
{
|
|
841
|
+
type: "component",
|
|
842
|
+
name: LABEL_COMPONENT_NAME,
|
|
843
|
+
props: {
|
|
844
|
+
children: {
|
|
845
|
+
type: "text",
|
|
846
|
+
value: "Checkbox Group"
|
|
847
|
+
}
|
|
848
|
+
}
|
|
849
|
+
},
|
|
850
|
+
{
|
|
851
|
+
type: "component",
|
|
852
|
+
name: checkboxMeta.name,
|
|
853
|
+
props: {
|
|
854
|
+
children: makeDefaultCheckboxChildren({
|
|
855
|
+
label: "Checkbox 1",
|
|
856
|
+
showDocs: false
|
|
857
|
+
}),
|
|
858
|
+
value: "checkbox1"
|
|
859
|
+
}
|
|
860
|
+
},
|
|
861
|
+
{
|
|
862
|
+
type: "component",
|
|
863
|
+
name: checkboxMeta.name,
|
|
864
|
+
props: {
|
|
865
|
+
children: makeDefaultCheckboxChildren({
|
|
866
|
+
label: "Checkbox 2",
|
|
867
|
+
showDocs: false
|
|
868
|
+
}),
|
|
869
|
+
value: "checkbox2"
|
|
870
|
+
}
|
|
871
|
+
},
|
|
872
|
+
{
|
|
873
|
+
type: "component",
|
|
874
|
+
name: checkboxMeta.name,
|
|
875
|
+
props: {
|
|
876
|
+
children: makeDefaultCheckboxChildren({
|
|
877
|
+
label: "Checkbox 3",
|
|
878
|
+
showDocs: false
|
|
879
|
+
}),
|
|
880
|
+
value: "checkbox3"
|
|
881
|
+
}
|
|
882
|
+
},
|
|
883
|
+
{
|
|
884
|
+
type: "component",
|
|
885
|
+
name: DESCRIPTION_COMPONENT_NAME,
|
|
886
|
+
props: {
|
|
887
|
+
children: {
|
|
888
|
+
type: "text",
|
|
889
|
+
value: "Add interaction variants to see it in action..."
|
|
890
|
+
}
|
|
891
|
+
}
|
|
892
|
+
}
|
|
893
|
+
]
|
|
894
|
+
}
|
|
895
|
+
]
|
|
896
|
+
},
|
|
701
897
|
value: {
|
|
702
898
|
type: "array",
|
|
703
899
|
editOnly: true,
|
|
@@ -733,27 +929,8 @@ function registerCheckboxGroup(loader, overrides) {
|
|
|
733
929
|
},
|
|
734
930
|
overrides
|
|
735
931
|
);
|
|
736
|
-
const thisName = makeChildComponentName(
|
|
737
|
-
overrides == null ? void 0 : overrides.parentComponentName,
|
|
738
|
-
componentName$2
|
|
739
|
-
);
|
|
740
|
-
registerFieldError(loader, { parentComponentName: thisName });
|
|
741
|
-
registerCheckbox(loader, { parentComponentName: thisName });
|
|
742
|
-
registerLabel(loader, { parentComponentName: thisName });
|
|
743
|
-
registerDescription(loader, {
|
|
744
|
-
parentComponentName: thisName
|
|
745
|
-
});
|
|
746
932
|
}
|
|
747
933
|
|
|
748
|
-
const PlasmicSliderContext = React__default.default.createContext(void 0);
|
|
749
|
-
React__default.default.createContext(void 0);
|
|
750
|
-
const PlasmicListBoxContext = React__default.default.createContext(void 0);
|
|
751
|
-
const PlasmicPopoverContext = React__default.default.createContext(void 0);
|
|
752
|
-
const PlasmicItemContext = React__default.default.createContext(void 0);
|
|
753
|
-
const PlasmicSectionContext = React__default.default.createContext(void 0);
|
|
754
|
-
const PlasmicHeaderContext = React__default.default.createContext(void 0);
|
|
755
|
-
const PlasmicInputContext = React__default.default.createContext(void 0);
|
|
756
|
-
|
|
757
934
|
function useStrictOptions(props) {
|
|
758
935
|
const { options, optionInfo } = props;
|
|
759
936
|
return React__default.default.useMemo(() => {
|
|
@@ -884,6 +1061,22 @@ function makeOptionsPropType() {
|
|
|
884
1061
|
id: "option2",
|
|
885
1062
|
label: "Option 2",
|
|
886
1063
|
type: "option"
|
|
1064
|
+
},
|
|
1065
|
+
{
|
|
1066
|
+
label: "Section 1",
|
|
1067
|
+
type: "option-group",
|
|
1068
|
+
items: [
|
|
1069
|
+
{
|
|
1070
|
+
id: "section-1-1",
|
|
1071
|
+
label: "Section item 1",
|
|
1072
|
+
type: "option"
|
|
1073
|
+
},
|
|
1074
|
+
{
|
|
1075
|
+
id: "section-1-2",
|
|
1076
|
+
label: "Section item 2",
|
|
1077
|
+
type: "option"
|
|
1078
|
+
}
|
|
1079
|
+
]
|
|
887
1080
|
}
|
|
888
1081
|
]
|
|
889
1082
|
};
|
|
@@ -903,9 +1096,93 @@ function makeValuePropType() {
|
|
|
903
1096
|
return type;
|
|
904
1097
|
}
|
|
905
1098
|
|
|
1099
|
+
var __defProp$j = Object.defineProperty;
|
|
1100
|
+
var __getOwnPropSymbols$j = Object.getOwnPropertySymbols;
|
|
1101
|
+
var __hasOwnProp$j = Object.prototype.hasOwnProperty;
|
|
1102
|
+
var __propIsEnum$j = Object.prototype.propertyIsEnumerable;
|
|
1103
|
+
var __defNormalProp$j = (obj, key, value) => key in obj ? __defProp$j(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1104
|
+
var __spreadValues$j = (a, b) => {
|
|
1105
|
+
for (var prop in b || (b = {}))
|
|
1106
|
+
if (__hasOwnProp$j.call(b, prop))
|
|
1107
|
+
__defNormalProp$j(a, prop, b[prop]);
|
|
1108
|
+
if (__getOwnPropSymbols$j)
|
|
1109
|
+
for (var prop of __getOwnPropSymbols$j(b)) {
|
|
1110
|
+
if (__propIsEnum$j.call(b, prop))
|
|
1111
|
+
__defNormalProp$j(a, prop, b[prop]);
|
|
1112
|
+
}
|
|
1113
|
+
return a;
|
|
1114
|
+
};
|
|
1115
|
+
var __objRest$d = (source, exclude) => {
|
|
1116
|
+
var target = {};
|
|
1117
|
+
for (var prop in source)
|
|
1118
|
+
if (__hasOwnProp$j.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
1119
|
+
target[prop] = source[prop];
|
|
1120
|
+
if (source != null && __getOwnPropSymbols$j)
|
|
1121
|
+
for (var prop of __getOwnPropSymbols$j(source)) {
|
|
1122
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$j.call(source, prop))
|
|
1123
|
+
target[prop] = source[prop];
|
|
1124
|
+
}
|
|
1125
|
+
return target;
|
|
1126
|
+
};
|
|
1127
|
+
const INPUT_INTERACTION_VARIANTS = ["focused", "hovered"];
|
|
1128
|
+
const { interactionVariants: interactionVariants$5 } = pickAriaComponentVariants(
|
|
1129
|
+
INPUT_INTERACTION_VARIANTS
|
|
1130
|
+
);
|
|
1131
|
+
function BaseInput(props) {
|
|
1132
|
+
const _a = props, { updateInteractionVariant } = _a, rest = __objRest$d(_a, ["updateInteractionVariant"]);
|
|
1133
|
+
return /* @__PURE__ */ React__default.default.createElement(
|
|
1134
|
+
reactAriaComponents.Input,
|
|
1135
|
+
__spreadValues$j({
|
|
1136
|
+
onHoverChange: (isHovered) => {
|
|
1137
|
+
updateInteractionVariant == null ? void 0 : updateInteractionVariant({
|
|
1138
|
+
hovered: isHovered
|
|
1139
|
+
});
|
|
1140
|
+
},
|
|
1141
|
+
onFocus: () => {
|
|
1142
|
+
updateInteractionVariant == null ? void 0 : updateInteractionVariant({
|
|
1143
|
+
focused: true
|
|
1144
|
+
});
|
|
1145
|
+
},
|
|
1146
|
+
onBlur: () => {
|
|
1147
|
+
updateInteractionVariant == null ? void 0 : updateInteractionVariant({
|
|
1148
|
+
focused: false
|
|
1149
|
+
});
|
|
1150
|
+
}
|
|
1151
|
+
}, rest)
|
|
1152
|
+
);
|
|
1153
|
+
}
|
|
1154
|
+
const INPUT_COMPONENT_NAME = makeComponentName("input");
|
|
1155
|
+
function registerInput(loader, overrides) {
|
|
1156
|
+
registerComponentHelper(
|
|
1157
|
+
loader,
|
|
1158
|
+
BaseInput,
|
|
1159
|
+
{
|
|
1160
|
+
name: INPUT_COMPONENT_NAME,
|
|
1161
|
+
displayName: "Aria Input",
|
|
1162
|
+
importPath: "@plasmicpkgs/react-aria/skinny/registerInput",
|
|
1163
|
+
importName: "BaseInput",
|
|
1164
|
+
interactionVariants: interactionVariants$5,
|
|
1165
|
+
defaultStyles: {
|
|
1166
|
+
width: "300px",
|
|
1167
|
+
borderWidth: "1px",
|
|
1168
|
+
borderStyle: "solid",
|
|
1169
|
+
borderColor: "black",
|
|
1170
|
+
padding: "2px 10px"
|
|
1171
|
+
},
|
|
1172
|
+
props: {
|
|
1173
|
+
placeholder: {
|
|
1174
|
+
type: "string"
|
|
1175
|
+
}
|
|
1176
|
+
},
|
|
1177
|
+
trapsFocus: true
|
|
1178
|
+
},
|
|
1179
|
+
overrides
|
|
1180
|
+
);
|
|
1181
|
+
}
|
|
1182
|
+
|
|
906
1183
|
var __defProp$i = Object.defineProperty;
|
|
907
|
-
var __defProps$
|
|
908
|
-
var __getOwnPropDescs$
|
|
1184
|
+
var __defProps$9 = Object.defineProperties;
|
|
1185
|
+
var __getOwnPropDescs$9 = Object.getOwnPropertyDescriptors;
|
|
909
1186
|
var __getOwnPropSymbols$i = Object.getOwnPropertySymbols;
|
|
910
1187
|
var __hasOwnProp$i = Object.prototype.hasOwnProperty;
|
|
911
1188
|
var __propIsEnum$i = Object.prototype.propertyIsEnumerable;
|
|
@@ -921,256 +1198,68 @@ var __spreadValues$i = (a, b) => {
|
|
|
921
1198
|
}
|
|
922
1199
|
return a;
|
|
923
1200
|
};
|
|
924
|
-
var __spreadProps$
|
|
925
|
-
function
|
|
926
|
-
const
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
1201
|
+
var __spreadProps$9 = (a, b) => __defProps$9(a, __getOwnPropDescs$9(b));
|
|
1202
|
+
function BaseListBoxItem(props) {
|
|
1203
|
+
const contextProps = React__default.default.useContext(PlasmicItemContext);
|
|
1204
|
+
const mergedProps = utils.mergeProps(contextProps, props);
|
|
1205
|
+
return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.ListBoxItem, __spreadProps$9(__spreadValues$i({}, mergedProps), { textValue: contextProps.label }), mergedProps.children);
|
|
1206
|
+
}
|
|
1207
|
+
const makeDefaultListBoxItemChildren = (label, description) => ({
|
|
1208
|
+
type: "vbox",
|
|
1209
|
+
styles: {
|
|
1210
|
+
display: "flex",
|
|
1211
|
+
alignItems: "flex-start",
|
|
1212
|
+
gap: "2px"
|
|
1213
|
+
},
|
|
1214
|
+
children: [
|
|
1215
|
+
{
|
|
1216
|
+
type: "component",
|
|
1217
|
+
name: TEXT_COMPONENT_NAME,
|
|
1218
|
+
props: {
|
|
1219
|
+
slot: "label",
|
|
1220
|
+
children: {
|
|
1221
|
+
type: "text",
|
|
1222
|
+
styles: {
|
|
1223
|
+
fontWeight: 500
|
|
1224
|
+
},
|
|
1225
|
+
value: label
|
|
1226
|
+
}
|
|
1227
|
+
}
|
|
1228
|
+
},
|
|
1229
|
+
{
|
|
1230
|
+
type: "component",
|
|
1231
|
+
name: DESCRIPTION_COMPONENT_NAME,
|
|
1232
|
+
props: {
|
|
1233
|
+
children: {
|
|
1234
|
+
type: "text",
|
|
1235
|
+
styles: {
|
|
1236
|
+
color: "#838383"
|
|
1237
|
+
},
|
|
1238
|
+
value: description != null ? description : `Some description for ${label}...`
|
|
1239
|
+
}
|
|
1240
|
+
}
|
|
952
1241
|
}
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
);
|
|
969
|
-
};
|
|
970
|
-
return filterOptions(options);
|
|
971
|
-
}, [filterValue, options, contains, optionText]);
|
|
972
|
-
const flattenedOptions = React__default.default.useMemo(
|
|
973
|
-
() => flattenOptions(options),
|
|
974
|
-
[options]
|
|
975
|
-
);
|
|
976
|
-
const disabledKeys = flattenedOptions.filter((op) => op.isDisabled).map((op) => op.id);
|
|
977
|
-
const onSelectionChange = React__default.default.useCallback(
|
|
978
|
-
(key) => {
|
|
979
|
-
if (key === null) {
|
|
980
|
-
return;
|
|
981
|
-
}
|
|
982
|
-
const selectedOption = flattenedOptions == null ? void 0 : flattenedOptions.find((op) => op.id === key);
|
|
983
|
-
if (valueType === "text") {
|
|
984
|
-
if (selectedOption) {
|
|
985
|
-
onChange == null ? void 0 : onChange(optionText(selectedOption));
|
|
986
|
-
}
|
|
987
|
-
} else {
|
|
988
|
-
onChange == null ? void 0 : onChange(key);
|
|
989
|
-
}
|
|
990
|
-
if (selectedOption) {
|
|
991
|
-
onFilterValueChange == null ? void 0 : onFilterValueChange(optionText(selectedOption));
|
|
992
|
-
}
|
|
993
|
-
},
|
|
994
|
-
[flattenedOptions, valueType, onChange, optionText, onFilterValueChange]
|
|
995
|
-
);
|
|
996
|
-
const onInputValueChange = React__default.default.useCallback(
|
|
997
|
-
(newValue) => {
|
|
998
|
-
onFilterValueChange == null ? void 0 : onFilterValueChange(newValue);
|
|
999
|
-
setShowAllOptions(false);
|
|
1000
|
-
if (valueType === "text") {
|
|
1001
|
-
if (allowsCustomValue) {
|
|
1002
|
-
onChange == null ? void 0 : onChange(newValue);
|
|
1003
|
-
} else {
|
|
1004
|
-
const matchingOption = flattenedOptions == null ? void 0 : flattenedOptions.find(
|
|
1005
|
-
(op) => optionText(op) === newValue
|
|
1006
|
-
);
|
|
1007
|
-
if (matchingOption) {
|
|
1008
|
-
onChange == null ? void 0 : onChange(optionText(matchingOption));
|
|
1009
|
-
}
|
|
1242
|
+
]
|
|
1243
|
+
});
|
|
1244
|
+
function registerListBoxItem(loader, overrides) {
|
|
1245
|
+
return registerComponentHelper(
|
|
1246
|
+
loader,
|
|
1247
|
+
BaseListBoxItem,
|
|
1248
|
+
{
|
|
1249
|
+
name: makeComponentName("item"),
|
|
1250
|
+
displayName: "Aria ListBoxItem",
|
|
1251
|
+
importPath: "@plasmicpkgs/react-aria/skinny/registerListBoxItem",
|
|
1252
|
+
importName: "BaseListBoxItem",
|
|
1253
|
+
props: {
|
|
1254
|
+
children: {
|
|
1255
|
+
type: "slot",
|
|
1256
|
+
defaultValue: makeDefaultListBoxItemChildren("Item")
|
|
1010
1257
|
}
|
|
1011
1258
|
}
|
|
1012
1259
|
},
|
|
1013
|
-
|
|
1014
|
-
onFilterValueChange,
|
|
1015
|
-
onChange,
|
|
1016
|
-
flattenedOptions,
|
|
1017
|
-
optionText,
|
|
1018
|
-
valueType,
|
|
1019
|
-
allowsCustomValue
|
|
1020
|
-
]
|
|
1021
|
-
);
|
|
1022
|
-
const onBlur = React__default.default.useCallback(() => {
|
|
1023
|
-
if (!allowsCustomValue) {
|
|
1024
|
-
const selectedOption = flattenedOptions == null ? void 0 : flattenedOptions.find(
|
|
1025
|
-
(op) => valueType === "text" ? optionText(op) === value : op.id === value
|
|
1026
|
-
);
|
|
1027
|
-
if (selectedOption) {
|
|
1028
|
-
const selectedOptionText = optionText(selectedOption);
|
|
1029
|
-
if (selectedOptionText !== filterValue) {
|
|
1030
|
-
onFilterValueChange == null ? void 0 : onFilterValueChange(selectedOptionText);
|
|
1031
|
-
}
|
|
1032
|
-
}
|
|
1033
|
-
}
|
|
1034
|
-
}, [
|
|
1035
|
-
allowsCustomValue,
|
|
1036
|
-
flattenedOptions,
|
|
1037
|
-
valueType,
|
|
1038
|
-
optionText,
|
|
1039
|
-
value,
|
|
1040
|
-
filterValue,
|
|
1041
|
-
onFilterValueChange
|
|
1042
|
-
]);
|
|
1043
|
-
return /* @__PURE__ */ React__default.default.createElement(
|
|
1044
|
-
reactAriaComponents.ComboBox,
|
|
1045
|
-
__spreadValues$i({
|
|
1046
|
-
selectedKey: value,
|
|
1047
|
-
onSelectionChange,
|
|
1048
|
-
isDisabled,
|
|
1049
|
-
className,
|
|
1050
|
-
style,
|
|
1051
|
-
items: showAllOptions ? options : filteredOptions,
|
|
1052
|
-
menuTrigger,
|
|
1053
|
-
inputValue: filterValue,
|
|
1054
|
-
onInputChange: onInputValueChange,
|
|
1055
|
-
allowsCustomValue,
|
|
1056
|
-
disabledKeys,
|
|
1057
|
-
onOpenChange: (isOpen, trigger) => {
|
|
1058
|
-
if (isOpen && trigger === "manual") {
|
|
1059
|
-
setShowAllOptions(true);
|
|
1060
|
-
} else {
|
|
1061
|
-
setShowAllOptions(false);
|
|
1062
|
-
}
|
|
1063
|
-
onOpenChange == null ? void 0 : onOpenChange(isOpen);
|
|
1064
|
-
},
|
|
1065
|
-
onBlur,
|
|
1066
|
-
formValue: valueType === "text" ? "text" : "key",
|
|
1067
|
-
name
|
|
1068
|
-
}, extractPlasmicDataProps(props)),
|
|
1069
|
-
/* @__PURE__ */ React__default.default.createElement(
|
|
1070
|
-
PlasmicListBoxContext.Provider,
|
|
1071
|
-
{
|
|
1072
|
-
value: {
|
|
1073
|
-
getItemType: (option) => option.type === "section" ? "section" : "item"
|
|
1074
|
-
}
|
|
1075
|
-
},
|
|
1076
|
-
/* @__PURE__ */ React__default.default.createElement(PlasmicInputContext.Provider, { value: { placeholder } }, structure)
|
|
1077
|
-
),
|
|
1078
|
-
/* @__PURE__ */ React__default.default.createElement(BaseComboBoxEffects, { previewOpen })
|
|
1260
|
+
overrides
|
|
1079
1261
|
);
|
|
1080
1262
|
}
|
|
1081
|
-
function BaseComboBoxEffects(props) {
|
|
1082
|
-
const { previewOpen } = props;
|
|
1083
|
-
const comboBoxState = React__default.default.useContext(reactAriaComponents.ComboBoxStateContext);
|
|
1084
|
-
const prevPreviewOpenRef = React__default.default.useRef(previewOpen);
|
|
1085
|
-
React__default.default.useEffect(() => {
|
|
1086
|
-
if (comboBoxState) {
|
|
1087
|
-
if (previewOpen) {
|
|
1088
|
-
comboBoxState.open(void 0, "manual");
|
|
1089
|
-
} else if (prevPreviewOpenRef.current) {
|
|
1090
|
-
comboBoxState.close();
|
|
1091
|
-
}
|
|
1092
|
-
}
|
|
1093
|
-
prevPreviewOpenRef.current = previewOpen;
|
|
1094
|
-
}, [previewOpen, comboBoxState, prevPreviewOpenRef]);
|
|
1095
|
-
return null;
|
|
1096
|
-
}
|
|
1097
|
-
function registerComboBox(loader) {
|
|
1098
|
-
const rootName = makeComponentName("combobox");
|
|
1099
|
-
registerComponentHelper(loader, BaseComboBox, {
|
|
1100
|
-
name: rootName,
|
|
1101
|
-
displayName: "Aria ComboBox",
|
|
1102
|
-
importPath: "@plasmicpkgs/react-aria/skinny/registerComboBox",
|
|
1103
|
-
importName: "BaseComboBox",
|
|
1104
|
-
props: {
|
|
1105
|
-
options: makeOptionsPropType(),
|
|
1106
|
-
value: makeValuePropType(),
|
|
1107
|
-
onChange: {
|
|
1108
|
-
type: "eventHandler",
|
|
1109
|
-
argTypes: [{ name: "value", type: "string" }]
|
|
1110
|
-
},
|
|
1111
|
-
filterValue: {
|
|
1112
|
-
type: "string"
|
|
1113
|
-
},
|
|
1114
|
-
onFilterValueChange: {
|
|
1115
|
-
type: "eventHandler",
|
|
1116
|
-
argTypes: [{ name: "value", type: "string" }]
|
|
1117
|
-
},
|
|
1118
|
-
isDisabled: {
|
|
1119
|
-
type: "boolean"
|
|
1120
|
-
},
|
|
1121
|
-
valueType: {
|
|
1122
|
-
displayName: "`value` Type",
|
|
1123
|
-
type: "choice",
|
|
1124
|
-
options: [
|
|
1125
|
-
{ value: "value", label: "By option value" },
|
|
1126
|
-
{ value: "text", label: "By option text" }
|
|
1127
|
-
],
|
|
1128
|
-
defaultValueHint: "value",
|
|
1129
|
-
description: "This controls whether `value` and `onChange` are option values or option text. Choosing `text` allows you to optionally allow a custom value that's not in the provided list of options.",
|
|
1130
|
-
advanced: true
|
|
1131
|
-
},
|
|
1132
|
-
allowsCustomValue: {
|
|
1133
|
-
type: "boolean",
|
|
1134
|
-
displayName: "Allows custom value?",
|
|
1135
|
-
description: "Allows entering a value that is not one of the options",
|
|
1136
|
-
hidden: (ps) => ps.valueType !== "text",
|
|
1137
|
-
advanced: true
|
|
1138
|
-
},
|
|
1139
|
-
onOpenChange: {
|
|
1140
|
-
type: "eventHandler",
|
|
1141
|
-
argTypes: [{ name: "isOpen", type: "boolean" }]
|
|
1142
|
-
},
|
|
1143
|
-
structure: {
|
|
1144
|
-
type: "slot"
|
|
1145
|
-
},
|
|
1146
|
-
previewOpen: {
|
|
1147
|
-
type: "boolean",
|
|
1148
|
-
displayName: "Preview opened?",
|
|
1149
|
-
description: "Preview opened state while designing in Plasmic editor",
|
|
1150
|
-
editOnly: true
|
|
1151
|
-
}
|
|
1152
|
-
},
|
|
1153
|
-
states: {
|
|
1154
|
-
value: {
|
|
1155
|
-
type: "writable",
|
|
1156
|
-
valueProp: "value",
|
|
1157
|
-
onChangeProp: "onChange",
|
|
1158
|
-
variableType: "text"
|
|
1159
|
-
},
|
|
1160
|
-
filterValue: {
|
|
1161
|
-
type: "writable",
|
|
1162
|
-
valueProp: "filterValue",
|
|
1163
|
-
onChangeProp: "onFilterValueChange",
|
|
1164
|
-
variableType: "text"
|
|
1165
|
-
},
|
|
1166
|
-
isOpen: {
|
|
1167
|
-
type: "readonly",
|
|
1168
|
-
onChangeProp: "onOpenChange",
|
|
1169
|
-
variableType: "boolean"
|
|
1170
|
-
}
|
|
1171
|
-
}
|
|
1172
|
-
});
|
|
1173
|
-
}
|
|
1174
1263
|
|
|
1175
1264
|
var __defProp$h = Object.defineProperty;
|
|
1176
1265
|
var __getOwnPropSymbols$h = Object.getOwnPropertySymbols;
|
|
@@ -1188,59 +1277,24 @@ var __spreadValues$h = (a, b) => {
|
|
|
1188
1277
|
}
|
|
1189
1278
|
return a;
|
|
1190
1279
|
};
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
if (__hasOwnProp$h.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
1195
|
-
target[prop] = source[prop];
|
|
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))
|
|
1199
|
-
target[prop] = source[prop];
|
|
1200
|
-
}
|
|
1201
|
-
return target;
|
|
1202
|
-
};
|
|
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);
|
|
1280
|
+
function BaseHeader(props) {
|
|
1281
|
+
const contextProps = React__default.default.useContext(PlasmicHeaderContext);
|
|
1282
|
+
return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Header, __spreadValues$h({}, utils.mergeProps(contextProps, props)));
|
|
1206
1283
|
}
|
|
1207
|
-
function
|
|
1208
|
-
registerComponentHelper(
|
|
1284
|
+
function registerHeader(loader, overrides) {
|
|
1285
|
+
return registerComponentHelper(
|
|
1209
1286
|
loader,
|
|
1210
|
-
|
|
1287
|
+
BaseHeader,
|
|
1211
1288
|
{
|
|
1212
|
-
name: makeComponentName("
|
|
1213
|
-
displayName: "Aria
|
|
1214
|
-
importPath: "@plasmicpkgs/react-aria/skinny/
|
|
1215
|
-
importName: "
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
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
|
-
}
|
|
1289
|
+
name: makeComponentName("header"),
|
|
1290
|
+
displayName: "Aria Header",
|
|
1291
|
+
importPath: "@plasmicpkgs/react-aria/skinny/registerHeader",
|
|
1292
|
+
importName: "BaseHeader",
|
|
1293
|
+
defaultStyles: {
|
|
1294
|
+
fontWeight: "bold",
|
|
1295
|
+
fontSize: "20px"
|
|
1242
1296
|
},
|
|
1243
|
-
|
|
1297
|
+
props: {}
|
|
1244
1298
|
},
|
|
1245
1299
|
overrides
|
|
1246
1300
|
);
|
|
@@ -1262,73 +1316,53 @@ var __spreadValues$g = (a, b) => {
|
|
|
1262
1316
|
}
|
|
1263
1317
|
return a;
|
|
1264
1318
|
};
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
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
|
-
);
|
|
1319
|
+
function BaseSection(props) {
|
|
1320
|
+
const contextProps = React__default.default.useContext(PlasmicSectionContext);
|
|
1321
|
+
const mergedProps = utils.mergeProps(contextProps, props);
|
|
1322
|
+
const { section, renderHeader, key, renderItem } = mergedProps;
|
|
1323
|
+
return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Section, __spreadValues$g({ id: key }, mergedProps), /* @__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) => {
|
|
1324
|
+
return /* @__PURE__ */ React__default.default.createElement(PlasmicItemContext.Provider, { value: item }, renderItem == null ? void 0 : renderItem(item));
|
|
1325
|
+
}));
|
|
1302
1326
|
}
|
|
1303
|
-
function
|
|
1304
|
-
|
|
1327
|
+
function registerSection(loader, overrides) {
|
|
1328
|
+
const thisName = makeChildComponentName(
|
|
1329
|
+
overrides == null ? void 0 : overrides.parentComponentName,
|
|
1330
|
+
makeComponentName("section")
|
|
1331
|
+
);
|
|
1332
|
+
const headerMeta = registerHeader(loader, {
|
|
1333
|
+
parentComponentName: thisName
|
|
1334
|
+
});
|
|
1335
|
+
return registerComponentHelper(
|
|
1305
1336
|
loader,
|
|
1306
|
-
|
|
1337
|
+
BaseSection,
|
|
1307
1338
|
{
|
|
1308
|
-
name: makeComponentName("
|
|
1309
|
-
displayName: "Aria
|
|
1310
|
-
importPath: "@plasmicpkgs/react-aria/skinny/
|
|
1311
|
-
importName: "
|
|
1339
|
+
name: makeComponentName("section"),
|
|
1340
|
+
displayName: "Aria Section",
|
|
1341
|
+
importPath: "@plasmicpkgs/react-aria/skinny/registerSection",
|
|
1342
|
+
importName: "BaseSection",
|
|
1343
|
+
defaultStyles: {
|
|
1344
|
+
width: "stretch",
|
|
1345
|
+
padding: "10px"
|
|
1346
|
+
},
|
|
1312
1347
|
props: {
|
|
1313
|
-
|
|
1314
|
-
type: "slot"
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
type: "eventHandler",
|
|
1322
|
-
argTypes: []
|
|
1348
|
+
renderHeader: {
|
|
1349
|
+
type: "slot",
|
|
1350
|
+
displayName: "Render section header",
|
|
1351
|
+
renderPropParams: ["sectionProps"],
|
|
1352
|
+
defaultValue: {
|
|
1353
|
+
type: "component",
|
|
1354
|
+
name: headerMeta.name
|
|
1355
|
+
}
|
|
1323
1356
|
}
|
|
1324
|
-
}
|
|
1325
|
-
trapsFocus: true
|
|
1357
|
+
}
|
|
1326
1358
|
},
|
|
1327
1359
|
overrides
|
|
1328
1360
|
);
|
|
1329
1361
|
}
|
|
1330
1362
|
|
|
1331
1363
|
var __defProp$f = Object.defineProperty;
|
|
1364
|
+
var __defProps$8 = Object.defineProperties;
|
|
1365
|
+
var __getOwnPropDescs$8 = Object.getOwnPropertyDescriptors;
|
|
1332
1366
|
var __getOwnPropSymbols$f = Object.getOwnPropertySymbols;
|
|
1333
1367
|
var __hasOwnProp$f = Object.prototype.hasOwnProperty;
|
|
1334
1368
|
var __propIsEnum$f = Object.prototype.propertyIsEnumerable;
|
|
@@ -1344,7 +1378,8 @@ var __spreadValues$f = (a, b) => {
|
|
|
1344
1378
|
}
|
|
1345
1379
|
return a;
|
|
1346
1380
|
};
|
|
1347
|
-
var
|
|
1381
|
+
var __spreadProps$8 = (a, b) => __defProps$8(a, __getOwnPropDescs$8(b));
|
|
1382
|
+
var __objRest$c = (source, exclude) => {
|
|
1348
1383
|
var target = {};
|
|
1349
1384
|
for (var prop in source)
|
|
1350
1385
|
if (__hasOwnProp$f.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
@@ -1356,140 +1391,21 @@ var __objRest$b = (source, exclude) => {
|
|
|
1356
1391
|
}
|
|
1357
1392
|
return target;
|
|
1358
1393
|
};
|
|
1359
|
-
const INPUT_INTERACTION_VARIANTS = ["focused", "hovered"];
|
|
1360
|
-
const { interactionVariants: interactionVariants$5 } = pickAriaComponentVariants(
|
|
1361
|
-
INPUT_INTERACTION_VARIANTS
|
|
1362
|
-
);
|
|
1363
|
-
function BaseInput(props) {
|
|
1364
|
-
const _a = props, { updateInteractionVariant } = _a, rest = __objRest$b(_a, ["updateInteractionVariant"]);
|
|
1365
|
-
return /* @__PURE__ */ React__default.default.createElement(
|
|
1366
|
-
reactAriaComponents.Input,
|
|
1367
|
-
__spreadValues$f({
|
|
1368
|
-
onHoverChange: (isHovered) => {
|
|
1369
|
-
updateInteractionVariant == null ? void 0 : updateInteractionVariant({
|
|
1370
|
-
hovered: isHovered
|
|
1371
|
-
});
|
|
1372
|
-
},
|
|
1373
|
-
onFocus: () => {
|
|
1374
|
-
updateInteractionVariant == null ? void 0 : updateInteractionVariant({
|
|
1375
|
-
focused: true
|
|
1376
|
-
});
|
|
1377
|
-
},
|
|
1378
|
-
onBlur: () => {
|
|
1379
|
-
updateInteractionVariant == null ? void 0 : updateInteractionVariant({
|
|
1380
|
-
focused: false
|
|
1381
|
-
});
|
|
1382
|
-
}
|
|
1383
|
-
}, rest)
|
|
1384
|
-
);
|
|
1385
|
-
}
|
|
1386
|
-
function registerInput(loader, overrides) {
|
|
1387
|
-
registerComponentHelper(
|
|
1388
|
-
loader,
|
|
1389
|
-
BaseInput,
|
|
1390
|
-
{
|
|
1391
|
-
name: makeComponentName("input"),
|
|
1392
|
-
displayName: "Aria Input",
|
|
1393
|
-
importPath: "@plasmicpkgs/react-aria/skinny/registerInput",
|
|
1394
|
-
importName: "BaseInput",
|
|
1395
|
-
interactionVariants: interactionVariants$5,
|
|
1396
|
-
props: {
|
|
1397
|
-
placeholder: {
|
|
1398
|
-
type: "string"
|
|
1399
|
-
}
|
|
1400
|
-
},
|
|
1401
|
-
trapsFocus: true
|
|
1402
|
-
},
|
|
1403
|
-
overrides
|
|
1404
|
-
);
|
|
1405
|
-
}
|
|
1406
|
-
|
|
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) => {
|
|
1413
|
-
for (var prop in b || (b = {}))
|
|
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]);
|
|
1420
|
-
}
|
|
1421
|
-
return a;
|
|
1422
|
-
};
|
|
1423
|
-
function BaseListBoxItem(props) {
|
|
1424
|
-
const contextProps = React__default.default.useContext(PlasmicItemContext);
|
|
1425
|
-
const mergedProps = utils.mergeProps(contextProps, props);
|
|
1426
|
-
return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.ListBoxItem, __spreadValues$e({}, mergedProps), mergedProps.children);
|
|
1427
|
-
}
|
|
1428
|
-
function registerListBoxItem(loader, overrides) {
|
|
1429
|
-
registerComponentHelper(
|
|
1430
|
-
loader,
|
|
1431
|
-
BaseListBoxItem,
|
|
1432
|
-
{
|
|
1433
|
-
name: makeComponentName("item"),
|
|
1434
|
-
displayName: "Aria ListBoxItem",
|
|
1435
|
-
importPath: "@plasmicpkgs/react-aria/skinny/registerListBoxItem",
|
|
1436
|
-
importName: "BaseListBoxItem",
|
|
1437
|
-
props: {
|
|
1438
|
-
children: {
|
|
1439
|
-
type: "slot"
|
|
1440
|
-
}
|
|
1441
|
-
}
|
|
1442
|
-
},
|
|
1443
|
-
overrides
|
|
1444
|
-
);
|
|
1445
|
-
}
|
|
1446
|
-
|
|
1447
|
-
var __defProp$d = Object.defineProperty;
|
|
1448
|
-
var __defProps$7 = Object.defineProperties;
|
|
1449
|
-
var __getOwnPropDescs$7 = Object.getOwnPropertyDescriptors;
|
|
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) => {
|
|
1455
|
-
for (var prop in b || (b = {}))
|
|
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]);
|
|
1462
|
-
}
|
|
1463
|
-
return a;
|
|
1464
|
-
};
|
|
1465
|
-
var __spreadProps$7 = (a, b) => __defProps$7(a, __getOwnPropDescs$7(b));
|
|
1466
|
-
var __objRest$a = (source, exclude) => {
|
|
1467
|
-
var target = {};
|
|
1468
|
-
for (var prop in source)
|
|
1469
|
-
if (__hasOwnProp$d.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
1470
|
-
target[prop] = source[prop];
|
|
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))
|
|
1474
|
-
target[prop] = source[prop];
|
|
1475
|
-
}
|
|
1476
|
-
return target;
|
|
1477
|
-
};
|
|
1478
1394
|
function BaseListBox(props) {
|
|
1479
1395
|
var _c;
|
|
1480
1396
|
const contextProps = React__default.default.useContext(PlasmicListBoxContext);
|
|
1481
1397
|
const isStandalone = !contextProps;
|
|
1482
|
-
const _a = props, rest = __objRest$
|
|
1398
|
+
const _a = props, rest = __objRest$c(_a, ["options"]);
|
|
1483
1399
|
const { options } = useStrictOptions(props);
|
|
1484
1400
|
const _b = utils.mergeProps(
|
|
1485
1401
|
contextProps,
|
|
1486
1402
|
rest,
|
|
1487
1403
|
isStandalone ? { items: options } : {}
|
|
1488
|
-
), { renderItem, renderSection } = _b, mergedProps = __objRest$
|
|
1404
|
+
), { renderItem, renderSection } = _b, mergedProps = __objRest$c(_b, ["renderItem", "renderSection"]);
|
|
1489
1405
|
(_c = props.setControlContextData) == null ? void 0 : _c.call(props, {
|
|
1490
1406
|
isStandalone
|
|
1491
1407
|
});
|
|
1492
|
-
return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.ListBox, __spreadValues$
|
|
1408
|
+
return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.ListBox, __spreadValues$f({}, mergedProps), (item) => {
|
|
1493
1409
|
var _a2;
|
|
1494
1410
|
if (item.type === "option-group") {
|
|
1495
1411
|
return /* @__PURE__ */ React__default.default.createElement(React__default.default.Fragment, null, /* @__PURE__ */ React__default.default.createElement(
|
|
@@ -1508,36 +1424,559 @@ function BaseListBox(props) {
|
|
|
1508
1424
|
}
|
|
1509
1425
|
});
|
|
1510
1426
|
}
|
|
1427
|
+
const LIST_BOX_COMPONENT_NAME = makeComponentName("listbox");
|
|
1511
1428
|
function registerListBox(loader, overrides) {
|
|
1429
|
+
const listBoxItemMeta = registerListBoxItem(loader, {
|
|
1430
|
+
parentComponentName: LIST_BOX_COMPONENT_NAME
|
|
1431
|
+
});
|
|
1432
|
+
const sectionMeta = registerSection(loader, {
|
|
1433
|
+
parentComponentName: LIST_BOX_COMPONENT_NAME
|
|
1434
|
+
});
|
|
1512
1435
|
registerComponentHelper(
|
|
1513
1436
|
loader,
|
|
1514
1437
|
BaseListBox,
|
|
1515
1438
|
{
|
|
1516
|
-
name:
|
|
1439
|
+
name: LIST_BOX_COMPONENT_NAME,
|
|
1517
1440
|
displayName: "Aria ListBox",
|
|
1518
1441
|
importPath: "@plasmicpkgs/react-aria/skinny/registerListBox",
|
|
1519
1442
|
importName: "BaseListBox",
|
|
1443
|
+
defaultStyles: {
|
|
1444
|
+
width: "250px",
|
|
1445
|
+
borderWidth: "1px",
|
|
1446
|
+
borderStyle: "solid",
|
|
1447
|
+
borderColor: "black"
|
|
1448
|
+
},
|
|
1520
1449
|
props: {
|
|
1521
|
-
options: __spreadProps$
|
|
1450
|
+
options: __spreadProps$8(__spreadValues$f({}, makeOptionsPropType()), {
|
|
1522
1451
|
displayName: "Items",
|
|
1523
1452
|
hidden: (_ps, ctx) => !(ctx == null ? void 0 : ctx.isStandalone)
|
|
1524
1453
|
}),
|
|
1525
1454
|
renderItem: {
|
|
1526
1455
|
type: "slot",
|
|
1527
1456
|
displayName: "Render Item",
|
|
1528
|
-
renderPropParams: ["itemProps"]
|
|
1457
|
+
renderPropParams: ["itemProps"],
|
|
1458
|
+
defaultValue: {
|
|
1459
|
+
type: "component",
|
|
1460
|
+
name: listBoxItemMeta.name,
|
|
1461
|
+
props: {
|
|
1462
|
+
children: makeDefaultListBoxItemChildren(
|
|
1463
|
+
"Item (itemProps.label)",
|
|
1464
|
+
"Connect with `itemProps` in the data picker to display list box items"
|
|
1465
|
+
)
|
|
1466
|
+
}
|
|
1467
|
+
}
|
|
1529
1468
|
},
|
|
1530
1469
|
renderSection: {
|
|
1531
1470
|
type: "slot",
|
|
1532
1471
|
displayName: "Render Section",
|
|
1533
|
-
renderPropParams: ["sectionProps"]
|
|
1472
|
+
renderPropParams: ["sectionProps"],
|
|
1473
|
+
defaultValue: {
|
|
1474
|
+
type: "component",
|
|
1475
|
+
name: sectionMeta.name,
|
|
1476
|
+
styles: {
|
|
1477
|
+
backgroundColor: "#F4FAFF"
|
|
1478
|
+
}
|
|
1479
|
+
}
|
|
1534
1480
|
}
|
|
1535
1481
|
}
|
|
1536
|
-
},
|
|
1537
|
-
overrides
|
|
1538
|
-
);
|
|
1539
|
-
|
|
1540
|
-
|
|
1482
|
+
},
|
|
1483
|
+
overrides
|
|
1484
|
+
);
|
|
1485
|
+
}
|
|
1486
|
+
|
|
1487
|
+
var __defProp$e = Object.defineProperty;
|
|
1488
|
+
var __getOwnPropSymbols$e = Object.getOwnPropertySymbols;
|
|
1489
|
+
var __hasOwnProp$e = Object.prototype.hasOwnProperty;
|
|
1490
|
+
var __propIsEnum$e = Object.prototype.propertyIsEnumerable;
|
|
1491
|
+
var __defNormalProp$e = (obj, key, value) => key in obj ? __defProp$e(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1492
|
+
var __spreadValues$e = (a, b) => {
|
|
1493
|
+
for (var prop in b || (b = {}))
|
|
1494
|
+
if (__hasOwnProp$e.call(b, prop))
|
|
1495
|
+
__defNormalProp$e(a, prop, b[prop]);
|
|
1496
|
+
if (__getOwnPropSymbols$e)
|
|
1497
|
+
for (var prop of __getOwnPropSymbols$e(b)) {
|
|
1498
|
+
if (__propIsEnum$e.call(b, prop))
|
|
1499
|
+
__defNormalProp$e(a, prop, b[prop]);
|
|
1500
|
+
}
|
|
1501
|
+
return a;
|
|
1502
|
+
};
|
|
1503
|
+
var __objRest$b = (source, exclude) => {
|
|
1504
|
+
var target = {};
|
|
1505
|
+
for (var prop in source)
|
|
1506
|
+
if (__hasOwnProp$e.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
1507
|
+
target[prop] = source[prop];
|
|
1508
|
+
if (source != null && __getOwnPropSymbols$e)
|
|
1509
|
+
for (var prop of __getOwnPropSymbols$e(source)) {
|
|
1510
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$e.call(source, prop))
|
|
1511
|
+
target[prop] = source[prop];
|
|
1512
|
+
}
|
|
1513
|
+
return target;
|
|
1514
|
+
};
|
|
1515
|
+
function BasePopover(props) {
|
|
1516
|
+
const _a = props, { resetClassName } = _a, restProps = __objRest$b(_a, ["resetClassName"]);
|
|
1517
|
+
const isStandalone = !React__default.default.useContext(reactAriaComponents.PopoverContext);
|
|
1518
|
+
const contextProps = React__default.default.useContext(PlasmicPopoverContext);
|
|
1519
|
+
const mergedProps = utils.mergeProps(contextProps, restProps, {
|
|
1520
|
+
className: `${resetClassName}`
|
|
1521
|
+
});
|
|
1522
|
+
const triggerRef = React__default.default.useRef(null);
|
|
1523
|
+
const standaloneProps = isStandalone ? {
|
|
1524
|
+
triggerRef,
|
|
1525
|
+
isNonModal: true,
|
|
1526
|
+
isOpen: true
|
|
1527
|
+
} : {};
|
|
1528
|
+
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$e(__spreadValues$e({}, mergedProps), standaloneProps)));
|
|
1529
|
+
}
|
|
1530
|
+
const POPOVER_COMPONENT_NAME = makeComponentName("popover");
|
|
1531
|
+
const POPOVER_ARROW_IMG = {
|
|
1532
|
+
type: "img",
|
|
1533
|
+
// TODO: Replace with the image of an arrow pointing up, like: https://icon-sets.iconify.design/mdi/triangle/
|
|
1534
|
+
src: "https://static1.plasmic.app/arrow-up.svg",
|
|
1535
|
+
styles: {
|
|
1536
|
+
position: "absolute",
|
|
1537
|
+
top: "-14px",
|
|
1538
|
+
// center the arrow horizontally on the popover
|
|
1539
|
+
left: "50%",
|
|
1540
|
+
transform: "translateX(-50%)",
|
|
1541
|
+
width: "15px"
|
|
1542
|
+
}
|
|
1543
|
+
};
|
|
1544
|
+
function registerPopover(loader, overrides) {
|
|
1545
|
+
registerComponentHelper(
|
|
1546
|
+
loader,
|
|
1547
|
+
BasePopover,
|
|
1548
|
+
{
|
|
1549
|
+
name: POPOVER_COMPONENT_NAME,
|
|
1550
|
+
displayName: "Aria Popover",
|
|
1551
|
+
importPath: "@plasmicpkgs/react-aria/skinny/registerPopover",
|
|
1552
|
+
importName: "BasePopover",
|
|
1553
|
+
defaultStyles: {
|
|
1554
|
+
borderWidth: "1px",
|
|
1555
|
+
borderStyle: "solid",
|
|
1556
|
+
borderColor: "black",
|
|
1557
|
+
padding: "20px",
|
|
1558
|
+
width: "300px",
|
|
1559
|
+
backgroundColor: "#FDE3C3"
|
|
1560
|
+
},
|
|
1561
|
+
props: {
|
|
1562
|
+
children: {
|
|
1563
|
+
type: "slot",
|
|
1564
|
+
defaultValue: [
|
|
1565
|
+
POPOVER_ARROW_IMG,
|
|
1566
|
+
{
|
|
1567
|
+
type: "vbox",
|
|
1568
|
+
styles: {
|
|
1569
|
+
width: "stretch",
|
|
1570
|
+
padding: 0,
|
|
1571
|
+
gap: "10px"
|
|
1572
|
+
},
|
|
1573
|
+
children: [
|
|
1574
|
+
{
|
|
1575
|
+
type: "text",
|
|
1576
|
+
value: "This is a Popover!"
|
|
1577
|
+
},
|
|
1578
|
+
{
|
|
1579
|
+
type: "text",
|
|
1580
|
+
value: "You can put anything you can imagine here!",
|
|
1581
|
+
styles: {
|
|
1582
|
+
fontWeight: 500
|
|
1583
|
+
}
|
|
1584
|
+
},
|
|
1585
|
+
{
|
|
1586
|
+
type: "text",
|
|
1587
|
+
value: "Use it in a `Aria Dialog Trigger` component to trigger it on a button click!"
|
|
1588
|
+
}
|
|
1589
|
+
]
|
|
1590
|
+
}
|
|
1591
|
+
]
|
|
1592
|
+
},
|
|
1593
|
+
offset: {
|
|
1594
|
+
type: "number",
|
|
1595
|
+
displayName: "Offset",
|
|
1596
|
+
description: "Additional offset applied vertically between the popover and its trigger",
|
|
1597
|
+
defaultValueHint: 0
|
|
1598
|
+
},
|
|
1599
|
+
placement: {
|
|
1600
|
+
type: "choice",
|
|
1601
|
+
description: "Default placement of the popover relative to the trigger, if there is enough space",
|
|
1602
|
+
options: [
|
|
1603
|
+
"bottom",
|
|
1604
|
+
"bottom left",
|
|
1605
|
+
"bottom right",
|
|
1606
|
+
"top",
|
|
1607
|
+
"top left",
|
|
1608
|
+
"top right"
|
|
1609
|
+
]
|
|
1610
|
+
},
|
|
1611
|
+
resetClassName: {
|
|
1612
|
+
type: "themeResetClass"
|
|
1613
|
+
}
|
|
1614
|
+
},
|
|
1615
|
+
styleSections: true
|
|
1616
|
+
},
|
|
1617
|
+
overrides
|
|
1618
|
+
);
|
|
1619
|
+
}
|
|
1620
|
+
|
|
1621
|
+
var __defProp$d = Object.defineProperty;
|
|
1622
|
+
var __defProps$7 = Object.defineProperties;
|
|
1623
|
+
var __getOwnPropDescs$7 = Object.getOwnPropertyDescriptors;
|
|
1624
|
+
var __getOwnPropSymbols$d = Object.getOwnPropertySymbols;
|
|
1625
|
+
var __hasOwnProp$d = Object.prototype.hasOwnProperty;
|
|
1626
|
+
var __propIsEnum$d = Object.prototype.propertyIsEnumerable;
|
|
1627
|
+
var __defNormalProp$d = (obj, key, value) => key in obj ? __defProp$d(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1628
|
+
var __spreadValues$d = (a, b) => {
|
|
1629
|
+
for (var prop in b || (b = {}))
|
|
1630
|
+
if (__hasOwnProp$d.call(b, prop))
|
|
1631
|
+
__defNormalProp$d(a, prop, b[prop]);
|
|
1632
|
+
if (__getOwnPropSymbols$d)
|
|
1633
|
+
for (var prop of __getOwnPropSymbols$d(b)) {
|
|
1634
|
+
if (__propIsEnum$d.call(b, prop))
|
|
1635
|
+
__defNormalProp$d(a, prop, b[prop]);
|
|
1636
|
+
}
|
|
1637
|
+
return a;
|
|
1638
|
+
};
|
|
1639
|
+
var __spreadProps$7 = (a, b) => __defProps$7(a, __getOwnPropDescs$7(b));
|
|
1640
|
+
function BaseComboBox(props) {
|
|
1641
|
+
const {
|
|
1642
|
+
value,
|
|
1643
|
+
onChange,
|
|
1644
|
+
menuTrigger,
|
|
1645
|
+
filterValue,
|
|
1646
|
+
onFilterValueChange,
|
|
1647
|
+
valueType,
|
|
1648
|
+
allowsCustomValue,
|
|
1649
|
+
placeholder,
|
|
1650
|
+
previewOpen,
|
|
1651
|
+
onOpenChange,
|
|
1652
|
+
isDisabled,
|
|
1653
|
+
className,
|
|
1654
|
+
style,
|
|
1655
|
+
structure,
|
|
1656
|
+
name
|
|
1657
|
+
} = props;
|
|
1658
|
+
const { options, optionText } = useStrictOptions(props);
|
|
1659
|
+
const { contains } = i18n.useFilter({ sensitivity: "base" });
|
|
1660
|
+
const [showAllOptions, setShowAllOptions] = React__default.default.useState(false);
|
|
1661
|
+
const filteredOptions = React__default.default.useMemo(() => {
|
|
1662
|
+
if (!filterValue || filterValue.trim().length === 0) {
|
|
1663
|
+
return options;
|
|
1664
|
+
}
|
|
1665
|
+
if (!options) {
|
|
1666
|
+
return options;
|
|
1667
|
+
}
|
|
1668
|
+
const filterOptions = (opts) => {
|
|
1669
|
+
return withoutNils(
|
|
1670
|
+
opts.map((op) => {
|
|
1671
|
+
if (op.type === "option-group") {
|
|
1672
|
+
return __spreadProps$7(__spreadValues$d({}, op), {
|
|
1673
|
+
items: op.items ? filterOptions(op.items) : void 0
|
|
1674
|
+
});
|
|
1675
|
+
} else {
|
|
1676
|
+
if (contains(optionText(op), filterValue)) {
|
|
1677
|
+
return op;
|
|
1678
|
+
} else {
|
|
1679
|
+
return void 0;
|
|
1680
|
+
}
|
|
1681
|
+
}
|
|
1682
|
+
})
|
|
1683
|
+
);
|
|
1684
|
+
};
|
|
1685
|
+
return filterOptions(options);
|
|
1686
|
+
}, [filterValue, options, contains, optionText]);
|
|
1687
|
+
const flattenedOptions = React__default.default.useMemo(
|
|
1688
|
+
() => flattenOptions(options),
|
|
1689
|
+
[options]
|
|
1690
|
+
);
|
|
1691
|
+
const disabledKeys = flattenedOptions.filter((op) => op.isDisabled).map((op) => op.id);
|
|
1692
|
+
const onSelectionChange = React__default.default.useCallback(
|
|
1693
|
+
(key) => {
|
|
1694
|
+
if (key === null) {
|
|
1695
|
+
return;
|
|
1696
|
+
}
|
|
1697
|
+
const selectedOption = flattenedOptions == null ? void 0 : flattenedOptions.find((op) => op.id === key);
|
|
1698
|
+
if (valueType === "text") {
|
|
1699
|
+
if (selectedOption) {
|
|
1700
|
+
onChange == null ? void 0 : onChange(optionText(selectedOption));
|
|
1701
|
+
}
|
|
1702
|
+
} else {
|
|
1703
|
+
onChange == null ? void 0 : onChange(key);
|
|
1704
|
+
}
|
|
1705
|
+
if (selectedOption) {
|
|
1706
|
+
onFilterValueChange == null ? void 0 : onFilterValueChange(optionText(selectedOption));
|
|
1707
|
+
}
|
|
1708
|
+
},
|
|
1709
|
+
[flattenedOptions, valueType, onChange, optionText, onFilterValueChange]
|
|
1710
|
+
);
|
|
1711
|
+
const onInputValueChange = React__default.default.useCallback(
|
|
1712
|
+
(newValue) => {
|
|
1713
|
+
onFilterValueChange == null ? void 0 : onFilterValueChange(newValue);
|
|
1714
|
+
setShowAllOptions(false);
|
|
1715
|
+
if (valueType === "text") {
|
|
1716
|
+
if (allowsCustomValue) {
|
|
1717
|
+
onChange == null ? void 0 : onChange(newValue);
|
|
1718
|
+
} else {
|
|
1719
|
+
const matchingOption = flattenedOptions == null ? void 0 : flattenedOptions.find(
|
|
1720
|
+
(op) => optionText(op) === newValue
|
|
1721
|
+
);
|
|
1722
|
+
if (matchingOption) {
|
|
1723
|
+
onChange == null ? void 0 : onChange(optionText(matchingOption));
|
|
1724
|
+
}
|
|
1725
|
+
}
|
|
1726
|
+
}
|
|
1727
|
+
},
|
|
1728
|
+
[
|
|
1729
|
+
onFilterValueChange,
|
|
1730
|
+
onChange,
|
|
1731
|
+
flattenedOptions,
|
|
1732
|
+
optionText,
|
|
1733
|
+
valueType,
|
|
1734
|
+
allowsCustomValue
|
|
1735
|
+
]
|
|
1736
|
+
);
|
|
1737
|
+
const onBlur = React__default.default.useCallback(() => {
|
|
1738
|
+
if (!allowsCustomValue) {
|
|
1739
|
+
const selectedOption = flattenedOptions == null ? void 0 : flattenedOptions.find(
|
|
1740
|
+
(op) => valueType === "text" ? optionText(op) === value : op.id === value
|
|
1741
|
+
);
|
|
1742
|
+
if (selectedOption) {
|
|
1743
|
+
const selectedOptionText = optionText(selectedOption);
|
|
1744
|
+
if (selectedOptionText !== filterValue) {
|
|
1745
|
+
onFilterValueChange == null ? void 0 : onFilterValueChange(selectedOptionText);
|
|
1746
|
+
}
|
|
1747
|
+
}
|
|
1748
|
+
}
|
|
1749
|
+
}, [
|
|
1750
|
+
allowsCustomValue,
|
|
1751
|
+
flattenedOptions,
|
|
1752
|
+
valueType,
|
|
1753
|
+
optionText,
|
|
1754
|
+
value,
|
|
1755
|
+
filterValue,
|
|
1756
|
+
onFilterValueChange
|
|
1757
|
+
]);
|
|
1758
|
+
return /* @__PURE__ */ React__default.default.createElement(
|
|
1759
|
+
reactAriaComponents.ComboBox,
|
|
1760
|
+
__spreadValues$d({
|
|
1761
|
+
selectedKey: value,
|
|
1762
|
+
onSelectionChange,
|
|
1763
|
+
isDisabled,
|
|
1764
|
+
className,
|
|
1765
|
+
style,
|
|
1766
|
+
items: showAllOptions ? options : filteredOptions,
|
|
1767
|
+
menuTrigger,
|
|
1768
|
+
inputValue: filterValue,
|
|
1769
|
+
onInputChange: onInputValueChange,
|
|
1770
|
+
allowsCustomValue,
|
|
1771
|
+
disabledKeys,
|
|
1772
|
+
onOpenChange: (isOpen, trigger) => {
|
|
1773
|
+
if (isOpen && trigger === "manual") {
|
|
1774
|
+
setShowAllOptions(true);
|
|
1775
|
+
} else {
|
|
1776
|
+
setShowAllOptions(false);
|
|
1777
|
+
}
|
|
1778
|
+
onOpenChange == null ? void 0 : onOpenChange(isOpen);
|
|
1779
|
+
},
|
|
1780
|
+
onBlur,
|
|
1781
|
+
formValue: valueType === "text" ? "text" : "key",
|
|
1782
|
+
name
|
|
1783
|
+
}, extractPlasmicDataProps(props)),
|
|
1784
|
+
/* @__PURE__ */ React__default.default.createElement(
|
|
1785
|
+
PlasmicListBoxContext.Provider,
|
|
1786
|
+
{
|
|
1787
|
+
value: {
|
|
1788
|
+
getItemType: (option) => option.type === "section" ? "section" : "item"
|
|
1789
|
+
}
|
|
1790
|
+
},
|
|
1791
|
+
/* @__PURE__ */ React__default.default.createElement(PlasmicInputContext.Provider, { value: { placeholder } }, structure)
|
|
1792
|
+
),
|
|
1793
|
+
/* @__PURE__ */ React__default.default.createElement(BaseComboBoxEffects, { previewOpen })
|
|
1794
|
+
);
|
|
1795
|
+
}
|
|
1796
|
+
function BaseComboBoxEffects(props) {
|
|
1797
|
+
const { previewOpen } = props;
|
|
1798
|
+
const comboBoxState = React__default.default.useContext(reactAriaComponents.ComboBoxStateContext);
|
|
1799
|
+
const prevPreviewOpenRef = React__default.default.useRef(previewOpen);
|
|
1800
|
+
React__default.default.useEffect(() => {
|
|
1801
|
+
if (comboBoxState) {
|
|
1802
|
+
if (previewOpen) {
|
|
1803
|
+
comboBoxState.open(void 0, "manual");
|
|
1804
|
+
} else if (prevPreviewOpenRef.current) {
|
|
1805
|
+
comboBoxState.close();
|
|
1806
|
+
}
|
|
1807
|
+
}
|
|
1808
|
+
prevPreviewOpenRef.current = previewOpen;
|
|
1809
|
+
}, [previewOpen, comboBoxState, prevPreviewOpenRef]);
|
|
1810
|
+
return null;
|
|
1811
|
+
}
|
|
1812
|
+
function registerComboBox(loader) {
|
|
1813
|
+
const rootName = makeComponentName("combobox");
|
|
1814
|
+
registerComponentHelper(loader, BaseComboBox, {
|
|
1815
|
+
name: rootName,
|
|
1816
|
+
displayName: "Aria ComboBox",
|
|
1817
|
+
importPath: "@plasmicpkgs/react-aria/skinny/registerComboBox",
|
|
1818
|
+
importName: "BaseComboBox",
|
|
1819
|
+
props: {
|
|
1820
|
+
options: makeOptionsPropType(),
|
|
1821
|
+
value: makeValuePropType(),
|
|
1822
|
+
onChange: {
|
|
1823
|
+
type: "eventHandler",
|
|
1824
|
+
argTypes: [{ name: "value", type: "string" }]
|
|
1825
|
+
},
|
|
1826
|
+
filterValue: {
|
|
1827
|
+
type: "string"
|
|
1828
|
+
},
|
|
1829
|
+
onFilterValueChange: {
|
|
1830
|
+
type: "eventHandler",
|
|
1831
|
+
argTypes: [{ name: "value", type: "string" }]
|
|
1832
|
+
},
|
|
1833
|
+
isDisabled: {
|
|
1834
|
+
type: "boolean"
|
|
1835
|
+
},
|
|
1836
|
+
valueType: {
|
|
1837
|
+
displayName: "`value` Type",
|
|
1838
|
+
type: "choice",
|
|
1839
|
+
options: [
|
|
1840
|
+
{ value: "value", label: "By option value" },
|
|
1841
|
+
{ value: "text", label: "By option text" }
|
|
1842
|
+
],
|
|
1843
|
+
defaultValueHint: "value",
|
|
1844
|
+
description: "This controls whether `value` and `onChange` are option values or option text. Choosing `text` allows you to optionally allow a custom value that's not in the provided list of options.",
|
|
1845
|
+
advanced: true
|
|
1846
|
+
},
|
|
1847
|
+
allowsCustomValue: {
|
|
1848
|
+
type: "boolean",
|
|
1849
|
+
displayName: "Allows custom value?",
|
|
1850
|
+
description: "Allows entering a value that is not one of the options",
|
|
1851
|
+
hidden: (ps) => ps.valueType !== "text",
|
|
1852
|
+
advanced: true
|
|
1853
|
+
},
|
|
1854
|
+
onOpenChange: {
|
|
1855
|
+
type: "eventHandler",
|
|
1856
|
+
argTypes: [{ name: "isOpen", type: "boolean" }]
|
|
1857
|
+
},
|
|
1858
|
+
structure: {
|
|
1859
|
+
type: "slot",
|
|
1860
|
+
defaultValue: [
|
|
1861
|
+
{
|
|
1862
|
+
type: "vbox",
|
|
1863
|
+
styles: {
|
|
1864
|
+
justifyContent: "flex-start",
|
|
1865
|
+
alignItems: "flex-start",
|
|
1866
|
+
width: "300px",
|
|
1867
|
+
padding: 0
|
|
1868
|
+
},
|
|
1869
|
+
children: [
|
|
1870
|
+
{
|
|
1871
|
+
type: "component",
|
|
1872
|
+
name: LABEL_COMPONENT_NAME,
|
|
1873
|
+
props: {
|
|
1874
|
+
children: {
|
|
1875
|
+
type: "text",
|
|
1876
|
+
value: "Label"
|
|
1877
|
+
}
|
|
1878
|
+
}
|
|
1879
|
+
},
|
|
1880
|
+
{
|
|
1881
|
+
type: "hbox",
|
|
1882
|
+
styles: {
|
|
1883
|
+
width: "stretch",
|
|
1884
|
+
borderWidth: "1px",
|
|
1885
|
+
borderStyle: "solid",
|
|
1886
|
+
borderColor: "black",
|
|
1887
|
+
padding: 0,
|
|
1888
|
+
position: "relative"
|
|
1889
|
+
},
|
|
1890
|
+
children: [
|
|
1891
|
+
{
|
|
1892
|
+
type: "component",
|
|
1893
|
+
name: INPUT_COMPONENT_NAME,
|
|
1894
|
+
styles: {
|
|
1895
|
+
borderWidth: 0,
|
|
1896
|
+
width: "100%",
|
|
1897
|
+
padding: "2px 30px 2px 10px"
|
|
1898
|
+
}
|
|
1899
|
+
},
|
|
1900
|
+
{
|
|
1901
|
+
type: "component",
|
|
1902
|
+
name: BUTTON_COMPONENT_NAME,
|
|
1903
|
+
styles: {
|
|
1904
|
+
borderWidth: 0,
|
|
1905
|
+
display: "flex",
|
|
1906
|
+
alignItems: "center",
|
|
1907
|
+
justifyContent: "center",
|
|
1908
|
+
position: "absolute",
|
|
1909
|
+
right: "10px",
|
|
1910
|
+
top: 0,
|
|
1911
|
+
padding: 0,
|
|
1912
|
+
height: "100%"
|
|
1913
|
+
},
|
|
1914
|
+
props: {
|
|
1915
|
+
children: {
|
|
1916
|
+
type: "img",
|
|
1917
|
+
src: "https://static1.plasmic.app/arrow-up.svg",
|
|
1918
|
+
styles: {
|
|
1919
|
+
height: "20px",
|
|
1920
|
+
width: "20px",
|
|
1921
|
+
transform: "rotate(180deg)"
|
|
1922
|
+
}
|
|
1923
|
+
}
|
|
1924
|
+
}
|
|
1925
|
+
}
|
|
1926
|
+
]
|
|
1927
|
+
},
|
|
1928
|
+
{
|
|
1929
|
+
type: "component",
|
|
1930
|
+
name: POPOVER_COMPONENT_NAME,
|
|
1931
|
+
styles: {
|
|
1932
|
+
backgroundColor: "white",
|
|
1933
|
+
width: "300px",
|
|
1934
|
+
padding: "10px",
|
|
1935
|
+
overflow: "scroll"
|
|
1936
|
+
},
|
|
1937
|
+
props: {
|
|
1938
|
+
children: [
|
|
1939
|
+
{
|
|
1940
|
+
type: "component",
|
|
1941
|
+
name: LIST_BOX_COMPONENT_NAME,
|
|
1942
|
+
styles: {
|
|
1943
|
+
borderWidth: 0,
|
|
1944
|
+
width: "stretch"
|
|
1945
|
+
}
|
|
1946
|
+
}
|
|
1947
|
+
]
|
|
1948
|
+
}
|
|
1949
|
+
}
|
|
1950
|
+
]
|
|
1951
|
+
}
|
|
1952
|
+
]
|
|
1953
|
+
},
|
|
1954
|
+
previewOpen: {
|
|
1955
|
+
type: "boolean",
|
|
1956
|
+
displayName: "Preview opened?",
|
|
1957
|
+
description: "Preview opened state while designing in Plasmic editor",
|
|
1958
|
+
editOnly: true
|
|
1959
|
+
}
|
|
1960
|
+
},
|
|
1961
|
+
states: {
|
|
1962
|
+
value: {
|
|
1963
|
+
type: "writable",
|
|
1964
|
+
valueProp: "value",
|
|
1965
|
+
onChangeProp: "onChange",
|
|
1966
|
+
variableType: "text"
|
|
1967
|
+
},
|
|
1968
|
+
filterValue: {
|
|
1969
|
+
type: "writable",
|
|
1970
|
+
valueProp: "filterValue",
|
|
1971
|
+
onChangeProp: "onFilterValueChange",
|
|
1972
|
+
variableType: "text"
|
|
1973
|
+
},
|
|
1974
|
+
isOpen: {
|
|
1975
|
+
type: "readonly",
|
|
1976
|
+
onChangeProp: "onOpenChange",
|
|
1977
|
+
variableType: "boolean"
|
|
1978
|
+
}
|
|
1979
|
+
}
|
|
1541
1980
|
});
|
|
1542
1981
|
}
|
|
1543
1982
|
|
|
@@ -1560,7 +1999,7 @@ var __spreadValues$c = (a, b) => {
|
|
|
1560
1999
|
return a;
|
|
1561
2000
|
};
|
|
1562
2001
|
var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));
|
|
1563
|
-
var __objRest$
|
|
2002
|
+
var __objRest$a = (source, exclude) => {
|
|
1564
2003
|
var target = {};
|
|
1565
2004
|
for (var prop in source)
|
|
1566
2005
|
if (__hasOwnProp$c.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
@@ -1579,14 +2018,26 @@ const BaseModal = React.forwardRef(
|
|
|
1579
2018
|
heading,
|
|
1580
2019
|
modalOverlayClass,
|
|
1581
2020
|
onOpenChange,
|
|
1582
|
-
className
|
|
1583
|
-
|
|
2021
|
+
className,
|
|
2022
|
+
isOpen,
|
|
2023
|
+
setControlContextData
|
|
2024
|
+
} = _a, rest = __objRest$a(_a, [
|
|
1584
2025
|
"children",
|
|
1585
2026
|
"heading",
|
|
1586
2027
|
"modalOverlayClass",
|
|
1587
2028
|
"onOpenChange",
|
|
1588
|
-
"className"
|
|
2029
|
+
"className",
|
|
2030
|
+
"isOpen",
|
|
2031
|
+
"setControlContextData"
|
|
1589
2032
|
]);
|
|
2033
|
+
const contextProps = React__default.default.useContext(PlasmicDialogTriggerContext);
|
|
2034
|
+
const isStandalone = !contextProps;
|
|
2035
|
+
const mergedProps = reactAria.mergeProps(contextProps, rest, {
|
|
2036
|
+
isOpen: isStandalone ? isOpen : contextProps.isOpen
|
|
2037
|
+
});
|
|
2038
|
+
setControlContextData == null ? void 0 : setControlContextData({
|
|
2039
|
+
isStandalone
|
|
2040
|
+
});
|
|
1590
2041
|
React.useImperativeHandle(ref, () => ({
|
|
1591
2042
|
close: () => {
|
|
1592
2043
|
onOpenChange(false);
|
|
@@ -1599,7 +2050,7 @@ const BaseModal = React.forwardRef(
|
|
|
1599
2050
|
const body = /* @__PURE__ */ React__default.default.createElement(React__default.default.Fragment, null, heading && /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Heading, { slot: "title" }, heading), children);
|
|
1600
2051
|
return /* @__PURE__ */ React__default.default.createElement(
|
|
1601
2052
|
reactAriaComponents.ModalOverlay,
|
|
1602
|
-
__spreadProps$6(__spreadValues$c({},
|
|
2053
|
+
__spreadProps$6(__spreadValues$c({}, mergedProps), {
|
|
1603
2054
|
className: modalOverlayClass,
|
|
1604
2055
|
onOpenChange
|
|
1605
2056
|
}),
|
|
@@ -1607,16 +2058,31 @@ const BaseModal = React.forwardRef(
|
|
|
1607
2058
|
);
|
|
1608
2059
|
}
|
|
1609
2060
|
);
|
|
2061
|
+
const MODAL_COMPONENT_NAME = makeComponentName("modal");
|
|
1610
2062
|
function registerModal(loader, overrides) {
|
|
1611
2063
|
registerComponentHelper(
|
|
1612
2064
|
loader,
|
|
1613
2065
|
BaseModal,
|
|
1614
2066
|
{
|
|
1615
|
-
name:
|
|
2067
|
+
name: MODAL_COMPONENT_NAME,
|
|
1616
2068
|
displayName: "Aria Modal",
|
|
1617
2069
|
importPath: "@plasmicpkgs/react-aria/skinny/registerModal",
|
|
1618
2070
|
importName: "BaseModal",
|
|
1619
2071
|
styleSections: true,
|
|
2072
|
+
defaultStyles: {
|
|
2073
|
+
// centering the modal on the page by default
|
|
2074
|
+
position: "fixed",
|
|
2075
|
+
top: "10%",
|
|
2076
|
+
left: "50%",
|
|
2077
|
+
width: "50%",
|
|
2078
|
+
transform: "translateX(-50%)",
|
|
2079
|
+
borderWidth: "1px",
|
|
2080
|
+
borderStyle: "solid",
|
|
2081
|
+
borderColor: "black",
|
|
2082
|
+
padding: "20px",
|
|
2083
|
+
maxWidth: "300px",
|
|
2084
|
+
backgroundColor: "#FDE3C3"
|
|
2085
|
+
},
|
|
1620
2086
|
refActions: {
|
|
1621
2087
|
open: {
|
|
1622
2088
|
description: "Open the modal",
|
|
@@ -1629,10 +2095,46 @@ function registerModal(loader, overrides) {
|
|
|
1629
2095
|
},
|
|
1630
2096
|
props: {
|
|
1631
2097
|
heading: {
|
|
1632
|
-
type: "slot"
|
|
2098
|
+
type: "slot",
|
|
2099
|
+
defaultValue: {
|
|
2100
|
+
type: "text",
|
|
2101
|
+
value: "Modal Heading",
|
|
2102
|
+
styles: {
|
|
2103
|
+
fontSize: "20px",
|
|
2104
|
+
fontWeight: "bold",
|
|
2105
|
+
marginBottom: "10px"
|
|
2106
|
+
}
|
|
2107
|
+
}
|
|
1633
2108
|
},
|
|
1634
2109
|
children: {
|
|
1635
|
-
type: "slot"
|
|
2110
|
+
type: "slot",
|
|
2111
|
+
defaultValue: {
|
|
2112
|
+
type: "vbox",
|
|
2113
|
+
styles: {
|
|
2114
|
+
width: "stretch",
|
|
2115
|
+
padding: 0,
|
|
2116
|
+
gap: "10px",
|
|
2117
|
+
justifyContent: "flex-start",
|
|
2118
|
+
alignItems: "flex-start"
|
|
2119
|
+
},
|
|
2120
|
+
children: [
|
|
2121
|
+
{
|
|
2122
|
+
type: "text",
|
|
2123
|
+
value: "This is a Modal!"
|
|
2124
|
+
},
|
|
2125
|
+
{
|
|
2126
|
+
type: "text",
|
|
2127
|
+
value: "You can put anything you can imagine here!",
|
|
2128
|
+
styles: {
|
|
2129
|
+
fontWeight: 500
|
|
2130
|
+
}
|
|
2131
|
+
},
|
|
2132
|
+
{
|
|
2133
|
+
type: "text",
|
|
2134
|
+
value: "Use it in a `Aria Dialog Trigger` component to trigger it on a button click!"
|
|
2135
|
+
}
|
|
2136
|
+
]
|
|
2137
|
+
}
|
|
1636
2138
|
},
|
|
1637
2139
|
modalOverlayClass: {
|
|
1638
2140
|
type: "class",
|
|
@@ -1642,7 +2144,9 @@ function registerModal(loader, overrides) {
|
|
|
1642
2144
|
type: "boolean",
|
|
1643
2145
|
editOnly: true,
|
|
1644
2146
|
uncontrolledProp: "defaultOpen",
|
|
1645
|
-
defaultValueHint: false
|
|
2147
|
+
defaultValueHint: false,
|
|
2148
|
+
defaultValue: true,
|
|
2149
|
+
hidden: (_ps, ctx) => !(ctx == null ? void 0 : ctx.isStandalone)
|
|
1646
2150
|
},
|
|
1647
2151
|
isDismissable: {
|
|
1648
2152
|
type: "boolean",
|
|
@@ -1662,7 +2166,8 @@ function registerModal(loader, overrides) {
|
|
|
1662
2166
|
type: "writable",
|
|
1663
2167
|
valueProp: "isOpen",
|
|
1664
2168
|
onChangeProp: "onOpenChange",
|
|
1665
|
-
variableType: "boolean"
|
|
2169
|
+
variableType: "boolean",
|
|
2170
|
+
hidden: (_ps, ctx) => !(ctx == null ? void 0 : ctx.isStandalone)
|
|
1666
2171
|
}
|
|
1667
2172
|
},
|
|
1668
2173
|
trapsFocus: true
|
|
@@ -1687,7 +2192,7 @@ var __spreadValues$b = (a, b) => {
|
|
|
1687
2192
|
}
|
|
1688
2193
|
return a;
|
|
1689
2194
|
};
|
|
1690
|
-
var __objRest$
|
|
2195
|
+
var __objRest$9 = (source, exclude) => {
|
|
1691
2196
|
var target = {};
|
|
1692
2197
|
for (var prop in source)
|
|
1693
2198
|
if (__hasOwnProp$b.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
@@ -1699,57 +2204,143 @@ var __objRest$8 = (source, exclude) => {
|
|
|
1699
2204
|
}
|
|
1700
2205
|
return target;
|
|
1701
2206
|
};
|
|
1702
|
-
function
|
|
1703
|
-
const _a = props, {
|
|
1704
|
-
|
|
1705
|
-
const contextProps = React__default.default.useContext(PlasmicPopoverContext);
|
|
1706
|
-
const mergedProps = utils.mergeProps(contextProps, restProps, {
|
|
1707
|
-
className: `${resetClassName}`
|
|
1708
|
-
});
|
|
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)));
|
|
2207
|
+
function BaseDialogTrigger(props) {
|
|
2208
|
+
const _a = props, { trigger, dialog } = _a, rest = __objRest$9(_a, ["trigger", "dialog"]);
|
|
2209
|
+
return /* @__PURE__ */ React__default.default.createElement(PlasmicDialogTriggerContext.Provider, { value: props }, /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.DialogTrigger, __spreadValues$b({}, rest), trigger, dialog));
|
|
1716
2210
|
}
|
|
1717
|
-
function
|
|
2211
|
+
function registerDialogTrigger(loader, overrides) {
|
|
1718
2212
|
registerComponentHelper(
|
|
1719
2213
|
loader,
|
|
1720
|
-
|
|
2214
|
+
BaseDialogTrigger,
|
|
1721
2215
|
{
|
|
1722
|
-
name: "
|
|
1723
|
-
displayName: "Aria
|
|
1724
|
-
importPath: "@plasmicpkgs/react-aria/skinny/
|
|
1725
|
-
importName: "
|
|
2216
|
+
name: makeComponentName("dialogTrigger"),
|
|
2217
|
+
displayName: "Aria Dialog Trigger",
|
|
2218
|
+
importPath: "@plasmicpkgs/react-aria/skinny/registerDialogTrigger",
|
|
2219
|
+
importName: "BaseDialogTrigger",
|
|
2220
|
+
isAttachment: true,
|
|
2221
|
+
props: {
|
|
2222
|
+
trigger: {
|
|
2223
|
+
type: "slot",
|
|
2224
|
+
defaultValue: {
|
|
2225
|
+
type: "component",
|
|
2226
|
+
name: BUTTON_COMPONENT_NAME,
|
|
2227
|
+
props: {
|
|
2228
|
+
children: {
|
|
2229
|
+
type: "text",
|
|
2230
|
+
value: "Open Dialog"
|
|
2231
|
+
}
|
|
2232
|
+
}
|
|
2233
|
+
}
|
|
2234
|
+
},
|
|
2235
|
+
dialog: {
|
|
2236
|
+
type: "slot",
|
|
2237
|
+
defaultValue: {
|
|
2238
|
+
type: "component",
|
|
2239
|
+
name: MODAL_COMPONENT_NAME
|
|
2240
|
+
}
|
|
2241
|
+
},
|
|
2242
|
+
isOpen: {
|
|
2243
|
+
type: "boolean",
|
|
2244
|
+
defaultValueHint: false,
|
|
2245
|
+
editOnly: true,
|
|
2246
|
+
uncontrolledProp: "defaultOpen"
|
|
2247
|
+
},
|
|
2248
|
+
onOpenChange: {
|
|
2249
|
+
type: "eventHandler",
|
|
2250
|
+
argTypes: [{ name: "isOpen", type: "boolean" }]
|
|
2251
|
+
}
|
|
2252
|
+
},
|
|
2253
|
+
states: {
|
|
2254
|
+
isOpen: {
|
|
2255
|
+
type: "writable",
|
|
2256
|
+
valueProp: "isOpen",
|
|
2257
|
+
onChangeProp: "onOpenChange",
|
|
2258
|
+
variableType: "boolean"
|
|
2259
|
+
}
|
|
2260
|
+
},
|
|
2261
|
+
trapsFocus: true
|
|
2262
|
+
},
|
|
2263
|
+
overrides
|
|
2264
|
+
);
|
|
2265
|
+
}
|
|
2266
|
+
|
|
2267
|
+
var __defProp$a = Object.defineProperty;
|
|
2268
|
+
var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
|
|
2269
|
+
var __hasOwnProp$a = Object.prototype.hasOwnProperty;
|
|
2270
|
+
var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
|
|
2271
|
+
var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$a(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
2272
|
+
var __spreadValues$a = (a, b) => {
|
|
2273
|
+
for (var prop in b || (b = {}))
|
|
2274
|
+
if (__hasOwnProp$a.call(b, prop))
|
|
2275
|
+
__defNormalProp$a(a, prop, b[prop]);
|
|
2276
|
+
if (__getOwnPropSymbols$a)
|
|
2277
|
+
for (var prop of __getOwnPropSymbols$a(b)) {
|
|
2278
|
+
if (__propIsEnum$a.call(b, prop))
|
|
2279
|
+
__defNormalProp$a(a, prop, b[prop]);
|
|
2280
|
+
}
|
|
2281
|
+
return a;
|
|
2282
|
+
};
|
|
2283
|
+
var __objRest$8 = (source, exclude) => {
|
|
2284
|
+
var target = {};
|
|
2285
|
+
for (var prop in source)
|
|
2286
|
+
if (__hasOwnProp$a.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
2287
|
+
target[prop] = source[prop];
|
|
2288
|
+
if (source != null && __getOwnPropSymbols$a)
|
|
2289
|
+
for (var prop of __getOwnPropSymbols$a(source)) {
|
|
2290
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$a.call(source, prop))
|
|
2291
|
+
target[prop] = source[prop];
|
|
2292
|
+
}
|
|
2293
|
+
return target;
|
|
2294
|
+
};
|
|
2295
|
+
function BaseForm(props) {
|
|
2296
|
+
const _a = props, { onSubmit, children } = _a, rest = __objRest$8(_a, ["onSubmit", "children"]);
|
|
2297
|
+
return /* @__PURE__ */ React__default.default.createElement(
|
|
2298
|
+
reactAriaComponents.Form,
|
|
2299
|
+
__spreadValues$a({
|
|
2300
|
+
onSubmit: (e) => {
|
|
2301
|
+
e.preventDefault();
|
|
2302
|
+
const formData = new FormData(e.currentTarget);
|
|
2303
|
+
const formValues = {};
|
|
2304
|
+
formData.forEach((value, key) => {
|
|
2305
|
+
const field = e.currentTarget.elements.namedItem(key);
|
|
2306
|
+
if (field instanceof RadioNodeList && Array.from(field.values()).every(
|
|
2307
|
+
(f) => f.type === "checkbox"
|
|
2308
|
+
)) {
|
|
2309
|
+
formValues[key] = formData.getAll(key);
|
|
2310
|
+
} else {
|
|
2311
|
+
field.type;
|
|
2312
|
+
formValues[key] = formData.get(key);
|
|
2313
|
+
}
|
|
2314
|
+
});
|
|
2315
|
+
onSubmit == null ? void 0 : onSubmit(formValues);
|
|
2316
|
+
}
|
|
2317
|
+
}, rest),
|
|
2318
|
+
children
|
|
2319
|
+
);
|
|
2320
|
+
}
|
|
2321
|
+
function registerForm(loader, overrides) {
|
|
2322
|
+
registerComponentHelper(
|
|
2323
|
+
loader,
|
|
2324
|
+
BaseForm,
|
|
2325
|
+
{
|
|
2326
|
+
name: makeComponentName("form"),
|
|
2327
|
+
displayName: "Aria Form",
|
|
2328
|
+
importPath: "@plasmicpkgs/react-aria/skinny/registerForm",
|
|
2329
|
+
importName: "BaseForm",
|
|
1726
2330
|
props: {
|
|
1727
2331
|
children: {
|
|
1728
2332
|
type: "slot"
|
|
1729
2333
|
},
|
|
1730
|
-
|
|
1731
|
-
type: "
|
|
1732
|
-
|
|
1733
|
-
description: "Additional offset applied vertically between the popover and its trigger",
|
|
1734
|
-
defaultValueHint: 0
|
|
1735
|
-
},
|
|
1736
|
-
placement: {
|
|
1737
|
-
type: "choice",
|
|
1738
|
-
description: "Default placement of the popover relative to the trigger, if there is enough space",
|
|
1739
|
-
options: [
|
|
1740
|
-
"bottom",
|
|
1741
|
-
"bottom left",
|
|
1742
|
-
"bottom right",
|
|
1743
|
-
"top",
|
|
1744
|
-
"top left",
|
|
1745
|
-
"top right"
|
|
1746
|
-
]
|
|
2334
|
+
onSubmit: {
|
|
2335
|
+
type: "eventHandler",
|
|
2336
|
+
argTypes: [{ name: "data", type: "object" }]
|
|
1747
2337
|
},
|
|
1748
|
-
|
|
1749
|
-
type: "
|
|
2338
|
+
onReset: {
|
|
2339
|
+
type: "eventHandler",
|
|
2340
|
+
argTypes: []
|
|
1750
2341
|
}
|
|
1751
2342
|
},
|
|
1752
|
-
|
|
2343
|
+
trapsFocus: true
|
|
1753
2344
|
},
|
|
1754
2345
|
overrides
|
|
1755
2346
|
);
|
|
@@ -1771,21 +2362,21 @@ class ErrorBoundary extends React.Component {
|
|
|
1771
2362
|
}
|
|
1772
2363
|
}
|
|
1773
2364
|
|
|
1774
|
-
var __defProp$
|
|
2365
|
+
var __defProp$9 = Object.defineProperty;
|
|
1775
2366
|
var __defProps$5 = Object.defineProperties;
|
|
1776
2367
|
var __getOwnPropDescs$5 = Object.getOwnPropertyDescriptors;
|
|
1777
|
-
var __getOwnPropSymbols$
|
|
1778
|
-
var __hasOwnProp$
|
|
1779
|
-
var __propIsEnum$
|
|
1780
|
-
var __defNormalProp$
|
|
1781
|
-
var __spreadValues$
|
|
2368
|
+
var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
|
|
2369
|
+
var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
|
|
2370
|
+
var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
|
|
2371
|
+
var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$9(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
2372
|
+
var __spreadValues$9 = (a, b) => {
|
|
1782
2373
|
for (var prop in b || (b = {}))
|
|
1783
|
-
if (__hasOwnProp$
|
|
1784
|
-
__defNormalProp$
|
|
1785
|
-
if (__getOwnPropSymbols$
|
|
1786
|
-
for (var prop of __getOwnPropSymbols$
|
|
1787
|
-
if (__propIsEnum$
|
|
1788
|
-
__defNormalProp$
|
|
2374
|
+
if (__hasOwnProp$9.call(b, prop))
|
|
2375
|
+
__defNormalProp$9(a, prop, b[prop]);
|
|
2376
|
+
if (__getOwnPropSymbols$9)
|
|
2377
|
+
for (var prop of __getOwnPropSymbols$9(b)) {
|
|
2378
|
+
if (__propIsEnum$9.call(b, prop))
|
|
2379
|
+
__defNormalProp$9(a, prop, b[prop]);
|
|
1789
2380
|
}
|
|
1790
2381
|
return a;
|
|
1791
2382
|
};
|
|
@@ -1793,11 +2384,11 @@ var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));
|
|
|
1793
2384
|
var __objRest$7 = (source, exclude) => {
|
|
1794
2385
|
var target = {};
|
|
1795
2386
|
for (var prop in source)
|
|
1796
|
-
if (__hasOwnProp$
|
|
2387
|
+
if (__hasOwnProp$9.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
1797
2388
|
target[prop] = source[prop];
|
|
1798
|
-
if (source != null && __getOwnPropSymbols$
|
|
1799
|
-
for (var prop of __getOwnPropSymbols$
|
|
1800
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
2389
|
+
if (source != null && __getOwnPropSymbols$9)
|
|
2390
|
+
for (var prop of __getOwnPropSymbols$9(source)) {
|
|
2391
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$9.call(source, prop))
|
|
1801
2392
|
target[prop] = source[prop];
|
|
1802
2393
|
}
|
|
1803
2394
|
return target;
|
|
@@ -1812,8 +2403,9 @@ const { interactionVariants: interactionVariants$4, withObservedValues: withObse
|
|
|
1812
2403
|
RADIO_INTERACTION_VARIANTS
|
|
1813
2404
|
);
|
|
1814
2405
|
function BaseRadio(props) {
|
|
1815
|
-
const _a = props, { children, updateInteractionVariant } = _a, rest = __objRest$7(_a, ["children", "updateInteractionVariant"]);
|
|
1816
|
-
const
|
|
2406
|
+
const _a = props, { children, updateInteractionVariant, setControlContextData } = _a, rest = __objRest$7(_a, ["children", "updateInteractionVariant", "setControlContextData"]);
|
|
2407
|
+
const contextProps = React__default.default.useContext(PlasmicRadioGroupContext);
|
|
2408
|
+
const radio = /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Radio, __spreadValues$9({}, rest), ({ isHovered, isPressed, isFocused, isFocusVisible }) => withObservedValues$3(
|
|
1817
2409
|
children,
|
|
1818
2410
|
{
|
|
1819
2411
|
hovered: isHovered,
|
|
@@ -1823,10 +2415,46 @@ function BaseRadio(props) {
|
|
|
1823
2415
|
},
|
|
1824
2416
|
updateInteractionVariant
|
|
1825
2417
|
));
|
|
2418
|
+
const isStandalone = !contextProps;
|
|
2419
|
+
setControlContextData == null ? void 0 : setControlContextData({
|
|
2420
|
+
isStandalone
|
|
2421
|
+
});
|
|
1826
2422
|
return /* @__PURE__ */ React__default.default.createElement(ErrorBoundary, { fallback: /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.RadioGroup, null, radio) }, radio);
|
|
1827
2423
|
}
|
|
2424
|
+
const makeDefaultRadioChildren = (label) => ({
|
|
2425
|
+
type: "hbox",
|
|
2426
|
+
styles: {
|
|
2427
|
+
display: "flex",
|
|
2428
|
+
alignItems: "center",
|
|
2429
|
+
gap: "10px",
|
|
2430
|
+
padding: 0
|
|
2431
|
+
},
|
|
2432
|
+
children: [
|
|
2433
|
+
{
|
|
2434
|
+
type: "box",
|
|
2435
|
+
styles: {
|
|
2436
|
+
width: "7px",
|
|
2437
|
+
height: "7px",
|
|
2438
|
+
borderRadius: "100%",
|
|
2439
|
+
borderWidth: "1px",
|
|
2440
|
+
borderStyle: "solid",
|
|
2441
|
+
borderColor: "black"
|
|
2442
|
+
}
|
|
2443
|
+
},
|
|
2444
|
+
{
|
|
2445
|
+
type: "component",
|
|
2446
|
+
name: LABEL_COMPONENT_NAME,
|
|
2447
|
+
props: {
|
|
2448
|
+
children: {
|
|
2449
|
+
type: "text",
|
|
2450
|
+
value: label
|
|
2451
|
+
}
|
|
2452
|
+
}
|
|
2453
|
+
}
|
|
2454
|
+
]
|
|
2455
|
+
});
|
|
1828
2456
|
function registerRadio(loader, overrides) {
|
|
1829
|
-
registerComponentHelper(
|
|
2457
|
+
return registerComponentHelper(
|
|
1830
2458
|
loader,
|
|
1831
2459
|
BaseRadio,
|
|
1832
2460
|
{
|
|
@@ -1835,12 +2463,16 @@ function registerRadio(loader, overrides) {
|
|
|
1835
2463
|
importPath: "@plasmicpkgs/react-aria/skinny/registerRadio",
|
|
1836
2464
|
importName: "BaseRadio",
|
|
1837
2465
|
interactionVariants: interactionVariants$4,
|
|
1838
|
-
props: __spreadProps$5(__spreadValues$
|
|
2466
|
+
props: __spreadProps$5(__spreadValues$9({}, getCommonInputProps("radio", [
|
|
1839
2467
|
"isDisabled",
|
|
1840
2468
|
"autoFocus",
|
|
1841
|
-
"aria-label"
|
|
1842
|
-
"children"
|
|
2469
|
+
"aria-label"
|
|
1843
2470
|
])), {
|
|
2471
|
+
children: {
|
|
2472
|
+
type: "slot",
|
|
2473
|
+
mergeWithParent: true,
|
|
2474
|
+
defaultValue: makeDefaultRadioChildren("Radio")
|
|
2475
|
+
},
|
|
1844
2476
|
value: {
|
|
1845
2477
|
type: "string",
|
|
1846
2478
|
description: "The value of the input element, used when submitting an HTML form."
|
|
@@ -1854,7 +2486,8 @@ function registerRadio(loader, overrides) {
|
|
|
1854
2486
|
isSelected: {
|
|
1855
2487
|
type: "readonly",
|
|
1856
2488
|
onChangeProp: "onSelectionChange",
|
|
1857
|
-
variableType: "boolean"
|
|
2489
|
+
variableType: "boolean",
|
|
2490
|
+
hidden: (_ps, ctx) => !(ctx == null ? void 0 : ctx.isStandalone)
|
|
1858
2491
|
}
|
|
1859
2492
|
},
|
|
1860
2493
|
trapsFocus: true
|
|
@@ -1863,44 +2496,113 @@ function registerRadio(loader, overrides) {
|
|
|
1863
2496
|
);
|
|
1864
2497
|
}
|
|
1865
2498
|
|
|
1866
|
-
var __defProp$
|
|
1867
|
-
var __defProps$4 = Object.defineProperties;
|
|
1868
|
-
var __getOwnPropDescs$4 = Object.getOwnPropertyDescriptors;
|
|
1869
|
-
var __getOwnPropSymbols$
|
|
1870
|
-
var __hasOwnProp$
|
|
1871
|
-
var __propIsEnum$
|
|
1872
|
-
var __defNormalProp$
|
|
1873
|
-
var __spreadValues$
|
|
2499
|
+
var __defProp$8 = Object.defineProperty;
|
|
2500
|
+
var __defProps$4 = Object.defineProperties;
|
|
2501
|
+
var __getOwnPropDescs$4 = Object.getOwnPropertyDescriptors;
|
|
2502
|
+
var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
|
|
2503
|
+
var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
|
|
2504
|
+
var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
|
|
2505
|
+
var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$8(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
2506
|
+
var __spreadValues$8 = (a, b) => {
|
|
1874
2507
|
for (var prop in b || (b = {}))
|
|
1875
|
-
if (__hasOwnProp$
|
|
1876
|
-
__defNormalProp$
|
|
1877
|
-
if (__getOwnPropSymbols$
|
|
1878
|
-
for (var prop of __getOwnPropSymbols$
|
|
1879
|
-
if (__propIsEnum$
|
|
1880
|
-
__defNormalProp$
|
|
2508
|
+
if (__hasOwnProp$8.call(b, prop))
|
|
2509
|
+
__defNormalProp$8(a, prop, b[prop]);
|
|
2510
|
+
if (__getOwnPropSymbols$8)
|
|
2511
|
+
for (var prop of __getOwnPropSymbols$8(b)) {
|
|
2512
|
+
if (__propIsEnum$8.call(b, prop))
|
|
2513
|
+
__defNormalProp$8(a, prop, b[prop]);
|
|
1881
2514
|
}
|
|
1882
2515
|
return a;
|
|
1883
2516
|
};
|
|
1884
2517
|
var __spreadProps$4 = (a, b) => __defProps$4(a, __getOwnPropDescs$4(b));
|
|
1885
|
-
|
|
1886
|
-
|
|
2518
|
+
function BaseRadioGroup(props) {
|
|
2519
|
+
return /* @__PURE__ */ React__default.default.createElement(PlasmicRadioGroupContext.Provider, { value: props }, /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.RadioGroup, __spreadValues$8({}, props)));
|
|
2520
|
+
}
|
|
2521
|
+
const RADIO_GROUP_COMPONENT_NAME = makeComponentName("radioGroup");
|
|
1887
2522
|
function registerRadioGroup(loader, overrides) {
|
|
2523
|
+
const thisName = makeChildComponentName(
|
|
2524
|
+
overrides == null ? void 0 : overrides.parentComponentName,
|
|
2525
|
+
RADIO_GROUP_COMPONENT_NAME
|
|
2526
|
+
);
|
|
2527
|
+
registerFieldError(loader, { parentComponentName: thisName });
|
|
2528
|
+
const radioMeta = registerRadio(loader, { parentComponentName: thisName });
|
|
2529
|
+
registerLabel(loader, { parentComponentName: thisName });
|
|
1888
2530
|
registerComponentHelper(
|
|
1889
2531
|
loader,
|
|
1890
2532
|
BaseRadioGroup,
|
|
1891
2533
|
{
|
|
1892
|
-
name:
|
|
2534
|
+
name: RADIO_GROUP_COMPONENT_NAME,
|
|
1893
2535
|
displayName: "Aria RadioGroup",
|
|
1894
2536
|
importPath: "@plasmicpkgs/react-aria/skinny/registerRadioGroup",
|
|
1895
2537
|
importName: "BaseRadioGroup",
|
|
1896
|
-
props: __spreadProps$4(__spreadValues$
|
|
2538
|
+
props: __spreadProps$4(__spreadValues$8({}, getCommonInputProps("radio group", [
|
|
1897
2539
|
"name",
|
|
1898
2540
|
"isDisabled",
|
|
1899
2541
|
"isReadOnly",
|
|
1900
2542
|
"aria-label",
|
|
1901
|
-
"children",
|
|
1902
2543
|
"isRequired"
|
|
1903
2544
|
])), {
|
|
2545
|
+
children: {
|
|
2546
|
+
type: "slot",
|
|
2547
|
+
mergeWithParent: true,
|
|
2548
|
+
defaultValue: [
|
|
2549
|
+
{
|
|
2550
|
+
type: "vbox",
|
|
2551
|
+
styles: {
|
|
2552
|
+
display: "flex",
|
|
2553
|
+
gap: "5px",
|
|
2554
|
+
padding: 0,
|
|
2555
|
+
alignItems: "flex-start"
|
|
2556
|
+
},
|
|
2557
|
+
children: [
|
|
2558
|
+
{
|
|
2559
|
+
type: "component",
|
|
2560
|
+
name: LABEL_COMPONENT_NAME,
|
|
2561
|
+
props: {
|
|
2562
|
+
children: {
|
|
2563
|
+
type: "text",
|
|
2564
|
+
value: "Radio Group"
|
|
2565
|
+
}
|
|
2566
|
+
}
|
|
2567
|
+
},
|
|
2568
|
+
{
|
|
2569
|
+
type: "component",
|
|
2570
|
+
name: radioMeta.name,
|
|
2571
|
+
props: {
|
|
2572
|
+
children: makeDefaultRadioChildren("Radio 1"),
|
|
2573
|
+
value: "radio1"
|
|
2574
|
+
}
|
|
2575
|
+
},
|
|
2576
|
+
{
|
|
2577
|
+
type: "component",
|
|
2578
|
+
name: radioMeta.name,
|
|
2579
|
+
props: {
|
|
2580
|
+
children: makeDefaultRadioChildren("Radio 2"),
|
|
2581
|
+
value: "radio2"
|
|
2582
|
+
}
|
|
2583
|
+
},
|
|
2584
|
+
{
|
|
2585
|
+
type: "component",
|
|
2586
|
+
name: radioMeta.name,
|
|
2587
|
+
props: {
|
|
2588
|
+
children: makeDefaultRadioChildren("Radio 3"),
|
|
2589
|
+
value: "radio3"
|
|
2590
|
+
}
|
|
2591
|
+
},
|
|
2592
|
+
{
|
|
2593
|
+
type: "component",
|
|
2594
|
+
name: DESCRIPTION_COMPONENT_NAME,
|
|
2595
|
+
props: {
|
|
2596
|
+
children: {
|
|
2597
|
+
type: "text",
|
|
2598
|
+
value: "Add interaction variants to see it in action..."
|
|
2599
|
+
}
|
|
2600
|
+
}
|
|
2601
|
+
}
|
|
2602
|
+
]
|
|
2603
|
+
}
|
|
2604
|
+
]
|
|
2605
|
+
},
|
|
1904
2606
|
value: {
|
|
1905
2607
|
type: "string",
|
|
1906
2608
|
editOnly: true,
|
|
@@ -1936,87 +2638,6 @@ function registerRadioGroup(loader, overrides) {
|
|
|
1936
2638
|
},
|
|
1937
2639
|
overrides
|
|
1938
2640
|
);
|
|
1939
|
-
const thisName = makeChildComponentName(
|
|
1940
|
-
overrides == null ? void 0 : overrides.parentComponentName,
|
|
1941
|
-
componentName$1
|
|
1942
|
-
);
|
|
1943
|
-
registerFieldError(loader, { parentComponentName: thisName });
|
|
1944
|
-
registerRadio(loader, { parentComponentName: thisName });
|
|
1945
|
-
registerLabel(loader, { parentComponentName: thisName });
|
|
1946
|
-
registerDescription(loader, {
|
|
1947
|
-
parentComponentName: thisName
|
|
1948
|
-
});
|
|
1949
|
-
}
|
|
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
2641
|
}
|
|
2021
2642
|
|
|
2022
2643
|
var __defProp$7 = Object.defineProperty;
|
|
@@ -2035,6 +2656,10 @@ var __spreadValues$7 = (a, b) => {
|
|
|
2035
2656
|
}
|
|
2036
2657
|
return a;
|
|
2037
2658
|
};
|
|
2659
|
+
const BaseSelectValue = (props) => {
|
|
2660
|
+
const { children, customize } = props;
|
|
2661
|
+
return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.SelectValue, null, ({ isPlaceholder, selectedText }) => /* @__PURE__ */ React__default.default.createElement(React__default.default.Fragment, null, isPlaceholder ? /* @__PURE__ */ React__default.default.createElement("span", null, "Select an item") : /* @__PURE__ */ React__default.default.createElement(React__default.default.Fragment, null, /* @__PURE__ */ React__default.default.createElement("span", null, customize ? children : selectedText))));
|
|
2662
|
+
};
|
|
2038
2663
|
const SELECT_NAME = makeComponentName("select");
|
|
2039
2664
|
function BaseSelect(props) {
|
|
2040
2665
|
const {
|
|
@@ -2079,6 +2704,38 @@ function BaseSelect(props) {
|
|
|
2079
2704
|
);
|
|
2080
2705
|
}
|
|
2081
2706
|
function registerSelect(loader) {
|
|
2707
|
+
const selectValueMeta = registerComponentHelper(loader, BaseSelectValue, {
|
|
2708
|
+
name: makeComponentName("select-value"),
|
|
2709
|
+
displayName: "Aria Selected Value",
|
|
2710
|
+
importPath: "@plasmicpkgs/react-aria/registerSelect",
|
|
2711
|
+
importName: "SelectValue",
|
|
2712
|
+
parentComponentName: SELECT_NAME,
|
|
2713
|
+
props: {
|
|
2714
|
+
customize: {
|
|
2715
|
+
type: "boolean",
|
|
2716
|
+
advanced: true,
|
|
2717
|
+
description: "Whether to customize the selected value display"
|
|
2718
|
+
},
|
|
2719
|
+
children: {
|
|
2720
|
+
type: "slot",
|
|
2721
|
+
defaultValue: [
|
|
2722
|
+
{
|
|
2723
|
+
type: "text",
|
|
2724
|
+
value: "Selected value..."
|
|
2725
|
+
}
|
|
2726
|
+
]
|
|
2727
|
+
},
|
|
2728
|
+
className: {
|
|
2729
|
+
type: "class",
|
|
2730
|
+
selectors: [
|
|
2731
|
+
{
|
|
2732
|
+
selector: ":self[data-placeholder]",
|
|
2733
|
+
label: "Placeholder"
|
|
2734
|
+
}
|
|
2735
|
+
]
|
|
2736
|
+
}
|
|
2737
|
+
}
|
|
2738
|
+
});
|
|
2082
2739
|
registerComponentHelper(loader, BaseSelect, {
|
|
2083
2740
|
name: SELECT_NAME,
|
|
2084
2741
|
displayName: "Aria Select",
|
|
@@ -2141,7 +2798,84 @@ function registerSelect(loader) {
|
|
|
2141
2798
|
// "Return a function that takes in an option object, and returns true if option should be disabled",
|
|
2142
2799
|
// },
|
|
2143
2800
|
structure: {
|
|
2144
|
-
type: "slot"
|
|
2801
|
+
type: "slot",
|
|
2802
|
+
defaultValue: [
|
|
2803
|
+
{
|
|
2804
|
+
type: "vbox",
|
|
2805
|
+
styles: {
|
|
2806
|
+
justifyContent: "flex-start",
|
|
2807
|
+
alignItems: "flex-start",
|
|
2808
|
+
width: "300px",
|
|
2809
|
+
padding: 0
|
|
2810
|
+
},
|
|
2811
|
+
children: [
|
|
2812
|
+
{
|
|
2813
|
+
type: "component",
|
|
2814
|
+
name: LABEL_COMPONENT_NAME,
|
|
2815
|
+
props: {
|
|
2816
|
+
children: {
|
|
2817
|
+
type: "text",
|
|
2818
|
+
value: "Label"
|
|
2819
|
+
}
|
|
2820
|
+
}
|
|
2821
|
+
},
|
|
2822
|
+
{
|
|
2823
|
+
type: "component",
|
|
2824
|
+
name: BUTTON_COMPONENT_NAME,
|
|
2825
|
+
styles: {
|
|
2826
|
+
width: "100%"
|
|
2827
|
+
},
|
|
2828
|
+
props: {
|
|
2829
|
+
children: {
|
|
2830
|
+
type: "hbox",
|
|
2831
|
+
styles: {
|
|
2832
|
+
width: "stretch",
|
|
2833
|
+
justifyContent: "space-between",
|
|
2834
|
+
alignItems: "center",
|
|
2835
|
+
padding: "2px 5px"
|
|
2836
|
+
},
|
|
2837
|
+
children: [
|
|
2838
|
+
{
|
|
2839
|
+
type: "component",
|
|
2840
|
+
name: selectValueMeta.name
|
|
2841
|
+
},
|
|
2842
|
+
{
|
|
2843
|
+
type: "img",
|
|
2844
|
+
src: "https://static1.plasmic.app/arrow-up.svg",
|
|
2845
|
+
styles: {
|
|
2846
|
+
height: "20px",
|
|
2847
|
+
width: "20px",
|
|
2848
|
+
transform: "rotate(180deg)"
|
|
2849
|
+
}
|
|
2850
|
+
}
|
|
2851
|
+
]
|
|
2852
|
+
}
|
|
2853
|
+
}
|
|
2854
|
+
},
|
|
2855
|
+
{
|
|
2856
|
+
type: "component",
|
|
2857
|
+
name: POPOVER_COMPONENT_NAME,
|
|
2858
|
+
styles: {
|
|
2859
|
+
backgroundColor: "white",
|
|
2860
|
+
padding: "10px",
|
|
2861
|
+
overflow: "scroll"
|
|
2862
|
+
},
|
|
2863
|
+
props: {
|
|
2864
|
+
children: [
|
|
2865
|
+
{
|
|
2866
|
+
type: "component",
|
|
2867
|
+
name: LIST_BOX_COMPONENT_NAME,
|
|
2868
|
+
styles: {
|
|
2869
|
+
borderWidth: 0,
|
|
2870
|
+
width: "stretch"
|
|
2871
|
+
}
|
|
2872
|
+
}
|
|
2873
|
+
]
|
|
2874
|
+
}
|
|
2875
|
+
}
|
|
2876
|
+
]
|
|
2877
|
+
}
|
|
2878
|
+
]
|
|
2145
2879
|
},
|
|
2146
2880
|
// renderOption: {
|
|
2147
2881
|
// type: "slot",
|
|
@@ -2176,24 +2910,6 @@ function registerSelect(loader) {
|
|
|
2176
2910
|
}
|
|
2177
2911
|
}
|
|
2178
2912
|
});
|
|
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
2913
|
}
|
|
2198
2914
|
|
|
2199
2915
|
const BaseSliderOutput = reactAriaComponents.SliderOutput;
|
|
@@ -2789,14 +3505,91 @@ function registerSwitch(loader, overrides) {
|
|
|
2789
3505
|
importPath: "@plasmicpkgs/react-aria/skinny/registerSwitch",
|
|
2790
3506
|
importName: "BaseSwitch",
|
|
2791
3507
|
interactionVariants: interactionVariants$1,
|
|
3508
|
+
defaultStyles: {
|
|
3509
|
+
display: "flex",
|
|
3510
|
+
flexDirection: "column",
|
|
3511
|
+
alignItems: "center",
|
|
3512
|
+
justifyContent: "flex-start",
|
|
3513
|
+
padding: 0
|
|
3514
|
+
},
|
|
2792
3515
|
props: __spreadProps$2(__spreadValues$3({}, getCommonInputProps("switch", [
|
|
2793
3516
|
"name",
|
|
2794
3517
|
"isDisabled",
|
|
2795
3518
|
"isReadOnly",
|
|
2796
3519
|
"autoFocus",
|
|
2797
|
-
"aria-label"
|
|
2798
|
-
"children"
|
|
3520
|
+
"aria-label"
|
|
2799
3521
|
])), {
|
|
3522
|
+
children: {
|
|
3523
|
+
type: "slot",
|
|
3524
|
+
mergeWithParent: true,
|
|
3525
|
+
defaultValue: [
|
|
3526
|
+
{
|
|
3527
|
+
type: "hbox",
|
|
3528
|
+
styles: {
|
|
3529
|
+
display: "flex",
|
|
3530
|
+
alignItems: "center",
|
|
3531
|
+
justifyContent: "center",
|
|
3532
|
+
gap: "10px",
|
|
3533
|
+
padding: 0
|
|
3534
|
+
},
|
|
3535
|
+
children: [
|
|
3536
|
+
{
|
|
3537
|
+
// the track
|
|
3538
|
+
type: "hbox",
|
|
3539
|
+
styles: {
|
|
3540
|
+
width: "30px",
|
|
3541
|
+
height: "16px",
|
|
3542
|
+
padding: 0,
|
|
3543
|
+
backgroundColor: "#D5D5D5",
|
|
3544
|
+
cursor: "pointer",
|
|
3545
|
+
borderRadius: "999px"
|
|
3546
|
+
},
|
|
3547
|
+
children: {
|
|
3548
|
+
// the thumb
|
|
3549
|
+
type: "hbox",
|
|
3550
|
+
styles: {
|
|
3551
|
+
width: "12px",
|
|
3552
|
+
height: "12px",
|
|
3553
|
+
position: "absolute",
|
|
3554
|
+
top: "2px",
|
|
3555
|
+
left: "2px",
|
|
3556
|
+
borderRadius: "100%",
|
|
3557
|
+
backgroundColor: "#fff",
|
|
3558
|
+
padding: 0,
|
|
3559
|
+
transitionProperty: "all",
|
|
3560
|
+
transitionDuration: "0.5s",
|
|
3561
|
+
transitionTimingFunction: "ease-in-out"
|
|
3562
|
+
}
|
|
3563
|
+
}
|
|
3564
|
+
},
|
|
3565
|
+
{
|
|
3566
|
+
// the label
|
|
3567
|
+
type: "component",
|
|
3568
|
+
name: LABEL_COMPONENT_NAME,
|
|
3569
|
+
props: {
|
|
3570
|
+
children: {
|
|
3571
|
+
type: "text",
|
|
3572
|
+
value: "Label"
|
|
3573
|
+
}
|
|
3574
|
+
}
|
|
3575
|
+
}
|
|
3576
|
+
]
|
|
3577
|
+
},
|
|
3578
|
+
{
|
|
3579
|
+
type: "component",
|
|
3580
|
+
name: DESCRIPTION_COMPONENT_NAME,
|
|
3581
|
+
styles: {
|
|
3582
|
+
fontSize: "12px"
|
|
3583
|
+
},
|
|
3584
|
+
props: {
|
|
3585
|
+
children: {
|
|
3586
|
+
type: "text",
|
|
3587
|
+
value: "Add interaction variants to see it in action..."
|
|
3588
|
+
}
|
|
3589
|
+
}
|
|
3590
|
+
}
|
|
3591
|
+
]
|
|
3592
|
+
},
|
|
2800
3593
|
value: {
|
|
2801
3594
|
type: "boolean",
|
|
2802
3595
|
editOnly: true,
|
|
@@ -2961,13 +3754,13 @@ function BaseTextField(props) {
|
|
|
2961
3754
|
children
|
|
2962
3755
|
);
|
|
2963
3756
|
}
|
|
2964
|
-
const
|
|
3757
|
+
const TEXT_FIELD_COMPONENT_NAME = makeComponentName("textField");
|
|
2965
3758
|
function registerTextField(loader, overrides) {
|
|
2966
3759
|
registerComponentHelper(
|
|
2967
3760
|
loader,
|
|
2968
3761
|
BaseTextField,
|
|
2969
3762
|
{
|
|
2970
|
-
name:
|
|
3763
|
+
name: TEXT_FIELD_COMPONENT_NAME,
|
|
2971
3764
|
displayName: "Aria TextField",
|
|
2972
3765
|
importPath: "@plasmicpkgs/react-aria/skinny/registerTextField",
|
|
2973
3766
|
importName: "BaseTextField",
|
|
@@ -2978,9 +3771,50 @@ function registerTextField(loader, overrides) {
|
|
|
2978
3771
|
"isReadOnly",
|
|
2979
3772
|
"autoFocus",
|
|
2980
3773
|
"aria-label",
|
|
2981
|
-
"children",
|
|
2982
3774
|
"isRequired"
|
|
2983
3775
|
])), {
|
|
3776
|
+
children: {
|
|
3777
|
+
type: "slot",
|
|
3778
|
+
mergeWithParent: true,
|
|
3779
|
+
defaultValue: {
|
|
3780
|
+
type: "vbox",
|
|
3781
|
+
styles: {
|
|
3782
|
+
justifyContent: "flex-start",
|
|
3783
|
+
alignItems: "flex-start",
|
|
3784
|
+
width: "300px",
|
|
3785
|
+
gap: "5px"
|
|
3786
|
+
},
|
|
3787
|
+
children: [
|
|
3788
|
+
{
|
|
3789
|
+
type: "component",
|
|
3790
|
+
name: LABEL_COMPONENT_NAME,
|
|
3791
|
+
props: {
|
|
3792
|
+
children: {
|
|
3793
|
+
type: "text",
|
|
3794
|
+
value: "Label"
|
|
3795
|
+
}
|
|
3796
|
+
}
|
|
3797
|
+
},
|
|
3798
|
+
{
|
|
3799
|
+
type: "component",
|
|
3800
|
+
name: INPUT_COMPONENT_NAME,
|
|
3801
|
+
styles: {
|
|
3802
|
+
width: "100%"
|
|
3803
|
+
}
|
|
3804
|
+
},
|
|
3805
|
+
{
|
|
3806
|
+
type: "component",
|
|
3807
|
+
name: DESCRIPTION_COMPONENT_NAME,
|
|
3808
|
+
props: {
|
|
3809
|
+
children: {
|
|
3810
|
+
type: "text",
|
|
3811
|
+
value: "Type something..."
|
|
3812
|
+
}
|
|
3813
|
+
}
|
|
3814
|
+
}
|
|
3815
|
+
]
|
|
3816
|
+
}
|
|
3817
|
+
},
|
|
2984
3818
|
value: {
|
|
2985
3819
|
type: "string",
|
|
2986
3820
|
editOnly: true,
|
|
@@ -3196,12 +4030,11 @@ function registerTextField(loader, overrides) {
|
|
|
3196
4030
|
);
|
|
3197
4031
|
const thisName = makeChildComponentName(
|
|
3198
4032
|
overrides == null ? void 0 : overrides.parentComponentName,
|
|
3199
|
-
|
|
4033
|
+
TEXT_FIELD_COMPONENT_NAME
|
|
3200
4034
|
);
|
|
3201
4035
|
registerFieldError(loader, { parentComponentName: thisName });
|
|
3202
4036
|
registerInput(loader, { parentComponentName: thisName });
|
|
3203
4037
|
registerLabel(loader, { parentComponentName: thisName });
|
|
3204
|
-
registerDescription(loader, { parentComponentName: thisName });
|
|
3205
4038
|
registerTextArea(loader, { parentComponentName: thisName });
|
|
3206
4039
|
}
|
|
3207
4040
|
|
|
@@ -3335,6 +4168,8 @@ function registerTooltip(loader, overrides) {
|
|
|
3335
4168
|
}
|
|
3336
4169
|
|
|
3337
4170
|
function registerAll(loader) {
|
|
4171
|
+
registerText(loader);
|
|
4172
|
+
registerDescription(loader);
|
|
3338
4173
|
registerSelect(loader);
|
|
3339
4174
|
registerComboBox(loader);
|
|
3340
4175
|
registerButton(loader);
|
|
@@ -3342,7 +4177,6 @@ function registerAll(loader) {
|
|
|
3342
4177
|
registerListBox(loader);
|
|
3343
4178
|
registerPopover(loader);
|
|
3344
4179
|
registerInput(loader);
|
|
3345
|
-
registerSection(loader);
|
|
3346
4180
|
registerSwitch(loader);
|
|
3347
4181
|
registerForm(loader);
|
|
3348
4182
|
registerCheckbox(loader);
|