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