@deix/rossini-core 0.1.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/README.md +3 -0
- package/lib/package.json +73 -0
- package/lib/src/components/buttons/Avatar/Avatar.d.ts +8 -0
- package/lib/src/components/buttons/Avatar/Avatar.d.ts.map +1 -0
- package/lib/src/components/buttons/Avatar/Avatar.js +52 -0
- package/lib/src/components/buttons/LanguageSelect/LanguageSelect.d.ts +16 -0
- package/lib/src/components/buttons/LanguageSelect/LanguageSelect.d.ts.map +1 -0
- package/lib/src/components/buttons/LanguageSelect/LanguageSelect.js +52 -0
- package/lib/src/components/buttons/LanguageSelect/translations.json +9 -0
- package/lib/src/components/buttons/ToggleButtonGroup/ToggleButtonGroup.d.ts +41 -0
- package/lib/src/components/buttons/ToggleButtonGroup/ToggleButtonGroup.d.ts.map +1 -0
- package/lib/src/components/buttons/ToggleButtonGroup/ToggleButtonGroup.js +20 -0
- package/lib/src/components/buttons/index.d.ts +4 -0
- package/lib/src/components/buttons/index.d.ts.map +1 -0
- package/lib/src/components/buttons/index.js +3 -0
- package/lib/src/components/layout/MinimalLayout/MinimalLayout.d.ts +12 -0
- package/lib/src/components/layout/MinimalLayout/MinimalLayout.d.ts.map +1 -0
- package/lib/src/components/layout/MinimalLayout/MinimalLayout.js +57 -0
- package/lib/src/components/layout/MinimalLayout/translations.json +8 -0
- package/lib/src/components/layout/StandardLayout/StandardLayout.d.ts +16 -0
- package/lib/src/components/layout/StandardLayout/StandardLayout.d.ts.map +1 -0
- package/lib/src/components/layout/StandardLayout/StandardLayout.js +67 -0
- package/lib/src/components/layout/StandardLayout/translations.json +8 -0
- package/lib/src/components/layout/components/AppLogo/AppLogo.d.ts +19 -0
- package/lib/src/components/layout/components/AppLogo/AppLogo.d.ts.map +1 -0
- package/lib/src/components/layout/components/AppLogo/AppLogo.js +25 -0
- package/lib/src/components/layout/components/Footer/Footer.d.ts +27 -0
- package/lib/src/components/layout/components/Footer/Footer.d.ts.map +1 -0
- package/lib/src/components/layout/components/Footer/Footer.js +100 -0
- package/lib/src/components/layout/components/Sidebar/Sidebar.d.ts +23 -0
- package/lib/src/components/layout/components/Sidebar/Sidebar.d.ts.map +1 -0
- package/lib/src/components/layout/components/Sidebar/Sidebar.js +206 -0
- package/lib/src/components/layout/components/Topbar/ElevationScroll.d.ts +7 -0
- package/lib/src/components/layout/components/Topbar/ElevationScroll.d.ts.map +1 -0
- package/lib/src/components/layout/components/Topbar/ElevationScroll.js +13 -0
- package/lib/src/components/layout/components/Topbar/Topbar.d.ts +13 -0
- package/lib/src/components/layout/components/Topbar/Topbar.d.ts.map +1 -0
- package/lib/src/components/layout/components/Topbar/Topbar.js +46 -0
- package/lib/src/components/layout/components/Topbar/Topbar.styles.d.ts +18 -0
- package/lib/src/components/layout/components/Topbar/Topbar.styles.d.ts.map +1 -0
- package/lib/src/components/layout/components/Topbar/Topbar.styles.js +8 -0
- package/lib/src/components/layout/components/Topbar/translations.json +26 -0
- package/lib/src/components/layout/components/Topline/TopLine.d.ts +4 -0
- package/lib/src/components/layout/components/Topline/TopLine.d.ts.map +1 -0
- package/lib/src/components/layout/components/Topline/TopLine.js +13 -0
- package/lib/src/components/layout/index.d.ts +3 -0
- package/lib/src/components/layout/index.d.ts.map +1 -0
- package/lib/src/components/layout/index.js +2 -0
- package/lib/src/components/progress/CircularLoading/CircularLoading.d.ts +8 -0
- package/lib/src/components/progress/CircularLoading/CircularLoading.d.ts.map +1 -0
- package/lib/src/components/progress/CircularLoading/CircularLoading.js +16 -0
- package/lib/src/components/progress/CircularLoading/translations.json +8 -0
- package/lib/src/components/progress/DotWaveLoading/DotWaveLoading.d.ts +8 -0
- package/lib/src/components/progress/DotWaveLoading/DotWaveLoading.d.ts.map +1 -0
- package/lib/src/components/progress/DotWaveLoading/DotWaveLoading.js +18 -0
- package/lib/src/components/progress/DotWaveLoading/translations.json +8 -0
- package/lib/src/components/progress/index.d.ts +3 -0
- package/lib/src/components/progress/index.d.ts.map +1 -0
- package/lib/src/components/progress/index.js +2 -0
- package/lib/src/types/api.d.ts +16 -0
- package/lib/src/types/api.d.ts.map +1 -0
- package/lib/src/types/api.js +1 -0
- package/lib/src/types/languages.d.ts +12 -0
- package/lib/src/types/languages.d.ts.map +1 -0
- package/lib/src/types/languages.js +3 -0
- package/lib/src/types/palette.d.ts +16 -0
- package/lib/src/types/palette.d.ts.map +1 -0
- package/lib/src/types/palette.js +1 -0
- package/lib/src/utils/hooks/useAPI.d.ts +3 -0
- package/lib/src/utils/hooks/useAPI.d.ts.map +1 -0
- package/lib/src/utils/hooks/useAPI.js +9 -0
- package/lib/src/utils/hooks/useKeycloak.d.ts +8 -0
- package/lib/src/utils/hooks/useKeycloak.d.ts.map +1 -0
- package/lib/src/utils/hooks/useKeycloak.js +69 -0
- package/lib/src/utils/hooks/useLocale.d.ts +3 -0
- package/lib/src/utils/hooks/useLocale.d.ts.map +1 -0
- package/lib/src/utils/hooks/useLocale.js +6 -0
- package/lib/src/utils/hooks/usePersistedState.d.ts +2 -0
- package/lib/src/utils/hooks/usePersistedState.d.ts.map +1 -0
- package/lib/src/utils/hooks/usePersistedState.js +27 -0
- package/lib/tsconfig-lib.tsbuildinfo +1 -0
- package/package.json +73 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/progress/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAC/E,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,iCAAiC,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { AxiosRequestConfig } from 'axios';
|
|
2
|
+
export interface Query {
|
|
3
|
+
url: string;
|
|
4
|
+
config?: AxiosRequestConfig;
|
|
5
|
+
}
|
|
6
|
+
export interface DBRow {
|
|
7
|
+
[key: string]: string | number | unknown;
|
|
8
|
+
}
|
|
9
|
+
export type DBRows = Array<DBRow>;
|
|
10
|
+
export interface PaginatedResponse {
|
|
11
|
+
offset: number;
|
|
12
|
+
limit: number;
|
|
13
|
+
total: number;
|
|
14
|
+
items: DBRows;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../src/types/api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,OAAO,CAAC;AAE3C,MAAM,WAAW,KAAK;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,kBAAkB,CAAC;CAC7B;AAED,MAAM,WAAW,KAAK;IACpB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;CAC1C;AACD,MAAM,MAAM,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC;AAClC,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type Locale = 'en' | 'de' | 'fr' | 'it';
|
|
2
|
+
export type StringTranslation = {
|
|
3
|
+
[key in Locale]?: string;
|
|
4
|
+
};
|
|
5
|
+
export interface Language {
|
|
6
|
+
id: Locale;
|
|
7
|
+
label: string;
|
|
8
|
+
countryCode: string;
|
|
9
|
+
MUILocale: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const isStringTranslation: (value: unknown) => value is StringTranslation;
|
|
12
|
+
//# sourceMappingURL=languages.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"languages.d.ts","sourceRoot":"","sources":["../../../src/types/languages.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE/C,MAAM,MAAM,iBAAiB,GAAG;KAC7B,GAAG,IAAI,MAAM,CAAC,CAAC,EAAE,MAAM;CACzB,CAAC;AAEF,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,mBAAmB,UACvB,OAAO,+BAGf,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
declare module '@mui/material/styles/createPalette' {
|
|
2
|
+
interface Palette {
|
|
3
|
+
gradient: SimplePaletteColorOptions;
|
|
4
|
+
linkNotActive: SimplePaletteColorOptions;
|
|
5
|
+
sidebar: SimplePaletteColorOptions;
|
|
6
|
+
topbar: SimplePaletteColorOptions;
|
|
7
|
+
}
|
|
8
|
+
interface PaletteOptions {
|
|
9
|
+
gradient: SimplePaletteColorOptions;
|
|
10
|
+
linkNotActive: SimplePaletteColorOptions;
|
|
11
|
+
sidebar: SimplePaletteColorOptions;
|
|
12
|
+
topbar: SimplePaletteColorOptions;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=palette.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"palette.d.ts","sourceRoot":"","sources":["../../../src/types/palette.ts"],"names":[],"mappings":"AACA,OAAO,QAAQ,oCAAoC,CAAC;IAClD,UAAU,OAAO;QACf,QAAQ,EAAE,yBAAyB,CAAC;QACpC,aAAa,EAAE,yBAAyB,CAAC;QACzC,OAAO,EAAE,yBAAyB,CAAC;QACnC,MAAM,EAAE,yBAAyB,CAAC;KACnC;IACD,UAAU,cAAc;QACtB,QAAQ,EAAE,yBAAyB,CAAC;QACpC,aAAa,EAAE,yBAAyB,CAAC;QACzC,OAAO,EAAE,yBAAyB,CAAC;QACnC,MAAM,EAAE,yBAAyB,CAAC;KACnC;CACF;AAED,OAAO,EAAG,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAPI.d.ts","sourceRoot":"","sources":["../../../../src/utils/hooks/useAPI.ts"],"names":[],"mappings":"AAAA,OAAc,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE7C,eAAO,MAAM,MAAM,aAAc,MAAM,KAAG,aAMtC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AxiosInstance } from 'axios';
|
|
2
|
+
export interface UserInfo {
|
|
3
|
+
email: string;
|
|
4
|
+
user: string;
|
|
5
|
+
preferredUserName: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const useUserInfo: (apiClient: AxiosInstance) => import("react-query").UseQueryResult<UserInfo, unknown>;
|
|
8
|
+
//# sourceMappingURL=useKeycloak.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useKeycloak.d.ts","sourceRoot":"","sources":["../../../../src/utils/hooks/useKeycloak.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAGtC,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAqBD,eAAO,MAAM,WAAW,cAAe,aAAa,4DAKhD,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
12
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
+
function step(op) {
|
|
15
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
17
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
+
switch (op[0]) {
|
|
20
|
+
case 0: case 1: t = op; break;
|
|
21
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
+
default:
|
|
25
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
+
if (t[2]) _.ops.pop();
|
|
30
|
+
_.trys.pop(); continue;
|
|
31
|
+
}
|
|
32
|
+
op = body.call(thisArg, _);
|
|
33
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
import { useQuery } from 'react-query';
|
|
38
|
+
var getUserInfo = function (apiClient) { return __awaiter(void 0, void 0, void 0, function () {
|
|
39
|
+
var fetch;
|
|
40
|
+
return __generator(this, function (_a) {
|
|
41
|
+
switch (_a.label) {
|
|
42
|
+
case 0:
|
|
43
|
+
fetch = apiClient
|
|
44
|
+
.get('oauth2/userinfo')
|
|
45
|
+
.then(function (result) {
|
|
46
|
+
console.log('User Info', result.data);
|
|
47
|
+
return result.data;
|
|
48
|
+
})
|
|
49
|
+
.catch(function (err) {
|
|
50
|
+
console.error('Could not get user info');
|
|
51
|
+
console.error(err);
|
|
52
|
+
return {
|
|
53
|
+
email: '',
|
|
54
|
+
user: 'anonymous',
|
|
55
|
+
preferredUserName: 'anonymous',
|
|
56
|
+
};
|
|
57
|
+
});
|
|
58
|
+
return [4 /*yield*/, fetch];
|
|
59
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
}); };
|
|
63
|
+
export var useUserInfo = function (apiClient) {
|
|
64
|
+
return useQuery('user-info', function () { return getUserInfo(apiClient); }, {
|
|
65
|
+
keepPreviousData: true,
|
|
66
|
+
staleTime: Infinity,
|
|
67
|
+
cacheTime: Infinity,
|
|
68
|
+
});
|
|
69
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useLocale.d.ts","sourceRoot":"","sources":["../../../../src/utils/hooks/useLocale.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,eAAO,MAAM,SAAS,QAAO,MAK5B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePersistedState.d.ts","sourceRoot":"","sources":["../../../../src/utils/hooks/usePersistedState.ts"],"names":[],"mappings":"AAEA,wBAAgB,iBAAiB,CAAC,CAAC,EACjC,IAAI,EAAE,MAAM,EACZ,YAAY,EAAE,CAAC,GACd,CAAC,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC,CAyBzB"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
export function usePersistedState(name, defaultValue) {
|
|
3
|
+
var _a = useState(function () {
|
|
4
|
+
try {
|
|
5
|
+
var value_1 = window.localStorage.getItem(name);
|
|
6
|
+
if (value_1) {
|
|
7
|
+
return JSON.parse(value_1);
|
|
8
|
+
}
|
|
9
|
+
else {
|
|
10
|
+
window.localStorage.setItem(name, JSON.stringify(defaultValue));
|
|
11
|
+
return defaultValue;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
catch (err) {
|
|
15
|
+
return defaultValue;
|
|
16
|
+
}
|
|
17
|
+
}), value = _a[0], setValue = _a[1];
|
|
18
|
+
useEffect(function () {
|
|
19
|
+
try {
|
|
20
|
+
window.localStorage.setItem(name, JSON.stringify(value));
|
|
21
|
+
}
|
|
22
|
+
catch (err) {
|
|
23
|
+
console.error(err);
|
|
24
|
+
}
|
|
25
|
+
}, [value]);
|
|
26
|
+
return [value, setValue];
|
|
27
|
+
}
|