@beinformed/react 1.0.0-beta.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/CHANGELOG.md +12 -0
- package/LICENSE.md +1 -0
- package/dist/ErrorBoundaryFallback-D6YQem9P.d.cts +13 -0
- package/dist/ErrorBoundaryFallback-D6YQem9P.d.ts +13 -0
- package/dist/beforeRenderHooks-CNvsMmi8.d.cts +18 -0
- package/dist/beforeRenderHooks-Gb0tcmCY.d.ts +18 -0
- package/dist/chunk-347XDLN7.js +1 -0
- package/dist/chunk-347XDLN7.js.map +1 -0
- package/dist/chunk-3OP2KQ56.js +2 -0
- package/dist/chunk-3OP2KQ56.js.map +1 -0
- package/dist/chunk-4AC7YQ5Q.js +2 -0
- package/dist/chunk-4AC7YQ5Q.js.map +1 -0
- package/dist/chunk-6E5DAS6G.js +1 -0
- package/dist/chunk-6E5DAS6G.js.map +1 -0
- package/dist/chunk-6KRECIRI.js +2 -0
- package/dist/chunk-6KRECIRI.js.map +1 -0
- package/dist/chunk-A4USB53Q.js +2 -0
- package/dist/chunk-A4USB53Q.js.map +1 -0
- package/dist/chunk-AMFWIR2R.js +2 -0
- package/dist/chunk-AMFWIR2R.js.map +1 -0
- package/dist/chunk-B7PQLTVC.js +2 -0
- package/dist/chunk-B7PQLTVC.js.map +1 -0
- package/dist/chunk-DI7VM62A.js +2 -0
- package/dist/chunk-DI7VM62A.js.map +1 -0
- package/dist/chunk-FW4363Y4.js +2 -0
- package/dist/chunk-FW4363Y4.js.map +1 -0
- package/dist/chunk-HDOILTJ2.js +2 -0
- package/dist/chunk-HDOILTJ2.js.map +1 -0
- package/dist/chunk-JYAETKRB.js +2 -0
- package/dist/chunk-JYAETKRB.js.map +1 -0
- package/dist/chunk-K3DTH6XN.js +2 -0
- package/dist/chunk-K3DTH6XN.js.map +1 -0
- package/dist/chunk-KNEDBCHP.js +2 -0
- package/dist/chunk-KNEDBCHP.js.map +1 -0
- package/dist/chunk-MT7D3AJU.js +12 -0
- package/dist/chunk-MT7D3AJU.js.map +1 -0
- package/dist/chunk-RKGGCIUD.js +2 -0
- package/dist/chunk-RKGGCIUD.js.map +1 -0
- package/dist/chunk-UZIZDEU6.js +2 -0
- package/dist/chunk-UZIZDEU6.js.map +1 -0
- package/dist/chunk-VFLYA5WJ.js +2 -0
- package/dist/chunk-VFLYA5WJ.js.map +1 -0
- package/dist/chunk-VG3QU524.js +22 -0
- package/dist/chunk-VG3QU524.js.map +1 -0
- package/dist/chunk-WBPDMDW4.js +2 -0
- package/dist/chunk-WBPDMDW4.js.map +1 -0
- package/dist/chunk-X2C7CKOK.js +2 -0
- package/dist/chunk-X2C7CKOK.js.map +1 -0
- package/dist/chunk-X3N2NQVZ.js +2 -0
- package/dist/chunk-X3N2NQVZ.js.map +1 -0
- package/dist/chunk-Y7ESITVO.js +2 -0
- package/dist/chunk-Y7ESITVO.js.map +1 -0
- package/dist/chunk-YG7XDCNV.js +2 -0
- package/dist/chunk-YG7XDCNV.js.map +1 -0
- package/dist/chunk-YJNJVQFW.js +2 -0
- package/dist/chunk-YJNJVQFW.js.map +1 -0
- package/dist/chunk-Z2Y3OPVI.js +2 -0
- package/dist/chunk-Z2Y3OPVI.js.map +1 -0
- package/dist/client/index.cjs +12 -0
- package/dist/client/index.cjs.map +1 -0
- package/dist/client/index.d.cts +84 -0
- package/dist/client/index.d.ts +84 -0
- package/dist/client/index.js +2 -0
- package/dist/client/index.js.map +1 -0
- package/dist/components/index.cjs +12 -0
- package/dist/components/index.cjs.map +1 -0
- package/dist/components/index.d.cts +28 -0
- package/dist/components/index.d.ts +28 -0
- package/dist/components/index.js +2 -0
- package/dist/components/index.js.map +1 -0
- package/dist/hooks/index.cjs +2 -0
- package/dist/hooks/index.cjs.map +1 -0
- package/dist/hooks/index.d.cts +353 -0
- package/dist/hooks/index.d.ts +353 -0
- package/dist/hooks/index.js +2 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/i18n/index.cjs +2 -0
- package/dist/i18n/index.cjs.map +1 -0
- package/dist/i18n/index.d.cts +26 -0
- package/dist/i18n/index.d.ts +26 -0
- package/dist/i18n/index.js +2 -0
- package/dist/i18n/index.js.map +1 -0
- package/dist/index.cjs +32 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +27 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/redux/index.cjs +2 -0
- package/dist/redux/index.cjs.map +1 -0
- package/dist/redux/index.d.cts +458 -0
- package/dist/redux/index.d.ts +458 -0
- package/dist/redux/index.js +2 -0
- package/dist/redux/index.js.map +1 -0
- package/dist/server/index.cjs +22 -0
- package/dist/server/index.cjs.map +1 -0
- package/dist/server/index.d.cts +78 -0
- package/dist/server/index.d.ts +78 -0
- package/dist/server/index.js +2 -0
- package/dist/server/index.js.map +1 -0
- package/dist/styled-components.d-CrkOxzv5.d.cts +346 -0
- package/dist/styled-components.d-CrkOxzv5.d.ts +346 -0
- package/dist/theme/index.cjs +2 -0
- package/dist/theme/index.cjs.map +1 -0
- package/dist/theme/index.d.cts +112 -0
- package/dist/theme/index.d.ts +112 -0
- package/dist/theme/index.js +2 -0
- package/dist/theme/index.js.map +1 -0
- package/dist/types-CGXygEPz.d.cts +8 -0
- package/dist/types-CGXygEPz.d.ts +8 -0
- package/dist/useForm-CG_DMYfZ.d.cts +178 -0
- package/dist/useForm-DW-a5mcV.d.ts +178 -0
- package/dist/utils/index.cjs +2 -0
- package/dist/utils/index.cjs.map +1 -0
- package/dist/utils/index.d.cts +6 -0
- package/dist/utils/index.d.ts +6 -0
- package/dist/utils/index.js +2 -0
- package/dist/utils/index.js.map +1 -0
- package/package.json +125 -0
|
@@ -0,0 +1,346 @@
|
|
|
1
|
+
import * as _reduxjs_toolkit from '@reduxjs/toolkit';
|
|
2
|
+
import { Reducer } from '@reduxjs/toolkit';
|
|
3
|
+
import * as history from 'history';
|
|
4
|
+
import { Location, Action } from 'history';
|
|
5
|
+
import * as redux from 'redux';
|
|
6
|
+
import { ErrorResponse, BaseCollection, ModularUIModel, Href } from '@beinformed/ui/models';
|
|
7
|
+
import { MessageParameters } from '@beinformed/ui/types';
|
|
8
|
+
import { immerable } from 'immer';
|
|
9
|
+
import { ModularUIRequestOptions, UpdateHandler } from '@beinformed/ui/utils';
|
|
10
|
+
import { Setting as Setting$1 } from '@beinformed/ui/settings';
|
|
11
|
+
import { DefaultTheme } from 'styled-components';
|
|
12
|
+
|
|
13
|
+
interface ProgressIndicatorState {
|
|
14
|
+
count: number;
|
|
15
|
+
timestamp: number;
|
|
16
|
+
percentComplete: number;
|
|
17
|
+
}
|
|
18
|
+
declare const progressIndicatorReducer: redux.Reducer<ProgressIndicatorState> & {
|
|
19
|
+
getInitialState: () => ProgressIndicatorState;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
interface LocaleConfiguration {
|
|
23
|
+
code: string;
|
|
24
|
+
messages: Record<string, string>;
|
|
25
|
+
errors?: Record<string, string>;
|
|
26
|
+
nativeName?: string;
|
|
27
|
+
}
|
|
28
|
+
interface MessageObject {
|
|
29
|
+
id: string;
|
|
30
|
+
defaultMessage?: string;
|
|
31
|
+
parameters?: MessageParameters;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
interface NotificationState {
|
|
35
|
+
render: boolean;
|
|
36
|
+
messageType: string | undefined;
|
|
37
|
+
message: MessageObject | undefined;
|
|
38
|
+
error: ErrorResponse | undefined;
|
|
39
|
+
}
|
|
40
|
+
interface ShowNotificationArguments {
|
|
41
|
+
type: NOTIFICATION_TYPES | undefined;
|
|
42
|
+
message: MessageObject | undefined;
|
|
43
|
+
error?: ErrorResponse | undefined;
|
|
44
|
+
timeout?: number;
|
|
45
|
+
}
|
|
46
|
+
declare enum NOTIFICATION_TYPES {
|
|
47
|
+
SUCCESS = "SUCCESS",
|
|
48
|
+
INFO = "INFO",
|
|
49
|
+
WARNING = "WARNING",
|
|
50
|
+
ERROR = "ERROR"
|
|
51
|
+
}
|
|
52
|
+
declare const showNotification: _reduxjs_toolkit.AsyncThunk<void, ShowNotificationArguments, {
|
|
53
|
+
state?: unknown;
|
|
54
|
+
dispatch?: _reduxjs_toolkit.ThunkDispatch<unknown, unknown, redux.UnknownAction>;
|
|
55
|
+
extra?: unknown;
|
|
56
|
+
rejectValue?: unknown;
|
|
57
|
+
serializedErrorType?: unknown;
|
|
58
|
+
pendingMeta?: unknown;
|
|
59
|
+
fulfilledMeta?: unknown;
|
|
60
|
+
rejectedMeta?: unknown;
|
|
61
|
+
}>;
|
|
62
|
+
declare const dismissNotification: _reduxjs_toolkit.ActionCreatorWithoutPayload<"DISMISS_NOTIFICATION">;
|
|
63
|
+
declare const notificationReducer: redux.Reducer<NotificationState> & {
|
|
64
|
+
getInitialState: () => NotificationState;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
interface ModelCatalogState {
|
|
68
|
+
entryDate: string | undefined;
|
|
69
|
+
}
|
|
70
|
+
declare const updateEntryDate: _reduxjs_toolkit.ActionCreatorWithPreparedPayload<[entryDate: string], string, "UPDATE_ENTRYDATE", never, never>;
|
|
71
|
+
/**
|
|
72
|
+
* Keep track of the entry date for the modelcatalog
|
|
73
|
+
*/
|
|
74
|
+
declare const modelCatalogReducer: redux.Reducer<ModelCatalogState> & {
|
|
75
|
+
getInitialState: () => ModelCatalogState;
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
interface ModalState {
|
|
79
|
+
key: string;
|
|
80
|
+
visible: boolean;
|
|
81
|
+
size?: string;
|
|
82
|
+
}
|
|
83
|
+
interface ModalsState {
|
|
84
|
+
modals: ModalState[];
|
|
85
|
+
}
|
|
86
|
+
declare const showModal: _reduxjs_toolkit.ActionCreatorWithPreparedPayload<[key: string], string, "SHOW_MODAL", never, never>;
|
|
87
|
+
declare const closeModal: _reduxjs_toolkit.ActionCreatorWithPreparedPayload<[key: string], string, "CLOSE_MODAL", never, never>;
|
|
88
|
+
declare const modalsReducer: redux.Reducer<ModalsState> & {
|
|
89
|
+
getInitialState: () => ModalsState;
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
interface AuthState {
|
|
93
|
+
authenticated: boolean;
|
|
94
|
+
mustChangePassword: boolean;
|
|
95
|
+
error: string | null;
|
|
96
|
+
}
|
|
97
|
+
declare const loginSuccess: _reduxjs_toolkit.ActionCreatorWithoutPayload<"AUTHENTICATION_SUCCESS">;
|
|
98
|
+
declare const logoutSuccess: _reduxjs_toolkit.ActionCreatorWithoutPayload<"AUTHENTICATION_LOGOUT">;
|
|
99
|
+
declare const sendAuthenticationError: _reduxjs_toolkit.ActionCreatorWithPreparedPayload<[errorMessage: string], string, "AUTHENTICATION_ERROR", never, never>;
|
|
100
|
+
declare const resetAuthErrors: _reduxjs_toolkit.ActionCreatorWithoutPayload<"AUTHENTICATION_RESET_ERRORS">;
|
|
101
|
+
declare const saveChangePassword: _reduxjs_toolkit.ActionCreatorWithoutPayload<"CHANGE_PASSWORD">;
|
|
102
|
+
declare const authReducer: redux.Reducer<AuthState> & {
|
|
103
|
+
getInitialState: () => AuthState;
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
type RouterLocation = Location<{
|
|
107
|
+
from?: string;
|
|
108
|
+
modal?: boolean;
|
|
109
|
+
}>;
|
|
110
|
+
interface RouterState {
|
|
111
|
+
location: RouterLocation | undefined;
|
|
112
|
+
action: Action | undefined;
|
|
113
|
+
}
|
|
114
|
+
declare const locationChange: _reduxjs_toolkit.ActionCreatorWithPreparedPayload<[location: RouterLocation, action: Action], {
|
|
115
|
+
location: RouterLocation;
|
|
116
|
+
action: Action;
|
|
117
|
+
}, "ROUTER/LOCATION_CHANGE", never, never>;
|
|
118
|
+
declare const routerReducer: redux.Reducer<RouterState> & {
|
|
119
|
+
getInitialState: () => RouterState;
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Create a locale
|
|
124
|
+
*/
|
|
125
|
+
declare class Locale {
|
|
126
|
+
#private;
|
|
127
|
+
[immerable]: boolean;
|
|
128
|
+
constructor(locale: LocaleConfiguration);
|
|
129
|
+
/**
|
|
130
|
+
* Retrieve locale code
|
|
131
|
+
*/
|
|
132
|
+
get code(): string;
|
|
133
|
+
/**
|
|
134
|
+
* Retrieve nativeName
|
|
135
|
+
*/
|
|
136
|
+
get nativeName(): string;
|
|
137
|
+
/**
|
|
138
|
+
* Exported messages from Be Informed have placeholders in the syntax ${placeholder_name}
|
|
139
|
+
* where the ICU messageformat module uses {placeholder_name}.
|
|
140
|
+
* This method converts the ${} to {}
|
|
141
|
+
*/
|
|
142
|
+
fixPlaceHolders(message: string | undefined): string | null;
|
|
143
|
+
/**
|
|
144
|
+
* Exported messages from Be Informed have placeholders in the syntax ${placeholder_name}
|
|
145
|
+
* where the ICU messageformat module uses {placeholder_name}.
|
|
146
|
+
* This method converts the ${} to {}
|
|
147
|
+
*/
|
|
148
|
+
private fixPlaceHoldersInObject;
|
|
149
|
+
/**
|
|
150
|
+
* Retrieve message by id
|
|
151
|
+
*/
|
|
152
|
+
getBaseMessage(id: string, defaultMessage?: string): string;
|
|
153
|
+
/**
|
|
154
|
+
* Format message using formatMessage library
|
|
155
|
+
*/
|
|
156
|
+
formatMessage(message: string, parameters?: MessageParameters): string;
|
|
157
|
+
/**
|
|
158
|
+
* Retrieve a messages with replaced parameters
|
|
159
|
+
*/
|
|
160
|
+
getMessage(id: string, defaultMessage?: string, parameters?: MessageParameters): string;
|
|
161
|
+
/**
|
|
162
|
+
* Add or change messages for this locale. It is not possible to remove messages.
|
|
163
|
+
*/
|
|
164
|
+
update(messages?: Record<string, string>, errors?: Record<string, string>): void;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
type ErrorMessageObject = Record<string, Record<string, string>>;
|
|
168
|
+
interface HydratedLocales {
|
|
169
|
+
collection: {
|
|
170
|
+
code: string;
|
|
171
|
+
messages: Record<string, string>;
|
|
172
|
+
errors: Record<string, string>;
|
|
173
|
+
}[];
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Array of available locales
|
|
177
|
+
* Order of locales is the preferred order of locales.
|
|
178
|
+
* When user has an accept language header that does not correspond to the locales array,
|
|
179
|
+
* the first one is used as the preferred language
|
|
180
|
+
*/
|
|
181
|
+
declare const availableLocales: LocaleConfiguration[];
|
|
182
|
+
/**
|
|
183
|
+
* Merge an object with custom error messages (exported and translated from be informed for example) and merge them with the existing translations.
|
|
184
|
+
*/
|
|
185
|
+
declare const createLocalesWithConfiguredErrors: (configuredErrors: ErrorMessageObject) => LocaleConfiguration[];
|
|
186
|
+
/**
|
|
187
|
+
* Locales, collection of Locale
|
|
188
|
+
*/
|
|
189
|
+
declare class Locales extends BaseCollection<Locale> {
|
|
190
|
+
constructor(locales?: LocaleConfiguration[]);
|
|
191
|
+
/**
|
|
192
|
+
* rehydrate
|
|
193
|
+
*/
|
|
194
|
+
static rehydrate(hydatedLocales: HydratedLocales): Locales;
|
|
195
|
+
/**
|
|
196
|
+
* Check if locale with localeCode exists
|
|
197
|
+
*/
|
|
198
|
+
hasLocale(localeCode: string): boolean;
|
|
199
|
+
/**
|
|
200
|
+
* Retrieve locales by localeCode from Locales collection
|
|
201
|
+
*/
|
|
202
|
+
getLocale(localeCode: string): Locale;
|
|
203
|
+
/**
|
|
204
|
+
* Retrieve all available locale codes
|
|
205
|
+
*/
|
|
206
|
+
get availableLocaleCodes(): string[];
|
|
207
|
+
/**
|
|
208
|
+
* Retrieve preferred locale based on the accept header of a browser
|
|
209
|
+
*/
|
|
210
|
+
getPreferredLocale(acceptLanguageHeader: string | null): string | undefined;
|
|
211
|
+
/**
|
|
212
|
+
* Add or change messages and errors for the given locale.<br>
|
|
213
|
+
* It is not possible to remove messages.
|
|
214
|
+
*/
|
|
215
|
+
update(locale: string, messages?: Record<string, string>, errors?: Record<string, string>): void;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
interface I18nState {
|
|
219
|
+
locales: Locales;
|
|
220
|
+
locale: string;
|
|
221
|
+
}
|
|
222
|
+
declare const receiveLocale: (locale: string) => {
|
|
223
|
+
payload: string;
|
|
224
|
+
type: "UPDATE_LOCALE";
|
|
225
|
+
};
|
|
226
|
+
declare const updateLocale: _reduxjs_toolkit.ActionCreatorWithPreparedPayload<[locale: string], string, "UPDATE_LOCALE", never, never>;
|
|
227
|
+
declare const setLocales: _reduxjs_toolkit.ActionCreatorWithPreparedPayload<[locales: Locales, locale: string], {
|
|
228
|
+
locales: Locales;
|
|
229
|
+
locale: string;
|
|
230
|
+
}, "SET_LOCALES", never, never>;
|
|
231
|
+
declare const i18nReducer: redux.Reducer<I18nState> & {
|
|
232
|
+
getInitialState: () => I18nState;
|
|
233
|
+
};
|
|
234
|
+
|
|
235
|
+
interface ModelEntry {
|
|
236
|
+
status: string;
|
|
237
|
+
model?: ModularUIModel;
|
|
238
|
+
lastModification: number;
|
|
239
|
+
requestOptions?: ModularUIRequestOptions;
|
|
240
|
+
error?: ErrorResponse;
|
|
241
|
+
}
|
|
242
|
+
interface FetchModelPayload {
|
|
243
|
+
key: string;
|
|
244
|
+
href: Href | string;
|
|
245
|
+
options?: ModularUIRequestOptions;
|
|
246
|
+
}
|
|
247
|
+
interface FetchModelResult {
|
|
248
|
+
key: string;
|
|
249
|
+
model: ModularUIModel;
|
|
250
|
+
updateHandler?: UpdateHandler;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
type ModularUIState = Record<string, ModelEntry>;
|
|
254
|
+
declare const modularUIReducer: redux.Reducer<ModularUIState> & {
|
|
255
|
+
getInitialState: () => ModularUIState;
|
|
256
|
+
};
|
|
257
|
+
|
|
258
|
+
type SimplePreferenceValue = null | string | boolean | Record<string, unknown>;
|
|
259
|
+
type PreferenceValue = SimplePreferenceValue | SimplePreferenceValue[];
|
|
260
|
+
|
|
261
|
+
type ThemePropValue = undefined | null | string | number | boolean | string[] | Record<string, Setting$1>;
|
|
262
|
+
type Theme = DefaultTheme;
|
|
263
|
+
interface UtilThemeProps {
|
|
264
|
+
theme: Theme;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
type PreferencesState = Record<string, PreferenceValue> & {
|
|
268
|
+
theme?: Theme;
|
|
269
|
+
};
|
|
270
|
+
declare const setPreference: _reduxjs_toolkit.ActionCreatorWithPreparedPayload<[propertyName: string, propertyValue: PreferenceValue], {
|
|
271
|
+
key: string;
|
|
272
|
+
value: PreferenceValue;
|
|
273
|
+
}, "SET_PREFERENCE", never, never>;
|
|
274
|
+
declare const setPreferences: _reduxjs_toolkit.ActionCreatorWithPreparedPayload<[preferences: Record<string, PreferenceValue>], {
|
|
275
|
+
[x: string]: PreferenceValue;
|
|
276
|
+
}, "SET_PREFERENCES", never, never>;
|
|
277
|
+
declare const preferencesReducer: redux.Reducer<PreferencesState> & {
|
|
278
|
+
getInitialState: () => PreferencesState;
|
|
279
|
+
};
|
|
280
|
+
|
|
281
|
+
type ErrorState = null | ErrorResponse;
|
|
282
|
+
declare const saveError: _reduxjs_toolkit.ActionCreatorWithPreparedPayload<[error: ErrorResponse], ErrorResponse, "SAVE_ERROR", never, never>;
|
|
283
|
+
declare const errorReducer: redux.Reducer<ErrorState> & {
|
|
284
|
+
getInitialState: () => ErrorState;
|
|
285
|
+
};
|
|
286
|
+
|
|
287
|
+
declare const rootReducers: Reducer<{
|
|
288
|
+
router: RouterState;
|
|
289
|
+
preferences: PreferencesState;
|
|
290
|
+
modularui: ModularUIState;
|
|
291
|
+
i18n: I18nState;
|
|
292
|
+
auth: AuthState;
|
|
293
|
+
error: ErrorState;
|
|
294
|
+
modals: ModalsState;
|
|
295
|
+
modelcatalog: ModelCatalogState;
|
|
296
|
+
notification: NotificationState;
|
|
297
|
+
progressindicator: ProgressIndicatorState;
|
|
298
|
+
}, redux.UnknownAction, Partial<{
|
|
299
|
+
router: RouterState | undefined;
|
|
300
|
+
preferences: PreferencesState | undefined;
|
|
301
|
+
modularui: ModularUIState | undefined;
|
|
302
|
+
i18n: I18nState | undefined;
|
|
303
|
+
auth: AuthState | undefined;
|
|
304
|
+
error: ErrorState | undefined;
|
|
305
|
+
modals: ModalsState | undefined;
|
|
306
|
+
modelcatalog: ModelCatalogState | undefined;
|
|
307
|
+
notification: NotificationState | undefined;
|
|
308
|
+
progressindicator: ProgressIndicatorState | undefined;
|
|
309
|
+
}>>;
|
|
310
|
+
declare const setupStore: (preloadedState?: Partial<RootState>, customReducers?: Record<string, Reducer> | null, history?: history.History<unknown>) => _reduxjs_toolkit.EnhancedStore<{
|
|
311
|
+
router: RouterState;
|
|
312
|
+
preferences: PreferencesState;
|
|
313
|
+
modularui: ModularUIState;
|
|
314
|
+
i18n: I18nState;
|
|
315
|
+
auth: AuthState;
|
|
316
|
+
error: ErrorState;
|
|
317
|
+
modals: ModalsState;
|
|
318
|
+
modelcatalog: ModelCatalogState;
|
|
319
|
+
notification: NotificationState;
|
|
320
|
+
progressindicator: ProgressIndicatorState;
|
|
321
|
+
}, redux.UnknownAction, _reduxjs_toolkit.Tuple<[redux.StoreEnhancer<{
|
|
322
|
+
dispatch: _reduxjs_toolkit.ThunkDispatch<{
|
|
323
|
+
router: RouterState;
|
|
324
|
+
preferences: PreferencesState;
|
|
325
|
+
modularui: ModularUIState;
|
|
326
|
+
i18n: I18nState;
|
|
327
|
+
auth: AuthState;
|
|
328
|
+
error: ErrorState;
|
|
329
|
+
modals: ModalsState;
|
|
330
|
+
modelcatalog: ModelCatalogState;
|
|
331
|
+
notification: NotificationState;
|
|
332
|
+
progressindicator: ProgressIndicatorState;
|
|
333
|
+
}, undefined, redux.UnknownAction>;
|
|
334
|
+
}>, redux.StoreEnhancer]>>;
|
|
335
|
+
type BEIStore = ReturnType<typeof setupStore>;
|
|
336
|
+
type RootState = ReturnType<typeof rootReducers>;
|
|
337
|
+
type BEIDispatch = BEIStore["dispatch"];
|
|
338
|
+
|
|
339
|
+
declare module "styled-components" {
|
|
340
|
+
export interface DefaultTheme {
|
|
341
|
+
[key: string]: ThemePropValue;
|
|
342
|
+
settings?: Record<string, Setting>;
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
export { type RootState as $, type AuthState as A, type ModelEntry as B, type FetchModelResult as C, NOTIFICATION_TYPES as D, type ErrorState as E, type FetchModelPayload as F, showNotification as G, dismissNotification as H, type I18nState as I, notificationReducer as J, setPreference as K, Locale as L, type MessageObject as M, type NotificationState as N, setPreferences as O, type PreferencesState as P, preferencesReducer as Q, type PreferenceValue as R, type ShowNotificationArguments as S, type ProgressIndicatorState as T, progressIndicatorReducer as U, type RouterLocation as V, type RouterState as W, locationChange as X, routerReducer as Y, setupStore as Z, type BEIStore as _, availableLocales as a, type BEIDispatch as a0, type ThemePropValue as a1, type Theme as a2, type UtilThemeProps as a3, Locales as b, createLocalesWithConfiguredErrors as c, type LocaleConfiguration as d, logoutSuccess as e, saveChangePassword as f, authReducer as g, saveError as h, errorReducer as i, receiveLocale as j, setLocales as k, loginSuccess as l, i18nReducer as m, type ModalState as n, type ModalsState as o, showModal as p, closeModal as q, resetAuthErrors as r, sendAuthenticationError as s, modalsReducer as t, updateLocale as u, type ModelCatalogState as v, updateEntryDate as w, modelCatalogReducer as x, type ModularUIState as y, modularUIReducer as z };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var Et=Object.create;var D=Object.defineProperty;var Dt=Object.getOwnPropertyDescriptor;var jt=Object.getOwnPropertyNames;var wt=Object.getPrototypeOf,Rt=Object.prototype.hasOwnProperty;var n=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),Nt=(e,r)=>{for(var t in r)D(e,t,{get:r[t],enumerable:!0})},H=(e,r,t,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of jt(r))!Rt.call(e,i)&&i!==t&&D(e,i,{get:()=>r[i],enumerable:!(o=Dt(r,i))||o.enumerable});return e};var T=(e,r,t)=>(t=e!=null?Et(wt(e)):{},H(r||!e||!e.__esModule?D(t,"default",{value:e,enumerable:!0}):t,e)),At=e=>H(D({},"__esModule",{value:!0}),e);var k=n((Ts,B)=>{"use strict";function Ft(e,r){for(var t=-1,o=r.length,i=e.length;++t<o;)e[i+t]=r[t];return e}B.exports=Ft});var K=n((ys,Y)=>{"use strict";var $t=typeof global=="object"&&global&&global.Object===Object&&global;Y.exports=$t});var j=n((bs,J)=>{"use strict";var Gt=K(),Ut=typeof self=="object"&&self&&self.Object===Object&&self,Lt=Gt||Ut||Function("return this")();J.exports=Lt});var y=n((vs,Q)=>{"use strict";var zt=j(),Mt=zt.Symbol;Q.exports=Mt});var ee=n((Ps,Z)=>{"use strict";var W=y(),X=Object.prototype,Vt=X.hasOwnProperty,Ht=X.toString,b=W?W.toStringTag:void 0;function Bt(e){var r=Vt.call(e,b),t=e[b];try{e[b]=void 0;var o=!0}catch{}var i=Ht.call(e);return o&&(r?e[b]=t:delete e[b]),i}Z.exports=Bt});var te=n((xs,re)=>{"use strict";var kt=Object.prototype,Yt=kt.toString;function Kt(e){return Yt.call(e)}re.exports=Kt});var v=n((Ss,ie)=>{"use strict";var oe=y(),Jt=ee(),Qt=te(),Wt="[object Null]",Xt="[object Undefined]",ne=oe?oe.toStringTag:void 0;function Zt(e){return e==null?e===void 0?Xt:Wt:ne&&ne in Object(e)?Jt(e):Qt(e)}ie.exports=Zt});var P=n((_s,se)=>{"use strict";function eo(e){return e!=null&&typeof e=="object"}se.exports=eo});var pe=n((Cs,ae)=>{"use strict";var ro=v(),to=P(),oo="[object Arguments]";function no(e){return to(e)&&ro(e)==oo}ae.exports=no});var le=n((qs,fe)=>{"use strict";var ue=pe(),io=P(),ce=Object.prototype,so=ce.hasOwnProperty,ao=ce.propertyIsEnumerable,po=ue(function(){return arguments}())?ue:function(e){return io(e)&&so.call(e,"callee")&&!ao.call(e,"callee")};fe.exports=po});var x=n((Os,me)=>{"use strict";var uo=Array.isArray;me.exports=uo});var Te=n((Is,de)=>{"use strict";var he=y(),co=le(),fo=x(),ge=he?he.isConcatSpreadable:void 0;function lo(e){return fo(e)||co(e)||!!(ge&&e&&e[ge])}de.exports=lo});var ve=n((Es,be)=>{"use strict";var mo=k(),ho=Te();function ye(e,r,t,o,i){var s=-1,a=e.length;for(t||(t=ho),i||(i=[]);++s<a;){var p=e[s];r>0&&t(p)?r>1?ye(p,r-1,t,o,i):mo(i,p):o||(i[i.length]=p)}return i}be.exports=ye});var xe=n((Ds,Pe)=>{"use strict";var go=ve(),To=1/0;function yo(e){var r=e==null?0:e.length;return r?go(e,To):[]}Pe.exports=yo});var _e=n((js,Se)=>{"use strict";function bo(e,r){return function(t){return e(r(t))}}Se.exports=bo});var qe=n((ws,Ce)=>{"use strict";var vo=_e(),Po=vo(Object.getPrototypeOf,Object);Ce.exports=Po});var A=n((Rs,Ie)=>{"use strict";var xo=v(),So=qe(),_o=P(),Co="[object Object]",qo=Function.prototype,Oo=Object.prototype,Oe=qo.toString,Io=Oo.hasOwnProperty,Eo=Oe.call(Object);function Do(e){if(!_o(e)||xo(e)!=Co)return!1;var r=So(e);if(r===null)return!0;var t=Io.call(r,"constructor")&&r.constructor;return typeof t=="function"&&t instanceof t&&Oe.call(t)==Eo}Ie.exports=Do});var w=n((Ks,Ve)=>{"use strict";var Ao=v(),Fo=P(),$o="[object Symbol]";function Go(e){return typeof e=="symbol"||Fo(e)&&Ao(e)==$o}Ve.exports=Go});var Be=n((Js,He)=>{"use strict";var Uo=x(),Lo=w(),zo=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Mo=/^\w*$/;function Vo(e,r){if(Uo(e))return!1;var t=typeof e;return t=="number"||t=="symbol"||t=="boolean"||e==null||Lo(e)?!0:Mo.test(e)||!zo.test(e)||r!=null&&e in Object(r)}He.exports=Vo});var G=n((Qs,ke)=>{"use strict";function Ho(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}ke.exports=Ho});var Ke=n((Ws,Ye)=>{"use strict";var Bo=v(),ko=G(),Yo="[object AsyncFunction]",Ko="[object Function]",Jo="[object GeneratorFunction]",Qo="[object Proxy]";function Wo(e){if(!ko(e))return!1;var r=Bo(e);return r==Ko||r==Jo||r==Yo||r==Qo}Ye.exports=Wo});var Qe=n((Xs,Je)=>{"use strict";var Xo=j(),Zo=Xo["__core-js_shared__"];Je.exports=Zo});var Ze=n((Zs,Xe)=>{"use strict";var U=Qe(),We=function(){var e=/[^.]+$/.exec(U&&U.keys&&U.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function en(e){return!!We&&We in e}Xe.exports=en});var rr=n((ea,er)=>{"use strict";var rn=Function.prototype,tn=rn.toString;function on(e){if(e!=null){try{return tn.call(e)}catch{}try{return e+""}catch{}}return""}er.exports=on});var or=n((ra,tr)=>{"use strict";var nn=Ke(),sn=Ze(),an=G(),pn=rr(),un=/[\\^$.*+?()[\]{}|]/g,cn=/^\[object .+?Constructor\]$/,fn=Function.prototype,ln=Object.prototype,mn=fn.toString,hn=ln.hasOwnProperty,gn=RegExp("^"+mn.call(hn).replace(un,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function dn(e){if(!an(e)||sn(e))return!1;var r=nn(e)?gn:cn;return r.test(pn(e))}tr.exports=dn});var ir=n((ta,nr)=>{"use strict";function Tn(e,r){return e?.[r]}nr.exports=Tn});var L=n((oa,sr)=>{"use strict";var yn=or(),bn=ir();function vn(e,r){var t=bn(e,r);return yn(t)?t:void 0}sr.exports=vn});var q=n((na,ar)=>{"use strict";var Pn=L(),xn=Pn(Object,"create");ar.exports=xn});var cr=n((ia,ur)=>{"use strict";var pr=q();function Sn(){this.__data__=pr?pr(null):{},this.size=0}ur.exports=Sn});var lr=n((sa,fr)=>{"use strict";function _n(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}fr.exports=_n});var hr=n((aa,mr)=>{"use strict";var Cn=q(),qn="__lodash_hash_undefined__",On=Object.prototype,In=On.hasOwnProperty;function En(e){var r=this.__data__;if(Cn){var t=r[e];return t===qn?void 0:t}return In.call(r,e)?r[e]:void 0}mr.exports=En});var dr=n((pa,gr)=>{"use strict";var Dn=q(),jn=Object.prototype,wn=jn.hasOwnProperty;function Rn(e){var r=this.__data__;return Dn?r[e]!==void 0:wn.call(r,e)}gr.exports=Rn});var yr=n((ua,Tr)=>{"use strict";var Nn=q(),An="__lodash_hash_undefined__";function Fn(e,r){var t=this.__data__;return this.size+=this.has(e)?0:1,t[e]=Nn&&r===void 0?An:r,this}Tr.exports=Fn});var vr=n((ca,br)=>{"use strict";var $n=cr(),Gn=lr(),Un=hr(),Ln=dr(),zn=yr();function m(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var o=e[r];this.set(o[0],o[1])}}m.prototype.clear=$n;m.prototype.delete=Gn;m.prototype.get=Un;m.prototype.has=Ln;m.prototype.set=zn;br.exports=m});var xr=n((fa,Pr)=>{"use strict";function Mn(){this.__data__=[],this.size=0}Pr.exports=Mn});var _r=n((la,Sr)=>{"use strict";function Vn(e,r){return e===r||e!==e&&r!==r}Sr.exports=Vn});var O=n((ma,Cr)=>{"use strict";var Hn=_r();function Bn(e,r){for(var t=e.length;t--;)if(Hn(e[t][0],r))return t;return-1}Cr.exports=Bn});var Or=n((ha,qr)=>{"use strict";var kn=O(),Yn=Array.prototype,Kn=Yn.splice;function Jn(e){var r=this.__data__,t=kn(r,e);if(t<0)return!1;var o=r.length-1;return t==o?r.pop():Kn.call(r,t,1),--this.size,!0}qr.exports=Jn});var Er=n((ga,Ir)=>{"use strict";var Qn=O();function Wn(e){var r=this.__data__,t=Qn(r,e);return t<0?void 0:r[t][1]}Ir.exports=Wn});var jr=n((da,Dr)=>{"use strict";var Xn=O();function Zn(e){return Xn(this.__data__,e)>-1}Dr.exports=Zn});var Rr=n((Ta,wr)=>{"use strict";var ei=O();function ri(e,r){var t=this.__data__,o=ei(t,e);return o<0?(++this.size,t.push([e,r])):t[o][1]=r,this}wr.exports=ri});var Ar=n((ya,Nr)=>{"use strict";var ti=xr(),oi=Or(),ni=Er(),ii=jr(),si=Rr();function h(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var o=e[r];this.set(o[0],o[1])}}h.prototype.clear=ti;h.prototype.delete=oi;h.prototype.get=ni;h.prototype.has=ii;h.prototype.set=si;Nr.exports=h});var $r=n((ba,Fr)=>{"use strict";var ai=L(),pi=j(),ui=ai(pi,"Map");Fr.exports=ui});var Lr=n((va,Ur)=>{"use strict";var Gr=vr(),ci=Ar(),fi=$r();function li(){this.size=0,this.__data__={hash:new Gr,map:new(fi||ci),string:new Gr}}Ur.exports=li});var Mr=n((Pa,zr)=>{"use strict";function mi(e){var r=typeof e;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?e!=="__proto__":e===null}zr.exports=mi});var I=n((xa,Vr)=>{"use strict";var hi=Mr();function gi(e,r){var t=e.__data__;return hi(r)?t[typeof r=="string"?"string":"hash"]:t.map}Vr.exports=gi});var Br=n((Sa,Hr)=>{"use strict";var di=I();function Ti(e){var r=di(this,e).delete(e);return this.size-=r?1:0,r}Hr.exports=Ti});var Yr=n((_a,kr)=>{"use strict";var yi=I();function bi(e){return yi(this,e).get(e)}kr.exports=bi});var Jr=n((Ca,Kr)=>{"use strict";var vi=I();function Pi(e){return vi(this,e).has(e)}Kr.exports=Pi});var Wr=n((qa,Qr)=>{"use strict";var xi=I();function Si(e,r){var t=xi(this,e),o=t.size;return t.set(e,r),this.size+=t.size==o?0:1,this}Qr.exports=Si});var Zr=n((Oa,Xr)=>{"use strict";var _i=Lr(),Ci=Br(),qi=Yr(),Oi=Jr(),Ii=Wr();function g(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var o=e[r];this.set(o[0],o[1])}}g.prototype.clear=_i;g.prototype.delete=Ci;g.prototype.get=qi;g.prototype.has=Oi;g.prototype.set=Ii;Xr.exports=g});var tt=n((Ia,rt)=>{"use strict";var et=Zr(),Ei="Expected a function";function z(e,r){if(typeof e!="function"||r!=null&&typeof r!="function")throw new TypeError(Ei);var t=function(){var o=arguments,i=r?r.apply(this,o):o[0],s=t.cache;if(s.has(i))return s.get(i);var a=e.apply(this,o);return t.cache=s.set(i,a)||s,a};return t.cache=new(z.Cache||et),t}z.Cache=et;rt.exports=z});var nt=n((Ea,ot)=>{"use strict";var Di=tt(),ji=500;function wi(e){var r=Di(e,function(o){return t.size===ji&&t.clear(),o}),t=r.cache;return r}ot.exports=wi});var st=n((Da,it)=>{"use strict";var Ri=nt(),Ni=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ai=/\\(\\)?/g,Fi=Ri(function(e){var r=[];return e.charCodeAt(0)===46&&r.push(""),e.replace(Ni,function(t,o,i,s){r.push(i?s.replace(Ai,"$1"):o||t)}),r});it.exports=Fi});var pt=n((ja,at)=>{"use strict";function $i(e,r){for(var t=-1,o=e==null?0:e.length,i=Array(o);++t<o;)i[t]=r(e[t],t,e);return i}at.exports=$i});var ht=n((wa,mt)=>{"use strict";var ut=y(),Gi=pt(),Ui=x(),Li=w(),zi=1/0,ct=ut?ut.prototype:void 0,ft=ct?ct.toString:void 0;function lt(e){if(typeof e=="string")return e;if(Ui(e))return Gi(e,lt)+"";if(Li(e))return ft?ft.call(e):"";var r=e+"";return r=="0"&&1/e==-zi?"-0":r}mt.exports=lt});var dt=n((Ra,gt)=>{"use strict";var Mi=ht();function Vi(e){return e==null?"":Mi(e)}gt.exports=Vi});var yt=n((Na,Tt)=>{"use strict";var Hi=x(),Bi=Be(),ki=st(),Yi=dt();function Ki(e,r){return Hi(e)?e:Bi(e,r)?[e]:ki(Yi(e))}Tt.exports=Ki});var vt=n((Aa,bt)=>{"use strict";var Ji=w(),Qi=1/0;function Wi(e){if(typeof e=="string"||Ji(e))return e;var r=e+"";return r=="0"&&1/e==-Qi?"-0":r}bt.exports=Wi});var xt=n((Fa,Pt)=>{"use strict";var Xi=yt(),Zi=vt();function es(e,r){r=Xi(r,e);for(var t=0,o=r.length;e!=null&&t<o;)e=e[Zi(r[t++])];return t&&t==o?e:void 0}Pt.exports=es});var _t=n(($a,St)=>{"use strict";var rs=xt();function ts(e,r,t){var o=e==null?void 0:rs(e,r);return o===void 0?t:o}St.exports=ts});var gs={};Nt(gs,{ThemeProvider:()=>Ue,changeHSL:()=>ps,createTheme:()=>F,darkenColor:()=>ss,getColorContrast:()=>R,getContrastYIQ:()=>qt,getProp:()=>d,getThemeNumberProp:()=>os,getThemeProp:()=>c,getThemeStringProp:()=>f,getYIQ:()=>N,gutter:()=>hs,lightenColor:()=>as,renderBackground:()=>is,renderContrastColor:()=>cs,roundedCorners:()=>fs,setConfigurationTheme:()=>Ro,spacer:()=>ls,spacers:()=>ms,themeProp:()=>ns,useTheme:()=>No});module.exports=At(gs);var De=require("@beinformed/ui/settings"),je=T(xe(),1),we=T(A(),1),Ee=e=>{let r=Object.keys(e).map(o=>`\\b${o}\\b`).join("|"),t=new RegExp(`\\$(${r})`,"g");return Object.entries(e).forEach(([o,i])=>{o!=="settings"&&typeof i=="string"&&(e[o]=i.replace(t,(s,a)=>{let p=e[a];return typeof p=="string"?p:s}))}),e},jo=(e,...r)=>{let t=e?.settings??{},o={settings:{}};for(let i of r)if(typeof i=="function")o=i(Ee(o));else if((0,we.default)(i)){let s=o.settings??{};o={...o,...i,...e},"settings"in i&&typeof i.settings=="object"&&(o.settings={...s,...i.settings,...t})}return Ee(o)},F=(e,...r)=>{let t=(0,je.default)(r).filter(i=>i!=null),o=jo(e,...t);return o?.settings&&(0,De.setSettings)(o.settings),o};var _=require("@beinformed/ui/constants"),Ne=require("@beinformed/ui/exceptions"),C=require("@beinformed/ui/settings"),Ae=T(A(),1);var S=require("@reduxjs/toolkit"),$=(0,S.createAction)("SET_PREFERENCE",(e,r)=>({payload:{key:e,value:r}})),Re=(0,S.createAction)("SET_PREFERENCES",e=>({payload:{...e}})),wo={},As=(0,S.createReducer)(wo,e=>{e.addCase($,(r,t)=>{let{key:o,value:i}=t.payload;r[o]=i}).addCase(Re,(r,t)=>{for(let o of Object.keys(t.payload))r[o]=t.payload[o]})});var Fe=e=>{let r;try{r=e?JSON.parse(e):null}catch(t){throw new Ne.JsonParseException(`Theme file contains invalid JSON: ${t}`)}return r&&(0,Ae.default)(r)&&(0,C.setSettings)(r.settings),$("theme",r)};var Ro=e=>{let r=null,t=preferencesProvider.getLayoutConfigFileLocation();if(typeof t=="string"){let o=t.startsWith("/")?`/resource${t}`:`/resource/${t}`;if(r=dataFetcher.fetch(o),r)e.dispatch(Fe(r));else throw new Error(`Could not read theme configuration file from: ${o}`)}};var Ge=require("styled-components");var l=require("react-redux"),zs=l.useDispatch.withTypes(),$e=l.useSelector.withTypes(),Ms=l.useStore.withTypes();var Le=require("react/jsx-runtime"),Ue=({theme:e,children:r})=>{let t=$e(i=>i.preferences.theme),o=F(t,e);return(0,Le.jsx)(Ge.ThemeProvider,{theme:o,children:r})};Ue.displayName="BI.ThemeProvider";var ze=require("react"),Me=require("styled-components"),No=()=>(0,ze.useContext)(Me.ThemeContext);var Ct=T(_t(),1),d=(e={},r="",t="")=>{if(r==="")return t;let o=(0,Ct.default)(e,r,t);return o||t},c=(e={},r="",t="")=>{let o=d(e,r,t);if(o!=null&&(typeof o=="string"||typeof o=="number"||typeof o=="object"))return o;throw new Error(`${r} is not a string, number or plain object, but: ${o===null?"nuLl":typeof o}`)},f=(e={},r="",t="")=>{let o=d(e,r,t);if(typeof o=="string")return o;if(typeof o=="number")return o.toString();throw new Error(`${r} is not a string, but: ${typeof o}`)},os=(e={},r="",t=0)=>{let o=d(e,r,t);if(typeof o=="number")return o;throw new Error(`${r} is not a number, but: ${typeof o}`)},ns=(e,r)=>({theme:t})=>c(t,e,r);var is=(e,r)=>({theme:t})=>{let o=c(t,e,r);return typeof o=="string"?`background: ${o}`:o};var u=require("polished");var ss=(e="",r,t)=>({theme:o})=>(0,u.darken)(e,String(c(o,r,t))),as=(e="",r,t)=>({theme:o})=>(0,u.lighten)(e,String(c(o,r,t))),ps=(e,r,t,o=0)=>(0,u.hsl)((0,u.parseToHsl)(e).hue+o,r,t);var E=require("polished");var R=(e,r)=>{let t=(0,E.getLuminance)(e),o=(0,E.getLuminance)(r);return parseFloat((t>o?(t+.05)/(o+.05):(o+.05)/(t+.05)).toFixed(2))},N=e=>{let r=(0,E.parseToRgb)(e);return(r.red*299+r.green*587+r.blue*114)/1e3},qt=(e,r="#212529",t="#fff",o)=>{if(typeof e!="string")throw new Error("ContrastYIQ needs a string to retrieve color, received: "+e);let i=N(e);if(o&&R(e,o)>=4.5)return o;let s=N(r)<127.5?r:"#212529",a=N(t)>127.5?t:"#fff";return i>127.5?R(e,s)<3?"#212529":s:R(e,a)<3?"#fff":a},us=(e,r,t)=>{let o=d(e,r,t);if(typeof o=="object"&&o!=null&&"backgroundColor"in o){let{backgroundColor:i}=o;if(typeof i=="string")return i}return typeof o=="string"?o:t},cs=(e="",r,t="YIQ_DARK_COLOR",o="YIQ_LIGHT_COLOR")=>({theme:i})=>{let s=us(i,e,"#ffffff"),a=f(i,r),p=f(i,t,"#212529"),It=f(i,o,"#fff");return qt(s,p,It,a)};var M="border-radius",fs=(e=M,r="BORDER_RADIUS",t="0.25rem")=>({theme:o})=>o.ROUNDED_CORNERS?`${e&&e!==M?`border-${e}-radius`:M}: ${f(o,r,t)}`:"";var Ot=T(require("big.js"),1),V=(e,r=1,t="SPACER",o="rem")=>{if(typeof r=="string")return r;if(typeof r=="number"){if(typeof e[t]=="number")return`${(0,Ot.default)(r).times(e[t])}${o}`;throw new Error(`Size ${t} must be a number`)}throw new Error(`Ratio ${JSON.stringify(r)} must be a string or number`)},ls=(e=1)=>({theme:r})=>V(r,e),ms=(...e)=>({theme:r})=>e.map(t=>V(r,t)).join(" "),hs=(e=1)=>({theme:r})=>V(r,e,"GRID_GUTTER","px");0&&(module.exports={ThemeProvider,changeHSL,createTheme,darkenColor,getColorContrast,getContrastYIQ,getProp,getThemeNumberProp,getThemeProp,getThemeStringProp,getYIQ,gutter,lightenColor,renderBackground,renderContrastColor,roundedCorners,setConfigurationTheme,spacer,spacers,themeProp,useTheme});
|
|
2
|
+
//# sourceMappingURL=index.cjs.map
|