@mezzanine-ui/react 0.13.5 → 0.13.7

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/Input/Input.js CHANGED
@@ -38,15 +38,12 @@ const Input = forwardRef(function Input(props, ref) {
38
38
  value: valueProp,
39
39
  });
40
40
  const composedInputRef = useComposeRefs([inputRefProp, inputRef]);
41
- const maxLength = () => (tagsMode
42
- ? Math.min((inputProps === null || inputProps === void 0 ? void 0 : inputProps.maxLength) || 8, 8)
43
- : inputProps === null || inputProps === void 0 ? void 0 : inputProps.maxLength);
44
41
  const active = !!value;
45
42
  const mountInput = !tagsMode || !tagsReachedMax;
46
43
  return (jsxs(TextField, { ref: ref, active: active, className: cx(inputClasses.host, tagsMode && inputClasses.tagsMode, inputPosition === 'top' && inputClasses.tagsModeInputOnTop, className), clearable: clearable, disabled: disabled, error: error, fullWidth: fullWidth, onClear: tagsMode ? tagsModeOnClear : onClear, prefix: mountInput ? prefix : undefined, suffix: mountInput ? suffix : undefined, size: size, children: [tagsMode && (jsx("div", { className: selectClasses.triggerTags, children: tags.map((tag) => (jsx(Tag, { closable: true, disabled: disabled, size: size, onClose: (e) => {
47
44
  e.stopPropagation();
48
45
  tagsModeOnRemove(tag);
49
- }, children: tag }, tag))) })), mountInput && (jsx("input", { ...inputProps, "aria-disabled": disabled, "aria-multiline": false, "aria-readonly": readOnly, "aria-required": required, disabled: disabled, maxLength: maxLength(), onChange: tagsMode ? tagsModeOnChange : onChange, onKeyDown: tagsMode ? onKeyDown : inputProps === null || inputProps === void 0 ? void 0 : inputProps.onKeyDown, placeholder: placeholder, readOnly: readOnly, ref: composedInputRef, required: required, value: tagsMode ? undefined : value }))] }));
46
+ }, children: tag }, tag))) })), mountInput && (jsx("input", { ...inputProps, "aria-disabled": disabled, "aria-multiline": false, "aria-readonly": readOnly, "aria-required": required, disabled: disabled, onChange: tagsMode ? tagsModeOnChange : onChange, onKeyDown: tagsMode ? onKeyDown : inputProps === null || inputProps === void 0 ? void 0 : inputProps.onKeyDown, placeholder: placeholder, readOnly: readOnly, ref: composedInputRef, required: required, value: tagsMode ? undefined : value }))] }));
50
47
  });
51
48
  var Input$1 = Input;
52
49
 
@@ -1,9 +1,10 @@
1
1
  import { jsxs, jsx } from 'react/jsx-runtime';
2
- import { forwardRef, useContext, useMemo, useRef, useLayoutEffect, useState } from 'react';
2
+ import { forwardRef, useContext, useMemo, useRef, useState } from 'react';
3
3
  import { selectClasses } from '@mezzanine-ui/core/select';
4
4
  import { useComposeRefs } from '../hooks/useComposeRefs.js';
5
5
  import { useClickAway } from '../hooks/useClickAway.js';
6
6
  import SelectTrigger from './SelectTrigger.js';
7
+ import { useIsomorphicLayoutEffect } from '../hooks/useIsomorphicLayoutEffect.js';
7
8
  import { traverseTree } from '../Tree/traverseTree.js';
8
9
  import InputTriggerPopper from '../_internal/InputTriggerPopper/InputTriggerPopper.js';
9
10
  import Menu from '../Menu/Menu.js';
@@ -50,7 +51,7 @@ const TreeSelect = forwardRef((props, ref) => {
50
51
  const composedRef = useComposeRefs([ref, controlRef]);
51
52
  /** Make popper positioning dynamically by computing styles every time value prop changes */
52
53
  const controllerRef = useRef(null);
53
- useLayoutEffect(() => {
54
+ useIsomorphicLayoutEffect(() => {
54
55
  var _a, _b;
55
56
  (_b = (_a = controllerRef.current) === null || _a === void 0 ? void 0 : _a.forceUpdate) === null || _b === void 0 ? void 0 : _b.call(_a);
56
57
  }, [valueProp]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mezzanine-ui/react",
3
- "version": "0.13.5",
3
+ "version": "0.13.7",
4
4
  "description": "React components for mezzanine-ui",
5
5
  "author": "Mezzanine",
6
6
  "repository": {
@@ -31,9 +31,9 @@
31
31
  "react-dom": "^18.2.0"
32
32
  },
33
33
  "dependencies": {
34
- "@mezzanine-ui/core": "^0.13.5",
35
- "@mezzanine-ui/icons": "^0.13.5",
36
- "@mezzanine-ui/system": "^0.13.5",
34
+ "@mezzanine-ui/core": "^0.13.7",
35
+ "@mezzanine-ui/icons": "^0.13.7",
36
+ "@mezzanine-ui/system": "^0.13.7",
37
37
  "@popperjs/core": "^2.11.6",
38
38
  "@types/react-transition-group": "^4.4.5",
39
39
  "clsx": "^1.2.1",
@@ -1,5 +1,5 @@
1
1
  function getElement(elementGetter) {
2
- if (elementGetter) {
2
+ if (elementGetter && typeof window !== 'undefined') {
3
3
  if (elementGetter instanceof HTMLElement) {
4
4
  return elementGetter;
5
5
  }