@vonq/hapi-elements-types 1.6.0 → 1.7.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 (106) hide show
  1. package/package.json +2 -2
  2. package/{src/theming → theming}/types.ts +38 -1
  3. package/tsconfig.json +1 -1
  4. /package/{src/_window → _window}/api.types.ts +0 -0
  5. /package/{src/_window → _window}/auth.types.ts +0 -0
  6. /package/{src/_window → _window}/config.types.ts +0 -0
  7. /package/{src/_window → _window}/events.types.ts +0 -0
  8. /package/{src/_window → _window}/index.ts +0 -0
  9. /package/{src/_window → _window}/instances.types.ts +0 -0
  10. /package/{src/_window → _window}/qa.types.ts +0 -0
  11. /package/{src/_window → _window}/routing.types.ts +0 -0
  12. /package/{src/_window → _window}/sdk.types.ts +0 -0
  13. /package/{src/_window → _window}/service.types.ts +0 -0
  14. /package/{src/_window → _window}/state.types.ts +0 -0
  15. /package/{src/_window → _window}/ui.types.ts +0 -0
  16. /package/{src/_window → _window}/utils.types.ts +0 -0
  17. /package/{src/_window → _window}/validation.types.ts +0 -0
  18. /package/{src/_window → _window}/window.ts +0 -0
  19. /package/{src/alert → alert}/enums.ts +0 -0
  20. /package/{src/alert → alert}/index.ts +0 -0
  21. /package/{src/alert → alert}/service.types.ts +0 -0
  22. /package/{src/alert → alert}/state.types.ts +0 -0
  23. /package/{src/alert → alert}/types.ts +0 -0
  24. /package/{src/ats → ats}/api.types.ts +0 -0
  25. /package/{src/ats → ats}/index.ts +0 -0
  26. /package/{src/ats → ats}/service.types.ts +0 -0
  27. /package/{src/ats → ats}/state.types.ts +0 -0
  28. /package/{src/ats → ats}/types.ts +0 -0
  29. /package/{src/basket → basket}/index.ts +0 -0
  30. /package/{src/basket → basket}/service.types.ts +0 -0
  31. /package/{src/basket → basket}/state.types.ts +0 -0
  32. /package/{src/basket → basket}/types.ts +0 -0
  33. /package/{src/basket → basket}/utils.types.ts +0 -0
  34. /package/{src/basket → basket}/validations.types.ts +0 -0
  35. /package/{src/campaign → campaign}/api.types.ts +0 -0
  36. /package/{src/campaign → campaign}/enums.ts +0 -0
  37. /package/{src/campaign → campaign}/index.ts +0 -0
  38. /package/{src/campaign → campaign}/qa.types.ts +0 -0
  39. /package/{src/campaign → campaign}/service.types.ts +0 -0
  40. /package/{src/campaign → campaign}/state.types.ts +0 -0
  41. /package/{src/campaign → campaign}/types.ts +0 -0
  42. /package/{src/campaign → campaign}/utils.types.ts +0 -0
  43. /package/{src/campaign → campaign}/validations.types.ts +0 -0
  44. /package/{src/common → common}/enums.ts +0 -0
  45. /package/{src/common → common}/events/EventCommand/enums.ts +0 -0
  46. /package/{src/common → common}/events/EventCommand/index.ts +0 -0
  47. /package/{src/common → common}/events/EventCommand/types.ts +0 -0
  48. /package/{src/common → common}/events/index.ts +0 -0
  49. /package/{src/common → common}/events/types.ts +0 -0
  50. /package/{src/common → common}/index.ts +0 -0
  51. /package/{src/common → common}/logger/enums.ts +0 -0
  52. /package/{src/common → common}/logger/types.ts +0 -0
  53. /package/{src/common → common}/qa.types.ts +0 -0
  54. /package/{src/common → common}/types.ts +0 -0
  55. /package/{src/common → common}/validations.types.ts +0 -0
  56. /package/{src/common → common}/validator/types.ts +0 -0
  57. /package/{src/contract → contract}/api.types.ts +0 -0
  58. /package/{src/contract → contract}/index.ts +0 -0
  59. /package/{src/contract → contract}/qa.types.ts +0 -0
  60. /package/{src/contract → contract}/service.types.ts +0 -0
  61. /package/{src/contract → contract}/state.types.ts +0 -0
  62. /package/{src/contract → contract}/types.ts +0 -0
  63. /package/{src/contract → contract}/utils.types.ts +0 -0
  64. /package/{src/contract → contract}/validations.types.ts +0 -0
  65. /package/{src/debugging → debugging}/index.ts +0 -0
  66. /package/{src/debugging → debugging}/state.types.ts +0 -0
  67. /package/{src/index.ts → index.ts} +0 -0
  68. /package/{src/language → language}/index.ts +0 -0
  69. /package/{src/language → language}/qa.types.ts +0 -0
  70. /package/{src/language → language}/state.types.ts +0 -0
  71. /package/{src/language → language}/validations.types.ts +0 -0
  72. /package/{src/modal → modal}/enums.ts +0 -0
  73. /package/{src/modal → modal}/index.ts +0 -0
  74. /package/{src/modal → modal}/service.types.ts +0 -0
  75. /package/{src/modal → modal}/state.types.ts +0 -0
  76. /package/{src/modal → modal}/types.ts +0 -0
  77. /package/{src/orderJourney → orderJourney}/enums.ts +0 -0
  78. /package/{src/orderJourney → orderJourney}/index.ts +0 -0
  79. /package/{src/orderJourney → orderJourney}/qa.types.ts +0 -0
  80. /package/{src/orderJourney → orderJourney}/state.types.ts +0 -0
  81. /package/{src/orderJourney → orderJourney}/types.ts +0 -0
  82. /package/{src/orderJourney → orderJourney}/utils.types.ts +0 -0
  83. /package/{src/orderJourney → orderJourney}/validations.types.ts +0 -0
  84. /package/{src/product → product}/api.types.ts +0 -0
  85. /package/{src/product → product}/enums.ts +0 -0
  86. /package/{src/product → product}/index.ts +0 -0
  87. /package/{src/product → product}/qa.types.ts +0 -0
  88. /package/{src/product → product}/service.types.ts +0 -0
  89. /package/{src/product → product}/state.types.ts +0 -0
  90. /package/{src/product → product}/types.ts +0 -0
  91. /package/{src/product → product}/utils.types.ts +0 -0
  92. /package/{src/product → product}/validations.types.ts +0 -0
  93. /package/{src/routing → routing}/index.ts +0 -0
  94. /package/{src/routing → routing}/state.types.ts +0 -0
  95. /package/{src/theming → theming}/index.ts +0 -0
  96. /package/{src/theming → theming}/qa.types.ts +0 -0
  97. /package/{src/theming → theming}/state.types.ts +0 -0
  98. /package/{src/theming → theming}/validations.types.ts +0 -0
  99. /package/{src/ui → ui}/index.ts +0 -0
  100. /package/{src/ui → ui}/service.types.ts +0 -0
  101. /package/{src/wallet → wallet}/api.types.ts +0 -0
  102. /package/{src/wallet → wallet}/index.ts +0 -0
  103. /package/{src/wallet → wallet}/service.types.ts +0 -0
  104. /package/{src/wallet → wallet}/state.types.ts +0 -0
  105. /package/{src/wallet → wallet}/types.ts +0 -0
  106. /package/{src/wallet → wallet}/validations.types.ts +0 -0
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@vonq/hapi-elements-types",
4
- "version": "1.6.0",
4
+ "version": "1.7.0",
5
5
  "description": "This package contains Typescript definitions for HAPI Elements",
6
6
  "author": "VONQ HAPI Team",
7
7
  "license": "BSD-3-Clause",
@@ -12,7 +12,7 @@
12
12
  "publish:types": "npm publish --access public",
13
13
  "generate:index": "cti create ./src"
14
14
  },
15
- "main": "src/index.ts",
15
+ "main": "index.ts",
16
16
  "types": "index.d.ts",
17
17
  "dependencies": {
18
18
  "@datadog/browser-logs": "^4.34.2",
@@ -1,4 +1,41 @@
1
- import { Theming } from "theming"
1
+ import * as React from "react"
2
+
3
+ type DefaultTheme = object | null
4
+
5
+ type WithThemeFactory<Theme> = <
6
+ InnerProps extends { theme: NonNullable<Theme> },
7
+ InnerComponent extends React.ComponentType<InnerProps>,
8
+ OuterProps extends InnerProps & { theme?: NonNullable<Theme> },
9
+ >(
10
+ comp: InnerComponent,
11
+ ) => React.ComponentType<OuterProps>
12
+
13
+ interface ThemeProviderProps<Theme> {
14
+ theme: NonNullable<Theme> | ((outerTheme: Theme) => NonNullable<Theme>)
15
+ children: React.ReactNode
16
+ }
17
+
18
+ type ThemeProviderFactory<Theme> = React.ComponentType<
19
+ ThemeProviderProps<Theme>
20
+ >
21
+
22
+ type UseThemeFactory<Theme> = <CustomTheme = Theme>() => CustomTheme
23
+
24
+ interface Theming<Theme> {
25
+ context: React.Context<Theme>
26
+ withTheme: WithThemeFactory<Theme>
27
+ ThemeProvider: ThemeProviderFactory<Theme>
28
+ useTheme: UseThemeFactory<Theme>
29
+ }
30
+
31
+ declare function createTheming<Theme>(
32
+ context: React.Context<Theme>,
33
+ ): Theming<Theme>
34
+
35
+ declare const withTheme: WithThemeFactory<DefaultTheme>
36
+ declare const ThemeProvider: ThemeProviderFactory<DefaultTheme>
37
+ declare const ThemeContext: React.Context<DefaultTheme>
38
+ declare const useTheme: UseThemeFactory<DefaultTheme>
2
39
 
3
40
  export type ThemeGlobalStyles = {
4
41
  borderRadius: string
package/tsconfig.json CHANGED
@@ -23,7 +23,7 @@
23
23
  "forceConsistentCasingInFileNames": true
24
24
  },
25
25
  "include": [
26
- "./src/**/*",
26
+ "**/*",
27
27
  ],
28
28
  "exclude": [
29
29
  "node_modules",
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes