@scbt-ecom/ui 0.88.0 → 0.89.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 (38) hide show
  1. package/dist/hooks.js +26 -40
  2. package/dist/hooks.js.map +1 -1
  3. package/dist/{index-B6tiFtIj.js → index-BFZfRLgg.js} +1916 -1913
  4. package/dist/index-BFZfRLgg.js.map +1 -0
  5. package/dist/lib/shared/hooks/index.d.ts +1 -1
  6. package/dist/lib/shared/hooks/useObserverWidgets.d.ts +7 -0
  7. package/dist/lib/shared/ui/customLink/index.d.ts +1 -1
  8. package/dist/lib/shared/ui/customLink/model/helpers.d.ts +2 -2
  9. package/dist/lib/shared/ui/icon/allowedIcons.d.ts +3 -3
  10. package/dist/lib/shared/ui/icon/iconsMap.d.ts +12 -0
  11. package/dist/lib/shared/ui/popover/Popover.d.ts +2 -1
  12. package/dist/lib/widgets/index.d.ts +1 -0
  13. package/dist/lib/widgets/userFeedback/UserFeedback.d.ts +11 -0
  14. package/dist/lib/widgets/userFeedback/index.d.ts +1 -0
  15. package/dist/lib/widgets/userFeedback/model/hooks/index.d.ts +1 -0
  16. package/dist/lib/widgets/userFeedback/model/hooks/useRating.d.ts +9 -0
  17. package/dist/lib/widgets/userFeedback/model/index.d.ts +3 -0
  18. package/dist/lib/widgets/userFeedback/model/schema.d.ts +8 -0
  19. package/dist/lib/widgets/userFeedback/model/types.d.ts +8 -0
  20. package/dist/lib/widgets/userFeedback/ui/FeedbackTrigger.d.ts +1 -0
  21. package/dist/lib/widgets/userFeedback/ui/SelectRating.d.ts +4 -0
  22. package/dist/lib/widgets/userFeedback/ui/Success.d.ts +3 -0
  23. package/dist/lib/widgets/userFeedback/ui/UserReviewForm.d.ts +7 -0
  24. package/dist/lib/widgets/userFeedback/ui/index.d.ts +4 -0
  25. package/dist/static/static/general/heart.svg +12 -0
  26. package/dist/static/static/status/succesCircle.svg +14 -0
  27. package/dist/ui.js +8 -5
  28. package/dist/ui.js.map +1 -1
  29. package/dist/useDebounce-5MeprqTX.js.map +1 -1
  30. package/dist/useFieldsProgress-C918amw-.js +41 -0
  31. package/dist/useFieldsProgress-C918amw-.js.map +1 -0
  32. package/dist/widget.js +1334 -1214
  33. package/dist/widget.js.map +1 -1
  34. package/package.json +1 -1
  35. package/dist/index-B6tiFtIj.js.map +0 -1
  36. package/dist/lib/shared/hooks/useObserveElements.d.ts +0 -1
  37. package/dist/useFieldsProgress-CUlFPv4E.js +0 -26
  38. package/dist/useFieldsProgress-CUlFPv4E.js.map +0 -1
@@ -3,6 +3,6 @@ export * from './useBoolean';
3
3
  export * from './useClickOutside';
4
4
  export * from './useControlledForm';
5
5
  export * from './useDebounce';
6
- export * from './useObserveElements';
6
+ export * from './useObserverWidgets';
7
7
  export * from './useFieldsProgress';
8
8
  export * from './useFloating';
@@ -0,0 +1,7 @@
1
+ import { AllowedWidgets } from '../../widgets';
2
+ export type UseObserverWidgets = {
3
+ ids: AllowedWidgets[];
4
+ options?: IntersectionObserverInit;
5
+ initialState?: boolean;
6
+ };
7
+ export declare const useObserverWidgets: ({ ids, options, initialState }: UseObserverWidgets) => boolean;
@@ -1,2 +1,2 @@
1
1
  export * from './CustomLink';
2
- export { linkPrimitiveArrowIntent, linkPrimitiveIntent, linkPrimitiveSize } from './model/helpers';
2
+ export { linkPrimitiveIconIntent, linkPrimitiveIntent, linkPrimitiveSize } from './model/helpers';
@@ -7,7 +7,7 @@ export declare const linkPrimitiveSize: {
7
7
  readonly sm: "desk-body-regular-m";
8
8
  readonly md: "desk-body-regular-l";
9
9
  };
10
- export declare const linkPrimitiveArrowIntent: {
10
+ export declare const linkPrimitiveIconIntent: {
11
11
  readonly blue: "text-icon-primary-default group-hover:text-icon-primary-hover group-focus:text-icon-primary-default ";
12
12
  readonly white: "text-icon-white group-hover:text-icon-footer group-focus:text-icon-white";
13
13
  readonly dark: "text-icon-dark-default";
@@ -18,7 +18,7 @@ export declare const customLinkConfig: (props?: ({
18
18
  disabled?: boolean | null | undefined;
19
19
  size?: "md" | "sm" | null | undefined;
20
20
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
21
- export declare const linkArrowConfig: (props?: ({
21
+ export declare const linkIconConfig: (props?: ({
22
22
  intent?: "blue" | "white" | "dark" | null | undefined;
23
23
  disabled?: boolean | null | undefined;
24
24
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
@@ -6,12 +6,12 @@ export declare const allowedIcons: {
6
6
  readonly communication: readonly ["communication/phone"];
7
7
  readonly editor: readonly ["editor/bold", "editor/heading", "editor/italic", "editor/link", "editor/list", "editor/palette", "editor/redo", "editor/removeFormatting", "editor/space", "editor/strikethrough", "editor/typography", "editor/underline", "editor/undo"];
8
8
  readonly files: readonly ["files/border", "files/borderError", "files/documentFilled", "files/documentOutline", "files/upload"];
9
- readonly general: readonly ["general/calendar", "general/check", "general/close", "general/edit", "general/hiddenEye", "general/menu", "general/plus", "general/reorder", "general/search", "general/shield", "general/showEye"];
9
+ readonly general: readonly ["general/calendar", "general/check", "general/close", "general/edit", "general/heart", "general/hiddenEye", "general/menu", "general/plus", "general/reorder", "general/search", "general/shield", "general/showEye"];
10
10
  readonly info: readonly ["info/helpCircle", "info/warningCircle"];
11
11
  readonly logos: readonly ["logos/beeline", "logos/megafon", "logos/mts"];
12
12
  readonly media: readonly ["media/desktop", "media/mobile"];
13
13
  readonly social: readonly ["social/classmates", "social/telegram", "social/vk"];
14
- readonly status: readonly ["status/badSmile", "status/iconMark", "status/iconRetry", "status/iconUser"];
14
+ readonly status: readonly ["status/badSmile", "status/iconMark", "status/iconRetry", "status/iconUser", "status/succesCircle"];
15
15
  };
16
- readonly flatten: readonly ["arrows/arrowCircle", "arrows/arrowDownRight", "arrows/arrowLink", "arrows/arrowRight", "arrows/arrowRotate", "arrows/arrowScroll", "brandLogos/logoBlack", "brandLogos/logoBusiness", "brandLogos/logoGray", "brandLogos/logoInsurance", "brandLogos/logoMain", "brandLogos/logoWhite", "communication/phone", "editor/bold", "editor/heading", "editor/italic", "editor/link", "editor/list", "editor/palette", "editor/redo", "editor/removeFormatting", "editor/space", "editor/strikethrough", "editor/typography", "editor/underline", "editor/undo", "files/border", "files/borderError", "files/documentFilled", "files/documentOutline", "files/upload", "general/calendar", "general/check", "general/close", "general/edit", "general/hiddenEye", "general/menu", "general/plus", "general/reorder", "general/search", "general/shield", "general/showEye", "info/helpCircle", "info/warningCircle", "logos/beeline", "logos/megafon", "logos/mts", "media/desktop", "media/mobile", "social/classmates", "social/telegram", "social/vk", "status/badSmile", "status/iconMark", "status/iconRetry", "status/iconUser"];
16
+ readonly flatten: readonly ["arrows/arrowCircle", "arrows/arrowDownRight", "arrows/arrowLink", "arrows/arrowRight", "arrows/arrowRotate", "arrows/arrowScroll", "brandLogos/logoBlack", "brandLogos/logoBusiness", "brandLogos/logoGray", "brandLogos/logoInsurance", "brandLogos/logoMain", "brandLogos/logoWhite", "communication/phone", "editor/bold", "editor/heading", "editor/italic", "editor/link", "editor/list", "editor/palette", "editor/redo", "editor/removeFormatting", "editor/space", "editor/strikethrough", "editor/typography", "editor/underline", "editor/undo", "files/border", "files/borderError", "files/documentFilled", "files/documentOutline", "files/upload", "general/calendar", "general/check", "general/close", "general/edit", "general/heart", "general/hiddenEye", "general/menu", "general/plus", "general/reorder", "general/search", "general/shield", "general/showEye", "info/helpCircle", "info/warningCircle", "logos/beeline", "logos/megafon", "logos/mts", "media/desktop", "media/mobile", "social/classmates", "social/telegram", "social/vk", "status/badSmile", "status/iconMark", "status/iconRetry", "status/iconUser", "status/succesCircle"];
17
17
  };
@@ -209,6 +209,12 @@ export declare const iconsMap: {
209
209
  desc?: string;
210
210
  descId?: string;
211
211
  }>;
212
+ 'general/heart': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement> & {
213
+ title?: string;
214
+ titleId?: string;
215
+ desc?: string;
216
+ descId?: string;
217
+ }>;
212
218
  'general/hiddenEye': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement> & {
213
219
  title?: string;
214
220
  titleId?: string;
@@ -335,4 +341,10 @@ export declare const iconsMap: {
335
341
  desc?: string;
336
342
  descId?: string;
337
343
  }>;
344
+ 'status/succesCircle': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement> & {
345
+ title?: string;
346
+ titleId?: string;
347
+ desc?: string;
348
+ descId?: string;
349
+ }>;
338
350
  };
@@ -17,6 +17,7 @@ interface PopoverContentProps extends PopoverContentPropsBase {
17
17
  defaultOpen?: boolean;
18
18
  avoidCollisions?: boolean;
19
19
  withCloseBtn?: boolean;
20
+ withArrow?: boolean;
20
21
  }
21
22
  export interface PopoverProps extends PopoverContentProps {
22
23
  triggerElement: ReactElement;
@@ -24,5 +25,5 @@ export interface PopoverProps extends PopoverContentProps {
24
25
  classes?: PopoverClasses;
25
26
  portalContainer?: PopoverPrimitive.PopoverPortalProps['container'];
26
27
  }
27
- export declare const Popover: ({ triggerElement, classes, sideOffset, alignOffset, align, side, defaultOpen, avoidCollisions, children, arrowPadding, portalContainer, withCloseBtn, ...contentProps }: PopoverProps) => import("react/jsx-runtime").JSX.Element;
28
+ export declare const Popover: ({ triggerElement, classes, sideOffset, alignOffset, align, side, defaultOpen, avoidCollisions, children, arrowPadding, portalContainer, withCloseBtn, withArrow, ...contentProps }: PopoverProps) => import("react/jsx-runtime").JSX.Element;
28
29
  export {};
@@ -18,4 +18,5 @@ export * from './breadcrumbs';
18
18
  export * from './seoHeader';
19
19
  export * from './calculator';
20
20
  export * from './infoBlock';
21
+ export * from './userFeedback';
21
22
  export { queryClient } from './queryClientProvider';
@@ -0,0 +1,11 @@
1
+ import { FormStep, FormStepSetter, SubmitCallback, UseRatingReturn } from './model';
2
+ export type RenderFormStep = {
3
+ formStep: FormStep;
4
+ setFormStep: FormStepSetter;
5
+ ratingProps: UseRatingReturn;
6
+ submitCallback: SubmitCallback;
7
+ };
8
+ export type UserFeedbackProps = {
9
+ submitCallback: SubmitCallback;
10
+ };
11
+ export declare const UserFeedback: ({ submitCallback }: UserFeedbackProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export * from './UserFeedback';
@@ -0,0 +1 @@
1
+ export * from './useRating';
@@ -0,0 +1,9 @@
1
+ import { FormStepSetter } from '../types';
2
+ export type UseRatingReturn = {
3
+ selectedRating: number;
4
+ hoveredRatings: number;
5
+ handleMouseEnter: (index: number) => void;
6
+ handleMouseLeave: () => void;
7
+ handleSelectRating: (index: number) => void;
8
+ };
9
+ export declare const useRating: (setFormStep: FormStepSetter) => UseRatingReturn;
@@ -0,0 +1,3 @@
1
+ export type * from './types';
2
+ export * from './hooks';
3
+ export * from './schema';
@@ -0,0 +1,8 @@
1
+ import { z } from 'zod';
2
+ export declare const userReviewSchema: z.ZodObject<{
3
+ review: z.ZodEffects<z.ZodOptional<z.ZodString>, string | undefined, string | undefined>;
4
+ }, "strip", z.ZodTypeAny, {
5
+ review?: string | undefined;
6
+ }, {
7
+ review?: string | undefined;
8
+ }>;
@@ -0,0 +1,8 @@
1
+ import { Dispatch, SetStateAction } from 'react';
2
+ import { FieldValues } from 'react-hook-form';
3
+ import { z } from 'zod';
4
+ import { userReviewSchema } from './schema';
5
+ export type FormStep = 'rating' | 'review' | 'finally';
6
+ export type FormStepSetter = Dispatch<SetStateAction<FormStep>>;
7
+ export type UserReviewSchema = z.infer<typeof userReviewSchema>;
8
+ export type SubmitCallback = <T extends FieldValues>(values: T) => Promise<void>;
@@ -0,0 +1 @@
1
+ export declare const FeedbackTrigger: import('react').MemoExoticComponent<() => import("react/jsx-runtime").JSX.Element>;
@@ -0,0 +1,4 @@
1
+ import { UseRatingReturn } from '../model';
2
+ export interface SelectRatingProps extends UseRatingReturn {
3
+ }
4
+ export declare const SelectRating: ({ handleMouseLeave, hoveredRatings, selectedRating, handleSelectRating, handleMouseEnter }: SelectRatingProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ export interface SuccessProps {
2
+ }
3
+ export declare const Success: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { FormStepSetter, SubmitCallback } from '../model';
2
+ export interface UserReviewFormProps {
3
+ submitCallback: SubmitCallback;
4
+ setFormStep: FormStepSetter;
5
+ rating: number;
6
+ }
7
+ export declare const UserReviewForm: ({ submitCallback, rating, setFormStep }: UserReviewFormProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ export * from './FeedbackTrigger';
2
+ export * from './Success';
3
+ export * from './UserReviewForm';
4
+ export * from './SelectRating';
@@ -0,0 +1,12 @@
1
+ <svg
2
+ viewBox="0 0 48 48"
3
+ xmlns="http://www.w3.org/2000/svg"
4
+ fill="currentColor"
5
+ >
6
+ <g stroke-width="0" />
7
+ <g stroke-linecap="round" stroke-linejoin="round" />
8
+ <g>
9
+ <defs />
10
+ <path d="m43,17.0766c0-5.6539-4.5835-10.2373-10.2374-10.2373-3.7223,0-6.9708,1.9932-8.7626,4.964-1.7919-2.9708-5.0403-4.964-8.7626-4.964-5.6539,0-10.2373,4.5834-10.2373,10.2373,0,1.2925.2496,2.524.6866,3.6627,3.3851,9.7368,18.3134,20.4215,18.3134,20.4215,0,0,14.9282-10.6847,18.3134-20.4215.437-1.1386.6867-2.3702.6867-3.6627Z" />
11
+ </g>
12
+ </svg>
@@ -0,0 +1,14 @@
1
+ <svg
2
+ width="40"
3
+ height="40"
4
+ viewBox="0 0 40 40"
5
+ fill="none"
6
+ xmlns="http://www.w3.org/2000/svg"
7
+ >
8
+ <path
9
+ fill-rule="evenodd"
10
+ clip-rule="evenodd"
11
+ d="M20 0C8.95431 0 0 8.95431 0 20C0 31.0457 8.95431 40 20 40C31.0457 40 40 31.0457 40 20C40 8.95431 31.0457 0 20 0ZM2.82051 20C2.82051 10.512 10.512 2.82051 20 2.82051C29.488 2.82051 37.1795 10.512 37.1795 20C37.1795 29.488 29.488 37.1795 20 37.1795C10.512 37.1795 2.82051 29.488 2.82051 20ZM29.3305 13.2336C28.7798 12.6828 27.8869 12.6828 27.3361 13.2336L17.1575 23.4122C17.0613 23.5084 16.9309 23.5624 16.7949 23.5624C16.6589 23.5624 16.5284 23.5084 16.4323 23.4122L12.6639 19.6438C12.1131 19.0931 11.2202 19.0931 10.6695 19.6438C10.1187 20.1946 10.1187 21.0875 10.6695 21.6382L15.7977 26.7664C16.3484 27.3172 17.2413 27.3172 17.7921 26.7664L29.3305 15.228C29.8813 14.6772 29.8813 13.7843 29.3305 13.2336Z"
12
+ fill="#00A857"
13
+ />
14
+ </svg>
package/dist/ui.js CHANGED
@@ -1,5 +1,5 @@
1
- import { c as Ze, R as et, B as D, u as tt, a as nt, b as ot, d as rt, P as U, e as Fe, f as it, I as lt, g as W, h as st, A as ut, i as oe, D as at, V as gt, O as dt } from "./index-B6tiFtIj.js";
2
- import { s as Jn, o as Yn, C as Zn, r as eo, y as to, t as no, U as oo, Q as ro, z as io, v as lo, E as so, H as uo, T as ao, L as go, M as co, N as fo, n as po, p as mo, q as So, x as ho, w as Co, S as wo, W as Ro, F as vo, j as xo, l as _o, k as Fo, m as yo, X as $o, G as Vo, J as Mo, K as Io } from "./index-B6tiFtIj.js";
1
+ import { c as Ze, R as et, B as D, u as tt, a as nt, b as ot, d as rt, P as U, e as Fe, f as it, I as lt, g as W, h as st, A as ut, i as oe, D as at, V as gt, O as dt } from "./index-BFZfRLgg.js";
2
+ import { s as Jn, o as Yn, C as Zn, r as eo, y as to, t as no, U as oo, Q as ro, z as io, v as lo, E as so, H as uo, T as ao, L as go, M as co, N as fo, n as po, p as mo, q as So, x as ho, w as Co, S as wo, W as Ro, F as vo, j as xo, l as _o, k as Fo, m as yo, X as $o, G as Vo, J as Mo, K as Io } from "./index-BFZfRLgg.js";
3
3
  import { j as S, m as ct } from "./mergeRefs-Danc3mp8.js";
4
4
  import * as E from "react";
5
5
  import { forwardRef as M, useState as z, useRef as we, useEffect as ft, isValidElement as k, cloneElement as ye, Children as b } from "react";
@@ -81,6 +81,7 @@ const mt = Ze(
81
81
  "general/check",
82
82
  "general/close",
83
83
  "general/edit",
84
+ "general/heart",
84
85
  "general/hiddenEye",
85
86
  "general/menu",
86
87
  "general/plus",
@@ -93,7 +94,7 @@ const mt = Ze(
93
94
  logos: ["logos/beeline", "logos/megafon", "logos/mts"],
94
95
  media: ["media/desktop", "media/mobile"],
95
96
  social: ["social/classmates", "social/telegram", "social/vk"],
96
- status: ["status/badSmile", "status/iconMark", "status/iconRetry", "status/iconUser"]
97
+ status: ["status/badSmile", "status/iconMark", "status/iconRetry", "status/iconUser", "status/succesCircle"]
97
98
  },
98
99
  flatten: [
99
100
  "arrows/arrowCircle",
@@ -131,6 +132,7 @@ const mt = Ze(
131
132
  "general/check",
132
133
  "general/close",
133
134
  "general/edit",
135
+ "general/heart",
134
136
  "general/hiddenEye",
135
137
  "general/menu",
136
138
  "general/plus",
@@ -151,7 +153,8 @@ const mt = Ze(
151
153
  "status/badSmile",
152
154
  "status/iconMark",
153
155
  "status/iconRetry",
154
- "status/iconUser"
156
+ "status/iconUser",
157
+ "status/succesCircle"
155
158
  ]
156
159
  };
157
160
  var K = "Tabs", [St, Bn] = ot(K, [
@@ -2757,7 +2760,7 @@ export {
2757
2760
  Ao as formatDateToMonthString,
2758
2761
  Ho as formatDateToYearString,
2759
2762
  $o as isSingleOption,
2760
- Vo as linkPrimitiveArrowIntent,
2763
+ Vo as linkPrimitiveIconIntent,
2761
2764
  Mo as linkPrimitiveIntent,
2762
2765
  Io as linkPrimitiveSize
2763
2766
  };