@plasmicpkgs/react-aria 0.0.28 → 0.0.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.tsbuildinfo +1 -1
- package/dist/contexts.d.ts +4 -0
- package/dist/interaction-variant-utils.d.ts +4 -0
- package/dist/react-aria.esm.js +2494 -1120
- package/dist/react-aria.esm.js.map +1 -1
- package/dist/react-aria.js +2491 -1117
- 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/registerLabel.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/registerSlider.d.ts +14 -0
- package/dist/registerSliderOutput.d.ts +5 -0
- package/dist/registerSliderThumb.d.ts +13 -0
- package/dist/registerSliderTrack.d.ts +14 -0
- package/dist/registerText.d.ts +2 -1
- package/dist/registerTextField.d.ts +1 -0
- package/dist/utils.d.ts +9 -2
- package/package.json +2 -2
- package/skinny/ErrorBoundary-c6b111d3.esm.js +20 -0
- package/skinny/ErrorBoundary-c6b111d3.esm.js.map +1 -0
- package/skinny/ErrorBoundary-e9b86248.cjs.js +22 -0
- package/skinny/ErrorBoundary-e9b86248.cjs.js.map +1 -0
- package/skinny/contexts-9475faad.esm.js +16 -0
- package/skinny/contexts-9475faad.esm.js.map +1 -0
- package/skinny/{contexts-3e42cdf9.cjs.js → contexts-b21f6b12.cjs.js} +9 -1
- package/skinny/contexts-b21f6b12.cjs.js.map +1 -0
- package/skinny/contexts.d.ts +4 -0
- package/skinny/{interaction-variant-utils-0f05190f.cjs.js → interaction-variant-utils-244b74fb.cjs.js} +5 -1
- package/skinny/interaction-variant-utils-244b74fb.cjs.js.map +1 -0
- package/skinny/{interaction-variant-utils-909267e5.esm.js → interaction-variant-utils-c44a9d56.esm.js} +5 -1
- package/skinny/interaction-variant-utils-c44a9d56.esm.js.map +1 -0
- package/skinny/interaction-variant-utils.d.ts +4 -0
- package/skinny/registerButton.cjs.js +20 -5
- package/skinny/registerButton.cjs.js.map +1 -1
- package/skinny/registerButton.d.ts +1 -0
- package/skinny/registerButton.esm.js +20 -6
- package/skinny/registerButton.esm.js.map +1 -1
- package/skinny/registerCheckbox.cjs.js +76 -7
- package/skinny/registerCheckbox.cjs.js.map +1 -1
- package/skinny/registerCheckbox.d.ts +8 -2
- package/skinny/registerCheckbox.esm.js +76 -8
- package/skinny/registerCheckbox.esm.js.map +1 -1
- package/skinny/registerCheckboxGroup.cjs.js +90 -14
- package/skinny/registerCheckboxGroup.cjs.js.map +1 -1
- package/skinny/registerCheckboxGroup.d.ts +2 -2
- package/skinny/registerCheckboxGroup.esm.js +89 -17
- 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 +12 -3
- package/skinny/registerInput.cjs.js.map +1 -1
- package/skinny/registerInput.d.ts +1 -0
- package/skinny/registerInput.esm.js +12 -4
- package/skinny/registerInput.esm.js.map +1 -1
- package/skinny/registerLabel.cjs.js +7 -2
- package/skinny/registerLabel.cjs.js.map +1 -1
- package/skinny/registerLabel.d.ts +1 -0
- package/skinny/registerLabel.esm.js +7 -3
- package/skinny/registerLabel.esm.js.map +1 -1
- package/skinny/registerListBox-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 +54 -24
- package/skinny/registerRadio.cjs.js.map +1 -1
- package/skinny/registerRadio.d.ts +5 -2
- package/skinny/registerRadio.esm.js +54 -25
- package/skinny/registerRadio.esm.js.map +1 -1
- package/skinny/registerRadioGroup.cjs.js +82 -17
- package/skinny/registerRadioGroup.cjs.js.map +1 -1
- package/skinny/registerRadioGroup.d.ts +3 -3
- package/skinny/registerRadioGroup.esm.js +81 -20
- 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-39783c91.esm.js +425 -0
- package/skinny/registerSlider-39783c91.esm.js.map +1 -0
- package/skinny/registerSlider-ac9f3b1e.cjs.js +437 -0
- package/skinny/registerSlider-ac9f3b1e.cjs.js.map +1 -0
- package/skinny/registerSlider.cjs.js +23 -0
- package/skinny/registerSlider.cjs.js.map +1 -0
- package/skinny/registerSlider.d.ts +14 -0
- package/skinny/registerSlider.esm.js +15 -0
- package/skinny/registerSlider.esm.js.map +1 -0
- package/skinny/registerSliderOutput.cjs.js +30 -0
- package/skinny/registerSliderOutput.cjs.js.map +1 -0
- package/skinny/registerSliderOutput.d.ts +5 -0
- package/skinny/registerSliderOutput.esm.js +26 -0
- package/skinny/registerSliderOutput.esm.js.map +1 -0
- package/skinny/registerSliderThumb.cjs.js +119 -0
- package/skinny/registerSliderThumb.cjs.js.map +1 -0
- package/skinny/registerSliderThumb.d.ts +13 -0
- package/skinny/registerSliderThumb.esm.js +111 -0
- package/skinny/registerSliderThumb.esm.js.map +1 -0
- package/skinny/registerSliderTrack.cjs.js +23 -0
- package/skinny/registerSliderTrack.cjs.js.map +1 -0
- package/skinny/registerSliderTrack.d.ts +14 -0
- package/skinny/registerSliderTrack.esm.js +15 -0
- package/skinny/registerSliderTrack.esm.js.map +1 -0
- package/skinny/registerSwitch.cjs.js +84 -4
- package/skinny/registerSwitch.cjs.js.map +1 -1
- package/skinny/registerSwitch.esm.js +84 -4
- 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 +2 -2
- package/skinny/registerTextArea.esm.js +2 -2
- package/skinny/registerTextField.cjs.js +48 -7
- package/skinny/registerTextField.cjs.js.map +1 -1
- package/skinny/registerTextField.d.ts +1 -0
- package/skinny/registerTextField.esm.js +51 -11
- package/skinny/registerTextField.esm.js.map +1 -1
- package/skinny/registerTooltip.cjs.js +1 -1
- package/skinny/registerTooltip.esm.js +1 -1
- package/skinny/{utils-cf2632c9.esm.js → utils-5051df41.esm.js} +3 -2
- package/skinny/utils-5051df41.esm.js.map +1 -0
- package/skinny/{utils-18b2465b.cjs.js → utils-745db876.cjs.js} +2 -1
- package/skinny/utils-745db876.cjs.js.map +1 -0
- package/skinny/utils.d.ts +9 -2
- package/skinny/contexts-3e42cdf9.cjs.js.map +0 -1
- package/skinny/contexts-49f6c298.esm.js +0 -12
- package/skinny/contexts-49f6c298.esm.js.map +0 -1
- package/skinny/interaction-variant-utils-0f05190f.cjs.js.map +0 -1
- package/skinny/interaction-variant-utils-909267e5.esm.js.map +0 -1
- package/skinny/option-utils-4f037568.esm.js +0 -153
- package/skinny/option-utils-4f037568.esm.js.map +0 -1
- package/skinny/option-utils-5e4e85bd.cjs.js +0 -162
- package/skinny/option-utils-5e4e85bd.cjs.js.map +0 -1
- package/skinny/utils-18b2465b.cjs.js.map +0 -1
- package/skinny/utils-cf2632c9.esm.js.map +0 -1
package/dist/react-aria.js
CHANGED
|
@@ -82,6 +82,10 @@ const ARIA_COMPONENTS_INTERACTION_VARIANTS = {
|
|
|
82
82
|
focusVisible: {
|
|
83
83
|
cssSelector: "[data-focus-visible]",
|
|
84
84
|
displayName: "Focus Visible"
|
|
85
|
+
},
|
|
86
|
+
dragging: {
|
|
87
|
+
cssSelector: "[data-dragging]",
|
|
88
|
+
displayName: "Dragging"
|
|
85
89
|
}
|
|
86
90
|
};
|
|
87
91
|
function ChangesObserver({
|
|
@@ -115,29 +119,29 @@ function pickAriaComponentVariants(keys) {
|
|
|
115
119
|
};
|
|
116
120
|
}
|
|
117
121
|
|
|
118
|
-
var __defProp$
|
|
119
|
-
var __defProps$
|
|
120
|
-
var __getOwnPropDescs$
|
|
121
|
-
var __getOwnPropSymbols$
|
|
122
|
-
var __hasOwnProp$
|
|
123
|
-
var __propIsEnum$
|
|
124
|
-
var __defNormalProp$
|
|
125
|
-
var __spreadValues$
|
|
122
|
+
var __defProp$q = Object.defineProperty;
|
|
123
|
+
var __defProps$e = Object.defineProperties;
|
|
124
|
+
var __getOwnPropDescs$e = Object.getOwnPropertyDescriptors;
|
|
125
|
+
var __getOwnPropSymbols$q = Object.getOwnPropertySymbols;
|
|
126
|
+
var __hasOwnProp$q = Object.prototype.hasOwnProperty;
|
|
127
|
+
var __propIsEnum$q = Object.prototype.propertyIsEnumerable;
|
|
128
|
+
var __defNormalProp$q = (obj, key, value) => key in obj ? __defProp$q(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
129
|
+
var __spreadValues$q = (a, b) => {
|
|
126
130
|
for (var prop in b || (b = {}))
|
|
127
|
-
if (__hasOwnProp$
|
|
128
|
-
__defNormalProp$
|
|
129
|
-
if (__getOwnPropSymbols$
|
|
130
|
-
for (var prop of __getOwnPropSymbols$
|
|
131
|
-
if (__propIsEnum$
|
|
132
|
-
__defNormalProp$
|
|
131
|
+
if (__hasOwnProp$q.call(b, prop))
|
|
132
|
+
__defNormalProp$q(a, prop, b[prop]);
|
|
133
|
+
if (__getOwnPropSymbols$q)
|
|
134
|
+
for (var prop of __getOwnPropSymbols$q(b)) {
|
|
135
|
+
if (__propIsEnum$q.call(b, prop))
|
|
136
|
+
__defNormalProp$q(a, prop, b[prop]);
|
|
133
137
|
}
|
|
134
138
|
return a;
|
|
135
139
|
};
|
|
136
|
-
var __spreadProps$
|
|
140
|
+
var __spreadProps$e = (a, b) => __defProps$e(a, __getOwnPropDescs$e(b));
|
|
137
141
|
function registerComponentHelper(loader, component, meta, overrides) {
|
|
138
142
|
if (overrides) {
|
|
139
|
-
meta = __spreadProps$
|
|
140
|
-
props: __spreadValues$
|
|
143
|
+
meta = __spreadProps$e(__spreadValues$q(__spreadValues$q({}, meta), overrides), {
|
|
144
|
+
props: __spreadValues$q(__spreadValues$q({}, meta.props), overrides.props)
|
|
141
145
|
});
|
|
142
146
|
if (overrides.parentComponentName) {
|
|
143
147
|
meta.name = makeChildComponentName(
|
|
@@ -151,6 +155,7 @@ function registerComponentHelper(loader, component, meta, overrides) {
|
|
|
151
155
|
} else {
|
|
152
156
|
registerComponent__default.default(component, meta);
|
|
153
157
|
}
|
|
158
|
+
return meta;
|
|
154
159
|
}
|
|
155
160
|
function makeComponentName(name) {
|
|
156
161
|
return `plasmic-react-aria-${name}`;
|
|
@@ -173,33 +178,33 @@ function withoutNils(array) {
|
|
|
173
178
|
return array.filter((x) => x != null);
|
|
174
179
|
}
|
|
175
180
|
|
|
176
|
-
var __defProp$
|
|
177
|
-
var __defProps$
|
|
178
|
-
var __getOwnPropDescs$
|
|
179
|
-
var __getOwnPropSymbols$
|
|
180
|
-
var __hasOwnProp$
|
|
181
|
-
var __propIsEnum$
|
|
182
|
-
var __defNormalProp$
|
|
183
|
-
var __spreadValues$
|
|
181
|
+
var __defProp$p = Object.defineProperty;
|
|
182
|
+
var __defProps$d = Object.defineProperties;
|
|
183
|
+
var __getOwnPropDescs$d = Object.getOwnPropertyDescriptors;
|
|
184
|
+
var __getOwnPropSymbols$p = Object.getOwnPropertySymbols;
|
|
185
|
+
var __hasOwnProp$p = Object.prototype.hasOwnProperty;
|
|
186
|
+
var __propIsEnum$p = Object.prototype.propertyIsEnumerable;
|
|
187
|
+
var __defNormalProp$p = (obj, key, value) => key in obj ? __defProp$p(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
188
|
+
var __spreadValues$p = (a, b) => {
|
|
184
189
|
for (var prop in b || (b = {}))
|
|
185
|
-
if (__hasOwnProp$
|
|
186
|
-
__defNormalProp$
|
|
187
|
-
if (__getOwnPropSymbols$
|
|
188
|
-
for (var prop of __getOwnPropSymbols$
|
|
189
|
-
if (__propIsEnum$
|
|
190
|
-
__defNormalProp$
|
|
190
|
+
if (__hasOwnProp$p.call(b, prop))
|
|
191
|
+
__defNormalProp$p(a, prop, b[prop]);
|
|
192
|
+
if (__getOwnPropSymbols$p)
|
|
193
|
+
for (var prop of __getOwnPropSymbols$p(b)) {
|
|
194
|
+
if (__propIsEnum$p.call(b, prop))
|
|
195
|
+
__defNormalProp$p(a, prop, b[prop]);
|
|
191
196
|
}
|
|
192
197
|
return a;
|
|
193
198
|
};
|
|
194
|
-
var __spreadProps$
|
|
195
|
-
var __objRest$
|
|
199
|
+
var __spreadProps$d = (a, b) => __defProps$d(a, __getOwnPropDescs$d(b));
|
|
200
|
+
var __objRest$h = (source, exclude) => {
|
|
196
201
|
var target = {};
|
|
197
202
|
for (var prop in source)
|
|
198
|
-
if (__hasOwnProp$
|
|
203
|
+
if (__hasOwnProp$p.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
199
204
|
target[prop] = source[prop];
|
|
200
|
-
if (source != null && __getOwnPropSymbols$
|
|
201
|
-
for (var prop of __getOwnPropSymbols$
|
|
202
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
205
|
+
if (source != null && __getOwnPropSymbols$p)
|
|
206
|
+
for (var prop of __getOwnPropSymbols$p(source)) {
|
|
207
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$p.call(source, prop))
|
|
203
208
|
target[prop] = source[prop];
|
|
204
209
|
}
|
|
205
210
|
return target;
|
|
@@ -210,7 +215,7 @@ const BUTTON_INTERACTION_VARIANTS = [
|
|
|
210
215
|
"focused",
|
|
211
216
|
"focusVisible"
|
|
212
217
|
];
|
|
213
|
-
const { interactionVariants: interactionVariants$
|
|
218
|
+
const { interactionVariants: interactionVariants$7, withObservedValues: withObservedValues$5 } = pickAriaComponentVariants(
|
|
214
219
|
BUTTON_INTERACTION_VARIANTS
|
|
215
220
|
);
|
|
216
221
|
function BaseButton(props) {
|
|
@@ -219,14 +224,14 @@ function BaseButton(props) {
|
|
|
219
224
|
resetsForm,
|
|
220
225
|
children,
|
|
221
226
|
updateInteractionVariant
|
|
222
|
-
} = _a, rest = __objRest$
|
|
227
|
+
} = _a, rest = __objRest$h(_a, [
|
|
223
228
|
"submitsForm",
|
|
224
229
|
"resetsForm",
|
|
225
230
|
"children",
|
|
226
231
|
"updateInteractionVariant"
|
|
227
232
|
]);
|
|
228
233
|
const type = submitsForm ? "submit" : resetsForm ? "reset" : "button";
|
|
229
|
-
return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Button, __spreadValues$
|
|
234
|
+
return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Button, __spreadValues$p({ type }, rest), ({ isHovered, isPressed, isFocused, isFocusVisible }) => withObservedValues$5(
|
|
230
235
|
children,
|
|
231
236
|
{
|
|
232
237
|
hovered: isHovered,
|
|
@@ -237,21 +242,35 @@ function BaseButton(props) {
|
|
|
237
242
|
updateInteractionVariant
|
|
238
243
|
));
|
|
239
244
|
}
|
|
245
|
+
const BUTTON_COMPONENT_NAME = makeComponentName("button");
|
|
240
246
|
function registerButton(loader, overrides) {
|
|
241
247
|
registerComponentHelper(
|
|
242
248
|
loader,
|
|
243
249
|
BaseButton,
|
|
244
250
|
{
|
|
245
|
-
name:
|
|
251
|
+
name: BUTTON_COMPONENT_NAME,
|
|
246
252
|
displayName: "Aria Button",
|
|
247
253
|
importPath: "@plasmicpkgs/react-aria/skinny/registerButton",
|
|
248
254
|
importName: "BaseButton",
|
|
249
|
-
interactionVariants: interactionVariants$
|
|
250
|
-
|
|
255
|
+
interactionVariants: interactionVariants$7,
|
|
256
|
+
defaultStyles: {
|
|
257
|
+
borderWidth: "1px",
|
|
258
|
+
borderStyle: "solid",
|
|
259
|
+
borderColor: "black",
|
|
260
|
+
padding: "2px 10px"
|
|
261
|
+
},
|
|
262
|
+
props: __spreadProps$d(__spreadValues$p({}, getCommonInputProps("button", [
|
|
251
263
|
"isDisabled",
|
|
252
|
-
"aria-label"
|
|
253
|
-
"children"
|
|
264
|
+
"aria-label"
|
|
254
265
|
])), {
|
|
266
|
+
children: {
|
|
267
|
+
type: "slot",
|
|
268
|
+
mergeWithParent: true,
|
|
269
|
+
defaultValue: {
|
|
270
|
+
type: "text",
|
|
271
|
+
value: "Button"
|
|
272
|
+
}
|
|
273
|
+
},
|
|
255
274
|
submitsForm: {
|
|
256
275
|
type: "boolean",
|
|
257
276
|
displayName: "Submits form?",
|
|
@@ -279,33 +298,70 @@ function registerButton(loader, overrides) {
|
|
|
279
298
|
);
|
|
280
299
|
}
|
|
281
300
|
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
301
|
+
const PlasmicCheckboxGroupContext = React__default.default.createContext(void 0);
|
|
302
|
+
const PlasmicRadioGroupContext = React__default.default.createContext(void 0);
|
|
303
|
+
const PlasmicDialogTriggerContext = React__default.default.createContext(void 0);
|
|
304
|
+
const PlasmicSliderContext = React__default.default.createContext(void 0);
|
|
305
|
+
React__default.default.createContext(void 0);
|
|
306
|
+
const PlasmicListBoxContext = React__default.default.createContext(void 0);
|
|
307
|
+
const PlasmicPopoverContext = React__default.default.createContext(void 0);
|
|
308
|
+
const PlasmicItemContext = React__default.default.createContext(void 0);
|
|
309
|
+
const PlasmicSectionContext = React__default.default.createContext(void 0);
|
|
310
|
+
const PlasmicHeaderContext = React__default.default.createContext(void 0);
|
|
311
|
+
const PlasmicInputContext = React__default.default.createContext(void 0);
|
|
312
|
+
|
|
313
|
+
const BaseLabel = reactAriaComponents.Label;
|
|
314
|
+
const LABEL_COMPONENT_NAME = makeComponentName("label");
|
|
315
|
+
function registerLabel(loader, overrides) {
|
|
316
|
+
registerComponentHelper(
|
|
317
|
+
loader,
|
|
318
|
+
BaseLabel,
|
|
319
|
+
{
|
|
320
|
+
name: LABEL_COMPONENT_NAME,
|
|
321
|
+
displayName: "Aria Label",
|
|
322
|
+
importPath: "@plasmicpkgs/react-aria/skinny/registerLabel",
|
|
323
|
+
importName: "BaseLabel",
|
|
324
|
+
defaultStyles: {
|
|
325
|
+
cursor: "pointer"
|
|
326
|
+
},
|
|
327
|
+
props: {
|
|
328
|
+
children: {
|
|
329
|
+
type: "slot"
|
|
330
|
+
}
|
|
331
|
+
},
|
|
332
|
+
trapsFocus: true
|
|
333
|
+
},
|
|
334
|
+
overrides
|
|
335
|
+
);
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
var __defProp$o = Object.defineProperty;
|
|
339
|
+
var __defProps$c = Object.defineProperties;
|
|
340
|
+
var __getOwnPropDescs$c = Object.getOwnPropertyDescriptors;
|
|
341
|
+
var __getOwnPropSymbols$o = Object.getOwnPropertySymbols;
|
|
342
|
+
var __hasOwnProp$o = Object.prototype.hasOwnProperty;
|
|
343
|
+
var __propIsEnum$o = Object.prototype.propertyIsEnumerable;
|
|
344
|
+
var __defNormalProp$o = (obj, key, value) => key in obj ? __defProp$o(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
345
|
+
var __spreadValues$o = (a, b) => {
|
|
290
346
|
for (var prop in b || (b = {}))
|
|
291
|
-
if (__hasOwnProp$
|
|
292
|
-
__defNormalProp$
|
|
293
|
-
if (__getOwnPropSymbols$
|
|
294
|
-
for (var prop of __getOwnPropSymbols$
|
|
295
|
-
if (__propIsEnum$
|
|
296
|
-
__defNormalProp$
|
|
347
|
+
if (__hasOwnProp$o.call(b, prop))
|
|
348
|
+
__defNormalProp$o(a, prop, b[prop]);
|
|
349
|
+
if (__getOwnPropSymbols$o)
|
|
350
|
+
for (var prop of __getOwnPropSymbols$o(b)) {
|
|
351
|
+
if (__propIsEnum$o.call(b, prop))
|
|
352
|
+
__defNormalProp$o(a, prop, b[prop]);
|
|
297
353
|
}
|
|
298
354
|
return a;
|
|
299
355
|
};
|
|
300
|
-
var __spreadProps$
|
|
301
|
-
var __objRest$
|
|
356
|
+
var __spreadProps$c = (a, b) => __defProps$c(a, __getOwnPropDescs$c(b));
|
|
357
|
+
var __objRest$g = (source, exclude) => {
|
|
302
358
|
var target = {};
|
|
303
359
|
for (var prop in source)
|
|
304
|
-
if (__hasOwnProp$
|
|
360
|
+
if (__hasOwnProp$o.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
305
361
|
target[prop] = source[prop];
|
|
306
|
-
if (source != null && __getOwnPropSymbols$
|
|
307
|
-
for (var prop of __getOwnPropSymbols$
|
|
308
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
362
|
+
if (source != null && __getOwnPropSymbols$o)
|
|
363
|
+
for (var prop of __getOwnPropSymbols$o(source)) {
|
|
364
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$o.call(source, prop))
|
|
309
365
|
target[prop] = source[prop];
|
|
310
366
|
}
|
|
311
367
|
return target;
|
|
@@ -316,12 +372,17 @@ const CHECKBOX_INTERACTION_VARIANTS = [
|
|
|
316
372
|
"focused",
|
|
317
373
|
"focusVisible"
|
|
318
374
|
];
|
|
319
|
-
const { interactionVariants: interactionVariants$
|
|
375
|
+
const { interactionVariants: interactionVariants$6, withObservedValues: withObservedValues$4 } = pickAriaComponentVariants(
|
|
320
376
|
CHECKBOX_INTERACTION_VARIANTS
|
|
321
377
|
);
|
|
322
378
|
function BaseCheckbox(props) {
|
|
323
|
-
const _a = props, { children, updateInteractionVariant } = _a, rest = __objRest$
|
|
324
|
-
|
|
379
|
+
const _a = props, { children, updateInteractionVariant, setControlContextData } = _a, rest = __objRest$g(_a, ["children", "updateInteractionVariant", "setControlContextData"]);
|
|
380
|
+
const contextProps = React__default.default.useContext(PlasmicCheckboxGroupContext);
|
|
381
|
+
const isStandalone = !contextProps;
|
|
382
|
+
setControlContextData == null ? void 0 : setControlContextData({
|
|
383
|
+
isStandalone
|
|
384
|
+
});
|
|
385
|
+
return /* @__PURE__ */ React__default.default.createElement(React__default.default.Fragment, null, /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Checkbox, __spreadValues$o({}, rest), ({ isHovered, isPressed, isFocused, isFocusVisible }) => withObservedValues$4(
|
|
325
386
|
children,
|
|
326
387
|
{
|
|
327
388
|
hovered: isHovered,
|
|
@@ -332,8 +393,60 @@ function BaseCheckbox(props) {
|
|
|
332
393
|
updateInteractionVariant
|
|
333
394
|
)));
|
|
334
395
|
}
|
|
396
|
+
const makeDefaultCheckboxChildren = ({
|
|
397
|
+
label,
|
|
398
|
+
showDocs
|
|
399
|
+
}) => ({
|
|
400
|
+
type: "vbox",
|
|
401
|
+
styles: {
|
|
402
|
+
display: "flex",
|
|
403
|
+
alignItems: "center",
|
|
404
|
+
gap: "2px",
|
|
405
|
+
padding: 0
|
|
406
|
+
},
|
|
407
|
+
children: [
|
|
408
|
+
{
|
|
409
|
+
type: "hbox",
|
|
410
|
+
styles: {
|
|
411
|
+
display: "flex",
|
|
412
|
+
alignItems: "center",
|
|
413
|
+
gap: "10px",
|
|
414
|
+
padding: 0
|
|
415
|
+
},
|
|
416
|
+
children: [
|
|
417
|
+
{
|
|
418
|
+
type: "box",
|
|
419
|
+
styles: {
|
|
420
|
+
width: "7px",
|
|
421
|
+
height: "7px",
|
|
422
|
+
borderRadius: "3px",
|
|
423
|
+
borderWidth: "1px",
|
|
424
|
+
borderStyle: "solid",
|
|
425
|
+
borderColor: "black"
|
|
426
|
+
}
|
|
427
|
+
},
|
|
428
|
+
{
|
|
429
|
+
type: "component",
|
|
430
|
+
name: LABEL_COMPONENT_NAME,
|
|
431
|
+
props: {
|
|
432
|
+
children: {
|
|
433
|
+
type: "text",
|
|
434
|
+
value: label
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
]
|
|
439
|
+
},
|
|
440
|
+
...showDocs ? [
|
|
441
|
+
{
|
|
442
|
+
type: "text",
|
|
443
|
+
value: "Add interaction variants to see it in action..."
|
|
444
|
+
}
|
|
445
|
+
] : []
|
|
446
|
+
]
|
|
447
|
+
});
|
|
335
448
|
function registerCheckbox(loader, overrides) {
|
|
336
|
-
registerComponentHelper(
|
|
449
|
+
return registerComponentHelper(
|
|
337
450
|
loader,
|
|
338
451
|
BaseCheckbox,
|
|
339
452
|
{
|
|
@@ -341,16 +454,23 @@ function registerCheckbox(loader, overrides) {
|
|
|
341
454
|
displayName: "Aria Checkbox",
|
|
342
455
|
importPath: "@plasmicpkgs/react-aria/skinny/registerCheckbox",
|
|
343
456
|
importName: "BaseCheckbox",
|
|
344
|
-
interactionVariants: interactionVariants$
|
|
345
|
-
props: __spreadProps$
|
|
457
|
+
interactionVariants: interactionVariants$6,
|
|
458
|
+
props: __spreadProps$c(__spreadValues$o({}, getCommonInputProps("checkbox", [
|
|
346
459
|
"name",
|
|
347
460
|
"isDisabled",
|
|
348
461
|
"isReadOnly",
|
|
349
462
|
"aria-label",
|
|
350
|
-
"children",
|
|
351
463
|
"isRequired",
|
|
352
464
|
"autoFocus"
|
|
353
465
|
])), {
|
|
466
|
+
children: {
|
|
467
|
+
type: "slot",
|
|
468
|
+
mergeWithParent: true,
|
|
469
|
+
defaultValue: makeDefaultCheckboxChildren({
|
|
470
|
+
label: "Label",
|
|
471
|
+
showDocs: true
|
|
472
|
+
})
|
|
473
|
+
},
|
|
354
474
|
value: {
|
|
355
475
|
type: "string",
|
|
356
476
|
description: "The value of the input element, used when submitting an HTML form."
|
|
@@ -360,7 +480,8 @@ function registerCheckbox(loader, overrides) {
|
|
|
360
480
|
editOnly: true,
|
|
361
481
|
uncontrolledProp: "defaultSelected",
|
|
362
482
|
description: "Whether the checkbox is toggled on",
|
|
363
|
-
defaultValueHint: false
|
|
483
|
+
defaultValueHint: false,
|
|
484
|
+
defaultValue: false
|
|
364
485
|
},
|
|
365
486
|
isIndeterminate: {
|
|
366
487
|
displayName: "Indeterminate",
|
|
@@ -390,7 +511,8 @@ function registerCheckbox(loader, overrides) {
|
|
|
390
511
|
type: "writable",
|
|
391
512
|
valueProp: "isSelected",
|
|
392
513
|
onChangeProp: "onChange",
|
|
393
|
-
variableType: "boolean"
|
|
514
|
+
variableType: "boolean",
|
|
515
|
+
hidden: (_ps, ctx) => !(ctx == null ? void 0 : ctx.isStandalone)
|
|
394
516
|
}
|
|
395
517
|
},
|
|
396
518
|
trapsFocus: true
|
|
@@ -399,50 +521,56 @@ function registerCheckbox(loader, overrides) {
|
|
|
399
521
|
);
|
|
400
522
|
}
|
|
401
523
|
|
|
402
|
-
var __defProp$
|
|
403
|
-
var __getOwnPropSymbols$
|
|
404
|
-
var __hasOwnProp$
|
|
405
|
-
var __propIsEnum$
|
|
406
|
-
var __defNormalProp$
|
|
407
|
-
var __spreadValues$
|
|
524
|
+
var __defProp$n = Object.defineProperty;
|
|
525
|
+
var __getOwnPropSymbols$n = Object.getOwnPropertySymbols;
|
|
526
|
+
var __hasOwnProp$n = Object.prototype.hasOwnProperty;
|
|
527
|
+
var __propIsEnum$n = Object.prototype.propertyIsEnumerable;
|
|
528
|
+
var __defNormalProp$n = (obj, key, value) => key in obj ? __defProp$n(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
529
|
+
var __spreadValues$n = (a, b) => {
|
|
408
530
|
for (var prop in b || (b = {}))
|
|
409
|
-
if (__hasOwnProp$
|
|
410
|
-
__defNormalProp$
|
|
411
|
-
if (__getOwnPropSymbols$
|
|
412
|
-
for (var prop of __getOwnPropSymbols$
|
|
413
|
-
if (__propIsEnum$
|
|
414
|
-
__defNormalProp$
|
|
531
|
+
if (__hasOwnProp$n.call(b, prop))
|
|
532
|
+
__defNormalProp$n(a, prop, b[prop]);
|
|
533
|
+
if (__getOwnPropSymbols$n)
|
|
534
|
+
for (var prop of __getOwnPropSymbols$n(b)) {
|
|
535
|
+
if (__propIsEnum$n.call(b, prop))
|
|
536
|
+
__defNormalProp$n(a, prop, b[prop]);
|
|
415
537
|
}
|
|
416
538
|
return a;
|
|
417
539
|
};
|
|
418
|
-
var __objRest$
|
|
540
|
+
var __objRest$f = (source, exclude) => {
|
|
419
541
|
var target = {};
|
|
420
542
|
for (var prop in source)
|
|
421
|
-
if (__hasOwnProp$
|
|
543
|
+
if (__hasOwnProp$n.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
422
544
|
target[prop] = source[prop];
|
|
423
|
-
if (source != null && __getOwnPropSymbols$
|
|
424
|
-
for (var prop of __getOwnPropSymbols$
|
|
425
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
545
|
+
if (source != null && __getOwnPropSymbols$n)
|
|
546
|
+
for (var prop of __getOwnPropSymbols$n(source)) {
|
|
547
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$n.call(source, prop))
|
|
426
548
|
target[prop] = source[prop];
|
|
427
549
|
}
|
|
428
550
|
return target;
|
|
429
551
|
};
|
|
430
552
|
function BaseText(_a) {
|
|
431
|
-
var _b = _a, { children } = _b, rest = __objRest$
|
|
432
|
-
return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Text, __spreadValues$
|
|
553
|
+
var _b = _a, { children } = _b, rest = __objRest$f(_b, ["children"]);
|
|
554
|
+
return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Text, __spreadValues$n({}, rest), children);
|
|
433
555
|
}
|
|
556
|
+
const TEXT_COMPONENT_NAME = makeComponentName("text");
|
|
434
557
|
function registerText(loader, overrides) {
|
|
435
|
-
registerComponentHelper(
|
|
558
|
+
return registerComponentHelper(
|
|
436
559
|
loader,
|
|
437
560
|
BaseText,
|
|
438
561
|
{
|
|
439
|
-
name:
|
|
562
|
+
name: TEXT_COMPONENT_NAME,
|
|
440
563
|
displayName: "Aria Text",
|
|
441
564
|
importPath: "@plasmicpkgs/react-aria/skinny/registerText",
|
|
442
565
|
importName: "BaseText",
|
|
443
566
|
props: {
|
|
444
567
|
children: {
|
|
445
|
-
type: "slot"
|
|
568
|
+
type: "slot",
|
|
569
|
+
mergeWithParent: true,
|
|
570
|
+
defaultValue: {
|
|
571
|
+
type: "text",
|
|
572
|
+
value: "Some text..."
|
|
573
|
+
}
|
|
446
574
|
},
|
|
447
575
|
slot: {
|
|
448
576
|
type: "string"
|
|
@@ -454,58 +582,64 @@ function registerText(loader, overrides) {
|
|
|
454
582
|
);
|
|
455
583
|
}
|
|
456
584
|
|
|
457
|
-
var __defProp$
|
|
458
|
-
var __defProps$
|
|
459
|
-
var __getOwnPropDescs$
|
|
460
|
-
var __getOwnPropSymbols$
|
|
461
|
-
var __hasOwnProp$
|
|
462
|
-
var __propIsEnum$
|
|
463
|
-
var __defNormalProp$
|
|
464
|
-
var __spreadValues$
|
|
585
|
+
var __defProp$m = Object.defineProperty;
|
|
586
|
+
var __defProps$b = Object.defineProperties;
|
|
587
|
+
var __getOwnPropDescs$b = Object.getOwnPropertyDescriptors;
|
|
588
|
+
var __getOwnPropSymbols$m = Object.getOwnPropertySymbols;
|
|
589
|
+
var __hasOwnProp$m = Object.prototype.hasOwnProperty;
|
|
590
|
+
var __propIsEnum$m = Object.prototype.propertyIsEnumerable;
|
|
591
|
+
var __defNormalProp$m = (obj, key, value) => key in obj ? __defProp$m(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
592
|
+
var __spreadValues$m = (a, b) => {
|
|
465
593
|
for (var prop in b || (b = {}))
|
|
466
|
-
if (__hasOwnProp$
|
|
467
|
-
__defNormalProp$
|
|
468
|
-
if (__getOwnPropSymbols$
|
|
469
|
-
for (var prop of __getOwnPropSymbols$
|
|
470
|
-
if (__propIsEnum$
|
|
471
|
-
__defNormalProp$
|
|
594
|
+
if (__hasOwnProp$m.call(b, prop))
|
|
595
|
+
__defNormalProp$m(a, prop, b[prop]);
|
|
596
|
+
if (__getOwnPropSymbols$m)
|
|
597
|
+
for (var prop of __getOwnPropSymbols$m(b)) {
|
|
598
|
+
if (__propIsEnum$m.call(b, prop))
|
|
599
|
+
__defNormalProp$m(a, prop, b[prop]);
|
|
472
600
|
}
|
|
473
601
|
return a;
|
|
474
602
|
};
|
|
475
|
-
var __spreadProps$
|
|
603
|
+
var __spreadProps$b = (a, b) => __defProps$b(a, __getOwnPropDescs$b(b));
|
|
604
|
+
const DESCRIPTION_COMPONENT_NAME = makeComponentName("description");
|
|
476
605
|
function registerDescription(loader, overrides) {
|
|
477
|
-
registerText(loader, __spreadProps$
|
|
606
|
+
return registerText(loader, __spreadProps$b(__spreadValues$m({}, overrides), {
|
|
607
|
+
name: DESCRIPTION_COMPONENT_NAME,
|
|
478
608
|
displayName: "Aria Description",
|
|
479
609
|
props: {
|
|
480
|
-
slot: {
|
|
610
|
+
slot: {
|
|
611
|
+
type: "string",
|
|
612
|
+
hidden: () => true,
|
|
613
|
+
defaultValue: "description"
|
|
614
|
+
}
|
|
481
615
|
}
|
|
482
616
|
}));
|
|
483
617
|
}
|
|
484
618
|
|
|
485
|
-
var __defProp$
|
|
486
|
-
var __getOwnPropSymbols$
|
|
487
|
-
var __hasOwnProp$
|
|
488
|
-
var __propIsEnum$
|
|
489
|
-
var __defNormalProp$
|
|
490
|
-
var __spreadValues$
|
|
619
|
+
var __defProp$l = Object.defineProperty;
|
|
620
|
+
var __getOwnPropSymbols$l = Object.getOwnPropertySymbols;
|
|
621
|
+
var __hasOwnProp$l = Object.prototype.hasOwnProperty;
|
|
622
|
+
var __propIsEnum$l = Object.prototype.propertyIsEnumerable;
|
|
623
|
+
var __defNormalProp$l = (obj, key, value) => key in obj ? __defProp$l(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
624
|
+
var __spreadValues$l = (a, b) => {
|
|
491
625
|
for (var prop in b || (b = {}))
|
|
492
|
-
if (__hasOwnProp$
|
|
493
|
-
__defNormalProp$
|
|
494
|
-
if (__getOwnPropSymbols$
|
|
495
|
-
for (var prop of __getOwnPropSymbols$
|
|
496
|
-
if (__propIsEnum$
|
|
497
|
-
__defNormalProp$
|
|
626
|
+
if (__hasOwnProp$l.call(b, prop))
|
|
627
|
+
__defNormalProp$l(a, prop, b[prop]);
|
|
628
|
+
if (__getOwnPropSymbols$l)
|
|
629
|
+
for (var prop of __getOwnPropSymbols$l(b)) {
|
|
630
|
+
if (__propIsEnum$l.call(b, prop))
|
|
631
|
+
__defNormalProp$l(a, prop, b[prop]);
|
|
498
632
|
}
|
|
499
633
|
return a;
|
|
500
634
|
};
|
|
501
|
-
var __objRest$
|
|
635
|
+
var __objRest$e = (source, exclude) => {
|
|
502
636
|
var target = {};
|
|
503
637
|
for (var prop in source)
|
|
504
|
-
if (__hasOwnProp$
|
|
638
|
+
if (__hasOwnProp$l.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
505
639
|
target[prop] = source[prop];
|
|
506
|
-
if (source != null && __getOwnPropSymbols$
|
|
507
|
-
for (var prop of __getOwnPropSymbols$
|
|
508
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
640
|
+
if (source != null && __getOwnPropSymbols$l)
|
|
641
|
+
for (var prop of __getOwnPropSymbols$l(source)) {
|
|
642
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$l.call(source, prop))
|
|
509
643
|
target[prop] = source[prop];
|
|
510
644
|
}
|
|
511
645
|
return target;
|
|
@@ -522,7 +656,7 @@ function BaseFieldError(_a) {
|
|
|
522
656
|
tooShort,
|
|
523
657
|
typeMismatch,
|
|
524
658
|
valueMissing
|
|
525
|
-
} = _b, rest = __objRest$
|
|
659
|
+
} = _b, rest = __objRest$e(_b, [
|
|
526
660
|
"badInput",
|
|
527
661
|
"customError",
|
|
528
662
|
"patternMismatch",
|
|
@@ -534,27 +668,37 @@ function BaseFieldError(_a) {
|
|
|
534
668
|
"typeMismatch",
|
|
535
669
|
"valueMissing"
|
|
536
670
|
]);
|
|
537
|
-
return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.FieldError, __spreadValues$
|
|
538
|
-
if (validationDetails.badInput && badInput)
|
|
671
|
+
return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.FieldError, __spreadValues$l({}, rest), ({ validationDetails, validationErrors }) => {
|
|
672
|
+
if (validationDetails.badInput && badInput) {
|
|
539
673
|
return badInput;
|
|
540
|
-
|
|
674
|
+
}
|
|
675
|
+
if (validationDetails.customError && customError) {
|
|
541
676
|
return customError;
|
|
542
|
-
|
|
677
|
+
}
|
|
678
|
+
if (validationDetails.patternMismatch && patternMismatch) {
|
|
543
679
|
return patternMismatch;
|
|
544
|
-
|
|
680
|
+
}
|
|
681
|
+
if (validationDetails.rangeOverflow && rangeOverflow) {
|
|
545
682
|
return rangeOverflow;
|
|
546
|
-
|
|
683
|
+
}
|
|
684
|
+
if (validationDetails.rangeUnderflow && rangeUnderflow) {
|
|
547
685
|
return rangeUnderflow;
|
|
548
|
-
|
|
686
|
+
}
|
|
687
|
+
if (validationDetails.stepMismatch && stepMismatch) {
|
|
549
688
|
return stepMismatch;
|
|
550
|
-
|
|
689
|
+
}
|
|
690
|
+
if (validationDetails.tooLong && tooLong) {
|
|
551
691
|
return tooLong;
|
|
552
|
-
|
|
692
|
+
}
|
|
693
|
+
if (validationDetails.tooShort && tooShort) {
|
|
553
694
|
return tooShort;
|
|
554
|
-
|
|
695
|
+
}
|
|
696
|
+
if (validationDetails.typeMismatch && typeMismatch) {
|
|
555
697
|
return typeMismatch;
|
|
556
|
-
|
|
698
|
+
}
|
|
699
|
+
if (validationDetails.valueMissing && valueMissing) {
|
|
557
700
|
return valueMissing;
|
|
701
|
+
}
|
|
558
702
|
return validationErrors;
|
|
559
703
|
});
|
|
560
704
|
}
|
|
@@ -631,58 +775,48 @@ function registerFieldError(loader, overrides) {
|
|
|
631
775
|
);
|
|
632
776
|
}
|
|
633
777
|
|
|
634
|
-
|
|
635
|
-
|
|
778
|
+
var __defProp$k = Object.defineProperty;
|
|
779
|
+
var __defProps$a = Object.defineProperties;
|
|
780
|
+
var __getOwnPropDescs$a = Object.getOwnPropertyDescriptors;
|
|
781
|
+
var __getOwnPropSymbols$k = Object.getOwnPropertySymbols;
|
|
782
|
+
var __hasOwnProp$k = Object.prototype.hasOwnProperty;
|
|
783
|
+
var __propIsEnum$k = Object.prototype.propertyIsEnumerable;
|
|
784
|
+
var __defNormalProp$k = (obj, key, value) => key in obj ? __defProp$k(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
785
|
+
var __spreadValues$k = (a, b) => {
|
|
786
|
+
for (var prop in b || (b = {}))
|
|
787
|
+
if (__hasOwnProp$k.call(b, prop))
|
|
788
|
+
__defNormalProp$k(a, prop, b[prop]);
|
|
789
|
+
if (__getOwnPropSymbols$k)
|
|
790
|
+
for (var prop of __getOwnPropSymbols$k(b)) {
|
|
791
|
+
if (__propIsEnum$k.call(b, prop))
|
|
792
|
+
__defNormalProp$k(a, prop, b[prop]);
|
|
793
|
+
}
|
|
794
|
+
return a;
|
|
795
|
+
};
|
|
796
|
+
var __spreadProps$a = (a, b) => __defProps$a(a, __getOwnPropDescs$a(b));
|
|
797
|
+
function BaseCheckboxGroup(props) {
|
|
798
|
+
return /* @__PURE__ */ React__default.default.createElement(PlasmicCheckboxGroupContext.Provider, { value: props }, /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.CheckboxGroup, __spreadValues$k({}, props)));
|
|
799
|
+
}
|
|
800
|
+
const componentName = makeComponentName("checkboxGroup");
|
|
801
|
+
function registerCheckboxGroup(loader, overrides) {
|
|
802
|
+
const thisName = makeChildComponentName(
|
|
803
|
+
overrides == null ? void 0 : overrides.parentComponentName,
|
|
804
|
+
componentName
|
|
805
|
+
);
|
|
806
|
+
registerFieldError(loader, { parentComponentName: thisName });
|
|
807
|
+
const checkboxMeta = registerCheckbox(loader, {
|
|
808
|
+
parentComponentName: thisName
|
|
809
|
+
});
|
|
810
|
+
registerLabel(loader, { parentComponentName: thisName });
|
|
636
811
|
registerComponentHelper(
|
|
637
812
|
loader,
|
|
638
|
-
|
|
813
|
+
BaseCheckboxGroup,
|
|
639
814
|
{
|
|
640
|
-
name:
|
|
641
|
-
displayName: "Aria Label",
|
|
642
|
-
importPath: "@plasmicpkgs/react-aria/skinny/registerLabel",
|
|
643
|
-
importName: "BaseLabel",
|
|
644
|
-
props: {
|
|
645
|
-
children: {
|
|
646
|
-
type: "slot"
|
|
647
|
-
}
|
|
648
|
-
},
|
|
649
|
-
trapsFocus: true
|
|
650
|
-
},
|
|
651
|
-
overrides
|
|
652
|
-
);
|
|
653
|
-
}
|
|
654
|
-
|
|
655
|
-
var __defProp$g = Object.defineProperty;
|
|
656
|
-
var __defProps$8 = Object.defineProperties;
|
|
657
|
-
var __getOwnPropDescs$8 = Object.getOwnPropertyDescriptors;
|
|
658
|
-
var __getOwnPropSymbols$g = Object.getOwnPropertySymbols;
|
|
659
|
-
var __hasOwnProp$g = Object.prototype.hasOwnProperty;
|
|
660
|
-
var __propIsEnum$g = Object.prototype.propertyIsEnumerable;
|
|
661
|
-
var __defNormalProp$g = (obj, key, value) => key in obj ? __defProp$g(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
662
|
-
var __spreadValues$g = (a, b) => {
|
|
663
|
-
for (var prop in b || (b = {}))
|
|
664
|
-
if (__hasOwnProp$g.call(b, prop))
|
|
665
|
-
__defNormalProp$g(a, prop, b[prop]);
|
|
666
|
-
if (__getOwnPropSymbols$g)
|
|
667
|
-
for (var prop of __getOwnPropSymbols$g(b)) {
|
|
668
|
-
if (__propIsEnum$g.call(b, prop))
|
|
669
|
-
__defNormalProp$g(a, prop, b[prop]);
|
|
670
|
-
}
|
|
671
|
-
return a;
|
|
672
|
-
};
|
|
673
|
-
var __spreadProps$8 = (a, b) => __defProps$8(a, __getOwnPropDescs$8(b));
|
|
674
|
-
const BaseCheckboxGroup = reactAriaComponents.CheckboxGroup;
|
|
675
|
-
const componentName$2 = makeComponentName("checkboxGroup");
|
|
676
|
-
function registerCheckboxGroup(loader, overrides) {
|
|
677
|
-
registerComponentHelper(
|
|
678
|
-
loader,
|
|
679
|
-
BaseCheckboxGroup,
|
|
680
|
-
{
|
|
681
|
-
name: componentName$2,
|
|
815
|
+
name: componentName,
|
|
682
816
|
displayName: "Aria Checkbox Group",
|
|
683
817
|
importPath: "@plasmicpkgs/react-aria/skinny/registerCheckboxGroup",
|
|
684
818
|
importName: "BaseCheckboxGroup",
|
|
685
|
-
props: __spreadProps$
|
|
819
|
+
props: __spreadProps$a(__spreadValues$k({}, getCommonInputProps("checkbox group", [
|
|
686
820
|
"name",
|
|
687
821
|
"isDisabled",
|
|
688
822
|
"isReadOnly",
|
|
@@ -690,6 +824,76 @@ function registerCheckboxGroup(loader, overrides) {
|
|
|
690
824
|
"children",
|
|
691
825
|
"isRequired"
|
|
692
826
|
])), {
|
|
827
|
+
children: {
|
|
828
|
+
type: "slot",
|
|
829
|
+
mergeWithParent: true,
|
|
830
|
+
defaultValue: [
|
|
831
|
+
{
|
|
832
|
+
type: "vbox",
|
|
833
|
+
styles: {
|
|
834
|
+
display: "flex",
|
|
835
|
+
gap: "5px",
|
|
836
|
+
padding: 0,
|
|
837
|
+
alignItems: "flex-start"
|
|
838
|
+
},
|
|
839
|
+
children: [
|
|
840
|
+
{
|
|
841
|
+
type: "component",
|
|
842
|
+
name: LABEL_COMPONENT_NAME,
|
|
843
|
+
props: {
|
|
844
|
+
children: {
|
|
845
|
+
type: "text",
|
|
846
|
+
value: "Checkbox Group"
|
|
847
|
+
}
|
|
848
|
+
}
|
|
849
|
+
},
|
|
850
|
+
{
|
|
851
|
+
type: "component",
|
|
852
|
+
name: checkboxMeta.name,
|
|
853
|
+
props: {
|
|
854
|
+
children: makeDefaultCheckboxChildren({
|
|
855
|
+
label: "Checkbox 1",
|
|
856
|
+
showDocs: false
|
|
857
|
+
}),
|
|
858
|
+
value: "checkbox1"
|
|
859
|
+
}
|
|
860
|
+
},
|
|
861
|
+
{
|
|
862
|
+
type: "component",
|
|
863
|
+
name: checkboxMeta.name,
|
|
864
|
+
props: {
|
|
865
|
+
children: makeDefaultCheckboxChildren({
|
|
866
|
+
label: "Checkbox 2",
|
|
867
|
+
showDocs: false
|
|
868
|
+
}),
|
|
869
|
+
value: "checkbox2"
|
|
870
|
+
}
|
|
871
|
+
},
|
|
872
|
+
{
|
|
873
|
+
type: "component",
|
|
874
|
+
name: checkboxMeta.name,
|
|
875
|
+
props: {
|
|
876
|
+
children: makeDefaultCheckboxChildren({
|
|
877
|
+
label: "Checkbox 3",
|
|
878
|
+
showDocs: false
|
|
879
|
+
}),
|
|
880
|
+
value: "checkbox3"
|
|
881
|
+
}
|
|
882
|
+
},
|
|
883
|
+
{
|
|
884
|
+
type: "component",
|
|
885
|
+
name: DESCRIPTION_COMPONENT_NAME,
|
|
886
|
+
props: {
|
|
887
|
+
children: {
|
|
888
|
+
type: "text",
|
|
889
|
+
value: "Add interaction variants to see it in action..."
|
|
890
|
+
}
|
|
891
|
+
}
|
|
892
|
+
}
|
|
893
|
+
]
|
|
894
|
+
}
|
|
895
|
+
]
|
|
896
|
+
},
|
|
693
897
|
value: {
|
|
694
898
|
type: "array",
|
|
695
899
|
editOnly: true,
|
|
@@ -725,26 +929,8 @@ function registerCheckboxGroup(loader, overrides) {
|
|
|
725
929
|
},
|
|
726
930
|
overrides
|
|
727
931
|
);
|
|
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
932
|
}
|
|
739
933
|
|
|
740
|
-
React__default.default.createContext(void 0);
|
|
741
|
-
const PlasmicListBoxContext = React__default.default.createContext(void 0);
|
|
742
|
-
const PlasmicPopoverContext = React__default.default.createContext(void 0);
|
|
743
|
-
const PlasmicItemContext = React__default.default.createContext(void 0);
|
|
744
|
-
const PlasmicSectionContext = React__default.default.createContext(void 0);
|
|
745
|
-
const PlasmicHeaderContext = React__default.default.createContext(void 0);
|
|
746
|
-
const PlasmicInputContext = React__default.default.createContext(void 0);
|
|
747
|
-
|
|
748
934
|
function useStrictOptions(props) {
|
|
749
935
|
const { options, optionInfo } = props;
|
|
750
936
|
return React__default.default.useMemo(() => {
|
|
@@ -875,6 +1061,22 @@ function makeOptionsPropType() {
|
|
|
875
1061
|
id: "option2",
|
|
876
1062
|
label: "Option 2",
|
|
877
1063
|
type: "option"
|
|
1064
|
+
},
|
|
1065
|
+
{
|
|
1066
|
+
label: "Section 1",
|
|
1067
|
+
type: "option-group",
|
|
1068
|
+
items: [
|
|
1069
|
+
{
|
|
1070
|
+
id: "section-1-1",
|
|
1071
|
+
label: "Section item 1",
|
|
1072
|
+
type: "option"
|
|
1073
|
+
},
|
|
1074
|
+
{
|
|
1075
|
+
id: "section-1-2",
|
|
1076
|
+
label: "Section item 2",
|
|
1077
|
+
type: "option"
|
|
1078
|
+
}
|
|
1079
|
+
]
|
|
878
1080
|
}
|
|
879
1081
|
]
|
|
880
1082
|
};
|
|
@@ -894,126 +1096,648 @@ function makeValuePropType() {
|
|
|
894
1096
|
return type;
|
|
895
1097
|
}
|
|
896
1098
|
|
|
897
|
-
var __defProp$
|
|
898
|
-
var
|
|
899
|
-
var
|
|
900
|
-
var
|
|
901
|
-
var
|
|
902
|
-
var
|
|
903
|
-
var __defNormalProp$f = (obj, key, value) => key in obj ? __defProp$f(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
904
|
-
var __spreadValues$f = (a, b) => {
|
|
1099
|
+
var __defProp$j = Object.defineProperty;
|
|
1100
|
+
var __getOwnPropSymbols$j = Object.getOwnPropertySymbols;
|
|
1101
|
+
var __hasOwnProp$j = Object.prototype.hasOwnProperty;
|
|
1102
|
+
var __propIsEnum$j = Object.prototype.propertyIsEnumerable;
|
|
1103
|
+
var __defNormalProp$j = (obj, key, value) => key in obj ? __defProp$j(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1104
|
+
var __spreadValues$j = (a, b) => {
|
|
905
1105
|
for (var prop in b || (b = {}))
|
|
906
|
-
if (__hasOwnProp$
|
|
907
|
-
__defNormalProp$
|
|
908
|
-
if (__getOwnPropSymbols$
|
|
909
|
-
for (var prop of __getOwnPropSymbols$
|
|
910
|
-
if (__propIsEnum$
|
|
911
|
-
__defNormalProp$
|
|
1106
|
+
if (__hasOwnProp$j.call(b, prop))
|
|
1107
|
+
__defNormalProp$j(a, prop, b[prop]);
|
|
1108
|
+
if (__getOwnPropSymbols$j)
|
|
1109
|
+
for (var prop of __getOwnPropSymbols$j(b)) {
|
|
1110
|
+
if (__propIsEnum$j.call(b, prop))
|
|
1111
|
+
__defNormalProp$j(a, prop, b[prop]);
|
|
912
1112
|
}
|
|
913
1113
|
return a;
|
|
914
1114
|
};
|
|
915
|
-
var
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
allowsCustomValue,
|
|
925
|
-
placeholder,
|
|
926
|
-
previewOpen,
|
|
927
|
-
onOpenChange,
|
|
928
|
-
isDisabled,
|
|
929
|
-
className,
|
|
930
|
-
style,
|
|
931
|
-
structure,
|
|
932
|
-
name
|
|
933
|
-
} = props;
|
|
934
|
-
const { options, optionText } = useStrictOptions(props);
|
|
935
|
-
const { contains } = i18n.useFilter({ sensitivity: "base" });
|
|
936
|
-
const [showAllOptions, setShowAllOptions] = React__default.default.useState(false);
|
|
937
|
-
const filteredOptions = React__default.default.useMemo(() => {
|
|
938
|
-
if (!filterValue || filterValue.trim().length === 0) {
|
|
939
|
-
return options;
|
|
940
|
-
}
|
|
941
|
-
if (!options) {
|
|
942
|
-
return options;
|
|
1115
|
+
var __objRest$d = (source, exclude) => {
|
|
1116
|
+
var target = {};
|
|
1117
|
+
for (var prop in source)
|
|
1118
|
+
if (__hasOwnProp$j.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
1119
|
+
target[prop] = source[prop];
|
|
1120
|
+
if (source != null && __getOwnPropSymbols$j)
|
|
1121
|
+
for (var prop of __getOwnPropSymbols$j(source)) {
|
|
1122
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$j.call(source, prop))
|
|
1123
|
+
target[prop] = source[prop];
|
|
943
1124
|
}
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
})
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
(key) => {
|
|
970
|
-
if (key === null) {
|
|
971
|
-
return;
|
|
1125
|
+
return target;
|
|
1126
|
+
};
|
|
1127
|
+
const INPUT_INTERACTION_VARIANTS = ["focused", "hovered"];
|
|
1128
|
+
const { interactionVariants: interactionVariants$5 } = pickAriaComponentVariants(
|
|
1129
|
+
INPUT_INTERACTION_VARIANTS
|
|
1130
|
+
);
|
|
1131
|
+
function BaseInput(props) {
|
|
1132
|
+
const _a = props, { updateInteractionVariant } = _a, rest = __objRest$d(_a, ["updateInteractionVariant"]);
|
|
1133
|
+
return /* @__PURE__ */ React__default.default.createElement(
|
|
1134
|
+
reactAriaComponents.Input,
|
|
1135
|
+
__spreadValues$j({
|
|
1136
|
+
onHoverChange: (isHovered) => {
|
|
1137
|
+
updateInteractionVariant == null ? void 0 : updateInteractionVariant({
|
|
1138
|
+
hovered: isHovered
|
|
1139
|
+
});
|
|
1140
|
+
},
|
|
1141
|
+
onFocus: () => {
|
|
1142
|
+
updateInteractionVariant == null ? void 0 : updateInteractionVariant({
|
|
1143
|
+
focused: true
|
|
1144
|
+
});
|
|
1145
|
+
},
|
|
1146
|
+
onBlur: () => {
|
|
1147
|
+
updateInteractionVariant == null ? void 0 : updateInteractionVariant({
|
|
1148
|
+
focused: false
|
|
1149
|
+
});
|
|
972
1150
|
}
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
1151
|
+
}, rest)
|
|
1152
|
+
);
|
|
1153
|
+
}
|
|
1154
|
+
const INPUT_COMPONENT_NAME = makeComponentName("input");
|
|
1155
|
+
function registerInput(loader, overrides) {
|
|
1156
|
+
registerComponentHelper(
|
|
1157
|
+
loader,
|
|
1158
|
+
BaseInput,
|
|
1159
|
+
{
|
|
1160
|
+
name: INPUT_COMPONENT_NAME,
|
|
1161
|
+
displayName: "Aria Input",
|
|
1162
|
+
importPath: "@plasmicpkgs/react-aria/skinny/registerInput",
|
|
1163
|
+
importName: "BaseInput",
|
|
1164
|
+
interactionVariants: interactionVariants$5,
|
|
1165
|
+
defaultStyles: {
|
|
1166
|
+
width: "300px",
|
|
1167
|
+
borderWidth: "1px",
|
|
1168
|
+
borderStyle: "solid",
|
|
1169
|
+
borderColor: "black",
|
|
1170
|
+
padding: "2px 10px"
|
|
1171
|
+
},
|
|
1172
|
+
props: {
|
|
1173
|
+
placeholder: {
|
|
1174
|
+
type: "string"
|
|
977
1175
|
}
|
|
978
|
-
}
|
|
979
|
-
|
|
980
|
-
}
|
|
981
|
-
if (selectedOption) {
|
|
982
|
-
onFilterValueChange == null ? void 0 : onFilterValueChange(optionText(selectedOption));
|
|
983
|
-
}
|
|
1176
|
+
},
|
|
1177
|
+
trapsFocus: true
|
|
984
1178
|
},
|
|
985
|
-
|
|
1179
|
+
overrides
|
|
986
1180
|
);
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1181
|
+
}
|
|
1182
|
+
|
|
1183
|
+
var __defProp$i = Object.defineProperty;
|
|
1184
|
+
var __defProps$9 = Object.defineProperties;
|
|
1185
|
+
var __getOwnPropDescs$9 = Object.getOwnPropertyDescriptors;
|
|
1186
|
+
var __getOwnPropSymbols$i = Object.getOwnPropertySymbols;
|
|
1187
|
+
var __hasOwnProp$i = Object.prototype.hasOwnProperty;
|
|
1188
|
+
var __propIsEnum$i = Object.prototype.propertyIsEnumerable;
|
|
1189
|
+
var __defNormalProp$i = (obj, key, value) => key in obj ? __defProp$i(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1190
|
+
var __spreadValues$i = (a, b) => {
|
|
1191
|
+
for (var prop in b || (b = {}))
|
|
1192
|
+
if (__hasOwnProp$i.call(b, prop))
|
|
1193
|
+
__defNormalProp$i(a, prop, b[prop]);
|
|
1194
|
+
if (__getOwnPropSymbols$i)
|
|
1195
|
+
for (var prop of __getOwnPropSymbols$i(b)) {
|
|
1196
|
+
if (__propIsEnum$i.call(b, prop))
|
|
1197
|
+
__defNormalProp$i(a, prop, b[prop]);
|
|
1198
|
+
}
|
|
1199
|
+
return a;
|
|
1200
|
+
};
|
|
1201
|
+
var __spreadProps$9 = (a, b) => __defProps$9(a, __getOwnPropDescs$9(b));
|
|
1202
|
+
function BaseListBoxItem(props) {
|
|
1203
|
+
const contextProps = React__default.default.useContext(PlasmicItemContext);
|
|
1204
|
+
const mergedProps = utils.mergeProps(contextProps, props);
|
|
1205
|
+
return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.ListBoxItem, __spreadProps$9(__spreadValues$i({}, mergedProps), { textValue: contextProps.label }), mergedProps.children);
|
|
1206
|
+
}
|
|
1207
|
+
const makeDefaultListBoxItemChildren = (label, description) => ({
|
|
1208
|
+
type: "vbox",
|
|
1209
|
+
styles: {
|
|
1210
|
+
display: "flex",
|
|
1211
|
+
alignItems: "flex-start",
|
|
1212
|
+
gap: "2px"
|
|
1213
|
+
},
|
|
1214
|
+
children: [
|
|
1215
|
+
{
|
|
1216
|
+
type: "component",
|
|
1217
|
+
name: TEXT_COMPONENT_NAME,
|
|
1218
|
+
props: {
|
|
1219
|
+
slot: "label",
|
|
1220
|
+
children: {
|
|
1221
|
+
type: "text",
|
|
1222
|
+
styles: {
|
|
1223
|
+
fontWeight: 500
|
|
1224
|
+
},
|
|
1225
|
+
value: label
|
|
1001
1226
|
}
|
|
1002
1227
|
}
|
|
1003
1228
|
},
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1229
|
+
{
|
|
1230
|
+
type: "component",
|
|
1231
|
+
name: DESCRIPTION_COMPONENT_NAME,
|
|
1232
|
+
props: {
|
|
1233
|
+
children: {
|
|
1234
|
+
type: "text",
|
|
1235
|
+
styles: {
|
|
1236
|
+
color: "#838383"
|
|
1237
|
+
},
|
|
1238
|
+
value: description != null ? description : `Some description for ${label}...`
|
|
1239
|
+
}
|
|
1240
|
+
}
|
|
1241
|
+
}
|
|
1242
|
+
]
|
|
1243
|
+
});
|
|
1244
|
+
function registerListBoxItem(loader, overrides) {
|
|
1245
|
+
return registerComponentHelper(
|
|
1246
|
+
loader,
|
|
1247
|
+
BaseListBoxItem,
|
|
1248
|
+
{
|
|
1249
|
+
name: makeComponentName("item"),
|
|
1250
|
+
displayName: "Aria ListBoxItem",
|
|
1251
|
+
importPath: "@plasmicpkgs/react-aria/skinny/registerListBoxItem",
|
|
1252
|
+
importName: "BaseListBoxItem",
|
|
1253
|
+
props: {
|
|
1254
|
+
children: {
|
|
1255
|
+
type: "slot",
|
|
1256
|
+
defaultValue: makeDefaultListBoxItemChildren("Item")
|
|
1257
|
+
}
|
|
1258
|
+
}
|
|
1259
|
+
},
|
|
1260
|
+
overrides
|
|
1261
|
+
);
|
|
1262
|
+
}
|
|
1263
|
+
|
|
1264
|
+
var __defProp$h = Object.defineProperty;
|
|
1265
|
+
var __getOwnPropSymbols$h = Object.getOwnPropertySymbols;
|
|
1266
|
+
var __hasOwnProp$h = Object.prototype.hasOwnProperty;
|
|
1267
|
+
var __propIsEnum$h = Object.prototype.propertyIsEnumerable;
|
|
1268
|
+
var __defNormalProp$h = (obj, key, value) => key in obj ? __defProp$h(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1269
|
+
var __spreadValues$h = (a, b) => {
|
|
1270
|
+
for (var prop in b || (b = {}))
|
|
1271
|
+
if (__hasOwnProp$h.call(b, prop))
|
|
1272
|
+
__defNormalProp$h(a, prop, b[prop]);
|
|
1273
|
+
if (__getOwnPropSymbols$h)
|
|
1274
|
+
for (var prop of __getOwnPropSymbols$h(b)) {
|
|
1275
|
+
if (__propIsEnum$h.call(b, prop))
|
|
1276
|
+
__defNormalProp$h(a, prop, b[prop]);
|
|
1277
|
+
}
|
|
1278
|
+
return a;
|
|
1279
|
+
};
|
|
1280
|
+
function BaseHeader(props) {
|
|
1281
|
+
const contextProps = React__default.default.useContext(PlasmicHeaderContext);
|
|
1282
|
+
return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Header, __spreadValues$h({}, utils.mergeProps(contextProps, props)));
|
|
1283
|
+
}
|
|
1284
|
+
function registerHeader(loader, overrides) {
|
|
1285
|
+
return registerComponentHelper(
|
|
1286
|
+
loader,
|
|
1287
|
+
BaseHeader,
|
|
1288
|
+
{
|
|
1289
|
+
name: makeComponentName("header"),
|
|
1290
|
+
displayName: "Aria Header",
|
|
1291
|
+
importPath: "@plasmicpkgs/react-aria/skinny/registerHeader",
|
|
1292
|
+
importName: "BaseHeader",
|
|
1293
|
+
defaultStyles: {
|
|
1294
|
+
fontWeight: "bold",
|
|
1295
|
+
fontSize: "20px"
|
|
1296
|
+
},
|
|
1297
|
+
props: {}
|
|
1298
|
+
},
|
|
1299
|
+
overrides
|
|
1300
|
+
);
|
|
1301
|
+
}
|
|
1302
|
+
|
|
1303
|
+
var __defProp$g = Object.defineProperty;
|
|
1304
|
+
var __getOwnPropSymbols$g = Object.getOwnPropertySymbols;
|
|
1305
|
+
var __hasOwnProp$g = Object.prototype.hasOwnProperty;
|
|
1306
|
+
var __propIsEnum$g = Object.prototype.propertyIsEnumerable;
|
|
1307
|
+
var __defNormalProp$g = (obj, key, value) => key in obj ? __defProp$g(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1308
|
+
var __spreadValues$g = (a, b) => {
|
|
1309
|
+
for (var prop in b || (b = {}))
|
|
1310
|
+
if (__hasOwnProp$g.call(b, prop))
|
|
1311
|
+
__defNormalProp$g(a, prop, b[prop]);
|
|
1312
|
+
if (__getOwnPropSymbols$g)
|
|
1313
|
+
for (var prop of __getOwnPropSymbols$g(b)) {
|
|
1314
|
+
if (__propIsEnum$g.call(b, prop))
|
|
1315
|
+
__defNormalProp$g(a, prop, b[prop]);
|
|
1316
|
+
}
|
|
1317
|
+
return a;
|
|
1318
|
+
};
|
|
1319
|
+
function BaseSection(props) {
|
|
1320
|
+
const contextProps = React__default.default.useContext(PlasmicSectionContext);
|
|
1321
|
+
const mergedProps = utils.mergeProps(contextProps, props);
|
|
1322
|
+
const { section, renderHeader, key, renderItem } = mergedProps;
|
|
1323
|
+
return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Section, __spreadValues$g({ id: key }, mergedProps), /* @__PURE__ */ React__default.default.createElement(PlasmicHeaderContext.Provider, { value: { children: section == null ? void 0 : section.label } }, renderHeader == null ? void 0 : renderHeader(section)), /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Collection, { items: section == null ? void 0 : section.items }, (item) => {
|
|
1324
|
+
return /* @__PURE__ */ React__default.default.createElement(PlasmicItemContext.Provider, { value: item }, renderItem == null ? void 0 : renderItem(item));
|
|
1325
|
+
}));
|
|
1326
|
+
}
|
|
1327
|
+
function registerSection(loader, overrides) {
|
|
1328
|
+
const thisName = makeChildComponentName(
|
|
1329
|
+
overrides == null ? void 0 : overrides.parentComponentName,
|
|
1330
|
+
makeComponentName("section")
|
|
1331
|
+
);
|
|
1332
|
+
const headerMeta = registerHeader(loader, {
|
|
1333
|
+
parentComponentName: thisName
|
|
1334
|
+
});
|
|
1335
|
+
return registerComponentHelper(
|
|
1336
|
+
loader,
|
|
1337
|
+
BaseSection,
|
|
1338
|
+
{
|
|
1339
|
+
name: makeComponentName("section"),
|
|
1340
|
+
displayName: "Aria Section",
|
|
1341
|
+
importPath: "@plasmicpkgs/react-aria/skinny/registerSection",
|
|
1342
|
+
importName: "BaseSection",
|
|
1343
|
+
defaultStyles: {
|
|
1344
|
+
width: "stretch",
|
|
1345
|
+
padding: "10px"
|
|
1346
|
+
},
|
|
1347
|
+
props: {
|
|
1348
|
+
renderHeader: {
|
|
1349
|
+
type: "slot",
|
|
1350
|
+
displayName: "Render section header",
|
|
1351
|
+
renderPropParams: ["sectionProps"],
|
|
1352
|
+
defaultValue: {
|
|
1353
|
+
type: "component",
|
|
1354
|
+
name: headerMeta.name
|
|
1355
|
+
}
|
|
1356
|
+
}
|
|
1357
|
+
}
|
|
1358
|
+
},
|
|
1359
|
+
overrides
|
|
1360
|
+
);
|
|
1361
|
+
}
|
|
1362
|
+
|
|
1363
|
+
var __defProp$f = Object.defineProperty;
|
|
1364
|
+
var __defProps$8 = Object.defineProperties;
|
|
1365
|
+
var __getOwnPropDescs$8 = Object.getOwnPropertyDescriptors;
|
|
1366
|
+
var __getOwnPropSymbols$f = Object.getOwnPropertySymbols;
|
|
1367
|
+
var __hasOwnProp$f = Object.prototype.hasOwnProperty;
|
|
1368
|
+
var __propIsEnum$f = Object.prototype.propertyIsEnumerable;
|
|
1369
|
+
var __defNormalProp$f = (obj, key, value) => key in obj ? __defProp$f(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1370
|
+
var __spreadValues$f = (a, b) => {
|
|
1371
|
+
for (var prop in b || (b = {}))
|
|
1372
|
+
if (__hasOwnProp$f.call(b, prop))
|
|
1373
|
+
__defNormalProp$f(a, prop, b[prop]);
|
|
1374
|
+
if (__getOwnPropSymbols$f)
|
|
1375
|
+
for (var prop of __getOwnPropSymbols$f(b)) {
|
|
1376
|
+
if (__propIsEnum$f.call(b, prop))
|
|
1377
|
+
__defNormalProp$f(a, prop, b[prop]);
|
|
1378
|
+
}
|
|
1379
|
+
return a;
|
|
1380
|
+
};
|
|
1381
|
+
var __spreadProps$8 = (a, b) => __defProps$8(a, __getOwnPropDescs$8(b));
|
|
1382
|
+
var __objRest$c = (source, exclude) => {
|
|
1383
|
+
var target = {};
|
|
1384
|
+
for (var prop in source)
|
|
1385
|
+
if (__hasOwnProp$f.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
1386
|
+
target[prop] = source[prop];
|
|
1387
|
+
if (source != null && __getOwnPropSymbols$f)
|
|
1388
|
+
for (var prop of __getOwnPropSymbols$f(source)) {
|
|
1389
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$f.call(source, prop))
|
|
1390
|
+
target[prop] = source[prop];
|
|
1391
|
+
}
|
|
1392
|
+
return target;
|
|
1393
|
+
};
|
|
1394
|
+
function BaseListBox(props) {
|
|
1395
|
+
var _c;
|
|
1396
|
+
const contextProps = React__default.default.useContext(PlasmicListBoxContext);
|
|
1397
|
+
const isStandalone = !contextProps;
|
|
1398
|
+
const _a = props, rest = __objRest$c(_a, ["options"]);
|
|
1399
|
+
const { options } = useStrictOptions(props);
|
|
1400
|
+
const _b = utils.mergeProps(
|
|
1401
|
+
contextProps,
|
|
1402
|
+
rest,
|
|
1403
|
+
isStandalone ? { items: options } : {}
|
|
1404
|
+
), { renderItem, renderSection } = _b, mergedProps = __objRest$c(_b, ["renderItem", "renderSection"]);
|
|
1405
|
+
(_c = props.setControlContextData) == null ? void 0 : _c.call(props, {
|
|
1406
|
+
isStandalone
|
|
1407
|
+
});
|
|
1408
|
+
return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.ListBox, __spreadValues$f({}, mergedProps), (item) => {
|
|
1409
|
+
var _a2;
|
|
1410
|
+
if (item.type === "option-group") {
|
|
1411
|
+
return /* @__PURE__ */ React__default.default.createElement(React__default.default.Fragment, null, /* @__PURE__ */ React__default.default.createElement(
|
|
1412
|
+
PlasmicSectionContext.Provider,
|
|
1413
|
+
{
|
|
1414
|
+
value: {
|
|
1415
|
+
renderItem,
|
|
1416
|
+
key: (_a2 = item.key) != null ? _a2 : item.label,
|
|
1417
|
+
section: item
|
|
1418
|
+
}
|
|
1419
|
+
},
|
|
1420
|
+
renderSection == null ? void 0 : renderSection(item)
|
|
1421
|
+
));
|
|
1422
|
+
} else {
|
|
1423
|
+
return /* @__PURE__ */ React__default.default.createElement(PlasmicItemContext.Provider, { value: item }, renderItem == null ? void 0 : renderItem(item));
|
|
1424
|
+
}
|
|
1425
|
+
});
|
|
1426
|
+
}
|
|
1427
|
+
const LIST_BOX_COMPONENT_NAME = makeComponentName("listbox");
|
|
1428
|
+
function registerListBox(loader, overrides) {
|
|
1429
|
+
const listBoxItemMeta = registerListBoxItem(loader, {
|
|
1430
|
+
parentComponentName: LIST_BOX_COMPONENT_NAME
|
|
1431
|
+
});
|
|
1432
|
+
const sectionMeta = registerSection(loader, {
|
|
1433
|
+
parentComponentName: LIST_BOX_COMPONENT_NAME
|
|
1434
|
+
});
|
|
1435
|
+
registerComponentHelper(
|
|
1436
|
+
loader,
|
|
1437
|
+
BaseListBox,
|
|
1438
|
+
{
|
|
1439
|
+
name: LIST_BOX_COMPONENT_NAME,
|
|
1440
|
+
displayName: "Aria ListBox",
|
|
1441
|
+
importPath: "@plasmicpkgs/react-aria/skinny/registerListBox",
|
|
1442
|
+
importName: "BaseListBox",
|
|
1443
|
+
defaultStyles: {
|
|
1444
|
+
width: "250px",
|
|
1445
|
+
borderWidth: "1px",
|
|
1446
|
+
borderStyle: "solid",
|
|
1447
|
+
borderColor: "black"
|
|
1448
|
+
},
|
|
1449
|
+
props: {
|
|
1450
|
+
options: __spreadProps$8(__spreadValues$f({}, makeOptionsPropType()), {
|
|
1451
|
+
displayName: "Items",
|
|
1452
|
+
hidden: (_ps, ctx) => !(ctx == null ? void 0 : ctx.isStandalone)
|
|
1453
|
+
}),
|
|
1454
|
+
renderItem: {
|
|
1455
|
+
type: "slot",
|
|
1456
|
+
displayName: "Render Item",
|
|
1457
|
+
renderPropParams: ["itemProps"],
|
|
1458
|
+
defaultValue: {
|
|
1459
|
+
type: "component",
|
|
1460
|
+
name: listBoxItemMeta.name,
|
|
1461
|
+
props: {
|
|
1462
|
+
children: makeDefaultListBoxItemChildren(
|
|
1463
|
+
"Item (itemProps.label)",
|
|
1464
|
+
"Connect with `itemProps` in the data picker to display list box items"
|
|
1465
|
+
)
|
|
1466
|
+
}
|
|
1467
|
+
}
|
|
1468
|
+
},
|
|
1469
|
+
renderSection: {
|
|
1470
|
+
type: "slot",
|
|
1471
|
+
displayName: "Render Section",
|
|
1472
|
+
renderPropParams: ["sectionProps"],
|
|
1473
|
+
defaultValue: {
|
|
1474
|
+
type: "component",
|
|
1475
|
+
name: sectionMeta.name,
|
|
1476
|
+
styles: {
|
|
1477
|
+
backgroundColor: "#F4FAFF"
|
|
1478
|
+
}
|
|
1479
|
+
}
|
|
1480
|
+
}
|
|
1481
|
+
}
|
|
1482
|
+
},
|
|
1483
|
+
overrides
|
|
1484
|
+
);
|
|
1485
|
+
}
|
|
1486
|
+
|
|
1487
|
+
var __defProp$e = Object.defineProperty;
|
|
1488
|
+
var __getOwnPropSymbols$e = Object.getOwnPropertySymbols;
|
|
1489
|
+
var __hasOwnProp$e = Object.prototype.hasOwnProperty;
|
|
1490
|
+
var __propIsEnum$e = Object.prototype.propertyIsEnumerable;
|
|
1491
|
+
var __defNormalProp$e = (obj, key, value) => key in obj ? __defProp$e(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1492
|
+
var __spreadValues$e = (a, b) => {
|
|
1493
|
+
for (var prop in b || (b = {}))
|
|
1494
|
+
if (__hasOwnProp$e.call(b, prop))
|
|
1495
|
+
__defNormalProp$e(a, prop, b[prop]);
|
|
1496
|
+
if (__getOwnPropSymbols$e)
|
|
1497
|
+
for (var prop of __getOwnPropSymbols$e(b)) {
|
|
1498
|
+
if (__propIsEnum$e.call(b, prop))
|
|
1499
|
+
__defNormalProp$e(a, prop, b[prop]);
|
|
1500
|
+
}
|
|
1501
|
+
return a;
|
|
1502
|
+
};
|
|
1503
|
+
var __objRest$b = (source, exclude) => {
|
|
1504
|
+
var target = {};
|
|
1505
|
+
for (var prop in source)
|
|
1506
|
+
if (__hasOwnProp$e.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
1507
|
+
target[prop] = source[prop];
|
|
1508
|
+
if (source != null && __getOwnPropSymbols$e)
|
|
1509
|
+
for (var prop of __getOwnPropSymbols$e(source)) {
|
|
1510
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$e.call(source, prop))
|
|
1511
|
+
target[prop] = source[prop];
|
|
1512
|
+
}
|
|
1513
|
+
return target;
|
|
1514
|
+
};
|
|
1515
|
+
function BasePopover(props) {
|
|
1516
|
+
const _a = props, { resetClassName } = _a, restProps = __objRest$b(_a, ["resetClassName"]);
|
|
1517
|
+
const isStandalone = !React__default.default.useContext(reactAriaComponents.PopoverContext);
|
|
1518
|
+
const contextProps = React__default.default.useContext(PlasmicPopoverContext);
|
|
1519
|
+
const mergedProps = utils.mergeProps(contextProps, restProps, {
|
|
1520
|
+
className: `${resetClassName}`
|
|
1521
|
+
});
|
|
1522
|
+
const triggerRef = React__default.default.useRef(null);
|
|
1523
|
+
const standaloneProps = isStandalone ? {
|
|
1524
|
+
triggerRef,
|
|
1525
|
+
isNonModal: true,
|
|
1526
|
+
isOpen: true
|
|
1527
|
+
} : {};
|
|
1528
|
+
return /* @__PURE__ */ React__default.default.createElement(React__default.default.Fragment, null, isStandalone && /* @__PURE__ */ React__default.default.createElement("div", { ref: triggerRef }), /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Popover, __spreadValues$e(__spreadValues$e({}, mergedProps), standaloneProps)));
|
|
1529
|
+
}
|
|
1530
|
+
const POPOVER_COMPONENT_NAME = makeComponentName("popover");
|
|
1531
|
+
const POPOVER_ARROW_IMG = {
|
|
1532
|
+
type: "img",
|
|
1533
|
+
// TODO: Replace with the image of an arrow pointing up, like: https://icon-sets.iconify.design/mdi/triangle/
|
|
1534
|
+
src: "https://static1.plasmic.app/arrow-up.svg",
|
|
1535
|
+
styles: {
|
|
1536
|
+
position: "absolute",
|
|
1537
|
+
top: "-14px",
|
|
1538
|
+
// center the arrow horizontally on the popover
|
|
1539
|
+
left: "50%",
|
|
1540
|
+
transform: "translateX(-50%)",
|
|
1541
|
+
width: "15px"
|
|
1542
|
+
}
|
|
1543
|
+
};
|
|
1544
|
+
function registerPopover(loader, overrides) {
|
|
1545
|
+
registerComponentHelper(
|
|
1546
|
+
loader,
|
|
1547
|
+
BasePopover,
|
|
1548
|
+
{
|
|
1549
|
+
name: POPOVER_COMPONENT_NAME,
|
|
1550
|
+
displayName: "Aria Popover",
|
|
1551
|
+
importPath: "@plasmicpkgs/react-aria/skinny/registerPopover",
|
|
1552
|
+
importName: "BasePopover",
|
|
1553
|
+
defaultStyles: {
|
|
1554
|
+
borderWidth: "1px",
|
|
1555
|
+
borderStyle: "solid",
|
|
1556
|
+
borderColor: "black",
|
|
1557
|
+
padding: "20px",
|
|
1558
|
+
width: "300px",
|
|
1559
|
+
backgroundColor: "#FDE3C3"
|
|
1560
|
+
},
|
|
1561
|
+
props: {
|
|
1562
|
+
children: {
|
|
1563
|
+
type: "slot",
|
|
1564
|
+
defaultValue: [
|
|
1565
|
+
POPOVER_ARROW_IMG,
|
|
1566
|
+
{
|
|
1567
|
+
type: "vbox",
|
|
1568
|
+
styles: {
|
|
1569
|
+
width: "stretch",
|
|
1570
|
+
padding: 0,
|
|
1571
|
+
gap: "10px"
|
|
1572
|
+
},
|
|
1573
|
+
children: [
|
|
1574
|
+
{
|
|
1575
|
+
type: "text",
|
|
1576
|
+
value: "This is a Popover!"
|
|
1577
|
+
},
|
|
1578
|
+
{
|
|
1579
|
+
type: "text",
|
|
1580
|
+
value: "You can put anything you can imagine here!",
|
|
1581
|
+
styles: {
|
|
1582
|
+
fontWeight: 500
|
|
1583
|
+
}
|
|
1584
|
+
},
|
|
1585
|
+
{
|
|
1586
|
+
type: "text",
|
|
1587
|
+
value: "Use it in a `Aria Dialog Trigger` component to trigger it on a button click!"
|
|
1588
|
+
}
|
|
1589
|
+
]
|
|
1590
|
+
}
|
|
1591
|
+
]
|
|
1592
|
+
},
|
|
1593
|
+
offset: {
|
|
1594
|
+
type: "number",
|
|
1595
|
+
displayName: "Offset",
|
|
1596
|
+
description: "Additional offset applied vertically between the popover and its trigger",
|
|
1597
|
+
defaultValueHint: 0
|
|
1598
|
+
},
|
|
1599
|
+
placement: {
|
|
1600
|
+
type: "choice",
|
|
1601
|
+
description: "Default placement of the popover relative to the trigger, if there is enough space",
|
|
1602
|
+
options: [
|
|
1603
|
+
"bottom",
|
|
1604
|
+
"bottom left",
|
|
1605
|
+
"bottom right",
|
|
1606
|
+
"top",
|
|
1607
|
+
"top left",
|
|
1608
|
+
"top right"
|
|
1609
|
+
]
|
|
1610
|
+
},
|
|
1611
|
+
resetClassName: {
|
|
1612
|
+
type: "themeResetClass"
|
|
1613
|
+
}
|
|
1614
|
+
},
|
|
1615
|
+
styleSections: true
|
|
1616
|
+
},
|
|
1617
|
+
overrides
|
|
1618
|
+
);
|
|
1619
|
+
}
|
|
1620
|
+
|
|
1621
|
+
var __defProp$d = Object.defineProperty;
|
|
1622
|
+
var __defProps$7 = Object.defineProperties;
|
|
1623
|
+
var __getOwnPropDescs$7 = Object.getOwnPropertyDescriptors;
|
|
1624
|
+
var __getOwnPropSymbols$d = Object.getOwnPropertySymbols;
|
|
1625
|
+
var __hasOwnProp$d = Object.prototype.hasOwnProperty;
|
|
1626
|
+
var __propIsEnum$d = Object.prototype.propertyIsEnumerable;
|
|
1627
|
+
var __defNormalProp$d = (obj, key, value) => key in obj ? __defProp$d(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1628
|
+
var __spreadValues$d = (a, b) => {
|
|
1629
|
+
for (var prop in b || (b = {}))
|
|
1630
|
+
if (__hasOwnProp$d.call(b, prop))
|
|
1631
|
+
__defNormalProp$d(a, prop, b[prop]);
|
|
1632
|
+
if (__getOwnPropSymbols$d)
|
|
1633
|
+
for (var prop of __getOwnPropSymbols$d(b)) {
|
|
1634
|
+
if (__propIsEnum$d.call(b, prop))
|
|
1635
|
+
__defNormalProp$d(a, prop, b[prop]);
|
|
1636
|
+
}
|
|
1637
|
+
return a;
|
|
1638
|
+
};
|
|
1639
|
+
var __spreadProps$7 = (a, b) => __defProps$7(a, __getOwnPropDescs$7(b));
|
|
1640
|
+
function BaseComboBox(props) {
|
|
1641
|
+
const {
|
|
1642
|
+
value,
|
|
1643
|
+
onChange,
|
|
1644
|
+
menuTrigger,
|
|
1645
|
+
filterValue,
|
|
1646
|
+
onFilterValueChange,
|
|
1647
|
+
valueType,
|
|
1648
|
+
allowsCustomValue,
|
|
1649
|
+
placeholder,
|
|
1650
|
+
previewOpen,
|
|
1651
|
+
onOpenChange,
|
|
1652
|
+
isDisabled,
|
|
1653
|
+
className,
|
|
1654
|
+
style,
|
|
1655
|
+
structure,
|
|
1656
|
+
name
|
|
1657
|
+
} = props;
|
|
1658
|
+
const { options, optionText } = useStrictOptions(props);
|
|
1659
|
+
const { contains } = i18n.useFilter({ sensitivity: "base" });
|
|
1660
|
+
const [showAllOptions, setShowAllOptions] = React__default.default.useState(false);
|
|
1661
|
+
const filteredOptions = React__default.default.useMemo(() => {
|
|
1662
|
+
if (!filterValue || filterValue.trim().length === 0) {
|
|
1663
|
+
return options;
|
|
1664
|
+
}
|
|
1665
|
+
if (!options) {
|
|
1666
|
+
return options;
|
|
1667
|
+
}
|
|
1668
|
+
const filterOptions = (opts) => {
|
|
1669
|
+
return withoutNils(
|
|
1670
|
+
opts.map((op) => {
|
|
1671
|
+
if (op.type === "option-group") {
|
|
1672
|
+
return __spreadProps$7(__spreadValues$d({}, op), {
|
|
1673
|
+
items: op.items ? filterOptions(op.items) : void 0
|
|
1674
|
+
});
|
|
1675
|
+
} else {
|
|
1676
|
+
if (contains(optionText(op), filterValue)) {
|
|
1677
|
+
return op;
|
|
1678
|
+
} else {
|
|
1679
|
+
return void 0;
|
|
1680
|
+
}
|
|
1681
|
+
}
|
|
1682
|
+
})
|
|
1683
|
+
);
|
|
1684
|
+
};
|
|
1685
|
+
return filterOptions(options);
|
|
1686
|
+
}, [filterValue, options, contains, optionText]);
|
|
1687
|
+
const flattenedOptions = React__default.default.useMemo(
|
|
1688
|
+
() => flattenOptions(options),
|
|
1689
|
+
[options]
|
|
1690
|
+
);
|
|
1691
|
+
const disabledKeys = flattenedOptions.filter((op) => op.isDisabled).map((op) => op.id);
|
|
1692
|
+
const onSelectionChange = React__default.default.useCallback(
|
|
1693
|
+
(key) => {
|
|
1694
|
+
if (key === null) {
|
|
1695
|
+
return;
|
|
1696
|
+
}
|
|
1697
|
+
const selectedOption = flattenedOptions == null ? void 0 : flattenedOptions.find((op) => op.id === key);
|
|
1698
|
+
if (valueType === "text") {
|
|
1699
|
+
if (selectedOption) {
|
|
1700
|
+
onChange == null ? void 0 : onChange(optionText(selectedOption));
|
|
1701
|
+
}
|
|
1702
|
+
} else {
|
|
1703
|
+
onChange == null ? void 0 : onChange(key);
|
|
1704
|
+
}
|
|
1705
|
+
if (selectedOption) {
|
|
1706
|
+
onFilterValueChange == null ? void 0 : onFilterValueChange(optionText(selectedOption));
|
|
1707
|
+
}
|
|
1708
|
+
},
|
|
1709
|
+
[flattenedOptions, valueType, onChange, optionText, onFilterValueChange]
|
|
1710
|
+
);
|
|
1711
|
+
const onInputValueChange = React__default.default.useCallback(
|
|
1712
|
+
(newValue) => {
|
|
1713
|
+
onFilterValueChange == null ? void 0 : onFilterValueChange(newValue);
|
|
1714
|
+
setShowAllOptions(false);
|
|
1715
|
+
if (valueType === "text") {
|
|
1716
|
+
if (allowsCustomValue) {
|
|
1717
|
+
onChange == null ? void 0 : onChange(newValue);
|
|
1718
|
+
} else {
|
|
1719
|
+
const matchingOption = flattenedOptions == null ? void 0 : flattenedOptions.find(
|
|
1720
|
+
(op) => optionText(op) === newValue
|
|
1721
|
+
);
|
|
1722
|
+
if (matchingOption) {
|
|
1723
|
+
onChange == null ? void 0 : onChange(optionText(matchingOption));
|
|
1724
|
+
}
|
|
1725
|
+
}
|
|
1726
|
+
}
|
|
1727
|
+
},
|
|
1728
|
+
[
|
|
1729
|
+
onFilterValueChange,
|
|
1730
|
+
onChange,
|
|
1731
|
+
flattenedOptions,
|
|
1732
|
+
optionText,
|
|
1733
|
+
valueType,
|
|
1734
|
+
allowsCustomValue
|
|
1735
|
+
]
|
|
1736
|
+
);
|
|
1737
|
+
const onBlur = React__default.default.useCallback(() => {
|
|
1738
|
+
if (!allowsCustomValue) {
|
|
1739
|
+
const selectedOption = flattenedOptions == null ? void 0 : flattenedOptions.find(
|
|
1740
|
+
(op) => valueType === "text" ? optionText(op) === value : op.id === value
|
|
1017
1741
|
);
|
|
1018
1742
|
if (selectedOption) {
|
|
1019
1743
|
const selectedOptionText = optionText(selectedOption);
|
|
@@ -1033,7 +1757,7 @@ function BaseComboBox(props) {
|
|
|
1033
1757
|
]);
|
|
1034
1758
|
return /* @__PURE__ */ React__default.default.createElement(
|
|
1035
1759
|
reactAriaComponents.ComboBox,
|
|
1036
|
-
__spreadValues$
|
|
1760
|
+
__spreadValues$d({
|
|
1037
1761
|
selectedKey: value,
|
|
1038
1762
|
onSelectionChange,
|
|
1039
1763
|
isDisabled,
|
|
@@ -1111,215 +1835,154 @@ function registerComboBox(loader) {
|
|
|
1111
1835
|
},
|
|
1112
1836
|
valueType: {
|
|
1113
1837
|
displayName: "`value` Type",
|
|
1114
|
-
type: "choice",
|
|
1115
|
-
options: [
|
|
1116
|
-
{ value: "value", label: "By option value" },
|
|
1117
|
-
{ value: "text", label: "By option text" }
|
|
1118
|
-
],
|
|
1119
|
-
defaultValueHint: "value",
|
|
1120
|
-
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.",
|
|
1121
|
-
advanced: true
|
|
1122
|
-
},
|
|
1123
|
-
allowsCustomValue: {
|
|
1124
|
-
type: "boolean",
|
|
1125
|
-
displayName: "Allows custom value?",
|
|
1126
|
-
description: "Allows entering a value that is not one of the options",
|
|
1127
|
-
hidden: (ps) => ps.valueType !== "text",
|
|
1128
|
-
advanced: true
|
|
1129
|
-
},
|
|
1130
|
-
onOpenChange: {
|
|
1131
|
-
type: "eventHandler",
|
|
1132
|
-
argTypes: [{ name: "isOpen", type: "boolean" }]
|
|
1133
|
-
},
|
|
1134
|
-
structure: {
|
|
1135
|
-
type: "slot"
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
isOpen: {
|
|
1228
|
-
type: "writable",
|
|
1229
|
-
valueProp: "isOpen",
|
|
1230
|
-
onChangeProp: "onOpenChange",
|
|
1231
|
-
variableType: "boolean"
|
|
1232
|
-
}
|
|
1233
|
-
},
|
|
1234
|
-
trapsFocus: true
|
|
1235
|
-
},
|
|
1236
|
-
overrides
|
|
1237
|
-
);
|
|
1238
|
-
}
|
|
1239
|
-
|
|
1240
|
-
var __defProp$d = Object.defineProperty;
|
|
1241
|
-
var __getOwnPropSymbols$d = Object.getOwnPropertySymbols;
|
|
1242
|
-
var __hasOwnProp$d = Object.prototype.hasOwnProperty;
|
|
1243
|
-
var __propIsEnum$d = Object.prototype.propertyIsEnumerable;
|
|
1244
|
-
var __defNormalProp$d = (obj, key, value) => key in obj ? __defProp$d(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1245
|
-
var __spreadValues$d = (a, b) => {
|
|
1246
|
-
for (var prop in b || (b = {}))
|
|
1247
|
-
if (__hasOwnProp$d.call(b, prop))
|
|
1248
|
-
__defNormalProp$d(a, prop, b[prop]);
|
|
1249
|
-
if (__getOwnPropSymbols$d)
|
|
1250
|
-
for (var prop of __getOwnPropSymbols$d(b)) {
|
|
1251
|
-
if (__propIsEnum$d.call(b, prop))
|
|
1252
|
-
__defNormalProp$d(a, prop, b[prop]);
|
|
1253
|
-
}
|
|
1254
|
-
return a;
|
|
1255
|
-
};
|
|
1256
|
-
var __objRest$9 = (source, exclude) => {
|
|
1257
|
-
var target = {};
|
|
1258
|
-
for (var prop in source)
|
|
1259
|
-
if (__hasOwnProp$d.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
1260
|
-
target[prop] = source[prop];
|
|
1261
|
-
if (source != null && __getOwnPropSymbols$d)
|
|
1262
|
-
for (var prop of __getOwnPropSymbols$d(source)) {
|
|
1263
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$d.call(source, prop))
|
|
1264
|
-
target[prop] = source[prop];
|
|
1265
|
-
}
|
|
1266
|
-
return target;
|
|
1267
|
-
};
|
|
1268
|
-
function BaseForm(props) {
|
|
1269
|
-
const _a = props, { onSubmit, children } = _a, rest = __objRest$9(_a, ["onSubmit", "children"]);
|
|
1270
|
-
return /* @__PURE__ */ React__default.default.createElement(
|
|
1271
|
-
reactAriaComponents.Form,
|
|
1272
|
-
__spreadValues$d({
|
|
1273
|
-
onSubmit: (e) => {
|
|
1274
|
-
e.preventDefault();
|
|
1275
|
-
const formData = new FormData(e.currentTarget);
|
|
1276
|
-
const formValues = {};
|
|
1277
|
-
formData.forEach((value, key) => {
|
|
1278
|
-
const field = e.currentTarget.elements.namedItem(key);
|
|
1279
|
-
if (field instanceof RadioNodeList && Array.from(field.values()).every(
|
|
1280
|
-
(f) => f.type === "checkbox"
|
|
1281
|
-
)) {
|
|
1282
|
-
formValues[key] = formData.getAll(key);
|
|
1283
|
-
} else {
|
|
1284
|
-
field.type;
|
|
1285
|
-
formValues[key] = formData.get(key);
|
|
1838
|
+
type: "choice",
|
|
1839
|
+
options: [
|
|
1840
|
+
{ value: "value", label: "By option value" },
|
|
1841
|
+
{ value: "text", label: "By option text" }
|
|
1842
|
+
],
|
|
1843
|
+
defaultValueHint: "value",
|
|
1844
|
+
description: "This controls whether `value` and `onChange` are option values or option text. Choosing `text` allows you to optionally allow a custom value that's not in the provided list of options.",
|
|
1845
|
+
advanced: true
|
|
1846
|
+
},
|
|
1847
|
+
allowsCustomValue: {
|
|
1848
|
+
type: "boolean",
|
|
1849
|
+
displayName: "Allows custom value?",
|
|
1850
|
+
description: "Allows entering a value that is not one of the options",
|
|
1851
|
+
hidden: (ps) => ps.valueType !== "text",
|
|
1852
|
+
advanced: true
|
|
1853
|
+
},
|
|
1854
|
+
onOpenChange: {
|
|
1855
|
+
type: "eventHandler",
|
|
1856
|
+
argTypes: [{ name: "isOpen", type: "boolean" }]
|
|
1857
|
+
},
|
|
1858
|
+
structure: {
|
|
1859
|
+
type: "slot",
|
|
1860
|
+
defaultValue: [
|
|
1861
|
+
{
|
|
1862
|
+
type: "vbox",
|
|
1863
|
+
styles: {
|
|
1864
|
+
justifyContent: "flex-start",
|
|
1865
|
+
alignItems: "flex-start",
|
|
1866
|
+
width: "300px",
|
|
1867
|
+
padding: 0
|
|
1868
|
+
},
|
|
1869
|
+
children: [
|
|
1870
|
+
{
|
|
1871
|
+
type: "component",
|
|
1872
|
+
name: LABEL_COMPONENT_NAME,
|
|
1873
|
+
props: {
|
|
1874
|
+
children: {
|
|
1875
|
+
type: "text",
|
|
1876
|
+
value: "Label"
|
|
1877
|
+
}
|
|
1878
|
+
}
|
|
1879
|
+
},
|
|
1880
|
+
{
|
|
1881
|
+
type: "hbox",
|
|
1882
|
+
styles: {
|
|
1883
|
+
width: "stretch",
|
|
1884
|
+
borderWidth: "1px",
|
|
1885
|
+
borderStyle: "solid",
|
|
1886
|
+
borderColor: "black",
|
|
1887
|
+
padding: 0,
|
|
1888
|
+
position: "relative"
|
|
1889
|
+
},
|
|
1890
|
+
children: [
|
|
1891
|
+
{
|
|
1892
|
+
type: "component",
|
|
1893
|
+
name: INPUT_COMPONENT_NAME,
|
|
1894
|
+
styles: {
|
|
1895
|
+
borderWidth: 0,
|
|
1896
|
+
width: "100%",
|
|
1897
|
+
padding: "2px 30px 2px 10px"
|
|
1898
|
+
}
|
|
1899
|
+
},
|
|
1900
|
+
{
|
|
1901
|
+
type: "component",
|
|
1902
|
+
name: BUTTON_COMPONENT_NAME,
|
|
1903
|
+
styles: {
|
|
1904
|
+
borderWidth: 0,
|
|
1905
|
+
display: "flex",
|
|
1906
|
+
alignItems: "center",
|
|
1907
|
+
justifyContent: "center",
|
|
1908
|
+
position: "absolute",
|
|
1909
|
+
right: "10px",
|
|
1910
|
+
top: 0,
|
|
1911
|
+
padding: 0,
|
|
1912
|
+
height: "100%"
|
|
1913
|
+
},
|
|
1914
|
+
props: {
|
|
1915
|
+
children: {
|
|
1916
|
+
type: "img",
|
|
1917
|
+
src: "https://static1.plasmic.app/arrow-up.svg",
|
|
1918
|
+
styles: {
|
|
1919
|
+
height: "20px",
|
|
1920
|
+
width: "20px",
|
|
1921
|
+
transform: "rotate(180deg)"
|
|
1922
|
+
}
|
|
1923
|
+
}
|
|
1924
|
+
}
|
|
1925
|
+
}
|
|
1926
|
+
]
|
|
1927
|
+
},
|
|
1928
|
+
{
|
|
1929
|
+
type: "component",
|
|
1930
|
+
name: POPOVER_COMPONENT_NAME,
|
|
1931
|
+
styles: {
|
|
1932
|
+
backgroundColor: "white",
|
|
1933
|
+
width: "300px",
|
|
1934
|
+
padding: "10px",
|
|
1935
|
+
overflow: "scroll"
|
|
1936
|
+
},
|
|
1937
|
+
props: {
|
|
1938
|
+
children: [
|
|
1939
|
+
{
|
|
1940
|
+
type: "component",
|
|
1941
|
+
name: LIST_BOX_COMPONENT_NAME,
|
|
1942
|
+
styles: {
|
|
1943
|
+
borderWidth: 0,
|
|
1944
|
+
width: "stretch"
|
|
1945
|
+
}
|
|
1946
|
+
}
|
|
1947
|
+
]
|
|
1948
|
+
}
|
|
1949
|
+
}
|
|
1950
|
+
]
|
|
1286
1951
|
}
|
|
1287
|
-
|
|
1288
|
-
onSubmit == null ? void 0 : onSubmit(formValues);
|
|
1289
|
-
}
|
|
1290
|
-
}, rest),
|
|
1291
|
-
children
|
|
1292
|
-
);
|
|
1293
|
-
}
|
|
1294
|
-
function registerForm(loader, overrides) {
|
|
1295
|
-
registerComponentHelper(
|
|
1296
|
-
loader,
|
|
1297
|
-
BaseForm,
|
|
1298
|
-
{
|
|
1299
|
-
name: makeComponentName("form"),
|
|
1300
|
-
displayName: "Aria Form",
|
|
1301
|
-
importPath: "@plasmicpkgs/react-aria/skinny/registerForm",
|
|
1302
|
-
importName: "BaseForm",
|
|
1303
|
-
props: {
|
|
1304
|
-
children: {
|
|
1305
|
-
type: "slot"
|
|
1306
|
-
},
|
|
1307
|
-
onSubmit: {
|
|
1308
|
-
type: "eventHandler",
|
|
1309
|
-
argTypes: [{ name: "data", type: "object" }]
|
|
1310
|
-
},
|
|
1311
|
-
onReset: {
|
|
1312
|
-
type: "eventHandler",
|
|
1313
|
-
argTypes: []
|
|
1314
|
-
}
|
|
1952
|
+
]
|
|
1315
1953
|
},
|
|
1316
|
-
|
|
1954
|
+
previewOpen: {
|
|
1955
|
+
type: "boolean",
|
|
1956
|
+
displayName: "Preview opened?",
|
|
1957
|
+
description: "Preview opened state while designing in Plasmic editor",
|
|
1958
|
+
editOnly: true
|
|
1959
|
+
}
|
|
1317
1960
|
},
|
|
1318
|
-
|
|
1319
|
-
|
|
1961
|
+
states: {
|
|
1962
|
+
value: {
|
|
1963
|
+
type: "writable",
|
|
1964
|
+
valueProp: "value",
|
|
1965
|
+
onChangeProp: "onChange",
|
|
1966
|
+
variableType: "text"
|
|
1967
|
+
},
|
|
1968
|
+
filterValue: {
|
|
1969
|
+
type: "writable",
|
|
1970
|
+
valueProp: "filterValue",
|
|
1971
|
+
onChangeProp: "onFilterValueChange",
|
|
1972
|
+
variableType: "text"
|
|
1973
|
+
},
|
|
1974
|
+
isOpen: {
|
|
1975
|
+
type: "readonly",
|
|
1976
|
+
onChangeProp: "onOpenChange",
|
|
1977
|
+
variableType: "boolean"
|
|
1978
|
+
}
|
|
1979
|
+
}
|
|
1980
|
+
});
|
|
1320
1981
|
}
|
|
1321
1982
|
|
|
1322
1983
|
var __defProp$c = Object.defineProperty;
|
|
1984
|
+
var __defProps$6 = Object.defineProperties;
|
|
1985
|
+
var __getOwnPropDescs$6 = Object.getOwnPropertyDescriptors;
|
|
1323
1986
|
var __getOwnPropSymbols$c = Object.getOwnPropertySymbols;
|
|
1324
1987
|
var __hasOwnProp$c = Object.prototype.hasOwnProperty;
|
|
1325
1988
|
var __propIsEnum$c = Object.prototype.propertyIsEnumerable;
|
|
@@ -1335,7 +1998,8 @@ var __spreadValues$c = (a, b) => {
|
|
|
1335
1998
|
}
|
|
1336
1999
|
return a;
|
|
1337
2000
|
};
|
|
1338
|
-
var
|
|
2001
|
+
var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));
|
|
2002
|
+
var __objRest$a = (source, exclude) => {
|
|
1339
2003
|
var target = {};
|
|
1340
2004
|
for (var prop in source)
|
|
1341
2005
|
if (__hasOwnProp$c.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
@@ -1347,46 +2011,163 @@ var __objRest$8 = (source, exclude) => {
|
|
|
1347
2011
|
}
|
|
1348
2012
|
return target;
|
|
1349
2013
|
};
|
|
1350
|
-
const
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
2014
|
+
const BaseModal = React.forwardRef(
|
|
2015
|
+
function _BaseModal(props, ref) {
|
|
2016
|
+
const _a = props, {
|
|
2017
|
+
children,
|
|
2018
|
+
heading,
|
|
2019
|
+
modalOverlayClass,
|
|
2020
|
+
onOpenChange,
|
|
2021
|
+
className,
|
|
2022
|
+
isOpen,
|
|
2023
|
+
setControlContextData
|
|
2024
|
+
} = _a, rest = __objRest$a(_a, [
|
|
2025
|
+
"children",
|
|
2026
|
+
"heading",
|
|
2027
|
+
"modalOverlayClass",
|
|
2028
|
+
"onOpenChange",
|
|
2029
|
+
"className",
|
|
2030
|
+
"isOpen",
|
|
2031
|
+
"setControlContextData"
|
|
2032
|
+
]);
|
|
2033
|
+
const contextProps = React__default.default.useContext(PlasmicDialogTriggerContext);
|
|
2034
|
+
const isStandalone = !contextProps;
|
|
2035
|
+
const mergedProps = reactAria.mergeProps(contextProps, rest, {
|
|
2036
|
+
isOpen: isStandalone ? isOpen : contextProps.isOpen
|
|
2037
|
+
});
|
|
2038
|
+
setControlContextData == null ? void 0 : setControlContextData({
|
|
2039
|
+
isStandalone
|
|
2040
|
+
});
|
|
2041
|
+
React.useImperativeHandle(ref, () => ({
|
|
2042
|
+
close: () => {
|
|
2043
|
+
onOpenChange(false);
|
|
1368
2044
|
},
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
focused: false
|
|
1372
|
-
});
|
|
2045
|
+
open: () => {
|
|
2046
|
+
onOpenChange(true);
|
|
1373
2047
|
}
|
|
1374
|
-
}
|
|
1375
|
-
|
|
1376
|
-
}
|
|
1377
|
-
|
|
2048
|
+
}));
|
|
2049
|
+
const isCanvas = host.usePlasmicCanvasContext();
|
|
2050
|
+
const body = /* @__PURE__ */ React__default.default.createElement(React__default.default.Fragment, null, heading && /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Heading, { slot: "title" }, heading), children);
|
|
2051
|
+
return /* @__PURE__ */ React__default.default.createElement(
|
|
2052
|
+
reactAriaComponents.ModalOverlay,
|
|
2053
|
+
__spreadProps$6(__spreadValues$c({}, mergedProps), {
|
|
2054
|
+
className: modalOverlayClass,
|
|
2055
|
+
onOpenChange
|
|
2056
|
+
}),
|
|
2057
|
+
/* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Modal, { className }, isCanvas ? body : /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Dialog, null, body))
|
|
2058
|
+
);
|
|
2059
|
+
}
|
|
2060
|
+
);
|
|
2061
|
+
const MODAL_COMPONENT_NAME = makeComponentName("modal");
|
|
2062
|
+
function registerModal(loader, overrides) {
|
|
1378
2063
|
registerComponentHelper(
|
|
1379
2064
|
loader,
|
|
1380
|
-
|
|
2065
|
+
BaseModal,
|
|
1381
2066
|
{
|
|
1382
|
-
name:
|
|
1383
|
-
displayName: "Aria
|
|
1384
|
-
importPath: "@plasmicpkgs/react-aria/skinny/
|
|
1385
|
-
importName: "
|
|
1386
|
-
|
|
2067
|
+
name: MODAL_COMPONENT_NAME,
|
|
2068
|
+
displayName: "Aria Modal",
|
|
2069
|
+
importPath: "@plasmicpkgs/react-aria/skinny/registerModal",
|
|
2070
|
+
importName: "BaseModal",
|
|
2071
|
+
styleSections: true,
|
|
2072
|
+
defaultStyles: {
|
|
2073
|
+
// centering the modal on the page by default
|
|
2074
|
+
position: "fixed",
|
|
2075
|
+
top: "10%",
|
|
2076
|
+
left: "50%",
|
|
2077
|
+
width: "50%",
|
|
2078
|
+
transform: "translateX(-50%)",
|
|
2079
|
+
borderWidth: "1px",
|
|
2080
|
+
borderStyle: "solid",
|
|
2081
|
+
borderColor: "black",
|
|
2082
|
+
padding: "20px",
|
|
2083
|
+
maxWidth: "300px",
|
|
2084
|
+
backgroundColor: "#FDE3C3"
|
|
2085
|
+
},
|
|
2086
|
+
refActions: {
|
|
2087
|
+
open: {
|
|
2088
|
+
description: "Open the modal",
|
|
2089
|
+
argTypes: []
|
|
2090
|
+
},
|
|
2091
|
+
close: {
|
|
2092
|
+
description: "Close the modal",
|
|
2093
|
+
argTypes: []
|
|
2094
|
+
}
|
|
2095
|
+
},
|
|
1387
2096
|
props: {
|
|
1388
|
-
|
|
1389
|
-
type: "
|
|
2097
|
+
heading: {
|
|
2098
|
+
type: "slot",
|
|
2099
|
+
defaultValue: {
|
|
2100
|
+
type: "text",
|
|
2101
|
+
value: "Modal Heading",
|
|
2102
|
+
styles: {
|
|
2103
|
+
fontSize: "20px",
|
|
2104
|
+
fontWeight: "bold",
|
|
2105
|
+
marginBottom: "10px"
|
|
2106
|
+
}
|
|
2107
|
+
}
|
|
2108
|
+
},
|
|
2109
|
+
children: {
|
|
2110
|
+
type: "slot",
|
|
2111
|
+
defaultValue: {
|
|
2112
|
+
type: "vbox",
|
|
2113
|
+
styles: {
|
|
2114
|
+
width: "stretch",
|
|
2115
|
+
padding: 0,
|
|
2116
|
+
gap: "10px",
|
|
2117
|
+
justifyContent: "flex-start",
|
|
2118
|
+
alignItems: "flex-start"
|
|
2119
|
+
},
|
|
2120
|
+
children: [
|
|
2121
|
+
{
|
|
2122
|
+
type: "text",
|
|
2123
|
+
value: "This is a Modal!"
|
|
2124
|
+
},
|
|
2125
|
+
{
|
|
2126
|
+
type: "text",
|
|
2127
|
+
value: "You can put anything you can imagine here!",
|
|
2128
|
+
styles: {
|
|
2129
|
+
fontWeight: 500
|
|
2130
|
+
}
|
|
2131
|
+
},
|
|
2132
|
+
{
|
|
2133
|
+
type: "text",
|
|
2134
|
+
value: "Use it in a `Aria Dialog Trigger` component to trigger it on a button click!"
|
|
2135
|
+
}
|
|
2136
|
+
]
|
|
2137
|
+
}
|
|
2138
|
+
},
|
|
2139
|
+
modalOverlayClass: {
|
|
2140
|
+
type: "class",
|
|
2141
|
+
displayName: "Modal Overlay"
|
|
2142
|
+
},
|
|
2143
|
+
isOpen: {
|
|
2144
|
+
type: "boolean",
|
|
2145
|
+
editOnly: true,
|
|
2146
|
+
uncontrolledProp: "defaultOpen",
|
|
2147
|
+
defaultValueHint: false,
|
|
2148
|
+
defaultValue: true,
|
|
2149
|
+
hidden: (_ps, ctx) => !(ctx == null ? void 0 : ctx.isStandalone)
|
|
2150
|
+
},
|
|
2151
|
+
isDismissable: {
|
|
2152
|
+
type: "boolean",
|
|
2153
|
+
description: "Whether to close the modal when the user interacts outside it."
|
|
2154
|
+
},
|
|
2155
|
+
isKeyboardDismissDisabled: {
|
|
2156
|
+
type: "boolean",
|
|
2157
|
+
description: "Whether pressing the escape key to close the modal should be disabled."
|
|
2158
|
+
},
|
|
2159
|
+
onOpenChange: {
|
|
2160
|
+
type: "eventHandler",
|
|
2161
|
+
argTypes: [{ name: "isOpen", type: "boolean" }]
|
|
2162
|
+
}
|
|
2163
|
+
},
|
|
2164
|
+
states: {
|
|
2165
|
+
isOpen: {
|
|
2166
|
+
type: "writable",
|
|
2167
|
+
valueProp: "isOpen",
|
|
2168
|
+
onChangeProp: "onOpenChange",
|
|
2169
|
+
variableType: "boolean",
|
|
2170
|
+
hidden: (_ps, ctx) => !(ctx == null ? void 0 : ctx.isStandalone)
|
|
1390
2171
|
}
|
|
1391
2172
|
},
|
|
1392
2173
|
trapsFocus: true
|
|
@@ -1411,33 +2192,79 @@ var __spreadValues$b = (a, b) => {
|
|
|
1411
2192
|
}
|
|
1412
2193
|
return a;
|
|
1413
2194
|
};
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
2195
|
+
var __objRest$9 = (source, exclude) => {
|
|
2196
|
+
var target = {};
|
|
2197
|
+
for (var prop in source)
|
|
2198
|
+
if (__hasOwnProp$b.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
2199
|
+
target[prop] = source[prop];
|
|
2200
|
+
if (source != null && __getOwnPropSymbols$b)
|
|
2201
|
+
for (var prop of __getOwnPropSymbols$b(source)) {
|
|
2202
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$b.call(source, prop))
|
|
2203
|
+
target[prop] = source[prop];
|
|
2204
|
+
}
|
|
2205
|
+
return target;
|
|
2206
|
+
};
|
|
2207
|
+
function BaseDialogTrigger(props) {
|
|
2208
|
+
const _a = props, { trigger, dialog } = _a, rest = __objRest$9(_a, ["trigger", "dialog"]);
|
|
2209
|
+
return /* @__PURE__ */ React__default.default.createElement(PlasmicDialogTriggerContext.Provider, { value: props }, /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.DialogTrigger, __spreadValues$b({}, rest), trigger, dialog));
|
|
1418
2210
|
}
|
|
1419
|
-
function
|
|
2211
|
+
function registerDialogTrigger(loader, overrides) {
|
|
1420
2212
|
registerComponentHelper(
|
|
1421
2213
|
loader,
|
|
1422
|
-
|
|
2214
|
+
BaseDialogTrigger,
|
|
1423
2215
|
{
|
|
1424
|
-
name: makeComponentName("
|
|
1425
|
-
displayName: "Aria
|
|
1426
|
-
importPath: "@plasmicpkgs/react-aria/skinny/
|
|
1427
|
-
importName: "
|
|
2216
|
+
name: makeComponentName("dialogTrigger"),
|
|
2217
|
+
displayName: "Aria Dialog Trigger",
|
|
2218
|
+
importPath: "@plasmicpkgs/react-aria/skinny/registerDialogTrigger",
|
|
2219
|
+
importName: "BaseDialogTrigger",
|
|
2220
|
+
isAttachment: true,
|
|
1428
2221
|
props: {
|
|
1429
|
-
|
|
1430
|
-
type: "slot"
|
|
2222
|
+
trigger: {
|
|
2223
|
+
type: "slot",
|
|
2224
|
+
defaultValue: {
|
|
2225
|
+
type: "component",
|
|
2226
|
+
name: BUTTON_COMPONENT_NAME,
|
|
2227
|
+
props: {
|
|
2228
|
+
children: {
|
|
2229
|
+
type: "text",
|
|
2230
|
+
value: "Open Dialog"
|
|
2231
|
+
}
|
|
2232
|
+
}
|
|
2233
|
+
}
|
|
2234
|
+
},
|
|
2235
|
+
dialog: {
|
|
2236
|
+
type: "slot",
|
|
2237
|
+
defaultValue: {
|
|
2238
|
+
type: "component",
|
|
2239
|
+
name: MODAL_COMPONENT_NAME
|
|
2240
|
+
}
|
|
2241
|
+
},
|
|
2242
|
+
isOpen: {
|
|
2243
|
+
type: "boolean",
|
|
2244
|
+
defaultValueHint: false,
|
|
2245
|
+
editOnly: true,
|
|
2246
|
+
uncontrolledProp: "defaultOpen"
|
|
2247
|
+
},
|
|
2248
|
+
onOpenChange: {
|
|
2249
|
+
type: "eventHandler",
|
|
2250
|
+
argTypes: [{ name: "isOpen", type: "boolean" }]
|
|
2251
|
+
}
|
|
2252
|
+
},
|
|
2253
|
+
states: {
|
|
2254
|
+
isOpen: {
|
|
2255
|
+
type: "writable",
|
|
2256
|
+
valueProp: "isOpen",
|
|
2257
|
+
onChangeProp: "onOpenChange",
|
|
2258
|
+
variableType: "boolean"
|
|
1431
2259
|
}
|
|
1432
|
-
}
|
|
2260
|
+
},
|
|
2261
|
+
trapsFocus: true
|
|
1433
2262
|
},
|
|
1434
2263
|
overrides
|
|
1435
2264
|
);
|
|
1436
2265
|
}
|
|
1437
2266
|
|
|
1438
2267
|
var __defProp$a = Object.defineProperty;
|
|
1439
|
-
var __defProps$6 = Object.defineProperties;
|
|
1440
|
-
var __getOwnPropDescs$6 = Object.getOwnPropertyDescriptors;
|
|
1441
2268
|
var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
|
|
1442
2269
|
var __hasOwnProp$a = Object.prototype.hasOwnProperty;
|
|
1443
2270
|
var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
|
|
@@ -1453,8 +2280,7 @@ var __spreadValues$a = (a, b) => {
|
|
|
1453
2280
|
}
|
|
1454
2281
|
return a;
|
|
1455
2282
|
};
|
|
1456
|
-
var
|
|
1457
|
-
var __objRest$7 = (source, exclude) => {
|
|
2283
|
+
var __objRest$8 = (source, exclude) => {
|
|
1458
2284
|
var target = {};
|
|
1459
2285
|
for (var prop in source)
|
|
1460
2286
|
if (__hasOwnProp$a.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
@@ -1466,70 +2292,74 @@ var __objRest$7 = (source, exclude) => {
|
|
|
1466
2292
|
}
|
|
1467
2293
|
return target;
|
|
1468
2294
|
};
|
|
1469
|
-
function
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
PlasmicSectionContext.Provider,
|
|
1488
|
-
{
|
|
1489
|
-
value: {
|
|
1490
|
-
renderItem,
|
|
1491
|
-
key: (_a2 = item.key) != null ? _a2 : item.label,
|
|
1492
|
-
section: item
|
|
2295
|
+
function BaseForm(props) {
|
|
2296
|
+
const _a = props, { onSubmit, children } = _a, rest = __objRest$8(_a, ["onSubmit", "children"]);
|
|
2297
|
+
return /* @__PURE__ */ React__default.default.createElement(
|
|
2298
|
+
reactAriaComponents.Form,
|
|
2299
|
+
__spreadValues$a({
|
|
2300
|
+
onSubmit: (e) => {
|
|
2301
|
+
e.preventDefault();
|
|
2302
|
+
const formData = new FormData(e.currentTarget);
|
|
2303
|
+
const formValues = {};
|
|
2304
|
+
formData.forEach((value, key) => {
|
|
2305
|
+
const field = e.currentTarget.elements.namedItem(key);
|
|
2306
|
+
if (field instanceof RadioNodeList && Array.from(field.values()).every(
|
|
2307
|
+
(f) => f.type === "checkbox"
|
|
2308
|
+
)) {
|
|
2309
|
+
formValues[key] = formData.getAll(key);
|
|
2310
|
+
} else {
|
|
2311
|
+
field.type;
|
|
2312
|
+
formValues[key] = formData.get(key);
|
|
1493
2313
|
}
|
|
1494
|
-
}
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
}
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
});
|
|
2314
|
+
});
|
|
2315
|
+
onSubmit == null ? void 0 : onSubmit(formValues);
|
|
2316
|
+
}
|
|
2317
|
+
}, rest),
|
|
2318
|
+
children
|
|
2319
|
+
);
|
|
1501
2320
|
}
|
|
1502
|
-
function
|
|
2321
|
+
function registerForm(loader, overrides) {
|
|
1503
2322
|
registerComponentHelper(
|
|
1504
2323
|
loader,
|
|
1505
|
-
|
|
2324
|
+
BaseForm,
|
|
1506
2325
|
{
|
|
1507
|
-
name: makeComponentName("
|
|
1508
|
-
displayName: "Aria
|
|
1509
|
-
importPath: "@plasmicpkgs/react-aria/skinny/
|
|
1510
|
-
importName: "
|
|
2326
|
+
name: makeComponentName("form"),
|
|
2327
|
+
displayName: "Aria Form",
|
|
2328
|
+
importPath: "@plasmicpkgs/react-aria/skinny/registerForm",
|
|
2329
|
+
importName: "BaseForm",
|
|
1511
2330
|
props: {
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
hidden: (_ps, ctx) => !(ctx == null ? void 0 : ctx.isStandalone)
|
|
1515
|
-
}),
|
|
1516
|
-
renderItem: {
|
|
1517
|
-
type: "slot",
|
|
1518
|
-
displayName: "Render Item",
|
|
1519
|
-
renderPropParams: ["itemProps"]
|
|
2331
|
+
children: {
|
|
2332
|
+
type: "slot"
|
|
1520
2333
|
},
|
|
1521
|
-
|
|
1522
|
-
type: "
|
|
1523
|
-
|
|
1524
|
-
|
|
2334
|
+
onSubmit: {
|
|
2335
|
+
type: "eventHandler",
|
|
2336
|
+
argTypes: [{ name: "data", type: "object" }]
|
|
2337
|
+
},
|
|
2338
|
+
onReset: {
|
|
2339
|
+
type: "eventHandler",
|
|
2340
|
+
argTypes: []
|
|
1525
2341
|
}
|
|
1526
|
-
}
|
|
2342
|
+
},
|
|
2343
|
+
trapsFocus: true
|
|
1527
2344
|
},
|
|
1528
2345
|
overrides
|
|
1529
2346
|
);
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
2347
|
+
}
|
|
2348
|
+
|
|
2349
|
+
class ErrorBoundary extends React.Component {
|
|
2350
|
+
constructor(props) {
|
|
2351
|
+
super(props);
|
|
2352
|
+
this.state = { hasError: false };
|
|
2353
|
+
}
|
|
2354
|
+
static getDerivedStateFromError(_) {
|
|
2355
|
+
return { hasError: true };
|
|
2356
|
+
}
|
|
2357
|
+
render() {
|
|
2358
|
+
if (this.state.hasError) {
|
|
2359
|
+
return this.props.fallback;
|
|
2360
|
+
}
|
|
2361
|
+
return this.props.children;
|
|
2362
|
+
}
|
|
1533
2363
|
}
|
|
1534
2364
|
|
|
1535
2365
|
var __defProp$9 = Object.defineProperty;
|
|
@@ -1551,7 +2381,7 @@ var __spreadValues$9 = (a, b) => {
|
|
|
1551
2381
|
return a;
|
|
1552
2382
|
};
|
|
1553
2383
|
var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));
|
|
1554
|
-
var __objRest$
|
|
2384
|
+
var __objRest$7 = (source, exclude) => {
|
|
1555
2385
|
var target = {};
|
|
1556
2386
|
for (var prop in source)
|
|
1557
2387
|
if (__hasOwnProp$9.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
@@ -1563,97 +2393,245 @@ var __objRest$6 = (source, exclude) => {
|
|
|
1563
2393
|
}
|
|
1564
2394
|
return target;
|
|
1565
2395
|
};
|
|
1566
|
-
const
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
} = _a, rest = __objRest$6(_a, [
|
|
1575
|
-
"children",
|
|
1576
|
-
"heading",
|
|
1577
|
-
"modalOverlayClass",
|
|
1578
|
-
"onOpenChange",
|
|
1579
|
-
"className"
|
|
1580
|
-
]);
|
|
1581
|
-
React.useImperativeHandle(ref, () => ({
|
|
1582
|
-
close: () => {
|
|
1583
|
-
onOpenChange(false);
|
|
1584
|
-
},
|
|
1585
|
-
open: () => {
|
|
1586
|
-
onOpenChange(true);
|
|
1587
|
-
}
|
|
1588
|
-
}));
|
|
1589
|
-
const isCanvas = host.usePlasmicCanvasContext();
|
|
1590
|
-
const body = /* @__PURE__ */ React__default.default.createElement(React__default.default.Fragment, null, heading && /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Heading, { slot: "title" }, heading), children);
|
|
1591
|
-
return /* @__PURE__ */ React__default.default.createElement(
|
|
1592
|
-
reactAriaComponents.ModalOverlay,
|
|
1593
|
-
__spreadProps$5(__spreadValues$9({}, rest), {
|
|
1594
|
-
className: modalOverlayClass,
|
|
1595
|
-
onOpenChange
|
|
1596
|
-
}),
|
|
1597
|
-
/* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Modal, { className }, isCanvas ? body : /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Dialog, null, body))
|
|
1598
|
-
);
|
|
1599
|
-
}
|
|
2396
|
+
const RADIO_INTERACTION_VARIANTS = [
|
|
2397
|
+
"hovered",
|
|
2398
|
+
"pressed",
|
|
2399
|
+
"focused",
|
|
2400
|
+
"focusVisible"
|
|
2401
|
+
];
|
|
2402
|
+
const { interactionVariants: interactionVariants$4, withObservedValues: withObservedValues$3 } = pickAriaComponentVariants(
|
|
2403
|
+
RADIO_INTERACTION_VARIANTS
|
|
1600
2404
|
);
|
|
1601
|
-
function
|
|
1602
|
-
|
|
2405
|
+
function BaseRadio(props) {
|
|
2406
|
+
const _a = props, { children, updateInteractionVariant, setControlContextData } = _a, rest = __objRest$7(_a, ["children", "updateInteractionVariant", "setControlContextData"]);
|
|
2407
|
+
const contextProps = React__default.default.useContext(PlasmicRadioGroupContext);
|
|
2408
|
+
const radio = /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Radio, __spreadValues$9({}, rest), ({ isHovered, isPressed, isFocused, isFocusVisible }) => withObservedValues$3(
|
|
2409
|
+
children,
|
|
2410
|
+
{
|
|
2411
|
+
hovered: isHovered,
|
|
2412
|
+
pressed: isPressed,
|
|
2413
|
+
focused: isFocused,
|
|
2414
|
+
focusVisible: isFocusVisible
|
|
2415
|
+
},
|
|
2416
|
+
updateInteractionVariant
|
|
2417
|
+
));
|
|
2418
|
+
const isStandalone = !contextProps;
|
|
2419
|
+
setControlContextData == null ? void 0 : setControlContextData({
|
|
2420
|
+
isStandalone
|
|
2421
|
+
});
|
|
2422
|
+
return /* @__PURE__ */ React__default.default.createElement(ErrorBoundary, { fallback: /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.RadioGroup, null, radio) }, radio);
|
|
2423
|
+
}
|
|
2424
|
+
const makeDefaultRadioChildren = (label) => ({
|
|
2425
|
+
type: "hbox",
|
|
2426
|
+
styles: {
|
|
2427
|
+
display: "flex",
|
|
2428
|
+
alignItems: "center",
|
|
2429
|
+
gap: "10px",
|
|
2430
|
+
padding: 0
|
|
2431
|
+
},
|
|
2432
|
+
children: [
|
|
2433
|
+
{
|
|
2434
|
+
type: "box",
|
|
2435
|
+
styles: {
|
|
2436
|
+
width: "7px",
|
|
2437
|
+
height: "7px",
|
|
2438
|
+
borderRadius: "100%",
|
|
2439
|
+
borderWidth: "1px",
|
|
2440
|
+
borderStyle: "solid",
|
|
2441
|
+
borderColor: "black"
|
|
2442
|
+
}
|
|
2443
|
+
},
|
|
2444
|
+
{
|
|
2445
|
+
type: "component",
|
|
2446
|
+
name: LABEL_COMPONENT_NAME,
|
|
2447
|
+
props: {
|
|
2448
|
+
children: {
|
|
2449
|
+
type: "text",
|
|
2450
|
+
value: label
|
|
2451
|
+
}
|
|
2452
|
+
}
|
|
2453
|
+
}
|
|
2454
|
+
]
|
|
2455
|
+
});
|
|
2456
|
+
function registerRadio(loader, overrides) {
|
|
2457
|
+
return registerComponentHelper(
|
|
1603
2458
|
loader,
|
|
1604
|
-
|
|
2459
|
+
BaseRadio,
|
|
1605
2460
|
{
|
|
1606
|
-
name: makeComponentName("
|
|
1607
|
-
displayName: "Aria
|
|
1608
|
-
importPath: "@plasmicpkgs/react-aria/skinny/
|
|
1609
|
-
importName: "
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
2461
|
+
name: makeComponentName("radio"),
|
|
2462
|
+
displayName: "Aria Radio",
|
|
2463
|
+
importPath: "@plasmicpkgs/react-aria/skinny/registerRadio",
|
|
2464
|
+
importName: "BaseRadio",
|
|
2465
|
+
interactionVariants: interactionVariants$4,
|
|
2466
|
+
props: __spreadProps$5(__spreadValues$9({}, getCommonInputProps("radio", [
|
|
2467
|
+
"isDisabled",
|
|
2468
|
+
"autoFocus",
|
|
2469
|
+
"aria-label"
|
|
2470
|
+
])), {
|
|
2471
|
+
children: {
|
|
2472
|
+
type: "slot",
|
|
2473
|
+
mergeWithParent: true,
|
|
2474
|
+
defaultValue: makeDefaultRadioChildren("Radio")
|
|
1615
2475
|
},
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
2476
|
+
value: {
|
|
2477
|
+
type: "string",
|
|
2478
|
+
description: "The value of the input element, used when submitting an HTML form."
|
|
2479
|
+
},
|
|
2480
|
+
onSelectionChange: {
|
|
2481
|
+
type: "eventHandler",
|
|
2482
|
+
argTypes: [{ name: "isSelected", type: "boolean" }]
|
|
2483
|
+
}
|
|
2484
|
+
}),
|
|
2485
|
+
states: {
|
|
2486
|
+
isSelected: {
|
|
2487
|
+
type: "readonly",
|
|
2488
|
+
onChangeProp: "onSelectionChange",
|
|
2489
|
+
variableType: "boolean",
|
|
2490
|
+
hidden: (_ps, ctx) => !(ctx == null ? void 0 : ctx.isStandalone)
|
|
1619
2491
|
}
|
|
1620
2492
|
},
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
2493
|
+
trapsFocus: true
|
|
2494
|
+
},
|
|
2495
|
+
overrides
|
|
2496
|
+
);
|
|
2497
|
+
}
|
|
2498
|
+
|
|
2499
|
+
var __defProp$8 = Object.defineProperty;
|
|
2500
|
+
var __defProps$4 = Object.defineProperties;
|
|
2501
|
+
var __getOwnPropDescs$4 = Object.getOwnPropertyDescriptors;
|
|
2502
|
+
var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
|
|
2503
|
+
var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
|
|
2504
|
+
var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
|
|
2505
|
+
var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$8(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
2506
|
+
var __spreadValues$8 = (a, b) => {
|
|
2507
|
+
for (var prop in b || (b = {}))
|
|
2508
|
+
if (__hasOwnProp$8.call(b, prop))
|
|
2509
|
+
__defNormalProp$8(a, prop, b[prop]);
|
|
2510
|
+
if (__getOwnPropSymbols$8)
|
|
2511
|
+
for (var prop of __getOwnPropSymbols$8(b)) {
|
|
2512
|
+
if (__propIsEnum$8.call(b, prop))
|
|
2513
|
+
__defNormalProp$8(a, prop, b[prop]);
|
|
2514
|
+
}
|
|
2515
|
+
return a;
|
|
2516
|
+
};
|
|
2517
|
+
var __spreadProps$4 = (a, b) => __defProps$4(a, __getOwnPropDescs$4(b));
|
|
2518
|
+
function BaseRadioGroup(props) {
|
|
2519
|
+
return /* @__PURE__ */ React__default.default.createElement(PlasmicRadioGroupContext.Provider, { value: props }, /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.RadioGroup, __spreadValues$8({}, props)));
|
|
2520
|
+
}
|
|
2521
|
+
const RADIO_GROUP_COMPONENT_NAME = makeComponentName("radioGroup");
|
|
2522
|
+
function registerRadioGroup(loader, overrides) {
|
|
2523
|
+
const thisName = makeChildComponentName(
|
|
2524
|
+
overrides == null ? void 0 : overrides.parentComponentName,
|
|
2525
|
+
RADIO_GROUP_COMPONENT_NAME
|
|
2526
|
+
);
|
|
2527
|
+
registerFieldError(loader, { parentComponentName: thisName });
|
|
2528
|
+
const radioMeta = registerRadio(loader, { parentComponentName: thisName });
|
|
2529
|
+
registerLabel(loader, { parentComponentName: thisName });
|
|
2530
|
+
registerComponentHelper(
|
|
2531
|
+
loader,
|
|
2532
|
+
BaseRadioGroup,
|
|
2533
|
+
{
|
|
2534
|
+
name: RADIO_GROUP_COMPONENT_NAME,
|
|
2535
|
+
displayName: "Aria RadioGroup",
|
|
2536
|
+
importPath: "@plasmicpkgs/react-aria/skinny/registerRadioGroup",
|
|
2537
|
+
importName: "BaseRadioGroup",
|
|
2538
|
+
props: __spreadProps$4(__spreadValues$8({}, getCommonInputProps("radio group", [
|
|
2539
|
+
"name",
|
|
2540
|
+
"isDisabled",
|
|
2541
|
+
"isReadOnly",
|
|
2542
|
+
"aria-label",
|
|
2543
|
+
"isRequired"
|
|
2544
|
+
])), {
|
|
1625
2545
|
children: {
|
|
1626
|
-
type: "slot"
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
2546
|
+
type: "slot",
|
|
2547
|
+
mergeWithParent: true,
|
|
2548
|
+
defaultValue: [
|
|
2549
|
+
{
|
|
2550
|
+
type: "vbox",
|
|
2551
|
+
styles: {
|
|
2552
|
+
display: "flex",
|
|
2553
|
+
gap: "5px",
|
|
2554
|
+
padding: 0,
|
|
2555
|
+
alignItems: "flex-start"
|
|
2556
|
+
},
|
|
2557
|
+
children: [
|
|
2558
|
+
{
|
|
2559
|
+
type: "component",
|
|
2560
|
+
name: LABEL_COMPONENT_NAME,
|
|
2561
|
+
props: {
|
|
2562
|
+
children: {
|
|
2563
|
+
type: "text",
|
|
2564
|
+
value: "Radio Group"
|
|
2565
|
+
}
|
|
2566
|
+
}
|
|
2567
|
+
},
|
|
2568
|
+
{
|
|
2569
|
+
type: "component",
|
|
2570
|
+
name: radioMeta.name,
|
|
2571
|
+
props: {
|
|
2572
|
+
children: makeDefaultRadioChildren("Radio 1"),
|
|
2573
|
+
value: "radio1"
|
|
2574
|
+
}
|
|
2575
|
+
},
|
|
2576
|
+
{
|
|
2577
|
+
type: "component",
|
|
2578
|
+
name: radioMeta.name,
|
|
2579
|
+
props: {
|
|
2580
|
+
children: makeDefaultRadioChildren("Radio 2"),
|
|
2581
|
+
value: "radio2"
|
|
2582
|
+
}
|
|
2583
|
+
},
|
|
2584
|
+
{
|
|
2585
|
+
type: "component",
|
|
2586
|
+
name: radioMeta.name,
|
|
2587
|
+
props: {
|
|
2588
|
+
children: makeDefaultRadioChildren("Radio 3"),
|
|
2589
|
+
value: "radio3"
|
|
2590
|
+
}
|
|
2591
|
+
},
|
|
2592
|
+
{
|
|
2593
|
+
type: "component",
|
|
2594
|
+
name: DESCRIPTION_COMPONENT_NAME,
|
|
2595
|
+
props: {
|
|
2596
|
+
children: {
|
|
2597
|
+
type: "text",
|
|
2598
|
+
value: "Add interaction variants to see it in action..."
|
|
2599
|
+
}
|
|
2600
|
+
}
|
|
2601
|
+
}
|
|
2602
|
+
]
|
|
2603
|
+
}
|
|
2604
|
+
]
|
|
1631
2605
|
},
|
|
1632
|
-
|
|
1633
|
-
type: "
|
|
2606
|
+
value: {
|
|
2607
|
+
type: "string",
|
|
1634
2608
|
editOnly: true,
|
|
1635
|
-
uncontrolledProp: "
|
|
1636
|
-
|
|
2609
|
+
uncontrolledProp: "defaultValue",
|
|
2610
|
+
description: "The current value"
|
|
1637
2611
|
},
|
|
1638
|
-
|
|
2612
|
+
isInvalid: {
|
|
2613
|
+
displayName: "Invalid",
|
|
1639
2614
|
type: "boolean",
|
|
1640
|
-
description: "Whether
|
|
2615
|
+
description: "Whether the input value is invalid",
|
|
2616
|
+
defaultValueHint: false
|
|
1641
2617
|
},
|
|
1642
|
-
|
|
1643
|
-
type: "
|
|
1644
|
-
|
|
2618
|
+
validationBehavior: {
|
|
2619
|
+
type: "choice",
|
|
2620
|
+
options: ["native", "aria"],
|
|
2621
|
+
description: "Whether to use native HTML form validation to prevent form submission when the value is missing or invalid, or mark the field as required or invalid via ARIA.",
|
|
2622
|
+
defaultValueHint: "native"
|
|
1645
2623
|
},
|
|
1646
|
-
|
|
2624
|
+
onChange: {
|
|
1647
2625
|
type: "eventHandler",
|
|
1648
|
-
argTypes: [{ name: "
|
|
2626
|
+
argTypes: [{ name: "value", type: "string" }]
|
|
1649
2627
|
}
|
|
1650
|
-
},
|
|
2628
|
+
}),
|
|
1651
2629
|
states: {
|
|
1652
|
-
|
|
2630
|
+
value: {
|
|
1653
2631
|
type: "writable",
|
|
1654
|
-
valueProp: "
|
|
1655
|
-
onChangeProp: "
|
|
1656
|
-
variableType: "
|
|
2632
|
+
valueProp: "value",
|
|
2633
|
+
onChangeProp: "onChange",
|
|
2634
|
+
variableType: "array"
|
|
1657
2635
|
}
|
|
1658
2636
|
},
|
|
1659
2637
|
trapsFocus: true
|
|
@@ -1662,281 +2640,396 @@ function registerModal(loader, overrides) {
|
|
|
1662
2640
|
);
|
|
1663
2641
|
}
|
|
1664
2642
|
|
|
1665
|
-
var __defProp$
|
|
1666
|
-
var __getOwnPropSymbols$
|
|
1667
|
-
var __hasOwnProp$
|
|
1668
|
-
var __propIsEnum$
|
|
1669
|
-
var __defNormalProp$
|
|
1670
|
-
var __spreadValues$
|
|
2643
|
+
var __defProp$7 = Object.defineProperty;
|
|
2644
|
+
var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
|
|
2645
|
+
var __hasOwnProp$7 = Object.prototype.hasOwnProperty;
|
|
2646
|
+
var __propIsEnum$7 = Object.prototype.propertyIsEnumerable;
|
|
2647
|
+
var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
2648
|
+
var __spreadValues$7 = (a, b) => {
|
|
1671
2649
|
for (var prop in b || (b = {}))
|
|
1672
|
-
if (__hasOwnProp$
|
|
1673
|
-
__defNormalProp$
|
|
1674
|
-
if (__getOwnPropSymbols$
|
|
1675
|
-
for (var prop of __getOwnPropSymbols$
|
|
1676
|
-
if (__propIsEnum$
|
|
1677
|
-
__defNormalProp$
|
|
2650
|
+
if (__hasOwnProp$7.call(b, prop))
|
|
2651
|
+
__defNormalProp$7(a, prop, b[prop]);
|
|
2652
|
+
if (__getOwnPropSymbols$7)
|
|
2653
|
+
for (var prop of __getOwnPropSymbols$7(b)) {
|
|
2654
|
+
if (__propIsEnum$7.call(b, prop))
|
|
2655
|
+
__defNormalProp$7(a, prop, b[prop]);
|
|
1678
2656
|
}
|
|
1679
2657
|
return a;
|
|
1680
2658
|
};
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
if (__hasOwnProp$8.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
1685
|
-
target[prop] = source[prop];
|
|
1686
|
-
if (source != null && __getOwnPropSymbols$8)
|
|
1687
|
-
for (var prop of __getOwnPropSymbols$8(source)) {
|
|
1688
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$8.call(source, prop))
|
|
1689
|
-
target[prop] = source[prop];
|
|
1690
|
-
}
|
|
1691
|
-
return target;
|
|
2659
|
+
const BaseSelectValue = (props) => {
|
|
2660
|
+
const { children, customize } = props;
|
|
2661
|
+
return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.SelectValue, null, ({ isPlaceholder, selectedText }) => /* @__PURE__ */ React__default.default.createElement(React__default.default.Fragment, null, isPlaceholder ? /* @__PURE__ */ React__default.default.createElement("span", null, "Select an item") : /* @__PURE__ */ React__default.default.createElement(React__default.default.Fragment, null, /* @__PURE__ */ React__default.default.createElement("span", null, customize ? children : selectedText))));
|
|
1692
2662
|
};
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
const
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
2663
|
+
const SELECT_NAME = makeComponentName("select");
|
|
2664
|
+
function BaseSelect(props) {
|
|
2665
|
+
const {
|
|
2666
|
+
value,
|
|
2667
|
+
onChange,
|
|
2668
|
+
placeholder,
|
|
2669
|
+
previewOpen,
|
|
2670
|
+
onOpenChange,
|
|
2671
|
+
isDisabled,
|
|
2672
|
+
className,
|
|
2673
|
+
style,
|
|
2674
|
+
structure,
|
|
2675
|
+
name,
|
|
2676
|
+
"aria-label": ariaLabel
|
|
2677
|
+
} = props;
|
|
2678
|
+
const { options } = useStrictOptions(props);
|
|
2679
|
+
const canvas = host.usePlasmicCanvasContext();
|
|
2680
|
+
const disabledKeys = flattenOptions(options).filter((op) => op.isDisabled).map((op) => op.id);
|
|
2681
|
+
return /* @__PURE__ */ React__default.default.createElement(
|
|
2682
|
+
reactAriaComponents.Select,
|
|
2683
|
+
__spreadValues$7(__spreadValues$7({
|
|
2684
|
+
placeholder,
|
|
2685
|
+
selectedKey: value,
|
|
2686
|
+
onSelectionChange: onChange,
|
|
2687
|
+
onOpenChange,
|
|
2688
|
+
isDisabled,
|
|
2689
|
+
className,
|
|
2690
|
+
style,
|
|
2691
|
+
name,
|
|
2692
|
+
"aria-label": ariaLabel
|
|
2693
|
+
}, previewOpen && canvas ? { isOpen: previewOpen } : void 0), extractPlasmicDataProps(props)),
|
|
2694
|
+
/* @__PURE__ */ React__default.default.createElement(
|
|
2695
|
+
PlasmicListBoxContext.Provider,
|
|
2696
|
+
{
|
|
2697
|
+
value: {
|
|
2698
|
+
items: options,
|
|
2699
|
+
disabledKeys
|
|
2700
|
+
}
|
|
2701
|
+
},
|
|
2702
|
+
structure
|
|
2703
|
+
)
|
|
2704
|
+
);
|
|
2705
|
+
}
|
|
2706
|
+
function registerSelect(loader) {
|
|
2707
|
+
const selectValueMeta = registerComponentHelper(loader, BaseSelectValue, {
|
|
2708
|
+
name: makeComponentName("select-value"),
|
|
2709
|
+
displayName: "Aria Selected Value",
|
|
2710
|
+
importPath: "@plasmicpkgs/react-aria/registerSelect",
|
|
2711
|
+
importName: "SelectValue",
|
|
2712
|
+
parentComponentName: SELECT_NAME,
|
|
2713
|
+
props: {
|
|
2714
|
+
customize: {
|
|
2715
|
+
type: "boolean",
|
|
2716
|
+
advanced: true,
|
|
2717
|
+
description: "Whether to customize the selected value display"
|
|
2718
|
+
},
|
|
2719
|
+
children: {
|
|
2720
|
+
type: "slot",
|
|
2721
|
+
defaultValue: [
|
|
2722
|
+
{
|
|
2723
|
+
type: "text",
|
|
2724
|
+
value: "Selected value..."
|
|
2725
|
+
}
|
|
2726
|
+
]
|
|
2727
|
+
},
|
|
2728
|
+
className: {
|
|
2729
|
+
type: "class",
|
|
2730
|
+
selectors: [
|
|
2731
|
+
{
|
|
2732
|
+
selector: ":self[data-placeholder]",
|
|
2733
|
+
label: "Placeholder"
|
|
2734
|
+
}
|
|
2735
|
+
]
|
|
2736
|
+
}
|
|
2737
|
+
}
|
|
2738
|
+
});
|
|
2739
|
+
registerComponentHelper(loader, BaseSelect, {
|
|
2740
|
+
name: SELECT_NAME,
|
|
2741
|
+
displayName: "Aria Select",
|
|
2742
|
+
importPath: "@plasmicpkgs/react-aria/skinny/registerSelect",
|
|
2743
|
+
importName: "BaseSelect",
|
|
2744
|
+
props: {
|
|
2745
|
+
options: makeOptionsPropType(),
|
|
2746
|
+
placeholder: {
|
|
2747
|
+
type: "string"
|
|
2748
|
+
},
|
|
2749
|
+
isDisabled: {
|
|
2750
|
+
type: "boolean"
|
|
2751
|
+
},
|
|
2752
|
+
value: makeValuePropType(),
|
|
2753
|
+
onChange: {
|
|
2754
|
+
type: "eventHandler",
|
|
2755
|
+
argTypes: [{ name: "value", type: "string" }]
|
|
2756
|
+
},
|
|
2757
|
+
previewOpen: {
|
|
2758
|
+
type: "boolean",
|
|
2759
|
+
displayName: "Preview opened?",
|
|
2760
|
+
description: "Preview opened state while designing in Plasmic editor",
|
|
2761
|
+
editOnly: true
|
|
2762
|
+
},
|
|
2763
|
+
onOpenChange: {
|
|
2764
|
+
type: "eventHandler",
|
|
2765
|
+
argTypes: [{ name: "isOpen", type: "boolean" }]
|
|
2766
|
+
},
|
|
2767
|
+
// optionValue: {
|
|
2768
|
+
// type: "string",
|
|
2769
|
+
// displayName: "Field key for an option's value",
|
|
2770
|
+
// hidden: (ps) =>
|
|
2771
|
+
// !ps.options ||
|
|
2772
|
+
// !ps.options[0] ||
|
|
2773
|
+
// typeof ps.options[0] === "string" ||
|
|
2774
|
+
// "value" in ps.options[0],
|
|
2775
|
+
// exprHint:
|
|
2776
|
+
// "Return a function that takes in an option object, and returns the key to use",
|
|
2777
|
+
// },
|
|
2778
|
+
// optionText: {
|
|
2779
|
+
// type: "string",
|
|
2780
|
+
// displayName: "Field key for an option's text value",
|
|
2781
|
+
// hidden: (ps) =>
|
|
2782
|
+
// !ps.options ||
|
|
2783
|
+
// !ps.options[0] ||
|
|
2784
|
+
// typeof ps.options[0] === "string" ||
|
|
2785
|
+
// "value" in ps.options[0],
|
|
2786
|
+
// exprHint:
|
|
2787
|
+
// "Return a function that takes in an option object, and returns the text value to use",
|
|
2788
|
+
// },
|
|
2789
|
+
// optionDisabled: {
|
|
2790
|
+
// type: "string",
|
|
2791
|
+
// displayName: "Field key for whether an option is disabled",
|
|
2792
|
+
// hidden: (ps) =>
|
|
2793
|
+
// !ps.options ||
|
|
2794
|
+
// !ps.options[0] ||
|
|
2795
|
+
// typeof ps.options[0] === "string" ||
|
|
2796
|
+
// "value" in ps.options[0],
|
|
2797
|
+
// exprHint:
|
|
2798
|
+
// "Return a function that takes in an option object, and returns true if option should be disabled",
|
|
2799
|
+
// },
|
|
2800
|
+
structure: {
|
|
2801
|
+
type: "slot",
|
|
2802
|
+
defaultValue: [
|
|
2803
|
+
{
|
|
2804
|
+
type: "vbox",
|
|
2805
|
+
styles: {
|
|
2806
|
+
justifyContent: "flex-start",
|
|
2807
|
+
alignItems: "flex-start",
|
|
2808
|
+
width: "300px",
|
|
2809
|
+
padding: 0
|
|
2810
|
+
},
|
|
2811
|
+
children: [
|
|
2812
|
+
{
|
|
2813
|
+
type: "component",
|
|
2814
|
+
name: LABEL_COMPONENT_NAME,
|
|
2815
|
+
props: {
|
|
2816
|
+
children: {
|
|
2817
|
+
type: "text",
|
|
2818
|
+
value: "Label"
|
|
2819
|
+
}
|
|
2820
|
+
}
|
|
2821
|
+
},
|
|
2822
|
+
{
|
|
2823
|
+
type: "component",
|
|
2824
|
+
name: BUTTON_COMPONENT_NAME,
|
|
2825
|
+
styles: {
|
|
2826
|
+
width: "100%"
|
|
2827
|
+
},
|
|
2828
|
+
props: {
|
|
2829
|
+
children: {
|
|
2830
|
+
type: "hbox",
|
|
2831
|
+
styles: {
|
|
2832
|
+
width: "stretch",
|
|
2833
|
+
justifyContent: "space-between",
|
|
2834
|
+
alignItems: "center",
|
|
2835
|
+
padding: "2px 5px"
|
|
2836
|
+
},
|
|
2837
|
+
children: [
|
|
2838
|
+
{
|
|
2839
|
+
type: "component",
|
|
2840
|
+
name: selectValueMeta.name
|
|
2841
|
+
},
|
|
2842
|
+
{
|
|
2843
|
+
type: "img",
|
|
2844
|
+
src: "https://static1.plasmic.app/arrow-up.svg",
|
|
2845
|
+
styles: {
|
|
2846
|
+
height: "20px",
|
|
2847
|
+
width: "20px",
|
|
2848
|
+
transform: "rotate(180deg)"
|
|
2849
|
+
}
|
|
2850
|
+
}
|
|
2851
|
+
]
|
|
2852
|
+
}
|
|
2853
|
+
}
|
|
2854
|
+
},
|
|
2855
|
+
{
|
|
2856
|
+
type: "component",
|
|
2857
|
+
name: POPOVER_COMPONENT_NAME,
|
|
2858
|
+
styles: {
|
|
2859
|
+
backgroundColor: "white",
|
|
2860
|
+
padding: "10px",
|
|
2861
|
+
overflow: "scroll"
|
|
2862
|
+
},
|
|
2863
|
+
props: {
|
|
2864
|
+
children: [
|
|
2865
|
+
{
|
|
2866
|
+
type: "component",
|
|
2867
|
+
name: LIST_BOX_COMPONENT_NAME,
|
|
2868
|
+
styles: {
|
|
2869
|
+
borderWidth: 0,
|
|
2870
|
+
width: "stretch"
|
|
2871
|
+
}
|
|
2872
|
+
}
|
|
2873
|
+
]
|
|
2874
|
+
}
|
|
2875
|
+
}
|
|
2876
|
+
]
|
|
2877
|
+
}
|
|
2878
|
+
]
|
|
2879
|
+
},
|
|
2880
|
+
// renderOption: {
|
|
2881
|
+
// type: "slot",
|
|
2882
|
+
// displayName: "Custom render option",
|
|
2883
|
+
// renderPropParams: ["item"],
|
|
2884
|
+
// hidePlaceholder: true
|
|
2885
|
+
// },
|
|
2886
|
+
name: {
|
|
2887
|
+
type: "string",
|
|
2888
|
+
displayName: "Form field key",
|
|
2889
|
+
description: "Name of the input, when submitting in an HTML form",
|
|
2890
|
+
advanced: true
|
|
2891
|
+
},
|
|
2892
|
+
"aria-label": {
|
|
2893
|
+
type: "string",
|
|
2894
|
+
displayName: "Aria Label",
|
|
2895
|
+
description: "Label for this input, if no visible label is used",
|
|
2896
|
+
advanced: true
|
|
2897
|
+
}
|
|
2898
|
+
},
|
|
2899
|
+
states: {
|
|
2900
|
+
value: {
|
|
2901
|
+
type: "writable",
|
|
2902
|
+
valueProp: "value",
|
|
2903
|
+
onChangeProp: "onChange",
|
|
2904
|
+
variableType: "text"
|
|
2905
|
+
},
|
|
2906
|
+
isOpen: {
|
|
2907
|
+
type: "readonly",
|
|
2908
|
+
onChangeProp: "onOpenChange",
|
|
2909
|
+
variableType: "boolean"
|
|
2910
|
+
}
|
|
2911
|
+
}
|
|
1699
2912
|
});
|
|
1700
|
-
const triggerRef = React__default.default.useRef(null);
|
|
1701
|
-
const standaloneProps = isStandalone ? {
|
|
1702
|
-
triggerRef,
|
|
1703
|
-
isNonModal: true,
|
|
1704
|
-
isOpen: true
|
|
1705
|
-
} : {};
|
|
1706
|
-
return /* @__PURE__ */ React__default.default.createElement(React__default.default.Fragment, null, isStandalone && /* @__PURE__ */ React__default.default.createElement("div", { ref: triggerRef }), /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Popover, __spreadValues$8(__spreadValues$8({}, mergedProps), standaloneProps)));
|
|
1707
2913
|
}
|
|
1708
|
-
|
|
2914
|
+
|
|
2915
|
+
const BaseSliderOutput = reactAriaComponents.SliderOutput;
|
|
2916
|
+
const SLIDER_OUTPUT_COMPONENT_NAME = makeComponentName("sliderOutput");
|
|
2917
|
+
function registerSliderOutput(loader, overrides) {
|
|
1709
2918
|
registerComponentHelper(
|
|
1710
2919
|
loader,
|
|
1711
|
-
|
|
2920
|
+
BaseSliderOutput,
|
|
1712
2921
|
{
|
|
1713
|
-
name:
|
|
1714
|
-
displayName: "Aria
|
|
1715
|
-
importPath: "@plasmicpkgs/react-aria/skinny/
|
|
1716
|
-
importName: "
|
|
2922
|
+
name: SLIDER_OUTPUT_COMPONENT_NAME,
|
|
2923
|
+
displayName: "Aria Slider Output",
|
|
2924
|
+
importPath: "@plasmicpkgs/react-aria/skinny/registerSliderOutput",
|
|
2925
|
+
importName: "BaseSliderOutput",
|
|
1717
2926
|
props: {
|
|
1718
|
-
children: {
|
|
1719
|
-
type: "slot"
|
|
1720
|
-
},
|
|
1721
|
-
offset: {
|
|
1722
|
-
type: "number",
|
|
1723
|
-
displayName: "Offset",
|
|
1724
|
-
description: "Additional offset applied vertically between the popover and its trigger",
|
|
1725
|
-
defaultValueHint: 0
|
|
1726
|
-
},
|
|
1727
|
-
placement: {
|
|
1728
|
-
type: "choice",
|
|
1729
|
-
description: "Default placement of the popover relative to the trigger, if there is enough space",
|
|
1730
|
-
options: [
|
|
1731
|
-
"bottom",
|
|
1732
|
-
"bottom left",
|
|
1733
|
-
"bottom right",
|
|
1734
|
-
"top",
|
|
1735
|
-
"top left",
|
|
1736
|
-
"top right"
|
|
1737
|
-
]
|
|
1738
|
-
},
|
|
1739
|
-
resetClassName: {
|
|
1740
|
-
type: "themeResetClass"
|
|
1741
|
-
}
|
|
2927
|
+
children: { type: "slot" }
|
|
1742
2928
|
},
|
|
1743
|
-
|
|
2929
|
+
trapsFocus: true
|
|
1744
2930
|
},
|
|
1745
2931
|
overrides
|
|
1746
2932
|
);
|
|
1747
2933
|
}
|
|
1748
2934
|
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
return { hasError: true };
|
|
1756
|
-
}
|
|
1757
|
-
render() {
|
|
1758
|
-
if (this.state.hasError) {
|
|
1759
|
-
return this.props.fallback;
|
|
1760
|
-
}
|
|
1761
|
-
return this.props.children;
|
|
1762
|
-
}
|
|
1763
|
-
}
|
|
1764
|
-
|
|
1765
|
-
var __defProp$7 = Object.defineProperty;
|
|
1766
|
-
var __defProps$4 = Object.defineProperties;
|
|
1767
|
-
var __getOwnPropDescs$4 = Object.getOwnPropertyDescriptors;
|
|
1768
|
-
var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
|
|
1769
|
-
var __hasOwnProp$7 = Object.prototype.hasOwnProperty;
|
|
1770
|
-
var __propIsEnum$7 = Object.prototype.propertyIsEnumerable;
|
|
1771
|
-
var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1772
|
-
var __spreadValues$7 = (a, b) => {
|
|
2935
|
+
var __defProp$6 = Object.defineProperty;
|
|
2936
|
+
var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
|
|
2937
|
+
var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
|
|
2938
|
+
var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
|
|
2939
|
+
var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
2940
|
+
var __spreadValues$6 = (a, b) => {
|
|
1773
2941
|
for (var prop in b || (b = {}))
|
|
1774
|
-
if (__hasOwnProp$
|
|
1775
|
-
__defNormalProp$
|
|
1776
|
-
if (__getOwnPropSymbols$
|
|
1777
|
-
for (var prop of __getOwnPropSymbols$
|
|
1778
|
-
if (__propIsEnum$
|
|
1779
|
-
__defNormalProp$
|
|
2942
|
+
if (__hasOwnProp$6.call(b, prop))
|
|
2943
|
+
__defNormalProp$6(a, prop, b[prop]);
|
|
2944
|
+
if (__getOwnPropSymbols$6)
|
|
2945
|
+
for (var prop of __getOwnPropSymbols$6(b)) {
|
|
2946
|
+
if (__propIsEnum$6.call(b, prop))
|
|
2947
|
+
__defNormalProp$6(a, prop, b[prop]);
|
|
1780
2948
|
}
|
|
1781
2949
|
return a;
|
|
1782
2950
|
};
|
|
1783
|
-
var
|
|
1784
|
-
var __objRest$4 = (source, exclude) => {
|
|
2951
|
+
var __objRest$6 = (source, exclude) => {
|
|
1785
2952
|
var target = {};
|
|
1786
2953
|
for (var prop in source)
|
|
1787
|
-
if (__hasOwnProp$
|
|
2954
|
+
if (__hasOwnProp$6.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
1788
2955
|
target[prop] = source[prop];
|
|
1789
|
-
if (source != null && __getOwnPropSymbols$
|
|
1790
|
-
for (var prop of __getOwnPropSymbols$
|
|
1791
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
2956
|
+
if (source != null && __getOwnPropSymbols$6)
|
|
2957
|
+
for (var prop of __getOwnPropSymbols$6(source)) {
|
|
2958
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$6.call(source, prop))
|
|
1792
2959
|
target[prop] = source[prop];
|
|
1793
2960
|
}
|
|
1794
2961
|
return target;
|
|
1795
2962
|
};
|
|
1796
|
-
const
|
|
2963
|
+
const SLIDER_THUMB_INTERACTION_VARIANTS = [
|
|
2964
|
+
"dragging",
|
|
1797
2965
|
"hovered",
|
|
1798
|
-
"pressed",
|
|
1799
2966
|
"focused",
|
|
1800
2967
|
"focusVisible"
|
|
1801
2968
|
];
|
|
1802
|
-
const { interactionVariants: interactionVariants$
|
|
1803
|
-
|
|
2969
|
+
const { interactionVariants: interactionVariants$3, withObservedValues: withObservedValues$2 } = pickAriaComponentVariants(
|
|
2970
|
+
SLIDER_THUMB_INTERACTION_VARIANTS
|
|
1804
2971
|
);
|
|
1805
|
-
function
|
|
1806
|
-
|
|
1807
|
-
const radio = /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Radio, __spreadValues$7({}, rest), ({ isHovered, isPressed, isFocused, isFocusVisible }) => withObservedValues$1(
|
|
2972
|
+
function BaseSliderThumb(_a) {
|
|
2973
|
+
var _b = _a, {
|
|
1808
2974
|
children,
|
|
2975
|
+
advanced,
|
|
2976
|
+
updateInteractionVariant
|
|
2977
|
+
} = _b, rest = __objRest$6(_b, [
|
|
2978
|
+
"children",
|
|
2979
|
+
"advanced",
|
|
2980
|
+
"updateInteractionVariant"
|
|
2981
|
+
]);
|
|
2982
|
+
const context = React__default.default.useContext(PlasmicSliderContext);
|
|
2983
|
+
const mergedProps = reactAria.mergeProps(context, rest);
|
|
2984
|
+
const thumb = /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.SliderThumb, __spreadValues$6({}, mergedProps), ({ isDragging, isHovered, isFocused, isFocusVisible }) => withObservedValues$2(
|
|
2985
|
+
/* @__PURE__ */ React__default.default.createElement(React__default.default.Fragment, null, advanced ? children : void 0),
|
|
1809
2986
|
{
|
|
2987
|
+
dragging: isDragging,
|
|
1810
2988
|
hovered: isHovered,
|
|
1811
|
-
pressed: isPressed,
|
|
1812
2989
|
focused: isFocused,
|
|
1813
2990
|
focusVisible: isFocusVisible
|
|
1814
2991
|
},
|
|
1815
2992
|
updateInteractionVariant
|
|
1816
2993
|
));
|
|
1817
|
-
return /* @__PURE__ */ React__default.default.createElement(
|
|
1818
|
-
|
|
1819
|
-
function registerRadio(loader, overrides) {
|
|
1820
|
-
registerComponentHelper(
|
|
1821
|
-
loader,
|
|
1822
|
-
BaseRadio,
|
|
2994
|
+
return /* @__PURE__ */ React__default.default.createElement(
|
|
2995
|
+
ErrorBoundary,
|
|
1823
2996
|
{
|
|
1824
|
-
|
|
1825
|
-
displayName: "Aria Radio",
|
|
1826
|
-
importPath: "@plasmicpkgs/react-aria/skinny/registerRadio",
|
|
1827
|
-
importName: "BaseRadio",
|
|
1828
|
-
interactionVariants: interactionVariants$2,
|
|
1829
|
-
props: __spreadProps$4(__spreadValues$7({}, getCommonInputProps("radio", [
|
|
1830
|
-
"isDisabled",
|
|
1831
|
-
"autoFocus",
|
|
1832
|
-
"aria-label",
|
|
1833
|
-
"children"
|
|
1834
|
-
])), {
|
|
1835
|
-
value: {
|
|
1836
|
-
type: "string",
|
|
1837
|
-
description: "The value of the input element, used when submitting an HTML form."
|
|
1838
|
-
},
|
|
1839
|
-
onSelectionChange: {
|
|
1840
|
-
type: "eventHandler",
|
|
1841
|
-
argTypes: [{ name: "isSelected", type: "boolean" }]
|
|
1842
|
-
}
|
|
1843
|
-
}),
|
|
1844
|
-
states: {
|
|
1845
|
-
isSelected: {
|
|
1846
|
-
type: "readonly",
|
|
1847
|
-
onChangeProp: "onSelectionChange",
|
|
1848
|
-
variableType: "boolean"
|
|
1849
|
-
}
|
|
1850
|
-
},
|
|
1851
|
-
trapsFocus: true
|
|
2997
|
+
fallback: /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Slider, { style: { height: "100%", width: "100%" } }, /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.SliderTrack, null, thumb))
|
|
1852
2998
|
},
|
|
1853
|
-
|
|
2999
|
+
thumb
|
|
1854
3000
|
);
|
|
1855
3001
|
}
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
var __defProps$3 = Object.defineProperties;
|
|
1859
|
-
var __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors;
|
|
1860
|
-
var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
|
|
1861
|
-
var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
|
|
1862
|
-
var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
|
|
1863
|
-
var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1864
|
-
var __spreadValues$6 = (a, b) => {
|
|
1865
|
-
for (var prop in b || (b = {}))
|
|
1866
|
-
if (__hasOwnProp$6.call(b, prop))
|
|
1867
|
-
__defNormalProp$6(a, prop, b[prop]);
|
|
1868
|
-
if (__getOwnPropSymbols$6)
|
|
1869
|
-
for (var prop of __getOwnPropSymbols$6(b)) {
|
|
1870
|
-
if (__propIsEnum$6.call(b, prop))
|
|
1871
|
-
__defNormalProp$6(a, prop, b[prop]);
|
|
1872
|
-
}
|
|
1873
|
-
return a;
|
|
1874
|
-
};
|
|
1875
|
-
var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b));
|
|
1876
|
-
const BaseRadioGroup = reactAriaComponents.RadioGroup;
|
|
1877
|
-
const componentName$1 = makeComponentName("radioGroup");
|
|
1878
|
-
function registerRadioGroup(loader, overrides) {
|
|
3002
|
+
const SLIDER_THUMB_COMPONENT_NAME = makeComponentName("sliderThumb");
|
|
3003
|
+
function registerSliderThumb(loader, overrides) {
|
|
1879
3004
|
registerComponentHelper(
|
|
1880
3005
|
loader,
|
|
1881
|
-
|
|
3006
|
+
BaseSliderThumb,
|
|
1882
3007
|
{
|
|
1883
|
-
name:
|
|
1884
|
-
displayName: "Aria
|
|
1885
|
-
importPath: "@plasmicpkgs/react-aria/skinny/
|
|
1886
|
-
importName: "
|
|
1887
|
-
|
|
1888
|
-
"
|
|
1889
|
-
"
|
|
1890
|
-
"
|
|
1891
|
-
"
|
|
1892
|
-
"
|
|
1893
|
-
"
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
displayName: "Invalid",
|
|
1903
|
-
type: "boolean",
|
|
1904
|
-
description: "Whether the input value is invalid",
|
|
1905
|
-
defaultValueHint: false
|
|
1906
|
-
},
|
|
1907
|
-
validationBehavior: {
|
|
1908
|
-
type: "choice",
|
|
1909
|
-
options: ["native", "aria"],
|
|
1910
|
-
description: "Whether to use native HTML form validation to prevent form submission when the value is missing or invalid, or mark the field as required or invalid via ARIA.",
|
|
1911
|
-
defaultValueHint: "native"
|
|
1912
|
-
},
|
|
1913
|
-
onChange: {
|
|
1914
|
-
type: "eventHandler",
|
|
1915
|
-
argTypes: [{ name: "value", type: "string" }]
|
|
1916
|
-
}
|
|
1917
|
-
}),
|
|
1918
|
-
states: {
|
|
1919
|
-
value: {
|
|
1920
|
-
type: "writable",
|
|
1921
|
-
valueProp: "value",
|
|
1922
|
-
onChangeProp: "onChange",
|
|
1923
|
-
variableType: "array"
|
|
3008
|
+
name: SLIDER_THUMB_COMPONENT_NAME,
|
|
3009
|
+
displayName: "Aria Slider Thumb",
|
|
3010
|
+
importPath: "@plasmicpkgs/react-aria/skinny/registerSliderThumb",
|
|
3011
|
+
importName: "BaseSliderThumb",
|
|
3012
|
+
defaultStyles: {
|
|
3013
|
+
position: "absolute",
|
|
3014
|
+
top: "5px",
|
|
3015
|
+
width: "20px",
|
|
3016
|
+
height: "20px",
|
|
3017
|
+
backgroundColor: "#C80101",
|
|
3018
|
+
borderRadius: "100%",
|
|
3019
|
+
cursor: "pointer"
|
|
3020
|
+
},
|
|
3021
|
+
interactionVariants: interactionVariants$3,
|
|
3022
|
+
props: {
|
|
3023
|
+
advanced: "boolean",
|
|
3024
|
+
children: {
|
|
3025
|
+
type: "slot",
|
|
3026
|
+
hidden: (ps) => !ps.advanced
|
|
1924
3027
|
}
|
|
1925
3028
|
},
|
|
1926
3029
|
trapsFocus: true
|
|
1927
3030
|
},
|
|
1928
3031
|
overrides
|
|
1929
3032
|
);
|
|
1930
|
-
const thisName = makeChildComponentName(
|
|
1931
|
-
overrides == null ? void 0 : overrides.parentComponentName,
|
|
1932
|
-
componentName$1
|
|
1933
|
-
);
|
|
1934
|
-
registerFieldError(loader, { parentComponentName: thisName });
|
|
1935
|
-
registerRadio(loader, { parentComponentName: thisName });
|
|
1936
|
-
registerLabel(loader, { parentComponentName: thisName });
|
|
1937
|
-
registerDescription(loader, {
|
|
1938
|
-
parentComponentName: thisName
|
|
1939
|
-
});
|
|
1940
3033
|
}
|
|
1941
3034
|
|
|
1942
3035
|
var __defProp$5 = Object.defineProperty;
|
|
@@ -1955,62 +3048,163 @@ var __spreadValues$5 = (a, b) => {
|
|
|
1955
3048
|
}
|
|
1956
3049
|
return a;
|
|
1957
3050
|
};
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
3051
|
+
var __objRest$5 = (source, exclude) => {
|
|
3052
|
+
var target = {};
|
|
3053
|
+
for (var prop in source)
|
|
3054
|
+
if (__hasOwnProp$5.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
3055
|
+
target[prop] = source[prop];
|
|
3056
|
+
if (source != null && __getOwnPropSymbols$5)
|
|
3057
|
+
for (var prop of __getOwnPropSymbols$5(source)) {
|
|
3058
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$5.call(source, prop))
|
|
3059
|
+
target[prop] = source[prop];
|
|
3060
|
+
}
|
|
3061
|
+
return target;
|
|
3062
|
+
};
|
|
3063
|
+
const SLIDER_TRACK_INTERACTION_VARIANTS = ["hovered"];
|
|
3064
|
+
const { interactionVariants: interactionVariants$2, withObservedValues: withObservedValues$1 } = pickAriaComponentVariants(
|
|
3065
|
+
SLIDER_TRACK_INTERACTION_VARIANTS
|
|
3066
|
+
);
|
|
3067
|
+
function findMinMaxIndices(values) {
|
|
3068
|
+
if (typeof values === "number" || (values == null ? void 0 : values.length) === 0 || !Array.isArray(values)) {
|
|
3069
|
+
return { minIndex: 0, maxIndex: 0 };
|
|
3070
|
+
}
|
|
3071
|
+
let minIndex = 0;
|
|
3072
|
+
let maxIndex = 0;
|
|
3073
|
+
for (let i = 1; i < values.length; i++) {
|
|
3074
|
+
if (values[i] < values[minIndex]) {
|
|
3075
|
+
minIndex = i;
|
|
3076
|
+
}
|
|
3077
|
+
if (values[i] > values[maxIndex]) {
|
|
3078
|
+
maxIndex = i;
|
|
3079
|
+
}
|
|
3080
|
+
}
|
|
3081
|
+
return { minIndex, maxIndex };
|
|
1961
3082
|
}
|
|
1962
|
-
function
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
3083
|
+
function BaseSliderTrack(props) {
|
|
3084
|
+
const context = React__default.default.useContext(PlasmicSliderContext);
|
|
3085
|
+
const mergedProps = reactAria.mergeProps(context, props);
|
|
3086
|
+
const _a = mergedProps, {
|
|
3087
|
+
children,
|
|
3088
|
+
progressBar,
|
|
3089
|
+
updateInteractionVariant,
|
|
3090
|
+
isMultiValue
|
|
3091
|
+
} = _a, rest = __objRest$5(_a, [
|
|
3092
|
+
"children",
|
|
3093
|
+
"progressBar",
|
|
3094
|
+
"updateInteractionVariant",
|
|
3095
|
+
"isMultiValue"
|
|
3096
|
+
]);
|
|
3097
|
+
const { minIndex, maxIndex } = React.useMemo(
|
|
3098
|
+
() => findMinMaxIndices(mergedProps.value),
|
|
3099
|
+
[mergedProps.value]
|
|
3100
|
+
);
|
|
3101
|
+
const thumbs = React.useMemo(() => {
|
|
3102
|
+
const rawThumbs = flattenChildren__default.default(children);
|
|
3103
|
+
if (mergedProps.value === void 0) {
|
|
3104
|
+
return [];
|
|
3105
|
+
}
|
|
3106
|
+
if (!Array.isArray(mergedProps == null ? void 0 : mergedProps.value)) {
|
|
3107
|
+
return rawThumbs;
|
|
3108
|
+
}
|
|
3109
|
+
const difference = mergedProps.value.length - rawThumbs.length;
|
|
3110
|
+
if (!difference) {
|
|
3111
|
+
return rawThumbs;
|
|
3112
|
+
}
|
|
3113
|
+
if (difference < 0) {
|
|
3114
|
+
return rawThumbs.slice(0, mergedProps.value.length);
|
|
3115
|
+
}
|
|
3116
|
+
const lastThumb = rawThumbs[rawThumbs.length - 1];
|
|
3117
|
+
return rawThumbs.concat(new Array(difference).fill(lastThumb));
|
|
3118
|
+
}, [children, mergedProps.value]);
|
|
3119
|
+
const track = /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.SliderTrack, __spreadValues$5({ style: { position: "relative" } }, rest), ({ state, isHovered }) => /* @__PURE__ */ React__default.default.createElement(React__default.default.Fragment, null, withObservedValues$1(
|
|
3120
|
+
/* @__PURE__ */ React__default.default.createElement(React__default.default.Fragment, null, /* @__PURE__ */ React__default.default.createElement(
|
|
3121
|
+
"div",
|
|
3122
|
+
{
|
|
3123
|
+
style: {
|
|
3124
|
+
width: `${(!isMultiValue ? state.getThumbPercent(minIndex) : state.getThumbPercent(maxIndex) - state.getThumbPercent(minIndex)) * 100}%`,
|
|
3125
|
+
height: "100%",
|
|
3126
|
+
position: "absolute",
|
|
3127
|
+
top: 0,
|
|
3128
|
+
left: !isMultiValue ? 0 : state.getThumbPercent(minIndex) * 100 + "%"
|
|
3129
|
+
}
|
|
3130
|
+
},
|
|
3131
|
+
progressBar
|
|
3132
|
+
), thumbs.map(
|
|
3133
|
+
(thumb, i) => React__default.default.isValidElement(thumb) && React__default.default.cloneElement(thumb, {
|
|
3134
|
+
// sets the index of the thumb, so that each thumb reflects the correct value
|
|
3135
|
+
index: i
|
|
3136
|
+
})
|
|
3137
|
+
)),
|
|
1966
3138
|
{
|
|
1967
|
-
|
|
1968
|
-
displayName: "Aria Header",
|
|
1969
|
-
importPath: "@plasmicpkgs/react-aria/skinny/registerHeader",
|
|
1970
|
-
importName: "BaseHeader",
|
|
1971
|
-
props: {}
|
|
3139
|
+
hovered: isHovered
|
|
1972
3140
|
},
|
|
1973
|
-
|
|
3141
|
+
updateInteractionVariant
|
|
3142
|
+
)));
|
|
3143
|
+
return /* @__PURE__ */ React__default.default.createElement(
|
|
3144
|
+
ErrorBoundary,
|
|
3145
|
+
{
|
|
3146
|
+
fallback: /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Slider, { style: { height: "100%", width: "100%" } }, track)
|
|
3147
|
+
},
|
|
3148
|
+
track
|
|
1974
3149
|
);
|
|
1975
3150
|
}
|
|
1976
|
-
|
|
1977
|
-
function
|
|
1978
|
-
const contextProps = React__default.default.useContext(PlasmicSectionContext);
|
|
1979
|
-
const mergedProps = utils.mergeProps(contextProps, props);
|
|
1980
|
-
const { section, renderHeader, key, renderItem } = mergedProps;
|
|
1981
|
-
return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Section, { id: key }, /* @__PURE__ */ React__default.default.createElement(PlasmicHeaderContext.Provider, { value: { children: section == null ? void 0 : section.label } }, renderHeader == null ? void 0 : renderHeader(section)), /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Collection, { items: section == null ? void 0 : section.items }, (item) => {
|
|
1982
|
-
return /* @__PURE__ */ React__default.default.createElement(PlasmicItemContext.Provider, { value: item }, renderItem == null ? void 0 : renderItem(item));
|
|
1983
|
-
}));
|
|
1984
|
-
}
|
|
1985
|
-
function registerSection(loader, overrides) {
|
|
3151
|
+
const SLIDER_TRACK_COMPONENT_NAME = makeComponentName("sliderTrack");
|
|
3152
|
+
function registerSliderTrack(loader, overrides) {
|
|
1986
3153
|
registerComponentHelper(
|
|
1987
3154
|
loader,
|
|
1988
|
-
|
|
3155
|
+
BaseSliderTrack,
|
|
1989
3156
|
{
|
|
1990
|
-
name:
|
|
1991
|
-
displayName: "Aria
|
|
1992
|
-
importPath: "@plasmicpkgs/react-aria/skinny/
|
|
1993
|
-
importName: "
|
|
3157
|
+
name: SLIDER_TRACK_COMPONENT_NAME,
|
|
3158
|
+
displayName: "Aria Slider Track",
|
|
3159
|
+
importPath: "@plasmicpkgs/react-aria/skinny/registerSliderTrack",
|
|
3160
|
+
importName: "BaseSliderTrack",
|
|
3161
|
+
defaultStyles: {
|
|
3162
|
+
width: "stretch",
|
|
3163
|
+
backgroundColor: "#aaa",
|
|
3164
|
+
position: "relative",
|
|
3165
|
+
height: "10px",
|
|
3166
|
+
padding: 0
|
|
3167
|
+
},
|
|
3168
|
+
interactionVariants: interactionVariants$2,
|
|
1994
3169
|
props: {
|
|
1995
|
-
|
|
3170
|
+
children: {
|
|
1996
3171
|
type: "slot",
|
|
1997
|
-
|
|
1998
|
-
|
|
3172
|
+
description: "The thumbs of the slider",
|
|
3173
|
+
defaultValue: [
|
|
3174
|
+
{
|
|
3175
|
+
type: "component",
|
|
3176
|
+
name: makeChildComponentName(
|
|
3177
|
+
SLIDER_COMPONENT_NAME,
|
|
3178
|
+
SLIDER_THUMB_COMPONENT_NAME
|
|
3179
|
+
)
|
|
3180
|
+
}
|
|
3181
|
+
]
|
|
3182
|
+
},
|
|
3183
|
+
progressBar: {
|
|
3184
|
+
type: "slot",
|
|
3185
|
+
displayName: "Progress Bar",
|
|
3186
|
+
defaultValue: [
|
|
3187
|
+
{
|
|
3188
|
+
type: "box",
|
|
3189
|
+
styles: {
|
|
3190
|
+
height: "100%",
|
|
3191
|
+
width: "100%",
|
|
3192
|
+
backgroundColor: "#ffa6a6",
|
|
3193
|
+
padding: 0
|
|
3194
|
+
}
|
|
3195
|
+
}
|
|
3196
|
+
]
|
|
1999
3197
|
}
|
|
2000
|
-
}
|
|
3198
|
+
},
|
|
3199
|
+
trapsFocus: true
|
|
2001
3200
|
},
|
|
2002
3201
|
overrides
|
|
2003
3202
|
);
|
|
2004
|
-
const thisName = makeChildComponentName(
|
|
2005
|
-
overrides == null ? void 0 : overrides.parentComponentName,
|
|
2006
|
-
makeComponentName("section")
|
|
2007
|
-
);
|
|
2008
|
-
registerHeader(loader, {
|
|
2009
|
-
parentComponentName: thisName
|
|
2010
|
-
});
|
|
2011
3203
|
}
|
|
2012
3204
|
|
|
2013
3205
|
var __defProp$4 = Object.defineProperty;
|
|
3206
|
+
var __defProps$3 = Object.defineProperties;
|
|
3207
|
+
var __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors;
|
|
2014
3208
|
var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
|
|
2015
3209
|
var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
|
|
2016
3210
|
var __propIsEnum$4 = Object.prototype.propertyIsEnumerable;
|
|
@@ -2026,164 +3220,225 @@ var __spreadValues$4 = (a, b) => {
|
|
|
2026
3220
|
}
|
|
2027
3221
|
return a;
|
|
2028
3222
|
};
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
__spreadValues$4(__spreadValues$4({
|
|
2050
|
-
placeholder,
|
|
2051
|
-
selectedKey: value,
|
|
2052
|
-
onSelectionChange: onChange,
|
|
2053
|
-
onOpenChange,
|
|
2054
|
-
isDisabled,
|
|
2055
|
-
className,
|
|
2056
|
-
style,
|
|
2057
|
-
name,
|
|
2058
|
-
"aria-label": ariaLabel
|
|
2059
|
-
}, previewOpen && canvas ? { isOpen: previewOpen } : void 0), extractPlasmicDataProps(props)),
|
|
2060
|
-
/* @__PURE__ */ React__default.default.createElement(
|
|
2061
|
-
PlasmicListBoxContext.Provider,
|
|
2062
|
-
{
|
|
2063
|
-
value: {
|
|
2064
|
-
items: options,
|
|
2065
|
-
disabledKeys
|
|
3223
|
+
var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b));
|
|
3224
|
+
var __objRest$4 = (source, exclude) => {
|
|
3225
|
+
var target = {};
|
|
3226
|
+
for (var prop in source)
|
|
3227
|
+
if (__hasOwnProp$4.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
3228
|
+
target[prop] = source[prop];
|
|
3229
|
+
if (source != null && __getOwnPropSymbols$4)
|
|
3230
|
+
for (var prop of __getOwnPropSymbols$4(source)) {
|
|
3231
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$4.call(source, prop))
|
|
3232
|
+
target[prop] = source[prop];
|
|
3233
|
+
}
|
|
3234
|
+
return target;
|
|
3235
|
+
};
|
|
3236
|
+
const SLIDER_COMPONENT_NAME = makeComponentName("slider");
|
|
3237
|
+
const sliderHelpers = {
|
|
3238
|
+
states: {
|
|
3239
|
+
range: {
|
|
3240
|
+
onChangeArgsToValue: (value, isMultiValue) => {
|
|
3241
|
+
if (isMultiValue) {
|
|
3242
|
+
return Array.isArray(value) ? value : [value, value + 10];
|
|
2066
3243
|
}
|
|
2067
|
-
|
|
2068
|
-
structure
|
|
2069
|
-
)
|
|
2070
|
-
);
|
|
2071
|
-
}
|
|
2072
|
-
function registerSelect(loader) {
|
|
2073
|
-
registerComponentHelper(loader, BaseSelect, {
|
|
2074
|
-
name: SELECT_NAME,
|
|
2075
|
-
displayName: "Aria Select",
|
|
2076
|
-
importPath: "@plasmicpkgs/react-aria/skinny/registerSelect",
|
|
2077
|
-
importName: "BaseSelect",
|
|
2078
|
-
props: {
|
|
2079
|
-
options: makeOptionsPropType(),
|
|
2080
|
-
placeholder: {
|
|
2081
|
-
type: "string"
|
|
2082
|
-
},
|
|
2083
|
-
isDisabled: {
|
|
2084
|
-
type: "boolean"
|
|
2085
|
-
},
|
|
2086
|
-
value: makeValuePropType(),
|
|
2087
|
-
onChange: {
|
|
2088
|
-
type: "eventHandler",
|
|
2089
|
-
argTypes: [{ name: "value", type: "string" }]
|
|
2090
|
-
},
|
|
2091
|
-
previewOpen: {
|
|
2092
|
-
type: "boolean",
|
|
2093
|
-
displayName: "Preview opened?",
|
|
2094
|
-
description: "Preview opened state while designing in Plasmic editor",
|
|
2095
|
-
editOnly: true
|
|
2096
|
-
},
|
|
2097
|
-
onOpenChange: {
|
|
2098
|
-
type: "eventHandler",
|
|
2099
|
-
argTypes: [{ name: "isOpen", type: "boolean" }]
|
|
2100
|
-
},
|
|
2101
|
-
// optionValue: {
|
|
2102
|
-
// type: "string",
|
|
2103
|
-
// displayName: "Field key for an option's value",
|
|
2104
|
-
// hidden: (ps) =>
|
|
2105
|
-
// !ps.options ||
|
|
2106
|
-
// !ps.options[0] ||
|
|
2107
|
-
// typeof ps.options[0] === "string" ||
|
|
2108
|
-
// "value" in ps.options[0],
|
|
2109
|
-
// exprHint:
|
|
2110
|
-
// "Return a function that takes in an option object, and returns the key to use",
|
|
2111
|
-
// },
|
|
2112
|
-
// optionText: {
|
|
2113
|
-
// type: "string",
|
|
2114
|
-
// displayName: "Field key for an option's text value",
|
|
2115
|
-
// hidden: (ps) =>
|
|
2116
|
-
// !ps.options ||
|
|
2117
|
-
// !ps.options[0] ||
|
|
2118
|
-
// typeof ps.options[0] === "string" ||
|
|
2119
|
-
// "value" in ps.options[0],
|
|
2120
|
-
// exprHint:
|
|
2121
|
-
// "Return a function that takes in an option object, and returns the text value to use",
|
|
2122
|
-
// },
|
|
2123
|
-
// optionDisabled: {
|
|
2124
|
-
// type: "string",
|
|
2125
|
-
// displayName: "Field key for whether an option is disabled",
|
|
2126
|
-
// hidden: (ps) =>
|
|
2127
|
-
// !ps.options ||
|
|
2128
|
-
// !ps.options[0] ||
|
|
2129
|
-
// typeof ps.options[0] === "string" ||
|
|
2130
|
-
// "value" in ps.options[0],
|
|
2131
|
-
// exprHint:
|
|
2132
|
-
// "Return a function that takes in an option object, and returns true if option should be disabled",
|
|
2133
|
-
// },
|
|
2134
|
-
structure: {
|
|
2135
|
-
type: "slot"
|
|
2136
|
-
},
|
|
2137
|
-
// renderOption: {
|
|
2138
|
-
// type: "slot",
|
|
2139
|
-
// displayName: "Custom render option",
|
|
2140
|
-
// renderPropParams: ["item"],
|
|
2141
|
-
// hidePlaceholder: true
|
|
2142
|
-
// },
|
|
2143
|
-
name: {
|
|
2144
|
-
type: "string",
|
|
2145
|
-
displayName: "Form field key",
|
|
2146
|
-
description: "Name of the input, when submitting in an HTML form",
|
|
2147
|
-
advanced: true
|
|
2148
|
-
},
|
|
2149
|
-
"aria-label": {
|
|
2150
|
-
type: "string",
|
|
2151
|
-
displayName: "Aria Label",
|
|
2152
|
-
description: "Label for this input, if no visible label is used",
|
|
2153
|
-
advanced: true
|
|
3244
|
+
return void 0;
|
|
2154
3245
|
}
|
|
2155
3246
|
},
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
},
|
|
2163
|
-
isOpen: {
|
|
2164
|
-
type: "readonly",
|
|
2165
|
-
onChangeProp: "onOpenChange",
|
|
2166
|
-
variableType: "boolean"
|
|
3247
|
+
value: {
|
|
3248
|
+
onChangeArgsToValue: (value, isMultiValue) => {
|
|
3249
|
+
if (isMultiValue) {
|
|
3250
|
+
return void 0;
|
|
3251
|
+
}
|
|
3252
|
+
return Array.isArray(value) ? value[0] : value;
|
|
2167
3253
|
}
|
|
2168
3254
|
}
|
|
3255
|
+
}
|
|
3256
|
+
};
|
|
3257
|
+
function BaseSlider(props) {
|
|
3258
|
+
const _a = props, { range, value, defaultRange, defaultValue, onChange } = _a, rest = __objRest$4(_a, ["range", "value", "defaultRange", "defaultValue", "onChange"]);
|
|
3259
|
+
const isFirstRender = React.useRef(true);
|
|
3260
|
+
React.useEffect(() => {
|
|
3261
|
+
var _a2, _b, _c;
|
|
3262
|
+
if (isFirstRender.current) {
|
|
3263
|
+
isFirstRender.current = false;
|
|
3264
|
+
return;
|
|
3265
|
+
}
|
|
3266
|
+
if (props.isMultiValue) {
|
|
3267
|
+
const minValue = (_a2 = props.minValue) != null ? _a2 : 0;
|
|
3268
|
+
(_b = props.onChange) == null ? void 0 : _b.call(
|
|
3269
|
+
props,
|
|
3270
|
+
Array.isArray(range) && range.length > 1 ? range : [minValue, minValue + 10],
|
|
3271
|
+
true
|
|
3272
|
+
);
|
|
3273
|
+
return;
|
|
3274
|
+
}
|
|
3275
|
+
(_c = props.onChange) == null ? void 0 : _c.call(props, Array.isArray(value) ? 0 : value != null ? value : 0, false);
|
|
3276
|
+
}, [props.isMultiValue]);
|
|
3277
|
+
const mergedProps = reactAria.mergeProps(rest, {
|
|
3278
|
+
value: props.isMultiValue ? range : value,
|
|
3279
|
+
defaultValue: props.isMultiValue ? defaultRange : defaultValue
|
|
2169
3280
|
});
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
props: {
|
|
2177
|
-
className: {
|
|
2178
|
-
type: "class",
|
|
2179
|
-
selectors: [
|
|
2180
|
-
{
|
|
2181
|
-
selector: ":self[data-placeholder]",
|
|
2182
|
-
label: "Placeholder"
|
|
2183
|
-
}
|
|
2184
|
-
]
|
|
3281
|
+
return /* @__PURE__ */ React__default.default.createElement(PlasmicSliderContext.Provider, { value: mergedProps }, /* @__PURE__ */ React__default.default.createElement(
|
|
3282
|
+
reactAriaComponents.Slider,
|
|
3283
|
+
__spreadValues$4({
|
|
3284
|
+
key: props.isMultiValue ? "multi" : "single",
|
|
3285
|
+
onChange: (newValue) => {
|
|
3286
|
+
onChange == null ? void 0 : onChange(newValue, props.isMultiValue);
|
|
2185
3287
|
}
|
|
2186
|
-
}
|
|
3288
|
+
}, mergedProps)
|
|
3289
|
+
));
|
|
3290
|
+
}
|
|
3291
|
+
function registerSlider(loader, overrides) {
|
|
3292
|
+
registerComponentHelper(
|
|
3293
|
+
loader,
|
|
3294
|
+
BaseSlider,
|
|
3295
|
+
{
|
|
3296
|
+
name: SLIDER_COMPONENT_NAME,
|
|
3297
|
+
displayName: "Aria Slider",
|
|
3298
|
+
importPath: "@plasmicpkgs/react-aria/skinny/registerSlider",
|
|
3299
|
+
importName: "BaseSlider",
|
|
3300
|
+
defaultStyles: {
|
|
3301
|
+
width: "300px"
|
|
3302
|
+
},
|
|
3303
|
+
props: __spreadProps$3(__spreadValues$4({}, getCommonInputProps("slider", [
|
|
3304
|
+
"isDisabled",
|
|
3305
|
+
"name",
|
|
3306
|
+
"autoFocus",
|
|
3307
|
+
"aria-label"
|
|
3308
|
+
])), {
|
|
3309
|
+
children: {
|
|
3310
|
+
type: "slot",
|
|
3311
|
+
defaultValue: [
|
|
3312
|
+
{
|
|
3313
|
+
type: "hbox",
|
|
3314
|
+
styles: {
|
|
3315
|
+
width: "stretch",
|
|
3316
|
+
justifyContent: "space-between",
|
|
3317
|
+
padding: "8px 0px"
|
|
3318
|
+
},
|
|
3319
|
+
children: [
|
|
3320
|
+
{
|
|
3321
|
+
type: "component",
|
|
3322
|
+
name: LABEL_COMPONENT_NAME,
|
|
3323
|
+
props: {
|
|
3324
|
+
children: {
|
|
3325
|
+
type: "text",
|
|
3326
|
+
value: "Label"
|
|
3327
|
+
}
|
|
3328
|
+
}
|
|
3329
|
+
},
|
|
3330
|
+
{
|
|
3331
|
+
type: "component",
|
|
3332
|
+
name: makeChildComponentName(
|
|
3333
|
+
SLIDER_COMPONENT_NAME,
|
|
3334
|
+
SLIDER_OUTPUT_COMPONENT_NAME
|
|
3335
|
+
),
|
|
3336
|
+
props: {
|
|
3337
|
+
children: {
|
|
3338
|
+
type: "text",
|
|
3339
|
+
value: "Output"
|
|
3340
|
+
}
|
|
3341
|
+
}
|
|
3342
|
+
}
|
|
3343
|
+
]
|
|
3344
|
+
},
|
|
3345
|
+
{
|
|
3346
|
+
type: "component",
|
|
3347
|
+
name: makeChildComponentName(
|
|
3348
|
+
SLIDER_COMPONENT_NAME,
|
|
3349
|
+
SLIDER_TRACK_COMPONENT_NAME
|
|
3350
|
+
)
|
|
3351
|
+
}
|
|
3352
|
+
]
|
|
3353
|
+
},
|
|
3354
|
+
orientation: {
|
|
3355
|
+
type: "choice",
|
|
3356
|
+
options: ["horizontal", "vertical"],
|
|
3357
|
+
defaultValueHint: "horizontal",
|
|
3358
|
+
defaultValue: "horizontal"
|
|
3359
|
+
},
|
|
3360
|
+
minValue: {
|
|
3361
|
+
type: "number",
|
|
3362
|
+
description: "The minimum value of the slider",
|
|
3363
|
+
defaultValueHint: 0
|
|
3364
|
+
},
|
|
3365
|
+
maxValue: {
|
|
3366
|
+
type: "number",
|
|
3367
|
+
description: "The maximum value of the slider",
|
|
3368
|
+
defaultValueHint: 100
|
|
3369
|
+
},
|
|
3370
|
+
step: {
|
|
3371
|
+
type: "number",
|
|
3372
|
+
description: "The step value of the slider",
|
|
3373
|
+
defaultValueHint: 1
|
|
3374
|
+
},
|
|
3375
|
+
isMultiValue: {
|
|
3376
|
+
type: "boolean",
|
|
3377
|
+
displayName: "Multi-valued",
|
|
3378
|
+
description: "Whether the slider supports range (multiple thumbs)",
|
|
3379
|
+
defaultValue: false,
|
|
3380
|
+
defaultValueHint: false
|
|
3381
|
+
},
|
|
3382
|
+
range: {
|
|
3383
|
+
type: "array",
|
|
3384
|
+
editOnly: true,
|
|
3385
|
+
uncontrolledProp: "defaultRange",
|
|
3386
|
+
description: "The default range of the slider",
|
|
3387
|
+
defaultValueHint: [10, 20],
|
|
3388
|
+
defaultValue: [10, 20],
|
|
3389
|
+
hidden: (ps) => !ps.isMultiValue
|
|
3390
|
+
},
|
|
3391
|
+
value: {
|
|
3392
|
+
type: "number",
|
|
3393
|
+
editOnly: true,
|
|
3394
|
+
uncontrolledProp: "defaultValue",
|
|
3395
|
+
description: "The default value of the slider",
|
|
3396
|
+
defaultValueHint: 0,
|
|
3397
|
+
defaultValue: 0,
|
|
3398
|
+
hidden: (ps) => Boolean(ps.isMultiValue)
|
|
3399
|
+
},
|
|
3400
|
+
onChange: {
|
|
3401
|
+
type: "eventHandler",
|
|
3402
|
+
argTypes: [{ name: "value", type: "object" }]
|
|
3403
|
+
},
|
|
3404
|
+
onChangeEnd: {
|
|
3405
|
+
type: "eventHandler",
|
|
3406
|
+
argTypes: [{ name: "value", type: "object" }]
|
|
3407
|
+
}
|
|
3408
|
+
}),
|
|
3409
|
+
states: {
|
|
3410
|
+
range: __spreadValues$4({
|
|
3411
|
+
type: "writable",
|
|
3412
|
+
valueProp: "range",
|
|
3413
|
+
onChangeProp: "onChange",
|
|
3414
|
+
variableType: "array",
|
|
3415
|
+
hidden: (ps) => !ps.isMultiValue
|
|
3416
|
+
}, sliderHelpers.states.range),
|
|
3417
|
+
value: __spreadValues$4({
|
|
3418
|
+
type: "writable",
|
|
3419
|
+
valueProp: "value",
|
|
3420
|
+
onChangeProp: "onChange",
|
|
3421
|
+
variableType: "number",
|
|
3422
|
+
hidden: (ps) => Boolean(ps.isMultiValue)
|
|
3423
|
+
}, sliderHelpers.states.value)
|
|
3424
|
+
},
|
|
3425
|
+
componentHelpers: {
|
|
3426
|
+
helpers: sliderHelpers,
|
|
3427
|
+
importName: "sliderHelpers",
|
|
3428
|
+
importPath: "@plasmicpkgs/react-aria/skinny/registerSlider"
|
|
3429
|
+
},
|
|
3430
|
+
trapsFocus: true
|
|
3431
|
+
},
|
|
3432
|
+
overrides
|
|
3433
|
+
);
|
|
3434
|
+
registerSliderOutput(loader, {
|
|
3435
|
+
parentComponentName: SLIDER_COMPONENT_NAME
|
|
3436
|
+
});
|
|
3437
|
+
registerSliderThumb(loader, {
|
|
3438
|
+
parentComponentName: SLIDER_COMPONENT_NAME
|
|
3439
|
+
});
|
|
3440
|
+
registerSliderTrack(loader, {
|
|
3441
|
+
parentComponentName: SLIDER_COMPONENT_NAME
|
|
2187
3442
|
});
|
|
2188
3443
|
}
|
|
2189
3444
|
|
|
@@ -2250,14 +3505,91 @@ function registerSwitch(loader, overrides) {
|
|
|
2250
3505
|
importPath: "@plasmicpkgs/react-aria/skinny/registerSwitch",
|
|
2251
3506
|
importName: "BaseSwitch",
|
|
2252
3507
|
interactionVariants: interactionVariants$1,
|
|
3508
|
+
defaultStyles: {
|
|
3509
|
+
display: "flex",
|
|
3510
|
+
flexDirection: "column",
|
|
3511
|
+
alignItems: "center",
|
|
3512
|
+
justifyContent: "flex-start",
|
|
3513
|
+
padding: 0
|
|
3514
|
+
},
|
|
2253
3515
|
props: __spreadProps$2(__spreadValues$3({}, getCommonInputProps("switch", [
|
|
2254
3516
|
"name",
|
|
2255
3517
|
"isDisabled",
|
|
2256
3518
|
"isReadOnly",
|
|
2257
3519
|
"autoFocus",
|
|
2258
|
-
"aria-label"
|
|
2259
|
-
"children"
|
|
3520
|
+
"aria-label"
|
|
2260
3521
|
])), {
|
|
3522
|
+
children: {
|
|
3523
|
+
type: "slot",
|
|
3524
|
+
mergeWithParent: true,
|
|
3525
|
+
defaultValue: [
|
|
3526
|
+
{
|
|
3527
|
+
type: "hbox",
|
|
3528
|
+
styles: {
|
|
3529
|
+
display: "flex",
|
|
3530
|
+
alignItems: "center",
|
|
3531
|
+
justifyContent: "center",
|
|
3532
|
+
gap: "10px",
|
|
3533
|
+
padding: 0
|
|
3534
|
+
},
|
|
3535
|
+
children: [
|
|
3536
|
+
{
|
|
3537
|
+
// the track
|
|
3538
|
+
type: "hbox",
|
|
3539
|
+
styles: {
|
|
3540
|
+
width: "30px",
|
|
3541
|
+
height: "16px",
|
|
3542
|
+
padding: 0,
|
|
3543
|
+
backgroundColor: "#D5D5D5",
|
|
3544
|
+
cursor: "pointer",
|
|
3545
|
+
borderRadius: "999px"
|
|
3546
|
+
},
|
|
3547
|
+
children: {
|
|
3548
|
+
// the thumb
|
|
3549
|
+
type: "hbox",
|
|
3550
|
+
styles: {
|
|
3551
|
+
width: "12px",
|
|
3552
|
+
height: "12px",
|
|
3553
|
+
position: "absolute",
|
|
3554
|
+
top: "2px",
|
|
3555
|
+
left: "2px",
|
|
3556
|
+
borderRadius: "100%",
|
|
3557
|
+
backgroundColor: "#fff",
|
|
3558
|
+
padding: 0,
|
|
3559
|
+
transitionProperty: "all",
|
|
3560
|
+
transitionDuration: "0.5s",
|
|
3561
|
+
transitionTimingFunction: "ease-in-out"
|
|
3562
|
+
}
|
|
3563
|
+
}
|
|
3564
|
+
},
|
|
3565
|
+
{
|
|
3566
|
+
// the label
|
|
3567
|
+
type: "component",
|
|
3568
|
+
name: LABEL_COMPONENT_NAME,
|
|
3569
|
+
props: {
|
|
3570
|
+
children: {
|
|
3571
|
+
type: "text",
|
|
3572
|
+
value: "Label"
|
|
3573
|
+
}
|
|
3574
|
+
}
|
|
3575
|
+
}
|
|
3576
|
+
]
|
|
3577
|
+
},
|
|
3578
|
+
{
|
|
3579
|
+
type: "component",
|
|
3580
|
+
name: DESCRIPTION_COMPONENT_NAME,
|
|
3581
|
+
styles: {
|
|
3582
|
+
fontSize: "12px"
|
|
3583
|
+
},
|
|
3584
|
+
props: {
|
|
3585
|
+
children: {
|
|
3586
|
+
type: "text",
|
|
3587
|
+
value: "Add interaction variants to see it in action..."
|
|
3588
|
+
}
|
|
3589
|
+
}
|
|
3590
|
+
}
|
|
3591
|
+
]
|
|
3592
|
+
},
|
|
2261
3593
|
value: {
|
|
2262
3594
|
type: "boolean",
|
|
2263
3595
|
editOnly: true,
|
|
@@ -2422,13 +3754,13 @@ function BaseTextField(props) {
|
|
|
2422
3754
|
children
|
|
2423
3755
|
);
|
|
2424
3756
|
}
|
|
2425
|
-
const
|
|
3757
|
+
const TEXT_FIELD_COMPONENT_NAME = makeComponentName("textField");
|
|
2426
3758
|
function registerTextField(loader, overrides) {
|
|
2427
3759
|
registerComponentHelper(
|
|
2428
3760
|
loader,
|
|
2429
3761
|
BaseTextField,
|
|
2430
3762
|
{
|
|
2431
|
-
name:
|
|
3763
|
+
name: TEXT_FIELD_COMPONENT_NAME,
|
|
2432
3764
|
displayName: "Aria TextField",
|
|
2433
3765
|
importPath: "@plasmicpkgs/react-aria/skinny/registerTextField",
|
|
2434
3766
|
importName: "BaseTextField",
|
|
@@ -2439,9 +3771,50 @@ function registerTextField(loader, overrides) {
|
|
|
2439
3771
|
"isReadOnly",
|
|
2440
3772
|
"autoFocus",
|
|
2441
3773
|
"aria-label",
|
|
2442
|
-
"children",
|
|
2443
3774
|
"isRequired"
|
|
2444
3775
|
])), {
|
|
3776
|
+
children: {
|
|
3777
|
+
type: "slot",
|
|
3778
|
+
mergeWithParent: true,
|
|
3779
|
+
defaultValue: {
|
|
3780
|
+
type: "vbox",
|
|
3781
|
+
styles: {
|
|
3782
|
+
justifyContent: "flex-start",
|
|
3783
|
+
alignItems: "flex-start",
|
|
3784
|
+
width: "300px",
|
|
3785
|
+
gap: "5px"
|
|
3786
|
+
},
|
|
3787
|
+
children: [
|
|
3788
|
+
{
|
|
3789
|
+
type: "component",
|
|
3790
|
+
name: LABEL_COMPONENT_NAME,
|
|
3791
|
+
props: {
|
|
3792
|
+
children: {
|
|
3793
|
+
type: "text",
|
|
3794
|
+
value: "Label"
|
|
3795
|
+
}
|
|
3796
|
+
}
|
|
3797
|
+
},
|
|
3798
|
+
{
|
|
3799
|
+
type: "component",
|
|
3800
|
+
name: INPUT_COMPONENT_NAME,
|
|
3801
|
+
styles: {
|
|
3802
|
+
width: "100%"
|
|
3803
|
+
}
|
|
3804
|
+
},
|
|
3805
|
+
{
|
|
3806
|
+
type: "component",
|
|
3807
|
+
name: DESCRIPTION_COMPONENT_NAME,
|
|
3808
|
+
props: {
|
|
3809
|
+
children: {
|
|
3810
|
+
type: "text",
|
|
3811
|
+
value: "Type something..."
|
|
3812
|
+
}
|
|
3813
|
+
}
|
|
3814
|
+
}
|
|
3815
|
+
]
|
|
3816
|
+
}
|
|
3817
|
+
},
|
|
2445
3818
|
value: {
|
|
2446
3819
|
type: "string",
|
|
2447
3820
|
editOnly: true,
|
|
@@ -2657,12 +4030,11 @@ function registerTextField(loader, overrides) {
|
|
|
2657
4030
|
);
|
|
2658
4031
|
const thisName = makeChildComponentName(
|
|
2659
4032
|
overrides == null ? void 0 : overrides.parentComponentName,
|
|
2660
|
-
|
|
4033
|
+
TEXT_FIELD_COMPONENT_NAME
|
|
2661
4034
|
);
|
|
2662
4035
|
registerFieldError(loader, { parentComponentName: thisName });
|
|
2663
4036
|
registerInput(loader, { parentComponentName: thisName });
|
|
2664
4037
|
registerLabel(loader, { parentComponentName: thisName });
|
|
2665
|
-
registerDescription(loader, { parentComponentName: thisName });
|
|
2666
4038
|
registerTextArea(loader, { parentComponentName: thisName });
|
|
2667
4039
|
}
|
|
2668
4040
|
|
|
@@ -2796,6 +4168,8 @@ function registerTooltip(loader, overrides) {
|
|
|
2796
4168
|
}
|
|
2797
4169
|
|
|
2798
4170
|
function registerAll(loader) {
|
|
4171
|
+
registerText(loader);
|
|
4172
|
+
registerDescription(loader);
|
|
2799
4173
|
registerSelect(loader);
|
|
2800
4174
|
registerComboBox(loader);
|
|
2801
4175
|
registerButton(loader);
|
|
@@ -2803,7 +4177,6 @@ function registerAll(loader) {
|
|
|
2803
4177
|
registerListBox(loader);
|
|
2804
4178
|
registerPopover(loader);
|
|
2805
4179
|
registerInput(loader);
|
|
2806
|
-
registerSection(loader);
|
|
2807
4180
|
registerSwitch(loader);
|
|
2808
4181
|
registerForm(loader);
|
|
2809
4182
|
registerCheckbox(loader);
|
|
@@ -2813,6 +4186,7 @@ function registerAll(loader) {
|
|
|
2813
4186
|
registerModal(loader);
|
|
2814
4187
|
registerTooltip(loader);
|
|
2815
4188
|
registerDialogTrigger(loader);
|
|
4189
|
+
registerSlider(loader);
|
|
2816
4190
|
}
|
|
2817
4191
|
|
|
2818
4192
|
exports.registerAll = registerAll;
|