@ashtuka/react-lib 1.0.37 → 1.0.39

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 (51) hide show
  1. package/README.md +3 -0
  2. package/dist/components/LoadAbleImg/LoadAbleImg.d.ts +9 -0
  3. package/dist/components/LoadAbleImg/index.d.ts +1 -0
  4. package/dist/constants/breakpoints.d.ts +5 -5
  5. package/dist/hooks/index.d.ts +2 -0
  6. package/dist/hooks/index.es.js +5 -0
  7. package/dist/hooks/useDevice.d.ts +17 -0
  8. package/dist/hooks/useOnScreen-CpqVO1-u.mjs +28 -0
  9. package/dist/hooks/useOnScreen.d.ts +21 -0
  10. package/dist/index.d.ts +2 -0
  11. package/dist/index.es.js +4 -2
  12. package/dist/modules/FooterV2Module/AppsList/AppsList.d.ts +1 -0
  13. package/dist/modules/FooterV2Module/AppsList/index.d.ts +1 -0
  14. package/dist/modules/FooterV2Module/FooterBottom/FooterBottom.d.ts +8 -0
  15. package/dist/modules/FooterV2Module/FooterBottom/index.d.ts +1 -0
  16. package/dist/modules/FooterV2Module/FooterHeader/FooterHeader.d.ts +12 -0
  17. package/dist/modules/FooterV2Module/FooterHeader/index.d.ts +1 -0
  18. package/dist/modules/FooterV2Module/FooterMenu/FooterMenu.d.ts +11 -0
  19. package/dist/modules/FooterV2Module/FooterMenu/index.d.ts +1 -0
  20. package/dist/modules/FooterV2Module/FooterV2Module-Cd4z2v8y.mjs +387 -0
  21. package/dist/modules/FooterV2Module/FooterV2Module.css +1 -0
  22. package/dist/modules/FooterV2Module/FooterV2Module.d.ts +2 -0
  23. package/dist/modules/FooterV2Module/FooterV2Module.types.d.ts +52 -0
  24. package/dist/modules/FooterV2Module/PaymentSystems/PaymentSystems.d.ts +5 -0
  25. package/dist/modules/FooterV2Module/PaymentSystems/index.d.ts +1 -0
  26. package/dist/modules/FooterV2Module/Phone/Phone.d.ts +7 -0
  27. package/dist/modules/FooterV2Module/Phone/index.d.ts +1 -0
  28. package/dist/modules/FooterV2Module/SocialList/SocialList.d.ts +13 -0
  29. package/dist/modules/FooterV2Module/SocialList/index.d.ts +1 -0
  30. package/dist/modules/FooterV2Module/index.d.ts +2 -0
  31. package/dist/modules/FooterV2Module/index.es.js +4 -0
  32. package/dist/modules/FooterV2Module/utils/getAbsUrl.d.ts +3 -0
  33. package/dist/modules/FooterV2Module/utils/index.d.ts +2 -0
  34. package/dist/modules/FooterV2Module/utils/setFooterStyle.d.ts +3 -0
  35. package/dist/modules/PageLoaderModule/PageLoaderModule-D6yGXr6Z.mjs +100 -0
  36. package/dist/modules/PageLoaderModule/PageLoaderModule.d.ts +2 -28
  37. package/dist/modules/PageLoaderModule/PageLoaderModule.types.d.ts +26 -0
  38. package/dist/modules/PageLoaderModule/PageLoaderModuleLocalization.d.ts +7 -0
  39. package/dist/modules/PageLoaderModule/index.d.ts +1 -1
  40. package/dist/modules/PageLoaderModule/index.es.js +4 -0
  41. package/dist/services/LayoutService.d.ts +9 -0
  42. package/dist/services/Service.d.ts +13 -0
  43. package/dist/services/utils/getHost.d.ts +1 -0
  44. package/dist/services/utils/index.d.ts +1 -0
  45. package/dist/types/Header.d.ts +34 -0
  46. package/dist/types/Locale-D0KYJGGt.mjs +4 -0
  47. package/dist/types/index.d.ts +1 -0
  48. package/package.json +12 -10
  49. package/dist/modules/PageLoaderModule/PageLoaderModule-BJcY2xBU.mjs +0 -369
  50. package/dist/modules/PageLoaderModule/PageLoaderModule.es.js +0 -4
  51. /package/dist/{utils.es.js → utils/index.es.js} +0 -0
@@ -0,0 +1,13 @@
1
+ type SocialListType = {
2
+ facebook?: string;
3
+ youtube?: string;
4
+ telegram?: string;
5
+ tiktok?: string;
6
+ instagram?: string;
7
+ } | undefined;
8
+ type SocialListProps = {
9
+ socialList: SocialListType;
10
+ isAgent: boolean;
11
+ };
12
+ export declare const SocialList: ({ socialList, isAgent }: SocialListProps) => import("react/jsx-runtime").JSX.Element | null;
13
+ export {};
@@ -0,0 +1 @@
1
+ export * from './SocialList';
@@ -0,0 +1,2 @@
1
+ export { FooterV2Module } from './FooterV2Module';
2
+ export type { FooterV2ModuleProps } from './FooterV2Module.types';
@@ -0,0 +1,4 @@
1
+ import { F as r } from "./FooterV2Module-Cd4z2v8y.mjs";
2
+ export {
3
+ r as FooterV2Module
4
+ };
@@ -0,0 +1,3 @@
1
+ import { Locale } from '@/types';
2
+ export declare const getAbsUrl: (lang: Locale, url: string) => string;
3
+ export default getAbsUrl;
@@ -0,0 +1,2 @@
1
+ export * from './getAbsUrl';
2
+ export * from './setFooterStyle';
@@ -0,0 +1,3 @@
1
+ import { FooterStyleConfig } from '../FooterV2Module.types';
2
+ export declare const setFooterStyles: (styleConfig: FooterStyleConfig) => void;
3
+ export default setFooterStyles;
@@ -0,0 +1,100 @@
1
+ import { jsxs as c, jsx as s } from "react/jsx-runtime";
2
+ import { L as f } from "../../types/Locale-D0KYJGGt.mjs";
3
+ import _ from "react-localization";
4
+ function g(o) {
5
+ return o && o.__esModule && Object.prototype.hasOwnProperty.call(o, "default") ? o.default : o;
6
+ }
7
+ var m = { exports: {} };
8
+ /*!
9
+ Copyright (c) 2018 Jed Watson.
10
+ Licensed under the MIT License (MIT), see
11
+ http://jedwatson.github.io/classnames
12
+ */
13
+ (function(o) {
14
+ (function() {
15
+ var d = {}.hasOwnProperty;
16
+ function r() {
17
+ for (var n = "", e = 0; e < arguments.length; e++) {
18
+ var a = arguments[e];
19
+ a && (n = i(n, l(a)));
20
+ }
21
+ return n;
22
+ }
23
+ function l(n) {
24
+ if (typeof n == "string" || typeof n == "number")
25
+ return n;
26
+ if (typeof n != "object")
27
+ return "";
28
+ if (Array.isArray(n))
29
+ return r.apply(null, n);
30
+ if (n.toString !== Object.prototype.toString && !n.toString.toString().includes("[native code]"))
31
+ return n.toString();
32
+ var e = "";
33
+ for (var a in n)
34
+ d.call(n, a) && n[a] && (e = i(e, a));
35
+ return e;
36
+ }
37
+ function i(n, e) {
38
+ return e ? n ? n + " " + e : n + e : n;
39
+ }
40
+ o.exports ? (r.default = r, o.exports = r) : window.classNames = r;
41
+ })();
42
+ })(m);
43
+ var h = m.exports;
44
+ const u = /* @__PURE__ */ g(h), p = new _({
45
+ uk: {
46
+ sloganRow1: "Класний пошукатор",
47
+ sloganRow2: "страхових"
48
+ },
49
+ ru: {
50
+ sloganRow1: "Классный пошукатор",
51
+ sloganRow2: "страховых"
52
+ }
53
+ }), w = "_container_1xrzw_1", v = "_fullScreen_1xrzw_10", x = "_loaderContainer_1xrzw_26", N = "_inner_1xrzw_34", z = "_item_1xrzw_41", S = "_logo_1xrzw_94", y = "_sloganWrap_1xrzw_99", j = "_slogan_1xrzw_99", C = "_title_1xrzw_113", t = {
54
+ container: w,
55
+ fullScreen: v,
56
+ loaderContainer: x,
57
+ inner: N,
58
+ item: z,
59
+ logo: S,
60
+ sloganWrap: y,
61
+ slogan: j,
62
+ title: C
63
+ }, W = ({
64
+ classes: o = "",
65
+ isFullScreen: d,
66
+ locale: r = f.UK,
67
+ title: l,
68
+ titleClasses: i = ""
69
+ }) => {
70
+ p.setLanguage(r);
71
+ const n = u(t.container, o, {
72
+ [t.fullScreen]: d
73
+ }), e = u(t.title, i);
74
+ return /* @__PURE__ */ c("div", { className: n, children: [
75
+ /* @__PURE__ */ c("div", { className: t.loaderContainer, children: [
76
+ /* @__PURE__ */ c("div", { className: t.inner, children: [
77
+ /* @__PURE__ */ s("div", { className: t.item, children: " " }),
78
+ /* @__PURE__ */ s("div", { className: t.item, children: " " }),
79
+ /* @__PURE__ */ s("div", { className: t.item, children: " " })
80
+ ] }),
81
+ /* @__PURE__ */ s("div", { className: t.logo, children: /* @__PURE__ */ s(
82
+ "img",
83
+ {
84
+ width: "148px",
85
+ height: "40px",
86
+ src: "https://polis.ua/static/img/logo/logoWithFlagLine.svg",
87
+ alt: "Icon"
88
+ }
89
+ ) }),
90
+ /* @__PURE__ */ c("div", { className: t.sloganWrap, children: [
91
+ /* @__PURE__ */ s("span", { className: t.slogan, children: p.sloganRow1 }),
92
+ /* @__PURE__ */ s("span", { className: t.slogan, children: p.sloganRow2 })
93
+ ] })
94
+ ] }),
95
+ l && /* @__PURE__ */ s("div", { className: e, children: l })
96
+ ] });
97
+ };
98
+ export {
99
+ W as P
100
+ };
@@ -18,31 +18,5 @@
18
18
  * />
19
19
  * ```
20
20
  */
21
- import React from 'react';
22
- import { Locale } from '@/types';
23
- export type PageLoaderModuleProps = {
24
- /**
25
- * Додаткові CSS-класи для контейнера.
26
- * @default ''
27
- */
28
- classes?: string;
29
- /**
30
- * Якщо `true`, лоадер займає весь екран.
31
- */
32
- isFullScreen?: boolean;
33
- /**
34
- * Підтримувані значення: `Locale.UK` (українська), `Locale.RU` (російська).
35
- * @default Locale.UK
36
- */
37
- locale?: Locale;
38
- /**
39
- * Додатковий заголовок.
40
- */
41
- title?: string;
42
- /**
43
- * Додаткові CSS-класи для заголовка.
44
- * @default ''
45
- */
46
- titleClasses?: string;
47
- };
48
- export declare const PageLoaderModule: React.FC<PageLoaderModuleProps>;
21
+ import { PageLoaderModuleProps } from './PageLoaderModule.types';
22
+ export declare const PageLoaderModule: ({ classes, isFullScreen, locale, title, titleClasses, }: PageLoaderModuleProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,26 @@
1
+ import { Locale } from '@/types';
2
+ export type PageLoaderModuleProps = {
3
+ /**
4
+ * Додаткові CSS-класи для контейнера.
5
+ * @default ''
6
+ */
7
+ classes?: string;
8
+ /**
9
+ * Якщо `true`, лоадер займає весь екран.
10
+ */
11
+ isFullScreen?: boolean;
12
+ /**
13
+ * Підтримувані значення: `Locale.UK` (українська), `Locale.RU` (російська).
14
+ * @default Locale.UK
15
+ */
16
+ locale?: Locale;
17
+ /**
18
+ * Додатковий заголовок.
19
+ */
20
+ title?: string;
21
+ /**
22
+ * Додаткові CSS-класи для заголовка.
23
+ * @default ''
24
+ */
25
+ titleClasses?: string;
26
+ };
@@ -0,0 +1,7 @@
1
+ export declare const localization: import("react-localization").LocalizedStrings<{
2
+ sloganRow1: string;
3
+ sloganRow2: string;
4
+ } | {
5
+ sloganRow1: string;
6
+ sloganRow2: string;
7
+ }>;
@@ -1,2 +1,2 @@
1
1
  export { PageLoaderModule } from './PageLoaderModule';
2
- export type { PageLoaderModuleProps } from './PageLoaderModule';
2
+ export type { PageLoaderModuleProps } from './PageLoaderModule.types';
@@ -0,0 +1,4 @@
1
+ import { P as a } from "./PageLoaderModule-D6yGXr6Z.mjs";
2
+ export {
3
+ a as PageLoaderModule
4
+ };
@@ -0,0 +1,9 @@
1
+ import { HeaderData } from '@/types';
2
+ import { FooterData } from '@/modules/FooterV2Module/FooterV2Module.types';
3
+ import Service from './Service';
4
+ declare class LayoutService extends Service {
5
+ constructor();
6
+ fetchHeaderData(): Promise<HeaderData>;
7
+ fetchFooterData(): Promise<FooterData>;
8
+ }
9
+ export default LayoutService;
@@ -0,0 +1,13 @@
1
+ type RequestConfig = {
2
+ method?: 'GET' | 'POST' | 'PUT' | 'DELETE';
3
+ data?: unknown;
4
+ params?: Record<string, string>;
5
+ headers?: Record<string, string>;
6
+ };
7
+ declare class Service {
8
+ protected readonly BASE_PATH: string;
9
+ protected readonly HOST: string;
10
+ constructor(host: string, basePath: string);
11
+ request<T>(endpoint: string, config: RequestConfig): Promise<T>;
12
+ }
13
+ export default Service;
@@ -0,0 +1 @@
1
+ export declare const getHost: () => string;
@@ -0,0 +1 @@
1
+ export * from './getHost';
@@ -0,0 +1,34 @@
1
+ export interface MenuItem {
2
+ imgAddress: string;
3
+ label: string;
4
+ navigateTo: string;
5
+ new: boolean;
6
+ }
7
+ export interface Cabinet {
8
+ childs: MenuItem[];
9
+ link: string;
10
+ title: string;
11
+ }
12
+ export interface CategoryItem {
13
+ title: string;
14
+ id: string;
15
+ childList: MenuItem[];
16
+ }
17
+ export interface NavItem {
18
+ title: string;
19
+ _id: string;
20
+ imgAddress: string;
21
+ link?: string;
22
+ childs: MenuItem[];
23
+ categoryList: CategoryItem[];
24
+ }
25
+ export type HeaderData = {
26
+ uk: {
27
+ cabinet: Cabinet;
28
+ navItemNew: NavItem[];
29
+ };
30
+ ru: {
31
+ cabinet: Cabinet;
32
+ navItemNew: NavItem[];
33
+ };
34
+ };
@@ -0,0 +1,4 @@
1
+ var u = /* @__PURE__ */ ((r) => (r.UK = "uk", r.RU = "ru", r))(u || {});
2
+ export {
3
+ u as L
4
+ };
@@ -1 +1,2 @@
1
1
  export * from './Locale';
2
+ export * from './Header';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ashtuka/react-lib",
3
- "version": "1.0.37",
3
+ "version": "1.0.39",
4
4
  "main": "./dist/index.es.js",
5
5
  "module": "./dist/index.es.js",
6
6
  "types": "./dist/index.d.ts",
@@ -13,19 +13,20 @@
13
13
  "import": "./dist/utils.es.js",
14
14
  "types": "./dist/utils/index.d.ts"
15
15
  },
16
- "./PageLoaderModule": {
17
- "import": "./dist/modules/PageLoaderModule/PageLoaderModule.es.js",
18
- "types": "./dist/modules/PageLoaderModule/index.d.ts"
16
+ "./hooks": {
17
+ "import": "./dist/hooks.es.js",
18
+ "types": "./dist/hooks/index.d.ts"
19
19
  },
20
- "./PageLoaderModule/style.css": "./dist/modules/PageLoaderModule/PageLoaderModule.css"
20
+ "./PageLoaderModule/style.css": "./dist/modules/PageLoaderModule/PageLoaderModule.css",
21
+ "./FooterV2Module/style.css": "./dist/modules/FooterV2Module/FooterV2Module.css"
21
22
  },
22
23
  "typesVersions": {
23
24
  "*": {
24
25
  "utils": [
25
26
  "./dist/utils/index.d.ts"
26
27
  ],
27
- "PageLoaderModule": [
28
- "./dist/modules/PageLoaderModule/index.d.ts"
28
+ "hooks": [
29
+ "./dist/hooks/index.d.ts"
29
30
  ]
30
31
  }
31
32
  },
@@ -38,14 +39,14 @@
38
39
  },
39
40
  "scripts": {
40
41
  "dev": "vite",
41
- "build": "vite build && tsc && npx tsx scripts/organizeDist.ts",
42
+ "build": "vite build && tsc",
42
43
  "lint": "eslint . --ext .ts,.tsx --fix",
43
44
  "format": "prettier --write .",
44
45
  "release": "npm version patch && npm publish --access public",
45
- "updBuildConfig": "npx tsx scripts/updateBuildConfig.ts",
46
- "organizeDist": "npx tsx scripts/organizeDist.ts"
46
+ "updBuildConfig": "npx tsx scripts/updateBuildConfig.ts"
47
47
  },
48
48
  "peerDependencies": {
49
+ "axios": "^1.11.0",
49
50
  "react": "^19.1.1",
50
51
  "react-dom": "^19.1.1",
51
52
  "react-localization": "^2.0.6"
@@ -57,6 +58,7 @@
57
58
  "@typescript-eslint/eslint-plugin": "^8.29.1",
58
59
  "@typescript-eslint/parser": "^8.29.1",
59
60
  "@vitejs/plugin-react": "^4.0.0",
61
+ "axios": "^1.11.0",
60
62
  "classnames": "^2.5.1",
61
63
  "eslint": "^8.57.1",
62
64
  "eslint-config-prettier": "^10.1.1",