dt-shared-front 2.2.128 → 3.0.0

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 (48) hide show
  1. package/dist/components/breadcrumbs/breadcrumbs.d.ts +1 -0
  2. package/dist/components/button/button.d.ts +1 -2
  3. package/dist/components/checkbox/checkbox.d.ts +1 -2
  4. package/dist/components/counter/counter.d.ts +0 -1
  5. package/dist/components/counter/counter.stories.d.ts +9 -0
  6. package/dist/components/date-picker/date-picker.d.ts +34 -59
  7. package/dist/components/date-picker/date-picker.stories.d.ts +9 -0
  8. package/dist/components/form-control/form-control.d.ts +6 -3
  9. package/dist/components/form-control/form-control.stories.d.ts +8 -0
  10. package/dist/components/heading/heading.d.ts +1 -2
  11. package/dist/components/input/input.d.ts +1 -3
  12. package/dist/components/link/link.stories.d.ts +8 -0
  13. package/dist/components/pagination/index.d.ts +1 -0
  14. package/dist/components/pagination/pagination.d.ts +12 -0
  15. package/dist/components/radio/radio.d.ts +1 -2
  16. package/dist/components/select/select.d.ts +2 -1
  17. package/dist/components/select/select.stories.d.ts +19 -1
  18. package/dist/components/selector/selector.stories.d.ts +18 -0
  19. package/dist/components/skeleton/skeleton.d.ts +1 -2
  20. package/dist/components/slider/slider.d.ts +6 -3
  21. package/dist/components/spoiler/spoiler.d.ts +0 -1
  22. package/dist/components/stacked-input/stacked-input.d.ts +0 -1
  23. package/dist/components/switch/switch.d.ts +2 -1
  24. package/dist/components/switch/switch.stories.d.ts +2 -1
  25. package/dist/components/table/index.d.ts +3 -0
  26. package/dist/components/table/table-row.d.ts +16 -0
  27. package/dist/components/table/table.d.ts +23 -0
  28. package/dist/components/table/table.hook.d.ts +33 -0
  29. package/dist/components/table/table.stories.d.ts +32 -0
  30. package/dist/components/table/table.types.d.ts +19 -0
  31. package/dist/components/tag-box/tag-box.stories.d.ts +4 -0
  32. package/dist/components/tag-button/tag-button.d.ts +1 -2
  33. package/dist/components/text/text.d.ts +1 -2
  34. package/dist/components/text-area/text-area.d.ts +1 -2
  35. package/dist/components/tooltip/tooltip.d.ts +10 -3
  36. package/dist/components/tooltip/tooltip.stories.d.ts +3 -0
  37. package/dist/components/tooltip/tooltip.utils.d.ts +10 -2
  38. package/dist/components/upload/upload.stories.d.ts +16 -0
  39. package/dist/index.d.ts +1 -1
  40. package/dist/index.js +1 -1
  41. package/dist/index.js.map +1 -1
  42. package/dist/main.css +42 -41
  43. package/dist/main.css.map +1 -1
  44. package/dist/providers/shared.provider.d.ts +0 -2
  45. package/package.json +7 -1
  46. package/dist/components/range-picker/index.d.ts +0 -1
  47. package/dist/components/range-picker/range-picker.d.ts +0 -54
  48. package/dist/components/range-picker/range-picker.stories.d.ts +0 -6
@@ -13,6 +13,7 @@ interface IBreadcrumbsProps {
13
13
  paths: IBreadcrumbsPath[];
14
14
  variant?: keyof typeof EBreadcrumbsVariant;
15
15
  onBack?: (path: string) => void;
16
+ isMobile?: boolean;
16
17
  }
17
18
  export declare const Breadcrumbs: ({ paths, onBack, variant }: IBreadcrumbsProps) => React.JSX.Element;
18
19
  export {};
@@ -27,10 +27,9 @@ export interface IButtonProps {
27
27
  iconPosition?: keyof typeof EButtonIconPosition;
28
28
  borderRadius?: keyof typeof EButtonBorderRadius;
29
29
  loading?: boolean;
30
- isWbTheme?: boolean;
31
30
  disabled?: boolean;
32
31
  className?: string;
33
32
  type?: 'button' | 'submit' | 'reset';
34
33
  onClick?: (e?: MouseEvent<HTMLButtonElement>) => void;
35
34
  }
36
- export declare const Button: ({ variant, size, iconPosition, borderRadius, width, icon: Icon, loading, disabled, children, className, onClick, type, isWbTheme, }: PropsWithChildren<IButtonProps>) => React.JSX.Element;
35
+ export declare const Button: ({ variant, size, iconPosition, borderRadius, width, icon: Icon, loading, disabled, children, className, onClick, type, }: PropsWithChildren<IButtonProps>) => React.JSX.Element;
@@ -8,6 +8,5 @@ export declare type ICheckboxProps = {
8
8
  className?: string;
9
9
  small?: boolean;
10
10
  name?: string;
11
- isWbTheme?: boolean;
12
11
  };
13
- export declare const Checkbox: ({ disabled, value, onChange, children, error, className, isWbTheme, name, }: PropsWithChildren<ICheckboxProps>) => React.JSX.Element;
12
+ export declare const Checkbox: ({ disabled, value, onChange, children, error, className, name, }: PropsWithChildren<ICheckboxProps>) => React.JSX.Element;
@@ -4,7 +4,6 @@ interface ICounterProps {
4
4
  max?: number;
5
5
  min?: number;
6
6
  onChange?: (count: number) => void;
7
- isWbTheme?: boolean;
8
7
  }
9
8
  export declare const Counter: (props: ICounterProps) => React.JSX.Element;
10
9
  export {};
@@ -0,0 +1,9 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import { Counter } from './counter';
3
+ declare const meta: Meta<typeof Counter>;
4
+ export default meta;
5
+ declare type Story = StoryObj<typeof Counter>;
6
+ export declare const Default: Story;
7
+ export declare const WithCustomInitial: Story;
8
+ export declare const AtMinValue: Story;
9
+ export declare const AtMaxValue: Story;
@@ -1,64 +1,39 @@
1
- import React, { ComponentProps, ReactNode } from 'react';
2
- declare const AntDatePicker: import("antd/lib/date-picker/generatePicker/interface").PickerComponentClass<import("antd/lib/date-picker/generatePicker").PickerProps<Date> & {
3
- status?: "" | "error" | "warning";
4
- dropdownClassName?: string;
5
- popupClassName?: string;
6
- }, unknown> & {
7
- WeekPicker: import("antd/lib/date-picker/generatePicker/interface").PickerComponentClass<Omit<import("antd/lib/date-picker/generatePicker").PickerProps<Date> & {
8
- status?: "" | "error" | "warning";
9
- dropdownClassName?: string;
10
- popupClassName?: string;
11
- }, "picker">, unknown>;
12
- MonthPicker: import("antd/lib/date-picker/generatePicker/interface").PickerComponentClass<Omit<import("antd/lib/date-picker/generatePicker").PickerProps<Date> & {
13
- status?: "" | "error" | "warning";
14
- dropdownClassName?: string;
15
- popupClassName?: string;
16
- }, "picker">, unknown>;
17
- YearPicker: import("antd/lib/date-picker/generatePicker/interface").PickerComponentClass<Omit<import("antd/lib/date-picker/generatePicker").PickerProps<Date> & {
18
- status?: "" | "error" | "warning";
19
- dropdownClassName?: string;
20
- popupClassName?: string;
21
- }, "picker">, unknown>;
22
- RangePicker: import("antd/lib/date-picker/generatePicker/interface").PickerComponentClass<import("antd/lib/date-picker/generatePicker").RangePickerProps<Date> & {
23
- dropdownClassName?: string;
24
- popupClassName?: string;
25
- }, unknown>;
26
- TimePicker: import("antd/lib/date-picker/generatePicker/interface").PickerComponentClass<Omit<Omit<import("rc-picker/lib/Picker").PickerTimeProps<Date>, "locale" | "generateConfig" | "hideHeader" | "components"> & {
27
- locale?: import("antd/lib/date-picker/generatePicker").PickerLocale;
28
- size?: import("antd/lib/button").ButtonSize;
29
- placement?: "bottomLeft" | "bottomRight" | "topLeft" | "topRight";
30
- bordered?: boolean;
31
- status?: "" | "error" | "warning";
32
- } & {
33
- status?: "" | "error" | "warning";
34
- dropdownClassName?: string;
35
- popupClassName?: string;
36
- }, "picker">, unknown>;
37
- QuarterPicker: import("antd/lib/date-picker/generatePicker/interface").PickerComponentClass<Omit<Omit<import("rc-picker/lib/Picker").PickerTimeProps<Date>, "locale" | "generateConfig" | "hideHeader" | "components"> & {
38
- locale?: import("antd/lib/date-picker/generatePicker").PickerLocale;
39
- size?: import("antd/lib/button").ButtonSize;
40
- placement?: "bottomLeft" | "bottomRight" | "topLeft" | "topRight";
41
- bordered?: boolean;
42
- status?: "" | "error" | "warning";
43
- } & {
44
- status?: "" | "error" | "warning";
45
- dropdownClassName?: string;
46
- popupClassName?: string;
47
- }, "picker">, unknown>;
48
- };
49
- declare type IDatePickerProps = {
50
- error?: boolean;
51
- onClear?: (e: any) => void;
52
- onTouchStart?: (e: any) => void;
53
- onClick?: (e: any) => void;
1
+ import React from 'react';
2
+ import { ReactNode } from 'react';
3
+ declare enum EDatePickerSize {
4
+ large = "large",
5
+ medium = "medium",
6
+ small = "small",
7
+ pure = "pure"
8
+ }
9
+ declare enum EDatePickerVariant {
10
+ filled = "filled",
11
+ outlined = "outlined",
12
+ pure = "pure"
13
+ }
14
+ interface IDatePicker {
15
+ value?: Date | [Date, Date];
16
+ isRange?: boolean;
17
+ isRangeSingle?: boolean;
18
+ isTwoCalendar?: boolean;
19
+ onChange?: (val: Date | [Date, Date]) => void;
20
+ onOpenChange?: (val: boolean) => void;
54
21
  format?: string;
55
- mask?: string;
56
- labelPlaceholder?: string;
57
- isWbTheme?: boolean;
22
+ size?: keyof typeof EDatePickerSize;
23
+ variant?: keyof typeof EDatePickerVariant;
58
24
  placeholder?: string;
25
+ allowClear?: boolean;
59
26
  className?: string;
60
- onChange?: (e: any) => void;
61
27
  suffixIcon?: ReactNode;
62
- } & ComponentProps<typeof AntDatePicker>;
63
- export declare const DatePicker: React.ForwardRefExoticComponent<IDatePickerProps & React.RefAttributes<unknown>>;
28
+ loading?: boolean;
29
+ error?: boolean;
30
+ disabled?: boolean;
31
+ renderExtraFooter?: () => ReactNode;
32
+ disabledDate?: (date: Date) => boolean;
33
+ dateRender?: (date: Date) => ReactNode;
34
+ valueRender?: (date: Date | [Date, Date]) => ReactNode;
35
+ onClick?: (e: MouseEvent) => void;
36
+ isOpen?: boolean;
37
+ }
38
+ export declare const DatePicker: ({ format, size, variant, ...props }: IDatePicker) => React.JSX.Element;
64
39
  export {};
@@ -4,3 +4,12 @@ declare const meta: Meta<typeof DatePicker>;
4
4
  export default meta;
5
5
  declare type Story = StoryObj<typeof DatePicker>;
6
6
  export declare const Default: Story;
7
+ export declare const Range: Story;
8
+ export declare const SizeLarge: Story;
9
+ export declare const SizeMedium: Story;
10
+ export declare const SizeSmall: Story;
11
+ export declare const SizePure: Story;
12
+ export declare const RangeSizeLarge: Story;
13
+ export declare const RangeSizeMedium: Story;
14
+ export declare const RangeSizeSmall: Story;
15
+ export declare const RangeSizePure: Story;
@@ -1,5 +1,4 @@
1
- import React from 'react';
2
- import { ComponentProps, ElementType, PropsWithChildren } from 'react';
1
+ import React, { ComponentProps, ElementType, PropsWithChildren } from 'react';
3
2
  declare type IFormControlProps<C extends ElementType> = {
4
3
  [key in keyof ComponentProps<C>]?: ComponentProps<C>[key];
5
4
  } & {
@@ -8,7 +7,11 @@ declare type IFormControlProps<C extends ElementType> = {
8
7
  component?: C;
9
8
  onChange?: any;
10
9
  errorPosition?: 'absolute' | 'relative' | 'static' | 'initial' | 'inherit';
10
+ tooltipText?: string;
11
+ onFocus?: React.FocusEventHandler<any>;
12
+ onBlur?: React.FocusEventHandler<any>;
13
+ hideTooltipOnClick?: boolean;
11
14
  };
12
15
  export declare const isRequiredField: (validationSchema: any, name: any) => any;
13
- export declare function FormControl<T extends ElementType>({ name, label, component, onChange, errorPosition, ...props }: PropsWithChildren<IFormControlProps<T>>): React.JSX.Element;
16
+ export declare function FormControl<T extends ElementType>({ name, label, component, onChange, errorPosition, tooltipText, hideTooltipOnClick, ...props }: PropsWithChildren<IFormControlProps<T>>): React.JSX.Element;
14
17
  export {};
@@ -0,0 +1,8 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import { FormControl } from './form-control';
3
+ declare const meta: Meta<typeof FormControl>;
4
+ export default meta;
5
+ declare type Story = StoryObj<typeof FormControl>;
6
+ export declare const TooltipOnError: Story;
7
+ export declare const TooltipStaysOpenWhileTyping: Story;
8
+ export declare const SelectWithHideTooltipOnClick: Story;
@@ -38,7 +38,6 @@ interface IHeadingProps {
38
38
  className?: string;
39
39
  centerText?: boolean;
40
40
  weight?: keyof typeof EHeadingWeight;
41
- isWbTheme?: boolean;
42
41
  }
43
- export declare const Heading: ({ children, level, mobLevel, addition, attention, warning, success, inverse, error, variant, className, centerText, weight, isWbTheme, }: IHeadingProps) => React.JSX.Element;
42
+ export declare const Heading: ({ children, level, mobLevel, addition, attention, warning, success, inverse, error, variant, className, centerText, weight, }: IHeadingProps) => React.JSX.Element;
44
43
  export {};
@@ -36,7 +36,6 @@ export declare type IInputProps = {
36
36
  mask?: string;
37
37
  maskObj?: any;
38
38
  maskParams?: any;
39
- isWbTheme?: boolean;
40
39
  onClear?: (val?: string) => void;
41
40
  onBeforeMask?: (val?: string) => void;
42
41
  onPointerUp?: (e: any) => void;
@@ -63,11 +62,10 @@ export declare const Input: React.ForwardRefExoticComponent<{
63
62
  mask?: string;
64
63
  maskObj?: any;
65
64
  maskParams?: any;
66
- isWbTheme?: boolean;
67
65
  onClear?: (val?: string) => void;
68
66
  onBeforeMask?: (val?: string) => void;
69
67
  onPointerUp?: (e: any) => void;
70
68
  onChange?: (value: string, event: ChangeEvent<HTMLInputElement>) => void;
71
69
  onSearch?: ((val: string) => void) | ((val: string) => Promise<void>);
72
70
  valueTransformer?: (value: string) => string;
73
- } & Omit<React.InputHTMLAttributes<HTMLInputElement>, "variant" | "size" | "onChange"> & React.RefAttributes<HTMLInputElement>>;
71
+ } & Omit<React.InputHTMLAttributes<HTMLInputElement>, "size" | "variant" | "onChange"> & React.RefAttributes<HTMLInputElement>>;
@@ -0,0 +1,8 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import { Link } from './link';
3
+ declare const meta: Meta<typeof Link>;
4
+ export default meta;
5
+ declare type Story = StoryObj<typeof Link>;
6
+ export declare const Default: Story;
7
+ export declare const External: Story;
8
+ export declare const WithIcon: Story;
@@ -0,0 +1 @@
1
+ export { Pagination } from './pagination';
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ interface IPaginationProps {
3
+ total: number;
4
+ page: number;
5
+ perPage: number;
6
+ aroundCount?: number;
7
+ onChange?: (page: number, perPage?: number) => void;
8
+ className?: string;
9
+ loading?: boolean;
10
+ }
11
+ export declare const Pagination: ({ total, page, perPage, aroundCount, onChange, className, loading, }: IPaginationProps) => React.JSX.Element;
12
+ export {};
@@ -21,8 +21,7 @@ declare type IRadioProps<T> = Omit<RadioGroupProps, 'options' | 'onChange' | 'va
21
21
  className?: string;
22
22
  classNameContainer?: string;
23
23
  error?: boolean;
24
- isWbTheme?: boolean;
25
24
  onRenderOption?: (value: T) => ReactNode;
26
25
  };
27
- export declare function Radio<T = any>({ options, position, labelPosition, valueKey, labelKey, labels, className, error, isWbTheme, onRenderOption, ...props }: IRadioProps<T>): React.JSX.Element;
26
+ export declare function Radio<T = any>({ options, position, labelPosition, valueKey, labelKey, labels, className, error, onRenderOption, ...props }: IRadioProps<T>): React.JSX.Element;
28
27
  export {};
@@ -32,8 +32,9 @@ declare type ISelectProps<T> = Omit<SelectProps, 'options' | 'onChange'> & {
32
32
  modalSearchable?: boolean;
33
33
  modalPlaceholder?: boolean;
34
34
  modalShowConfirmButton?: boolean;
35
- isWbTheme?: boolean;
36
35
  notFoundContent?: React.ReactNode;
36
+ open?: boolean;
37
+ selectTextOnClick?: boolean;
37
38
  };
38
39
  export declare const Select: <T = any>(props: ISelectProps<T>, ref: Ref<HTMLInputElement>) => ReactElement;
39
40
  export {};
@@ -3,4 +3,22 @@ import { Select } from './select';
3
3
  declare const meta: Meta<typeof Select>;
4
4
  export default meta;
5
5
  declare type Story = StoryObj<typeof Select>;
6
- export declare const AllDefault: Story;
6
+ export declare const Default: Story;
7
+ export declare const WithObjectOptions: Story;
8
+ export declare const WithGroupedOptions: Story;
9
+ export declare const WithValue: Story;
10
+ export declare const Disabled: Story;
11
+ export declare const WithError: Story;
12
+ export declare const Stacked: Story;
13
+ export declare const SizeLarge: Story;
14
+ export declare const SizeMiddle: Story;
15
+ export declare const SizeSmall: Story;
16
+ export declare const WithServerSearch: Story;
17
+ export declare const WithServerSearchGroup: Story;
18
+ export declare const WithCustomRenderOption: Story;
19
+ export declare const MobileModal: Story;
20
+ export declare const WithLabelPlaceholder: Story;
21
+ export declare const WithLabels: Story;
22
+ export declare const Loading: Story;
23
+ export declare const WithNotFoundContent: Story;
24
+ export declare const WithNewClearIcon: Story;
@@ -0,0 +1,18 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import { Selector } from './selector';
3
+ declare const meta: Meta<typeof Selector>;
4
+ export default meta;
5
+ declare type Story = StoryObj<typeof Selector>;
6
+ export declare const BasicSlider: Story;
7
+ export declare const SliderWithStep: Story;
8
+ export declare const SliderWithMarks: Story;
9
+ export declare const DisabledSlider: Story;
10
+ export declare const CustomRangeSlider: Story;
11
+ export declare const RangeSlider: Story;
12
+ export declare const RangeSliderWithStep: Story;
13
+ export declare const PriceRangeSlider: Story;
14
+ export declare const RangeSliderWithMarks: Story;
15
+ export declare const DisabledRangeSlider: Story;
16
+ export declare const AllVariants: Story;
17
+ export declare const WithAfterChange: Story;
18
+ export declare const WithTooltips: Story;
@@ -5,8 +5,7 @@ declare enum ESkeletonVariant {
5
5
  inverse = "inverse"
6
6
  }
7
7
  declare type ISkeletonProps = SkeletonProps & {
8
- isWbTheme?: boolean;
9
8
  variant?: keyof typeof ESkeletonVariant;
10
9
  };
11
- export declare const Skeleton: ({ isWbTheme, variant, ...props }: ISkeletonProps) => React.JSX.Element;
10
+ export declare const Skeleton: ({ variant, ...props }: ISkeletonProps) => React.JSX.Element;
12
11
  export {};
@@ -1,19 +1,22 @@
1
1
  import React from 'react';
2
+ import { SwiperOptions } from 'swiper';
2
3
  interface ISliderProps {
3
4
  items: any[];
4
- slidesPerView: any;
5
+ slidesPerView: number | 'auto';
5
6
  showNavigation?: boolean;
7
+ hoverNavigation?: boolean;
6
8
  navPosition?: 'inset' | '';
7
9
  renderItem: (item: any, index: number) => any;
8
10
  viewItem?: (item: any, index: number) => void;
9
11
  loop?: boolean;
10
12
  asyncReady?: boolean;
11
13
  spaceBetween?: number;
12
- autoplay?: boolean;
13
14
  delay?: number;
14
15
  freeMode?: boolean;
15
16
  showCounter?: boolean;
16
17
  centeredSlides?: boolean;
18
+ centeredSlidesBounds?: boolean;
19
+ centerInsufficientSlides?: boolean;
17
20
  className?: string;
18
21
  classNamePrev?: string;
19
22
  classNameNext?: string;
@@ -29,5 +32,5 @@ interface ISliderProps {
29
32
  speed?: number;
30
33
  effect?: 'slide' | 'fade' | 'cube' | 'coverflow' | 'flip';
31
34
  }
32
- export declare const Slider: ({ items, slidesPerView, renderItem, viewItem, loop, asyncReady, showNavigation, navPosition, spaceBetween, autoplay, delay, freeMode, showCounter, centeredSlides, className, classNamePrev, classNameNext, touchStartPreventDefault, overflow, preloadImages, shortSwipes, longSwipes, longSwipesMs, longSwipesRatio, preventClicks, preventClicksPropagation, effect, speed, }: ISliderProps) => React.JSX.Element;
35
+ export declare const Slider: ({ items, slidesPerView, renderItem, viewItem, loop, asyncReady, showNavigation, hoverNavigation, navPosition, spaceBetween, autoplay, delay, freeMode, showCounter, centeredSlides, centeredSlidesBounds, centerInsufficientSlides, className, classNamePrev, classNameNext, touchStartPreventDefault, overflow, preloadImages, shortSwipes, longSwipes, longSwipesMs, longSwipesRatio, preventClicks, preventClicksPropagation, effect, speed, ...props }: ISliderProps & SwiperOptions) => React.JSX.Element;
33
36
  export {};
@@ -4,7 +4,6 @@ interface ISpoilerProps {
4
4
  title: string | ReactNode;
5
5
  initialValue?: boolean;
6
6
  className?: string;
7
- isWbTheme?: boolean;
8
7
  }
9
8
  export declare const Spoiler: (props: PropsWithChildren<ISpoilerProps>) => React.JSX.Element;
10
9
  export {};
@@ -17,7 +17,6 @@ declare type IStackedInputProps<T> = {
17
17
  labelPlaceholder?: string;
18
18
  mask?: IInputProps['mask'];
19
19
  value?: string;
20
- isWbTheme?: boolean;
21
20
  onRenderOption?: (item: T) => ReactNode;
22
21
  disabled?: boolean;
23
22
  } & ComponentProps<typeof Input> & Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'variant' | 'onChange'>;
@@ -12,6 +12,7 @@ declare type ISwitchProps = {
12
12
  onChange?: (value: boolean) => void;
13
13
  disabled?: boolean;
14
14
  size?: keyof typeof ESwitchSize;
15
+ mobSize?: keyof typeof ESwitchSize;
15
16
  };
16
- export declare const Switch: ({ size, ...props }: ISwitchProps) => React.JSX.Element;
17
+ export declare const Switch: ({ size, mobSize, ...props }: ISwitchProps) => React.JSX.Element;
17
18
  export {};
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  declare const _default: {
3
3
  title: string;
4
- component: ({ size, ...props }: {
4
+ component: ({ size, mobSize, ...props }: {
5
5
  value?: boolean;
6
6
  name?: string;
7
7
  title?: string;
@@ -9,6 +9,7 @@ declare const _default: {
9
9
  onChange?: (value: boolean) => void;
10
10
  disabled?: boolean;
11
11
  size?: "small" | "medium" | "large";
12
+ mobSize?: "small" | "medium" | "large";
12
13
  }) => React.JSX.Element;
13
14
  };
14
15
  export default _default;
@@ -0,0 +1,3 @@
1
+ export { Table } from './table';
2
+ export type { ITableColumn, ITablePagination } from './table.types';
3
+ export { useTableHook } from './table.hook';
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import { ReactNode } from 'react';
3
+ import { ITableColumn } from './table.types';
4
+ interface ITableRow<T> {
5
+ item: T;
6
+ index: number;
7
+ keyId: string;
8
+ columns: ITableColumn<T>[];
9
+ onClickRow: (item: T) => void;
10
+ onRenderCell: (item: T, column: ITableColumn<T>) => ReactNode;
11
+ onRenderRow?: (item: T, node: JSX.Element) => JSX.Element;
12
+ onRenderDetail: (item: T) => ReactNode;
13
+ onRenderControls: (item: T) => ReactNode;
14
+ }
15
+ export declare function TableRow<T>({ item, columns, keyId, index, onClickRow, onRenderCell, onRenderRow, onRenderDetail, onRenderControls, }: ITableRow<T>): React.JSX.Element;
16
+ export {};
@@ -0,0 +1,23 @@
1
+ import React from 'react';
2
+ import { ReactNode } from 'react';
3
+ import { ITableColumn, ITableSort } from './table.types';
4
+ export interface ITableProps<T> {
5
+ items: T[];
6
+ columns: ITableColumn<T>[];
7
+ onRenderControls?: (item: T) => ReactNode;
8
+ keyId?: string;
9
+ loading?: boolean;
10
+ onRenderDetail?: (item: T) => ReactNode;
11
+ onRenderRow?: (item: T, node: JSX.Element) => JSX.Element;
12
+ showPagination?: boolean;
13
+ pagination?: {
14
+ limit?: number;
15
+ offset?: number;
16
+ };
17
+ total?: number;
18
+ sort?: ITableSort;
19
+ onChangePagination?: (limit: number, offset: number) => void;
20
+ onChangeSort?: (key: string, order: 'asc' | 'desc') => void;
21
+ className?: string;
22
+ }
23
+ export declare function Table<T>({ items, columns, keyId, loading, onRenderDetail, onRenderRow, total, showPagination, pagination, onChangePagination, sort, onChangeSort, onRenderControls, className, }: ITableProps<T>): React.JSX.Element;
@@ -0,0 +1,33 @@
1
+ import { Dispatch, SetStateAction } from 'react';
2
+ import { ITablePagination, ITableSort } from './table.types';
3
+ interface ITableHookBaseProps<T, F> {
4
+ request: (pagination?: ITablePagination, sort?: ITableSort, filter?: F) => Promise<{
5
+ list: T;
6
+ total: number;
7
+ }>;
8
+ pagination?: ITablePagination;
9
+ filter?: F;
10
+ sort?: ITableSort;
11
+ }
12
+ interface ITableHookServerProps<T, F> extends ITableHookBaseProps<T, F> {
13
+ }
14
+ interface ITableHookLocalProps<T, F> extends ITableHookBaseProps<T, F> {
15
+ localFn: (list: T, filter?: F, sort?: ITableSort, pagination?: ITablePagination) => T;
16
+ local: boolean;
17
+ }
18
+ interface IUseTableHookReturn<T, F> {
19
+ refresh: () => void;
20
+ list: T;
21
+ loading: boolean;
22
+ error: any;
23
+ total: number;
24
+ pagination: ITablePagination;
25
+ sort: ITableSort;
26
+ filter: F;
27
+ setPagination: Dispatch<SetStateAction<ITablePagination>>;
28
+ setSort: (val: ITableSort) => void;
29
+ setFilter: Dispatch<SetStateAction<F>>;
30
+ }
31
+ export declare function useTableHook<T, F>(props: ITableHookServerProps<T, F>): IUseTableHookReturn<T, F>;
32
+ export declare function useTableHook<T, F>(props: ITableHookLocalProps<T, F>): IUseTableHookReturn<T, F>;
33
+ export {};
@@ -0,0 +1,32 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import { Table } from './table';
3
+ interface User {
4
+ id: number;
5
+ name: string;
6
+ email: string;
7
+ role: string;
8
+ status: 'active' | 'inactive';
9
+ createdAt: Date;
10
+ tags?: string[];
11
+ }
12
+ interface Product {
13
+ id: string;
14
+ title: string;
15
+ price: number;
16
+ category: string;
17
+ stock: number;
18
+ description: string;
19
+ }
20
+ declare const meta: Meta<typeof Table>;
21
+ export default meta;
22
+ declare type Story = StoryObj<typeof Table<User>>;
23
+ export declare const Default: Story;
24
+ export declare const WithSorting: Story;
25
+ export declare const WithPagination: Story;
26
+ export declare const WithCustomCells: Story;
27
+ export declare const WithActions: Story;
28
+ export declare const WithExpandableRows: Story;
29
+ export declare const Loading: Story;
30
+ export declare const Empty: Story;
31
+ export declare const FullFeatured: Story;
32
+ export declare const ProductsExample: StoryObj<typeof Table<Product>>;
@@ -0,0 +1,19 @@
1
+ import { ReactNode } from 'react';
2
+ export interface ITableColumn<T> {
3
+ key: string;
4
+ sortKey?: string;
5
+ title: string;
6
+ default?: string;
7
+ cellClassName?: string;
8
+ allowSort?: boolean;
9
+ width?: string | number;
10
+ renderCell?: (item: T, column: ITableColumn<T>) => ReactNode;
11
+ }
12
+ export interface ITablePagination {
13
+ offset: number;
14
+ limit: number;
15
+ }
16
+ export interface ITableSort {
17
+ key: string;
18
+ order: 'asc' | 'desc';
19
+ }
@@ -12,3 +12,7 @@ export declare enum EPassengerGenderName {
12
12
  export default meta;
13
13
  declare type Story = StoryObj<typeof TagBox>;
14
14
  export declare const Default: Story;
15
+ export declare const WithClear: Story;
16
+ export declare const SizeSmall: Story;
17
+ export declare const SizeMiddle: Story;
18
+ export declare const SizeLarge: Story;
@@ -26,7 +26,6 @@ interface IButtonProps {
26
26
  shadow?: boolean;
27
27
  onClick: (e?: boolean) => void;
28
28
  selectedClassName?: string;
29
- isWbTheme?: boolean;
30
29
  }
31
- export declare const TagButton: ({ variant, size, disabled, selected, children, onClick, selectedClassName, isWbTheme, }: PropsWithChildren<IButtonProps>) => React.JSX.Element;
30
+ export declare const TagButton: ({ variant, size, disabled, selected, children, onClick, selectedClassName, }: PropsWithChildren<IButtonProps>) => React.JSX.Element;
32
31
  export {};
@@ -52,7 +52,6 @@ interface ITextProps {
52
52
  onClick?: (e: any) => void;
53
53
  onMouseOver?: (e: any) => void;
54
54
  onMouseLeave?: (e: any) => void;
55
- isWbTheme?: boolean;
56
55
  }
57
- export declare const Text: ({ children, size, mobSize, bold, weight, variant, addition, success, error, inverse, attention, warning, className, style, through, tag, onClick, onMouseLeave, onMouseOver, isWbTheme, }: ITextProps) => React.JSX.Element;
56
+ export declare const Text: ({ children, size, mobSize, bold, weight, variant, addition, success, error, inverse, attention, warning, className, style, through, tag, onClick, onMouseLeave, onMouseOver, }: ITextProps) => React.JSX.Element;
58
57
  export {};
@@ -24,8 +24,7 @@ export declare const TextArea: React.ForwardRefExoticComponent<{
24
24
  autoResize?: boolean;
25
25
  placeholder?: string;
26
26
  labelPlaceholder?: string | ReactNode;
27
- isWbTheme?: boolean;
28
27
  onClear?: () => void;
29
28
  onSearch?: (e: any) => void;
30
29
  onChange?: (value: string, event?: ChangeEvent<HTMLTextAreaElement>) => void;
31
- } & Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, "variant" | "size" | "onChange"> & React.RefAttributes<HTMLTextAreaElement>>;
30
+ } & Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, "size" | "variant" | "onChange"> & React.RefAttributes<HTMLTextAreaElement>>;
@@ -1,4 +1,4 @@
1
- import React, { PropsWithChildren } from 'react';
1
+ import React, { CSSProperties, MouseEvent as ReactMouseEvent, PropsWithChildren } from 'react';
2
2
  import { TooltipPosition } from './tooltip.utils';
3
3
  declare type ITootipProps = {
4
4
  title: any;
@@ -6,7 +6,14 @@ declare type ITootipProps = {
6
6
  onOpenChange?: (val: boolean) => void;
7
7
  placement?: keyof typeof TooltipPosition;
8
8
  trigger?: any;
9
- isWbTheme?: boolean;
9
+ open?: boolean;
10
+ showClose?: boolean;
11
+ onCloseClick?: (event?: ReactMouseEvent<HTMLElement> | MouseEvent) => void;
12
+ width?: number | string;
13
+ zIndex?: number;
14
+ overlayStyle?: CSSProperties;
15
+ position?: 'fixed' | 'absolute';
16
+ allowVerticalScroll?: boolean;
10
17
  };
11
- export declare const Tooltip: ({ placement, isWbTheme, ...props }: PropsWithChildren<ITootipProps>) => React.JSX.Element;
18
+ export declare const Tooltip: ({ placement, open, position, allowVerticalScroll, ...props }: PropsWithChildren<ITootipProps>) => React.JSX.Element;
12
19
  export {};
@@ -4,3 +4,6 @@ declare const meta: Meta<typeof Tooltip>;
4
4
  export default meta;
5
5
  declare type Story = StoryObj<typeof Tooltip>;
6
6
  export declare const AllDefault: Story;
7
+ export declare const WithCloseButton: Story;
8
+ export declare const CustomWidth: Story;
9
+ export declare const ResizeTest: Story;