@plasmicpkgs/react-aria 0.0.29 → 0.0.31
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 +1759 -924
- package/dist/react-aria.esm.js.map +1 -1
- package/dist/react-aria.js +1758 -923
- 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/registerTooltip.d.ts +2 -1
- 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-73e80194.cjs.js → registerSlider-61c84cf7.cjs.js} +6 -11
- package/skinny/registerSlider-61c84cf7.cjs.js.map +1 -0
- package/skinny/{registerSlider-efdba013.esm.js → registerSlider-de8e9387.esm.js} +6 -11
- package/skinny/registerSlider-de8e9387.esm.js.map +1 -0
- 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 +7 -3
- package/skinny/registerSliderThumb.cjs.js.map +1 -1
- package/skinny/registerSliderThumb.esm.js +7 -3
- package/skinny/registerSliderThumb.esm.js.map +1 -1
- 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 +8 -6
- package/skinny/registerTooltip.cjs.js.map +1 -1
- package/skinny/registerTooltip.d.ts +2 -1
- package/skinny/registerTooltip.esm.js +8 -6
- package/skinny/registerTooltip.esm.js.map +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/registerSlider-73e80194.cjs.js.map +0 -1
- package/skinny/registerSlider-efdba013.esm.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$
|
|
114
|
+
var __defProp$q = Object.defineProperty;
|
|
115
115
|
var __defProps$d = Object.defineProperties;
|
|
116
116
|
var __getOwnPropDescs$d = Object.getOwnPropertyDescriptors;
|
|
117
|
-
var __getOwnPropSymbols$
|
|
118
|
-
var __hasOwnProp$
|
|
119
|
-
var __propIsEnum$
|
|
120
|
-
var __defNormalProp$
|
|
121
|
-
var __spreadValues$
|
|
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
132
|
var __spreadProps$d = (a, b) => __defProps$d(a, __getOwnPropDescs$d(b));
|
|
133
133
|
function registerComponentHelper(loader, component, meta, overrides) {
|
|
134
134
|
if (overrides) {
|
|
135
|
-
meta = __spreadProps$d(__spreadValues$
|
|
136
|
-
props: __spreadValues$
|
|
135
|
+
meta = __spreadProps$d(__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,21 +170,21 @@ function withoutNils(array) {
|
|
|
169
170
|
return array.filter((x) => x != null);
|
|
170
171
|
}
|
|
171
172
|
|
|
172
|
-
var __defProp$
|
|
173
|
+
var __defProp$p = Object.defineProperty;
|
|
173
174
|
var __defProps$c = Object.defineProperties;
|
|
174
175
|
var __getOwnPropDescs$c = Object.getOwnPropertyDescriptors;
|
|
175
|
-
var __getOwnPropSymbols$
|
|
176
|
-
var __hasOwnProp$
|
|
177
|
-
var __propIsEnum$
|
|
178
|
-
var __defNormalProp$
|
|
179
|
-
var __spreadValues$
|
|
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
|
};
|
|
@@ -191,11 +192,11 @@ var __spreadProps$c = (a, b) => __defProps$c(a, __getOwnPropDescs$c(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$c(__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,21 +290,58 @@ function registerButton(loader, overrides) {
|
|
|
275
290
|
);
|
|
276
291
|
}
|
|
277
292
|
|
|
278
|
-
|
|
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;
|
|
279
331
|
var __defProps$b = Object.defineProperties;
|
|
280
332
|
var __getOwnPropDescs$b = Object.getOwnPropertyDescriptors;
|
|
281
|
-
var __getOwnPropSymbols$
|
|
282
|
-
var __hasOwnProp$
|
|
283
|
-
var __propIsEnum$
|
|
284
|
-
var __defNormalProp$
|
|
285
|
-
var __spreadValues$
|
|
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
|
};
|
|
@@ -297,11 +349,11 @@ var __spreadProps$b = (a, b) => __defProps$b(a, __getOwnPropDescs$b(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$b(__spreadValues$
|
|
450
|
+
props: __spreadProps$b(__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,58 +574,64 @@ function registerText(loader, overrides) {
|
|
|
450
574
|
);
|
|
451
575
|
}
|
|
452
576
|
|
|
453
|
-
var __defProp$
|
|
577
|
+
var __defProp$m = Object.defineProperty;
|
|
454
578
|
var __defProps$a = Object.defineProperties;
|
|
455
579
|
var __getOwnPropDescs$a = Object.getOwnPropertyDescriptors;
|
|
456
|
-
var __getOwnPropSymbols$
|
|
457
|
-
var __hasOwnProp$
|
|
458
|
-
var __propIsEnum$
|
|
459
|
-
var __defNormalProp$
|
|
460
|
-
var __spreadValues$
|
|
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) => {
|
|
461
585
|
for (var prop in b || (b = {}))
|
|
462
|
-
if (__hasOwnProp$
|
|
463
|
-
__defNormalProp$
|
|
464
|
-
if (__getOwnPropSymbols$
|
|
465
|
-
for (var prop of __getOwnPropSymbols$
|
|
466
|
-
if (__propIsEnum$
|
|
467
|
-
__defNormalProp$
|
|
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]);
|
|
468
592
|
}
|
|
469
593
|
return a;
|
|
470
594
|
};
|
|
471
595
|
var __spreadProps$a = (a, b) => __defProps$a(a, __getOwnPropDescs$a(b));
|
|
596
|
+
const DESCRIPTION_COMPONENT_NAME = makeComponentName("description");
|
|
472
597
|
function registerDescription(loader, overrides) {
|
|
473
|
-
registerText(loader, __spreadProps$a(__spreadValues$
|
|
598
|
+
return registerText(loader, __spreadProps$a(__spreadValues$m({}, overrides), {
|
|
599
|
+
name: DESCRIPTION_COMPONENT_NAME,
|
|
474
600
|
displayName: "Aria Description",
|
|
475
601
|
props: {
|
|
476
|
-
slot: {
|
|
602
|
+
slot: {
|
|
603
|
+
type: "string",
|
|
604
|
+
hidden: () => true,
|
|
605
|
+
defaultValue: "description"
|
|
606
|
+
}
|
|
477
607
|
}
|
|
478
608
|
}));
|
|
479
609
|
}
|
|
480
610
|
|
|
481
|
-
var __defProp$
|
|
482
|
-
var __getOwnPropSymbols$
|
|
483
|
-
var __hasOwnProp$
|
|
484
|
-
var __propIsEnum$
|
|
485
|
-
var __defNormalProp$
|
|
486
|
-
var __spreadValues$
|
|
611
|
+
var __defProp$l = Object.defineProperty;
|
|
612
|
+
var __getOwnPropSymbols$l = Object.getOwnPropertySymbols;
|
|
613
|
+
var __hasOwnProp$l = Object.prototype.hasOwnProperty;
|
|
614
|
+
var __propIsEnum$l = Object.prototype.propertyIsEnumerable;
|
|
615
|
+
var __defNormalProp$l = (obj, key, value) => key in obj ? __defProp$l(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
616
|
+
var __spreadValues$l = (a, b) => {
|
|
487
617
|
for (var prop in b || (b = {}))
|
|
488
|
-
if (__hasOwnProp$
|
|
489
|
-
__defNormalProp$
|
|
490
|
-
if (__getOwnPropSymbols$
|
|
491
|
-
for (var prop of __getOwnPropSymbols$
|
|
492
|
-
if (__propIsEnum$
|
|
493
|
-
__defNormalProp$
|
|
618
|
+
if (__hasOwnProp$l.call(b, prop))
|
|
619
|
+
__defNormalProp$l(a, prop, b[prop]);
|
|
620
|
+
if (__getOwnPropSymbols$l)
|
|
621
|
+
for (var prop of __getOwnPropSymbols$l(b)) {
|
|
622
|
+
if (__propIsEnum$l.call(b, prop))
|
|
623
|
+
__defNormalProp$l(a, prop, b[prop]);
|
|
494
624
|
}
|
|
495
625
|
return a;
|
|
496
626
|
};
|
|
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
|
-
const LABEL_COMPONENT_NAME = makeComponentName("label");
|
|
632
|
-
function registerLabel(loader, overrides) {
|
|
633
|
-
registerComponentHelper(
|
|
634
|
-
loader,
|
|
635
|
-
BaseLabel,
|
|
636
|
-
{
|
|
637
|
-
name: LABEL_COMPONENT_NAME,
|
|
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;
|
|
770
|
+
var __defProp$k = Object.defineProperty;
|
|
656
771
|
var __defProps$9 = Object.defineProperties;
|
|
657
772
|
var __getOwnPropDescs$9 = Object.getOwnPropertyDescriptors;
|
|
658
|
-
var __getOwnPropSymbols$
|
|
659
|
-
var __hasOwnProp$
|
|
660
|
-
var __propIsEnum$
|
|
661
|
-
var __defNormalProp$
|
|
662
|
-
var __spreadValues$
|
|
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
788
|
var __spreadProps$9 = (a, b) => __defProps$9(a, __getOwnPropDescs$9(b));
|
|
674
|
-
|
|
675
|
-
|
|
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$9(__spreadValues$
|
|
811
|
+
props: __spreadProps$9(__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,6 +1088,90 @@ 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
1176
|
var __defProps$8 = Object.defineProperties;
|
|
900
1177
|
var __getOwnPropDescs$8 = Object.getOwnPropertyDescriptors;
|
|
@@ -914,254 +1191,66 @@ var __spreadValues$i = (a, b) => {
|
|
|
914
1191
|
return a;
|
|
915
1192
|
};
|
|
916
1193
|
var __spreadProps$8 = (a, b) => __defProps$8(a, __getOwnPropDescs$8(b));
|
|
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
|
-
if (!options) {
|
|
943
|
-
return options;
|
|
944
|
-
}
|
|
945
|
-
const filterOptions = (opts) => {
|
|
946
|
-
return withoutNils(
|
|
947
|
-
opts.map((op) => {
|
|
948
|
-
if (op.type === "option-group") {
|
|
949
|
-
return __spreadProps$8(__spreadValues$i({}, op), {
|
|
950
|
-
items: op.items ? filterOptions(op.items) : void 0
|
|
951
|
-
});
|
|
952
|
-
} else {
|
|
953
|
-
if (contains(optionText(op), filterValue)) {
|
|
954
|
-
return op;
|
|
955
|
-
} else {
|
|
956
|
-
return void 0;
|
|
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));
|
|
1194
|
+
function BaseListBoxItem(props) {
|
|
1195
|
+
const contextProps = React.useContext(PlasmicItemContext);
|
|
1196
|
+
const mergedProps = mergeProps(contextProps, props);
|
|
1197
|
+
return /* @__PURE__ */ React.createElement(ListBoxItem, __spreadProps$8(__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
|
|
978
1218
|
}
|
|
979
|
-
} else {
|
|
980
|
-
onChange == null ? void 0 : onChange(key);
|
|
981
|
-
}
|
|
982
|
-
if (selectedOption) {
|
|
983
|
-
onFilterValueChange == null ? void 0 : onFilterValueChange(optionText(selectedOption));
|
|
984
1219
|
}
|
|
985
1220
|
},
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
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
|
-
}
|
|
1002
|
-
}
|
|
1003
|
-
}
|
|
1004
|
-
},
|
|
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);
|
|
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}...`
|
|
1023
1231
|
}
|
|
1024
1232
|
}
|
|
1025
1233
|
}
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
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"
|
|
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")
|
|
1066
1249
|
}
|
|
1067
|
-
},
|
|
1068
|
-
/* @__PURE__ */ React.createElement(PlasmicInputContext.Provider, { value: { placeholder } }, structure)
|
|
1069
|
-
),
|
|
1070
|
-
/* @__PURE__ */ React.createElement(BaseComboBoxEffects, { previewOpen })
|
|
1071
|
-
);
|
|
1072
|
-
}
|
|
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
1250
|
}
|
|
1144
1251
|
},
|
|
1145
|
-
|
|
1146
|
-
|
|
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
|
-
});
|
|
1252
|
+
overrides
|
|
1253
|
+
);
|
|
1165
1254
|
}
|
|
1166
1255
|
|
|
1167
1256
|
var __defProp$h = Object.defineProperty;
|
|
@@ -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$7 = Object.defineProperties;
|
|
1357
|
+
var __getOwnPropDescs$7 = 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$7 = (a, b) => __defProps$7(a, __getOwnPropDescs$7(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,194 +1383,598 @@ var __objRest$b = (source, exclude) => {
|
|
|
1348
1383
|
}
|
|
1349
1384
|
return target;
|
|
1350
1385
|
};
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
const
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1386
|
+
function BaseListBox(props) {
|
|
1387
|
+
var _c;
|
|
1388
|
+
const contextProps = React.useContext(PlasmicListBoxContext);
|
|
1389
|
+
const isStandalone = !contextProps;
|
|
1390
|
+
const _a = props, rest = __objRest$c(_a, ["options"]);
|
|
1391
|
+
const { options } = useStrictOptions(props);
|
|
1392
|
+
const _b = mergeProps(
|
|
1393
|
+
contextProps,
|
|
1394
|
+
rest,
|
|
1395
|
+
isStandalone ? { items: options } : {}
|
|
1396
|
+
), { renderItem, renderSection } = _b, mergedProps = __objRest$c(_b, ["renderItem", "renderSection"]);
|
|
1397
|
+
(_c = props.setControlContextData) == null ? void 0 : _c.call(props, {
|
|
1398
|
+
isStandalone
|
|
1399
|
+
});
|
|
1400
|
+
return /* @__PURE__ */ React.createElement(ListBox, __spreadValues$f({}, mergedProps), (item) => {
|
|
1401
|
+
var _a2;
|
|
1402
|
+
if (item.type === "option-group") {
|
|
1403
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
1404
|
+
PlasmicSectionContext.Provider,
|
|
1405
|
+
{
|
|
1406
|
+
value: {
|
|
1407
|
+
renderItem,
|
|
1408
|
+
key: (_a2 = item.key) != null ? _a2 : item.label,
|
|
1409
|
+
section: item
|
|
1410
|
+
}
|
|
1411
|
+
},
|
|
1412
|
+
renderSection == null ? void 0 : renderSection(item)
|
|
1413
|
+
));
|
|
1414
|
+
} else {
|
|
1415
|
+
return /* @__PURE__ */ React.createElement(PlasmicItemContext.Provider, { value: item }, renderItem == null ? void 0 : renderItem(item));
|
|
1416
|
+
}
|
|
1417
|
+
});
|
|
1418
|
+
}
|
|
1419
|
+
const LIST_BOX_COMPONENT_NAME = makeComponentName("listbox");
|
|
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
|
+
});
|
|
1427
|
+
registerComponentHelper(
|
|
1428
|
+
loader,
|
|
1429
|
+
BaseListBox,
|
|
1430
|
+
{
|
|
1431
|
+
name: LIST_BOX_COMPONENT_NAME,
|
|
1432
|
+
displayName: "Aria ListBox",
|
|
1433
|
+
importPath: "@plasmicpkgs/react-aria/skinny/registerListBox",
|
|
1434
|
+
importName: "BaseListBox",
|
|
1435
|
+
defaultStyles: {
|
|
1436
|
+
width: "250px",
|
|
1437
|
+
borderWidth: "1px",
|
|
1438
|
+
borderStyle: "solid",
|
|
1439
|
+
borderColor: "black"
|
|
1369
1440
|
},
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1441
|
+
props: {
|
|
1442
|
+
options: __spreadProps$7(__spreadValues$f({}, makeOptionsPropType()), {
|
|
1443
|
+
displayName: "Items",
|
|
1444
|
+
hidden: (_ps, ctx) => !(ctx == null ? void 0 : ctx.isStandalone)
|
|
1445
|
+
}),
|
|
1446
|
+
renderItem: {
|
|
1447
|
+
type: "slot",
|
|
1448
|
+
displayName: "Render Item",
|
|
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
|
+
}
|
|
1460
|
+
},
|
|
1461
|
+
renderSection: {
|
|
1462
|
+
type: "slot",
|
|
1463
|
+
displayName: "Render Section",
|
|
1464
|
+
renderPropParams: ["sectionProps"],
|
|
1465
|
+
defaultValue: {
|
|
1466
|
+
type: "component",
|
|
1467
|
+
name: sectionMeta.name,
|
|
1468
|
+
styles: {
|
|
1469
|
+
backgroundColor: "#F4FAFF"
|
|
1470
|
+
}
|
|
1471
|
+
}
|
|
1472
|
+
}
|
|
1374
1473
|
}
|
|
1375
|
-
},
|
|
1474
|
+
},
|
|
1475
|
+
overrides
|
|
1376
1476
|
);
|
|
1377
1477
|
}
|
|
1378
|
-
|
|
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) {
|
|
1379
1537
|
registerComponentHelper(
|
|
1380
1538
|
loader,
|
|
1381
|
-
|
|
1539
|
+
BasePopover,
|
|
1382
1540
|
{
|
|
1383
|
-
name:
|
|
1384
|
-
displayName: "Aria
|
|
1385
|
-
importPath: "@plasmicpkgs/react-aria/skinny/
|
|
1386
|
-
importName: "
|
|
1387
|
-
|
|
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
|
+
},
|
|
1388
1553
|
props: {
|
|
1389
|
-
|
|
1390
|
-
type: "
|
|
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$6 = Object.defineProperties;
|
|
1615
|
+
var __getOwnPropDescs$6 = 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$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(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$6(__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"
|
|
1391
1781
|
}
|
|
1392
1782
|
},
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1783
|
+
/* @__PURE__ */ React.createElement(PlasmicInputContext.Provider, { value: { placeholder } }, structure)
|
|
1784
|
+
),
|
|
1785
|
+
/* @__PURE__ */ React.createElement(BaseComboBoxEffects, { previewOpen })
|
|
1396
1786
|
);
|
|
1397
1787
|
}
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
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
|
-
}
|
|
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();
|
|
1433
1798
|
}
|
|
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
|
-
function BaseListBox(props) {
|
|
1471
|
-
var _c;
|
|
1472
|
-
const contextProps = React.useContext(PlasmicListBoxContext);
|
|
1473
|
-
const isStandalone = !contextProps;
|
|
1474
|
-
const _a = props, rest = __objRest$a(_a, ["options"]);
|
|
1475
|
-
const { options } = useStrictOptions(props);
|
|
1476
|
-
const _b = mergeProps(
|
|
1477
|
-
contextProps,
|
|
1478
|
-
rest,
|
|
1479
|
-
isStandalone ? { items: options } : {}
|
|
1480
|
-
), { renderItem, renderSection } = _b, mergedProps = __objRest$a(_b, ["renderItem", "renderSection"]);
|
|
1481
|
-
(_c = props.setControlContextData) == null ? void 0 : _c.call(props, {
|
|
1482
|
-
isStandalone
|
|
1483
|
-
});
|
|
1484
|
-
return /* @__PURE__ */ React.createElement(ListBox, __spreadValues$d({}, mergedProps), (item) => {
|
|
1485
|
-
var _a2;
|
|
1486
|
-
if (item.type === "option-group") {
|
|
1487
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
1488
|
-
PlasmicSectionContext.Provider,
|
|
1489
|
-
{
|
|
1490
|
-
value: {
|
|
1491
|
-
renderItem,
|
|
1492
|
-
key: (_a2 = item.key) != null ? _a2 : item.label,
|
|
1493
|
-
section: item
|
|
1494
|
-
}
|
|
1495
|
-
},
|
|
1496
|
-
renderSection == null ? void 0 : renderSection(item)
|
|
1497
|
-
));
|
|
1498
|
-
} else {
|
|
1499
|
-
return /* @__PURE__ */ React.createElement(PlasmicItemContext.Provider, { value: item }, renderItem == null ? void 0 : renderItem(item));
|
|
1500
1799
|
}
|
|
1501
|
-
|
|
1800
|
+
prevPreviewOpenRef.current = previewOpen;
|
|
1801
|
+
}, [previewOpen, comboBoxState, prevPreviewOpenRef]);
|
|
1802
|
+
return null;
|
|
1502
1803
|
}
|
|
1503
|
-
function
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
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
|
|
1527
1951
|
}
|
|
1528
1952
|
},
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
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
|
|
|
1536
1975
|
var __defProp$c = Object.defineProperty;
|
|
1537
|
-
var __defProps$
|
|
1538
|
-
var __getOwnPropDescs$
|
|
1976
|
+
var __defProps$5 = Object.defineProperties;
|
|
1977
|
+
var __getOwnPropDescs$5 = Object.getOwnPropertyDescriptors;
|
|
1539
1978
|
var __getOwnPropSymbols$c = Object.getOwnPropertySymbols;
|
|
1540
1979
|
var __hasOwnProp$c = Object.prototype.hasOwnProperty;
|
|
1541
1980
|
var __propIsEnum$c = Object.prototype.propertyIsEnumerable;
|
|
@@ -1551,8 +1990,8 @@ var __spreadValues$c = (a, b) => {
|
|
|
1551
1990
|
}
|
|
1552
1991
|
return a;
|
|
1553
1992
|
};
|
|
1554
|
-
var __spreadProps$
|
|
1555
|
-
var __objRest$
|
|
1993
|
+
var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));
|
|
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$
|
|
2045
|
+
__spreadProps$5(__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,33 +2354,33 @@ class ErrorBoundary extends Component {
|
|
|
1763
2354
|
}
|
|
1764
2355
|
}
|
|
1765
2356
|
|
|
1766
|
-
var __defProp$
|
|
1767
|
-
var __defProps$
|
|
1768
|
-
var __getOwnPropDescs$
|
|
1769
|
-
var __getOwnPropSymbols$
|
|
1770
|
-
var __hasOwnProp$
|
|
1771
|
-
var __propIsEnum$
|
|
1772
|
-
var __defNormalProp$
|
|
1773
|
-
var __spreadValues$
|
|
2357
|
+
var __defProp$9 = Object.defineProperty;
|
|
2358
|
+
var __defProps$4 = Object.defineProperties;
|
|
2359
|
+
var __getOwnPropDescs$4 = Object.getOwnPropertyDescriptors;
|
|
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
|
};
|
|
1784
|
-
var __spreadProps$
|
|
2375
|
+
var __spreadProps$4 = (a, b) => __defProps$4(a, __getOwnPropDescs$4(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$
|
|
2458
|
+
props: __spreadProps$4(__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$
|
|
1860
|
-
var __getOwnPropDescs$
|
|
1861
|
-
var __getOwnPropSymbols$
|
|
1862
|
-
var __hasOwnProp$
|
|
1863
|
-
var __propIsEnum$
|
|
1864
|
-
var __defNormalProp$
|
|
1865
|
-
var __spreadValues$
|
|
2491
|
+
var __defProp$8 = Object.defineProperty;
|
|
2492
|
+
var __defProps$3 = Object.defineProperties;
|
|
2493
|
+
var __getOwnPropDescs$3 = 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
|
-
var __spreadProps$
|
|
1877
|
-
|
|
1878
|
-
|
|
2509
|
+
var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b));
|
|
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$
|
|
2530
|
+
props: __spreadProps$3(__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;
|
|
@@ -2296,7 +3012,11 @@ function registerSliderThumb(loader, overrides) {
|
|
|
2296
3012
|
},
|
|
2297
3013
|
interactionVariants: interactionVariants$3,
|
|
2298
3014
|
props: {
|
|
2299
|
-
advanced:
|
|
3015
|
+
advanced: {
|
|
3016
|
+
type: "boolean",
|
|
3017
|
+
displayName: "Advanced",
|
|
3018
|
+
description: "Enables the children slot for creating a more customized thumb"
|
|
3019
|
+
},
|
|
2300
3020
|
children: {
|
|
2301
3021
|
type: "slot",
|
|
2302
3022
|
hidden: (ps) => !ps.advanced
|
|
@@ -2376,18 +3096,13 @@ function BaseSliderTrack(props) {
|
|
|
2376
3096
|
);
|
|
2377
3097
|
const thumbs = useMemo(() => {
|
|
2378
3098
|
const rawThumbs = flattenChildren(children);
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
}
|
|
2382
|
-
if (!Array.isArray(mergedProps == null ? void 0 : mergedProps.value)) {
|
|
2383
|
-
return rawThumbs;
|
|
2384
|
-
}
|
|
2385
|
-
const difference = mergedProps.value.length - rawThumbs.length;
|
|
3099
|
+
const values = Array.isArray(mergedProps == null ? void 0 : mergedProps.value) ? mergedProps.value : [mergedProps.value].filter((v) => v !== void 0);
|
|
3100
|
+
const difference = values.length - rawThumbs.length;
|
|
2386
3101
|
if (!difference) {
|
|
2387
3102
|
return rawThumbs;
|
|
2388
3103
|
}
|
|
2389
3104
|
if (difference < 0) {
|
|
2390
|
-
return rawThumbs.slice(0,
|
|
3105
|
+
return rawThumbs.slice(0, values.length);
|
|
2391
3106
|
}
|
|
2392
3107
|
const lastThumb = rawThumbs[rawThumbs.length - 1];
|
|
2393
3108
|
return rawThumbs.concat(new Array(difference).fill(lastThumb));
|
|
@@ -2479,8 +3194,8 @@ function registerSliderTrack(loader, overrides) {
|
|
|
2479
3194
|
}
|
|
2480
3195
|
|
|
2481
3196
|
var __defProp$4 = Object.defineProperty;
|
|
2482
|
-
var __defProps$
|
|
2483
|
-
var __getOwnPropDescs$
|
|
3197
|
+
var __defProps$2 = Object.defineProperties;
|
|
3198
|
+
var __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors;
|
|
2484
3199
|
var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
|
|
2485
3200
|
var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
|
|
2486
3201
|
var __propIsEnum$4 = Object.prototype.propertyIsEnumerable;
|
|
@@ -2496,7 +3211,7 @@ var __spreadValues$4 = (a, b) => {
|
|
|
2496
3211
|
}
|
|
2497
3212
|
return a;
|
|
2498
3213
|
};
|
|
2499
|
-
var __spreadProps$
|
|
3214
|
+
var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));
|
|
2500
3215
|
var __objRest$4 = (source, exclude) => {
|
|
2501
3216
|
var target = {};
|
|
2502
3217
|
for (var prop in source)
|
|
@@ -2576,7 +3291,7 @@ function registerSlider(loader, overrides) {
|
|
|
2576
3291
|
defaultStyles: {
|
|
2577
3292
|
width: "300px"
|
|
2578
3293
|
},
|
|
2579
|
-
props: __spreadProps$
|
|
3294
|
+
props: __spreadProps$2(__spreadValues$4({}, getCommonInputProps("slider", [
|
|
2580
3295
|
"isDisabled",
|
|
2581
3296
|
"name",
|
|
2582
3297
|
"autoFocus",
|
|
@@ -2719,8 +3434,8 @@ function registerSlider(loader, overrides) {
|
|
|
2719
3434
|
}
|
|
2720
3435
|
|
|
2721
3436
|
var __defProp$3 = Object.defineProperty;
|
|
2722
|
-
var __defProps$
|
|
2723
|
-
var __getOwnPropDescs$
|
|
3437
|
+
var __defProps$1 = Object.defineProperties;
|
|
3438
|
+
var __getOwnPropDescs$1 = Object.getOwnPropertyDescriptors;
|
|
2724
3439
|
var __getOwnPropSymbols$3 = Object.getOwnPropertySymbols;
|
|
2725
3440
|
var __hasOwnProp$3 = Object.prototype.hasOwnProperty;
|
|
2726
3441
|
var __propIsEnum$3 = Object.prototype.propertyIsEnumerable;
|
|
@@ -2736,7 +3451,7 @@ var __spreadValues$3 = (a, b) => {
|
|
|
2736
3451
|
}
|
|
2737
3452
|
return a;
|
|
2738
3453
|
};
|
|
2739
|
-
var __spreadProps$
|
|
3454
|
+
var __spreadProps$1 = (a, b) => __defProps$1(a, __getOwnPropDescs$1(b));
|
|
2740
3455
|
var __objRest$3 = (source, exclude) => {
|
|
2741
3456
|
var target = {};
|
|
2742
3457
|
for (var prop in source)
|
|
@@ -2781,14 +3496,91 @@ function registerSwitch(loader, overrides) {
|
|
|
2781
3496
|
importPath: "@plasmicpkgs/react-aria/skinny/registerSwitch",
|
|
2782
3497
|
importName: "BaseSwitch",
|
|
2783
3498
|
interactionVariants: interactionVariants$1,
|
|
2784
|
-
|
|
3499
|
+
defaultStyles: {
|
|
3500
|
+
display: "flex",
|
|
3501
|
+
flexDirection: "column",
|
|
3502
|
+
alignItems: "center",
|
|
3503
|
+
justifyContent: "flex-start",
|
|
3504
|
+
padding: 0
|
|
3505
|
+
},
|
|
3506
|
+
props: __spreadProps$1(__spreadValues$3({}, getCommonInputProps("switch", [
|
|
2785
3507
|
"name",
|
|
2786
3508
|
"isDisabled",
|
|
2787
3509
|
"isReadOnly",
|
|
2788
3510
|
"autoFocus",
|
|
2789
|
-
"aria-label"
|
|
2790
|
-
"children"
|
|
3511
|
+
"aria-label"
|
|
2791
3512
|
])), {
|
|
3513
|
+
children: {
|
|
3514
|
+
type: "slot",
|
|
3515
|
+
mergeWithParent: true,
|
|
3516
|
+
defaultValue: [
|
|
3517
|
+
{
|
|
3518
|
+
type: "hbox",
|
|
3519
|
+
styles: {
|
|
3520
|
+
display: "flex",
|
|
3521
|
+
alignItems: "center",
|
|
3522
|
+
justifyContent: "center",
|
|
3523
|
+
gap: "10px",
|
|
3524
|
+
padding: 0
|
|
3525
|
+
},
|
|
3526
|
+
children: [
|
|
3527
|
+
{
|
|
3528
|
+
// the track
|
|
3529
|
+
type: "hbox",
|
|
3530
|
+
styles: {
|
|
3531
|
+
width: "30px",
|
|
3532
|
+
height: "16px",
|
|
3533
|
+
padding: 0,
|
|
3534
|
+
backgroundColor: "#D5D5D5",
|
|
3535
|
+
cursor: "pointer",
|
|
3536
|
+
borderRadius: "999px"
|
|
3537
|
+
},
|
|
3538
|
+
children: {
|
|
3539
|
+
// the thumb
|
|
3540
|
+
type: "hbox",
|
|
3541
|
+
styles: {
|
|
3542
|
+
width: "12px",
|
|
3543
|
+
height: "12px",
|
|
3544
|
+
position: "absolute",
|
|
3545
|
+
top: "2px",
|
|
3546
|
+
left: "2px",
|
|
3547
|
+
borderRadius: "100%",
|
|
3548
|
+
backgroundColor: "#fff",
|
|
3549
|
+
padding: 0,
|
|
3550
|
+
transitionProperty: "all",
|
|
3551
|
+
transitionDuration: "0.5s",
|
|
3552
|
+
transitionTimingFunction: "ease-in-out"
|
|
3553
|
+
}
|
|
3554
|
+
}
|
|
3555
|
+
},
|
|
3556
|
+
{
|
|
3557
|
+
// the label
|
|
3558
|
+
type: "component",
|
|
3559
|
+
name: LABEL_COMPONENT_NAME,
|
|
3560
|
+
props: {
|
|
3561
|
+
children: {
|
|
3562
|
+
type: "text",
|
|
3563
|
+
value: "Label"
|
|
3564
|
+
}
|
|
3565
|
+
}
|
|
3566
|
+
}
|
|
3567
|
+
]
|
|
3568
|
+
},
|
|
3569
|
+
{
|
|
3570
|
+
type: "component",
|
|
3571
|
+
name: DESCRIPTION_COMPONENT_NAME,
|
|
3572
|
+
styles: {
|
|
3573
|
+
fontSize: "12px"
|
|
3574
|
+
},
|
|
3575
|
+
props: {
|
|
3576
|
+
children: {
|
|
3577
|
+
type: "text",
|
|
3578
|
+
value: "Add interaction variants to see it in action..."
|
|
3579
|
+
}
|
|
3580
|
+
}
|
|
3581
|
+
}
|
|
3582
|
+
]
|
|
3583
|
+
},
|
|
2792
3584
|
value: {
|
|
2793
3585
|
type: "boolean",
|
|
2794
3586
|
editOnly: true,
|
|
@@ -2913,8 +3705,8 @@ function registerTextArea(loader, overrides) {
|
|
|
2913
3705
|
}
|
|
2914
3706
|
|
|
2915
3707
|
var __defProp$1 = Object.defineProperty;
|
|
2916
|
-
var __defProps
|
|
2917
|
-
var __getOwnPropDescs
|
|
3708
|
+
var __defProps = Object.defineProperties;
|
|
3709
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
2918
3710
|
var __getOwnPropSymbols$1 = Object.getOwnPropertySymbols;
|
|
2919
3711
|
var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
|
|
2920
3712
|
var __propIsEnum$1 = Object.prototype.propertyIsEnumerable;
|
|
@@ -2930,7 +3722,7 @@ var __spreadValues$1 = (a, b) => {
|
|
|
2930
3722
|
}
|
|
2931
3723
|
return a;
|
|
2932
3724
|
};
|
|
2933
|
-
var __spreadProps
|
|
3725
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
2934
3726
|
var __objRest$1 = (source, exclude) => {
|
|
2935
3727
|
var target = {};
|
|
2936
3728
|
for (var prop in source)
|
|
@@ -2953,26 +3745,67 @@ function BaseTextField(props) {
|
|
|
2953
3745
|
children
|
|
2954
3746
|
);
|
|
2955
3747
|
}
|
|
2956
|
-
const
|
|
3748
|
+
const TEXT_FIELD_COMPONENT_NAME = makeComponentName("textField");
|
|
2957
3749
|
function registerTextField(loader, overrides) {
|
|
2958
3750
|
registerComponentHelper(
|
|
2959
3751
|
loader,
|
|
2960
3752
|
BaseTextField,
|
|
2961
3753
|
{
|
|
2962
|
-
name:
|
|
3754
|
+
name: TEXT_FIELD_COMPONENT_NAME,
|
|
2963
3755
|
displayName: "Aria TextField",
|
|
2964
3756
|
importPath: "@plasmicpkgs/react-aria/skinny/registerTextField",
|
|
2965
3757
|
importName: "BaseTextField",
|
|
2966
3758
|
// TODO: Support for validate prop
|
|
2967
|
-
props: __spreadProps
|
|
3759
|
+
props: __spreadProps(__spreadValues$1({}, getCommonInputProps("input", [
|
|
2968
3760
|
"name",
|
|
2969
3761
|
"isDisabled",
|
|
2970
3762
|
"isReadOnly",
|
|
2971
3763
|
"autoFocus",
|
|
2972
3764
|
"aria-label",
|
|
2973
|
-
"children",
|
|
2974
3765
|
"isRequired"
|
|
2975
3766
|
])), {
|
|
3767
|
+
children: {
|
|
3768
|
+
type: "slot",
|
|
3769
|
+
mergeWithParent: true,
|
|
3770
|
+
defaultValue: {
|
|
3771
|
+
type: "vbox",
|
|
3772
|
+
styles: {
|
|
3773
|
+
justifyContent: "flex-start",
|
|
3774
|
+
alignItems: "flex-start",
|
|
3775
|
+
width: "300px",
|
|
3776
|
+
gap: "5px"
|
|
3777
|
+
},
|
|
3778
|
+
children: [
|
|
3779
|
+
{
|
|
3780
|
+
type: "component",
|
|
3781
|
+
name: LABEL_COMPONENT_NAME,
|
|
3782
|
+
props: {
|
|
3783
|
+
children: {
|
|
3784
|
+
type: "text",
|
|
3785
|
+
value: "Label"
|
|
3786
|
+
}
|
|
3787
|
+
}
|
|
3788
|
+
},
|
|
3789
|
+
{
|
|
3790
|
+
type: "component",
|
|
3791
|
+
name: INPUT_COMPONENT_NAME,
|
|
3792
|
+
styles: {
|
|
3793
|
+
width: "100%"
|
|
3794
|
+
}
|
|
3795
|
+
},
|
|
3796
|
+
{
|
|
3797
|
+
type: "component",
|
|
3798
|
+
name: DESCRIPTION_COMPONENT_NAME,
|
|
3799
|
+
props: {
|
|
3800
|
+
children: {
|
|
3801
|
+
type: "text",
|
|
3802
|
+
value: "Type something..."
|
|
3803
|
+
}
|
|
3804
|
+
}
|
|
3805
|
+
}
|
|
3806
|
+
]
|
|
3807
|
+
}
|
|
3808
|
+
},
|
|
2976
3809
|
value: {
|
|
2977
3810
|
type: "string",
|
|
2978
3811
|
editOnly: true,
|
|
@@ -3188,18 +4021,15 @@ function registerTextField(loader, overrides) {
|
|
|
3188
4021
|
);
|
|
3189
4022
|
const thisName = makeChildComponentName(
|
|
3190
4023
|
overrides == null ? void 0 : overrides.parentComponentName,
|
|
3191
|
-
|
|
4024
|
+
TEXT_FIELD_COMPONENT_NAME
|
|
3192
4025
|
);
|
|
3193
4026
|
registerFieldError(loader, { parentComponentName: thisName });
|
|
3194
4027
|
registerInput(loader, { parentComponentName: thisName });
|
|
3195
4028
|
registerLabel(loader, { parentComponentName: thisName });
|
|
3196
|
-
registerDescription(loader, { parentComponentName: thisName });
|
|
3197
4029
|
registerTextArea(loader, { parentComponentName: thisName });
|
|
3198
4030
|
}
|
|
3199
4031
|
|
|
3200
4032
|
var __defProp = Object.defineProperty;
|
|
3201
|
-
var __defProps = Object.defineProperties;
|
|
3202
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
3203
4033
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3204
4034
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
3205
4035
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
@@ -3215,7 +4045,6 @@ var __spreadValues = (a, b) => {
|
|
|
3215
4045
|
}
|
|
3216
4046
|
return a;
|
|
3217
4047
|
};
|
|
3218
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
3219
4048
|
var __objRest = (source, exclude) => {
|
|
3220
4049
|
var target = {};
|
|
3221
4050
|
for (var prop in source)
|
|
@@ -3237,11 +4066,13 @@ function BaseTooltip(props) {
|
|
|
3237
4066
|
state,
|
|
3238
4067
|
ref
|
|
3239
4068
|
);
|
|
4069
|
+
const hasContent = tooltipContent && tooltipContent.type.name !== "CanvasSlotPlaceholder";
|
|
3240
4070
|
const focusableChild = flattenChildren(children)[0];
|
|
3241
4071
|
return /* @__PURE__ */ React.createElement(
|
|
3242
4072
|
"div",
|
|
3243
4073
|
{
|
|
3244
|
-
style: { position: "relative" }
|
|
4074
|
+
style: { position: "relative" },
|
|
4075
|
+
className: resetClassName
|
|
3245
4076
|
},
|
|
3246
4077
|
React.isValidElement(focusableChild) ? React.cloneElement(focusableChild, __spreadValues({
|
|
3247
4078
|
ref
|
|
@@ -3249,7 +4080,10 @@ function BaseTooltip(props) {
|
|
|
3249
4080
|
focusableChild.props,
|
|
3250
4081
|
triggerProps
|
|
3251
4082
|
))) : null,
|
|
3252
|
-
state.isOpen && /* @__PURE__ */ React.createElement(
|
|
4083
|
+
state.isOpen && /* @__PURE__ */ React.createElement(React.Fragment, null, React.cloneElement(
|
|
4084
|
+
hasContent ? tooltipContent : /* @__PURE__ */ React.createElement("p", null, "Add some content to the tooltip..."),
|
|
4085
|
+
mergeProps(tooltipProps, tooltipContent == null ? void 0 : tooltipContent.props.attrs, { className })
|
|
4086
|
+
))
|
|
3253
4087
|
);
|
|
3254
4088
|
}
|
|
3255
4089
|
function registerTooltip(loader, overrides) {
|
|
@@ -3327,6 +4161,8 @@ function registerTooltip(loader, overrides) {
|
|
|
3327
4161
|
}
|
|
3328
4162
|
|
|
3329
4163
|
function registerAll(loader) {
|
|
4164
|
+
registerText(loader);
|
|
4165
|
+
registerDescription(loader);
|
|
3330
4166
|
registerSelect(loader);
|
|
3331
4167
|
registerComboBox(loader);
|
|
3332
4168
|
registerButton(loader);
|
|
@@ -3334,7 +4170,6 @@ function registerAll(loader) {
|
|
|
3334
4170
|
registerListBox(loader);
|
|
3335
4171
|
registerPopover(loader);
|
|
3336
4172
|
registerInput(loader);
|
|
3337
|
-
registerSection(loader);
|
|
3338
4173
|
registerSwitch(loader);
|
|
3339
4174
|
registerForm(loader);
|
|
3340
4175
|
registerCheckbox(loader);
|