widenarrow-ui 1.1.42 → 1.1.43

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.
@@ -1,4 +1,4 @@
1
- import { ColorTypes } from 'src/constants';
1
+ import { ColorTypes } from '../../constants';
2
2
  export interface Block {
3
3
  height: number;
4
4
  col: number;
@@ -16,6 +16,7 @@ export interface IconButtonProps extends IconStyleInterface {
16
16
  iconColor?: Partial<ColorTypes>;
17
17
  href?: string;
18
18
  disabled?: boolean;
19
+ tabIndex?: number;
19
20
  toolTip?: string;
20
21
  ariaLabel?: string;
21
22
  }
@@ -23,5 +23,6 @@ export interface InlineButtonProps {
23
23
  withEllipsis?: boolean;
24
24
  disabled?: boolean | undefined;
25
25
  style?: CSSProperties;
26
+ tabIndex?: number;
26
27
  toolTip?: string;
27
28
  }
@@ -5,3 +5,4 @@ export default meta;
5
5
  type Story = StoryObj<typeof Input>;
6
6
  export declare const Default: Story;
7
7
  export declare const SearchInput: Story;
8
+ export declare const InputWithButtons: Story;
@@ -5,6 +5,7 @@ export interface IconInterface {
5
5
  disabled?: boolean;
6
6
  icon: Partial<IconTypes>;
7
7
  toolTip?: string;
8
+ tabIndex?: number;
8
9
  onClickCallback: () => void;
9
10
  }
10
11
  export interface InputProps {
@@ -1,5 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
- import { IconTypes } from 'src/constants';
2
+ import { IconTypes } from '../../constants';
3
3
  export interface NoDataMessageProps {
4
4
  className?: string;
5
5
  icon?: Partial<IconTypes>;
@@ -1,4 +1,4 @@
1
- import { HierarchyTypes } from 'src/constants';
1
+ import { HierarchyTypes } from '../../constants';
2
2
  import { SearchResultInterface } from '../../types/common.types';
3
3
  export interface PaginationProps {
4
4
  pagination: SearchResultInterface;
@@ -1,7 +1,7 @@
1
1
  export interface SwitchButtonProps {
2
2
  checked: boolean;
3
3
  name?: string;
4
- label: string;
4
+ label?: string;
5
5
  withLabel?: boolean;
6
6
  withInlineLabel?: boolean;
7
7
  ariaLabel?: string;
package/lib/index.d.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  import * as react from 'react';
2
2
  import react__default, { CSSProperties, MouseEvent, ReactNode, FC, ChangeEvent, RefObject, FocusEvent, KeyboardEvent } from 'react';
3
3
  import { Placement, PositioningStrategy } from '@popperjs/core';
4
- import { HierarchyTypes as HierarchyTypes$1, ColorTypes as ColorTypes$1, IconTypes as IconTypes$1 } from 'src/constants';
5
4
 
6
5
  declare enum IconTypes {
7
6
  ACCOUNT_SETTINGS = "iconAccountSettings",
@@ -579,7 +578,7 @@ interface PaginationProps {
579
578
  withTablePagination?: boolean;
580
579
  withFastForwardButtons?: boolean;
581
580
  pageSizeOptions?: Array<number>;
582
- buttonType?: HierarchyTypes$1.PRIMARY | HierarchyTypes$1.SECONDARY;
581
+ buttonType?: HierarchyTypes.PRIMARY | HierarchyTypes.SECONDARY;
583
582
  className?: string;
584
583
  nextPageTitle?: string;
585
584
  previousPageTitle?: string;
@@ -602,7 +601,7 @@ interface Block {
602
601
  interface FormSkeletonProps {
603
602
  className?: string;
604
603
  blocks: Array<Block>;
605
- color?: Partial<ColorTypes$1>;
604
+ color?: Partial<ColorTypes>;
606
605
  }
607
606
 
608
607
  declare const FormSkeleton: FC<FormSkeletonProps>;
@@ -681,6 +680,7 @@ interface IconButtonProps extends IconStyleInterface {
681
680
  iconColor?: Partial<ColorTypes>;
682
681
  href?: string;
683
682
  disabled?: boolean;
683
+ tabIndex?: number;
684
684
  toolTip?: string;
685
685
  ariaLabel?: string;
686
686
  }
@@ -692,6 +692,7 @@ interface IconInterface {
692
692
  disabled?: boolean;
693
693
  icon: Partial<IconTypes>;
694
694
  toolTip?: string;
695
+ tabIndex?: number;
695
696
  onClickCallback: () => void;
696
697
  }
697
698
  interface InputProps {
@@ -769,6 +770,7 @@ interface InlineButtonProps {
769
770
  withEllipsis?: boolean;
770
771
  disabled?: boolean | undefined;
771
772
  style?: CSSProperties;
773
+ tabIndex?: number;
772
774
  toolTip?: string;
773
775
  }
774
776
 
@@ -944,7 +946,7 @@ declare const SortableTable: FC<SortableTableProps>;
944
946
  interface SwitchButtonProps {
945
947
  checked: boolean;
946
948
  name?: string;
947
- label: string;
949
+ label?: string;
948
950
  withLabel?: boolean;
949
951
  withInlineLabel?: boolean;
950
952
  ariaLabel?: string;
@@ -1054,7 +1056,7 @@ declare const SkeletonItem: FC<SkeletonItemProps>;
1054
1056
 
1055
1057
  interface NoDataMessageProps {
1056
1058
  className?: string;
1057
- icon?: Partial<IconTypes$1>;
1059
+ icon?: Partial<IconTypes>;
1058
1060
  title?: string;
1059
1061
  message?: string;
1060
1062
  absoluteCenter?: boolean;
@@ -1062,7 +1064,7 @@ interface NoDataMessageProps {
1062
1064
  button?: {
1063
1065
  onClickCallback: () => void;
1064
1066
  text: string;
1065
- icon: Partial<IconTypes$1>;
1067
+ icon: Partial<IconTypes>;
1066
1068
  };
1067
1069
  }
1068
1070
 
package/lib/index.esm.js CHANGED
@@ -354,7 +354,7 @@ var getPaginationArray = function (pagination) {
354
354
  };
355
355
  /**
356
356
  * @function pickAttributes
357
- * @param {Object} attr
357
+ * @param attributes
358
358
  * @returns {Object}
359
359
  */
360
360
  var pickAttributes = function (attributes) { return pickBy(function (val) { return val !== undefined; }, attributes); };
@@ -2765,7 +2765,7 @@ var styles$f = {"body":"InlineButton-module_aw3KLt","container":"InlineButton-mo
2765
2765
  var s$f = classNames.bind(styles$f);
2766
2766
  var InlineButton = memo(function (_a) {
2767
2767
  var _b, _c;
2768
- 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, rotateIcon = _a.rotateIcon, rotateIconByDegree = _a.rotateIconByDegree, onClickCallback = _a.onClickCallback, withEllipsis = _a.withEllipsis, disabled = _a.disabled, toolTip = _a.toolTip;
2768
+ 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;
2769
2769
  var mergedClassNames = s$f('container', (_b = {},
2770
2770
  _b["container_".concat(type)] = !!type,
2771
2771
  _b["container_sizeSm_".concat(size)] = !!size,
@@ -2792,6 +2792,7 @@ var InlineButton = memo(function (_a) {
2792
2792
  var baseAttributes = (_c = {
2793
2793
  className: mergedClassNames,
2794
2794
  id: id,
2795
+ tabIndex: tabIndex,
2795
2796
  disabled: loading || disabled,
2796
2797
  onClick: !!onClickCallback && !loading ? onClickCallback : undefined
2797
2798
  },
@@ -2961,7 +2962,7 @@ var styles$a = {"body":"IconButton-module_DV09bK","container":"IconButton-module
2961
2962
  var s$a = classNames.bind(styles$a);
2962
2963
  var IconButton = memo(function (_a) {
2963
2964
  var _b, _c;
2964
- 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, rotateIconByDegree = _a.rotateIconByDegree, toolTip = _a.toolTip, ariaLabel = _a.ariaLabel;
2965
+ 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;
2965
2966
  var mergedClassNames = s$a('container', (_b = {},
2966
2967
  _b["container_".concat(size)] = size,
2967
2968
  _b["container_".concat(type)] = type,
@@ -2990,6 +2991,7 @@ var IconButton = memo(function (_a) {
2990
2991
  _c['aria-label'] = ariaLabel || text,
2991
2992
  _c.style = style,
2992
2993
  _c.href = href,
2994
+ _c.tabIndex = tabIndex,
2993
2995
  _c.target = href ? '_blank' : undefined,
2994
2996
  _c.rel = href ? 'noopener noreferrer' : undefined,
2995
2997
  _c);
@@ -3050,7 +3052,7 @@ var Input = function (_a) {
3050
3052
  icon_displayNone: iconObject.loading
3051
3053
  },
3052
3054
  _a[iconClassName] = iconClassName,
3053
- _a)), disabled: has('disabled', iconObject) ? iconObject.disabled : disabled, toolTip: iconObject.toolTip, icon: iconObject.icon, onClickCallback: iconObject.onClickCallback }))] }));
3055
+ _a)), tabIndex: iconObject.tabIndex, disabled: has('disabled', iconObject) ? iconObject.disabled : disabled, toolTip: iconObject.toolTip, icon: iconObject.icon, onClickCallback: iconObject.onClickCallback }))] }));
3054
3056
  };
3055
3057
  var containerAttributes = {
3056
3058
  htmlFor: name
@@ -3391,7 +3393,7 @@ var SwitchButton = function (_a) {
3391
3393
  label_alignCenter: alignCenter,
3392
3394
  label_withInlineLabel: withInlineLabel,
3393
3395
  label_disabled: disabled
3394
- }), children: label }), jsx("input", __assign({ className: s$2('input'), type: 'checkbox', onChange: function () { return undefined; } }, pickAttributes(inputAttributes))), jsxs("div", { className: s$2('button', {
3396
+ }), children: label || ariaLabel }), jsx("input", __assign({ className: s$2('input'), type: 'checkbox', onChange: function () { return undefined; } }, pickAttributes(inputAttributes))), jsxs("div", { className: s$2('button', {
3395
3397
  button_alignCenter: alignCenter
3396
3398
  }), children: [jsx("span", { className: s$2('line') }), jsx("span", { className: s$2('circle') })] })] })));
3397
3399
  };