@vonq/hapi-elements-types 1.5.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.
- package/{src/_window → _window}/api.types.ts +9 -7
- package/_window/auth.types.ts +13 -0
- package/_window/config.types.ts +5 -0
- package/{src/_window → _window}/events.types.ts +15 -14
- package/_window/instances.types.ts +27 -0
- package/{src/_window → _window}/qa.types.ts +7 -5
- package/{src/_window → _window}/routing.types.ts +6 -4
- package/{src/_window → _window}/sdk.types.ts +29 -27
- package/{src/_window → _window}/service.types.ts +9 -7
- package/{src/_window → _window}/state.types.ts +55 -53
- package/_window/ui.types.ts +15 -0
- package/{src/_window → _window}/utils.types.ts +7 -5
- package/{src/_window → _window}/validation.types.ts +7 -5
- package/_window/window.ts +140 -0
- package/alert/index.ts +6 -0
- package/{src/alert → alert}/service.types.ts +2 -2
- package/alert/state.types.ts +9 -0
- package/{src/ats → ats}/api.types.ts +2 -2
- package/ats/index.ts +6 -0
- package/{src/ats → ats}/service.types.ts +2 -2
- package/{src/ats → ats}/state.types.ts +1 -1
- package/basket/index.ts +7 -0
- package/{src/basket → basket}/service.types.ts +2 -2
- package/{src/basket → basket}/state.types.ts +1 -1
- package/{src/basket → basket}/utils.types.ts +2 -2
- package/{src/campaign → campaign}/api.types.ts +2 -2
- package/campaign/index.ts +10 -0
- package/campaign/qa.types.ts +12 -0
- package/{src/campaign → campaign}/service.types.ts +2 -2
- package/{src/campaign → campaign}/state.types.ts +1 -1
- package/{src/campaign → campaign}/utils.types.ts +2 -2
- package/{enums.ts → common/enums.ts} +2 -1
- package/{src/common → common}/events/types.ts +6 -6
- package/common/index.ts +7 -0
- package/common/logger/types.ts +18 -0
- package/{src/common → common}/qa.types.ts +2 -2
- package/{src/common → common}/types.ts +5 -6
- package/common/validator/types.ts +4 -0
- package/{src/contract → contract}/api.types.ts +2 -2
- package/contract/index.ts +9 -0
- package/{src/contract → contract}/qa.types.ts +2 -2
- package/{src/contract → contract}/service.types.ts +2 -2
- package/{src/contract → contract}/state.types.ts +1 -1
- package/{src/contract → contract}/utils.types.ts +2 -2
- package/{src/common/logger-datadog → debugging}/index.ts +1 -1
- package/{src/debugging → debugging}/state.types.ts +1 -1
- package/index.ts +18 -0
- package/language/index.ts +5 -0
- package/{src/language → language}/qa.types.ts +2 -2
- package/{src/language → language}/state.types.ts +1 -1
- package/modal/index.ts +6 -0
- package/{src/modal → modal}/service.types.ts +2 -2
- package/{src/modal → modal}/state.types.ts +1 -1
- package/orderJourney/index.ts +8 -0
- package/{src/orderJourney → orderJourney}/qa.types.ts +2 -2
- package/{src/orderJourney → orderJourney}/state.types.ts +1 -1
- package/{src/orderJourney → orderJourney}/utils.types.ts +2 -2
- package/package.json +16 -5
- package/{src/product → product}/api.types.ts +2 -2
- package/product/index.ts +10 -0
- package/{src/product → product}/qa.types.ts +2 -2
- package/{src/product → product}/service.types.ts +2 -2
- package/{src/product → product}/state.types.ts +1 -1
- package/{src/product → product}/utils.types.ts +2 -2
- package/routing/index.ts +3 -0
- package/theming/index.ts +6 -0
- package/{src/theming → theming}/qa.types.ts +2 -2
- package/{src/theming → theming}/state.types.ts +1 -1
- package/{src/theming → theming}/types.ts +38 -1
- package/tsconfig.json +7 -12
- package/{src/ui → ui}/service.types.ts +2 -2
- package/{src/wallet → wallet}/api.types.ts +2 -2
- package/wallet/index.ts +7 -0
- package/{src/wallet → wallet}/service.types.ts +2 -2
- package/{src/wallet → wallet}/state.types.ts +1 -1
- package/src/_window/auth.types.ts +0 -11
- package/src/_window/config.types.ts +0 -30
- package/src/_window/instances.types.ts +0 -18
- package/src/_window/ui.types.ts +0 -13
- package/src/_window/window.ts +0 -56
- package/src/alert/functions.types.ts +0 -13
- package/src/alert/index.ts +0 -9
- package/src/alert/state.initial.ts +0 -16
- package/src/alert/state.types.ts +0 -27
- package/src/alert/state.validations.ts +0 -11
- package/src/ats/functions.types.ts +0 -7
- package/src/ats/index.ts +0 -9
- package/src/ats/state.initial.ts +0 -5
- package/src/ats/state.validations.ts +0 -6
- package/src/basket/consts.ts +0 -1
- package/src/basket/functions.types.ts +0 -40
- package/src/basket/index.ts +0 -12
- package/src/basket/state.initial.ts +0 -11
- package/src/basket/state.validations.ts +0 -12
- package/src/basket/utils.ts +0 -79
- package/src/campaign/consts.ts +0 -1
- package/src/campaign/functions.types.ts +0 -90
- package/src/campaign/index.ts +0 -15
- package/src/campaign/qa.types.ts +0 -12
- package/src/campaign/state.initial.ts +0 -84
- package/src/campaign/state.validations.ts +0 -16
- package/src/campaign/utils.ts +0 -53
- package/src/common/LocalStorage.ts +0 -123
- package/src/common/browser.ts +0 -2
- package/src/common/color.ts +0 -9
- package/src/common/immutable.ts +0 -28
- package/src/common/index.ts +0 -22
- package/src/common/instances/Instance.ts +0 -13
- package/src/common/instances/consts.ts +0 -1
- package/src/common/instances/index.ts +0 -4
- package/src/common/json.ts +0 -25
- package/src/common/logger/Logger.ts +0 -70
- package/src/common/logger/index.ts +0 -5
- package/src/common/logger/types.ts +0 -7
- package/src/common/logger-datadog/LoggerDatadog.ts +0 -42
- package/src/common/misc.ts +0 -114
- package/src/common/promise.ts +0 -161
- package/src/common/proxy.ts +0 -77
- package/src/common/regExTest.ts +0 -12
- package/src/common/tree.ts +0 -148
- package/src/common/utm.ts +0 -19
- package/src/common/validators.ts +0 -21
- package/src/common/webComponents.ts +0 -26
- package/src/config/functions.types.ts +0 -23
- package/src/config/index.ts +0 -5
- package/src/config/state.initial.ts +0 -11
- package/src/config/state.types.ts +0 -15
- package/src/consts.ts +0 -980
- package/src/contract/consts.ts +0 -1
- package/src/contract/functions.types.ts +0 -112
- package/src/contract/index.ts +0 -14
- package/src/contract/state.initial.ts +0 -39
- package/src/contract/state.validations.ts +0 -21
- package/src/contract/utils.ts +0 -36
- package/src/debugging/functions.types.ts +0 -34
- package/src/debugging/index.ts +0 -6
- package/src/debugging/state.initial.ts +0 -10
- package/src/debugging/state.validations.ts +0 -10
- package/src/index.ts +0 -22
- package/src/language/consts.ts +0 -6
- package/src/language/en.ts +0 -530
- package/src/language/functions.types.ts +0 -29
- package/src/language/index.ts +0 -11
- package/src/language/state.initial.ts +0 -13
- package/src/language/state.validations.ts +0 -10
- package/src/language/utils.ts +0 -17
- package/src/modal/consts.ts +0 -6
- package/src/modal/functions.types.ts +0 -22
- package/src/modal/index.ts +0 -11
- package/src/modal/state.initial.ts +0 -9
- package/src/modal/state.validations.ts +0 -6
- package/src/modal/store.types.ts +0 -5
- package/src/orderJourney/consts.ts +0 -289
- package/src/orderJourney/functions.types.ts +0 -140
- package/src/orderJourney/index.ts +0 -13
- package/src/orderJourney/state.initial.ts +0 -401
- package/src/orderJourney/state.validations.ts +0 -78
- package/src/orderJourney/utils.ts +0 -7
- package/src/product/consts.ts +0 -1
- package/src/product/functions.types.ts +0 -156
- package/src/product/index.ts +0 -14
- package/src/product/state.initial.ts +0 -28
- package/src/product/state.validations.ts +0 -25
- package/src/routing/functions.types.ts +0 -48
- package/src/routing/index.ts +0 -5
- package/src/routing/state.initial.ts +0 -10
- package/src/theming/consts.ts +0 -7727
- package/src/theming/functions.types.ts +0 -13
- package/src/theming/index.ts +0 -11
- package/src/theming/state.initial.ts +0 -16
- package/src/theming/state.validations.ts +0 -8
- package/src/theming/utils.ts +0 -581
- package/src/types.ts +0 -229
- package/src/utils.ts +0 -3
- package/src/wallet/consts.ts +0 -3
- package/src/wallet/functions.types.ts +0 -58
- package/src/wallet/index.ts +0 -11
- package/src/wallet/state.initial.ts +0 -18
- package/src/wallet/state.validations.ts +0 -18
- /package/{src/_window → _window}/index.ts +0 -0
- /package/{src/alert → alert}/enums.ts +0 -0
- /package/{src/alert → alert}/types.ts +0 -0
- /package/{src/ats → ats}/types.ts +0 -0
- /package/{src/basket → basket}/types.ts +0 -0
- /package/{src/basket → basket}/validations.types.ts +0 -0
- /package/{src/campaign → campaign}/enums.ts +0 -0
- /package/{src/campaign → campaign}/types.ts +0 -0
- /package/{src/campaign → campaign}/validations.types.ts +0 -0
- /package/{src/common → common}/events/EventCommand/enums.ts +0 -0
- /package/{src/common → common}/events/EventCommand/index.ts +0 -0
- /package/{src/common → common}/events/EventCommand/types.ts +0 -0
- /package/{src/common → common}/events/index.ts +0 -0
- /package/{src/common → common}/logger/enums.ts +0 -0
- /package/{src/common → common}/validations.types.ts +0 -0
- /package/{src/contract → contract}/types.ts +0 -0
- /package/{src/contract → contract}/validations.types.ts +0 -0
- /package/{src/language → language}/validations.types.ts +0 -0
- /package/{src/modal → modal}/enums.ts +0 -0
- /package/{src/modal → modal}/types.ts +0 -0
- /package/{src/orderJourney → orderJourney}/enums.ts +0 -0
- /package/{src/orderJourney → orderJourney}/types.ts +0 -0
- /package/{src/orderJourney → orderJourney}/validations.types.ts +0 -0
- /package/{src/product → product}/enums.ts +0 -0
- /package/{src/product → product}/types.ts +0 -0
- /package/{src/product → product}/validations.types.ts +0 -0
- /package/{src/routing → routing}/state.types.ts +0 -0
- /package/{src/theming → theming}/validations.types.ts +0 -0
- /package/{src/ui → ui}/index.ts +0 -0
- /package/{src/wallet → wallet}/types.ts +0 -0
- /package/{src/wallet → wallet}/validations.types.ts +0 -0
@@ -1,13 +0,0 @@
|
|
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
|
-
}
|
package/src/theming/index.ts
DELETED
@@ -1,11 +0,0 @@
|
|
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';
|
@@ -1,16 +0,0 @@
|
|
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
|
-
}
|
package/src/theming/utils.ts
DELETED
@@ -1,581 +0,0 @@
|
|
1
|
-
import { getColorInstanceOrUndefined } from "../common/color"
|
2
|
-
import { HapiTheme, ThemeGlobalStyles } from "./types"
|
3
|
-
import {
|
4
|
-
THEME_LIGHT_BASE_COMPONENT_STYLES,
|
5
|
-
THEME_LIGHT_DEFAULT_COLORS,
|
6
|
-
themeBaseVars,
|
7
|
-
} from "./consts"
|
8
|
-
import { mergeDeepOverwriteArrays } from "../common/immutable"
|
9
|
-
import { RecursivePartial } from "../common/types"
|
10
|
-
|
11
|
-
export const borderWidthForThingsLikeTabs = "3px"
|
12
|
-
|
13
|
-
export const getDefaultTheme = (
|
14
|
-
globalColors?: RecursivePartial<ThemeGlobalStyles>,
|
15
|
-
): HapiTheme => {
|
16
|
-
return {
|
17
|
-
global: globalColors || THEME_LIGHT_DEFAULT_COLORS,
|
18
|
-
link: {
|
19
|
-
color: "var(--hapi-global-primary-background-color)",
|
20
|
-
},
|
21
|
-
loadingSpinner: {
|
22
|
-
fill: "var(--hapi-global-primary-background-color)",
|
23
|
-
},
|
24
|
-
userJourneyBar: {},
|
25
|
-
card: {
|
26
|
-
display: "block",
|
27
|
-
backgroundColor: "#FFF",
|
28
|
-
borderRadius: "var(--hapi-global-border-radius)",
|
29
|
-
boxShadow: "0px 1px 3px rgba(51, 51, 51, 0.2)",
|
30
|
-
},
|
31
|
-
modal: {
|
32
|
-
backgroundColor: "#FFF",
|
33
|
-
borderLeftWidth: "6px",
|
34
|
-
borderLeftColor: "var(--hapi-global-primary-background-color)",
|
35
|
-
dropShadow:
|
36
|
-
"drop-shadow(0 4px 3px rgb(0 0 0 / 0.07)) drop-shadow(0 2px 2px rgb(0 0 0 / 0.06))",
|
37
|
-
"&:focus-visible": {
|
38
|
-
outline: "none !important",
|
39
|
-
},
|
40
|
-
},
|
41
|
-
modalBackdrop: {
|
42
|
-
backdropFilter: "brightness(0.75)",
|
43
|
-
},
|
44
|
-
tabHeaders: {
|
45
|
-
".tab--horizontal &": {
|
46
|
-
columnGap: themeBaseVars.gap!["2"],
|
47
|
-
},
|
48
|
-
".tab--vertical &": {
|
49
|
-
rowGap: themeBaseVars.gap!["2"],
|
50
|
-
},
|
51
|
-
},
|
52
|
-
tabHeader: {
|
53
|
-
display: "inline-flex",
|
54
|
-
alignItems: "center",
|
55
|
-
justifyContent: "center",
|
56
|
-
cursor: "pointer",
|
57
|
-
flex: themeBaseVars.flex!["1"],
|
58
|
-
padding: `${themeBaseVars.padding!["4"]} ${
|
59
|
-
themeBaseVars.padding!["12"]
|
60
|
-
}`,
|
61
|
-
borderRadius: "0px",
|
62
|
-
backgroundColor: getColorInstanceOrUndefined(
|
63
|
-
globalColors?.fadedBackgroundColor ||
|
64
|
-
THEME_LIGHT_DEFAULT_COLORS.fadedBackgroundColor,
|
65
|
-
)?.hex(),
|
66
|
-
".tab--horizontal &.active": {
|
67
|
-
backgroundColor: getColorInstanceOrUndefined(
|
68
|
-
globalColors?.infoSecondaryBackgroundColor ||
|
69
|
-
THEME_LIGHT_DEFAULT_COLORS.infoSecondaryBackgroundColor,
|
70
|
-
)?.hex(),
|
71
|
-
borderTopWidth: borderWidthForThingsLikeTabs,
|
72
|
-
borderTopStyle: "solid",
|
73
|
-
borderTopColor:
|
74
|
-
globalColors?.primaryBackgroundColor ||
|
75
|
-
THEME_LIGHT_DEFAULT_COLORS.primaryBackgroundColor,
|
76
|
-
},
|
77
|
-
".tab--vertical &.active": {
|
78
|
-
backgroundColor: getColorInstanceOrUndefined(
|
79
|
-
globalColors?.infoSecondaryBackgroundColor ||
|
80
|
-
THEME_LIGHT_DEFAULT_COLORS.infoSecondaryBackgroundColor,
|
81
|
-
)?.hex(),
|
82
|
-
borderLeftWidth: borderWidthForThingsLikeTabs,
|
83
|
-
borderLeftStyle: "solid",
|
84
|
-
borderLeftColor:
|
85
|
-
globalColors?.primaryBackgroundColor ||
|
86
|
-
THEME_LIGHT_DEFAULT_COLORS.primaryBackgroundColor,
|
87
|
-
},
|
88
|
-
".tab--horizontal &:first-child": {
|
89
|
-
borderTopLeftRadius:
|
90
|
-
globalColors?.borderRadius ||
|
91
|
-
THEME_LIGHT_DEFAULT_COLORS.borderRadius,
|
92
|
-
},
|
93
|
-
".tab--horizontal &:last-child": {
|
94
|
-
borderTopRightRadius:
|
95
|
-
globalColors?.borderRadius ||
|
96
|
-
THEME_LIGHT_DEFAULT_COLORS.borderRadius,
|
97
|
-
},
|
98
|
-
".tab--vertical &:first-child": {
|
99
|
-
borderTopLeftRadius:
|
100
|
-
globalColors?.borderRadius ||
|
101
|
-
THEME_LIGHT_DEFAULT_COLORS.borderRadius,
|
102
|
-
},
|
103
|
-
".tab--vertical &:last-child": {
|
104
|
-
borderBottomLeftRadius:
|
105
|
-
globalColors?.borderRadius ||
|
106
|
-
THEME_LIGHT_DEFAULT_COLORS.borderRadius,
|
107
|
-
},
|
108
|
-
},
|
109
|
-
tabPanels: {},
|
110
|
-
tabPanel: {
|
111
|
-
backgroundColor: getColorInstanceOrUndefined(
|
112
|
-
globalColors?.infoSecondaryBackgroundColor ||
|
113
|
-
THEME_LIGHT_DEFAULT_COLORS.infoSecondaryBackgroundColor,
|
114
|
-
)?.hex(),
|
115
|
-
".tab--horizontal &": {
|
116
|
-
padding: `${themeBaseVars.padding!["4"]} ${
|
117
|
-
themeBaseVars.padding!["2"]
|
118
|
-
}`,
|
119
|
-
},
|
120
|
-
".tab--vertical &": {
|
121
|
-
padding: `${themeBaseVars.padding!["2"]} ${
|
122
|
-
themeBaseVars.padding!["4"]
|
123
|
-
}`,
|
124
|
-
},
|
125
|
-
},
|
126
|
-
buttonBase: THEME_LIGHT_BASE_COMPONENT_STYLES["button"] || {},
|
127
|
-
buttonPrimary: {
|
128
|
-
extend: "buttonBase",
|
129
|
-
backgroundColor: "var(--hapi-global-primary-background-color)",
|
130
|
-
color: "var(--hapi-global-primary-text-color)",
|
131
|
-
"&:disabled": {
|
132
|
-
backgroundColor: getColorInstanceOrUndefined(
|
133
|
-
globalColors?.primaryBackgroundColor ||
|
134
|
-
THEME_LIGHT_DEFAULT_COLORS.primaryBackgroundColor,
|
135
|
-
)
|
136
|
-
?.fade(0.3)
|
137
|
-
.hexa(),
|
138
|
-
},
|
139
|
-
"&:hover:enabled": {
|
140
|
-
backgroundColor: getColorInstanceOrUndefined(
|
141
|
-
globalColors?.primaryBackgroundColor ||
|
142
|
-
THEME_LIGHT_DEFAULT_COLORS.primaryBackgroundColor,
|
143
|
-
)
|
144
|
-
?.darken(0.1)
|
145
|
-
.hex(),
|
146
|
-
},
|
147
|
-
},
|
148
|
-
buttonSecondary: {
|
149
|
-
extend: "buttonBase",
|
150
|
-
backgroundColor: "var(--hapi-global-secondary-background-color)",
|
151
|
-
color: "var(--hapi-global-secondary-text-color)",
|
152
|
-
"&:disabled": {
|
153
|
-
backgroundColor: getColorInstanceOrUndefined(
|
154
|
-
globalColors?.secondaryBackgroundColor ||
|
155
|
-
THEME_LIGHT_DEFAULT_COLORS.secondaryBackgroundColor,
|
156
|
-
)
|
157
|
-
?.fade(0.3)
|
158
|
-
.hexa(),
|
159
|
-
},
|
160
|
-
"&:hover:enabled": {
|
161
|
-
backgroundColor: getColorInstanceOrUndefined(
|
162
|
-
globalColors?.secondaryBackgroundColor ||
|
163
|
-
THEME_LIGHT_DEFAULT_COLORS.secondaryBackgroundColor,
|
164
|
-
)
|
165
|
-
?.darken(0.1)
|
166
|
-
.hex(),
|
167
|
-
},
|
168
|
-
},
|
169
|
-
buttonDanger: {
|
170
|
-
extend: "buttonBase",
|
171
|
-
backgroundColor: "var(--hapi-global-danger-background-color)",
|
172
|
-
color: "var(--hapi-global-danger-text-color)",
|
173
|
-
"&:disabled": {
|
174
|
-
backgroundColor: getColorInstanceOrUndefined(
|
175
|
-
globalColors?.dangerBackgroundColor ||
|
176
|
-
THEME_LIGHT_DEFAULT_COLORS.dangerBackgroundColor,
|
177
|
-
)
|
178
|
-
?.fade(0.3)
|
179
|
-
.hexa(),
|
180
|
-
},
|
181
|
-
"&:hover:enabled": {
|
182
|
-
backgroundColor: getColorInstanceOrUndefined(
|
183
|
-
globalColors?.dangerBackgroundColor ||
|
184
|
-
THEME_LIGHT_DEFAULT_COLORS.dangerBackgroundColor,
|
185
|
-
)
|
186
|
-
?.darken(0.1)
|
187
|
-
.hex(),
|
188
|
-
},
|
189
|
-
},
|
190
|
-
buttonDangerSecondary: {
|
191
|
-
extend: "buttonBase",
|
192
|
-
backgroundColor:
|
193
|
-
"var(--hapi-global-danger-secondary-background-color)",
|
194
|
-
color: "var(--hapi-global-danger-background-color)",
|
195
|
-
"&:disabled": {
|
196
|
-
backgroundColor: getColorInstanceOrUndefined(
|
197
|
-
globalColors?.dangerSecondaryBackgroundColor ||
|
198
|
-
THEME_LIGHT_DEFAULT_COLORS.dangerSecondaryBackgroundColor,
|
199
|
-
)
|
200
|
-
?.fade(0.3)
|
201
|
-
.hexa(),
|
202
|
-
},
|
203
|
-
"&:hover:enabled": {
|
204
|
-
backgroundColor: getColorInstanceOrUndefined(
|
205
|
-
globalColors?.dangerSecondaryBackgroundColor ||
|
206
|
-
THEME_LIGHT_DEFAULT_COLORS.dangerSecondaryBackgroundColor,
|
207
|
-
)
|
208
|
-
?.darken(0.1)
|
209
|
-
.hex(),
|
210
|
-
},
|
211
|
-
},
|
212
|
-
buttonSuccess: {
|
213
|
-
extend: "buttonBase",
|
214
|
-
backgroundColor: "var(--hapi-global-success-background-color)",
|
215
|
-
color: "var(--hapi-global-success-text-color)",
|
216
|
-
"&:disabled": {
|
217
|
-
backgroundColor: getColorInstanceOrUndefined(
|
218
|
-
globalColors?.successBackgroundColor ||
|
219
|
-
THEME_LIGHT_DEFAULT_COLORS.successBackgroundColor,
|
220
|
-
)
|
221
|
-
?.fade(0.3)
|
222
|
-
.hexa(),
|
223
|
-
},
|
224
|
-
"&:hover:enabled": {
|
225
|
-
backgroundColor: getColorInstanceOrUndefined(
|
226
|
-
globalColors?.successBackgroundColor ||
|
227
|
-
THEME_LIGHT_DEFAULT_COLORS.successBackgroundColor,
|
228
|
-
)
|
229
|
-
?.darken(0.1)
|
230
|
-
.hex(),
|
231
|
-
},
|
232
|
-
},
|
233
|
-
buttonSuccessSecondary: {
|
234
|
-
extend: "buttonBase",
|
235
|
-
backgroundColor:
|
236
|
-
"var(--hapi-global-success-secondary-background-color)",
|
237
|
-
color: "var(--hapi-global-success-background-color)",
|
238
|
-
"&:disabled": {
|
239
|
-
backgroundColor: getColorInstanceOrUndefined(
|
240
|
-
globalColors?.successSecondaryBackgroundColor ||
|
241
|
-
THEME_LIGHT_DEFAULT_COLORS.successSecondaryBackgroundColor,
|
242
|
-
)
|
243
|
-
?.fade(0.3)
|
244
|
-
.hexa(),
|
245
|
-
},
|
246
|
-
"&:hover:enabled": {
|
247
|
-
backgroundColor: getColorInstanceOrUndefined(
|
248
|
-
globalColors?.successSecondaryBackgroundColor ||
|
249
|
-
THEME_LIGHT_DEFAULT_COLORS.successSecondaryBackgroundColor,
|
250
|
-
)
|
251
|
-
?.darken(0.1)
|
252
|
-
.hex(),
|
253
|
-
},
|
254
|
-
},
|
255
|
-
buttonInfo: {
|
256
|
-
extend: "buttonBase",
|
257
|
-
backgroundColor: "var(--hapi-global-info-background-color)",
|
258
|
-
color: "var(--hapi-global-info-text-color)",
|
259
|
-
"&:disabled": {
|
260
|
-
backgroundColor: getColorInstanceOrUndefined(
|
261
|
-
globalColors?.infoBackgroundColor ||
|
262
|
-
THEME_LIGHT_DEFAULT_COLORS.infoBackgroundColor,
|
263
|
-
)
|
264
|
-
?.fade(0.3)
|
265
|
-
.hexa(),
|
266
|
-
},
|
267
|
-
"&:hover:enabled": {
|
268
|
-
backgroundColor: getColorInstanceOrUndefined(
|
269
|
-
globalColors?.infoBackgroundColor ||
|
270
|
-
THEME_LIGHT_DEFAULT_COLORS.infoBackgroundColor,
|
271
|
-
)
|
272
|
-
?.darken(0.1)
|
273
|
-
.hex(),
|
274
|
-
},
|
275
|
-
},
|
276
|
-
buttonInfoSecondary: {
|
277
|
-
extend: "buttonBase",
|
278
|
-
backgroundColor:
|
279
|
-
"var(--hapi-global-info-secondary-background-color)",
|
280
|
-
color: "var(--hapi-global-info-background-color)",
|
281
|
-
"&:disabled": {
|
282
|
-
backgroundColor: getColorInstanceOrUndefined(
|
283
|
-
globalColors?.infoSecondaryBackgroundColor ||
|
284
|
-
THEME_LIGHT_DEFAULT_COLORS.infoSecondaryBackgroundColor,
|
285
|
-
)
|
286
|
-
?.fade(0.3)
|
287
|
-
.hexa(),
|
288
|
-
},
|
289
|
-
"&:hover:enabled": {
|
290
|
-
backgroundColor: getColorInstanceOrUndefined(
|
291
|
-
globalColors?.infoSecondaryBackgroundColor ||
|
292
|
-
THEME_LIGHT_DEFAULT_COLORS.infoSecondaryBackgroundColor,
|
293
|
-
)
|
294
|
-
?.darken(0.1)
|
295
|
-
.hex(),
|
296
|
-
},
|
297
|
-
},
|
298
|
-
buttonWarning: {
|
299
|
-
extend: "buttonBase",
|
300
|
-
backgroundColor: "var(--hapi-global-warning-background-color)",
|
301
|
-
color: "var(--hapi-global-warning-text-color)",
|
302
|
-
"&:disabled": {
|
303
|
-
backgroundColor: getColorInstanceOrUndefined(
|
304
|
-
globalColors?.warningBackgroundColor ||
|
305
|
-
THEME_LIGHT_DEFAULT_COLORS.warningBackgroundColor,
|
306
|
-
)
|
307
|
-
?.fade(0.3)
|
308
|
-
.hexa(),
|
309
|
-
},
|
310
|
-
"&:hover:enabled": {
|
311
|
-
backgroundColor: getColorInstanceOrUndefined(
|
312
|
-
globalColors?.warningBackgroundColor ||
|
313
|
-
THEME_LIGHT_DEFAULT_COLORS.warningBackgroundColor,
|
314
|
-
)
|
315
|
-
?.darken(0.1)
|
316
|
-
.hex(),
|
317
|
-
},
|
318
|
-
},
|
319
|
-
buttonWarningSecondary: {
|
320
|
-
extend: "buttonBase",
|
321
|
-
backgroundColor:
|
322
|
-
"var(--hapi-global-warning-secondary-background-color)",
|
323
|
-
color: "var(--hapi-global-warning-background-color)",
|
324
|
-
"&:disabled": {
|
325
|
-
backgroundColor: getColorInstanceOrUndefined(
|
326
|
-
globalColors?.warningSecondaryBackgroundColor ||
|
327
|
-
THEME_LIGHT_DEFAULT_COLORS.warningSecondaryBackgroundColor,
|
328
|
-
)
|
329
|
-
?.fade(0.3)
|
330
|
-
.hexa(),
|
331
|
-
},
|
332
|
-
"&:hover:enabled": {
|
333
|
-
backgroundColor: getColorInstanceOrUndefined(
|
334
|
-
globalColors?.warningSecondaryBackgroundColor ||
|
335
|
-
THEME_LIGHT_DEFAULT_COLORS.warningSecondaryBackgroundColor,
|
336
|
-
)
|
337
|
-
?.darken(0.1)
|
338
|
-
.hex(),
|
339
|
-
},
|
340
|
-
},
|
341
|
-
buttonAccent: {
|
342
|
-
extend: "buttonBase",
|
343
|
-
backgroundColor: "var(--hapi-global-accent-background-color)",
|
344
|
-
color: "var(--hapi-global-accent-text-color)",
|
345
|
-
"&:disabled": {
|
346
|
-
backgroundColor: getColorInstanceOrUndefined(
|
347
|
-
globalColors?.accentBackgroundColor ||
|
348
|
-
THEME_LIGHT_DEFAULT_COLORS.accentBackgroundColor,
|
349
|
-
)
|
350
|
-
?.fade(0.3)
|
351
|
-
.hexa(),
|
352
|
-
},
|
353
|
-
"&:hover:enabled": {
|
354
|
-
backgroundColor: getColorInstanceOrUndefined(
|
355
|
-
globalColors?.accentBackgroundColor ||
|
356
|
-
THEME_LIGHT_DEFAULT_COLORS.accentBackgroundColor,
|
357
|
-
)
|
358
|
-
?.darken(0.1)
|
359
|
-
.hex(),
|
360
|
-
},
|
361
|
-
},
|
362
|
-
buttonFaded: {
|
363
|
-
extend: "buttonBase",
|
364
|
-
backgroundColor: "var(--hapi-global-faded-background-color)",
|
365
|
-
color: "var(--hapi-global-faded-text-color)",
|
366
|
-
"&:disabled": {
|
367
|
-
backgroundColor: getColorInstanceOrUndefined(
|
368
|
-
globalColors?.fadedBackgroundColor ||
|
369
|
-
THEME_LIGHT_DEFAULT_COLORS.fadedBackgroundColor,
|
370
|
-
)
|
371
|
-
?.fade(0.3)
|
372
|
-
.hexa(),
|
373
|
-
},
|
374
|
-
"&:hover:enabled": {
|
375
|
-
backgroundColor: getColorInstanceOrUndefined(
|
376
|
-
globalColors?.fadedBackgroundColor ||
|
377
|
-
THEME_LIGHT_DEFAULT_COLORS.fadedBackgroundColor,
|
378
|
-
)
|
379
|
-
?.darken(0.1)
|
380
|
-
.hex(),
|
381
|
-
},
|
382
|
-
},
|
383
|
-
badgeBase: {
|
384
|
-
backgroundColor: "var(--hapi-global-primary-background-color)",
|
385
|
-
color: "var(--hapi-global-primary-text-color)",
|
386
|
-
},
|
387
|
-
headingBase: {},
|
388
|
-
headingOne: {
|
389
|
-
fontSize: themeBaseVars.fontSize!["5xl"][0],
|
390
|
-
lineHeight: themeBaseVars.fontSize!["5xl"][1].lineHeight,
|
391
|
-
},
|
392
|
-
headingTwo: {
|
393
|
-
fontSize: themeBaseVars.fontSize!["4xl"][0],
|
394
|
-
lineHeight: themeBaseVars.fontSize!["4xl"][1].lineHeight,
|
395
|
-
},
|
396
|
-
headingThree: {
|
397
|
-
fontSize: themeBaseVars.fontSize!["3xl"][0],
|
398
|
-
lineHeight: themeBaseVars.fontSize!["3xl"][1].lineHeight,
|
399
|
-
},
|
400
|
-
headingFour: {
|
401
|
-
fontSize: themeBaseVars.fontSize!["2xl"][0],
|
402
|
-
lineHeight: themeBaseVars.fontSize!["2xl"][1].lineHeight,
|
403
|
-
},
|
404
|
-
headingFive: {
|
405
|
-
fontSize: themeBaseVars.fontSize!["xl"][0],
|
406
|
-
lineHeight: themeBaseVars.fontSize!["xl"][1].lineHeight,
|
407
|
-
},
|
408
|
-
headingSix: {
|
409
|
-
fontSize: themeBaseVars.fontSize!["lg"][0],
|
410
|
-
lineHeight: themeBaseVars.fontSize!["lg"][1].lineHeight,
|
411
|
-
},
|
412
|
-
formFieldBase: THEME_LIGHT_BASE_COMPONENT_STYLES["formFieldBase"] || {},
|
413
|
-
inputSelectBase:
|
414
|
-
THEME_LIGHT_BASE_COMPONENT_STYLES["inputSelectBase"] || {},
|
415
|
-
input: {
|
416
|
-
extend: [
|
417
|
-
THEME_LIGHT_BASE_COMPONENT_STYLES["formFieldBase"] || {},
|
418
|
-
THEME_LIGHT_BASE_COMPONENT_STYLES["inputSelectBase"] || {},
|
419
|
-
],
|
420
|
-
},
|
421
|
-
inputHtml: {
|
422
|
-
extend: () => {
|
423
|
-
const style: any = {}
|
424
|
-
|
425
|
-
const combinedStyles = {
|
426
|
-
...THEME_LIGHT_BASE_COMPONENT_STYLES["formFieldBase"],
|
427
|
-
...THEME_LIGHT_BASE_COMPONENT_STYLES["inputSelectBase"],
|
428
|
-
}
|
429
|
-
|
430
|
-
Object.keys(combinedStyles)
|
431
|
-
.filter((key) => !key.includes("padding"))
|
432
|
-
.forEach((key) => (style[key] = combinedStyles[key]))
|
433
|
-
|
434
|
-
return style
|
435
|
-
},
|
436
|
-
},
|
437
|
-
inputRange: {
|
438
|
-
extend: "formFieldBase",
|
439
|
-
backgroundColor: "var(--hapi-global-secondary-background-color)",
|
440
|
-
borderColor: "var(--hapi-global-primary-background-color)",
|
441
|
-
},
|
442
|
-
inputTags: {
|
443
|
-
extend: () => {
|
444
|
-
const style: any = {}
|
445
|
-
|
446
|
-
const combinedStyles = {
|
447
|
-
...THEME_LIGHT_BASE_COMPONENT_STYLES["formFieldBase"],
|
448
|
-
...THEME_LIGHT_BASE_COMPONENT_STYLES["inputSelectBase"],
|
449
|
-
}
|
450
|
-
|
451
|
-
Object.keys(combinedStyles)
|
452
|
-
.filter(
|
453
|
-
(key) =>
|
454
|
-
!key.includes("border") && !key.includes("padding"),
|
455
|
-
)
|
456
|
-
.forEach((key) => (style[key] = combinedStyles[key]))
|
457
|
-
|
458
|
-
return style
|
459
|
-
},
|
460
|
-
marginBottom: "0",
|
461
|
-
flex: "1",
|
462
|
-
padding: "0",
|
463
|
-
border: "0",
|
464
|
-
"&:focus": {
|
465
|
-
border: "0",
|
466
|
-
boxShadow: "none",
|
467
|
-
outline: "none",
|
468
|
-
},
|
469
|
-
},
|
470
|
-
textarea: {
|
471
|
-
extend: [
|
472
|
-
THEME_LIGHT_BASE_COMPONENT_STYLES["formFieldBase"] || {},
|
473
|
-
THEME_LIGHT_BASE_COMPONENT_STYLES["inputSelectBase"] || {},
|
474
|
-
],
|
475
|
-
},
|
476
|
-
select: {
|
477
|
-
extend: () => {
|
478
|
-
const style: any = {}
|
479
|
-
|
480
|
-
const combinedStyles = {
|
481
|
-
...THEME_LIGHT_BASE_COMPONENT_STYLES["formFieldBase"],
|
482
|
-
...THEME_LIGHT_BASE_COMPONENT_STYLES["inputSelectBase"],
|
483
|
-
}
|
484
|
-
|
485
|
-
Object.keys(combinedStyles)
|
486
|
-
.filter(
|
487
|
-
(key) =>
|
488
|
-
!key.includes("padding") &&
|
489
|
-
(key === "borderRadius" || !key.includes("border")),
|
490
|
-
)
|
491
|
-
.forEach((key) => (style[key] = combinedStyles[key]))
|
492
|
-
|
493
|
-
return style
|
494
|
-
},
|
495
|
-
},
|
496
|
-
checkbox: {
|
497
|
-
extend: "formFieldBase",
|
498
|
-
"&:checked": {
|
499
|
-
color: THEME_LIGHT_DEFAULT_COLORS.primaryBackgroundColor,
|
500
|
-
},
|
501
|
-
},
|
502
|
-
radio: {
|
503
|
-
extend: () => {
|
504
|
-
const style: any = {}
|
505
|
-
Object.keys(
|
506
|
-
THEME_LIGHT_BASE_COMPONENT_STYLES["formFieldBase"] || {},
|
507
|
-
)
|
508
|
-
.filter((key) => key !== "borderRadius")
|
509
|
-
.forEach((key) => {
|
510
|
-
if (
|
511
|
-
THEME_LIGHT_BASE_COMPONENT_STYLES["formFieldBase"]
|
512
|
-
) {
|
513
|
-
style[key] =
|
514
|
-
THEME_LIGHT_BASE_COMPONENT_STYLES[
|
515
|
-
"formFieldBase"
|
516
|
-
][key]
|
517
|
-
}
|
518
|
-
})
|
519
|
-
return style
|
520
|
-
},
|
521
|
-
"&:checked": {
|
522
|
-
color: THEME_LIGHT_DEFAULT_COLORS.primaryBackgroundColor,
|
523
|
-
},
|
524
|
-
},
|
525
|
-
accordionButton: {
|
526
|
-
display: "flex",
|
527
|
-
alignItems: "center",
|
528
|
-
width: "100%",
|
529
|
-
borderRadius: "var(--hapi-global-border-radius)",
|
530
|
-
color: "#000",
|
531
|
-
fontWeight: themeBaseVars.fontWeight!["medium"],
|
532
|
-
textAlign: "left",
|
533
|
-
padding: `${themeBaseVars.padding!["2"]} ${
|
534
|
-
themeBaseVars.padding!["4"]
|
535
|
-
}`,
|
536
|
-
backgroundColor: themeBaseVars.backgroundColor!["gray"]["100"],
|
537
|
-
cursor: "pointer",
|
538
|
-
"&:hover": {
|
539
|
-
backgroundColor: getColorInstanceOrUndefined(
|
540
|
-
themeBaseVars.backgroundColor!["gray"]["100"],
|
541
|
-
)
|
542
|
-
?.darken(0.1)
|
543
|
-
.hex(),
|
544
|
-
},
|
545
|
-
},
|
546
|
-
accordionArrow: {
|
547
|
-
height: themeBaseVars.height!["4"],
|
548
|
-
width: themeBaseVars.width!["4"],
|
549
|
-
color: themeBaseVars.textColor!["gray"]["500"],
|
550
|
-
},
|
551
|
-
accordionPanel: {
|
552
|
-
marginBottom: themeBaseVars.margin!["2"],
|
553
|
-
paddingBottom: themeBaseVars.padding!["5"],
|
554
|
-
paddingRight: themeBaseVars.padding!["5"],
|
555
|
-
paddingLeft: themeBaseVars.padding!["5"],
|
556
|
-
fontSize: themeBaseVars.fontSize!["sm"],
|
557
|
-
color: themeBaseVars.textColor!["gray"]["500"],
|
558
|
-
backgroundColor: themeBaseVars.backgroundColor!["gray"]["100"],
|
559
|
-
},
|
560
|
-
accordionTitle: {
|
561
|
-
display: "inline-flex",
|
562
|
-
flex: themeBaseVars.flex!["1"],
|
563
|
-
alignItems: "center",
|
564
|
-
},
|
565
|
-
alert: {
|
566
|
-
maxWidth: themeBaseVars.maxWidth!["md"],
|
567
|
-
},
|
568
|
-
}
|
569
|
-
}
|
570
|
-
|
571
|
-
export const getUpdatedTheme = (
|
572
|
-
updatedTheme: Partial<HapiTheme>,
|
573
|
-
): Partial<HapiTheme> => {
|
574
|
-
const newTheme: Partial<HapiTheme> = getDefaultTheme(
|
575
|
-
mergeDeepOverwriteArrays(
|
576
|
-
THEME_LIGHT_DEFAULT_COLORS,
|
577
|
-
updatedTheme.global,
|
578
|
-
),
|
579
|
-
)
|
580
|
-
return newTheme
|
581
|
-
}
|