widenarrow-ui 1.1.57 → 1.1.58

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.
@@ -13,6 +13,7 @@ export interface CheckboxProps {
13
13
  helperText?: string;
14
14
  checked?: boolean;
15
15
  blocked?: boolean;
16
+ autoFocus?: boolean;
16
17
  withEllipsis?: boolean;
17
18
  withLabel?: boolean;
18
19
  indeterminate?: boolean;
@@ -16,6 +16,7 @@ export interface IconButtonProps extends IconStyleInterface {
16
16
  iconColor?: Partial<ColorTypes>;
17
17
  href?: string;
18
18
  disabled?: boolean;
19
+ autoFocus?: boolean;
19
20
  tabIndex?: number;
20
21
  toolTip?: string;
21
22
  ariaLabel?: string;
@@ -24,5 +24,6 @@ export interface InlineButtonProps {
24
24
  disabled?: boolean | undefined;
25
25
  style?: CSSProperties;
26
26
  tabIndex?: number;
27
+ autoFocus?: boolean;
27
28
  toolTip?: string;
28
29
  }
@@ -10,6 +10,7 @@ export interface RadioButtonProps {
10
10
  disabled?: boolean;
11
11
  helperText?: string;
12
12
  withEllipsis?: boolean;
13
+ autoFocus?: boolean;
13
14
  checked: boolean;
14
15
  toolTip?: string;
15
16
  onChange: (val: string | number, event: ChangeEvent<HTMLInputElement> | KeyboardEvent<HTMLInputElement>) => void;
@@ -21,6 +21,7 @@ export interface SelectInputProps {
21
21
  helperText?: string;
22
22
  text?: string;
23
23
  marginBottom?: boolean;
24
+ autoFocus?: boolean;
24
25
  loading?: boolean;
25
26
  ariaLabel?: string;
26
27
  label?: string;
@@ -7,6 +7,7 @@ export interface SwitchButtonProps {
7
7
  withInlineLabel?: boolean;
8
8
  ariaLabel?: string;
9
9
  disabled?: boolean;
10
+ autoFocus?: boolean;
10
11
  alignCenter?: boolean;
11
12
  className?: string;
12
13
  marginBottom?: boolean;
package/lib/index.d.ts CHANGED
@@ -446,6 +446,7 @@ interface CheckboxProps {
446
446
  helperText?: string;
447
447
  checked?: boolean;
448
448
  blocked?: boolean;
449
+ autoFocus?: boolean;
449
450
  withEllipsis?: boolean;
450
451
  withLabel?: boolean;
451
452
  indeterminate?: boolean;
@@ -489,6 +490,7 @@ interface RadioButtonProps {
489
490
  disabled?: boolean;
490
491
  helperText?: string;
491
492
  withEllipsis?: boolean;
493
+ autoFocus?: boolean;
492
494
  checked: boolean;
493
495
  toolTip?: string;
494
496
  onChange: (val: string | number, event: ChangeEvent<HTMLInputElement> | KeyboardEvent<HTMLInputElement>) => void;
@@ -696,6 +698,7 @@ interface IconButtonProps extends IconStyleInterface {
696
698
  iconColor?: Partial<ColorTypes>;
697
699
  href?: string;
698
700
  disabled?: boolean;
701
+ autoFocus?: boolean;
699
702
  tabIndex?: number;
700
703
  toolTip?: string;
701
704
  ariaLabel?: string;
@@ -789,6 +792,7 @@ interface InlineButtonProps {
789
792
  disabled?: boolean | undefined;
790
793
  style?: CSSProperties;
791
794
  tabIndex?: number;
795
+ autoFocus?: boolean;
792
796
  toolTip?: string;
793
797
  }
794
798
 
@@ -974,6 +978,7 @@ interface SwitchButtonProps {
974
978
  withInlineLabel?: boolean;
975
979
  ariaLabel?: string;
976
980
  disabled?: boolean;
981
+ autoFocus?: boolean;
977
982
  alignCenter?: boolean;
978
983
  className?: string;
979
984
  marginBottom?: boolean;
@@ -1003,6 +1008,7 @@ interface SelectInputProps {
1003
1008
  helperText?: string;
1004
1009
  text?: string;
1005
1010
  marginBottom?: boolean;
1011
+ autoFocus?: boolean;
1006
1012
  loading?: boolean;
1007
1013
  ariaLabel?: string;
1008
1014
  label?: string;
package/lib/index.esm.js CHANGED
@@ -2358,7 +2358,7 @@ var styles$m = {"body":"Checkbox-module_et5-hi","container":"Checkbox-module_pUY
2358
2358
  var s$m = classNames.bind(styles$m);
2359
2359
  var Checkbox = function (_a) {
2360
2360
  var _b, _c;
2361
- var value = _a.value, className = _a.className, label = _a.label, id = _a.id, name = _a.name, _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, isFake = _a.isFake, ariaLabel = _a.ariaLabel;
2361
+ var value = _a.value, className = _a.className, label = _a.label, id = _a.id, name = _a.name, _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;
2362
2362
  var htmlId = useMemo(function () { return id || shortUid(); }, []);
2363
2363
  var onClickRealInput = function (event) {
2364
2364
  if (!disabled && onChange) {
@@ -2379,6 +2379,7 @@ var Checkbox = function (_a) {
2379
2379
  disabled: disabled,
2380
2380
  checked: checked,
2381
2381
  name: name,
2382
+ autoFocus: autoFocus,
2382
2383
  onChange: onClickRealInput,
2383
2384
  onFocus: onFocusCallback ? onFocusCallback : undefined,
2384
2385
  onBlur: onBlurCallback ? onBlurCallback : undefined
@@ -2499,7 +2500,7 @@ var styles$j = {"body":"RadioButton-module_sinlEa","container":"RadioButton-modu
2499
2500
  var s$j = classNames.bind(styles$j);
2500
2501
  var RadioButton = function (_a) {
2501
2502
  var _b;
2502
- var className = _a.className, label = _a.label, id = _a.id, name = _a.name, _c = _a.withLabel, withLabel = _c === void 0 ? true : _c, ariaLabel = _a.ariaLabel, onChange = _a.onChange, onFocusCallback = _a.onFocusCallback, onBlurCallback = _a.onBlurCallback, checked = _a.checked, value = _a.value, withEllipsis = _a.withEllipsis, disabled = _a.disabled, helperText = _a.helperText, toolTip = _a.toolTip;
2503
+ var className = _a.className, label = _a.label, id = _a.id, name = _a.name, _c = _a.withLabel, withLabel = _c === void 0 ? true : _c, ariaLabel = _a.ariaLabel, onChange = _a.onChange, onFocusCallback = _a.onFocusCallback, onBlurCallback = _a.onBlurCallback, checked = _a.checked, value = _a.value, autoFocus = _a.autoFocus, withEllipsis = _a.withEllipsis, disabled = _a.disabled, helperText = _a.helperText, toolTip = _a.toolTip;
2503
2504
  var onClick = function (event) {
2504
2505
  if (disabled) {
2505
2506
  return;
@@ -2521,6 +2522,7 @@ var RadioButton = function (_a) {
2521
2522
  onChange(value || '', event);
2522
2523
  }
2523
2524
  },
2525
+ autoFocus: autoFocus,
2524
2526
  onFocus: onFocusCallback ? onFocusCallback : undefined,
2525
2527
  onBlur: onBlurCallback ? onBlurCallback : undefined,
2526
2528
  name: name
@@ -2831,7 +2833,7 @@ var styles$f = {"body":"InlineButton-module_aw3KLt","container":"InlineButton-mo
2831
2833
  var s$f = classNames.bind(styles$f);
2832
2834
  var InlineButton = memo(function (_a) {
2833
2835
  var _b, _c;
2834
- var className = _a.className, id = _a.id, loading = _a.loading, ariaLabel = _a.ariaLabel, text = _a.text, style = _a.style, _d = _a.size, size = _d === void 0 ? SizeTypes.MEDIUM : _d, sizeMd = _a.sizeMd, sizeLg = _a.sizeLg, sizeXl = _a.sizeXl, _e = _a.type, type = _e === void 0 ? HierarchyTypes.PRIMARY : _e, textClassName = _a.textClassName, children = _a.children, icon = _a.icon, withIconRight = _a.withIconRight, iconSize = _a.iconSize, iconClassName = _a.iconClassName, tabIndex = _a.tabIndex, rotateIcon = _a.rotateIcon, rotateIconByDegree = _a.rotateIconByDegree, onClickCallback = _a.onClickCallback, withEllipsis = _a.withEllipsis, disabled = _a.disabled, toolTip = _a.toolTip;
2836
+ var className = _a.className, id = _a.id, loading = _a.loading, ariaLabel = _a.ariaLabel, text = _a.text, style = _a.style, _d = _a.size, size = _d === void 0 ? SizeTypes.MEDIUM : _d, sizeMd = _a.sizeMd, sizeLg = _a.sizeLg, sizeXl = _a.sizeXl, _e = _a.type, type = _e === void 0 ? HierarchyTypes.PRIMARY : _e, textClassName = _a.textClassName, children = _a.children, icon = _a.icon, withIconRight = _a.withIconRight, iconSize = _a.iconSize, autoFocus = _a.autoFocus, iconClassName = _a.iconClassName, tabIndex = _a.tabIndex, rotateIcon = _a.rotateIcon, rotateIconByDegree = _a.rotateIconByDegree, onClickCallback = _a.onClickCallback, withEllipsis = _a.withEllipsis, disabled = _a.disabled, toolTip = _a.toolTip;
2835
2837
  var mergedClassNames = s$f('container', (_b = {},
2836
2838
  _b["container_".concat(type)] = !!type,
2837
2839
  _b["container_sizeSm_".concat(size)] = !!size,
@@ -2859,6 +2861,7 @@ var InlineButton = memo(function (_a) {
2859
2861
  className: mergedClassNames,
2860
2862
  id: id,
2861
2863
  tabIndex: tabIndex,
2864
+ autoFocus: autoFocus,
2862
2865
  disabled: loading || disabled,
2863
2866
  onClick: !!onClickCallback && !loading ? onClickCallback : undefined
2864
2867
  },
@@ -3028,7 +3031,7 @@ var styles$a = {"body":"IconButton-module_DV09bK","container":"IconButton-module
3028
3031
  var s$a = classNames.bind(styles$a);
3029
3032
  var IconButton = memo(function (_a) {
3030
3033
  var _b, _c;
3031
- var className = _a.className, disabled = _a.disabled, style = _a.style, icon = _a.icon, id = _a.id, text = _a.text, _d = _a.size, size = _d === void 0 ? SizeTypes.MEDIUM : _d, _e = _a.type, type = _e === void 0 ? HierarchyTypes.SECONDARY : _e, href = _a.href, iconColor = _a.iconColor, iconSize = _a.iconSize, iconClassName = _a.iconClassName, onClickCallback = _a.onClickCallback, rotateIcon = _a.rotateIcon, tabIndex = _a.tabIndex, rotateIconByDegree = _a.rotateIconByDegree, toolTip = _a.toolTip, ariaLabel = _a.ariaLabel;
3034
+ var className = _a.className, disabled = _a.disabled, style = _a.style, icon = _a.icon, id = _a.id, text = _a.text, _d = _a.size, size = _d === void 0 ? SizeTypes.MEDIUM : _d, _e = _a.type, type = _e === void 0 ? HierarchyTypes.SECONDARY : _e, href = _a.href, iconColor = _a.iconColor, iconSize = _a.iconSize, iconClassName = _a.iconClassName, onClickCallback = _a.onClickCallback, rotateIcon = _a.rotateIcon, tabIndex = _a.tabIndex, autoFocus = _a.autoFocus, rotateIconByDegree = _a.rotateIconByDegree, toolTip = _a.toolTip, ariaLabel = _a.ariaLabel;
3032
3035
  var mergedClassNames = s$a('container', (_b = {},
3033
3036
  _b["container_".concat(size)] = size,
3034
3037
  _b["container_".concat(type)] = type,
@@ -3058,6 +3061,7 @@ var IconButton = memo(function (_a) {
3058
3061
  _c.style = style,
3059
3062
  _c.href = href,
3060
3063
  _c.tabIndex = tabIndex,
3064
+ _c.autoFocus = autoFocus,
3061
3065
  _c.target = href ? '_blank' : undefined,
3062
3066
  _c.rel = href ? 'noopener noreferrer' : undefined,
3063
3067
  _c);
@@ -3078,8 +3082,8 @@ var styles$9 = {"body":"Input-module_cNvink","container":"Input-module_itXJpS","
3078
3082
  var s$9 = classNames.bind(styles$9);
3079
3083
  var Input = function (_a) {
3080
3084
  var _b, _c, _d;
3081
- 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, _j = _a.autoFocus, autoFocus = _j === void 0 ? false : _j, _k = _a.withLabel, withLabel = _k === void 0 ? true : _k, 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;
3082
- var _l = useState(false), isFocused = _l[0], setFocus = _l[1];
3085
+ 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;
3086
+ var _k = useState(false), isFocused = _k[0], setFocus = _k[1];
3083
3087
  var htmlId = useMemo(function () { return id || shortUid(); }, []);
3084
3088
  var callbackRef = useCallback(function (inputElement) {
3085
3089
  if (inputElement && autoFocus) {
@@ -3449,7 +3453,7 @@ var styles$2 = {"body":"SwitchButton-module_BSiKOl","container":"SwitchButton-mo
3449
3453
  var s$2 = classNames.bind(styles$2);
3450
3454
  var SwitchButton = function (_a) {
3451
3455
  var _b, _c;
3452
- var className = _a.className, onClickCallback = _a.onClickCallback, checked = _a.checked, disabled = _a.disabled, label = _a.label, id = _a.id, name = _a.name, ariaLabel = _a.ariaLabel, withInlineLabel = _a.withInlineLabel, withLabel = _a.withLabel, alignCenter = _a.alignCenter, marginBottom = _a.marginBottom;
3456
+ var className = _a.className, onClickCallback = _a.onClickCallback, checked = _a.checked, disabled = _a.disabled, label = _a.label, id = _a.id, name = _a.name, autoFocus = _a.autoFocus, ariaLabel = _a.ariaLabel, withInlineLabel = _a.withInlineLabel, withLabel = _a.withLabel, alignCenter = _a.alignCenter, marginBottom = _a.marginBottom;
3453
3457
  var htmlId = useMemo(function () { return id || shortUid(); }, []);
3454
3458
  var containerAttributes = (_b = {
3455
3459
  htmlFor: htmlId
@@ -3459,6 +3463,7 @@ var SwitchButton = function (_a) {
3459
3463
  var inputAttributes = {
3460
3464
  id: htmlId,
3461
3465
  name: name,
3466
+ autoFocus: autoFocus,
3462
3467
  disabled: disabled,
3463
3468
  checked: checked
3464
3469
  };
@@ -3494,12 +3499,13 @@ var styles$1 = {"body":"SelectInput-module_w2mdUW","container":"SelectInput-modu
3494
3499
  var s$1 = classNames.bind(styles$1);
3495
3500
  var SelectInput = function (_a) {
3496
3501
  var _b, _c, _d;
3497
- var label = _a.label, _e = _a.withLabel, withLabel = _e === void 0 ? true : _e, inputRef = _a.inputRef, _f = _a.nativeHtmlComponent, nativeHtmlComponent = _f === void 0 ? true : _f, _g = _a.size, size = _g === void 0 ? SizeTypes.MEDIUM : _g, sizeMd = _a.sizeMd, sizeLg = _a.sizeLg, sizeXl = _a.sizeXl, ariaLabel = _a.ariaLabel, id = _a.id, onChange = _a.onChange, defaultOption = _a.defaultOption, value = _a.value, error = _a.error, helperText = _a.helperText, options = _a.options, disabled = _a.disabled, loading = _a.loading, className = _a.className, inputClassName = _a.inputClassName, marginBottom = _a.marginBottom;
3502
+ var label = _a.label, _e = _a.withLabel, withLabel = _e === void 0 ? true : _e, inputRef = _a.inputRef, _f = _a.nativeHtmlComponent, nativeHtmlComponent = _f === void 0 ? true : _f, _g = _a.size, size = _g === void 0 ? SizeTypes.MEDIUM : _g, sizeMd = _a.sizeMd, sizeLg = _a.sizeLg, sizeXl = _a.sizeXl, ariaLabel = _a.ariaLabel, id = _a.id, onChange = _a.onChange, defaultOption = _a.defaultOption, value = _a.value, error = _a.error, autoFocus = _a.autoFocus, helperText = _a.helperText, options = _a.options, disabled = _a.disabled, loading = _a.loading, className = _a.className, inputClassName = _a.inputClassName, marginBottom = _a.marginBottom;
3498
3503
  var htmlId = useMemo(function () { return (id ? "".concat(id) : shortUid()); }, []);
3499
3504
  var inputAttributes = (_b = {
3500
3505
  ref: inputRef,
3501
3506
  id: htmlId,
3502
3507
  value: value,
3508
+ autoFocus: autoFocus,
3503
3509
  disabled: disabled || loading
3504
3510
  },
3505
3511
  _b['aria-label'] = ariaLabel || label,