@plasmicpkgs/react-aria 0.0.45 → 0.0.47
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 +1 -0
- package/dist/react-aria.esm.js +29 -23
- package/dist/react-aria.esm.js.map +1 -1
- package/dist/react-aria.js +29 -23
- package/dist/react-aria.js.map +1 -1
- package/dist/registerModal.d.ts +0 -1
- package/dist/registerSelect.d.ts +3 -3
- package/package.json +2 -2
- package/skinny/{common-f51484c1.cjs.js → common-0e83996a.cjs.js} +3 -3
- package/skinny/{common-f51484c1.cjs.js.map → common-0e83996a.cjs.js.map} +1 -1
- package/skinny/{common-96be13c3.esm.js → common-e9d84279.esm.js} +3 -3
- package/skinny/{common-96be13c3.esm.js.map → common-e9d84279.esm.js.map} +1 -1
- package/skinny/{contexts-3a98471a.cjs.js → contexts-0dec6156.cjs.js} +3 -1
- package/skinny/contexts-0dec6156.cjs.js.map +1 -0
- package/skinny/{contexts-87c261f6.esm.js → contexts-9a8234bf.esm.js} +3 -2
- package/skinny/contexts-9a8234bf.esm.js.map +1 -0
- package/skinny/contexts.d.ts +1 -0
- package/skinny/registerButton.cjs.js +1 -1
- package/skinny/registerButton.esm.js +1 -1
- package/skinny/registerCheckbox.cjs.js +2 -2
- package/skinny/registerCheckbox.esm.js +2 -2
- package/skinny/registerCheckboxGroup.cjs.js +2 -2
- package/skinny/registerCheckboxGroup.esm.js +2 -2
- package/skinny/registerComboBox.cjs.js +3 -3
- package/skinny/registerComboBox.esm.js +3 -3
- package/skinny/registerDialogTrigger.cjs.js +2 -2
- package/skinny/registerDialogTrigger.esm.js +2 -2
- package/skinny/registerHeader.cjs.js +1 -1
- package/skinny/registerHeader.esm.js +1 -1
- package/skinny/registerInput.cjs.js +2 -2
- package/skinny/registerInput.esm.js +2 -2
- package/skinny/{registerListBox-44316bb6.cjs.js → registerListBox-5fcac24c.cjs.js} +3 -3
- package/skinny/{registerListBox-44316bb6.cjs.js.map → registerListBox-5fcac24c.cjs.js.map} +1 -1
- package/skinny/{registerListBox-ccd14a2e.esm.js → registerListBox-7472d398.esm.js} +3 -3
- package/skinny/{registerListBox-ccd14a2e.esm.js.map → registerListBox-7472d398.esm.js.map} +1 -1
- package/skinny/registerListBox.cjs.js +3 -3
- package/skinny/registerListBox.esm.js +3 -3
- package/skinny/registerListBoxItem.cjs.js +1 -1
- package/skinny/registerListBoxItem.esm.js +1 -1
- package/skinny/registerModal.cjs.js +7 -14
- package/skinny/registerModal.cjs.js.map +1 -1
- package/skinny/registerModal.d.ts +0 -1
- package/skinny/registerModal.esm.js +7 -14
- package/skinny/registerModal.esm.js.map +1 -1
- package/skinny/registerPopover.cjs.js +3 -0
- package/skinny/registerPopover.cjs.js.map +1 -1
- package/skinny/registerPopover.esm.js +3 -0
- package/skinny/registerPopover.esm.js.map +1 -1
- package/skinny/registerRadio.cjs.js +2 -2
- package/skinny/registerRadio.esm.js +2 -2
- package/skinny/registerRadioGroup.cjs.js +3 -3
- package/skinny/registerRadioGroup.cjs.js.map +1 -1
- package/skinny/registerRadioGroup.esm.js +3 -3
- package/skinny/registerRadioGroup.esm.js.map +1 -1
- package/skinny/registerSection.cjs.js +1 -1
- package/skinny/registerSection.esm.js +1 -1
- package/skinny/registerSelect.cjs.js +19 -10
- package/skinny/registerSelect.cjs.js.map +1 -1
- package/skinny/registerSelect.d.ts +3 -3
- package/skinny/registerSelect.esm.js +19 -10
- package/skinny/registerSelect.esm.js.map +1 -1
- package/skinny/registerSlider.cjs.js +4 -3
- package/skinny/registerSlider.cjs.js.map +1 -1
- package/skinny/registerSlider.esm.js +4 -3
- package/skinny/registerSlider.esm.js.map +1 -1
- package/skinny/registerSliderThumb.cjs.js +2 -2
- package/skinny/registerSliderThumb.esm.js +2 -2
- package/skinny/registerSliderTrack.cjs.js +1 -1
- package/skinny/registerSliderTrack.esm.js +1 -1
- package/skinny/registerSwitch.cjs.js +1 -1
- package/skinny/registerSwitch.esm.js +1 -1
- package/skinny/registerTextArea.cjs.js +2 -2
- package/skinny/registerTextArea.esm.js +2 -2
- package/skinny/registerTextField.cjs.js +2 -2
- package/skinny/registerTextField.esm.js +2 -2
- package/skinny/contexts-3a98471a.cjs.js.map +0 -1
- package/skinny/contexts-87c261f6.esm.js.map +0 -1
package/dist/contexts.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export declare const PlasmicDialogTriggerContext: React.Context<import("./regist
|
|
|
9
9
|
export type PlasmicSliderContextType<T extends number | number[]> = React.ComponentProps<typeof BaseSlider<T>> | undefined;
|
|
10
10
|
export declare const PlasmicSliderContext: React.Context<PlasmicSliderContextType<number | number[]>>;
|
|
11
11
|
export declare const PlasmicLabelContext: React.Context<(import("react-aria-components").LabelProps & React.RefAttributes<HTMLLabelElement>) | undefined>;
|
|
12
|
+
export declare const PlasmicPopoverContext: React.Context<import("./registerPopover").BasePopoverProps | undefined>;
|
|
12
13
|
export declare const PlasmicListBoxContext: React.Context<BaseListBoxProps | undefined>;
|
|
13
14
|
export declare const PlasmicItemContext: React.Context<StrictItemType | undefined>;
|
|
14
15
|
export declare const PlasmicSectionContext: React.Context<import("./registerSection").BaseSectionProps | undefined>;
|
package/dist/react-aria.esm.js
CHANGED
|
@@ -145,7 +145,7 @@ function createAutoFocusProp(componentName) {
|
|
|
145
145
|
function createAriaLabelProp(componentName) {
|
|
146
146
|
return {
|
|
147
147
|
type: "string",
|
|
148
|
-
displayName: "
|
|
148
|
+
displayName: "ARIA label",
|
|
149
149
|
description: `Label for this ${componentName}, if no visible label is used, to identify the element to assistive technology`,
|
|
150
150
|
advanced: true,
|
|
151
151
|
hidden: hasParent
|
|
@@ -173,7 +173,7 @@ function getCommonProps(componentName, propNames) {
|
|
|
173
173
|
value: {
|
|
174
174
|
type: "string",
|
|
175
175
|
editOnly: true,
|
|
176
|
-
displayName: "
|
|
176
|
+
displayName: "Initial value",
|
|
177
177
|
uncontrolledProp: "defaultValue",
|
|
178
178
|
description: `The default value of the ${componentName}`,
|
|
179
179
|
hidden: hasParent
|
|
@@ -605,6 +605,7 @@ const PlasmicRadioGroupContext = React.createContext(void 0);
|
|
|
605
605
|
const PlasmicDialogTriggerContext = React.createContext(void 0);
|
|
606
606
|
const PlasmicSliderContext = React.createContext(void 0);
|
|
607
607
|
React.createContext(void 0);
|
|
608
|
+
const PlasmicPopoverContext = React.createContext(void 0);
|
|
608
609
|
const PlasmicListBoxContext = React.createContext(void 0);
|
|
609
610
|
const PlasmicItemContext = React.createContext(void 0);
|
|
610
611
|
const PlasmicSectionContext = React.createContext(void 0);
|
|
@@ -1956,12 +1957,14 @@ var __objRest$d = (source, exclude) => {
|
|
|
1956
1957
|
function BasePopover(props) {
|
|
1957
1958
|
const _a = props, { resetClassName, setControlContextData } = _a, restProps = __objRest$d(_a, ["resetClassName", "setControlContextData"]);
|
|
1958
1959
|
const isStandalone = !React.useContext(PopoverContext);
|
|
1960
|
+
const context = React.useContext(PlasmicPopoverContext);
|
|
1959
1961
|
const isInsideSelect = !!React.useContext(SelectContext);
|
|
1960
1962
|
const triggerRef = React.useRef(null);
|
|
1961
1963
|
const isEditMode = !!usePlasmicCanvasContext();
|
|
1962
1964
|
const defaultShouldFlip = isInsideSelect ? false : true;
|
|
1963
1965
|
const mergedProps = mergeProps$1(
|
|
1964
1966
|
{ shouldFlip: defaultShouldFlip },
|
|
1967
|
+
context,
|
|
1965
1968
|
/**
|
|
1966
1969
|
* isNonModal: Whether the popover is non-modal, i.e. elements outside the popover may be interacted with by assistive technologies. *
|
|
1967
1970
|
*
|
|
@@ -2481,7 +2484,6 @@ const BaseModal = forwardRef(
|
|
|
2481
2484
|
children,
|
|
2482
2485
|
heading,
|
|
2483
2486
|
modalOverlayClass,
|
|
2484
|
-
onOpenChange,
|
|
2485
2487
|
className,
|
|
2486
2488
|
isOpen,
|
|
2487
2489
|
setControlContextData
|
|
@@ -2489,7 +2491,6 @@ const BaseModal = forwardRef(
|
|
|
2489
2491
|
"children",
|
|
2490
2492
|
"heading",
|
|
2491
2493
|
"modalOverlayClass",
|
|
2492
|
-
"onOpenChange",
|
|
2493
2494
|
"className",
|
|
2494
2495
|
"isOpen",
|
|
2495
2496
|
"setControlContextData"
|
|
@@ -2504,22 +2505,17 @@ const BaseModal = forwardRef(
|
|
|
2504
2505
|
});
|
|
2505
2506
|
useImperativeHandle(ref, () => ({
|
|
2506
2507
|
close: () => {
|
|
2507
|
-
|
|
2508
|
+
var _a2;
|
|
2509
|
+
(_a2 = mergedProps.onOpenChange) == null ? void 0 : _a2.call(mergedProps, false);
|
|
2508
2510
|
},
|
|
2509
2511
|
open: () => {
|
|
2510
|
-
|
|
2512
|
+
var _a2;
|
|
2513
|
+
(_a2 = mergedProps.onOpenChange) == null ? void 0 : _a2.call(mergedProps, true);
|
|
2511
2514
|
}
|
|
2512
2515
|
}));
|
|
2513
2516
|
const isCanvas = usePlasmicCanvasContext();
|
|
2514
2517
|
const body = /* @__PURE__ */ React.createElement(React.Fragment, null, heading && /* @__PURE__ */ React.createElement(Heading, { slot: "title" }, heading), children);
|
|
2515
|
-
return /* @__PURE__ */ React.createElement(
|
|
2516
|
-
ModalOverlay,
|
|
2517
|
-
__spreadProps$6(__spreadValues$d({}, mergedProps), {
|
|
2518
|
-
className: modalOverlayClass,
|
|
2519
|
-
onOpenChange
|
|
2520
|
-
}),
|
|
2521
|
-
/* @__PURE__ */ React.createElement(Modal, { className }, isCanvas ? body : /* @__PURE__ */ React.createElement(Dialog, null, body))
|
|
2522
|
-
);
|
|
2518
|
+
return /* @__PURE__ */ React.createElement(ModalOverlay, __spreadProps$6(__spreadValues$d({}, mergedProps), { className: modalOverlayClass }), /* @__PURE__ */ React.createElement(Modal, { className }, isCanvas ? body : /* @__PURE__ */ React.createElement(Dialog, null, body)));
|
|
2523
2519
|
}
|
|
2524
2520
|
);
|
|
2525
2521
|
const MODAL_COMPONENT_NAME = makeComponentName("modal");
|
|
@@ -3088,7 +3084,7 @@ function registerRadioGroup(loader, overrides) {
|
|
|
3088
3084
|
value: {
|
|
3089
3085
|
type: "string",
|
|
3090
3086
|
editOnly: true,
|
|
3091
|
-
displayName: "
|
|
3087
|
+
displayName: "Initial value",
|
|
3092
3088
|
uncontrolledProp: "defaultValue",
|
|
3093
3089
|
description: "The current value"
|
|
3094
3090
|
},
|
|
@@ -3156,14 +3152,16 @@ function BaseSelect(props) {
|
|
|
3156
3152
|
style,
|
|
3157
3153
|
structure,
|
|
3158
3154
|
name,
|
|
3155
|
+
isOpen,
|
|
3159
3156
|
"aria-label": ariaLabel
|
|
3160
3157
|
} = props;
|
|
3161
3158
|
const { options } = useStrictOptions(props);
|
|
3162
3159
|
const isEditMode = !!usePlasmicCanvasContext();
|
|
3160
|
+
const openProp = isEditMode && previewOpen ? true : isOpen;
|
|
3163
3161
|
const disabledKeys = flattenOptions(options).filter((op) => op.isDisabled).map((op) => op.id);
|
|
3164
3162
|
return /* @__PURE__ */ React.createElement(
|
|
3165
3163
|
Select,
|
|
3166
|
-
__spreadValues$8(
|
|
3164
|
+
__spreadValues$8({
|
|
3167
3165
|
placeholder,
|
|
3168
3166
|
selectedKey: value,
|
|
3169
3167
|
onSelectionChange: onChange,
|
|
@@ -3172,9 +3170,10 @@ function BaseSelect(props) {
|
|
|
3172
3170
|
className,
|
|
3173
3171
|
style,
|
|
3174
3172
|
name,
|
|
3175
|
-
"aria-label": ariaLabel
|
|
3176
|
-
|
|
3177
|
-
|
|
3173
|
+
"aria-label": ariaLabel,
|
|
3174
|
+
isOpen: openProp
|
|
3175
|
+
}, extractPlasmicDataProps(props)),
|
|
3176
|
+
/* @__PURE__ */ React.createElement(PlasmicPopoverContext.Provider, { value: { isOpen: openProp } }, /* @__PURE__ */ React.createElement(
|
|
3178
3177
|
PlasmicListBoxContext.Provider,
|
|
3179
3178
|
{
|
|
3180
3179
|
value: {
|
|
@@ -3183,7 +3182,7 @@ function BaseSelect(props) {
|
|
|
3183
3182
|
}
|
|
3184
3183
|
},
|
|
3185
3184
|
structure
|
|
3186
|
-
)
|
|
3185
|
+
))
|
|
3187
3186
|
);
|
|
3188
3187
|
}
|
|
3189
3188
|
function registerSelect(loader) {
|
|
@@ -3243,6 +3242,11 @@ function registerSelect(loader) {
|
|
|
3243
3242
|
description: "Preview opened state while designing in Plasmic editor",
|
|
3244
3243
|
editOnly: true
|
|
3245
3244
|
},
|
|
3245
|
+
isOpen: {
|
|
3246
|
+
type: "boolean",
|
|
3247
|
+
// It doesn't make sense to make isOpen prop editable (it's controlled by user interaction and always closed by default), so we keep this prop hidden. We have listed the prop here in the meta only so we can expose a writeable state for it.
|
|
3248
|
+
hidden: () => true
|
|
3249
|
+
},
|
|
3246
3250
|
onOpenChange: {
|
|
3247
3251
|
type: "eventHandler",
|
|
3248
3252
|
argTypes: [{ name: "isOpen", type: "boolean" }]
|
|
@@ -3374,7 +3378,7 @@ function registerSelect(loader) {
|
|
|
3374
3378
|
},
|
|
3375
3379
|
"aria-label": {
|
|
3376
3380
|
type: "string",
|
|
3377
|
-
displayName: "
|
|
3381
|
+
displayName: "ARIA label",
|
|
3378
3382
|
description: "Label for this input, if no visible label is used",
|
|
3379
3383
|
advanced: true
|
|
3380
3384
|
}
|
|
@@ -3387,7 +3391,8 @@ function registerSelect(loader) {
|
|
|
3387
3391
|
variableType: "text"
|
|
3388
3392
|
},
|
|
3389
3393
|
isOpen: {
|
|
3390
|
-
type: "
|
|
3394
|
+
type: "writable",
|
|
3395
|
+
valueProp: "isOpen",
|
|
3391
3396
|
onChangeProp: "onOpenChange",
|
|
3392
3397
|
variableType: "boolean"
|
|
3393
3398
|
}
|
|
@@ -4008,8 +4013,9 @@ function registerSlider(loader, overrides) {
|
|
|
4008
4013
|
value: {
|
|
4009
4014
|
type: "number",
|
|
4010
4015
|
editOnly: true,
|
|
4016
|
+
displayName: "Initial value",
|
|
4011
4017
|
uncontrolledProp: "defaultValue",
|
|
4012
|
-
description: "The
|
|
4018
|
+
description: "The initial value of the slider",
|
|
4013
4019
|
defaultValueHint: 0,
|
|
4014
4020
|
defaultValue: 0
|
|
4015
4021
|
},
|