widenarrow-ui 1.1.42 → 1.1.44

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 (29) hide show
  1. package/lib/components/FormSkeleton/FormSkeleton.types.d.ts +1 -1
  2. package/lib/components/IconButton/IconButton.types.d.ts +1 -0
  3. package/lib/components/InlineButton/InlineButton.types.d.ts +1 -0
  4. package/lib/components/Input/Input.stories.d.ts +1 -0
  5. package/lib/components/Input/Input.types.d.ts +1 -0
  6. package/lib/components/NoDataMessage/NoDataMessage.types.d.ts +1 -1
  7. package/lib/components/Pagination/Pagination.types.d.ts +1 -1
  8. package/lib/components/SwitchButton/SwitchButton.types.d.ts +1 -1
  9. package/lib/index.d.ts +8 -6
  10. package/lib/index.esm.js +11 -6
  11. package/lib/index.esm.js.map +1 -1
  12. package/lib/index.js +11 -6
  13. package/lib/index.js.map +1 -1
  14. package/lib/utils.d.ts +1 -1
  15. package/package.json +1 -1
  16. package/src/components/FormSkeleton/FormSkeleton.types.ts +1 -1
  17. package/src/components/IconButton/IconButton.tsx +2 -0
  18. package/src/components/IconButton/IconButton.types.ts +1 -0
  19. package/src/components/InlineButton/InlineButton.tsx +2 -0
  20. package/src/components/InlineButton/InlineButton.types.ts +1 -0
  21. package/src/components/Input/Input.stories.tsx +22 -0
  22. package/src/components/Input/Input.tsx +1 -0
  23. package/src/components/Input/Input.types.ts +1 -0
  24. package/src/components/NoDataMessage/NoDataMessage.types.ts +1 -1
  25. package/src/components/Pagination/Pagination.types.ts +1 -1
  26. package/src/components/SwitchButton/SwitchButton.tsx +1 -1
  27. package/src/components/SwitchButton/SwitchButton.types.ts +1 -1
  28. package/src/components/ToolTip/ToolTip.tsx +5 -1
  29. package/src/utils.ts +1 -1
@@ -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); };
@@ -700,7 +700,10 @@ var ToolTip = function (_a) {
700
700
  if (!children) {
701
701
  return null;
702
702
  }
703
- if (disabled || !text) {
703
+ if (disabled) {
704
+ return jsx(Fragment, { children: children });
705
+ }
706
+ if (!text && !component) {
704
707
  return jsx(Fragment, { children: children });
705
708
  }
706
709
  var uniq = id ? "".concat(id) : uuid();
@@ -2765,7 +2768,7 @@ var styles$f = {"body":"InlineButton-module_aw3KLt","container":"InlineButton-mo
2765
2768
  var s$f = classNames.bind(styles$f);
2766
2769
  var InlineButton = memo(function (_a) {
2767
2770
  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;
2771
+ 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
2772
  var mergedClassNames = s$f('container', (_b = {},
2770
2773
  _b["container_".concat(type)] = !!type,
2771
2774
  _b["container_sizeSm_".concat(size)] = !!size,
@@ -2792,6 +2795,7 @@ var InlineButton = memo(function (_a) {
2792
2795
  var baseAttributes = (_c = {
2793
2796
  className: mergedClassNames,
2794
2797
  id: id,
2798
+ tabIndex: tabIndex,
2795
2799
  disabled: loading || disabled,
2796
2800
  onClick: !!onClickCallback && !loading ? onClickCallback : undefined
2797
2801
  },
@@ -2961,7 +2965,7 @@ var styles$a = {"body":"IconButton-module_DV09bK","container":"IconButton-module
2961
2965
  var s$a = classNames.bind(styles$a);
2962
2966
  var IconButton = memo(function (_a) {
2963
2967
  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;
2968
+ 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
2969
  var mergedClassNames = s$a('container', (_b = {},
2966
2970
  _b["container_".concat(size)] = size,
2967
2971
  _b["container_".concat(type)] = type,
@@ -2990,6 +2994,7 @@ var IconButton = memo(function (_a) {
2990
2994
  _c['aria-label'] = ariaLabel || text,
2991
2995
  _c.style = style,
2992
2996
  _c.href = href,
2997
+ _c.tabIndex = tabIndex,
2993
2998
  _c.target = href ? '_blank' : undefined,
2994
2999
  _c.rel = href ? 'noopener noreferrer' : undefined,
2995
3000
  _c);
@@ -3050,7 +3055,7 @@ var Input = function (_a) {
3050
3055
  icon_displayNone: iconObject.loading
3051
3056
  },
3052
3057
  _a[iconClassName] = iconClassName,
3053
- _a)), disabled: has('disabled', iconObject) ? iconObject.disabled : disabled, toolTip: iconObject.toolTip, icon: iconObject.icon, onClickCallback: iconObject.onClickCallback }))] }));
3058
+ _a)), tabIndex: iconObject.tabIndex, disabled: has('disabled', iconObject) ? iconObject.disabled : disabled, toolTip: iconObject.toolTip, icon: iconObject.icon, onClickCallback: iconObject.onClickCallback }))] }));
3054
3059
  };
3055
3060
  var containerAttributes = {
3056
3061
  htmlFor: name
@@ -3391,7 +3396,7 @@ var SwitchButton = function (_a) {
3391
3396
  label_alignCenter: alignCenter,
3392
3397
  label_withInlineLabel: withInlineLabel,
3393
3398
  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', {
3399
+ }), 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
3400
  button_alignCenter: alignCenter
3396
3401
  }), children: [jsx("span", { className: s$2('line') }), jsx("span", { className: s$2('circle') })] })] })));
3397
3402
  };