widenarrow-ui 0.1.32 → 0.1.33

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 (56) hide show
  1. package/.storybook/main.js +1 -1
  2. package/.storybook/preview.js +4 -0
  3. package/lib/components/Box/Box.d.ts +7 -6
  4. package/lib/components/Button/Button.d.ts +2 -2
  5. package/lib/components/DropDownItem/DropDownItem.d.ts +4 -4
  6. package/lib/components/FacetButton/FacetButton.d.ts +1 -1
  7. package/lib/components/IconButton/IconButton.d.ts +1 -1
  8. package/lib/components/Image/Image.d.ts +17 -0
  9. package/lib/components/Image/Image.stories.d.ts +6 -0
  10. package/lib/components/Image/index.d.ts +1 -0
  11. package/lib/components/InlineButton/InlineButton.d.ts +2 -2
  12. package/lib/components/ListSkeleton/ListSkeleton.d.ts +8 -3
  13. package/lib/components/MultiActionButton/MultiActionButton.d.ts +3 -3
  14. package/lib/components/Separator/Separator.d.ts +1 -1
  15. package/lib/components/SolidSpinner/SolidSpinner.d.ts +1 -1
  16. package/lib/components/SortableTable/SortableTable.d.ts +29 -0
  17. package/lib/components/SortableTable/SortableTable.stories.d.ts +7 -0
  18. package/lib/components/SortableTable/index.d.ts +1 -0
  19. package/lib/constants.d.ts +9 -0
  20. package/lib/index.css +1 -1
  21. package/lib/index.d.ts +3 -1
  22. package/lib/index.esm.css +1 -1
  23. package/lib/index.esm.js +335 -93
  24. package/lib/index.esm.js.map +1 -1
  25. package/lib/index.js +335 -91
  26. package/lib/index.js.map +1 -1
  27. package/lib/types/styling.d.ts +4 -4
  28. package/lib/utils.d.ts +57 -0
  29. package/package.json +5 -2
  30. package/src/components/Box/Box.module.scss +1 -22
  31. package/src/components/Box/Box.tsx +10 -7
  32. package/src/components/Button/Button.tsx +2 -2
  33. package/src/components/DropDownItem/DropDownItem.tsx +4 -4
  34. package/src/components/FacetButton/FacetButton.tsx +1 -1
  35. package/src/components/IconButton/IconButton.tsx +1 -1
  36. package/src/components/Image/Image.module.scss +95 -0
  37. package/src/components/Image/Image.stories.tsx +23 -0
  38. package/src/components/Image/Image.tsx +98 -0
  39. package/src/components/Image/index.tsx +1 -0
  40. package/src/components/InlineButton/InlineButton.tsx +2 -2
  41. package/src/components/ListSkeleton/ListSkeleton.module.scss +0 -4
  42. package/src/components/ListSkeleton/ListSkeleton.tsx +19 -5
  43. package/src/components/MultiActionButton/MultiActionButton.tsx +3 -3
  44. package/src/components/Separator/Separator.tsx +1 -1
  45. package/src/components/SolidSpinner/SolidSpinner.tsx +1 -1
  46. package/src/components/SortableTable/SortableTable.module.scss +107 -0
  47. package/src/components/SortableTable/SortableTable.stories.tsx +65 -0
  48. package/src/components/SortableTable/SortableTable.tsx +239 -0
  49. package/src/components/SortableTable/index.tsx +1 -0
  50. package/src/constants.ts +10 -0
  51. package/src/index.ts +7 -2
  52. package/src/styles/mixins.scss +23 -118
  53. package/src/styles/variables.scss +2 -48
  54. package/src/types/styling.ts +6 -4
  55. package/src/utils.ts +114 -1
  56. package/lib/index.d.ts.map +0 -1
@@ -28,7 +28,7 @@ module.exports = {
28
28
  config.resolve.plugins = [
29
29
  new TsconfigPathsPlugin({
30
30
  configFile: path.resolve(__dirname, '../tsconfig.json')
31
- }),
31
+ })
32
32
  ];
33
33
 
34
34
  // Return the altered config
@@ -2,6 +2,10 @@ import './normalize.css';
2
2
  import './fonts.css';
3
3
  import './storybook.css';
4
4
 
5
+ import 'lazysizes';
6
+ import 'lazysizes/plugins/attrchange/ls.attrchange';
7
+ import 'lazysizes/plugins/bgset/ls.bgset';
8
+
5
9
  export const parameters = {
6
10
  actions: { argTypesRegex: '^on[A-Z].*' },
7
11
  layout: 'centered'
@@ -5,13 +5,14 @@ interface Props extends MarginInterface, PaddingInterface, FlexStylingInterface
5
5
  children: React.ReactNode;
6
6
  className?: string;
7
7
  position?: string;
8
- border?: string;
9
- borderTop?: string;
10
- borderBottom?: string;
11
- borderRight?: string;
12
- backgroundColor?: `${ColorTypes}`;
8
+ borderColor?: Partial<ColorTypes>;
9
+ border?: '1' | '2' | '3';
10
+ borderTop?: '1' | '2' | '3';
11
+ borderBottom?: '1' | '2' | '3';
12
+ borderRight?: '1' | '2' | '3';
13
+ borderLeft?: '1' | '2' | '3';
14
+ backgroundColor?: Partial<ColorTypes>;
13
15
  showOnBreakpoint?: string;
14
- borderLeft?: string;
15
16
  withBorderRadius?: boolean;
16
17
  width?: string;
17
18
  minWidth?: string;
@@ -3,9 +3,9 @@ import { HierarchyTypes, SizeTypes, IconTypes } from 'src/constants';
3
3
  interface Props {
4
4
  text?: string;
5
5
  onClickCallback?: (e: MouseEvent<HTMLButtonElement>) => void;
6
- type?: `${HierarchyTypes}`;
6
+ type?: Partial<HierarchyTypes>;
7
7
  size?: SizeTypes.SMALL | SizeTypes.MEDIUM | SizeTypes.LARGE;
8
- icon?: `${IconTypes}`;
8
+ icon?: Partial<IconTypes>;
9
9
  iconSize?: SizeTypes.SMALL | SizeTypes.MEDIUM | SizeTypes.LARGE;
10
10
  withIconLeft?: boolean;
11
11
  disabled?: boolean;
@@ -10,11 +10,11 @@ interface Props {
10
10
  wrapperElement?: 'div' | 'li';
11
11
  className?: string;
12
12
  type?: HierarchyTypes.PRIMARY | HierarchyTypes.SECONDARY;
13
- leftIcon?: `${IconTypes}`;
14
- rightIcon?: `${IconTypes}`;
13
+ leftIcon?: Partial<IconTypes>;
14
+ rightIcon?: Partial<IconTypes>;
15
15
  iconSize?: SizeTypes.SMALL | SizeTypes.MEDIUM | SizeTypes.LARGE;
16
- iconColor?: `${ColorTypes}`;
17
- textColor?: `${ColorTypes}`;
16
+ iconColor?: Partial<ColorTypes>;
17
+ textColor?: Partial<ColorTypes>;
18
18
  iconClassName?: string;
19
19
  }
20
20
  declare const DropDownItem: FC<Props>;
@@ -7,7 +7,7 @@ interface Props {
7
7
  onClickCallback?: (e: MouseEvent<HTMLButtonElement>) => void;
8
8
  disabled?: boolean;
9
9
  selected?: boolean;
10
- icon?: `${IconTypes}`;
10
+ icon?: Partial<IconTypes>;
11
11
  children?: ReactNode;
12
12
  className?: string;
13
13
  toolTip?: string;
@@ -9,7 +9,7 @@ interface Props extends IconStyleInterface, SizeStyleInterface {
9
9
  type?: HierarchyTypes.PRIMARY | HierarchyTypes.SECONDARY;
10
10
  onClickCallback?: (e: MouseEvent<HTMLButtonElement>) => void;
11
11
  iconSize?: SizeTypes.SMALL | SizeTypes.MEDIUM | SizeTypes.LARGE;
12
- iconColor?: `${ColorTypes}`;
12
+ iconColor?: Partial<ColorTypes>;
13
13
  href?: string;
14
14
  disabled?: boolean;
15
15
  toolTip?: string;
@@ -0,0 +1,17 @@
1
+ import { FC, ReactNode } from 'react';
2
+ import { AspectRatioTypes } from 'src/constants';
3
+ interface Props {
4
+ src: string;
5
+ alt?: string;
6
+ className?: string;
7
+ customCellComponent?: ReactNode;
8
+ aspectRatio?: Partial<AspectRatioTypes>;
9
+ bgImage?: boolean;
10
+ bgImageProps?: {
11
+ size: 'cover' | 'contain';
12
+ position: 'top' | 'bottom' | 'center';
13
+ };
14
+ placeHolderColor?: string;
15
+ }
16
+ declare const Image: FC<Props>;
17
+ export default Image;
@@ -0,0 +1,6 @@
1
+ import type { Meta, StoryObj } from '@storybook/react';
2
+ import Image from 'src/components/Image';
3
+ declare const meta: Meta<typeof Image>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof Image>;
6
+ export declare const Default: Story;
@@ -0,0 +1 @@
1
+ export { default } from './Image';
@@ -5,11 +5,11 @@ interface Props {
5
5
  onClickCallback?: (e: MouseEvent<HTMLButtonElement>) => void;
6
6
  className?: string;
7
7
  children?: ReactNode;
8
- icon?: `${IconTypes}`;
8
+ icon?: Partial<IconTypes>;
9
9
  rotateIcon?: boolean;
10
10
  iconClassName?: string;
11
11
  withIconRight?: boolean;
12
- type?: `${HierarchyTypes}`;
12
+ type?: Partial<HierarchyTypes>;
13
13
  size?: SizeTypes.SMALL | SizeTypes.MEDIUM;
14
14
  textClassName?: string;
15
15
  withEllipsis?: boolean;
@@ -7,11 +7,16 @@ interface Props {
7
7
  itemClassName?: string;
8
8
  withBorderRadius?: boolean;
9
9
  withContent?: boolean;
10
- backgroundColor?: `${ColorTypes}`;
10
+ backgroundColor?: Partial<ColorTypes>;
11
11
  marginBottom?: string;
12
12
  padding?: string;
13
- borderColor?: `${ColorTypes}`;
14
- contentColor?: `${ColorTypes}`;
13
+ borderColor?: Partial<ColorTypes>;
14
+ border?: '1' | '2' | '3';
15
+ borderTop?: '1' | '2' | '3';
16
+ borderBottom?: '1' | '2' | '3';
17
+ borderRight?: '1' | '2' | '3';
18
+ borderLeft?: '1' | '2' | '3';
19
+ contentColor?: Partial<ColorTypes>;
15
20
  }
16
21
  declare const ListSkeleton: FC<Props>;
17
22
  export default ListSkeleton;
@@ -4,12 +4,12 @@ interface Props {
4
4
  text?: string;
5
5
  onLeftClickCallback?: (e: MouseEvent<HTMLButtonElement>) => void;
6
6
  onRightClickCallback?: (e: MouseEvent<HTMLButtonElement>) => void;
7
- type?: `${HierarchyTypes}`;
7
+ type?: Partial<HierarchyTypes>;
8
8
  size?: SizeTypes.SMALL | SizeTypes.MEDIUM | SizeTypes.LARGE;
9
9
  leftIconSize?: SizeTypes.SMALL | SizeTypes.MEDIUM | SizeTypes.LARGE;
10
10
  rightIconSize?: SizeTypes.SMALL | SizeTypes.MEDIUM | SizeTypes.LARGE;
11
- leftIcon?: `${IconTypes}`;
12
- rightIcon?: `${IconTypes}`;
11
+ leftIcon?: Partial<IconTypes>;
12
+ rightIcon?: Partial<IconTypes>;
13
13
  rotateLeftIconByDegree?: 0 | 45 | 90 | 135 | 180 | 225 | 270 | 315;
14
14
  rotateRightIconByDegree?: 0 | 45 | 90 | 135 | 180 | 225 | 270 | 315;
15
15
  disabled?: boolean;
@@ -3,7 +3,7 @@ import { MarginInterface, PaddingInterface } from 'src/types/styling';
3
3
  import { SizeTypes, ColorTypes } from 'src/constants';
4
4
  interface Props extends MarginInterface, PaddingInterface {
5
5
  className?: string;
6
- color?: `${ColorTypes}`;
6
+ color?: Partial<ColorTypes>;
7
7
  size?: SizeTypes.SMALL | SizeTypes.MEDIUM | SizeTypes.LARGE;
8
8
  }
9
9
  interface Props {
@@ -1,7 +1,7 @@
1
1
  import { FC } from 'react';
2
2
  import { HierarchyTypes, SizeTypes } from 'src/constants';
3
3
  interface Props {
4
- type?: `${HierarchyTypes}`;
4
+ type?: Partial<HierarchyTypes>;
5
5
  size?: SizeTypes.EXTRA_SMALL | SizeTypes.SMALL | SizeTypes.MEDIUM | SizeTypes.LARGE;
6
6
  disabled?: boolean;
7
7
  className?: string;
@@ -0,0 +1,29 @@
1
+ import { FC, ReactNode } from 'react';
2
+ interface Props {
3
+ cells: Array<{
4
+ key: string;
5
+ title: string;
6
+ width: string;
7
+ disableSort?: boolean;
8
+ alignRight?: boolean;
9
+ alignCenter?: boolean;
10
+ withEllipsis?: boolean;
11
+ toolTip?: string;
12
+ customHeaderCellComponent?: (row: object, cell: object) => ReactNode;
13
+ customCellComponent?: (row: object, cell: object) => ReactNode;
14
+ }>;
15
+ data?: Array<object>;
16
+ sortBy: Array<{
17
+ keyName: string;
18
+ ascending: boolean;
19
+ }>;
20
+ className?: string;
21
+ headerClassName?: string;
22
+ fetching?: boolean;
23
+ skeletonRows?: number;
24
+ withStickyHeader?: boolean;
25
+ withIntersectionObserver?: boolean;
26
+ onSortCallback?: (keyName: string) => void;
27
+ }
28
+ declare const SortableTable: FC<Props>;
29
+ export default SortableTable;
@@ -0,0 +1,7 @@
1
+ import type { Meta, StoryObj } from '@storybook/react';
2
+ import SortableTable from 'src/components/SortableTable';
3
+ declare const meta: Meta<typeof SortableTable>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof SortableTable>;
6
+ export declare const Default: Story;
7
+ export declare const Custom: Story;
@@ -0,0 +1 @@
1
+ export { default } from './SortableTable';
@@ -194,6 +194,15 @@ export declare enum HierarchyTypes {
194
194
  SECONDARY = "secondary",
195
195
  TERTIARY = "tertiary"
196
196
  }
197
+ export declare enum AspectRatioTypes {
198
+ ar4_1 = "ar4_1",
199
+ ar3_1 = "ar3_1",
200
+ ar21_9 = "ar21_9",
201
+ ar16_9 = "ar16_9",
202
+ ar21_13 = "ar21_13",
203
+ ar4_3 = "ar4_3",
204
+ ar1_1 = "ar1_1"
205
+ }
197
206
  export declare enum ColorTypes {
198
207
  WHITE = "white",
199
208
  BLUE = "blue",