@eventlook/sdk 1.5.0-beta.2 → 1.5.0-beta.4

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 (187) hide show
  1. package/.prettierrc +1 -14
  2. package/dist/cjs/index-DLC5Hr8L.js +35809 -0
  3. package/dist/cjs/index-DLC5Hr8L.js.map +1 -0
  4. package/dist/cjs/index.js +11 -49195
  5. package/dist/cjs/index.js.map +1 -1
  6. package/dist/cjs/index.umd-BSCKGDNQ.js +13407 -0
  7. package/dist/cjs/index.umd-BSCKGDNQ.js.map +1 -0
  8. package/dist/esm/index-BwmbJihM.js +35805 -0
  9. package/dist/esm/index-BwmbJihM.js.map +1 -0
  10. package/dist/esm/index.js +10 -49198
  11. package/dist/esm/index.js.map +1 -1
  12. package/dist/esm/index.umd-6fgyuQlr.js +13405 -0
  13. package/dist/esm/index.umd-6fgyuQlr.js.map +1 -0
  14. package/dist/types/components/ClientOnly.d.ts +5 -0
  15. package/dist/types/components/CustomSkeleton.d.ts +4 -0
  16. package/dist/types/components/Image.d.ts +14 -0
  17. package/dist/types/components/Label.d.ts +11 -0
  18. package/dist/types/components/TextIconLabel.d.ts +10 -0
  19. package/dist/types/components/TicketFormSkeleton.d.ts +3 -0
  20. package/dist/types/components/Trans.d.ts +12 -0
  21. package/dist/types/components/animate/DialogAnimate.d.ts +9 -0
  22. package/dist/types/components/animate/IconButtonAnimate.d.ts +7 -0
  23. package/dist/types/components/animate/MotionContainer.d.ts +10 -0
  24. package/dist/types/components/animate/MotionLazyContainer.d.ts +6 -0
  25. package/dist/types/components/animate/MotionViewport.d.ts +10 -0
  26. package/dist/types/components/animate/TextAnimate.d.ts +9 -0
  27. package/dist/types/components/animate/index.d.ts +7 -0
  28. package/dist/types/components/animate/variants/actions.d.ts +5 -0
  29. package/dist/types/components/animate/variants/background.d.ts +104 -0
  30. package/dist/types/components/animate/variants/bounce.d.ts +131 -0
  31. package/dist/types/components/animate/variants/container.d.ts +19 -0
  32. package/dist/types/components/animate/variants/fade.d.ts +217 -0
  33. package/dist/types/components/animate/variants/flip.d.ts +75 -0
  34. package/dist/types/components/animate/variants/index.d.ts +12 -0
  35. package/dist/types/components/animate/variants/path.d.ts +14 -0
  36. package/dist/types/components/animate/variants/rotate.d.ts +39 -0
  37. package/dist/types/components/animate/variants/scale.d.ts +75 -0
  38. package/dist/types/components/animate/variants/slide.d.ts +155 -0
  39. package/dist/types/components/animate/variants/transition.d.ts +13 -0
  40. package/dist/types/components/animate/variants/zoom.d.ts +199 -0
  41. package/dist/types/components/confirm-dialog/ConfirmDialog.d.ts +3 -0
  42. package/dist/types/components/confirm-dialog/index.d.ts +1 -0
  43. package/dist/types/components/confirm-dialog/types.d.ts +8 -0
  44. package/dist/types/components/hook-form/FormProvider.d.ts +9 -0
  45. package/dist/types/components/hook-form/RHFAutocomplete.d.ts +9 -0
  46. package/dist/types/components/hook-form/RHFCheckbox.d.ts +20 -0
  47. package/dist/types/components/hook-form/RHFCodes.d.ts +8 -0
  48. package/dist/types/components/hook-form/RHFDatePicker.d.ts +8 -0
  49. package/dist/types/components/hook-form/RHFPhone.d.ts +8 -0
  50. package/dist/types/components/hook-form/RHFRadioGroup.d.ts +14 -0
  51. package/dist/types/components/hook-form/RHFSelect.d.ts +23 -0
  52. package/dist/types/components/hook-form/RHFSlider.d.ts +8 -0
  53. package/dist/types/components/hook-form/RHFSwitch.d.ts +8 -0
  54. package/dist/types/components/hook-form/RHFTextField.d.ts +7 -0
  55. package/dist/types/components/hook-form/index.d.ts +9 -0
  56. package/dist/types/components/iconify/Iconify.d.ts +10 -0
  57. package/dist/types/components/iconify/index.d.ts +2 -0
  58. package/dist/types/components/iconify/types.d.ts +2 -0
  59. package/dist/types/components/index.d.ts +4 -0
  60. package/dist/types/context/GlobalContext.d.ts +16 -0
  61. package/dist/types/form/ChildEventCard.d.ts +7 -0
  62. package/dist/types/form/ChildEventDialog.d.ts +9 -0
  63. package/dist/types/form/ChildEvents.d.ts +8 -0
  64. package/dist/types/form/ContactPerson.d.ts +7 -0
  65. package/dist/types/form/EmailConfirmation.d.ts +8 -0
  66. package/dist/types/form/MerchandiseSelection.d.ts +9 -0
  67. package/dist/types/form/OrderSuccess.d.ts +9 -0
  68. package/dist/types/form/Payment.d.ts +7 -0
  69. package/dist/types/form/PaymentOverviewBox.d.ts +7 -0
  70. package/dist/types/form/PaymentPending.d.ts +3 -0
  71. package/dist/types/form/PaymentSuccess.d.ts +9 -0
  72. package/dist/types/form/ReleaseCountdown.d.ts +8 -0
  73. package/dist/types/form/ReleaseWithMerchandise.d.ts +12 -0
  74. package/dist/types/form/ScriptLoader.d.ts +3 -0
  75. package/dist/types/form/Shipping.d.ts +7 -0
  76. package/dist/types/form/TicketForm.d.ts +11 -0
  77. package/dist/types/form/TicketSelection.d.ts +7 -0
  78. package/dist/types/form/TicketSelectionMap.d.ts +7 -0
  79. package/dist/types/form/TicketWithMerchandiseSelection.d.ts +7 -0
  80. package/dist/types/form/TimeslotSelection.d.ts +7 -0
  81. package/dist/types/form/extra-field/ExtraField.d.ts +9 -0
  82. package/dist/types/form/extra-field/ReleaseExtraFields.d.ts +10 -0
  83. package/dist/types/form/index.d.ts +26 -0
  84. package/dist/types/form/payment/FeeBox.d.ts +8 -0
  85. package/dist/types/form/payment/PaymentOverviewCheckbox.d.ts +12 -0
  86. package/dist/types/form/payment/PaymentSkeleton.d.ts +7 -0
  87. package/dist/types/form/product/ProductCard.d.ts +9 -0
  88. package/dist/types/form/product/ProductVariantsDialog.d.ts +14 -0
  89. package/dist/types/form/shipping/ShippingSkeleton.d.ts +7 -0
  90. package/dist/types/form/style.d.ts +11 -0
  91. package/dist/types/form/timeslot/TimeslotCalendar.d.ts +12 -0
  92. package/dist/types/hooks/data/useActiveEventProducts.d.ts +8 -0
  93. package/dist/types/hooks/data/useAllowedPaymentMethods.d.ts +9 -0
  94. package/dist/types/hooks/data/useEvent.d.ts +8 -0
  95. package/dist/types/hooks/data/useEventActiveReleases.d.ts +8 -0
  96. package/dist/types/hooks/data/useEventShippingMethods.d.ts +8 -0
  97. package/dist/types/hooks/data/useEventTimeslots.d.ts +10 -0
  98. package/dist/types/hooks/useCountdown.d.ts +6 -0
  99. package/dist/types/hooks/useDebounce.d.ts +1 -0
  100. package/dist/types/hooks/useErrors.d.ts +4 -0
  101. package/dist/types/hooks/useEventListener.d.ts +5 -0
  102. package/dist/types/hooks/useFirstRender.d.ts +1 -0
  103. package/dist/types/hooks/useGlobal.d.ts +2 -0
  104. package/dist/types/hooks/useResponsive.d.ts +8 -0
  105. package/dist/types/index.d.ts +4 -0
  106. package/dist/types/locales/cs.d.ts +157 -0
  107. package/dist/types/locales/en.d.ts +158 -0
  108. package/dist/types/locales/es.d.ts +158 -0
  109. package/dist/types/locales/index.d.ts +6 -0
  110. package/dist/types/locales/pl.d.ts +158 -0
  111. package/dist/types/locales/sk.d.ts +158 -0
  112. package/dist/types/locales/uk.d.ts +158 -0
  113. package/dist/types/modules/event-timeslot.d.ts +2 -0
  114. package/dist/types/modules/event.d.ts +5 -0
  115. package/dist/types/modules/order.d.ts +7 -0
  116. package/dist/types/modules/promo-code.d.ts +1 -0
  117. package/dist/types/modules/shopping-cart.d.ts +4 -0
  118. package/dist/types/utils/axios.d.ts +2 -0
  119. package/dist/types/utils/data/cookie.d.ts +1 -0
  120. package/dist/types/utils/data/currency.d.ts +5 -0
  121. package/dist/types/utils/data/event.d.ts +4 -0
  122. package/dist/types/utils/data/extra-field.d.ts +11 -0
  123. package/dist/types/utils/data/gender.d.ts +5 -0
  124. package/dist/types/utils/data/global.d.ts +1 -0
  125. package/dist/types/utils/data/gopay.d.ts +10 -0
  126. package/dist/types/utils/data/language.d.ts +10 -0
  127. package/dist/types/utils/data/order.d.ts +4 -0
  128. package/dist/types/utils/data/product.d.ts +3 -0
  129. package/dist/types/utils/data/promo-code.d.ts +4 -0
  130. package/dist/types/utils/data/shipping-method.d.ts +4 -0
  131. package/dist/types/utils/data/shopping-cart.d.ts +5 -0
  132. package/dist/types/utils/formatNumber.d.ts +8 -0
  133. package/dist/types/utils/global.d.ts +4 -0
  134. package/dist/types/utils/gtm.d.ts +28 -0
  135. package/dist/types/utils/isBrowser.d.ts +1 -0
  136. package/dist/types/utils/place.d.ts +2 -0
  137. package/dist/types/utils/price.d.ts +5 -0
  138. package/dist/types/utils/product.d.ts +3 -0
  139. package/dist/types/utils/translation.d.ts +2 -0
  140. package/dist/types/utils/types/animate.d.ts +26 -0
  141. package/dist/types/utils/types/artist.type.d.ts +17 -0
  142. package/dist/types/utils/types/company.type.d.ts +12 -0
  143. package/dist/types/utils/types/country.type.d.ts +39 -0
  144. package/dist/types/utils/types/customer.type.d.ts +10 -0
  145. package/dist/types/utils/types/event-product.type.d.ts +15 -0
  146. package/dist/types/utils/types/event-timeslot.type.d.ts +15 -0
  147. package/dist/types/utils/types/event.type.d.ts +62 -0
  148. package/dist/types/utils/types/extra-field.type.d.ts +18 -0
  149. package/dist/types/utils/types/file.type.d.ts +6 -0
  150. package/dist/types/utils/types/global.type.d.ts +76 -0
  151. package/dist/types/utils/types/gtm.type.d.ts +90 -0
  152. package/dist/types/utils/types/locale.type.d.ts +4 -0
  153. package/dist/types/utils/types/order.type.d.ts +69 -0
  154. package/dist/types/utils/types/palette.type.d.ts +1 -0
  155. package/dist/types/utils/types/payment-method.type.d.ts +23 -0
  156. package/dist/types/utils/types/pixel.type.d.ts +7 -0
  157. package/dist/types/utils/types/place.type.d.ts +19 -0
  158. package/dist/types/utils/types/product-image.type.d.ts +5 -0
  159. package/dist/types/utils/types/product-parameter.type.d.ts +7 -0
  160. package/dist/types/utils/types/product-variant.type.d.ts +9 -0
  161. package/dist/types/utils/types/product.type.d.ts +57 -0
  162. package/dist/types/utils/types/project.type.d.ts +24 -0
  163. package/dist/types/utils/types/promo-code.type.d.ts +15 -0
  164. package/dist/types/utils/types/release-category.type.d.ts +17 -0
  165. package/dist/types/utils/types/release.type.d.ts +28 -0
  166. package/dist/types/utils/types/shipping-method.type.d.ts +11 -0
  167. package/dist/types/utils/types/shopping-cart.type.d.ts +78 -0
  168. package/dist/types/utils/types/ticket.type.d.ts +110 -0
  169. package/dist/types/utils/types/translation.type.d.ts +18 -0
  170. package/dist/types/utils/types/user.type.d.ts +9 -0
  171. package/dist/types/utils/url.d.ts +1 -0
  172. package/eslint.config.mjs +103 -27
  173. package/package.json +10 -2
  174. package/src/@types/index.d.ts +3 -5
  175. package/src/components/TextIconLabel.tsx +1 -2
  176. package/src/components/animate/IconButtonAnimate.tsx +1 -2
  177. package/src/components/animate/MotionLazyContainer.tsx +1 -1
  178. package/src/components/hook-form/RHFCodes.tsx +1 -2
  179. package/src/components/hook-form/RHFSelect.tsx +1 -1
  180. package/src/form/PaymentPending.tsx +6 -3
  181. package/src/form/PaymentSuccess.tsx +2 -2
  182. package/src/form/ScriptLoader.tsx +1 -2
  183. package/src/form/Shipping.tsx +75 -77
  184. package/src/form/TicketForm.tsx +3 -3
  185. package/src/locales/en.tsx +1 -1
  186. package/src/utils/types/event.type.ts +0 -6
  187. package/tsconfig.build.json +1 -0
@@ -0,0 +1,110 @@
1
+ import { Dayjs } from 'dayjs';
2
+ import { IPlace } from '@utils/types/place.type';
3
+ import { Currencies } from '@utils/data/currency';
4
+ import { IPromoCode } from '@utils/types/promo-code.type';
5
+ import { IEventProductForm } from '@utils/types/product.type';
6
+ import { IExtraFieldForm } from '@utils/types/extra-field.type';
7
+ import { IEventTimeslot } from '@utils/types/event-timeslot.type';
8
+ import { IBase } from '@utils/types/global.type';
9
+ import { IOrder } from '@utils/types/order.type';
10
+ import { IFile } from '@utils/types/file.type';
11
+ import { IRelease } from '@utils/types/release.type';
12
+ import { TicketSelection } from '@seat-picker/seat-picker-sdk';
13
+ export interface ITicket extends IBase {
14
+ hidden: boolean;
15
+ name: string;
16
+ price: number;
17
+ quantity: number;
18
+ release: IRelease;
19
+ usedAt: string | null;
20
+ order: IOrder | null;
21
+ number: string;
22
+ qrUrl?: string;
23
+ pdf?: IFile;
24
+ applePassWallet?: IFile;
25
+ googlePassWallet?: IFile;
26
+ }
27
+ export interface ITicketFormTicket {
28
+ releaseId: number | '';
29
+ quantity: number | '';
30
+ itemName: string;
31
+ price: number;
32
+ products: IEventProductForm[];
33
+ extraFields: IExtraFieldForm[][];
34
+ eventTimeslotId?: number | null;
35
+ location?: ITicketLocation | null;
36
+ }
37
+ export interface ITicketLocation {
38
+ id: string;
39
+ type: TicketSelection[number]['locationType'];
40
+ locationDescription?: {
41
+ type: TicketSelection[number]['locationTypeDescription'][number]['type'] | 'custom';
42
+ label: string;
43
+ value: string;
44
+ }[] | null;
45
+ }
46
+ export type EventTicketsType = {
47
+ [eventId: string]: ITicketFormTicket[];
48
+ };
49
+ export interface ITicketForm {
50
+ uuid?: string | null;
51
+ eventId: number;
52
+ tickets: EventTicketsType;
53
+ total: number;
54
+ originalPrice: number;
55
+ firstName: string;
56
+ lastName: string;
57
+ email: string;
58
+ phone: string;
59
+ birthdate: Dayjs | null;
60
+ gender: string;
61
+ callback: string;
62
+ paymentMethodId: number | null;
63
+ paymentMethodOptionId: number | null;
64
+ termsAndConditions: boolean;
65
+ ticketInsurance: boolean;
66
+ ticketInsurancePrice: number;
67
+ ticketInsurancePricePerUnit: number;
68
+ smsNotification: boolean;
69
+ smsNotificationPrice: number;
70
+ iframeCampaignId?: number;
71
+ products: {
72
+ [eventId: string]: IEventProductForm[];
73
+ };
74
+ shipping: {
75
+ shippingMethodId: number | null;
76
+ branchId: string | null;
77
+ price: number;
78
+ };
79
+ extraFields: IExtraFieldForm[];
80
+ selectedDate: string | null;
81
+ eventTimeslotId: number | null;
82
+ promoCodes: IPromoCode[];
83
+ totalFee?: number | null;
84
+ isPaymentVerify: boolean;
85
+ }
86
+ export interface ITicketBody extends ITicketForm {
87
+ promoCodeIds: number[];
88
+ }
89
+ export interface IPaidTicket {
90
+ eventName: string;
91
+ releaseName: string;
92
+ releaseCategoryName: string;
93
+ qrUrl: string;
94
+ price: number;
95
+ number: string;
96
+ location: IPlace;
97
+ pdfUrl?: string;
98
+ applePassWalletUrl?: string;
99
+ googlePassWalletUrl?: string;
100
+ currency: Currencies;
101
+ firstName?: string;
102
+ lastName?: string;
103
+ eventTimeslot?: IEventTimeslot;
104
+ }
105
+ export interface ICreateTicket {
106
+ releaseName: string;
107
+ releaseCategoryName: string;
108
+ price: number;
109
+ number: string;
110
+ }
@@ -0,0 +1,18 @@
1
+ import { IBaseLocale } from '@utils/types/locale.type';
2
+ import { IBase } from '@utils/types/global.type';
3
+ export interface IFaq {
4
+ title: string;
5
+ content: string;
6
+ }
7
+ export interface ITranslation extends IBase {
8
+ value: {
9
+ text: string;
10
+ } & IBaseLocale;
11
+ }
12
+ export interface ITranslationEntity extends IBase {
13
+ translationValues: ITranslationValue[];
14
+ }
15
+ export interface ITranslationValue extends IBase {
16
+ text: string;
17
+ locale: string;
18
+ }
@@ -0,0 +1,9 @@
1
+ import { Gender } from '@utils/data/gender';
2
+ export interface IUser {
3
+ email: string;
4
+ firstName: string;
5
+ lastName: string;
6
+ phone: string;
7
+ birthdate: string;
8
+ gender: Gender;
9
+ }
@@ -0,0 +1 @@
1
+ export declare const getSearchParamsInObject: (search: string) => Record<any, any>;
package/eslint.config.mjs CHANGED
@@ -1,36 +1,112 @@
1
- // eslint.config.js
2
- import js from '@eslint/js';
1
+ import eslint from '@eslint/js';
3
2
  import tseslint from 'typescript-eslint';
4
- import prettier from 'eslint-config-prettier';
5
- import reactPlugin from 'eslint-plugin-react';
3
+ import pluginReact from 'eslint-plugin-react';
4
+ import reactHooks from 'eslint-plugin-react-hooks';
5
+ import jsxA11y from 'eslint-plugin-jsx-a11y';
6
+ import importX from 'eslint-plugin-import-x';
7
+ import { createTypeScriptImportResolver } from 'eslint-import-resolver-typescript';
8
+ import prettierConfig from 'eslint-config-prettier/flat';
9
+ import prettierPlugin from 'eslint-plugin-prettier';
10
+ import globals from 'globals';
6
11
 
7
- export default [
8
- js.configs.recommended,
9
- ...tseslint.configs.recommended,
12
+ export default tseslint.config(
13
+ // Global ignores
14
+ { ignores: ['**/node_modules/*', 'dist/**', 'eslint.config.mjs'] },
15
+
16
+ // Base configs
17
+ eslint.configs.recommended,
18
+ tseslint.configs.recommended,
19
+
20
+ // React
21
+ pluginReact.configs.flat.recommended,
22
+ pluginReact.configs.flat['jsx-runtime'],
23
+ { settings: { react: { version: 'detect' } } },
24
+
25
+ // JSX a11y
26
+ jsxA11y.flatConfigs.recommended,
27
+
28
+ // Import-x
29
+ importX.flatConfigs.recommended,
30
+ importX.flatConfigs.typescript,
31
+
32
+ // Project-wide settings
10
33
  {
11
- name: 'custom-rules',
34
+ files: ['**/*.{ts,tsx}'],
12
35
  plugins: {
13
- '@typescript-eslint': tseslint.plugin,
14
- react: reactPlugin,
36
+ 'react-hooks': reactHooks,
37
+ prettier: prettierPlugin,
38
+ },
39
+ languageOptions: {
40
+ globals: { ...globals.browser, ...globals.es2021 },
41
+ parserOptions: {
42
+ projectService: true,
43
+ tsconfigRootDir: import.meta.dirname,
44
+ ecmaFeatures: { jsx: true },
45
+ },
46
+ },
47
+ settings: {
48
+ react: { version: 'detect' },
49
+ 'import-x/resolver-next': [
50
+ createTypeScriptImportResolver({ alwaysTryTypes: true }),
51
+ ],
15
52
  },
16
53
  rules: {
17
- '@typescript-eslint/ban-ts-comment': 'off',
18
- '@typescript-eslint/no-empty-function': 'off',
19
- '@typescript-eslint/no-explicit-any': 'off',
20
- 'arrow-body-style': 'warn',
21
- 'react/display-name': 'off',
54
+ // --- Carried over disabled rules ---
55
+ 'no-alert': 'off',
56
+ 'camelcase': 'off',
57
+ 'no-console': 'off',
58
+ 'no-unused-vars': 'off',
59
+ 'no-param-reassign': 'off',
60
+ 'no-underscore-dangle': 'off',
61
+ 'no-restricted-exports': 'off',
62
+ 'no-restricted-syntax': 'off',
63
+ 'no-await-in-loop': 'off',
64
+ 'no-plusplus': 'off',
65
+ 'no-promise-executor-return': 'off',
66
+
67
+ // React
22
68
  'react/no-children-prop': 'off',
23
- 'react/self-closing-comp': 'error',
24
- '@next/next/no-img-element': 'off',
25
- '@typescript-eslint/no-unused-vars': 'warn',
26
- '@typescript-eslint/explicit-module-boundary-types': 'off',
69
+ 'react/react-in-jsx-scope': 'off',
70
+ 'react/no-array-index-key': 'off',
71
+ 'react/require-default-props': 'off',
72
+ 'react/jsx-props-no-spreading': 'off',
73
+ 'react/function-component-definition': 'off',
74
+ 'react/display-name': 'off',
75
+ 'react/jsx-key': 'error',
76
+ 'react-hooks/exhaustive-deps': 'off',
77
+
78
+ // a11y
79
+ 'jsx-a11y/anchor-is-valid': 'off',
80
+ 'jsx-a11y/control-has-associated-label': 'off',
81
+ 'jsx-a11y/no-autofocus': 'off',
82
+
83
+ // Import
84
+ 'import-x/prefer-default-export': 'off',
85
+ 'import-x/no-cycle': 'off',
86
+ 'import-x/no-extraneous-dependencies': ['error', { devDependencies: true }],
87
+ 'import-x/no-named-as-default-member': 'off',
88
+ 'import-x/no-named-as-default': 'off',
89
+ 'import-x/default': 'off',
90
+
91
+ // TypeScript
92
+ '@typescript-eslint/naming-convention': 'off',
93
+ '@typescript-eslint/no-use-before-define': 'off',
94
+ '@typescript-eslint/no-unused-vars': ['warn', { args: 'none' }],
95
+ '@typescript-eslint/no-explicit-any': 'warn',
96
+ '@typescript-eslint/no-empty-object-type': 'warn',
97
+ '@typescript-eslint/ban-ts-comment': ['error', { 'ts-ignore': 'allow-with-description' }],
98
+
99
+ // Warnings
100
+ 'react/jsx-no-useless-fragment': ['warn', { allowExpressions: true }],
101
+ 'prefer-destructuring': ['warn', { object: true, array: false }],
102
+ 'react/no-unstable-nested-components': ['warn', { allowAsProps: true }],
103
+ 'react/jsx-no-duplicate-props': ['warn', { ignoreCase: false }],
104
+
105
+ // Prettier
106
+ 'prettier/prettier': 'error',
27
107
  },
28
108
  },
29
- {
30
- name: 'prettier',
31
- rules: prettier.rules,
32
- },
33
- {
34
- ignores: ['node_modules/**', 'dist/**'],
35
- },
36
- ];
109
+
110
+ // Must be last — disables formatting rules that conflict with Prettier
111
+ prettierConfig,
112
+ );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eventlook/sdk",
3
- "version": "1.5.0-beta.2",
3
+ "version": "1.5.0-beta.4",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/esm/index.js",
6
6
  "types": "dist/types/index.d.ts",
@@ -23,7 +23,8 @@
23
23
  "dev": "concurrently --kill-others-on-fail --kill-others \"yarn watch:rollup\" \"yarn watch:types\" \"yarn watch:push\"",
24
24
  "dev:simple": "concurrently --kill-others-on-fail \"yarn watch:rollup\" \"yarn watch:types\"",
25
25
  "publish": "npm publish",
26
- "lint:fix": "eslint --fix --ext .ts,.tsx .",
26
+ "lint": "eslint .",
27
+ "lint:fix": "eslint --fix .",
27
28
  "prettier": "prettier --write 'src/**/*.{js,jsx,ts,tsx}'",
28
29
  "format": "yarn lint:fix && yarn prettier"
29
30
  },
@@ -39,6 +40,7 @@
39
40
  "devDependencies": {
40
41
  "@emotion/react": "^11.14.0",
41
42
  "@emotion/styled": "^11.14.1",
43
+ "@eslint/js": "^9",
42
44
  "@hookform/resolvers": "^5.2.2",
43
45
  "@iconify/icons-carbon": "^1.2.20",
44
46
  "@iconify/react": "^6.0.2",
@@ -60,8 +62,14 @@
60
62
  "dayjs": "^1.11.19",
61
63
  "eslint": "^9.39.3",
62
64
  "eslint-config-prettier": "^10.1.8",
65
+ "eslint-import-resolver-typescript": "^4.4.4",
66
+ "eslint-plugin-import-x": "^4.16.1",
67
+ "eslint-plugin-jsx-a11y": "^6.10.2",
68
+ "eslint-plugin-prettier": "^5.5.5",
63
69
  "eslint-plugin-react": "^7.37.5",
70
+ "eslint-plugin-react-hooks": "^5",
64
71
  "framer-motion": "^12.34.4",
72
+ "globals": "^17.4.0",
65
73
  "js-cookie": "^3.0.5",
66
74
  "lodash": "^4.17.23",
67
75
  "lottie-react": "^2.4.1",
@@ -1,10 +1,10 @@
1
- import { IGopay } from '@utils/types/gopay.type';
2
-
3
1
  export {};
4
2
  declare global {
5
3
  interface Window {
4
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
6
5
  dataLayer: any;
7
- _gopay: IGopay;
6
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
7
+ _gopay: any;
8
8
  Packeta: Packeta;
9
9
  }
10
10
  }
@@ -30,5 +30,3 @@ interface Packeta {
30
30
  interface PacketaOptions {
31
31
  language: string;
32
32
  }
33
-
34
- window._gopay = window._gopay || {};
@@ -1,5 +1,4 @@
1
- import React from 'react';
2
- import { ReactElement } from 'react';
1
+ import React, { ReactElement } from 'react';
3
2
  import { Stack, StackProps, SxProps } from '@mui/material';
4
3
 
5
4
  interface Props extends StackProps {
@@ -1,6 +1,5 @@
1
- import React from 'react';
1
+ import React, { forwardRef, ReactNode } from 'react';
2
2
  import { m } from 'framer-motion';
3
- import { forwardRef, ReactNode } from 'react';
4
3
  import { Box, IconButton, IconButtonProps, SxProps } from '@mui/material';
5
4
 
6
5
  interface Props extends IconButtonProps {
@@ -1,7 +1,7 @@
1
1
  import React, { ReactNode } from 'react';
2
2
  import { LazyMotion } from 'framer-motion';
3
3
 
4
- // @ts-ignore
4
+ // @ts-ignore -- dynamic import of generated features file
5
5
  const loadFeatures = () => import('./features.js').then((res) => res.default);
6
6
 
7
7
  type Props = {
@@ -1,5 +1,4 @@
1
- import React, { RefObject } from 'react';
2
- import { useRef } from 'react';
1
+ import React, { RefObject, useRef } from 'react';
3
2
  // form
4
3
  import { useFormContext, Controller } from 'react-hook-form';
5
4
  // @mui
@@ -143,7 +143,7 @@ export function RHFMultiSelect({
143
143
  displayEmpty={!!placeholder}
144
144
  labelId={name}
145
145
  input={<OutlinedInput fullWidth label={label} error={!!error} />}
146
- // @ts-ignore
146
+ // @ts-ignore -- MUI Select renderValue type mismatch with custom renderer
147
147
  renderValue={renderValues}
148
148
  MenuProps={{
149
149
  PaperProps: {
@@ -1,11 +1,12 @@
1
- import React from 'react';
1
+ import React, { lazy, Suspense } from 'react';
2
2
  import { Box, Typography } from '@mui/material';
3
- import Lottie from 'lottie-react';
4
3
  import bankTransferAnimation from '../utils/data/lottie/bank-transfer.json';
5
4
  import { varBounce } from '@components/animate';
6
5
  import { m } from 'framer-motion';
7
6
  import useGlobal from '@hooks/useGlobal';
8
7
 
8
+ const Lottie = lazy(() => import('lottie-react'));
9
+
9
10
  const PaymentPending: React.FC = () => {
10
11
  const { t } = useGlobal();
11
12
 
@@ -17,7 +18,9 @@ const PaymentPending: React.FC = () => {
17
18
  </Typography>
18
19
  </m.div>
19
20
  <Box maxWidth={600} mx="auto">
20
- <Lottie animationData={bankTransferAnimation} />
21
+ <Suspense fallback={null}>
22
+ <Lottie animationData={bankTransferAnimation} />
23
+ </Suspense>
21
24
  </Box>
22
25
  </Box>
23
26
  );
@@ -50,9 +50,9 @@ const PaymentSuccess: React.FC<Props> = ({ setIsPaying, isIframe, pixels }) => {
50
50
  const { data } = await postOrderPaid({
51
51
  gopayId: Number(paymentId),
52
52
  });
53
- const tickets = data.tickets;
53
+ const { tickets } = data;
54
54
  setTickets(tickets);
55
- const products = data.products;
55
+ const { products } = data;
56
56
  setProducts(products);
57
57
  setState(data.state);
58
58
  setGwUrl(data.gwUrl);
@@ -1,5 +1,4 @@
1
- import React from 'react';
2
- import { useEffect } from 'react';
1
+ import React, { useEffect } from 'react';
3
2
 
4
3
  const ScriptLoader: React.FC = () => {
5
4
  useEffect(() => {
@@ -136,85 +136,83 @@ const Shipping: React.FC<Props> = ({ event }) => {
136
136
  {t('event.tickets.stepper.5.error')}
137
137
  </Typography>
138
138
  ) : (
139
- <>
140
- <Controller
141
- name="shipping.shippingMethodId"
142
- control={control}
143
- render={({ field, fieldState: { error } }) => (
144
- <FormControl component="fieldset" sx={{ width: '100%' }}>
145
- <RadioGroup {...field}>
146
- {filteredShippingMethods.map((shippingMethod) => (
147
- <ShippingMethodItem
148
- key={shippingMethod.id}
149
- active={Number(shippingMethodId) === shippingMethod.id}
150
- >
151
- <FormControlLabel
152
- value={shippingMethod.id}
153
- control={<Radio />}
154
- label={
155
- <Stack
156
- direction="row"
157
- justifyContent="space-between"
158
- alignItems="center"
159
- width="100%"
160
- >
161
- <Stack direction="row" alignItems="center">
162
- <Box
163
- sx={{
164
- marginRight: 2,
165
- }}
166
- >
167
- <Typography sx={{ lineHeight: 1.2 }}>
168
- {t(`shipping_method.types.${shippingMethod.type}`)}
169
- </Typography>
170
- {displayBranchName &&
171
- shippingMethod.type === ShippingTypes.PACKETA &&
172
- shippingMethod.id === Number(shippingMethodId) && (
173
- <Typography variant="caption" sx={{ lineHeight: 1 }}>
174
- {displayBranchName}
175
- </Typography>
176
- )}
177
- </Box>
178
- {paymentImages[shippingMethod.type]}
179
- </Stack>
180
- {shippingMethod.type === ShippingTypes.PACKETA &&
181
- shippingMethod.id === Number(shippingMethodId) &&
182
- branchId && (
183
- <Box>
184
- <Button
185
- onClick={handleChangeBranch}
186
- variant="outlined"
187
- size="small"
188
- >
189
- {t('change')}
190
- </Button>
191
- </Box>
192
- )}
139
+ <Controller
140
+ name="shipping.shippingMethodId"
141
+ control={control}
142
+ render={({ field, fieldState: { error } }) => (
143
+ <FormControl component="fieldset" sx={{ width: '100%' }}>
144
+ <RadioGroup {...field}>
145
+ {filteredShippingMethods.map((shippingMethod) => (
146
+ <ShippingMethodItem
147
+ key={shippingMethod.id}
148
+ active={Number(shippingMethodId) === shippingMethod.id}
149
+ >
150
+ <FormControlLabel
151
+ value={shippingMethod.id}
152
+ control={<Radio />}
153
+ label={
154
+ <Stack
155
+ direction="row"
156
+ justifyContent="space-between"
157
+ alignItems="center"
158
+ width="100%"
159
+ >
160
+ <Stack direction="row" alignItems="center">
161
+ <Box
162
+ sx={{
163
+ marginRight: 2,
164
+ }}
165
+ >
166
+ <Typography sx={{ lineHeight: 1.2 }}>
167
+ {t(`shipping_method.types.${shippingMethod.type}`)}
168
+ </Typography>
169
+ {displayBranchName &&
170
+ shippingMethod.type === ShippingTypes.PACKETA &&
171
+ shippingMethod.id === Number(shippingMethodId) && (
172
+ <Typography variant="caption" sx={{ lineHeight: 1 }}>
173
+ {displayBranchName}
174
+ </Typography>
175
+ )}
176
+ </Box>
177
+ {paymentImages[shippingMethod.type]}
193
178
  </Stack>
194
- }
195
- sx={{
196
- '&:not(:last-of-type)': {
197
- mb: 0,
198
- },
199
- '& .MuiFormControlLabel-label': {
200
- width: '100%',
201
- mr: 0,
202
- },
203
- }}
204
- />
205
- </ShippingMethodItem>
206
- ))}
207
- </RadioGroup>
179
+ {shippingMethod.type === ShippingTypes.PACKETA &&
180
+ shippingMethod.id === Number(shippingMethodId) &&
181
+ branchId && (
182
+ <Box>
183
+ <Button
184
+ onClick={handleChangeBranch}
185
+ variant="outlined"
186
+ size="small"
187
+ >
188
+ {t('change')}
189
+ </Button>
190
+ </Box>
191
+ )}
192
+ </Stack>
193
+ }
194
+ sx={{
195
+ '&:not(:last-of-type)': {
196
+ mb: 0,
197
+ },
198
+ '& .MuiFormControlLabel-label': {
199
+ width: '100%',
200
+ mr: 0,
201
+ },
202
+ }}
203
+ />
204
+ </ShippingMethodItem>
205
+ ))}
206
+ </RadioGroup>
208
207
 
209
- {!!error && (
210
- <FormHelperText error={!!error} sx={{ mx: 0 }}>
211
- {error?.message}
212
- </FormHelperText>
213
- )}
214
- </FormControl>
215
- )}
216
- />
217
- </>
208
+ {!!error && (
209
+ <FormHelperText error={!!error} sx={{ mx: 0 }}>
210
+ {error?.message}
211
+ </FormHelperText>
212
+ )}
213
+ </FormControl>
214
+ )}
215
+ />
218
216
  )}
219
217
  </>
220
218
  )}
@@ -301,7 +301,7 @@ const TicketForm: React.FC<Props> = ({
301
301
  });
302
302
 
303
303
  const methods = useForm<ITicketForm>({
304
- // @ts-ignore
304
+ // @ts-ignore -- yup resolver type mismatch with dynamic schema
305
305
  resolver: yupResolver(ValidationSchema),
306
306
  defaultValues,
307
307
  });
@@ -496,7 +496,7 @@ const TicketForm: React.FC<Props> = ({
496
496
  isInline={isInline}
497
497
  />
498
498
  ) : (
499
- // @ts-ignore
499
+ // @ts-ignore -- FormProvider expects stricter form types
500
500
  <FormProvider methods={methods} onSubmit={methods.handleSubmit(onSubmit)}>
501
501
  <Typography
502
502
  className="overview-card__event-info"
@@ -603,7 +603,7 @@ const TicketForm: React.FC<Props> = ({
603
603
  <EmailConfirmation
604
604
  open={formStep === 2 && !isIframe}
605
605
  onClose={() => setFormStep(1)}
606
- // @ts-ignore
606
+ // @ts-ignore -- handleSubmit return type mismatch with onConfirm prop
607
607
  onConfirm={methods.handleSubmit(onSubmit)}
608
608
  />
609
609
  </FormProvider>
@@ -124,7 +124,7 @@ const en = {
124
124
  label: 'SMS event reminder',
125
125
  modal: {
126
126
  description:
127
- 'Event reminder the day before: SMS will notify you about the upcoming event so you don\'t forget and have time to prepare.',
127
+ "Event reminder the day before: SMS will notify you about the upcoming event so you don't forget and have time to prepare.",
128
128
  price: 'SMS event reminder price',
129
129
  },
130
130
  },
@@ -63,9 +63,3 @@ export interface IEventCategory extends IBase {
63
63
  export interface IEventTag extends IBase {
64
64
  name: string;
65
65
  }
66
-
67
- export interface IEventCategory extends IBase {
68
- translation: {
69
- name: string;
70
- } & IBaseLocale;
71
- }
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "extends": "./tsconfig.json",
3
3
  "compilerOptions": {
4
+ "noEmit": false,
4
5
  "declaration": true,
5
6
  "emitDeclarationOnly": true,
6
7
  "outDir": "./dist/types"