@plasmicpkgs/react-aria 0.0.84 → 0.0.85

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.
Files changed (40) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/react-aria.esm.js +119 -116
  3. package/dist/react-aria.esm.js.map +1 -1
  4. package/dist/react-aria.js +118 -115
  5. package/dist/react-aria.js.map +1 -1
  6. package/dist/registerInput.d.ts +3 -2
  7. package/dist/registerListBox.d.ts +5 -1
  8. package/dist/registerSelect.d.ts +1 -1
  9. package/dist/registerTextArea.d.ts +3 -2
  10. package/package.json +2 -2
  11. package/skinny/registerComboBox.cjs.js +19 -24
  12. package/skinny/registerComboBox.cjs.js.map +1 -1
  13. package/skinny/registerComboBox.esm.js +20 -25
  14. package/skinny/registerComboBox.esm.js.map +1 -1
  15. package/skinny/registerInput.cjs.js +26 -43
  16. package/skinny/registerInput.cjs.js.map +1 -1
  17. package/skinny/registerInput.d.ts +3 -2
  18. package/skinny/registerInput.esm.js +27 -44
  19. package/skinny/registerInput.esm.js.map +1 -1
  20. package/skinny/{registerListBox-b47231d8.cjs.js → registerListBox-44088cfc.cjs.js} +23 -4
  21. package/skinny/registerListBox-44088cfc.cjs.js.map +1 -0
  22. package/skinny/{registerListBox-d5efc5da.esm.js → registerListBox-da15518f.esm.js} +24 -5
  23. package/skinny/registerListBox-da15518f.esm.js.map +1 -0
  24. package/skinny/registerListBox.cjs.js +2 -2
  25. package/skinny/registerListBox.d.ts +5 -1
  26. package/skinny/registerListBox.esm.js +2 -2
  27. package/skinny/registerSection.cjs.js +1 -1
  28. package/skinny/registerSection.esm.js +1 -1
  29. package/skinny/registerSelect.cjs.js +22 -8
  30. package/skinny/registerSelect.cjs.js.map +1 -1
  31. package/skinny/registerSelect.d.ts +1 -1
  32. package/skinny/registerSelect.esm.js +23 -9
  33. package/skinny/registerSelect.esm.js.map +1 -1
  34. package/skinny/registerTextArea.cjs.js +22 -29
  35. package/skinny/registerTextArea.cjs.js.map +1 -1
  36. package/skinny/registerTextArea.d.ts +3 -2
  37. package/skinny/registerTextArea.esm.js +23 -30
  38. package/skinny/registerTextArea.esm.js.map +1 -1
  39. package/skinny/registerListBox-b47231d8.cjs.js.map +0 -1
  40. package/skinny/registerListBox-d5efc5da.esm.js.map +0 -1
@@ -562,7 +562,7 @@ const BUTTON_VARIANTS = [
562
562
  "focusVisible",
563
563
  "disabled"
564
564
  ];
565
- const { variants: variants$f, withObservedValues: withObservedValues$d } = pickAriaComponentVariants(BUTTON_VARIANTS);
565
+ const { variants: variants$g, withObservedValues: withObservedValues$d } = pickAriaComponentVariants(BUTTON_VARIANTS);
566
566
  const BaseButton = React__default.default.forwardRef(function BaseButtonInner(props, ref) {
567
567
  const _a = props, { submitsForm, resetsForm, children, plasmicUpdateVariant } = _a, rest = __objRest$m(_a, ["submitsForm", "resetsForm", "children", "plasmicUpdateVariant"]);
568
568
  const type = submitsForm ? "submit" : resetsForm ? "reset" : "button";
@@ -592,7 +592,7 @@ function registerButton(loader, overrides) {
592
592
  displayName: "Aria Button",
593
593
  importPath: "@plasmicpkgs/react-aria/skinny/registerButton",
594
594
  importName: "BaseButton",
595
- variants: variants$f,
595
+ variants: variants$g,
596
596
  defaultStyles: {
597
597
  borderWidth: "1px",
598
598
  borderStyle: "solid",
@@ -697,7 +697,7 @@ const CHECKBOX_VARIANTS = [
697
697
  "readonly",
698
698
  "selected"
699
699
  ];
700
- const { variants: variants$e, withObservedValues: withObservedValues$c } = pickAriaComponentVariants(CHECKBOX_VARIANTS);
700
+ const { variants: variants$f, withObservedValues: withObservedValues$c } = pickAriaComponentVariants(CHECKBOX_VARIANTS);
701
701
  function BaseCheckbox(props) {
702
702
  const _a = props, { children, plasmicUpdateVariant, setControlContextData } = _a, rest = __objRest$l(_a, ["children", "plasmicUpdateVariant", "setControlContextData"]);
703
703
  const contextProps = React__default.default.useContext(PlasmicCheckboxGroupContext);
@@ -784,7 +784,7 @@ function registerCheckbox(loader, overrides) {
784
784
  displayName: "Aria Checkbox",
785
785
  importPath: "@plasmicpkgs/react-aria/skinny/registerCheckbox",
786
786
  importName: "BaseCheckbox",
787
- variants: variants$e,
787
+ variants: variants$f,
788
788
  props: __spreadProps$e(__spreadValues$o({}, getCommonProps("checkbox", [
789
789
  "name",
790
790
  "isDisabled",
@@ -1050,7 +1050,7 @@ var __objRest$i = (source, exclude) => {
1050
1050
  return target;
1051
1051
  };
1052
1052
  const CHECKBOX_GROUP_VARIANTS = ["disabled", "readonly"];
1053
- const { variants: variants$d, withObservedValues: withObservedValues$b } = pickAriaComponentVariants(
1053
+ const { variants: variants$e, withObservedValues: withObservedValues$b } = pickAriaComponentVariants(
1054
1054
  CHECKBOX_GROUP_VARIANTS
1055
1055
  );
1056
1056
  function BaseCheckboxGroup(props) {
@@ -1078,7 +1078,7 @@ function registerCheckboxGroup(loader, overrides) {
1078
1078
  displayName: "Aria Checkbox Group",
1079
1079
  importPath: "@plasmicpkgs/react-aria/skinny/registerCheckboxGroup",
1080
1080
  importName: "BaseCheckboxGroup",
1081
- variants: variants$d,
1081
+ variants: variants$e,
1082
1082
  props: __spreadProps$a(__spreadValues$k({}, getCommonProps("checkbox group", [
1083
1083
  "name",
1084
1084
  "isDisabled",
@@ -1274,10 +1274,11 @@ var __objRest$h = (source, exclude) => {
1274
1274
  };
1275
1275
  const INPUT_VARIANTS = [
1276
1276
  "focused",
1277
+ "focusVisible",
1277
1278
  "hovered",
1278
1279
  "disabled"
1279
1280
  ];
1280
- const { variants: variants$c } = pickAriaComponentVariants(INPUT_VARIANTS);
1281
+ const { variants: variants$d } = pickAriaComponentVariants(INPUT_VARIANTS);
1281
1282
  const inputHelpers$1 = {
1282
1283
  states: {
1283
1284
  value: {
@@ -1288,65 +1289,47 @@ const inputHelpers$1 = {
1288
1289
  }
1289
1290
  };
1290
1291
  function BaseInput(props) {
1291
- var _b;
1292
1292
  const _a = props, {
1293
1293
  plasmicUpdateVariant,
1294
1294
  setControlContextData,
1295
- disabled,
1296
1295
  autoComplete,
1297
- value
1296
+ value,
1297
+ className
1298
1298
  } = _a, rest = __objRest$h(_a, [
1299
1299
  "plasmicUpdateVariant",
1300
1300
  "setControlContextData",
1301
- "disabled",
1302
1301
  "autoComplete",
1303
- "value"
1302
+ "value",
1303
+ "className"
1304
1304
  ]);
1305
1305
  const textFieldContext = React__default.default.useContext(PlasmicTextFieldContext);
1306
1306
  const context = React__default.default.useContext(PlasmicInputContext);
1307
1307
  setControlContextData == null ? void 0 : setControlContextData({
1308
1308
  parent: textFieldContext
1309
1309
  });
1310
- const mergedProps = reactAria.mergeProps(
1311
- rest,
1312
- {
1313
- value: (context == null ? void 0 : context.isUncontrolled) ? void 0 : value
1310
+ const classNameProp = React.useCallback(
1311
+ ({
1312
+ isDisabled,
1313
+ isFocusVisible,
1314
+ isFocused,
1315
+ isHovered
1316
+ }) => {
1317
+ plasmicUpdateVariant == null ? void 0 : plasmicUpdateVariant({
1318
+ disabled: isDisabled,
1319
+ focused: isFocused,
1320
+ focusVisible: isFocusVisible,
1321
+ hovered: isHovered
1322
+ });
1323
+ return className != null ? className : "";
1314
1324
  },
1315
- {
1316
- /**
1317
- * While react-aria internally does the merging of the disabled prop,
1318
- * we need to explicity do it here, because react-aria does it behind the scenes,
1319
- * whereas we need the calculated value of the disabled prop to be able to update the "disabled" CC variant.
1320
- * */
1321
- disabled: (_b = textFieldContext == null ? void 0 : textFieldContext.isDisabled) != null ? _b : disabled
1322
- }
1323
- );
1324
- React.useEffect(() => {
1325
- plasmicUpdateVariant == null ? void 0 : plasmicUpdateVariant({
1326
- disabled: mergedProps.disabled
1327
- });
1328
- }, [mergedProps.disabled, plasmicUpdateVariant]);
1329
- return /* @__PURE__ */ React__default.default.createElement(
1330
- reactAriaComponents.Input,
1331
- __spreadValues$j({
1332
- autoComplete: resolveAutoComplete(autoComplete),
1333
- onHoverChange: (isHovered) => {
1334
- plasmicUpdateVariant == null ? void 0 : plasmicUpdateVariant({
1335
- hovered: isHovered
1336
- });
1337
- },
1338
- onFocus: () => {
1339
- plasmicUpdateVariant == null ? void 0 : plasmicUpdateVariant({
1340
- focused: true
1341
- });
1342
- },
1343
- onBlur: () => {
1344
- plasmicUpdateVariant == null ? void 0 : plasmicUpdateVariant({
1345
- focused: false
1346
- });
1347
- }
1348
- }, mergedProps)
1325
+ [className, plasmicUpdateVariant]
1349
1326
  );
1327
+ const mergedProps = reactAria.mergeProps(rest, {
1328
+ value: (context == null ? void 0 : context.isUncontrolled) ? void 0 : value,
1329
+ autoComplete: resolveAutoComplete(autoComplete),
1330
+ className: classNameProp
1331
+ });
1332
+ return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Input, __spreadValues$j({}, mergedProps));
1350
1333
  }
1351
1334
  const INPUT_COMPONENT_NAME = makeComponentName("input");
1352
1335
  function registerInput(loader, overrides) {
@@ -1358,7 +1341,7 @@ function registerInput(loader, overrides) {
1358
1341
  displayName: "Aria Input",
1359
1342
  importPath: "@plasmicpkgs/react-aria/skinny/registerInput",
1360
1343
  importName: "BaseInput",
1361
- variants: variants$c,
1344
+ variants: variants$d,
1362
1345
  defaultStyles: {
1363
1346
  width: "300px",
1364
1347
  borderWidth: "1px",
@@ -1450,7 +1433,7 @@ const LIST_BOX_ITEM_VARIANTS = [
1450
1433
  "selected",
1451
1434
  "disabled"
1452
1435
  ];
1453
- const { variants: variants$b, withObservedValues: withObservedValues$a } = pickAriaComponentVariants(
1436
+ const { variants: variants$c, withObservedValues: withObservedValues$a } = pickAriaComponentVariants(
1454
1437
  LIST_BOX_ITEM_VARIANTS
1455
1438
  );
1456
1439
  function BaseListBoxItem(props) {
@@ -1556,7 +1539,7 @@ function registerListBoxItem(loader, overrides) {
1556
1539
  displayName: "Aria ListBoxItem",
1557
1540
  importPath: "@plasmicpkgs/react-aria/skinny/registerListBoxItem",
1558
1541
  importName: "BaseListBoxItem",
1559
- variants: variants$b,
1542
+ variants: variants$c,
1560
1543
  props: {
1561
1544
  id: {
1562
1545
  type: "string",
@@ -1692,6 +1675,8 @@ var __objRest$e = (source, exclude) => {
1692
1675
  }
1693
1676
  return target;
1694
1677
  };
1678
+ const LISTBOX_VARIANTS = ["focused", "focusVisible"];
1679
+ const { variants: variants$b } = pickAriaComponentVariants(LISTBOX_VARIANTS);
1695
1680
  const listboxHelpers = {
1696
1681
  states: {
1697
1682
  selectedValue: {
@@ -1708,13 +1693,17 @@ function BaseListBox(props) {
1708
1693
  const _a = props, {
1709
1694
  setControlContextData,
1710
1695
  children,
1696
+ className,
1711
1697
  selectedKeys,
1712
- defaultSelectedKeys
1698
+ defaultSelectedKeys,
1699
+ plasmicUpdateVariant
1713
1700
  } = _a, rest = __objRest$e(_a, [
1714
1701
  "setControlContextData",
1715
1702
  "children",
1703
+ "className",
1716
1704
  "selectedKeys",
1717
- "defaultSelectedKeys"
1705
+ "defaultSelectedKeys",
1706
+ "plasmicUpdateVariant"
1718
1707
  ]);
1719
1708
  const context = React__default.default.useContext(PlasmicListBoxContext);
1720
1709
  const isStandalone = !context;
@@ -1737,11 +1726,22 @@ function BaseListBox(props) {
1737
1726
  setIds(_ids);
1738
1727
  });
1739
1728
  }, []);
1729
+ const classNameProp = React.useCallback(
1730
+ ({ isFocusVisible, isFocused }) => {
1731
+ plasmicUpdateVariant == null ? void 0 : plasmicUpdateVariant({
1732
+ focused: isFocused,
1733
+ focusVisible: isFocusVisible
1734
+ });
1735
+ return className != null ? className : "";
1736
+ },
1737
+ [className, plasmicUpdateVariant]
1738
+ );
1740
1739
  const listbox = /* @__PURE__ */ React__default.default.createElement(
1741
1740
  reactAriaComponents.ListBox,
1742
1741
  __spreadValues$g({
1743
1742
  selectedKeys: normalizeSelectedKeys(selectedKeys),
1744
- defaultSelectedKeys: normalizeSelectedKeys(defaultSelectedKeys)
1743
+ defaultSelectedKeys: normalizeSelectedKeys(defaultSelectedKeys),
1744
+ className: classNameProp
1745
1745
  }, rest),
1746
1746
  children
1747
1747
  );
@@ -1823,6 +1823,7 @@ function registerListBox(loader, overrides) {
1823
1823
  displayName: "Aria ListBox",
1824
1824
  importPath: "@plasmicpkgs/react-aria/skinny/registerListBox",
1825
1825
  importName: "BaseListBox",
1826
+ variants: variants$b,
1826
1827
  defaultStyles: {
1827
1828
  width: "250px",
1828
1829
  borderWidth: "1px",
@@ -2167,16 +2168,23 @@ function BaseComboBox(props) {
2167
2168
  setControlContextData,
2168
2169
  plasmicUpdateVariant,
2169
2170
  className,
2170
- isDisabled,
2171
2171
  isOpen: _isOpen
2172
2172
  } = _a, rest = __objRest$c(_a, [
2173
2173
  "children",
2174
2174
  "setControlContextData",
2175
2175
  "plasmicUpdateVariant",
2176
2176
  "className",
2177
- "isDisabled",
2178
2177
  "isOpen"
2179
2178
  ]);
2179
+ const classNameProp = React.useCallback(
2180
+ ({ isDisabled }) => {
2181
+ plasmicUpdateVariant == null ? void 0 : plasmicUpdateVariant({
2182
+ disabled: isDisabled
2183
+ });
2184
+ return className != null ? className : "";
2185
+ },
2186
+ [className, plasmicUpdateVariant]
2187
+ );
2180
2188
  const idManager = React.useMemo(() => new ListBoxItemIdManager(), []);
2181
2189
  React.useEffect(() => {
2182
2190
  idManager.subscribe((ids) => {
@@ -2185,27 +2193,15 @@ function BaseComboBox(props) {
2185
2193
  });
2186
2194
  });
2187
2195
  }, []);
2188
- React.useEffect(() => {
2189
- plasmicUpdateVariant == null ? void 0 : plasmicUpdateVariant({
2190
- disabled: isDisabled
2191
- });
2192
- }, [isDisabled, plasmicUpdateVariant]);
2193
- return /* @__PURE__ */ React__default.default.createElement(
2194
- reactAriaComponents.ComboBox,
2195
- __spreadValues$e({
2196
- isDisabled,
2197
- className
2198
- }, rest),
2199
- /* @__PURE__ */ React__default.default.createElement(PlasmicPopoverTriggerContext.Provider, { value: true }, /* @__PURE__ */ React__default.default.createElement(
2200
- PlasmicListBoxContext.Provider,
2201
- {
2202
- value: {
2203
- idManager
2204
- }
2205
- },
2206
- /* @__PURE__ */ React__default.default.createElement(PlasmicInputContext.Provider, { value: { isUncontrolled: true } }, /* @__PURE__ */ React__default.default.createElement(ComboboxAutoOpen, __spreadValues$e({}, props)), children)
2207
- ))
2208
- );
2196
+ return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.ComboBox, __spreadValues$e({ className: classNameProp }, rest), /* @__PURE__ */ React__default.default.createElement(PlasmicPopoverTriggerContext.Provider, { value: true }, /* @__PURE__ */ React__default.default.createElement(
2197
+ PlasmicListBoxContext.Provider,
2198
+ {
2199
+ value: {
2200
+ idManager
2201
+ }
2202
+ },
2203
+ /* @__PURE__ */ React__default.default.createElement(PlasmicInputContext.Provider, { value: { isUncontrolled: true } }, /* @__PURE__ */ React__default.default.createElement(ComboboxAutoOpen, __spreadValues$e({}, props)), children)
2204
+ )));
2209
2205
  }
2210
2206
  function registerComboBox(loader) {
2211
2207
  registerComponentHelper(loader, BaseComboBox, {
@@ -3076,7 +3072,11 @@ const BaseSelectValue = (props) => {
3076
3072
  return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.SelectValue, { className }, ({ isPlaceholder, selectedText }) => /* @__PURE__ */ React__default.default.createElement(React__default.default.Fragment, null, isPlaceholder ? placeholder : selectedText));
3077
3073
  };
3078
3074
  const SELECT_NAME = makeComponentName("select");
3079
- const SELECT_VARIANTS = ["disabled"];
3075
+ const SELECT_VARIANTS = [
3076
+ "focused",
3077
+ "focusVisible",
3078
+ "disabled"
3079
+ ];
3080
3080
  const { variants: SELECT_VARIANTS_DATA } = pickAriaComponentVariants(SELECT_VARIANTS);
3081
3081
  function BaseSelect(props) {
3082
3082
  const {
@@ -3101,11 +3101,21 @@ function BaseSelect(props) {
3101
3101
  });
3102
3102
  });
3103
3103
  }, []);
3104
- React.useEffect(() => {
3105
- plasmicUpdateVariant == null ? void 0 : plasmicUpdateVariant({
3106
- disabled: isDisabled
3107
- });
3108
- }, [isDisabled, plasmicUpdateVariant]);
3104
+ const classNameProp = React.useCallback(
3105
+ ({
3106
+ isDisabled: isDisabled2,
3107
+ isFocusVisible,
3108
+ isFocused
3109
+ }) => {
3110
+ plasmicUpdateVariant == null ? void 0 : plasmicUpdateVariant({
3111
+ disabled: isDisabled2,
3112
+ focused: isFocused,
3113
+ focusVisible: isFocusVisible
3114
+ });
3115
+ return className != null ? className : "";
3116
+ },
3117
+ [className, plasmicUpdateVariant]
3118
+ );
3109
3119
  return /* @__PURE__ */ React__default.default.createElement(
3110
3120
  reactAriaComponents.Select,
3111
3121
  __spreadValues$8({
@@ -3113,7 +3123,7 @@ function BaseSelect(props) {
3113
3123
  onSelectionChange,
3114
3124
  onOpenChange,
3115
3125
  isDisabled,
3116
- className,
3126
+ className: classNameProp,
3117
3127
  style,
3118
3128
  name,
3119
3129
  disabledKeys,
@@ -4193,6 +4203,7 @@ var __objRest$1 = (source, exclude) => {
4193
4203
  };
4194
4204
  const TEXTAREA_VARIANTS = [
4195
4205
  "focused",
4206
+ "focusVisible",
4196
4207
  "hovered",
4197
4208
  "disabled"
4198
4209
  ];
@@ -4207,40 +4218,32 @@ const inputHelpers = {
4207
4218
  }
4208
4219
  };
4209
4220
  function BaseTextArea(props) {
4210
- var _b;
4211
- const _a = props, { disabled, plasmicUpdateVariant, setControlContextData } = _a, rest = __objRest$1(_a, ["disabled", "plasmicUpdateVariant", "setControlContextData"]);
4221
+ const _a = props, { className, plasmicUpdateVariant, setControlContextData } = _a, rest = __objRest$1(_a, ["className", "plasmicUpdateVariant", "setControlContextData"]);
4212
4222
  const textFieldContext = React__default.default.useContext(PlasmicTextFieldContext);
4213
- const mergedProps = reactAria.mergeProps(rest, {
4214
- disabled: (_b = textFieldContext == null ? void 0 : textFieldContext.isDisabled) != null ? _b : disabled
4215
- });
4216
- React.useEffect(() => {
4217
- plasmicUpdateVariant == null ? void 0 : plasmicUpdateVariant({
4218
- disabled: mergedProps.disabled
4219
- });
4220
- }, [mergedProps.disabled, plasmicUpdateVariant]);
4221
4223
  setControlContextData == null ? void 0 : setControlContextData({
4222
4224
  parent: textFieldContext
4223
4225
  });
4224
- return /* @__PURE__ */ React__default.default.createElement(
4225
- reactAriaComponents.TextArea,
4226
- __spreadValues$2({
4227
- onFocus: () => {
4228
- plasmicUpdateVariant == null ? void 0 : plasmicUpdateVariant({
4229
- focused: true
4230
- });
4231
- },
4232
- onBlur: () => {
4233
- plasmicUpdateVariant == null ? void 0 : plasmicUpdateVariant({
4234
- focused: false
4235
- });
4236
- },
4237
- onHoverChange: (isHovered) => {
4238
- plasmicUpdateVariant == null ? void 0 : plasmicUpdateVariant({
4239
- hovered: isHovered
4240
- });
4241
- }
4242
- }, mergedProps)
4226
+ const classNameProp = React.useCallback(
4227
+ ({
4228
+ isDisabled,
4229
+ isFocusVisible,
4230
+ isFocused,
4231
+ isHovered
4232
+ }) => {
4233
+ plasmicUpdateVariant == null ? void 0 : plasmicUpdateVariant({
4234
+ disabled: isDisabled,
4235
+ focused: isFocused,
4236
+ focusVisible: isFocusVisible,
4237
+ hovered: isHovered
4238
+ });
4239
+ return className != null ? className : "";
4240
+ },
4241
+ [className, plasmicUpdateVariant]
4243
4242
  );
4243
+ const mergedProps = reactAria.mergeProps(rest, {
4244
+ className: classNameProp
4245
+ });
4246
+ return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.TextArea, __spreadValues$2({}, mergedProps));
4244
4247
  }
4245
4248
  function registerTextArea(loader, overrides) {
4246
4249
  registerComponentHelper(