widenarrow-ui 1.1.59 → 1.1.61

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.
@@ -7,7 +7,7 @@ export interface CheckboxProps {
7
7
  onChange?: (val: string, event: ChangeEvent<HTMLInputElement> | KeyboardEvent<HTMLInputElement>) => void;
8
8
  onFocusCallback?: (event: FocusEvent<HTMLInputElement>) => void;
9
9
  onBlurCallback?: (event: FocusEvent<HTMLInputElement>) => void;
10
- onChangeFake?: (val: string, event: MouseEvent<HTMLDivElement>) => void;
10
+ onChangeFake?: (val: string, event: MouseEvent<HTMLSpanElement>) => void;
11
11
  className?: string;
12
12
  ariaLabel?: string;
13
13
  ref?: RefObject<HTMLInputElement>;
@@ -26,7 +26,7 @@ export interface InputProps {
26
26
  withLabel?: boolean;
27
27
  marginBottom?: boolean;
28
28
  placeholder?: string;
29
- ref?: RefObject<HTMLInputElement>;
29
+ inputRef?: RefObject<HTMLInputElement>;
30
30
  size?: SizeTypes.SMALL | SizeTypes.MEDIUM | SizeTypes.LARGE;
31
31
  helperText?: string;
32
32
  characterLimit?: number;
@@ -19,7 +19,7 @@ export interface TextAreaInputProps {
19
19
  disabled?: boolean;
20
20
  marginBottom?: boolean;
21
21
  autoFocus?: boolean;
22
- ref?: RefObject<HTMLTextAreaElement>;
22
+ inputRef?: RefObject<HTMLTextAreaElement>;
23
23
  style?: CSSProperties;
24
24
  readonly?: boolean;
25
25
  }
package/lib/index.d.ts CHANGED
@@ -441,7 +441,7 @@ interface CheckboxProps {
441
441
  onChange?: (val: string, event: ChangeEvent<HTMLInputElement> | KeyboardEvent<HTMLInputElement>) => void;
442
442
  onFocusCallback?: (event: FocusEvent<HTMLInputElement>) => void;
443
443
  onBlurCallback?: (event: FocusEvent<HTMLInputElement>) => void;
444
- onChangeFake?: (val: string, event: MouseEvent<HTMLDivElement>) => void;
444
+ onChangeFake?: (val: string, event: MouseEvent<HTMLSpanElement>) => void;
445
445
  className?: string;
446
446
  ariaLabel?: string;
447
447
  ref?: RefObject<HTMLInputElement>;
@@ -736,7 +736,7 @@ interface InputProps {
736
736
  withLabel?: boolean;
737
737
  marginBottom?: boolean;
738
738
  placeholder?: string;
739
- ref?: RefObject<HTMLInputElement>;
739
+ inputRef?: RefObject<HTMLInputElement>;
740
740
  size?: SizeTypes.SMALL | SizeTypes.MEDIUM | SizeTypes.LARGE;
741
741
  helperText?: string;
742
742
  characterLimit?: number;
@@ -823,7 +823,7 @@ interface TextAreaInputProps {
823
823
  disabled?: boolean;
824
824
  marginBottom?: boolean;
825
825
  autoFocus?: boolean;
826
- ref?: RefObject<HTMLTextAreaElement>;
826
+ inputRef?: RefObject<HTMLTextAreaElement>;
827
827
  style?: CSSProperties;
828
828
  readonly?: boolean;
829
829
  }
package/lib/index.esm.js CHANGED
@@ -2358,6 +2358,7 @@ var styles$m = {"body":"Checkbox-module_et5-hi","container":"Checkbox-module_pUY
2358
2358
 
2359
2359
  var s$m = classNames.bind(styles$m);
2360
2360
  var Checkbox = function (_a) {
2361
+ // TODO. There is an issue right now when switching between real and fake checkbox. The state is not updated correctly.
2361
2362
  var _b, _c;
2362
2363
  var value = _a.value, className = _a.className, label = _a.label, id = _a.id, name = _a.name, ref = _a.ref, _d = _a.withLabel, withLabel = _d === void 0 ? true : _d, helperText = _a.helperText, onChange = _a.onChange, onFocusCallback = _a.onFocusCallback, onBlurCallback = _a.onBlurCallback, onChangeFake = _a.onChangeFake, withEllipsis = _a.withEllipsis, checked = _a.checked, blocked = _a.blocked, indeterminate = _a.indeterminate, disabled = _a.disabled, autoFocus = _a.autoFocus, isFake = _a.isFake, ariaLabel = _a.ariaLabel;
2363
2364
  var htmlId = useMemo(function () { return id || shortUid(); }, []);
@@ -2402,7 +2403,7 @@ var Checkbox = function (_a) {
2402
2403
  box_disabledAndChecked: disabled && checked
2403
2404
  }), role: 'button', onClick: onClickFakeInput, tabIndex: 0, "aria-label": ariaLabel || label, children: checked ? jsx(Icon, { icon: IconTypes.CHECK, className: s$m('icon') }) : null })) : (jsxs(Fragment, { children: [jsx("input", __assign({ className: s$m('input', {
2404
2405
  input_disabled: disabled
2405
- }), type: 'checkbox', onChange: onClickRealInput, onKeyDown: function (event) {
2406
+ }), type: 'checkbox', onKeyDown: function (event) {
2406
2407
  if (event.key === 'Enter' && onChange) {
2407
2408
  onChange(value || '', event);
2408
2409
  }
@@ -3087,7 +3088,7 @@ var styles$9 = {"body":"Input-module_cNvink","container":"Input-module_itXJpS","
3087
3088
  var s$9 = classNames.bind(styles$9);
3088
3089
  var Input = function (_a) {
3089
3090
  var _b, _c, _d;
3090
- var _e = _a.placeholder, placeholder = _e === void 0 ? '' : _e, _f = _a.autoComplete, autoComplete = _f === void 0 ? 'off' : _f, _g = _a.size, size = _g === void 0 ? SizeTypes.MEDIUM : _g, _h = _a.type, type = _h === void 0 ? 'text' : _h, autoFocus = _a.autoFocus, _j = _a.withLabel, withLabel = _j === void 0 ? true : _j, characterLimit = _a.characterLimit, id = _a.id, ariaLabel = _a.ariaLabel, name = _a.name, ref = _a.ref, className = _a.className, disabled = _a.disabled, readOnly = _a.readOnly, error = _a.error, iconClassName = _a.iconClassName, inputClassName = _a.inputClassName, iconLeft = _a.iconLeft, iconRight = _a.iconRight, label = _a.label, marginBottom = _a.marginBottom, onBlur = _a.onBlur, onChange = _a.onChange, onEnter = _a.onEnter, onKeyDown = _a.onKeyDown, onFocus = _a.onFocus, helperText = _a.helperText, required = _a.required, value = _a.value;
3091
+ var _e = _a.placeholder, placeholder = _e === void 0 ? '' : _e, _f = _a.autoComplete, autoComplete = _f === void 0 ? 'off' : _f, _g = _a.size, size = _g === void 0 ? SizeTypes.MEDIUM : _g, _h = _a.type, type = _h === void 0 ? 'text' : _h, autoFocus = _a.autoFocus, _j = _a.withLabel, withLabel = _j === void 0 ? true : _j, characterLimit = _a.characterLimit, id = _a.id, ariaLabel = _a.ariaLabel, name = _a.name, inputRef = _a.inputRef, className = _a.className, disabled = _a.disabled, readOnly = _a.readOnly, error = _a.error, iconClassName = _a.iconClassName, inputClassName = _a.inputClassName, iconLeft = _a.iconLeft, iconRight = _a.iconRight, label = _a.label, marginBottom = _a.marginBottom, onBlur = _a.onBlur, onChange = _a.onChange, onEnter = _a.onEnter, onKeyDown = _a.onKeyDown, onFocus = _a.onFocus, helperText = _a.helperText, required = _a.required, value = _a.value;
3091
3092
  var _k = useState(false), isFocused = _k[0], setFocus = _k[1];
3092
3093
  var htmlId = useMemo(function () { return id || shortUid(); }, []);
3093
3094
  var callbackRef = useCallback(function (inputElement) {
@@ -3134,7 +3135,7 @@ var Input = function (_a) {
3134
3135
  htmlFor: htmlId
3135
3136
  };
3136
3137
  var inputAttributes = (_b = {
3137
- ref: ref || callbackRef,
3138
+ ref: inputRef || callbackRef,
3138
3139
  type: type,
3139
3140
  id: htmlId,
3140
3141
  autoComplete: autoComplete,
@@ -3175,7 +3176,7 @@ var styles$8 = {"body":"TextAreaInput-module_hdGRr2","container":"TextAreaInput-
3175
3176
  var s$8 = classNames.bind(styles$8);
3176
3177
  var TextAreaInput = function (_a) {
3177
3178
  var _b, _c, _d;
3178
- var onChange = _a.onChange, rows = _a.rows, placeholder = _a.placeholder, value = _a.value, name = _a.name, autoFocus = _a.autoFocus, ariaLabel = _a.ariaLabel, inputClassName = _a.inputClassName, className = _a.className, disabled = _a.disabled, style = _a.style, label = _a.label, _e = _a.withLabel, withLabel = _e === void 0 ? true : _e, id = _a.id, marginBottom = _a.marginBottom, helperText = _a.helperText, ref = _a.ref, onEnter = _a.onEnter, onKeyDown = _a.onKeyDown, error = _a.error, readonly = _a.readonly;
3179
+ var onChange = _a.onChange, rows = _a.rows, placeholder = _a.placeholder, value = _a.value, name = _a.name, autoFocus = _a.autoFocus, ariaLabel = _a.ariaLabel, inputClassName = _a.inputClassName, className = _a.className, disabled = _a.disabled, style = _a.style, label = _a.label, _e = _a.withLabel, withLabel = _e === void 0 ? true : _e, id = _a.id, marginBottom = _a.marginBottom, helperText = _a.helperText, inputRef = _a.inputRef, onEnter = _a.onEnter, onKeyDown = _a.onKeyDown, error = _a.error, readonly = _a.readonly;
3179
3180
  var htmlId = useMemo(function () { return id || shortUid(); }, []);
3180
3181
  var callbackRef = useCallback(function (inputElement) {
3181
3182
  if (inputElement && autoFocus) {
@@ -3206,7 +3207,7 @@ var TextAreaInput = function (_a) {
3206
3207
  readonly: readonly,
3207
3208
  id: htmlId,
3208
3209
  name: name,
3209
- ref: ref || callbackRef
3210
+ ref: inputRef || callbackRef
3210
3211
  },
3211
3212
  _b['aria-label'] = ariaLabel || placeholder,
3212
3213
  _b.style = style,