@mindly/ui-components 5.19.0 → 5.21.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 (60) hide show
  1. package/dist/cjs/configs/tailwind/colors.d.ts +2 -0
  2. package/dist/cjs/index.js +14 -5
  3. package/dist/cjs/lib2/shared/assets/icons/IconCancelRounded.d.ts +10 -0
  4. package/dist/cjs/lib2/shared/assets/icons/IconCapFilled.d.ts +10 -0
  5. package/dist/cjs/lib2/shared/assets/icons/IconCheck.d.ts +9 -0
  6. package/dist/cjs/lib2/shared/assets/icons/IconWarning.d.ts +7 -0
  7. package/dist/cjs/lib2/shared/assets/icons/index.d.ts +4 -0
  8. package/dist/cjs/lib2/shared/hooks/index.d.ts +1 -0
  9. package/dist/cjs/lib2/shared/hooks/useCircleRating.d.ts +26 -0
  10. package/dist/cjs/lib2/shared/providers/CircleRatingProvider/CircleRatingProvider.d.ts +9 -0
  11. package/dist/cjs/lib2/shared/providers/CircleRatingProvider/index.d.ts +1 -0
  12. package/dist/cjs/lib2/shared/providers/index.d.ts +1 -0
  13. package/dist/cjs/lib2/shared/types/index.d.ts +1 -0
  14. package/dist/cjs/lib2/shared/types/ratingCircleTypes.d.ts +73 -0
  15. package/dist/cjs/lib2/shared/ui/ItemCard/ItemCard.d.ts +4 -0
  16. package/dist/cjs/lib2/shared/ui/ItemCard/index.d.ts +1 -0
  17. package/dist/cjs/lib2/shared/ui/ItemCard/styles.d.ts +50 -0
  18. package/dist/cjs/lib2/shared/ui/ItemCard/types.d.ts +6 -0
  19. package/dist/cjs/lib2/shared/ui/RatingCircle/RatingCircle.d.ts +3 -0
  20. package/dist/cjs/lib2/shared/ui/RatingCircle/RatingCircle.stories.d.ts +6 -0
  21. package/dist/cjs/lib2/shared/ui/RatingCircle/RatingCircleBreakpoints.d.ts +3 -0
  22. package/dist/cjs/lib2/shared/ui/RatingCircle/RatingCircleContent.d.ts +3 -0
  23. package/dist/cjs/lib2/shared/ui/RatingCircle/RatingCircleIcons.d.ts +10 -0
  24. package/dist/cjs/lib2/shared/ui/RatingCircle/RatingCircleLegend.d.ts +3 -0
  25. package/dist/cjs/lib2/shared/ui/RatingCircle/RatingCircleWrapper.d.ts +7 -0
  26. package/dist/cjs/lib2/shared/ui/RatingCircle/index.d.ts +1 -0
  27. package/dist/cjs/lib2/shared/ui/RatingCircle/styles.d.ts +235 -0
  28. package/dist/cjs/lib2/shared/ui/index.d.ts +2 -0
  29. package/dist/esm/configs/tailwind/colors.d.ts +2 -0
  30. package/dist/esm/index.js +14 -5
  31. package/dist/esm/lib2/shared/assets/icons/IconCancelRounded.d.ts +10 -0
  32. package/dist/esm/lib2/shared/assets/icons/IconCapFilled.d.ts +10 -0
  33. package/dist/esm/lib2/shared/assets/icons/IconCheck.d.ts +9 -0
  34. package/dist/esm/lib2/shared/assets/icons/IconWarning.d.ts +7 -0
  35. package/dist/esm/lib2/shared/assets/icons/index.d.ts +4 -0
  36. package/dist/esm/lib2/shared/hooks/index.d.ts +1 -0
  37. package/dist/esm/lib2/shared/hooks/useCircleRating.d.ts +26 -0
  38. package/dist/esm/lib2/shared/providers/CircleRatingProvider/CircleRatingProvider.d.ts +9 -0
  39. package/dist/esm/lib2/shared/providers/CircleRatingProvider/index.d.ts +1 -0
  40. package/dist/esm/lib2/shared/providers/index.d.ts +1 -0
  41. package/dist/esm/lib2/shared/types/index.d.ts +1 -0
  42. package/dist/esm/lib2/shared/types/ratingCircleTypes.d.ts +73 -0
  43. package/dist/esm/lib2/shared/ui/ItemCard/ItemCard.d.ts +4 -0
  44. package/dist/esm/lib2/shared/ui/ItemCard/index.d.ts +1 -0
  45. package/dist/esm/lib2/shared/ui/ItemCard/styles.d.ts +50 -0
  46. package/dist/esm/lib2/shared/ui/ItemCard/types.d.ts +6 -0
  47. package/dist/esm/lib2/shared/ui/RatingCircle/RatingCircle.d.ts +3 -0
  48. package/dist/esm/lib2/shared/ui/RatingCircle/RatingCircle.stories.d.ts +6 -0
  49. package/dist/esm/lib2/shared/ui/RatingCircle/RatingCircleBreakpoints.d.ts +3 -0
  50. package/dist/esm/lib2/shared/ui/RatingCircle/RatingCircleContent.d.ts +3 -0
  51. package/dist/esm/lib2/shared/ui/RatingCircle/RatingCircleIcons.d.ts +10 -0
  52. package/dist/esm/lib2/shared/ui/RatingCircle/RatingCircleLegend.d.ts +3 -0
  53. package/dist/esm/lib2/shared/ui/RatingCircle/RatingCircleWrapper.d.ts +7 -0
  54. package/dist/esm/lib2/shared/ui/RatingCircle/index.d.ts +1 -0
  55. package/dist/esm/lib2/shared/ui/RatingCircle/styles.d.ts +235 -0
  56. package/dist/esm/lib2/shared/ui/index.d.ts +2 -0
  57. package/dist/index.d.ts +232 -91
  58. package/package.json +1 -1
  59. package/src/configs/tailwind/colors.ts +2 -0
  60. package/src/lib2/shared/css/tailwind.css +2 -0
@@ -0,0 +1,10 @@
1
+ import * as React from 'react';
2
+ import { FC } from 'react';
3
+ interface IconProps extends React.SVGAttributes<SVGElement> {
4
+ size?: number | string;
5
+ color?: string;
6
+ className?: string;
7
+ style?: React.CSSProperties;
8
+ }
9
+ export declare const IconCancelRounded: FC<IconProps>;
10
+ export {};
@@ -0,0 +1,10 @@
1
+ import * as React from 'react';
2
+ import { FC } from 'react';
3
+ interface IconProps extends React.SVGAttributes<SVGElement> {
4
+ size?: number | string;
5
+ color?: string;
6
+ className?: string;
7
+ style?: React.CSSProperties;
8
+ }
9
+ export declare const IconCapFilled: FC<IconProps>;
10
+ export {};
@@ -0,0 +1,9 @@
1
+ import * as React from 'react';
2
+ interface IconProps extends React.SVGAttributes<SVGElement> {
3
+ size?: number | string;
4
+ color?: string;
5
+ className?: string;
6
+ style?: React.CSSProperties;
7
+ }
8
+ export declare function IconCheck({ color, size, ...other }: IconProps): JSX.Element;
9
+ export {};
@@ -0,0 +1,7 @@
1
+ import * as React from 'react';
2
+ interface IconProps extends React.SVGAttributes<SVGElement> {
3
+ size?: number | string;
4
+ color?: string;
5
+ }
6
+ export declare function IconWarning({ color, size, ...other }: IconProps): JSX.Element;
7
+ export {};
@@ -32,6 +32,7 @@ export * from './IconLetter';
32
32
  export * from './IconSpinner';
33
33
  export * from './IconEye';
34
34
  export * from './IconEyeOff';
35
+ export * from './IconWarning';
35
36
  export * from './IconGift';
36
37
  export * from './IconCreditCard';
37
38
  export * from './IconQuestion';
@@ -39,3 +40,6 @@ export * from './IconPaper';
39
40
  export * from './IconChat3d';
40
41
  export * from './IconNotficationMuted';
41
42
  export * from './IconCheckSmall';
43
+ export * from './IconCheck';
44
+ export * from './IconCapFilled';
45
+ export * from './IconCancelRounded';
@@ -2,3 +2,4 @@ export * from './use-dom-ref';
2
2
  export * from './use-event';
3
3
  export * from './useAutoFocus';
4
4
  export * from './useToastContext';
5
+ export * from './useCircleRating';
@@ -0,0 +1,26 @@
1
+ import { WithTranslation } from 'react-i18next';
2
+ import { CircleRatingRange, CircleRatingDataProps, CircleRatingDataResult, ProgressRangeProps, BreakPointPositionResult, CircleRatingContextData } from '../types/ratingCircleTypes';
3
+ export declare const BREAKPOINT_ICON_SIZE = 20;
4
+ export declare function useCircleRatingRenderData({ progress, size, maxValue, isReverse, }: CircleRatingDataProps): CircleRatingDataResult;
5
+ export declare function useRangeIndex({ progress, maxValue, ranges, isReverse }: ProgressRangeProps): number;
6
+ export declare function getProgressForBreakPoint({ maxValue, breakPoint, }: {
7
+ maxValue: number;
8
+ breakPoint: number;
9
+ }): number;
10
+ export declare function useBreakPointsPosition({ maxValue, breakPoints, radius, strokeWidth, }: {
11
+ maxValue?: number;
12
+ breakPoints?: number[];
13
+ radius?: number;
14
+ strokeWidth?: number;
15
+ }): BreakPointPositionResult[];
16
+ export declare function useRatingCircleLegend({ ranges, t, isReverse }: {
17
+ ranges: CircleRatingRange[];
18
+ t: WithTranslation['t'];
19
+ isReverse?: boolean;
20
+ }): string[];
21
+ export declare function useRatingCircleBreakPoints({ ranges, maxValue, isReverse, }: {
22
+ ranges: CircleRatingRange[];
23
+ maxValue: number;
24
+ isReverse?: boolean;
25
+ }): number[];
26
+ export declare function useRatingContext(): CircleRatingContextData;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import { WithTranslation } from 'react-i18next';
3
+ import { CircleRatingContextProps, CircleRatingContextData } from '../../types';
4
+ export declare const CircleRatingContext: React.Context<CircleRatingContextData>;
5
+ export declare const CircleRatingProvider: ({ children, data, t, }: {
6
+ children: JSX.Element;
7
+ data: CircleRatingContextProps;
8
+ t: TFunction<import("react-i18next").FallbackNs<Ns>, KPrefix>;
9
+ }) => JSX.Element | null;
@@ -0,0 +1 @@
1
+ export * from './CircleRatingProvider';
@@ -1,2 +1,3 @@
1
1
  export * from './ThemeProvider';
2
2
  export * from './ToastProvider';
3
+ export * from './CircleRatingProvider';
@@ -0,0 +1 @@
1
+ export * from './ratingCircleTypes';
@@ -0,0 +1,73 @@
1
+ export declare enum CircleRatingSize {
2
+ 'S' = "S",
3
+ 'M' = "M",
4
+ 'L' = "L"
5
+ }
6
+ export type SizeValues = {
7
+ [size in CircleRatingSize]: number;
8
+ };
9
+ export type CircleRatingContent = {
10
+ text?: string;
11
+ isPercentage?: boolean;
12
+ showIcon?: boolean;
13
+ };
14
+ export type CircleRatingDataProps = {
15
+ progress: number;
16
+ size: keyof typeof CircleRatingSize;
17
+ maxValue: number;
18
+ isReverse?: boolean;
19
+ };
20
+ export type CircleRatingDataResult = {
21
+ circleSize: number;
22
+ radius: number;
23
+ circumference: number;
24
+ dash: number;
25
+ viewBox: string;
26
+ strokeWidth: number;
27
+ };
28
+ export type CircleRatingRange = {
29
+ min: number | null;
30
+ max: number | null;
31
+ };
32
+ export type ProgressRangeProps = {
33
+ progress: number;
34
+ maxValue: number;
35
+ ranges: CircleRatingRange[];
36
+ isReverse?: boolean;
37
+ };
38
+ export type BreakPointPositionProps = {
39
+ radius?: number;
40
+ strokeWidth?: number;
41
+ progress?: number;
42
+ };
43
+ export type BreakPointPositionResult = {
44
+ top: number;
45
+ left: number;
46
+ };
47
+ export type CircleRatingComponentProps = {
48
+ size: keyof typeof CircleRatingSize;
49
+ content?: CircleRatingContent | null;
50
+ progress: number;
51
+ ranges: CircleRatingRange[];
52
+ isColorless?: boolean;
53
+ isRatingDisabled?: boolean;
54
+ isShowLegend?: boolean;
55
+ isShowBreakPoints?: boolean;
56
+ isReverse?: boolean;
57
+ isZeroTransparent?: boolean;
58
+ };
59
+ export type CircleRatingContextProps = CircleRatingComponentProps & {
60
+ legend?: string[];
61
+ breakPoints?: number[];
62
+ };
63
+ export type CircleRatingContextData = CircleRatingContextProps & {
64
+ circleSize: number;
65
+ radius: number;
66
+ strokeWidth: number;
67
+ circumference: number;
68
+ dash: number;
69
+ viewBox: string;
70
+ maxValue: number;
71
+ percentage: number;
72
+ styles: any;
73
+ };
@@ -0,0 +1,4 @@
1
+ import * as React from 'react';
2
+ import { ItemCardProps } from './types';
3
+ declare const _default: React.NamedExoticComponent<ItemCardProps>;
4
+ export default _default;
@@ -0,0 +1 @@
1
+ export { default as ItemCard } from './ItemCard';
@@ -0,0 +1,50 @@
1
+ export declare const itemCardStyles: import("tailwind-variants").TVReturnType<{
2
+ variant: {
3
+ neutral: "bg-color-background-anti-flash-light";
4
+ };
5
+ size: {
6
+ M: "p-5 rounded-[30px]";
7
+ };
8
+ }, undefined, "", import("tailwind-variants/dist/config").TVConfig<{
9
+ variant: {
10
+ neutral: "bg-color-background-anti-flash-light";
11
+ };
12
+ size: {
13
+ M: "p-5 rounded-[30px]";
14
+ };
15
+ }, {
16
+ variant: {
17
+ neutral: "bg-color-background-anti-flash-light";
18
+ };
19
+ size: {
20
+ M: "p-5 rounded-[30px]";
21
+ };
22
+ }>, {
23
+ variant: {
24
+ neutral: "bg-color-background-anti-flash-light";
25
+ };
26
+ size: {
27
+ M: "p-5 rounded-[30px]";
28
+ };
29
+ }, undefined, import("tailwind-variants").TVReturnType<{
30
+ variant: {
31
+ neutral: "bg-color-background-anti-flash-light";
32
+ };
33
+ size: {
34
+ M: "p-5 rounded-[30px]";
35
+ };
36
+ }, undefined, "", import("tailwind-variants/dist/config").TVConfig<{
37
+ variant: {
38
+ neutral: "bg-color-background-anti-flash-light";
39
+ };
40
+ size: {
41
+ M: "p-5 rounded-[30px]";
42
+ };
43
+ }, {
44
+ variant: {
45
+ neutral: "bg-color-background-anti-flash-light";
46
+ };
47
+ size: {
48
+ M: "p-5 rounded-[30px]";
49
+ };
50
+ }>, unknown, unknown, undefined>>;
@@ -0,0 +1,6 @@
1
+ import * as React from 'react';
2
+ export type ItemCardVariants = 'neutral';
3
+ export type ItemCardProps = React.ComponentPropsWithoutRef<'div'> & {
4
+ variant: ItemCardVariants;
5
+ size?: 'M';
6
+ };
@@ -0,0 +1,3 @@
1
+ import { FC } from 'react';
2
+ declare const RatingCircle: FC;
3
+ export default RatingCircle;
@@ -0,0 +1,6 @@
1
+ import type { Meta, StoryObj } from '@storybook/react';
2
+ import RatingCircleWrapper from './RatingCircleWrapper';
3
+ declare const meta: Meta<typeof RatingCircleWrapper>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof RatingCircleWrapper>;
6
+ export declare const Default: Story;
@@ -0,0 +1,3 @@
1
+ import { FC } from 'react';
2
+ declare const RatingCircleBreakpoints: FC;
3
+ export default RatingCircleBreakpoints;
@@ -0,0 +1,3 @@
1
+ import { FC } from 'react';
2
+ declare const RatingCircleContent: FC;
3
+ export default RatingCircleContent;
@@ -0,0 +1,10 @@
1
+ export declare function CircleRatingIcon({ index, className, }: {
2
+ index: number;
3
+ className: string;
4
+ }): JSX.Element;
5
+ export declare function CircleBreakpointIcon({ index, top, left, className, }: {
6
+ index: number;
7
+ top: number;
8
+ left: number;
9
+ className: string;
10
+ }): JSX.Element;
@@ -0,0 +1,3 @@
1
+ import { FC } from 'react';
2
+ declare const RatingCircleLegend: FC;
3
+ export default RatingCircleLegend;
@@ -0,0 +1,7 @@
1
+ import { FC } from 'react';
2
+ import { WithTranslation } from 'react-i18next';
3
+ import { CircleRatingComponentProps } from '../../types';
4
+ declare const RatingCircleWrapper: FC<CircleRatingComponentProps & {
5
+ t: WithTranslation | any;
6
+ }>;
7
+ export default RatingCircleWrapper;
@@ -0,0 +1 @@
1
+ export { default as RatingCircleWrapper } from './RatingCircleWrapper';
@@ -0,0 +1,235 @@
1
+ export declare const circleRatingStyles: import("tailwind-variants").TVReturnType<{
2
+ transparent: {
3
+ true: {
4
+ coloredStroke: string;
5
+ };
6
+ };
7
+ isColorless: {
8
+ true: {
9
+ coloredStroke: string;
10
+ contentColor: string;
11
+ icon: string;
12
+ };
13
+ };
14
+ color: {
15
+ 0: {
16
+ coloredStroke: string;
17
+ contentColor: string;
18
+ icon: string;
19
+ };
20
+ 1: {
21
+ coloredStroke: string;
22
+ contentColor: string;
23
+ icon: string;
24
+ };
25
+ 2: {
26
+ coloredStroke: string;
27
+ contentColor: string;
28
+ icon: string;
29
+ };
30
+ };
31
+ }, {
32
+ breakPoint: string;
33
+ defaultStroke: string;
34
+ coloredStroke: string;
35
+ icon: string;
36
+ contentWrapper: string;
37
+ contentColor: string;
38
+ legendItem: string;
39
+ }, "", import("tailwind-variants/dist/config").TVConfig<{
40
+ transparent: {
41
+ true: {
42
+ coloredStroke: string;
43
+ };
44
+ };
45
+ isColorless: {
46
+ true: {
47
+ coloredStroke: string;
48
+ contentColor: string;
49
+ icon: string;
50
+ };
51
+ };
52
+ color: {
53
+ 0: {
54
+ coloredStroke: string;
55
+ contentColor: string;
56
+ icon: string;
57
+ };
58
+ 1: {
59
+ coloredStroke: string;
60
+ contentColor: string;
61
+ icon: string;
62
+ };
63
+ 2: {
64
+ coloredStroke: string;
65
+ contentColor: string;
66
+ icon: string;
67
+ };
68
+ };
69
+ }, {
70
+ transparent: {
71
+ true: {
72
+ coloredStroke: string;
73
+ };
74
+ };
75
+ isColorless: {
76
+ true: {
77
+ coloredStroke: string;
78
+ contentColor: string;
79
+ icon: string;
80
+ };
81
+ };
82
+ color: {
83
+ 0: {
84
+ coloredStroke: string;
85
+ contentColor: string;
86
+ icon: string;
87
+ };
88
+ 1: {
89
+ coloredStroke: string;
90
+ contentColor: string;
91
+ icon: string;
92
+ };
93
+ 2: {
94
+ coloredStroke: string;
95
+ contentColor: string;
96
+ icon: string;
97
+ };
98
+ };
99
+ }>, {
100
+ transparent: {
101
+ true: {
102
+ coloredStroke: string;
103
+ };
104
+ };
105
+ isColorless: {
106
+ true: {
107
+ coloredStroke: string;
108
+ contentColor: string;
109
+ icon: string;
110
+ };
111
+ };
112
+ color: {
113
+ 0: {
114
+ coloredStroke: string;
115
+ contentColor: string;
116
+ icon: string;
117
+ };
118
+ 1: {
119
+ coloredStroke: string;
120
+ contentColor: string;
121
+ icon: string;
122
+ };
123
+ 2: {
124
+ coloredStroke: string;
125
+ contentColor: string;
126
+ icon: string;
127
+ };
128
+ };
129
+ }, {
130
+ breakPoint: string;
131
+ defaultStroke: string;
132
+ coloredStroke: string;
133
+ icon: string;
134
+ contentWrapper: string;
135
+ contentColor: string;
136
+ legendItem: string;
137
+ }, import("tailwind-variants").TVReturnType<{
138
+ transparent: {
139
+ true: {
140
+ coloredStroke: string;
141
+ };
142
+ };
143
+ isColorless: {
144
+ true: {
145
+ coloredStroke: string;
146
+ contentColor: string;
147
+ icon: string;
148
+ };
149
+ };
150
+ color: {
151
+ 0: {
152
+ coloredStroke: string;
153
+ contentColor: string;
154
+ icon: string;
155
+ };
156
+ 1: {
157
+ coloredStroke: string;
158
+ contentColor: string;
159
+ icon: string;
160
+ };
161
+ 2: {
162
+ coloredStroke: string;
163
+ contentColor: string;
164
+ icon: string;
165
+ };
166
+ };
167
+ }, {
168
+ breakPoint: string;
169
+ defaultStroke: string;
170
+ coloredStroke: string;
171
+ icon: string;
172
+ contentWrapper: string;
173
+ contentColor: string;
174
+ legendItem: string;
175
+ }, "", import("tailwind-variants/dist/config").TVConfig<{
176
+ transparent: {
177
+ true: {
178
+ coloredStroke: string;
179
+ };
180
+ };
181
+ isColorless: {
182
+ true: {
183
+ coloredStroke: string;
184
+ contentColor: string;
185
+ icon: string;
186
+ };
187
+ };
188
+ color: {
189
+ 0: {
190
+ coloredStroke: string;
191
+ contentColor: string;
192
+ icon: string;
193
+ };
194
+ 1: {
195
+ coloredStroke: string;
196
+ contentColor: string;
197
+ icon: string;
198
+ };
199
+ 2: {
200
+ coloredStroke: string;
201
+ contentColor: string;
202
+ icon: string;
203
+ };
204
+ };
205
+ }, {
206
+ transparent: {
207
+ true: {
208
+ coloredStroke: string;
209
+ };
210
+ };
211
+ isColorless: {
212
+ true: {
213
+ coloredStroke: string;
214
+ contentColor: string;
215
+ icon: string;
216
+ };
217
+ };
218
+ color: {
219
+ 0: {
220
+ coloredStroke: string;
221
+ contentColor: string;
222
+ icon: string;
223
+ };
224
+ 1: {
225
+ coloredStroke: string;
226
+ contentColor: string;
227
+ icon: string;
228
+ };
229
+ 2: {
230
+ coloredStroke: string;
231
+ contentColor: string;
232
+ icon: string;
233
+ };
234
+ };
235
+ }>, unknown, unknown, undefined>>;
@@ -7,12 +7,14 @@ export * from './Container_v2';
7
7
  export * from './Flag_v2';
8
8
  export * from './Picture';
9
9
  export * from './Badge';
10
+ export * from './ItemCard';
10
11
  export * from './AppHeader_v2';
11
12
  export * from './ListBoxItem';
12
13
  export * from './ListBox';
13
14
  export * from './Calendar';
14
15
  export * from './Textarea_v2';
15
16
  export * from './Rating';
17
+ export * from './RatingCircle';
16
18
  export * from './IconButton';
17
19
  export * from './Toast';
18
20
  export * from './ScreenInput';
@@ -9,10 +9,12 @@ declare const _default: {
9
9
  };
10
10
  gray: {
11
11
  black: string;
12
+ middle: string;
12
13
  };
13
14
  };
14
15
  info: {
15
16
  red: {
17
+ default: string;
16
18
  not: {
17
19
  red: string;
18
20
  };