@redneckz/wildless-cms-uni-blocks 0.14.895 → 0.14.896

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 (162) hide show
  1. package/bundle/bundle.umd.js +20 -14
  2. package/bundle/bundle.umd.min.js +1 -1
  3. package/bundle/ui-kit/DialogManager/Dialog.d.ts +2 -2
  4. package/bundle/ui-kit/SnowplowPopupDialog/SnowplowPopupDialog.d.ts +20 -0
  5. package/dist/components/CardTransfer/SubmitFailedDialog.js +1 -1
  6. package/dist/components/CardTransfer/SubmitFailedDialog.js.map +1 -1
  7. package/dist/retail/components/CaptchaDialog/CaptchaDialog.js +1 -1
  8. package/dist/retail/components/CaptchaDialog/CaptchaDialog.js.map +1 -1
  9. package/dist/retail/components/ConsentBkiDialog/ConsentBkiDialog.js +1 -1
  10. package/dist/retail/components/ConsentBkiDialog/ConsentBkiDialog.js.map +1 -1
  11. package/dist/retail/components/DocumentDialog/DocumentDialog.js +1 -1
  12. package/dist/retail/components/DocumentDialog/DocumentDialog.js.map +1 -1
  13. package/dist/retail/components/DraftDialog/DraftDialog.js +1 -1
  14. package/dist/retail/components/DraftDialog/DraftDialog.js.map +1 -1
  15. package/dist/retail/components/DraftDialog/EmptyDraftDialog.js +1 -1
  16. package/dist/retail/components/DraftDialog/EmptyDraftDialog.js.map +1 -1
  17. package/dist/retail/components/NoConsentDialog/NoConsentDialog.js +1 -1
  18. package/dist/retail/components/NoConsentDialog/NoConsentDialog.js.map +1 -1
  19. package/dist/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.js +1 -1
  20. package/dist/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.js.map +1 -1
  21. package/dist/ui-kit/DialogManager/Dialog.d.ts +2 -2
  22. package/dist/ui-kit/DialogManager/Dialog.js +6 -1
  23. package/dist/ui-kit/DialogManager/Dialog.js.map +1 -1
  24. package/dist/ui-kit/LocationDialog/LocationDialog.js +2 -1
  25. package/dist/ui-kit/LocationDialog/LocationDialog.js.map +1 -1
  26. package/dist/ui-kit/ReportDialog/ReportDialog.js +1 -1
  27. package/dist/ui-kit/ReportDialog/ReportDialog.js.map +1 -1
  28. package/dist/ui-kit/ResponseTypeDialog/ResponseTypeDialog.js +1 -1
  29. package/dist/ui-kit/ResponseTypeDialog/ResponseTypeDialog.js.map +1 -1
  30. package/dist/ui-kit/SearchDialog/SearchDialog.js +1 -1
  31. package/dist/ui-kit/SearchDialog/SearchDialog.js.map +1 -1
  32. package/dist/ui-kit/SnowplowPopupDialog/SnowplowPopupDialog.d.ts +20 -0
  33. package/dist/ui-kit/SnowplowPopupDialog/SnowplowPopupDialog.js +24 -0
  34. package/dist/ui-kit/SnowplowPopupDialog/SnowplowPopupDialog.js.map +1 -0
  35. package/lib/common.css +1 -1
  36. package/lib/components/CardTransfer/SubmitFailedDialog.js +1 -1
  37. package/lib/components/CardTransfer/SubmitFailedDialog.js.map +1 -1
  38. package/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.d.ts +1 -1
  39. package/lib/retail/components/CaptchaDialog/CaptchaDialog.js +1 -1
  40. package/lib/retail/components/CaptchaDialog/CaptchaDialog.js.map +1 -1
  41. package/lib/retail/components/ConsentBkiDialog/ConsentBkiDialog.js +1 -1
  42. package/lib/retail/components/ConsentBkiDialog/ConsentBkiDialog.js.map +1 -1
  43. package/lib/retail/components/DocumentDialog/DocumentDialog.js +1 -1
  44. package/lib/retail/components/DocumentDialog/DocumentDialog.js.map +1 -1
  45. package/lib/retail/components/DraftDialog/DraftDialog.js +1 -1
  46. package/lib/retail/components/DraftDialog/DraftDialog.js.map +1 -1
  47. package/lib/retail/components/DraftDialog/EmptyDraftDialog.js +1 -1
  48. package/lib/retail/components/DraftDialog/EmptyDraftDialog.js.map +1 -1
  49. package/lib/retail/components/NoConsentDialog/NoConsentDialog.js +1 -1
  50. package/lib/retail/components/NoConsentDialog/NoConsentDialog.js.map +1 -1
  51. package/lib/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.js +1 -1
  52. package/lib/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.js.map +1 -1
  53. package/lib/ui-kit/DialogManager/Dialog.d.ts +2 -2
  54. package/lib/ui-kit/DialogManager/Dialog.js +6 -1
  55. package/lib/ui-kit/DialogManager/Dialog.js.map +1 -1
  56. package/lib/ui-kit/LocationDialog/LocationDialog.js +2 -1
  57. package/lib/ui-kit/LocationDialog/LocationDialog.js.map +1 -1
  58. package/lib/ui-kit/ReportDialog/ReportDialog.js +1 -1
  59. package/lib/ui-kit/ReportDialog/ReportDialog.js.map +1 -1
  60. package/lib/ui-kit/ResponseTypeDialog/ResponseTypeDialog.js +1 -1
  61. package/lib/ui-kit/ResponseTypeDialog/ResponseTypeDialog.js.map +1 -1
  62. package/lib/ui-kit/SearchDialog/SearchDialog.js +1 -1
  63. package/lib/ui-kit/SearchDialog/SearchDialog.js.map +1 -1
  64. package/lib/ui-kit/SnowplowPopupDialog/SnowplowPopupDialog.d.ts +20 -0
  65. package/lib/ui-kit/SnowplowPopupDialog/SnowplowPopupDialog.fixture.d.ts +5 -0
  66. package/lib/ui-kit/SnowplowPopupDialog/SnowplowPopupDialog.js +22 -0
  67. package/lib/ui-kit/SnowplowPopupDialog/SnowplowPopupDialog.js.map +1 -0
  68. package/mobile/bundle/bundle.umd.js +19 -13
  69. package/mobile/bundle/bundle.umd.min.js +1 -1
  70. package/mobile/bundle/ui-kit/DialogManager/Dialog.d.ts +2 -2
  71. package/mobile/bundle/ui-kit/SnowplowPopupDialog/SnowplowPopupDialog.d.ts +20 -0
  72. package/mobile/dist/components/CardTransfer/SubmitFailedDialog.js +1 -1
  73. package/mobile/dist/components/CardTransfer/SubmitFailedDialog.js.map +1 -1
  74. package/mobile/dist/retail/components/CaptchaDialog/CaptchaDialog.js +1 -1
  75. package/mobile/dist/retail/components/CaptchaDialog/CaptchaDialog.js.map +1 -1
  76. package/mobile/dist/retail/components/ConsentBkiDialog/ConsentBkiDialog.js +1 -1
  77. package/mobile/dist/retail/components/ConsentBkiDialog/ConsentBkiDialog.js.map +1 -1
  78. package/mobile/dist/retail/components/DocumentDialog/DocumentDialog.js +1 -1
  79. package/mobile/dist/retail/components/DocumentDialog/DocumentDialog.js.map +1 -1
  80. package/mobile/dist/retail/components/DraftDialog/DraftDialog.js +1 -1
  81. package/mobile/dist/retail/components/DraftDialog/DraftDialog.js.map +1 -1
  82. package/mobile/dist/retail/components/DraftDialog/EmptyDraftDialog.js +1 -1
  83. package/mobile/dist/retail/components/DraftDialog/EmptyDraftDialog.js.map +1 -1
  84. package/mobile/dist/retail/components/NoConsentDialog/NoConsentDialog.js +1 -1
  85. package/mobile/dist/retail/components/NoConsentDialog/NoConsentDialog.js.map +1 -1
  86. package/mobile/dist/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.js +1 -1
  87. package/mobile/dist/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.js.map +1 -1
  88. package/mobile/dist/ui-kit/DialogManager/Dialog.d.ts +2 -2
  89. package/mobile/dist/ui-kit/DialogManager/Dialog.js +6 -1
  90. package/mobile/dist/ui-kit/DialogManager/Dialog.js.map +1 -1
  91. package/mobile/dist/ui-kit/LocationDialog/LocationDialog.js +2 -1
  92. package/mobile/dist/ui-kit/LocationDialog/LocationDialog.js.map +1 -1
  93. package/mobile/dist/ui-kit/ReportDialog/ReportDialog.js +1 -1
  94. package/mobile/dist/ui-kit/ReportDialog/ReportDialog.js.map +1 -1
  95. package/mobile/dist/ui-kit/ResponseTypeDialog/ResponseTypeDialog.js +1 -1
  96. package/mobile/dist/ui-kit/ResponseTypeDialog/ResponseTypeDialog.js.map +1 -1
  97. package/mobile/dist/ui-kit/SearchDialog/SearchDialog.js +1 -1
  98. package/mobile/dist/ui-kit/SearchDialog/SearchDialog.js.map +1 -1
  99. package/mobile/dist/ui-kit/SnowplowPopupDialog/SnowplowPopupDialog.d.ts +20 -0
  100. package/mobile/dist/ui-kit/SnowplowPopupDialog/SnowplowPopupDialog.js +24 -0
  101. package/mobile/dist/ui-kit/SnowplowPopupDialog/SnowplowPopupDialog.js.map +1 -0
  102. package/mobile/lib/common.css +1 -1
  103. package/mobile/lib/components/CardTransfer/SubmitFailedDialog.js +1 -1
  104. package/mobile/lib/components/CardTransfer/SubmitFailedDialog.js.map +1 -1
  105. package/mobile/lib/retail/components/CaptchaDialog/CaptchaDialog.js +1 -1
  106. package/mobile/lib/retail/components/CaptchaDialog/CaptchaDialog.js.map +1 -1
  107. package/mobile/lib/retail/components/ConsentBkiDialog/ConsentBkiDialog.js +1 -1
  108. package/mobile/lib/retail/components/ConsentBkiDialog/ConsentBkiDialog.js.map +1 -1
  109. package/mobile/lib/retail/components/DocumentDialog/DocumentDialog.js +1 -1
  110. package/mobile/lib/retail/components/DocumentDialog/DocumentDialog.js.map +1 -1
  111. package/mobile/lib/retail/components/DraftDialog/DraftDialog.js +1 -1
  112. package/mobile/lib/retail/components/DraftDialog/DraftDialog.js.map +1 -1
  113. package/mobile/lib/retail/components/DraftDialog/EmptyDraftDialog.js +1 -1
  114. package/mobile/lib/retail/components/DraftDialog/EmptyDraftDialog.js.map +1 -1
  115. package/mobile/lib/retail/components/NoConsentDialog/NoConsentDialog.js +1 -1
  116. package/mobile/lib/retail/components/NoConsentDialog/NoConsentDialog.js.map +1 -1
  117. package/mobile/lib/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.js +1 -1
  118. package/mobile/lib/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.js.map +1 -1
  119. package/mobile/lib/ui-kit/DialogManager/Dialog.d.ts +2 -2
  120. package/mobile/lib/ui-kit/DialogManager/Dialog.js +6 -1
  121. package/mobile/lib/ui-kit/DialogManager/Dialog.js.map +1 -1
  122. package/mobile/lib/ui-kit/LocationDialog/LocationDialog.js +2 -1
  123. package/mobile/lib/ui-kit/LocationDialog/LocationDialog.js.map +1 -1
  124. package/mobile/lib/ui-kit/ReportDialog/ReportDialog.js +1 -1
  125. package/mobile/lib/ui-kit/ReportDialog/ReportDialog.js.map +1 -1
  126. package/mobile/lib/ui-kit/ResponseTypeDialog/ResponseTypeDialog.js +1 -1
  127. package/mobile/lib/ui-kit/ResponseTypeDialog/ResponseTypeDialog.js.map +1 -1
  128. package/mobile/lib/ui-kit/SearchDialog/SearchDialog.js +1 -1
  129. package/mobile/lib/ui-kit/SearchDialog/SearchDialog.js.map +1 -1
  130. package/mobile/lib/ui-kit/SnowplowPopupDialog/SnowplowPopupDialog.d.ts +20 -0
  131. package/mobile/lib/ui-kit/SnowplowPopupDialog/SnowplowPopupDialog.js +22 -0
  132. package/mobile/lib/ui-kit/SnowplowPopupDialog/SnowplowPopupDialog.js.map +1 -0
  133. package/mobile/src/components/CardTransfer/SubmitFailedDialog.tsx +1 -1
  134. package/mobile/src/retail/components/CaptchaDialog/CaptchaDialog.tsx +1 -5
  135. package/mobile/src/retail/components/ConsentBkiDialog/ConsentBkiDialog.tsx +1 -4
  136. package/mobile/src/retail/components/DocumentDialog/DocumentDialog.tsx +1 -1
  137. package/mobile/src/retail/components/DraftDialog/DraftDialog.tsx +1 -1
  138. package/mobile/src/retail/components/DraftDialog/EmptyDraftDialog.tsx +1 -4
  139. package/mobile/src/retail/components/NoConsentDialog/NoConsentDialog.tsx +1 -4
  140. package/mobile/src/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.tsx +1 -4
  141. package/mobile/src/ui-kit/DialogManager/Dialog.tsx +15 -6
  142. package/mobile/src/ui-kit/LocationDialog/LocationDialog.tsx +11 -13
  143. package/mobile/src/ui-kit/ReportDialog/ReportDialog.tsx +1 -1
  144. package/mobile/src/ui-kit/ResponseTypeDialog/ResponseTypeDialog.tsx +1 -1
  145. package/mobile/src/ui-kit/SearchDialog/SearchDialog.tsx +4 -1
  146. package/mobile/src/ui-kit/SnowplowPopupDialog/SnowplowPopupDialog.tsx +83 -0
  147. package/package.json +1 -1
  148. package/src/components/CardTransfer/SubmitFailedDialog.tsx +1 -1
  149. package/src/retail/components/CaptchaDialog/CaptchaDialog.tsx +1 -5
  150. package/src/retail/components/ConsentBkiDialog/ConsentBkiDialog.tsx +1 -4
  151. package/src/retail/components/DocumentDialog/DocumentDialog.tsx +1 -1
  152. package/src/retail/components/DraftDialog/DraftDialog.tsx +1 -1
  153. package/src/retail/components/DraftDialog/EmptyDraftDialog.tsx +1 -4
  154. package/src/retail/components/NoConsentDialog/NoConsentDialog.tsx +1 -4
  155. package/src/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.tsx +1 -4
  156. package/src/ui-kit/DialogManager/Dialog.tsx +15 -6
  157. package/src/ui-kit/LocationDialog/LocationDialog.tsx +11 -13
  158. package/src/ui-kit/ReportDialog/ReportDialog.tsx +1 -1
  159. package/src/ui-kit/ResponseTypeDialog/ResponseTypeDialog.tsx +1 -1
  160. package/src/ui-kit/SearchDialog/SearchDialog.tsx +4 -1
  161. package/src/ui-kit/SnowplowPopupDialog/SnowplowPopupDialog.fixture.tsx +32 -0
  162. package/src/ui-kit/SnowplowPopupDialog/SnowplowPopupDialog.tsx +83 -0
@@ -0,0 +1,20 @@
1
+ import { type HandleAspectsProps } from '../../hooks/useAspects/handleAspects';
2
+ import { type Aspects } from '../../hooks/useAspects/useAspects';
3
+ import { type AspectsDef } from '../../model/AspectsProps';
4
+ import { type HeadlineCommonProps } from '../../model/HeadlineType';
5
+ import { type Picture } from '../../model/Picture';
6
+ import { type LinkButtonContent } from '../LinkButton/LinkButtonContent';
7
+ import { type RichTextProps } from '../RichText/RichTextProps';
8
+ export interface SnowplowPopupDialogContent extends HeadlineCommonProps, RichTextProps {
9
+ img?: Picture;
10
+ buttons?: LinkButtonContent[];
11
+ dataShow?: AspectsDef[];
12
+ dataClose?: AspectsDef[];
13
+ delay?: number;
14
+ }
15
+ export interface SnowplowPopupDialogProps extends SnowplowPopupDialogContent {
16
+ onClose?: () => void;
17
+ aspects: Aspects;
18
+ handleAspects: (props: HandleAspectsProps) => void;
19
+ }
20
+ export declare const SnowplowPopupDialog: import("@redneckz/uni-jsx").UNIComponent<SnowplowPopupDialogProps, any, any>;
@@ -0,0 +1,22 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@redneckz/uni-jsx/jsx-runtime";
2
+ import { JSX } from '@redneckz/uni-jsx';
3
+ import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
4
+ import { Headline } from '../../components/Headline/Headline.js';
5
+ import { Dialog } from '../DialogManager/Dialog.js';
6
+ import { Img } from '../Img/Img.js';
7
+ import { renderButtonsSection } from '../LinkButton/renderButtonsSection.js';
8
+ import { RichText } from '../RichText/RichText.js';
9
+ export const SnowplowPopupDialog = JSX(({ title, description, buttons, img, dataClose, onClose, align, isDotted, __html, itemSize, richVersion, aspects, handleAspects, }) => {
10
+ const handleClose = useCallback(() => {
11
+ if (dataClose) {
12
+ handleAspects({
13
+ aspectsAttributes: dataClose,
14
+ aspects,
15
+ ev: {},
16
+ });
17
+ }
18
+ onClose?.();
19
+ }, [aspects, dataClose, onClose, handleAspects]);
20
+ return (_jsx(Dialog, { maxWidth: "sm", onClose: handleClose, children: _jsxs("div", { className: "flex flex-col gap-lg items-center rounded-md", children: [_jsx(Img, { image: img }), title || description ? (_jsx(Headline, { align: align, className: "w-full", title: title, description: description, headlineVersion: "XS", isEmbedded: true })) : null, _jsx(RichText, { __html: __html, isDotted: isDotted, itemSize: itemSize, richVersion: richVersion }), renderButtonsSection(buttons, { isVertical: true })] }) }));
21
+ });
22
+ //# sourceMappingURL=SnowplowPopupDialog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SnowplowPopupDialog.js","sourceRoot":"","sources":["../../../src/ui-kit/SnowplowPopupDialog/SnowplowPopupDialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AAM9D,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjD,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAEjC,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAE1E,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAgBhD,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,CACpC,CAAC,EACC,KAAK,EACL,WAAW,EACX,OAAO,EACP,GAAG,EACH,SAAS,EACT,OAAO,EACP,KAAK,EACL,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,WAAW,EACX,OAAO,EACP,aAAa,GACd,EAAE,EAAE;IACH,MAAM,WAAW,GAAG,WAAW,CAAC,GAAG,EAAE;QACnC,IAAI,SAAS,EAAE;YACb,aAAa,CAAC;gBACZ,iBAAiB,EAAE,SAAS;gBAC5B,OAAO;gBACP,EAAE,EAAE,EAAgC;aACrC,CAAC,CAAC;SACJ;QAED,OAAO,EAAE,EAAE,CAAC;IACd,CAAC,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC;IAEjD,OAAO,CACL,KAAC,MAAM,IAAC,QAAQ,EAAC,IAAI,EAAC,OAAO,EAAE,WAAW,YACxC,eAAK,SAAS,EAAC,8CAA8C,aAC3D,KAAC,GAAG,IAAC,KAAK,EAAE,GAAG,GAAI,EAClB,KAAK,IAAI,WAAW,CAAC,CAAC,CAAC,CACtB,KAAC,QAAQ,IACP,KAAK,EAAE,KAAK,EACZ,SAAS,EAAC,QAAQ,EAClB,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,WAAW,EACxB,eAAe,EAAC,IAAI,EACpB,UAAU,EAAE,IAAI,GAChB,CACH,CAAC,CAAC,CAAC,IAAI,EACR,KAAC,QAAQ,IACP,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,WAAW,GACxB,EACD,oBAAoB,CAAC,OAAO,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,IAChD,GACC,CACV,CAAC;AACJ,CAAC,CACF,CAAC"}
@@ -18,7 +18,7 @@ export const SubmitFailedDialog = ({
18
18
  const description = errorCode ? `Код ошибки - ${errorCode}` : 'Пожалуйста, повторите позднее';
19
19
 
20
20
  return (
21
- <Dialog className="my-6xl max-w-lg w-full min-h-fit mx-auto" onClose={onClose}>
21
+ <Dialog maxWidth="lg" onClose={onClose}>
22
22
  <div className="flex flex-col gap-lg items-center rounded-md space-x-m">
23
23
  <Img image={{ icon: 'ResponseFailIcon', iconVersion: 'normal' }} width="136" height="136" />
24
24
  <Headline
@@ -46,11 +46,7 @@ export const CaptchaDialog = JSX<CaptchaDialogProps>(({ phoneNumber, sendCode, o
46
46
  useEffect(handleCreateCaptcha, []);
47
47
 
48
48
  return (
49
- <Dialog
50
- className="my-6xl max-w-lg w-full min-h-fit mx-auto rounded-lg"
51
- head={<Logo />}
52
- onClose={closeAll}
53
- >
49
+ <Dialog head={<Logo />} onClose={onClose}>
54
50
  <div className="flex flex-col gap-lg items-center">
55
51
  <div className="flex">
56
52
  <img className="grow" src={captcha}></img>
@@ -49,10 +49,7 @@ export const ConsentBkiDialog = JSX<ConsentBkiDialogProps>(
49
49
  const consentText = showRefuseContent ? refuseConsentText : defaultConsentText;
50
50
 
51
51
  return (
52
- <Dialog
53
- className="my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-lg px-5xl"
54
- onClose={onClose}
55
- >
52
+ <Dialog onClose={onClose}>
56
53
  <div className="flex flex-col gap-xl items-center">
57
54
  <div role="button" onClick={openDocument}>
58
55
  <Heading
@@ -13,7 +13,7 @@ export const DocumentDialog = JSX<DocumentDialogProps>(({ src, onClose, onDocume
13
13
  const isMobileMode = useMobileMode();
14
14
 
15
15
  return (
16
- <Dialog className="mt-xl max-w-4xl mx-auto px-0 min-h-0 pb-0" onClose={onClose}>
16
+ <Dialog onClose={onClose}>
17
17
  {isMobileMode ? (
18
18
  <img src={src} />
19
19
  ) : (
@@ -57,7 +57,7 @@ export const DraftDialog = JSX<DraftDialogProps>(function ({
57
57
  }, []);
58
58
 
59
59
  return (
60
- <Dialog className="my-6xl max-w-4xl w-full min-h-fit mx-auto rounded-xl py-0" onClose={onClose}>
60
+ <Dialog onClose={onClose}>
61
61
  <div className="flex flex-col gap-lg items-center mt-xs mx-6xl">
62
62
  <Heading
63
63
  className="whitespace-pre-wrap text-center"
@@ -26,10 +26,7 @@ export const EmptyDraftDialog = JSX<EmptyDraftDialogProps>(function ({ isDebit,
26
26
  }, []);
27
27
 
28
28
  return (
29
- <Dialog
30
- className="my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-lg py-0 px-5xl"
31
- onClose={onClose}
32
- >
29
+ <Dialog onClose={onClose}>
33
30
  <div className="flex flex-col gap-lg">
34
31
  <Heading className="text-center" title="Заявки не найдены" headingType="h3" />
35
32
  <Paragraph size="text-l" align="text-center">
@@ -30,10 +30,7 @@ export const NoConsentDialog = JSX<NoConsentDialogProps>(({ attempts, onClose =
30
30
  }, [isMaxAttempts]);
31
31
 
32
32
  return (
33
- <Dialog
34
- className="my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-lg px-5xl"
35
- onClose={handleClose}
36
- >
33
+ <Dialog onClose={handleClose}>
37
34
  <div className="flex flex-col gap-xl items-center">
38
35
  <Paragraph align="text-center">Уважаемый клиент!</Paragraph>
39
36
  <Paragraph align="text-center">
@@ -108,10 +108,7 @@ export const VerifyPhoneDialog = JSX<VerifyPhoneDialogProps>(
108
108
  }, []);
109
109
 
110
110
  return (
111
- <Dialog
112
- className="my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-xl p-m"
113
- onClose={onClose}
114
- >
111
+ <Dialog maxWidth="lg" onClose={onClose}>
115
112
  <div className="flex flex-col gap-xl items-center rounded-md">
116
113
  <Headline
117
114
  className="w-full"
@@ -1,26 +1,35 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
- import { type ComponentType } from '../../model/ComponentType';
3
2
  import { type OnClickPreventableProps } from '../../model/OnClickProps';
4
3
  import type { OnCloseProps } from '../../model/OnCloseProps';
5
4
  import { type VNode } from '../../model/VNode';
6
5
  import { style } from '../../utils/style';
7
6
  import { CloseButton } from './CloseButton';
8
7
 
9
- export interface DialogProps extends ComponentType, OnCloseProps, OnClickPreventableProps {
8
+ export interface DialogProps extends OnCloseProps, OnClickPreventableProps {
10
9
  head?: VNode;
10
+ maxWidth?: 'sm' | '4xl' | 'lg';
11
11
  }
12
12
 
13
- export const Dialog = JSX<DialogProps>(({ className, head, children, onClose, onClick }) => (
13
+ const MAX_WIDTH_STYLE = {
14
+ sm: 'max-w-sm top-1/3',
15
+ lg: 'max-w-lg',
16
+ '4xl': 'max-w-4xl',
17
+ };
18
+
19
+ export const Dialog = JSX<DialogProps>(({ head, maxWidth = '4xl', children, onClose, onClick }) => (
14
20
  <div
15
- className={style('relative bg-white pt-0 p-lg', className)}
21
+ className={style(
22
+ 'relative bg-white p-lg pb-6xl my-6xl mx-auto rounded-lg w-full',
23
+ MAX_WIDTH_STYLE[maxWidth],
24
+ )}
16
25
  role="dialog"
17
26
  title="Диалог"
18
27
  onClick={onClick}
19
28
  >
20
29
  <div className="sticky py-xl top-0 bg-white z-10">
21
- <CloseButton className="absolute top-0 right-0" onClose={onClose} />
30
+ <CloseButton className="absolute top-0 right-0 z-10" onClose={onClose} />
22
31
  <div className="container">{head}</div>
23
32
  </div>
24
- <div className="container pb-m mb-[74px] lg:mb-0">{children}</div>
33
+ <div className="container">{children}</div>
25
34
  </div>
26
35
  ));
@@ -45,19 +45,7 @@ export const LocationDialog = JSX<LocationDialogProps>(({ foreignOffices, branch
45
45
  );
46
46
 
47
47
  return (
48
- <Dialog
49
- className="pb-20"
50
- head={
51
- <div>
52
- <Text size="text-h4" color="text-primary-text">
53
- Выберите филиал
54
- </Text>
55
- <SelectedLocation defaultLocation={branches?.default} />
56
- <SearchBar onSearch={setQuery} searchTerm={query} />
57
- </div>
58
- }
59
- onClose={onClose}
60
- >
48
+ <Dialog head={renderHead(query, setQuery, branches)} onClose={onClose}>
61
49
  {query && query.length >= SEARCH_TERM_MIN_LENGTH ? (
62
50
  <div>
63
51
  {regions
@@ -79,6 +67,16 @@ export const LocationDialog = JSX<LocationDialogProps>(({ foreignOffices, branch
79
67
  );
80
68
  });
81
69
 
70
+ const renderHead = (query: string, setQuery: (_: string) => void, branches?: BranchesHeader) => (
71
+ <div>
72
+ <Text size="text-h4" color="text-primary-text">
73
+ Выберите филиал
74
+ </Text>
75
+ <SelectedLocation defaultLocation={branches?.default} />
76
+ <SearchBar onSearch={setQuery} searchTerm={query} />
77
+ </div>
78
+ );
79
+
82
80
  const regionFirstLetter = (region: Region) => region.name?.charAt(0) ?? '';
83
81
 
84
82
  const cleanUpRegions = (regions: Region[]) =>
@@ -13,7 +13,7 @@ export interface ReportDialogProps extends LinkDoc, OnCloseProps {
13
13
  }
14
14
 
15
15
  export const ReportDialog = JSX<ReportDialogProps>(({ href, __html, target, onClose }) => (
16
- <Dialog className="my-6xl min-h-fit w-fit mx-auto" onClose={onClose}>
16
+ <Dialog maxWidth="lg" onClose={onClose}>
17
17
  {__html ? <RichText __html={__html} /> : null}
18
18
  <div className="flex flex-row mx-auto w-fit gap-lg py-lg">
19
19
  <Link
@@ -21,7 +21,7 @@ export const ResponseTypeDialog = JSX<ResponseNotificationProps>(({ ok, typeForm
21
21
  : 'Совсем скоро мы с вами свяжемся';
22
22
 
23
23
  return (
24
- <Dialog className="my-6xl max-w-lg w-full min-h-fit mx-auto" onClose={onClose}>
24
+ <Dialog maxWidth="lg" onClose={onClose}>
25
25
  <div className="flex flex-col gap-lg items-center rounded-md space-x-m">
26
26
  <Img image={{ icon: statusIcon, iconVersion: 'normal' }} width="136" height="136" />
27
27
  <Headline
@@ -28,7 +28,10 @@ export const SearchDialog = JSX<SearchDialogProps>(({ initialQuery, navigationIt
28
28
  );
29
29
 
30
30
  return (
31
- <Dialog head={<SearchInput autoFocus={true} {...searchInputProps} />} onClose={onClose}>
31
+ <Dialog
32
+ head={<SearchInput className="mt-s" autoFocus={true} {...searchInputProps} />}
33
+ onClose={onClose}
34
+ >
32
35
  <Sitemap navigationItems={searchItems} />
33
36
  </Dialog>
34
37
  );
@@ -0,0 +1,83 @@
1
+ import { JSX } from '@redneckz/uni-jsx';
2
+ import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
3
+ import { Headline } from '../../components/Headline/Headline';
4
+ import { type HandleAspectsProps } from '../../hooks/useAspects/handleAspects';
5
+ import { type Aspects } from '../../hooks/useAspects/useAspects';
6
+ import { type AspectsDef } from '../../model/AspectsProps';
7
+ import { type HeadlineCommonProps } from '../../model/HeadlineType';
8
+ import { type Picture } from '../../model/Picture';
9
+ import { Dialog } from '../DialogManager/Dialog';
10
+ import { Img } from '../Img/Img';
11
+ import { type LinkButtonContent } from '../LinkButton/LinkButtonContent';
12
+ import { renderButtonsSection } from '../LinkButton/renderButtonsSection';
13
+ import { type PreventableEventWithTarget } from '../PreventableEvent';
14
+ import { RichText } from '../RichText/RichText';
15
+ import { type RichTextProps } from '../RichText/RichTextProps';
16
+ export interface SnowplowPopupDialogContent extends HeadlineCommonProps, RichTextProps {
17
+ img?: Picture;
18
+ buttons?: LinkButtonContent[];
19
+ dataShow?: AspectsDef[];
20
+ dataClose?: AspectsDef[];
21
+ delay?: number;
22
+ }
23
+
24
+ export interface SnowplowPopupDialogProps extends SnowplowPopupDialogContent {
25
+ onClose?: () => void;
26
+ aspects: Aspects;
27
+ handleAspects: (props: HandleAspectsProps) => void;
28
+ }
29
+
30
+ export const SnowplowPopupDialog = JSX<SnowplowPopupDialogProps>(
31
+ ({
32
+ title,
33
+ description,
34
+ buttons,
35
+ img,
36
+ dataClose,
37
+ onClose,
38
+ align,
39
+ isDotted,
40
+ __html,
41
+ itemSize,
42
+ richVersion,
43
+ aspects,
44
+ handleAspects,
45
+ }) => {
46
+ const handleClose = useCallback(() => {
47
+ if (dataClose) {
48
+ handleAspects({
49
+ aspectsAttributes: dataClose,
50
+ aspects,
51
+ ev: {} as PreventableEventWithTarget,
52
+ });
53
+ }
54
+
55
+ onClose?.();
56
+ }, [aspects, dataClose, onClose, handleAspects]);
57
+
58
+ return (
59
+ <Dialog maxWidth="sm" onClose={handleClose}>
60
+ <div className="flex flex-col gap-lg items-center rounded-md">
61
+ <Img image={img} />
62
+ {title || description ? (
63
+ <Headline
64
+ align={align}
65
+ className="w-full"
66
+ title={title}
67
+ description={description}
68
+ headlineVersion="XS"
69
+ isEmbedded={true}
70
+ />
71
+ ) : null}
72
+ <RichText
73
+ __html={__html}
74
+ isDotted={isDotted}
75
+ itemSize={itemSize}
76
+ richVersion={richVersion}
77
+ />
78
+ {renderButtonsSection(buttons, { isVertical: true })}
79
+ </div>
80
+ </Dialog>
81
+ );
82
+ },
83
+ );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redneckz/wildless-cms-uni-blocks",
3
- "version": "0.14.895",
3
+ "version": "0.14.896",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "author": "ЦК",
@@ -18,7 +18,7 @@ export const SubmitFailedDialog = ({
18
18
  const description = errorCode ? `Код ошибки - ${errorCode}` : 'Пожалуйста, повторите позднее';
19
19
 
20
20
  return (
21
- <Dialog className="my-6xl max-w-lg w-full min-h-fit mx-auto" onClose={onClose}>
21
+ <Dialog maxWidth="lg" onClose={onClose}>
22
22
  <div className="flex flex-col gap-lg items-center rounded-md space-x-m">
23
23
  <Img image={{ icon: 'ResponseFailIcon', iconVersion: 'normal' }} width="136" height="136" />
24
24
  <Headline
@@ -46,11 +46,7 @@ export const CaptchaDialog = JSX<CaptchaDialogProps>(({ phoneNumber, sendCode, o
46
46
  useEffect(handleCreateCaptcha, []);
47
47
 
48
48
  return (
49
- <Dialog
50
- className="my-6xl max-w-lg w-full min-h-fit mx-auto rounded-lg"
51
- head={<Logo />}
52
- onClose={closeAll}
53
- >
49
+ <Dialog head={<Logo />} onClose={onClose}>
54
50
  <div className="flex flex-col gap-lg items-center">
55
51
  <div className="flex">
56
52
  <img className="grow" src={captcha}></img>
@@ -49,10 +49,7 @@ export const ConsentBkiDialog = JSX<ConsentBkiDialogProps>(
49
49
  const consentText = showRefuseContent ? refuseConsentText : defaultConsentText;
50
50
 
51
51
  return (
52
- <Dialog
53
- className="my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-lg px-5xl"
54
- onClose={onClose}
55
- >
52
+ <Dialog onClose={onClose}>
56
53
  <div className="flex flex-col gap-xl items-center">
57
54
  <div role="button" onClick={openDocument}>
58
55
  <Heading
@@ -13,7 +13,7 @@ export const DocumentDialog = JSX<DocumentDialogProps>(({ src, onClose, onDocume
13
13
  const isMobileMode = useMobileMode();
14
14
 
15
15
  return (
16
- <Dialog className="mt-xl max-w-4xl mx-auto px-0 min-h-0 pb-0" onClose={onClose}>
16
+ <Dialog onClose={onClose}>
17
17
  {isMobileMode ? (
18
18
  <img src={src} />
19
19
  ) : (
@@ -57,7 +57,7 @@ export const DraftDialog = JSX<DraftDialogProps>(function ({
57
57
  }, []);
58
58
 
59
59
  return (
60
- <Dialog className="my-6xl max-w-4xl w-full min-h-fit mx-auto rounded-xl py-0" onClose={onClose}>
60
+ <Dialog onClose={onClose}>
61
61
  <div className="flex flex-col gap-lg items-center mt-xs mx-6xl">
62
62
  <Heading
63
63
  className="whitespace-pre-wrap text-center"
@@ -26,10 +26,7 @@ export const EmptyDraftDialog = JSX<EmptyDraftDialogProps>(function ({ isDebit,
26
26
  }, []);
27
27
 
28
28
  return (
29
- <Dialog
30
- className="my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-lg py-0 px-5xl"
31
- onClose={onClose}
32
- >
29
+ <Dialog onClose={onClose}>
33
30
  <div className="flex flex-col gap-lg">
34
31
  <Heading className="text-center" title="Заявки не найдены" headingType="h3" />
35
32
  <Paragraph size="text-l" align="text-center">
@@ -30,10 +30,7 @@ export const NoConsentDialog = JSX<NoConsentDialogProps>(({ attempts, onClose =
30
30
  }, [isMaxAttempts]);
31
31
 
32
32
  return (
33
- <Dialog
34
- className="my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-lg px-5xl"
35
- onClose={handleClose}
36
- >
33
+ <Dialog onClose={handleClose}>
37
34
  <div className="flex flex-col gap-xl items-center">
38
35
  <Paragraph align="text-center">Уважаемый клиент!</Paragraph>
39
36
  <Paragraph align="text-center">
@@ -108,10 +108,7 @@ export const VerifyPhoneDialog = JSX<VerifyPhoneDialogProps>(
108
108
  }, []);
109
109
 
110
110
  return (
111
- <Dialog
112
- className="my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-xl p-m"
113
- onClose={onClose}
114
- >
111
+ <Dialog maxWidth="lg" onClose={onClose}>
115
112
  <div className="flex flex-col gap-xl items-center rounded-md">
116
113
  <Headline
117
114
  className="w-full"
@@ -1,26 +1,35 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
- import { type ComponentType } from '../../model/ComponentType';
3
2
  import { type OnClickPreventableProps } from '../../model/OnClickProps';
4
3
  import type { OnCloseProps } from '../../model/OnCloseProps';
5
4
  import { type VNode } from '../../model/VNode';
6
5
  import { style } from '../../utils/style';
7
6
  import { CloseButton } from './CloseButton';
8
7
 
9
- export interface DialogProps extends ComponentType, OnCloseProps, OnClickPreventableProps {
8
+ export interface DialogProps extends OnCloseProps, OnClickPreventableProps {
10
9
  head?: VNode;
10
+ maxWidth?: 'sm' | '4xl' | 'lg';
11
11
  }
12
12
 
13
- export const Dialog = JSX<DialogProps>(({ className, head, children, onClose, onClick }) => (
13
+ const MAX_WIDTH_STYLE = {
14
+ sm: 'max-w-sm top-1/3',
15
+ lg: 'max-w-lg',
16
+ '4xl': 'max-w-4xl',
17
+ };
18
+
19
+ export const Dialog = JSX<DialogProps>(({ head, maxWidth = '4xl', children, onClose, onClick }) => (
14
20
  <div
15
- className={style('relative bg-white pt-0 p-lg', className)}
21
+ className={style(
22
+ 'relative bg-white p-lg pb-6xl my-6xl mx-auto rounded-lg w-full',
23
+ MAX_WIDTH_STYLE[maxWidth],
24
+ )}
16
25
  role="dialog"
17
26
  title="Диалог"
18
27
  onClick={onClick}
19
28
  >
20
29
  <div className="sticky py-xl top-0 bg-white z-10">
21
- <CloseButton className="absolute top-0 right-0" onClose={onClose} />
30
+ <CloseButton className="absolute top-0 right-0 z-10" onClose={onClose} />
22
31
  <div className="container">{head}</div>
23
32
  </div>
24
- <div className="container pb-m mb-[74px] lg:mb-0">{children}</div>
33
+ <div className="container">{children}</div>
25
34
  </div>
26
35
  ));
@@ -45,19 +45,7 @@ export const LocationDialog = JSX<LocationDialogProps>(({ foreignOffices, branch
45
45
  );
46
46
 
47
47
  return (
48
- <Dialog
49
- className="pb-20"
50
- head={
51
- <div>
52
- <Text size="text-h4" color="text-primary-text">
53
- Выберите филиал
54
- </Text>
55
- <SelectedLocation defaultLocation={branches?.default} />
56
- <SearchBar onSearch={setQuery} searchTerm={query} />
57
- </div>
58
- }
59
- onClose={onClose}
60
- >
48
+ <Dialog head={renderHead(query, setQuery, branches)} onClose={onClose}>
61
49
  {query && query.length >= SEARCH_TERM_MIN_LENGTH ? (
62
50
  <div>
63
51
  {regions
@@ -79,6 +67,16 @@ export const LocationDialog = JSX<LocationDialogProps>(({ foreignOffices, branch
79
67
  );
80
68
  });
81
69
 
70
+ const renderHead = (query: string, setQuery: (_: string) => void, branches?: BranchesHeader) => (
71
+ <div>
72
+ <Text size="text-h4" color="text-primary-text">
73
+ Выберите филиал
74
+ </Text>
75
+ <SelectedLocation defaultLocation={branches?.default} />
76
+ <SearchBar onSearch={setQuery} searchTerm={query} />
77
+ </div>
78
+ );
79
+
82
80
  const regionFirstLetter = (region: Region) => region.name?.charAt(0) ?? '';
83
81
 
84
82
  const cleanUpRegions = (regions: Region[]) =>
@@ -13,7 +13,7 @@ export interface ReportDialogProps extends LinkDoc, OnCloseProps {
13
13
  }
14
14
 
15
15
  export const ReportDialog = JSX<ReportDialogProps>(({ href, __html, target, onClose }) => (
16
- <Dialog className="my-6xl min-h-fit w-fit mx-auto" onClose={onClose}>
16
+ <Dialog maxWidth="lg" onClose={onClose}>
17
17
  {__html ? <RichText __html={__html} /> : null}
18
18
  <div className="flex flex-row mx-auto w-fit gap-lg py-lg">
19
19
  <Link
@@ -21,7 +21,7 @@ export const ResponseTypeDialog = JSX<ResponseNotificationProps>(({ ok, typeForm
21
21
  : 'Совсем скоро мы с вами свяжемся';
22
22
 
23
23
  return (
24
- <Dialog className="my-6xl max-w-lg w-full min-h-fit mx-auto" onClose={onClose}>
24
+ <Dialog maxWidth="lg" onClose={onClose}>
25
25
  <div className="flex flex-col gap-lg items-center rounded-md space-x-m">
26
26
  <Img image={{ icon: statusIcon, iconVersion: 'normal' }} width="136" height="136" />
27
27
  <Headline
@@ -28,7 +28,10 @@ export const SearchDialog = JSX<SearchDialogProps>(({ initialQuery, navigationIt
28
28
  );
29
29
 
30
30
  return (
31
- <Dialog head={<SearchInput autoFocus={true} {...searchInputProps} />} onClose={onClose}>
31
+ <Dialog
32
+ head={<SearchInput className="mt-s" autoFocus={true} {...searchInputProps} />}
33
+ onClose={onClose}
34
+ >
32
35
  <Sitemap navigationItems={searchItems} />
33
36
  </Dialog>
34
37
  );
@@ -0,0 +1,32 @@
1
+ import '../../setup-fixture';
2
+ import { noop } from '../../utils/noop';
3
+
4
+ import { SnowplowPopupDialog, type SnowplowPopupDialogProps } from './SnowplowPopupDialog';
5
+
6
+ const PROPS: SnowplowPopupDialogProps = {
7
+ aspects: {},
8
+ onClose: () => noop(),
9
+ handleAspects: () => noop(),
10
+ title: 'Заголовок',
11
+ description:
12
+ 'Описание, но не короткое, а длинное описание, так что бы много слов и в несколько строк',
13
+ align: 'text-center',
14
+ img: {
15
+ src: 'chair.png',
16
+ size: {
17
+ width: 180,
18
+ height: 80,
19
+ },
20
+ },
21
+ buttons: [
22
+ {
23
+ version: 'primary',
24
+ text: 'Подробнее',
25
+ },
26
+ ],
27
+ __html: '<ul><li>Список 1</li></ul>',
28
+ };
29
+
30
+ export default {
31
+ default: <SnowplowPopupDialog {...PROPS} />,
32
+ };