@natoora-libs/core 0.1.7 → 0.1.8-dev-doug-1

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.
@@ -1,66 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
-
19
- // src/hooks/index.ts
20
- var hooks_exports = {};
21
- __export(hooks_exports, {
22
- useCheckPermissionToAccess: () => useCheckPermissionToAccess_default
23
- });
24
- module.exports = __toCommonJS(hooks_exports);
25
-
26
- // src/components/LeftDrawer/helpers/featuresAreEnabled.tsx
27
- function featuresAreEnabled(featureSettings, features, requireAll = true) {
28
- const storedPermissions = localStorage.getItem("permissions") || [];
29
- let enabled = false;
30
- if (requireAll) {
31
- enabled = features.every(
32
- (feature) => featureSettings.enabled_features.includes(feature) && // @ts-ignore
33
- storedPermissions.includes(`${feature}_read`)
34
- );
35
- } else {
36
- enabled = features.some(
37
- (feature) => featureSettings.enabled_features.includes(feature) && // @ts-ignore
38
- storedPermissions.includes(`${feature}_read`)
39
- );
40
- }
41
- return enabled;
42
- }
43
- var featuresAreEnabled_default = featuresAreEnabled;
44
-
45
- // src/hooks/useCheckPermissionToAccess/useCheckPermissionToAccess.ts
46
- var useCheckPermissionToAccess = ({
47
- featureSettings,
48
- pageName,
49
- requireAll = false
50
- }) => {
51
- let hasPermission = false;
52
- if (featuresAreEnabled_default(
53
- { enabled_features: featureSettings },
54
- [pageName],
55
- requireAll
56
- )) {
57
- hasPermission = true;
58
- }
59
- return hasPermission;
60
- };
61
- var useCheckPermissionToAccess_default = useCheckPermissionToAccess;
62
- // Annotate the CommonJS export names for ESM import in node:
63
- 0 && (module.exports = {
64
- useCheckPermissionToAccess
65
- });
66
- //# sourceMappingURL=index.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/hooks/index.ts","../../src/components/LeftDrawer/helpers/featuresAreEnabled.tsx","../../src/hooks/useCheckPermissionToAccess/useCheckPermissionToAccess.ts"],"sourcesContent":["// eslint-disable-next-line import/prefer-default-export\nexport { default as useCheckPermissionToAccess } from './useCheckPermissionToAccess/useCheckPermissionToAccess';\n","function featuresAreEnabled(featureSettings, features, requireAll = true) {\n const storedPermissions = localStorage.getItem('permissions') || [];\n let enabled = false;\n\n if (requireAll) {\n enabled = features.every(\n (feature) =>\n featureSettings.enabled_features.includes(feature) &&\n // @ts-ignore\n storedPermissions.includes(`${feature}_read`),\n );\n } else {\n enabled = features.some(\n (feature) =>\n featureSettings.enabled_features.includes(feature) &&\n // @ts-ignore\n storedPermissions.includes(`${feature}_read`),\n );\n }\n\n return enabled;\n}\n\nexport default featuresAreEnabled;\n","import featuresAreEnabled from '@/components/LeftDrawer/helpers/featuresAreEnabled';\n\nconst useCheckPermissionToAccess = ({\n featureSettings,\n pageName,\n requireAll = false,\n}) => {\n let hasPermission = false;\n if (\n featuresAreEnabled(\n { enabled_features: featureSettings },\n [pageName],\n requireAll,\n )\n ) {\n hasPermission = true;\n }\n\n return hasPermission;\n};\n\nexport default useCheckPermissionToAccess;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,SAAS,mBAAmB,iBAAiB,UAAU,aAAa,MAAM;AACxE,QAAM,oBAAoB,aAAa,QAAQ,aAAa,KAAK,CAAC;AAClE,MAAI,UAAU;AAEd,MAAI,YAAY;AACd,cAAU,SAAS;AAAA,MACjB,CAAC,YACC,gBAAgB,iBAAiB,SAAS,OAAO;AAAA,MAEjD,kBAAkB,SAAS,GAAG,OAAO,OAAO;AAAA,IAChD;AAAA,EACF,OAAO;AACL,cAAU,SAAS;AAAA,MACjB,CAAC,YACC,gBAAgB,iBAAiB,SAAS,OAAO;AAAA,MAEjD,kBAAkB,SAAS,GAAG,OAAO,OAAO;AAAA,IAChD;AAAA,EACF;AAEA,SAAO;AACT;AAEA,IAAO,6BAAQ;;;ACrBf,IAAM,6BAA6B,CAAC;AAAA,EAClC;AAAA,EACA;AAAA,EACA,aAAa;AACf,MAAM;AACJ,MAAI,gBAAgB;AACpB,MACE;AAAA,IACE,EAAE,kBAAkB,gBAAgB;AAAA,IACpC,CAAC,QAAQ;AAAA,IACT;AAAA,EACF,GACA;AACA,oBAAgB;AAAA,EAClB;AAEA,SAAO;AACT;AAEA,IAAO,qCAAQ;","names":[]}
@@ -1,7 +0,0 @@
1
- declare const useCheckPermissionToAccess: ({ featureSettings, pageName, requireAll, }: {
2
- featureSettings: any;
3
- pageName: any;
4
- requireAll?: boolean | undefined;
5
- }) => boolean;
6
-
7
- export { useCheckPermissionToAccess };
@@ -1,7 +0,0 @@
1
- declare const useCheckPermissionToAccess: ({ featureSettings, pageName, requireAll, }: {
2
- featureSettings: any;
3
- pageName: any;
4
- requireAll?: boolean | undefined;
5
- }) => boolean;
6
-
7
- export { useCheckPermissionToAccess };
@@ -1,26 +0,0 @@
1
- import {
2
- featuresAreEnabled_default
3
- } from "../chunk-6VEWNVPA.js";
4
- import "../chunk-5WRI5ZAA.js";
5
-
6
- // src/hooks/useCheckPermissionToAccess/useCheckPermissionToAccess.ts
7
- var useCheckPermissionToAccess = ({
8
- featureSettings,
9
- pageName,
10
- requireAll = false
11
- }) => {
12
- let hasPermission = false;
13
- if (featuresAreEnabled_default(
14
- { enabled_features: featureSettings },
15
- [pageName],
16
- requireAll
17
- )) {
18
- hasPermission = true;
19
- }
20
- return hasPermission;
21
- };
22
- var useCheckPermissionToAccess_default = useCheckPermissionToAccess;
23
- export {
24
- useCheckPermissionToAccess_default as useCheckPermissionToAccess
25
- };
26
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/hooks/useCheckPermissionToAccess/useCheckPermissionToAccess.ts"],"sourcesContent":["import featuresAreEnabled from '@/components/LeftDrawer/helpers/featuresAreEnabled';\n\nconst useCheckPermissionToAccess = ({\n featureSettings,\n pageName,\n requireAll = false,\n}) => {\n let hasPermission = false;\n if (\n featuresAreEnabled(\n { enabled_features: featureSettings },\n [pageName],\n requireAll,\n )\n ) {\n hasPermission = true;\n }\n\n return hasPermission;\n};\n\nexport default useCheckPermissionToAccess;\n"],"mappings":";;;;;;AAEA,IAAM,6BAA6B,CAAC;AAAA,EAClC;AAAA,EACA;AAAA,EACA,aAAa;AACf,MAAM;AACJ,MAAI,gBAAgB;AACpB,MACE;AAAA,IACE,EAAE,kBAAkB,gBAAgB;AAAA,IACpC,CAAC,QAAQ;AAAA,IACT;AAAA,EACF,GACA;AACA,oBAAgB;AAAA,EAClB;AAEA,SAAO;AACT;AAEA,IAAO,qCAAQ;","names":[]}
package/dist/index.cjs DELETED
@@ -1,26 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
-
19
- // src/index.ts
20
- var src_exports = {};
21
- __export(src_exports, {
22
- default: () => src_default
23
- });
24
- module.exports = __toCommonJS(src_exports);
25
- var src_default = "@natoora-libs/core";
26
- //# sourceMappingURL=index.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export default '@natoora-libs/core';\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAO,cAAQ;","names":[]}
package/dist/index.d.cts DELETED
@@ -1,3 +0,0 @@
1
- declare const _default: "@natoora-libs/core";
2
-
3
- export { _default as default };
package/dist/index.d.ts DELETED
@@ -1,3 +0,0 @@
1
- declare const _default: "@natoora-libs/core";
2
-
3
- export { _default as default };
package/dist/index.js DELETED
@@ -1,8 +0,0 @@
1
- import "./chunk-5WRI5ZAA.js";
2
-
3
- // src/index.ts
4
- var src_default = "@natoora-libs/core";
5
- export {
6
- src_default as default
7
- };
8
- //# sourceMappingURL=index.js.map
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export default '@natoora-libs/core';\n"],"mappings":";;;AAAA,IAAO,cAAQ;","names":[]}
@@ -1,451 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
-
19
- // src/providers/index.ts
20
- var providers_exports = {};
21
- __export(providers_exports, {
22
- ErrorProvider: () => ErrorProvider,
23
- FeedbackProvider: () => FeedbackProvider,
24
- LoadingProvider: () => LoadingProvider,
25
- useError: () => useError,
26
- useFeeback: () => useFeeback,
27
- useLoading: () => useLoading
28
- });
29
- module.exports = __toCommonJS(providers_exports);
30
-
31
- // src/providers/ErrorProvider/ErrorProvider.tsx
32
- var import_react2 = require("react");
33
-
34
- // src/providers/FeedbackProvider/FeedbackProvider.tsx
35
- var import_react = require("react");
36
- var import_material = require("@mui/material");
37
- var import_mui = require("tss-react/mui");
38
- var import_jsx_runtime = require("react/jsx-runtime");
39
- var DefaultValue = {
40
- /**
41
- * @param {object} arguments
42
- * @param {string} arguments.message - Content of the feedback
43
- * @param {string} arguments.type - Type of the feedback. Can be either: success | error
44
- */
45
- // eslint-disable-next-line no-unused-vars
46
- setFeedback: ({ message, type }) => {
47
- }
48
- };
49
- var FeedbackContent = (0, import_react.createContext)(DefaultValue);
50
- var useFeeback = () => (0, import_react.useContext)(FeedbackContent);
51
- var useStyles = (0, import_mui.makeStyles)()(() => ({
52
- alert: {
53
- /**
54
- * To avoid changing the success color directly from palette
55
- * I decided to override the color only here, just to not create design issues
56
- */
57
- "&.MuiAlert-filled.MuiAlert-colorSuccess": {
58
- backgroundColor: "#2E7D32;"
59
- }
60
- }
61
- }));
62
- var FeedbackProvider = ({ children }) => {
63
- const [isOpen, setIsOpen] = (0, import_react.useState)(false);
64
- const [message, setMessage] = (0, import_react.useState)("");
65
- const [type, setType] = (0, import_react.useState)("");
66
- const handleFeedbackChange = (feedback) => {
67
- setMessage(feedback.message);
68
- setType(feedback.type);
69
- setIsOpen(true);
70
- };
71
- const handleClose = () => {
72
- setIsOpen(false);
73
- };
74
- const { classes } = useStyles();
75
- const providerValue = (0, import_react.useMemo)(
76
- () => ({
77
- setFeedback: handleFeedbackChange
78
- }),
79
- []
80
- );
81
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(FeedbackContent.Provider, { value: providerValue, children: [
82
- children,
83
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
84
- import_material.Snackbar,
85
- {
86
- anchorOrigin: { vertical: "top", horizontal: "right" },
87
- autoHideDuration: 5e3,
88
- onClose: handleClose,
89
- open: isOpen,
90
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
91
- import_material.Alert,
92
- {
93
- className: classes.alert,
94
- onClose: handleClose,
95
- severity: type,
96
- variant: "filled",
97
- children: message
98
- }
99
- )
100
- }
101
- )
102
- ] });
103
- };
104
-
105
- // src/providers/ErrorProvider/ErrorProvider.tsx
106
- var import_jsx_runtime2 = require("react/jsx-runtime");
107
- var DefaultValue2 = {
108
- // eslint-disable-next-line no-unused-vars
109
- setError: (error) => {
110
- }
111
- };
112
- var ErrorContent = (0, import_react2.createContext)(DefaultValue2);
113
- var useError = () => (0, import_react2.useContext)(ErrorContent);
114
- var ErrorProvider = ({ children }) => {
115
- const { setFeedback } = useFeeback();
116
- const handleErrorChange = (error) => {
117
- if (error?.message) {
118
- setFeedback({
119
- message: error.message,
120
- type: "error"
121
- });
122
- return;
123
- }
124
- if (error?.response) {
125
- setFeedback({
126
- message: `${error.response.status}: ${error.response.data.detail}`,
127
- type: "error"
128
- });
129
- return;
130
- }
131
- if (typeof error === "string") {
132
- setFeedback({
133
- message: error,
134
- type: "error"
135
- });
136
- }
137
- };
138
- const providerValue = (0, import_react2.useMemo)(
139
- () => ({
140
- setError: handleErrorChange
141
- }),
142
- []
143
- );
144
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ErrorContent.Provider, { value: providerValue, children });
145
- };
146
-
147
- // src/providers/LoadingProvider/LoadingProvider.tsx
148
- var import_react3 = require("react");
149
-
150
- // src/components/Loading/Loading.tsx
151
- var import_material2 = require("@mui/material");
152
- var import_mui2 = require("tss-react/mui");
153
-
154
- // src/resources/styles/colors/darkPalette.ts
155
- var darkPalette = {
156
- // General colors
157
- white: "#FFFFFF",
158
- black: "#000000",
159
- // Neutral
160
- neutral50: "#1C1B1A",
161
- neutral100: "#1F1F1F",
162
- neutral150: "#262626",
163
- neutral200: "#2E2E2E",
164
- neutral250: "#383838",
165
- neutral300: "#424242",
166
- neutral400: "#4C4C4C",
167
- neutral500: "#666666",
168
- neutral600: "#808080",
169
- neutral700: "#A3A3A3",
170
- neutral750: "#B3B3B3",
171
- neutral800: "#CCCCCC",
172
- neutral900: "#F5F5F5",
173
- // Input and contrast
174
- contrast: "#FFFFFF",
175
- constrastOpacity50: "rgba(255,255,255,0.5)",
176
- // Icon and Material UI colors
177
- iconSearch: "#B0B0B0",
178
- default: "#444444",
179
- muiPrimary: "#E9FB62",
180
- muiPrimaryBlack: "#FFFFFF",
181
- lightMuiPrimaryColorBackground: "#e9fb6214",
182
- lightBlueBackground: "#e9fb6214",
183
- muiPrimaryAlternate: "#07BAF1",
184
- muiPrimaryHover: "#1890d5",
185
- muiSecondary: "#DE5B99",
186
- muiSecondaryAlternate: "#EC613C",
187
- muiSuccess: "#66BB6A",
188
- muiSuccessAlternate: "#81C784",
189
- // Transparency variants
190
- blackOpacity10: "inherit",
191
- blackOpacity20: "inherit",
192
- blackOpacity30: "inherit",
193
- blackOpacity50: "inherit",
194
- blackOpacity80: "inherit",
195
- primaryOpacity10: "rgba(233, 251, 98, 0.10)",
196
- primaryOpacity20: "rgba(233, 251, 98, 0.20)",
197
- primaryOpacity30: "rgba(233, 251, 98, 0.30)",
198
- secondaryAlternateOpacity30: "rgba(236, 97, 60, .3)",
199
- blueOpacity08: "rgba(25, 118, 210, 0.08)",
200
- whiteOpacity10: "rgba(255,255,255,0.1)",
201
- whiteOpacity20: "rgba(255,255,255,0.2)",
202
- whiteOpacity40: "rgba(255,255,255,0.4)",
203
- // Table rows and top bar
204
- topBar: "#2e3133",
205
- // Button colors
206
- // Round Button (default)
207
- buttonHoverBackground: "rgba(255, 255, 255, 0.08)",
208
- // Active Button
209
- buttonActiveText: "#E9FB62",
210
- // Contrast Button
211
- buttonContrastBorder: "#CECECE",
212
- buttonContrastText: "#CECECE",
213
- // Error Button
214
- error: "#EF5350"
215
- };
216
- var darkPalette_default = darkPalette;
217
-
218
- // src/resources/styles/colors/lightPalette.ts
219
- var lightPalette = {
220
- // General colors
221
- white: "#FFFFFF",
222
- black: "#000000",
223
- // Neutral
224
- neutral50: "#F0EBE6",
225
- neutral100: "#FAFAFA",
226
- neutral150: "#F4F4F4",
227
- neutral200: "#F1F1F1",
228
- neutral250: "#ECECEC",
229
- neutral300: "#E0E0E0",
230
- neutral400: "#C8C8C8",
231
- neutral500: "#BDBDBD",
232
- neutral600: "#999999",
233
- neutral700: "#878787",
234
- neutral750: "#6c6c6c",
235
- neutral800: "#555555",
236
- neutral900: "#4D4D4D",
237
- // Input and contrast
238
- contrast: "#000000",
239
- constrastOpacity50: "rgba(0,0,0,0.5)",
240
- // Icon and Material UI colors
241
- iconSearch: "#606060",
242
- default: "#E0E0E0",
243
- muiPrimary: "#0781CE",
244
- muiPrimaryBlack: "#000000",
245
- lightMuiPrimaryColorBackground: "#eff4fb",
246
- lightBlueBackground: "#eff4fb",
247
- muiPrimaryAlternate: "#07BAF1",
248
- muiPrimaryHover: "#1565c0",
249
- muiSecondary: "#A42966",
250
- muiSecondaryAlternate: "#EC613C",
251
- muiSuccess: "#4caf50",
252
- muiSuccessAlternate: "#357a38",
253
- // Transparency variants
254
- blackOpacity10: "rgba(0,0,0,0.1)",
255
- blackOpacity20: "rgba(0,0,0,0.2)",
256
- blackOpacity30: "rgba(0,0,0,0.3)",
257
- blackOpacity50: "rgba(0,0,0,0.5)",
258
- blackOpacity80: "rgba(0,0,0,0.8)",
259
- primaryOpacity10: "rgba(7, 129, 206, 0.10)",
260
- primaryOpacity20: "rgba(7, 129, 206, 0.20)",
261
- primaryOpacity30: "rgba(7, 129, 206, 0.30)",
262
- secondaryAlternateOpacity30: "rgba(236, 97, 60, 0.3)",
263
- blueOpacity08: "rgba(25, 118, 210, 0.08)",
264
- whiteOpacity10: "rgba(255,255,255,0.1)",
265
- whiteOpacity20: "rgba(255,255,255,0.2)",
266
- whiteOpacity40: "rgba(255,255,255,0.4)",
267
- // Table rows and top bar
268
- topBar: "#2e3133",
269
- // Button colors
270
- // Round Button (default)
271
- buttonHoverBackground: "rgba(0, 0, 0, 0.04)",
272
- // Active Button
273
- buttonActiveText: "#0781CE",
274
- // Contrast Button
275
- buttonContrastBorder: "#CECECE",
276
- buttonContrastText: "#CECECE",
277
- // Error Button
278
- error: "#D32F2F"
279
- };
280
- var lightPalette_default = lightPalette;
281
-
282
- // src/resources/styles/colors.ts
283
- var stylesheet = localStorage.getItem("@stylesheet");
284
- var isDarkModeEnabled = stylesheet === "styles/style-dark.css";
285
- var palette = isDarkModeEnabled ? darkPalette_default : lightPalette_default;
286
- var colors = {
287
- white: palette.white,
288
- black: palette.black,
289
- neutral50: palette.neutral50,
290
- neutral100: palette.neutral100,
291
- neutral150: palette.neutral150,
292
- neutral200: palette.neutral200,
293
- neutral250: palette.neutral250,
294
- neutral300: palette.neutral300,
295
- neutral400: palette.neutral400,
296
- neutral500: palette.neutral500,
297
- neutral600: palette.neutral600,
298
- neutral700: palette.neutral700,
299
- neutral750: palette.neutral750,
300
- neutral800: palette.neutral800,
301
- neutral900: palette.neutral900,
302
- // Input and contrast
303
- contrast: palette.contrast,
304
- constrastOpacity50: palette.constrastOpacity50,
305
- iconSearch: palette.iconSearch,
306
- default: palette.default,
307
- muiPrimary: palette.muiPrimary,
308
- muiPrimaryBlack: palette.muiPrimaryBlack,
309
- lightMuiPrimaryColorBackground: palette.lightMuiPrimaryColorBackground,
310
- lightBlueBackground: palette.lightBlueBackground,
311
- muiPrimaryAlternate: palette.muiPrimaryAlternate,
312
- muiPrimaryHover: palette.muiPrimaryHover,
313
- muiSecondary: palette.muiSecondary,
314
- muiSecondaryAlternate: palette.muiSecondaryAlternate,
315
- muiSuccess: palette.muiSuccess,
316
- muiSuccessAlternate: palette.muiSuccessAlternate,
317
- // Transparency
318
- blackOpacity10: palette.blackOpacity10,
319
- blackOpacity20: palette.blackOpacity20,
320
- blackOpacity30: palette.blackOpacity30,
321
- blackOpacity50: palette.blackOpacity50,
322
- blackOpacity80: palette.blackOpacity80,
323
- primaryOpacity10: palette.primaryOpacity10,
324
- primaryOpacity20: palette.primaryOpacity20,
325
- primaryOpacity30: palette.primaryOpacity30,
326
- secondaryAlternateOpacity30: palette.secondaryAlternateOpacity30,
327
- blueOpacity08: palette.blueOpacity08,
328
- whiteOpacity10: palette.whiteOpacity10,
329
- whiteOpacity20: palette.whiteOpacity20,
330
- whiteOpacity40: palette.whiteOpacity40,
331
- topBar: palette.topBar,
332
- error: palette.error,
333
- roundButton: {
334
- default: {
335
- border: palette.neutral600,
336
- color: palette.contrast,
337
- disabled: {
338
- color: palette.blackOpacity20
339
- },
340
- hover: {
341
- background: palette.buttonHoverBackground
342
- }
343
- },
344
- filled: {
345
- background: palette.neutral100,
346
- color: palette.blackOpacity80,
347
- hover: {
348
- background: palette.neutral250
349
- }
350
- },
351
- active: {
352
- color: palette.buttonActiveText,
353
- hover: {
354
- background: palette.primaryOpacity20
355
- }
356
- },
357
- contrast: {
358
- border: palette.buttonContrastBorder,
359
- color: palette.buttonContrastText,
360
- hover: {
361
- background: palette.whiteOpacity10
362
- }
363
- },
364
- tableButton: {
365
- color: palette.neutral800
366
- },
367
- focused: {
368
- background: palette.primaryOpacity20,
369
- color: palette.buttonActiveText,
370
- hover: {
371
- background: palette.primaryOpacity30
372
- }
373
- },
374
- error: palette.error
375
- },
376
- movementCard: {
377
- default: {
378
- background: palette.neutral100
379
- },
380
- disabled: {
381
- background: palette.neutral250
382
- },
383
- pill: {
384
- color: palette.neutral200,
385
- background: palette.neutral600
386
- }
387
- },
388
- rowProductCard: {
389
- locationSubtitle: palette.neutral800
390
- }
391
- };
392
-
393
- // src/components/Loading/Loading.tsx
394
- var import_jsx_runtime3 = require("react/jsx-runtime");
395
- var useStyles2 = (0, import_mui2.makeStyles)()(() => ({
396
- wrapper: {
397
- /**
398
- * MUI Dialogs have z-index = 1300
399
- */
400
- zIndex: 1301,
401
- backgroundColor: isDarkModeEnabled ? "rgba(0, 0, 0, 0.5)" : "rgba(255, 255, 255, 0.8)"
402
- }
403
- }));
404
- var Loading = ({ isLoading }) => {
405
- const { classes } = useStyles2();
406
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
407
- import_material2.Backdrop,
408
- {
409
- "aria-hidden": !isLoading,
410
- className: classes.wrapper,
411
- open: isLoading,
412
- "data-testid": "backdrop-loading",
413
- children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material2.CircularProgress, { color: "primary" })
414
- }
415
- );
416
- };
417
- var Loading_default = Loading;
418
-
419
- // src/providers/LoadingProvider/LoadingProvider.tsx
420
- var import_jsx_runtime4 = require("react/jsx-runtime");
421
- var DefaultValue3 = {
422
- isLoading: false,
423
- setLoading: (isLoading) => {
424
- }
425
- };
426
- var LoadingContext = (0, import_react3.createContext)(DefaultValue3);
427
- var useLoading = () => (0, import_react3.useContext)(LoadingContext);
428
- var LoadingProvider = ({ children }) => {
429
- const [isLoading, setIsLoading] = (0, import_react3.useState)(false);
430
- const providerValue = (0, import_react3.useMemo)(
431
- () => ({
432
- isLoading,
433
- setLoading: setIsLoading
434
- }),
435
- []
436
- );
437
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(LoadingContext.Provider, { value: providerValue, children: [
438
- children,
439
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Loading_default, { isLoading })
440
- ] });
441
- };
442
- // Annotate the CommonJS export names for ESM import in node:
443
- 0 && (module.exports = {
444
- ErrorProvider,
445
- FeedbackProvider,
446
- LoadingProvider,
447
- useError,
448
- useFeeback,
449
- useLoading
450
- });
451
- //# sourceMappingURL=index.cjs.map