@react-pakistan/util-functions 1.23.33 → 1.23.34

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 (101) hide show
  1. package/api/cors/index.js +6 -6
  2. package/api/stellar-solutions/app-user/index.js +97 -38
  3. package/api/stellar-solutions/banking-detail/index.js +107 -48
  4. package/api/stellar-solutions/branch/index.js +107 -48
  5. package/api/stellar-solutions/company/index.js +124 -57
  6. package/api/stellar-solutions/company-report/index.js +48 -13
  7. package/api/stellar-solutions/contact/index.js +132 -65
  8. package/api/stellar-solutions/currency/index.js +101 -42
  9. package/api/stellar-solutions/customer/index.js +149 -74
  10. package/api/stellar-solutions/expense/index.js +132 -65
  11. package/api/stellar-solutions/expense-category/index.js +133 -66
  12. package/api/stellar-solutions/lead/index.js +132 -65
  13. package/api/stellar-solutions/menu-order/index.js +97 -38
  14. package/api/stellar-solutions/payment/index.js +135 -77
  15. package/api/stellar-solutions/payment-mode/index.js +90 -31
  16. package/api/stellar-solutions/preference/index.js +71 -28
  17. package/api/stellar-solutions/product/index.js +144 -77
  18. package/api/stellar-solutions/product-category/index.js +130 -63
  19. package/api/stellar-solutions/profile/index.js +152 -77
  20. package/api/stellar-solutions/quote-invoice/index.js +280 -201
  21. package/api/stellar-solutions/quote-invoice-report/index.js +48 -13
  22. package/api/stellar-solutions/tax/index.js +103 -44
  23. package/constants/react-pakistan.js +11 -22
  24. package/constants/social-media-sizes.js +33 -32
  25. package/general/basic-get.js +68 -6
  26. package/general/basic-post.js +55 -6
  27. package/general/camel-to-sentence-case.js +3 -3
  28. package/general/check-even-odd-length.js +1 -1
  29. package/general/create-date.js +4 -4
  30. package/general/dynamic-page-limit.js +15 -4
  31. package/general/enum-to-text.js +2 -2
  32. package/general/fetch-supabase-image.js +53 -15
  33. package/general/format-date.js +13 -12
  34. package/general/generate-blog-schema.js +10 -9
  35. package/general/generate-breadcrumb-schema.js +5 -4
  36. package/general/generate-faq-schema.js +5 -3
  37. package/general/generate-grid.js +2 -2
  38. package/general/generate-organization-schema.js +14 -13
  39. package/general/get-day-name.js +1 -1
  40. package/general/get-full-name.js +4 -1
  41. package/general/get-href.js +1 -1
  42. package/general/get-month-name.js +1 -1
  43. package/general/get-pathname.js +1 -1
  44. package/general/index.d.ts +2 -2
  45. package/general/index.js +2 -2
  46. package/general/is-next-button-disabled.js +1 -1
  47. package/general/is-odd.js +1 -1
  48. package/general/is-previous-button-disabled.js +1 -1
  49. package/general/remove-data-image-prefix.js +2 -2
  50. package/general/repeat-times.js +3 -3
  51. package/general/resolve-anchor-link.js +4 -4
  52. package/general/resolve-current-date.js +2 -2
  53. package/general/resolve-grid.js +1 -1
  54. package/general/resolve-initials.js +2 -2
  55. package/general/set-timezone.js +6 -3
  56. package/general/slugify.js +2 -2
  57. package/general/text-to-enum.js +1 -1
  58. package/general/text-to-sentence-case.js +1 -1
  59. package/general/truncate-text.js +1 -1
  60. package/general/upload-blob-to-private-supabase.d.ts +11 -0
  61. package/general/upload-blob-to-private-supabase.js +62 -0
  62. package/general/upload-blob-to-public-supabase.d.ts +11 -0
  63. package/general/upload-blob-to-public-supabase.js +62 -0
  64. package/general/upload-image-to-private-supabase.js +51 -15
  65. package/general/upload-image-to-public-supabase.js +51 -15
  66. package/general/url-to-sentence-case.js +4 -4
  67. package/general/validate-comment.js +1 -1
  68. package/general/validate-email.js +2 -2
  69. package/general/validate-name.js +1 -1
  70. package/hooks/use-change.js +14 -5
  71. package/hooks/use-debounce.js +7 -6
  72. package/hooks/use-fetch.js +82 -31
  73. package/hooks/use-force-render.js +3 -3
  74. package/hooks/use-ip-geo-location.js +57 -22
  75. package/hooks/use-is-mobile.js +6 -6
  76. package/hooks/use-position.js +16 -16
  77. package/hooks/use-sticky.js +9 -8
  78. package/hooks/use-toggle-state.js +6 -5
  79. package/hooks/use-window-event-listener.js +4 -4
  80. package/local-storage/get-storage-value.js +2 -2
  81. package/local-storage/remove-storage-value.js +1 -1
  82. package/local-storage/set-storage-value.js +1 -1
  83. package/package.json +1 -1
  84. package/storybook/generate-sitemap.js +6 -22
  85. package/storybook/preview.js +13 -2
  86. package/storybook/react-design-story-script.js +7 -11
  87. package/storybook/react-emoji-collection.js +23 -33
  88. package/storybook/react-emoji-story-script.js +9 -13
  89. package/storybook/react-emoji-story-template.js +1 -46
  90. package/storybook/react-icon-collection.js +17 -27
  91. package/storybook/react-icon-story-script.js +9 -13
  92. package/storybook/react-icon-story-template.js +1 -46
  93. package/storybook/react-logo-collection.js +17 -27
  94. package/storybook/react-logo-story-script.js +9 -13
  95. package/storybook/react-logo-story-template.js +1 -46
  96. package/storybook/responsive-component.js +11 -46
  97. package/storybook/theme.js +4 -4
  98. package/general/upload-image-blob-to-private-supabase.d.ts +0 -11
  99. package/general/upload-image-blob-to-private-supabase.js +0 -27
  100. package/general/upload-image-blob-to-public-supabase.d.ts +0 -11
  101. package/general/upload-image-blob-to-public-supabase.js +0 -27
@@ -11,50 +11,5 @@
11
11
  /** End file docs */
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
13
  exports.reactLogoStoryTemplate = void 0;
14
- const reactLogoStoryTemplate = (category, logoListDirName) => `/*
15
- * Generated by scripts/generate-logos.js
16
- * DO NOT EDIT!
17
- */
18
-
19
- import React, { FC, ReactElement } from 'react';
20
- import { LogoWrapper, LogoTextWrapper, LogoItem, ILogoProps } from '../styled';
21
- import { StyledStory } from '../styled-app';
22
- import { LOGO_LIST } from './${logoListDirName}';
23
-
24
- const logoStyle = { width: '7rem', height: '7rem' };
25
-
26
- const renderItem = (
27
- item: { logo: FC<ILogoProps>, name: string }
28
- ): ReactElement => {
29
- const Logo = item.logo;
30
- return (
31
- <LogoItem
32
- key={item.name}
33
- >
34
- <Logo style={logoStyle} />
35
- <LogoTextWrapper>
36
- {item.name}
37
- </LogoTextWrapper>
38
- </LogoItem>
39
- );
40
- };
41
-
42
- const logos = LOGO_LIST.map(renderItem);
43
-
44
- export const ${category} = (): ReactElement => (
45
- <StyledStory>
46
- <LogoWrapper>
47
- {logos}
48
- </LogoWrapper>
49
- </StyledStory>
50
- );
51
-
52
- export default {
53
- title: 'Logo/${category}',
54
-
55
- parameters: {
56
- component: ${category},
57
- },
58
- };
59
- `;
14
+ var reactLogoStoryTemplate = function (category, logoListDirName) { return "/*\n * Generated by scripts/generate-logos.js\n * DO NOT EDIT!\n */\n\nimport React, { FC, ReactElement } from 'react';\nimport { LogoWrapper, LogoTextWrapper, LogoItem, ILogoProps } from '../styled';\nimport { StyledStory } from '../styled-app';\nimport { LOGO_LIST } from './".concat(logoListDirName, "';\n\nconst logoStyle = { width: '7rem', height: '7rem' };\n\nconst renderItem = (\n item: { logo: FC<ILogoProps>, name: string }\n): ReactElement => {\n const Logo = item.logo;\n return (\n <LogoItem\n key={item.name}\n >\n <Logo style={logoStyle} />\n <LogoTextWrapper>\n {item.name}\n </LogoTextWrapper>\n </LogoItem>\n );\n};\n\nconst logos = LOGO_LIST.map(renderItem);\n\nexport const ").concat(category, " = (): ReactElement => (\n <StyledStory>\n <LogoWrapper>\n {logos}\n </LogoWrapper>\n </StyledStory>\n);\n\nexport default {\n title: 'Logo/").concat(category, "',\n\n parameters: {\n component: ").concat(category, ",\n },\n};\n"); };
60
15
  exports.reactLogoStoryTemplate = reactLogoStoryTemplate;
@@ -1,51 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.responsiveComponent = void 0;
4
- const theme_1 = require("./theme");
5
- const responsiveComponent = ({ $desktop, $laptop, $laptopL, $mobileL, $mobileM, $mobileS, $tablet, }) => {
6
- const mobileSToReturn = $mobileS && `
7
- @media ${theme_1.theme.breakpoints.mobileS} {
8
- ${$mobileS}
9
- }
10
- `;
11
- const mobileMToReturn = $mobileM && `
12
- @media ${theme_1.theme.breakpoints.mobileM} {
13
- ${$mobileM}
14
- }
15
- `;
16
- const mobileLToReturn = $mobileL && `
17
- @media ${theme_1.theme.breakpoints.mobileL} {
18
- ${$mobileL}
19
- }
20
- `;
21
- const tabletToReturn = $tablet && `
22
- @media ${theme_1.theme.breakpoints.tablet} {
23
- ${$tablet}
24
- }
25
- `;
26
- const laptopToReturn = $laptop && `
27
- @media ${theme_1.theme.breakpoints.laptop} {
28
- ${$laptop}
29
- }
30
- `;
31
- const laptopLToReturn = $laptopL && `
32
- @media ${theme_1.theme.breakpoints.laptopL} {
33
- ${$laptopL}
34
- }
35
- `;
36
- const desktopToReturn = $desktop && `
37
- @media ${theme_1.theme.breakpoints.desktop} {
38
- ${$desktop}
39
- }
40
- `;
41
- return `
42
- ${mobileSToReturn}
43
- ${mobileMToReturn}
44
- ${mobileLToReturn}
45
- ${tabletToReturn}
46
- ${laptopToReturn}
47
- ${laptopLToReturn}
48
- ${desktopToReturn}
49
- `;
4
+ var theme_1 = require("./theme");
5
+ var responsiveComponent = function (_a) {
6
+ var $desktop = _a.$desktop, $laptop = _a.$laptop, $laptopL = _a.$laptopL, $mobileL = _a.$mobileL, $mobileM = _a.$mobileM, $mobileS = _a.$mobileS, $tablet = _a.$tablet;
7
+ var mobileSToReturn = $mobileS && "\n @media ".concat(theme_1.theme.breakpoints.mobileS, " {\n ").concat($mobileS, "\n }\n ");
8
+ var mobileMToReturn = $mobileM && "\n @media ".concat(theme_1.theme.breakpoints.mobileM, " {\n ").concat($mobileM, "\n }\n ");
9
+ var mobileLToReturn = $mobileL && "\n @media ".concat(theme_1.theme.breakpoints.mobileL, " {\n ").concat($mobileL, "\n }\n ");
10
+ var tabletToReturn = $tablet && "\n @media ".concat(theme_1.theme.breakpoints.tablet, " {\n ").concat($tablet, "\n }\n ");
11
+ var laptopToReturn = $laptop && "\n @media ".concat(theme_1.theme.breakpoints.laptop, " {\n ").concat($laptop, "\n }\n ");
12
+ var laptopLToReturn = $laptopL && "\n @media ".concat(theme_1.theme.breakpoints.laptopL, " {\n ").concat($laptopL, "\n }\n ");
13
+ var desktopToReturn = $desktop && "\n @media ".concat(theme_1.theme.breakpoints.desktop, " {\n ").concat($desktop, "\n }\n ");
14
+ return "\n ".concat(mobileSToReturn, "\n ").concat(mobileMToReturn, "\n ").concat(mobileLToReturn, "\n ").concat(tabletToReturn, "\n ").concat(laptopToReturn, "\n ").concat(laptopLToReturn, "\n ").concat(desktopToReturn, "\n ");
50
15
  };
51
16
  exports.responsiveComponent = responsiveComponent;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.theme = void 0;
4
- const colors = {
4
+ var colors = {
5
5
  absoluteWhite: '#FFFFFF',
6
6
  absoluteBlack: '#000000',
7
7
  ash50: '#FBFBFD',
@@ -427,7 +427,7 @@ const colors = {
427
427
  skyBlue: '#1E90FF',
428
428
  white: '#FFFFFF',
429
429
  };
430
- const typography = {
430
+ var typography = {
431
431
  fontFamily: 'Montserrat',
432
432
  h1: {
433
433
  fontFamily: 'Playfair Display',
@@ -692,7 +692,7 @@ const typography = {
692
692
  },
693
693
  };
694
694
  exports.theme = {
695
- typography,
695
+ typography: typography,
696
696
  avatarSizes: {
697
697
  small: '16px',
698
698
  medium: '24px',
@@ -708,7 +708,7 @@ exports.theme = {
708
708
  laptopL: 'only screen and (min-width: 1440px) and (max-width: 2559px)',
709
709
  desktop: 'only screen and (min-width: 2560px)',
710
710
  },
711
- colors,
711
+ colors: colors,
712
712
  // light: {
713
713
  // neutral0: '',
714
714
  // get neutral0Val() { return this.colors.white; },
@@ -1,11 +0,0 @@
1
- export interface UploadImageBlobToPrivateSupabaseArgs {
2
- blob: Blob;
3
- contentType: string;
4
- fileRef: string;
5
- supabase: any;
6
- upsert: boolean;
7
- }
8
- export declare const uploadImageBlobToPrivateSupabase: ({ blob, contentType, fileRef, supabase, upsert, }: UploadImageBlobToPrivateSupabaseArgs) => Promise<{
9
- data: any;
10
- error: any;
11
- }>;
@@ -1,27 +0,0 @@
1
- "use strict";
2
- /* eslint-disable @typescript-eslint/no-explicit-any */
3
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
4
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
5
- return new (P || (P = Promise))(function (resolve, reject) {
6
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
7
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
8
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
9
- step((generator = generator.apply(thisArg, _arguments || [])).next());
10
- });
11
- };
12
- Object.defineProperty(exports, "__esModule", { value: true });
13
- exports.uploadImageBlobToPrivateSupabase = void 0;
14
- const uploadImageBlobToPrivateSupabase = (_a) => __awaiter(void 0, [_a], void 0, function* ({ blob, contentType, fileRef, supabase, upsert, }) {
15
- const { data, error } = yield supabase.storage
16
- .from(process.env.NEXT_PUBLIC_SUPABASE_PRIVATE_BUCKET)
17
- .upload(fileRef, blob, {
18
- cacheControl: process.env.NEXT_PUBLIC_SUPABASE_CACHE_CONTROL,
19
- contentType,
20
- upsert,
21
- });
22
- return {
23
- data,
24
- error,
25
- };
26
- });
27
- exports.uploadImageBlobToPrivateSupabase = uploadImageBlobToPrivateSupabase;
@@ -1,11 +0,0 @@
1
- export interface UploadImageBlobToPublicSupabaseArgs {
2
- blob: Blob;
3
- contentType: string;
4
- fileRef: string;
5
- supabase: any;
6
- upsert: boolean;
7
- }
8
- export declare const uploadImageBlobToPublicSupabase: ({ blob, contentType, fileRef, supabase, upsert, }: UploadImageBlobToPublicSupabaseArgs) => Promise<{
9
- data: any;
10
- error: any;
11
- }>;
@@ -1,27 +0,0 @@
1
- "use strict";
2
- /* eslint-disable @typescript-eslint/no-explicit-any */
3
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
4
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
5
- return new (P || (P = Promise))(function (resolve, reject) {
6
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
7
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
8
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
9
- step((generator = generator.apply(thisArg, _arguments || [])).next());
10
- });
11
- };
12
- Object.defineProperty(exports, "__esModule", { value: true });
13
- exports.uploadImageBlobToPublicSupabase = void 0;
14
- const uploadImageBlobToPublicSupabase = (_a) => __awaiter(void 0, [_a], void 0, function* ({ blob, contentType, fileRef, supabase, upsert, }) {
15
- const { data, error } = yield supabase.storage
16
- .from(process.env.NEXT_PUBLIC_SUPABASE_PUBLIC_BUCKET)
17
- .upload(fileRef, blob, {
18
- cacheControl: process.env.NEXT_PUBLIC_SUPABASE_CACHE_CONTROL,
19
- contentType,
20
- upsert,
21
- });
22
- return {
23
- data,
24
- error,
25
- };
26
- });
27
- exports.uploadImageBlobToPublicSupabase = uploadImageBlobToPublicSupabase;