@vonq/hapi-elements-types 1.4.0 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (188) hide show
  1. package/enums.ts +41 -0
  2. package/package.json +5 -7
  3. package/src/_window/api.types.ts +59 -0
  4. package/src/_window/auth.types.ts +11 -0
  5. package/src/_window/config.types.ts +30 -0
  6. package/src/_window/events.types.ts +157 -0
  7. package/src/_window/index.ts +16 -0
  8. package/src/_window/instances.types.ts +18 -0
  9. package/src/_window/qa.types.ts +28 -0
  10. package/src/_window/routing.types.ts +21 -0
  11. package/src/_window/sdk.types.ts +147 -0
  12. package/src/_window/service.types.ts +67 -0
  13. package/src/_window/state.types.ts +112 -0
  14. package/src/_window/ui.types.ts +13 -0
  15. package/src/_window/utils.types.ts +34 -0
  16. package/src/_window/validation.types.ts +43 -0
  17. package/src/_window/window.ts +56 -0
  18. package/src/alert/enums.ts +22 -0
  19. package/src/alert/functions.types.ts +13 -0
  20. package/src/alert/index.ts +9 -0
  21. package/src/alert/service.types.ts +15 -0
  22. package/src/alert/state.initial.ts +16 -0
  23. package/src/alert/state.types.ts +27 -0
  24. package/src/alert/state.validations.ts +11 -0
  25. package/src/alert/types.ts +63 -0
  26. package/src/ats/api.types.ts +16 -0
  27. package/src/ats/functions.types.ts +7 -0
  28. package/src/ats/index.ts +9 -0
  29. package/src/ats/service.types.ts +17 -0
  30. package/src/ats/state.initial.ts +5 -0
  31. package/src/ats/state.types.ts +5 -0
  32. package/src/ats/state.validations.ts +6 -0
  33. package/src/ats/types.ts +19 -0
  34. package/src/basket/consts.ts +1 -0
  35. package/src/basket/functions.types.ts +40 -0
  36. package/src/basket/index.ts +12 -0
  37. package/src/basket/service.types.ts +32 -0
  38. package/src/basket/state.initial.ts +11 -0
  39. package/src/basket/state.types.ts +34 -0
  40. package/src/basket/state.validations.ts +12 -0
  41. package/src/basket/types.ts +4 -0
  42. package/src/basket/utils.ts +79 -0
  43. package/src/basket/utils.types.ts +10 -0
  44. package/src/basket/validations.types.ts +25 -0
  45. package/src/campaign/api.types.ts +45 -0
  46. package/src/campaign/consts.ts +1 -0
  47. package/src/campaign/enums.ts +17 -0
  48. package/src/campaign/functions.types.ts +90 -0
  49. package/src/campaign/index.ts +15 -0
  50. package/src/campaign/qa.types.ts +12 -0
  51. package/src/campaign/service.types.ts +48 -0
  52. package/src/campaign/state.initial.ts +84 -0
  53. package/src/campaign/state.types.ts +55 -0
  54. package/src/campaign/state.validations.ts +16 -0
  55. package/src/campaign/types.ts +237 -0
  56. package/src/campaign/utils.ts +53 -0
  57. package/src/campaign/utils.types.ts +59 -0
  58. package/src/campaign/validations.types.ts +215 -0
  59. package/src/common/LocalStorage.ts +123 -0
  60. package/src/common/browser.ts +2 -0
  61. package/src/common/color.ts +9 -0
  62. package/src/common/events/EventCommand/enums.ts +49 -0
  63. package/src/common/events/EventCommand/index.ts +4 -0
  64. package/src/common/events/EventCommand/types.ts +18 -0
  65. package/src/common/events/index.ts +4 -0
  66. package/src/common/events/types.ts +52 -0
  67. package/src/common/immutable.ts +28 -0
  68. package/src/common/index.ts +22 -0
  69. package/src/common/instances/Instance.ts +13 -0
  70. package/src/common/instances/consts.ts +1 -0
  71. package/src/common/instances/index.ts +4 -0
  72. package/src/common/json.ts +25 -0
  73. package/src/common/logger/Logger.ts +70 -0
  74. package/src/common/logger/enums.ts +12 -0
  75. package/src/common/logger/index.ts +5 -0
  76. package/src/common/logger/types.ts +7 -0
  77. package/src/common/logger-datadog/LoggerDatadog.ts +42 -0
  78. package/src/common/logger-datadog/index.ts +3 -0
  79. package/src/common/misc.ts +114 -0
  80. package/src/common/promise.ts +161 -0
  81. package/src/common/proxy.ts +77 -0
  82. package/src/common/qa.types.ts +9 -0
  83. package/src/common/regExTest.ts +12 -0
  84. package/src/common/tree.ts +148 -0
  85. package/src/common/types.ts +110 -0
  86. package/src/common/utm.ts +19 -0
  87. package/src/common/validations.types.ts +89 -0
  88. package/src/common/validators.ts +21 -0
  89. package/src/common/webComponents.ts +26 -0
  90. package/src/config/functions.types.ts +23 -0
  91. package/src/config/index.ts +5 -0
  92. package/src/config/state.initial.ts +11 -0
  93. package/src/config/state.types.ts +15 -0
  94. package/src/consts.ts +980 -0
  95. package/src/contract/api.types.ts +47 -0
  96. package/src/contract/consts.ts +1 -0
  97. package/src/contract/functions.types.ts +112 -0
  98. package/src/contract/index.ts +14 -0
  99. package/src/contract/qa.types.ts +12 -0
  100. package/src/contract/service.types.ts +54 -0
  101. package/src/contract/state.initial.ts +39 -0
  102. package/src/contract/state.types.ts +74 -0
  103. package/src/contract/state.validations.ts +21 -0
  104. package/src/contract/types.ts +145 -0
  105. package/src/contract/utils.ts +36 -0
  106. package/src/contract/utils.types.ts +11 -0
  107. package/src/contract/validations.types.ts +104 -0
  108. package/src/debugging/functions.types.ts +34 -0
  109. package/src/debugging/index.ts +6 -0
  110. package/src/debugging/state.initial.ts +10 -0
  111. package/src/debugging/state.types.ts +18 -0
  112. package/src/debugging/state.validations.ts +10 -0
  113. package/src/index.ts +22 -0
  114. package/src/language/consts.ts +6 -0
  115. package/src/language/en.ts +530 -0
  116. package/src/language/functions.types.ts +29 -0
  117. package/src/language/index.ts +11 -0
  118. package/src/language/qa.types.ts +19 -0
  119. package/src/language/state.initial.ts +13 -0
  120. package/src/language/state.types.ts +25 -0
  121. package/src/language/state.validations.ts +10 -0
  122. package/src/language/utils.ts +17 -0
  123. package/src/language/validations.types.ts +13 -0
  124. package/src/modal/consts.ts +6 -0
  125. package/src/modal/enums.ts +14 -0
  126. package/src/modal/functions.types.ts +22 -0
  127. package/src/modal/index.ts +11 -0
  128. package/src/modal/service.types.ts +32 -0
  129. package/src/modal/state.initial.ts +9 -0
  130. package/src/modal/state.types.ts +8 -0
  131. package/src/modal/state.validations.ts +6 -0
  132. package/src/modal/store.types.ts +5 -0
  133. package/src/modal/types.ts +44 -0
  134. package/src/orderJourney/consts.ts +289 -0
  135. package/src/orderJourney/enums.ts +25 -0
  136. package/src/orderJourney/functions.types.ts +140 -0
  137. package/src/orderJourney/index.ts +13 -0
  138. package/src/orderJourney/qa.types.ts +16 -0
  139. package/src/orderJourney/state.initial.ts +401 -0
  140. package/src/orderJourney/state.types.ts +99 -0
  141. package/src/orderJourney/state.validations.ts +78 -0
  142. package/src/orderJourney/types.ts +31 -0
  143. package/src/orderJourney/utils.ts +7 -0
  144. package/src/orderJourney/utils.types.ts +11 -0
  145. package/src/orderJourney/validations.types.ts +34 -0
  146. package/src/product/api.types.ts +62 -0
  147. package/src/product/consts.ts +1 -0
  148. package/src/product/enums.ts +11 -0
  149. package/src/product/functions.types.ts +156 -0
  150. package/src/product/index.ts +14 -0
  151. package/src/product/qa.types.ts +11 -0
  152. package/src/product/service.types.ts +68 -0
  153. package/src/product/state.initial.ts +28 -0
  154. package/src/product/state.types.ts +93 -0
  155. package/src/product/state.validations.ts +25 -0
  156. package/src/product/types.ts +161 -0
  157. package/src/product/utils.types.ts +22 -0
  158. package/src/product/validations.types.ts +189 -0
  159. package/src/routing/functions.types.ts +48 -0
  160. package/src/routing/index.ts +5 -0
  161. package/src/routing/state.initial.ts +10 -0
  162. package/src/routing/state.types.ts +30 -0
  163. package/src/theming/consts.ts +7727 -0
  164. package/src/theming/functions.types.ts +13 -0
  165. package/src/theming/index.ts +11 -0
  166. package/src/theming/qa.types.ts +11 -0
  167. package/src/theming/state.initial.ts +16 -0
  168. package/src/theming/state.types.ts +6 -0
  169. package/src/theming/state.validations.ts +8 -0
  170. package/src/theming/types.ts +123 -0
  171. package/src/theming/utils.ts +581 -0
  172. package/src/theming/validations.types.ts +62 -0
  173. package/src/types.ts +229 -0
  174. package/src/ui/index.ts +3 -0
  175. package/src/ui/service.types.ts +26 -0
  176. package/src/utils.ts +3 -0
  177. package/src/wallet/api.types.ts +33 -0
  178. package/src/wallet/consts.ts +3 -0
  179. package/src/wallet/functions.types.ts +58 -0
  180. package/src/wallet/index.ts +11 -0
  181. package/src/wallet/service.types.ts +26 -0
  182. package/src/wallet/state.initial.ts +18 -0
  183. package/src/wallet/state.types.ts +58 -0
  184. package/src/wallet/state.validations.ts +18 -0
  185. package/src/wallet/types.ts +65 -0
  186. package/src/wallet/validations.types.ts +18 -0
  187. package/tsconfig.json +41 -0
  188. package/index.d.ts +0 -5207
@@ -0,0 +1,13 @@
1
+ import { HapiFontOptions, HapiTheme, HapiThemingThemeProvider } from "./types"
2
+
3
+ export type ThemeStoreSetThemeProviderHandler = (
4
+ provider: HapiThemingThemeProvider,
5
+ ) => void
6
+
7
+ export type ThemeStoreSetThemeHandler = (theme: HapiTheme) => void
8
+ export type ThemeStoreSetFontOptionsHandler = (options: HapiFontOptions) => void
9
+
10
+ export type ThemeStoreFunctions = {
11
+ setTheme: ThemeStoreSetThemeHandler
12
+ setFontOptions: ThemeStoreSetFontOptionsHandler
13
+ }
@@ -0,0 +1,11 @@
1
+ // created from 'create-ts-index'
2
+
3
+ export * from './consts';
4
+ export * from './functions.types';
5
+ export * from './qa.types';
6
+ export * from './state.initial';
7
+ export * from './state.types';
8
+ export * from './state.validations';
9
+ export * from './types';
10
+ export * from './utils';
11
+ export * from './validations.types';
@@ -0,0 +1,11 @@
1
+ import { HapiFontOptions, HapiTheme } from "./types"
2
+ import { ModuleWithConstructorArgs } from "../types"
3
+ import { WindowHapiQA } from "../_window/qa.types"
4
+
5
+ export type WindowHapiQATheming = ModuleWithConstructorArgs<
6
+ {
7
+ setTheme: (updatedTheme: Partial<HapiTheme>) => HapiTheme
8
+ setFontOptions: (fontOptions: HapiFontOptions) => HapiFontOptions
9
+ },
10
+ { readonly qa: WindowHapiQA }
11
+ >
@@ -0,0 +1,16 @@
1
+ import { ThemeStoreState } from "./state.types"
2
+ import { THEME_LIGHT } from "./consts"
3
+
4
+ export const initialThemeStoreState: ThemeStoreState = {
5
+ fontOptions: {
6
+ fontFamily: "Poppins, Roboto, sans-serif",
7
+ fontFaces: [
8
+ {
9
+ src: "https://fonts.googleapis.com/css?family=Poppins:300,400,500,600,700|Roboto:300,400,500,600,700",
10
+ rel: "stylesheet",
11
+ fontFamily: "Poppins",
12
+ },
13
+ ],
14
+ },
15
+ theme: THEME_LIGHT,
16
+ }
@@ -0,0 +1,6 @@
1
+ import { HapiFontOptions, HapiTheme } from "./types"
2
+
3
+ export type ThemeStoreState = {
4
+ theme: Partial<HapiTheme>
5
+ fontOptions: HapiFontOptions
6
+ }
@@ -0,0 +1,8 @@
1
+ import { ThemeStoreState } from "./state.types"
2
+ import { StateValidations } from "../_window/state.types"
3
+
4
+ export const themeStoreStoreStateValidations: StateValidations<ThemeStoreState> =
5
+ {
6
+ theme: "theming.theme",
7
+ fontOptions: "theming.fontOptions",
8
+ }
@@ -0,0 +1,123 @@
1
+ import { Theming } from "theming"
2
+
3
+ export type ThemeGlobalStyles = {
4
+ borderRadius: string
5
+
6
+ primaryBackgroundColor: string
7
+ primaryTextColor: string
8
+
9
+ secondaryBackgroundColor: string
10
+ secondaryTextColor: string
11
+
12
+ successBackgroundColor: string
13
+ successTextColor: string
14
+ successSecondaryBackgroundColor: string
15
+
16
+ dangerBackgroundColor: string
17
+ dangerTextColor: string
18
+ dangerSecondaryBackgroundColor: string
19
+
20
+ warningBackgroundColor: string
21
+ warningTextColor: string
22
+ warningSecondaryBackgroundColor: string
23
+
24
+ infoBackgroundColor: string
25
+ infoTextColor: string
26
+ infoSecondaryBackgroundColor: string
27
+
28
+ fadedBackgroundColor: string
29
+ fadedTextColor: string
30
+
31
+ accentBackgroundColor: string
32
+ accentTextColor: string
33
+ }
34
+
35
+ export type HapiThemingThemeProvider = Theming<HapiTheme>["ThemeProvider"]
36
+ export type HapiThemingUseTheme = Theming<HapiTheme>["useTheme"]
37
+
38
+ export type HapiThemeRule =
39
+ | "global"
40
+ | "link"
41
+ | "modal"
42
+ | "modalBackdrop"
43
+ | "loadingSpinner"
44
+ | "userJourneyBar"
45
+ | "card"
46
+ | "tabHeaders"
47
+ | "tabHeader"
48
+ | "tabPanels"
49
+ | "tabPanel"
50
+ | "buttonBase"
51
+ | "buttonPrimary"
52
+ | "buttonSecondary"
53
+ | "buttonDanger"
54
+ | "buttonDangerSecondary"
55
+ | "buttonInfo"
56
+ | "buttonInfoSecondary"
57
+ | "buttonSuccess"
58
+ | "buttonSuccessSecondary"
59
+ | "buttonWarning"
60
+ | "buttonWarningSecondary"
61
+ | "buttonFaded"
62
+ | "buttonAccent"
63
+ | "badgeBase"
64
+ | "formFieldBase"
65
+ | "inputSelectBase"
66
+ | "input"
67
+ | "inputRange"
68
+ | "inputHtml"
69
+ | "inputTags"
70
+ | "textarea"
71
+ | "select"
72
+ | "checkbox"
73
+ | "radio"
74
+ | "accordionButton"
75
+ | "accordionArrow"
76
+ | "accordionPanel"
77
+ | "accordionTitle"
78
+ | "headingBase"
79
+ | "headingOne"
80
+ | "headingTwo"
81
+ | "headingThree"
82
+ | "headingFour"
83
+ | "headingFive"
84
+ | "headingSix"
85
+ | "alert"
86
+
87
+ export type HapiThemeComponentVariant =
88
+ | "primary"
89
+ | "secondary"
90
+ | "danger"
91
+ | "dangerSecondary"
92
+ | "warning"
93
+ | "warningSecondary"
94
+ | "info"
95
+ | "infoSecondary"
96
+ | "success"
97
+ | "successSecondary"
98
+ | "faded"
99
+ | "accent"
100
+
101
+ export type CSSPropertiesInJS = {
102
+ [key: string]: string | undefined | any[] | (() => any) | any
103
+ }
104
+
105
+ export type HapiTheme = {
106
+ [key in HapiThemeRule]: key extends "global"
107
+ ? Partial<ThemeGlobalStyles>
108
+ : CSSPropertiesInJS
109
+ }
110
+
111
+ export type HapiFontOptions = {
112
+ fontFaces?: ThemeFontFaceOption[]
113
+ fontFamily: string
114
+ }
115
+
116
+ export type ThemeFontFaceOption = {
117
+ fontFamily: string
118
+ src: string
119
+ fontWeight?: string
120
+ fontStyle?: string
121
+ fontSize?: string
122
+ rel?: "stylesheet"
123
+ }