@applica-software-guru/react-admin 1.0.42 → 1.0.44
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/bitbucket-pipelines.yml +2 -0
- package/dist/ApplicaAdmin.d.ts.map +1 -1
- package/dist/components/@extended/AnimateButton.d.ts +1 -1
- package/dist/components/@extended/AnimateButton.d.ts.map +1 -1
- package/dist/components/@extended/Avatar.d.ts.map +1 -1
- package/dist/components/@extended/Breadcrumbs.d.ts.map +1 -1
- package/dist/components/@extended/IconButton.d.ts.map +1 -1
- package/dist/components/@extended/LoadingButton.d.ts.map +1 -1
- package/dist/components/@extended/Tooltip.d.ts.map +1 -1
- package/dist/components/@extended/Transitions.d.ts.map +1 -1
- package/dist/components/@extended/progress/CircularWithLabel.d.ts.map +1 -1
- package/dist/components/@extended/progress/CircularWithPath.d.ts.map +1 -1
- package/dist/components/ActionsMenu.d.ts +30 -0
- package/dist/components/ActionsMenu.d.ts.map +1 -0
- package/dist/components/Layout/Drawer/DrawerContent/Navigation/NavCollapse.d.ts +1 -1
- package/dist/components/Layout/Drawer/DrawerContent/Navigation/NavCollapse.d.ts.map +1 -1
- package/dist/components/Layout/Drawer/DrawerContent/Navigation/NavGroup.d.ts.map +1 -1
- package/dist/components/Layout/Drawer/DrawerContent/Navigation/NavItem.d.ts.map +1 -1
- package/dist/components/Layout/Drawer/DrawerHeader/DrawerHeaderStyled.d.ts.map +1 -1
- package/dist/components/Layout/Drawer/DrawerHeader/index.d.ts.map +1 -1
- package/dist/components/Layout/Drawer/MiniDrawerStyled.d.ts.map +1 -1
- package/dist/components/Layout/Drawer/index.d.ts.map +1 -1
- package/dist/components/Layout/Footer.d.ts.map +1 -1
- package/dist/components/Layout/Header/AppBarStyled.d.ts.map +1 -1
- package/dist/components/Layout/Header/HeaderContent/Notification.d.ts.map +1 -1
- package/dist/components/Layout/Header/HeaderContent/NotificationItem.d.ts.map +1 -1
- package/dist/components/Layout/Header/HeaderContent/Profile.d.ts.map +1 -1
- package/dist/components/Layout/Header/HeaderContent/index.d.ts.map +1 -1
- package/dist/components/Layout/Header/index.d.ts.map +1 -1
- package/dist/components/Layout/index.d.ts.map +1 -1
- package/dist/components/MenuPopover/styles.d.ts.map +1 -1
- package/dist/components/Notification.d.ts.map +1 -1
- package/dist/components/ScrollX.d.ts.map +1 -1
- package/dist/components/ra-buttons/CreateInDialogButton.d.ts +62 -0
- package/dist/components/ra-buttons/CreateInDialogButton.d.ts.map +1 -0
- package/dist/components/ra-buttons/EditInDialogButton.d.ts.map +1 -1
- package/dist/components/ra-custom/ListItem.d.ts +45 -0
- package/dist/components/ra-custom/ListItem.d.ts.map +1 -0
- package/dist/components/ra-custom/index.d.ts +3 -0
- package/dist/components/ra-custom/index.d.ts.map +1 -0
- package/dist/components/ra-fields/AttachmentField.d.ts +36 -0
- package/dist/components/ra-fields/AttachmentField.d.ts.map +1 -0
- package/dist/components/ra-fields/BaseAttachmentField.d.ts +32 -0
- package/dist/components/ra-fields/BaseAttachmentField.d.ts.map +1 -0
- package/dist/components/ra-fields/CoverField.d.ts.map +1 -1
- package/dist/components/ra-fields/DateAgoField.d.ts.map +1 -1
- package/dist/components/ra-fields/ReadonlyField.d.ts.map +1 -1
- package/dist/components/ra-forms/CardForm.d.ts.map +1 -1
- package/dist/components/ra-forms/FormHeader.d.ts +29 -0
- package/dist/components/ra-forms/FormHeader.d.ts.map +1 -0
- package/dist/components/ra-forms/LongForm/LongForm.d.ts +98 -0
- package/dist/components/ra-forms/LongForm/LongForm.d.ts.map +1 -0
- package/dist/components/ra-forms/LongForm/LongFormSidebar.d.ts +34 -0
- package/dist/components/ra-forms/LongForm/LongFormSidebar.d.ts.map +1 -0
- package/dist/components/ra-forms/LongForm/LongFormTab.d.ts +45 -0
- package/dist/components/ra-forms/LongForm/LongFormTab.d.ts.map +1 -0
- package/dist/components/ra-forms/LongForm/LongFormTabs.d.ts +23 -0
- package/dist/components/ra-forms/LongForm/LongFormTabs.d.ts.map +1 -0
- package/dist/components/ra-forms/LongForm/LongFormView.d.ts +42 -0
- package/dist/components/ra-forms/LongForm/LongFormView.d.ts.map +1 -0
- package/dist/components/ra-forms/LongForm/index.d.ts +3 -0
- package/dist/components/ra-forms/LongForm/index.d.ts.map +1 -0
- package/dist/components/ra-forms/LongForm/useFormRootPath.d.ts.map +1 -1
- package/dist/components/ra-forms/SimpleForm.d.ts +40 -0
- package/dist/components/ra-forms/SimpleForm.d.ts.map +1 -0
- package/dist/components/ra-forms/SimpleFormIterator.d.ts +6 -0
- package/dist/components/ra-forms/SimpleFormIterator.d.ts.map +1 -0
- package/dist/components/ra-forms/TabbedForm.d.ts.map +1 -1
- package/dist/components/ra-inputs/ArrayInput.d.ts +13 -0
- package/dist/components/ra-inputs/ArrayInput.d.ts.map +1 -0
- package/dist/components/ra-inputs/LabeledArrayInput.d.ts +42 -0
- package/dist/components/ra-inputs/LabeledArrayInput.d.ts.map +1 -0
- package/dist/components/ra-inputs/ReferenceManyInput.d.ts.map +1 -1
- package/dist/components/ra-lists/Empty.d.ts.map +1 -1
- package/dist/components/ra-lists/NotificationList/NotificationList.d.ts.map +1 -1
- package/dist/components/ra-lists/NotificationList/button/MarkAsReadedButton.d.ts.map +1 -1
- package/dist/components/ra-lists/NotificationList/field/NotificationField.d.ts.map +1 -1
- package/dist/contexts/AppConfigContext.d.ts +32 -0
- package/dist/contexts/AppConfigContext.d.ts.map +1 -0
- package/dist/contexts/MenuConfigContext.d.ts.map +1 -1
- package/dist/contexts/MenuPropTypes.d.ts.map +1 -1
- package/dist/dev/useCliErrorCatcher.d.ts +1 -1
- package/dist/hooks/useMenu.d.ts.map +1 -1
- package/dist/i18n/useI18nCatcher.d.ts +1 -1
- package/dist/i18n/useI18nLanguages.d.ts +1 -1
- package/dist/i18n/useI18nLanguages.d.ts.map +1 -1
- package/dist/i18n/useI18nProvider.d.ts.map +1 -1
- package/dist/react-admin.cjs.js +1 -1
- package/dist/react-admin.cjs.js.map +1 -1
- package/dist/react-admin.es.js +299 -784
- package/dist/react-admin.es.js.map +1 -1
- package/dist/react-admin.umd.js +1 -1
- package/dist/react-admin.umd.js.map +1 -1
- package/dist/themes/overrides/OutlinedInput.d.ts.map +1 -1
- package/dist/themes/palette.d.ts.map +1 -1
- package/dist/themes/theme/theme1.d.ts.map +1 -1
- package/dist/themes/theme/theme2.d.ts.map +1 -1
- package/dist/themes/theme/theme3.d.ts.map +1 -1
- package/dist/themes/theme/theme4.d.ts.map +1 -1
- package/dist/themes/theme/theme5.d.ts.map +1 -1
- package/dist/themes/theme/theme6.d.ts.map +1 -1
- package/dist/themes/theme/theme7.d.ts.map +1 -1
- package/dist/themes/theme/theme8.d.ts.map +1 -1
- package/dist/utils/index.d.ts +2 -2
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/lang.d.ts +1 -1
- package/dist/utils/lang.d.ts.map +1 -1
- package/dist/utils/time.d.ts +2 -1
- package/dist/utils/time.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/Admin.jsx +8 -8
- package/src/AdminContext.jsx +9 -9
- package/src/ApplicaAdmin.jsx +30 -35
- package/src/components/@extended/AnimateButton.jsx +25 -33
- package/src/components/@extended/Avatar.jsx +35 -42
- package/src/components/@extended/Breadcrumbs.jsx +62 -96
- package/src/components/@extended/Dot.jsx +14 -14
- package/src/components/@extended/IconButton.jsx +55 -65
- package/src/components/@extended/LoadingButton.jsx +84 -86
- package/src/components/@extended/Tooltip.jsx +24 -27
- package/src/components/@extended/Transitions.jsx +98 -107
- package/src/components/@extended/index.jsx +10 -10
- package/src/components/@extended/progress/CircularWithLabel.jsx +7 -9
- package/src/components/@extended/progress/CircularWithPath.jsx +9 -18
- package/src/components/@extended/progress/LinearWithIcon.jsx +5 -5
- package/src/components/@extended/progress/LinearWithLabel.jsx +5 -5
- package/src/components/@extended/progress/index.jsx +5 -5
- package/src/components/Layout/Drawer/DrawerContent/Navigation/NavCollapse.jsx +112 -131
- package/src/components/Layout/Drawer/DrawerContent/Navigation/NavGroup.jsx +67 -88
- package/src/components/Layout/Drawer/DrawerContent/Navigation/NavItem.jsx +63 -79
- package/src/components/Layout/Drawer/DrawerContent/Navigation/index.jsx +28 -28
- package/src/components/Layout/Drawer/DrawerContent/index.jsx +7 -7
- package/src/components/Layout/Drawer/DrawerHeader/DrawerHeaderStyled.jsx +13 -15
- package/src/components/Layout/Drawer/DrawerHeader/index.jsx +17 -22
- package/src/components/Layout/Drawer/HorizontalBar.jsx +17 -17
- package/src/components/Layout/Drawer/MiniDrawerStyled.jsx +27 -29
- package/src/components/Layout/Drawer/index.jsx +21 -24
- package/src/components/Layout/Footer.jsx +7 -12
- package/src/components/Layout/Header/AppBarStyled.jsx +26 -28
- package/src/components/Layout/Header/HeaderContent/MobileSection.jsx +27 -27
- package/src/components/Layout/Header/HeaderContent/Notification.jsx +34 -55
- package/src/components/Layout/Header/HeaderContent/NotificationItem.jsx +24 -36
- package/src/components/Layout/Header/HeaderContent/Profile.jsx +48 -73
- package/src/components/Layout/Header/HeaderContent/index.jsx +16 -18
- package/src/components/Layout/Header/index.jsx +25 -43
- package/src/components/Layout/index.jsx +36 -52
- package/src/components/Loadable.jsx +4 -4
- package/src/components/Loader.jsx +7 -7
- package/src/components/Logo.jsx +14 -14
- package/src/components/MainIcon.jsx +6 -6
- package/src/components/MenuPopover/MenuPopover.jsx +15 -15
- package/src/components/MenuPopover/getPosition.jsx +40 -40
- package/src/components/MenuPopover/index.jsx +3 -3
- package/src/components/MenuPopover/styles.jsx +20 -20
- package/src/components/Notification.jsx +7 -7
- package/src/components/ScrollTop.jsx +13 -13
- package/src/components/ScrollX.jsx +4 -4
- package/src/components/SmallIcon.jsx +6 -6
- package/src/components/ra-buttons/EditInDialogButton.jsx +39 -45
- package/src/components/ra-buttons/ImpersonateUserButton.jsx +20 -20
- package/src/components/ra-buttons/index.jsx +4 -4
- package/src/components/ra-fields/ActionsField.jsx +12 -12
- package/src/components/ra-fields/CoverField.jsx +20 -26
- package/src/components/ra-fields/DateAgoField.jsx +17 -20
- package/src/components/ra-fields/DateField.jsx +14 -14
- package/src/components/ra-fields/EmailField.jsx +14 -14
- package/src/components/ra-fields/FileField.jsx +23 -23
- package/src/components/ra-fields/FunctionField.jsx +5 -5
- package/src/components/ra-fields/ImageField.jsx +11 -11
- package/src/components/ra-fields/ReadonlyField.jsx +40 -42
- package/src/components/ra-fields/ReferenceManyField.jsx +21 -21
- package/src/components/ra-fields/SizeField.jsx +15 -15
- package/src/components/ra-fields/TextField.jsx +14 -14
- package/src/components/ra-fields/index.jsx +15 -15
- package/src/components/ra-forms/CardForm.jsx +34 -40
- package/src/components/ra-forms/LongForm/useFormRootPath.ts +8 -13
- package/src/components/ra-forms/SimpleForm.tsx +5 -1
- package/src/components/ra-forms/TabbedForm.jsx +10 -10
- package/src/components/ra-forms/Toolbar.jsx +15 -15
- package/src/components/ra-forms/index.jsx +9 -9
- package/src/components/ra-inputs/AutocompleteArrayInput.jsx +7 -7
- package/src/components/ra-inputs/AutocompleteInput.jsx +9 -9
- package/src/components/ra-inputs/BooleanInput.jsx +19 -19
- package/src/components/ra-inputs/DateInput.jsx +13 -13
- package/src/components/ra-inputs/FileInput.jsx +33 -33
- package/src/components/ra-inputs/ImageInput.jsx +19 -19
- package/src/components/ra-inputs/NumberInput.jsx +13 -13
- package/src/components/ra-inputs/RecordInput.jsx +39 -39
- package/src/components/ra-inputs/ReferenceArrayInput.jsx +10 -10
- package/src/components/ra-inputs/ReferenceInput.jsx +10 -10
- package/src/components/ra-inputs/ReferenceManyInput.jsx +13 -24
- package/src/components/ra-inputs/SearchInput.jsx +6 -6
- package/src/components/ra-inputs/SelectArrayInput.jsx +19 -19
- package/src/components/ra-inputs/TimeInput.jsx +21 -21
- package/src/components/ra-lists/Empty.jsx +32 -37
- package/src/components/ra-lists/List.jsx +9 -9
- package/src/components/ra-lists/NotificationList/NotificationList.jsx +14 -16
- package/src/components/ra-lists/NotificationList/button/MarkAsReadedButton.jsx +21 -25
- package/src/components/ra-lists/NotificationList/button/MarkAsUnreadedButton.jsx +19 -19
- package/src/components/ra-lists/NotificationList/button/index.jsx +2 -2
- package/src/components/ra-lists/NotificationList/field/NotificationField.jsx +20 -31
- package/src/components/ra-lists/NotificationList/field/index.jsx +1 -1
- package/src/components/ra-lists/NotificationList/index.jsx +2 -2
- package/src/components/ra-lists/index.jsx +5 -5
- package/src/components/third-party/SimpleBar.jsx +10 -10
- package/src/components/third-party/index.jsx +2 -2
- package/src/contexts/MenuConfigContext.jsx +35 -35
- package/src/contexts/MenuPropTypes.jsx +7 -7
- package/src/contexts/index.jsx +5 -5
- package/src/dev/index.jsx +2 -2
- package/src/dev/useCliErrorCatcher.jsx +32 -32
- package/src/hooks/index.jsx +8 -16
- package/src/hooks/useAppConfig.jsx +4 -4
- package/src/hooks/useBreadcrumbs.jsx +37 -37
- package/src/hooks/useLocalStorage.jsx +16 -16
- package/src/hooks/useMenu.jsx +83 -88
- package/src/hooks/useMenuConfig.jsx +4 -4
- package/src/hooks/useResourceTitle.jsx +13 -13
- package/src/hooks/useThemeConfig.jsx +4 -4
- package/src/i18n/createI18nProvider.jsx +7 -7
- package/src/i18n/index.jsx +4 -4
- package/src/i18n/useI18nCatcher.jsx +26 -26
- package/src/i18n/useI18nLanguages.jsx +12 -16
- package/src/i18n/useI18nProvider.jsx +3 -4
- package/src/themes/getColors.jsx +8 -8
- package/src/themes/getShadow.jsx +17 -17
- package/src/themes/index.jsx +29 -29
- package/src/themes/overrides/Accordion.jsx +9 -9
- package/src/themes/overrides/AccordionDetails.jsx +5 -5
- package/src/themes/overrides/AccordionSummary.jsx +11 -11
- package/src/themes/overrides/Alert.jsx +21 -21
- package/src/themes/overrides/AlertTitle.jsx +5 -5
- package/src/themes/overrides/Autocomplete.jsx +9 -9
- package/src/themes/overrides/Badge.jsx +12 -12
- package/src/themes/overrides/Button.jsx +62 -62
- package/src/themes/overrides/ButtonBase.jsx +4 -4
- package/src/themes/overrides/ButtonGroup.jsx +4 -4
- package/src/themes/overrides/CardContent.jsx +6 -6
- package/src/themes/overrides/Checkbox.jsx +31 -31
- package/src/themes/overrides/Chip.jsx +22 -22
- package/src/themes/overrides/Dialog.jsx +7 -7
- package/src/themes/overrides/DialogContentText.jsx +5 -5
- package/src/themes/overrides/DialogTitle.jsx +5 -5
- package/src/themes/overrides/Fab.jsx +21 -21
- package/src/themes/overrides/IconButton.jsx +8 -8
- package/src/themes/overrides/InputBase.jsx +3 -3
- package/src/themes/overrides/InputLabel.jsx +8 -8
- package/src/themes/overrides/LinearProgress.jsx +6 -6
- package/src/themes/overrides/Link.jsx +4 -4
- package/src/themes/overrides/ListItemButton.jsx +7 -7
- package/src/themes/overrides/ListItemIcon.jsx +5 -5
- package/src/themes/overrides/LoadingButton.jsx +6 -6
- package/src/themes/overrides/OutlinedInput.jsx +20 -21
- package/src/themes/overrides/Pagination.jsx +4 -4
- package/src/themes/overrides/PaginationItem.jsx +55 -55
- package/src/themes/overrides/Popover.jsx +5 -5
- package/src/themes/overrides/Radio.jsx +30 -30
- package/src/themes/overrides/Slider.jsx +20 -20
- package/src/themes/overrides/Switch.jsx +26 -26
- package/src/themes/overrides/Tab.jsx +7 -7
- package/src/themes/overrides/TableBody.jsx +11 -11
- package/src/themes/overrides/TableCell.jsx +12 -12
- package/src/themes/overrides/TableFooter.jsx +5 -5
- package/src/themes/overrides/TableHead.jsx +5 -5
- package/src/themes/overrides/TablePagination.jsx +6 -6
- package/src/themes/overrides/TableRow.jsx +10 -10
- package/src/themes/overrides/Tabs.jsx +5 -5
- package/src/themes/overrides/ToggleButton.jsx +7 -7
- package/src/themes/overrides/Tooltip.jsx +5 -5
- package/src/themes/overrides/TreeItem.jsx +7 -7
- package/src/themes/overrides/Typography.jsx +5 -5
- package/src/themes/overrides/index.jsx +47 -47
- package/src/themes/palette.jsx +22 -34
- package/src/themes/shadows.jsx +4 -4
- package/src/themes/theme/default.jsx +17 -17
- package/src/themes/theme/index.jsx +23 -23
- package/src/themes/theme/theme1.jsx +24 -46
- package/src/themes/theme/theme2.jsx +24 -46
- package/src/themes/theme/theme3.jsx +24 -46
- package/src/themes/theme/theme4.jsx +24 -46
- package/src/themes/theme/theme5.jsx +24 -46
- package/src/themes/theme/theme6.jsx +24 -46
- package/src/themes/theme/theme7.jsx +24 -46
- package/src/themes/theme/theme8.jsx +24 -46
- package/src/themes/typography.jsx +16 -16
- package/src/utils/{lang.js → lang.ts} +4 -4
- package/src/utils/time.ts +14 -0
- package/vite.config.js +2 -2
- package/src/utils/time.js +0 -13
- /package/src/utils/{index.js → index.ts} +0 -0
|
@@ -1,22 +1,18 @@
|
|
|
1
1
|
/* eslint-disable no-console */
|
|
2
|
-
import React from 'react'
|
|
3
|
-
window.React = React
|
|
4
|
-
const useI18nLanguages = ({
|
|
5
|
-
|
|
6
|
-
endpoint = '/languages/load',
|
|
7
|
-
mapper = ({ data }) => ({ data }),
|
|
8
|
-
}) => {
|
|
9
|
-
const [data, setData] = React.useState({ loading: true, languages: null })
|
|
2
|
+
import React from 'react';
|
|
3
|
+
window.React = React;
|
|
4
|
+
const useI18nLanguages = ({ apiUrl, endpoint = '/languages/load', mapper = ({ data }) => ({ data }) }) => {
|
|
5
|
+
const [data, setData] = React.useState({ loading: true, languages: null });
|
|
10
6
|
React.useEffect(() => {
|
|
11
|
-
let headers = new Headers()
|
|
12
|
-
headers.append('Accept', 'application/json')
|
|
13
|
-
headers.append('Content-Type', 'application/json')
|
|
7
|
+
let headers = new Headers();
|
|
8
|
+
headers.append('Accept', 'application/json');
|
|
9
|
+
headers.append('Content-Type', 'application/json');
|
|
14
10
|
fetch(`${apiUrl}${endpoint}`, { headers })
|
|
15
11
|
.then((response) => response.json())
|
|
16
|
-
.then((response) => setData({ loading: false, ...mapper(response) }))
|
|
17
|
-
}, [apiUrl, endpoint, mapper])
|
|
12
|
+
.then((response) => setData({ loading: false, ...mapper(response) }));
|
|
13
|
+
}, [apiUrl, endpoint, mapper]);
|
|
18
14
|
|
|
19
|
-
return data
|
|
20
|
-
}
|
|
15
|
+
return data;
|
|
16
|
+
};
|
|
21
17
|
|
|
22
|
-
export default useI18nLanguages
|
|
18
|
+
export default useI18nLanguages;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import createI18nProvider from './createI18nProvider'
|
|
1
|
+
import createI18nProvider from './createI18nProvider';
|
|
2
2
|
|
|
3
|
-
const useI18nProvider = ({ apiUrl, locale = 'en', languages = {} }) =>
|
|
4
|
-
|
|
5
|
-
export default useI18nProvider
|
|
3
|
+
const useI18nProvider = ({ apiUrl, locale = 'en', languages = {} }) => createI18nProvider({ apiUrl, locale, languages });
|
|
4
|
+
export default useI18nProvider;
|
package/src/themes/getColors.jsx
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
const getColors = (theme, color) => {
|
|
2
2
|
switch (color) {
|
|
3
3
|
case 'secondary':
|
|
4
|
-
return theme.palette.secondary
|
|
4
|
+
return theme.palette.secondary;
|
|
5
5
|
case 'error':
|
|
6
|
-
return theme.palette.error
|
|
6
|
+
return theme.palette.error;
|
|
7
7
|
case 'warning':
|
|
8
|
-
return theme.palette.warning
|
|
8
|
+
return theme.palette.warning;
|
|
9
9
|
case 'info':
|
|
10
|
-
return theme.palette.info
|
|
10
|
+
return theme.palette.info;
|
|
11
11
|
case 'success':
|
|
12
|
-
return theme.palette.success
|
|
12
|
+
return theme.palette.success;
|
|
13
13
|
default:
|
|
14
|
-
return theme.palette.primary
|
|
14
|
+
return theme.palette.primary;
|
|
15
15
|
}
|
|
16
|
-
}
|
|
16
|
+
};
|
|
17
17
|
|
|
18
|
-
export default getColors
|
|
18
|
+
export default getColors;
|
package/src/themes/getShadow.jsx
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import PropTypes from 'prop-types'
|
|
1
|
+
import PropTypes from 'prop-types';
|
|
2
2
|
|
|
3
3
|
const getShadow = (theme, shadow) => {
|
|
4
4
|
switch (shadow) {
|
|
5
5
|
case 'secondary':
|
|
6
|
-
return theme.customShadows.secondary
|
|
6
|
+
return theme.customShadows.secondary;
|
|
7
7
|
case 'error':
|
|
8
|
-
return theme.customShadows.error
|
|
8
|
+
return theme.customShadows.error;
|
|
9
9
|
case 'warning':
|
|
10
|
-
return theme.customShadows.warning
|
|
10
|
+
return theme.customShadows.warning;
|
|
11
11
|
case 'info':
|
|
12
|
-
return theme.customShadows.info
|
|
12
|
+
return theme.customShadows.info;
|
|
13
13
|
case 'success':
|
|
14
|
-
return theme.customShadows.success
|
|
14
|
+
return theme.customShadows.success;
|
|
15
15
|
case 'primaryButton':
|
|
16
|
-
return theme.customShadows.primaryButton
|
|
16
|
+
return theme.customShadows.primaryButton;
|
|
17
17
|
case 'secondaryButton':
|
|
18
|
-
return theme.customShadows.secondaryButton
|
|
18
|
+
return theme.customShadows.secondaryButton;
|
|
19
19
|
case 'errorButton':
|
|
20
|
-
return theme.customShadows.errorButton
|
|
20
|
+
return theme.customShadows.errorButton;
|
|
21
21
|
case 'warningButton':
|
|
22
|
-
return theme.customShadows.warningButton
|
|
22
|
+
return theme.customShadows.warningButton;
|
|
23
23
|
case 'infoButton':
|
|
24
|
-
return theme.customShadows.infoButton
|
|
24
|
+
return theme.customShadows.infoButton;
|
|
25
25
|
case 'successButton':
|
|
26
|
-
return theme.customShadows.successButton
|
|
26
|
+
return theme.customShadows.successButton;
|
|
27
27
|
default:
|
|
28
|
-
return theme.customShadows.primary
|
|
28
|
+
return theme.customShadows.primary;
|
|
29
29
|
}
|
|
30
|
-
}
|
|
30
|
+
};
|
|
31
31
|
|
|
32
32
|
getShadow.propTypes = {
|
|
33
33
|
theme: PropTypes.object,
|
|
34
|
-
shadow: PropTypes.string
|
|
35
|
-
}
|
|
34
|
+
shadow: PropTypes.string
|
|
35
|
+
};
|
|
36
36
|
|
|
37
|
-
export default getShadow
|
|
37
|
+
export default getShadow;
|
package/src/themes/index.jsx
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { CssBaseline, StyledEngineProvider } from '@mui/material'
|
|
2
|
-
import { ThemeProvider, createTheme } from '@mui/material/styles'
|
|
1
|
+
import { CssBaseline, StyledEngineProvider } from '@mui/material';
|
|
2
|
+
import { ThemeProvider, createTheme } from '@mui/material/styles';
|
|
3
3
|
|
|
4
|
-
import CustomShadows from './shadows'
|
|
5
|
-
import Palette from './palette'
|
|
6
|
-
import PropTypes from 'prop-types'
|
|
7
|
-
import Typography from './typography'
|
|
8
|
-
import componentsOverride from './overrides'
|
|
9
|
-
import getColors from './getColors'
|
|
10
|
-
import getShadow from './getShadow'
|
|
11
|
-
import { useMemo } from 'react'
|
|
12
|
-
import { useThemeConfig } from '../hooks'
|
|
4
|
+
import CustomShadows from './shadows';
|
|
5
|
+
import Palette from './palette';
|
|
6
|
+
import PropTypes from 'prop-types';
|
|
7
|
+
import Typography from './typography';
|
|
8
|
+
import componentsOverride from './overrides';
|
|
9
|
+
import getColors from './getColors';
|
|
10
|
+
import getShadow from './getShadow';
|
|
11
|
+
import { useMemo } from 'react';
|
|
12
|
+
import { useThemeConfig } from '../hooks';
|
|
13
13
|
|
|
14
14
|
const ThemeCustomization = ({ themeOverrides, children }) => {
|
|
15
|
-
const { themeDirection, mode, presetColor, fontFamily } = useThemeConfig()
|
|
15
|
+
const { themeDirection, mode, presetColor, fontFamily } = useThemeConfig();
|
|
16
16
|
|
|
17
|
-
const theme = useMemo(() => Palette(mode, presetColor), [mode, presetColor])
|
|
17
|
+
const theme = useMemo(() => Palette(mode, presetColor), [mode, presetColor]);
|
|
18
18
|
|
|
19
19
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
20
|
-
const themeTypography = useMemo(() => Typography(fontFamily), [fontFamily])
|
|
21
|
-
const themeCustomShadows = useMemo(() => CustomShadows(theme), [theme])
|
|
20
|
+
const themeTypography = useMemo(() => Typography(fontFamily), [fontFamily]);
|
|
21
|
+
const themeCustomShadows = useMemo(() => CustomShadows(theme), [theme]);
|
|
22
22
|
|
|
23
23
|
const themeOptions = useMemo(
|
|
24
24
|
() => ({
|
|
@@ -28,29 +28,29 @@ const ThemeCustomization = ({ themeOverrides, children }) => {
|
|
|
28
28
|
sm: 768,
|
|
29
29
|
md: 1024,
|
|
30
30
|
lg: 1266,
|
|
31
|
-
xl: 1440
|
|
32
|
-
}
|
|
31
|
+
xl: 1440
|
|
32
|
+
}
|
|
33
33
|
},
|
|
34
34
|
direction: themeDirection,
|
|
35
35
|
mixins: {
|
|
36
36
|
toolbar: {
|
|
37
37
|
minHeight: 60,
|
|
38
38
|
paddingTop: 8,
|
|
39
|
-
paddingBottom: 8
|
|
40
|
-
}
|
|
39
|
+
paddingBottom: 8
|
|
40
|
+
}
|
|
41
41
|
},
|
|
42
42
|
palette: theme.palette,
|
|
43
43
|
customShadows: themeCustomShadows,
|
|
44
44
|
typography: themeTypography,
|
|
45
45
|
shadows: theme.shadows.map(() => 'none'),
|
|
46
|
-
...(typeof themeOverrides === 'function' ? themeOverrides(theme) : themeOverrides)
|
|
46
|
+
...(typeof themeOverrides === 'function' ? themeOverrides(theme) : themeOverrides)
|
|
47
47
|
}),
|
|
48
|
-
[themeDirection, theme, themeTypography, themeCustomShadows, themeOverrides]
|
|
49
|
-
)
|
|
48
|
+
[themeDirection, theme, themeTypography, themeCustomShadows, themeOverrides]
|
|
49
|
+
);
|
|
50
50
|
|
|
51
|
-
const themes = createTheme(themeOptions)
|
|
51
|
+
const themes = createTheme(themeOptions);
|
|
52
52
|
|
|
53
|
-
themes.components = componentsOverride(themes)
|
|
53
|
+
themes.components = componentsOverride(themes);
|
|
54
54
|
|
|
55
55
|
return (
|
|
56
56
|
<StyledEngineProvider injectFirst>
|
|
@@ -59,12 +59,12 @@ const ThemeCustomization = ({ themeOverrides, children }) => {
|
|
|
59
59
|
{children}
|
|
60
60
|
</ThemeProvider>
|
|
61
61
|
</StyledEngineProvider>
|
|
62
|
-
)
|
|
63
|
-
}
|
|
62
|
+
);
|
|
63
|
+
};
|
|
64
64
|
|
|
65
65
|
ThemeCustomization.propTypes = {
|
|
66
66
|
children: PropTypes.node,
|
|
67
|
-
themeOverrides: PropTypes.oneOfType([PropTypes.object, PropTypes.func])
|
|
68
|
-
}
|
|
67
|
+
themeOverrides: PropTypes.oneOfType([PropTypes.object, PropTypes.func])
|
|
68
|
+
};
|
|
69
69
|
|
|
70
|
-
export { ThemeCustomization, getColors as getThemeColor, getShadow as getThemeShadow }
|
|
70
|
+
export { ThemeCustomization, getColors as getThemeColor, getShadow as getThemeShadow };
|
|
@@ -6,22 +6,22 @@ export default function Accordion(theme) {
|
|
|
6
6
|
defaultProps: {
|
|
7
7
|
disableGutters: true,
|
|
8
8
|
square: true,
|
|
9
|
-
elevation: 0
|
|
9
|
+
elevation: 0
|
|
10
10
|
},
|
|
11
11
|
styleOverrides: {
|
|
12
12
|
root: {
|
|
13
13
|
border: `1px solid ${theme.palette.secondary.light}`,
|
|
14
14
|
'&:not(:last-child)': {
|
|
15
|
-
borderBottom: 0
|
|
15
|
+
borderBottom: 0
|
|
16
16
|
},
|
|
17
17
|
'&:before': {
|
|
18
|
-
display: 'none'
|
|
18
|
+
display: 'none'
|
|
19
19
|
},
|
|
20
20
|
'&.Mui-disabled': {
|
|
21
|
-
backgroundColor: theme.palette.secondary.lighter
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}
|
|
21
|
+
backgroundColor: theme.palette.secondary.lighter
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
27
|
}
|
|
@@ -6,9 +6,9 @@ export default function AccordionDetails(theme) {
|
|
|
6
6
|
styleOverrides: {
|
|
7
7
|
root: {
|
|
8
8
|
padding: theme.spacing(2),
|
|
9
|
-
borderTop: `1px solid ${theme.palette.secondary.light}
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
}
|
|
9
|
+
borderTop: `1px solid ${theme.palette.secondary.light}`
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
14
|
}
|
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
// assets
|
|
2
|
-
import { RightOutlined } from '@ant-design/icons'
|
|
2
|
+
import { RightOutlined } from '@ant-design/icons';
|
|
3
3
|
|
|
4
4
|
// ==============================|| OVERRIDES - ALERT TITLE ||============================== //
|
|
5
5
|
|
|
6
6
|
export default function AccordionSummary(theme) {
|
|
7
|
-
const { palette, spacing } = theme
|
|
7
|
+
const { palette, spacing } = theme;
|
|
8
8
|
|
|
9
9
|
return {
|
|
10
10
|
MuiAccordionSummary: {
|
|
11
11
|
defaultProps: {
|
|
12
|
-
expandIcon: <RightOutlined style={{ fontSize: '0.75rem' }}
|
|
12
|
+
expandIcon: <RightOutlined style={{ fontSize: '0.75rem' }} />
|
|
13
13
|
},
|
|
14
14
|
styleOverrides: {
|
|
15
15
|
root: {
|
|
16
16
|
backgroundColor: palette.secondary.lighter,
|
|
17
17
|
flexDirection: 'row-reverse',
|
|
18
|
-
minHeight: 46
|
|
18
|
+
minHeight: 46
|
|
19
19
|
},
|
|
20
20
|
expandIconWrapper: {
|
|
21
21
|
'&.Mui-expanded': {
|
|
22
|
-
transform: 'rotate(90deg)'
|
|
23
|
-
}
|
|
22
|
+
transform: 'rotate(90deg)'
|
|
23
|
+
}
|
|
24
24
|
},
|
|
25
25
|
content: {
|
|
26
26
|
marginTop: spacing(1.25),
|
|
27
27
|
marginBottom: spacing(1.25),
|
|
28
|
-
marginLeft: spacing(1)
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
28
|
+
marginLeft: spacing(1)
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
33
|
}
|
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
import { alpha } from '@mui/material/styles'
|
|
2
|
-
import getColors from '../getColors'
|
|
1
|
+
import { alpha } from '@mui/material/styles';
|
|
2
|
+
import getColors from '../getColors';
|
|
3
3
|
|
|
4
4
|
// ==============================|| ALERT - COLORS ||============================== //
|
|
5
5
|
|
|
6
6
|
function getColorStyle({ color, theme }) {
|
|
7
|
-
const colors = getColors(theme, color)
|
|
8
|
-
const { lighter, light, main } = colors
|
|
7
|
+
const colors = getColors(theme, color);
|
|
8
|
+
const { lighter, light, main } = colors;
|
|
9
9
|
|
|
10
10
|
return {
|
|
11
11
|
borderColor: alpha(light, 0.5),
|
|
12
12
|
backgroundColor: lighter,
|
|
13
13
|
'& .MuiAlert-icon': {
|
|
14
|
-
color: main
|
|
15
|
-
}
|
|
16
|
-
}
|
|
14
|
+
color: main
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
// ==============================|| OVERRIDES - ALERT ||============================== //
|
|
20
20
|
|
|
21
21
|
export default function Alert(theme) {
|
|
22
|
-
const primaryDashed = getColorStyle({ color: 'primary', theme })
|
|
22
|
+
const primaryDashed = getColorStyle({ color: 'primary', theme });
|
|
23
23
|
|
|
24
24
|
return {
|
|
25
25
|
MuiAlert: {
|
|
26
26
|
styleOverrides: {
|
|
27
27
|
root: {
|
|
28
28
|
color: theme.palette.text.primary,
|
|
29
|
-
fontSize: '0.875rem'
|
|
29
|
+
fontSize: '0.875rem'
|
|
30
30
|
},
|
|
31
31
|
icon: {
|
|
32
|
-
fontSize: '1rem'
|
|
32
|
+
fontSize: '1rem'
|
|
33
33
|
},
|
|
34
34
|
message: {
|
|
35
35
|
padding: 0,
|
|
36
|
-
marginTop: 3
|
|
36
|
+
marginTop: 3
|
|
37
37
|
},
|
|
38
38
|
filled: {
|
|
39
|
-
color: theme.palette.grey[0]
|
|
39
|
+
color: theme.palette.grey[0]
|
|
40
40
|
},
|
|
41
41
|
border: {
|
|
42
42
|
padding: '10px 16px',
|
|
@@ -47,14 +47,14 @@ export default function Alert(theme) {
|
|
|
47
47
|
'&.MuiAlert-borderError': getColorStyle({ color: 'error', theme }),
|
|
48
48
|
'&.MuiAlert-borderSuccess': getColorStyle({ color: 'success', theme }),
|
|
49
49
|
'&.MuiAlert-borderInfo': getColorStyle({ color: 'info', theme }),
|
|
50
|
-
'&.MuiAlert-borderWarning': getColorStyle({ color: 'warning', theme })
|
|
50
|
+
'&.MuiAlert-borderWarning': getColorStyle({ color: 'warning', theme })
|
|
51
51
|
},
|
|
52
52
|
action: {
|
|
53
53
|
'& .MuiButton-root': {
|
|
54
54
|
padding: 2,
|
|
55
55
|
height: 'auto',
|
|
56
56
|
fontSize: '0.75rem',
|
|
57
|
-
marginTop: -2
|
|
57
|
+
marginTop: -2
|
|
58
58
|
},
|
|
59
59
|
'& .MuiIconButton-root': {
|
|
60
60
|
width: 'auto',
|
|
@@ -62,11 +62,11 @@ export default function Alert(theme) {
|
|
|
62
62
|
padding: 2,
|
|
63
63
|
marginRight: 6,
|
|
64
64
|
'& .MuiSvgIcon-root': {
|
|
65
|
-
fontSize: '1rem'
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
65
|
+
fontSize: '1rem'
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
72
|
}
|
|
@@ -6,21 +6,21 @@ export default function Autocomplete(theme) {
|
|
|
6
6
|
styleOverrides: {
|
|
7
7
|
root: {
|
|
8
8
|
'& .MuiOutlinedInput-root': {
|
|
9
|
-
padding: '3px 9px'
|
|
10
|
-
}
|
|
9
|
+
padding: '3px 9px'
|
|
10
|
+
}
|
|
11
11
|
},
|
|
12
12
|
popupIndicator: {
|
|
13
13
|
width: 'auto',
|
|
14
|
-
height: 'auto'
|
|
14
|
+
height: 'auto'
|
|
15
15
|
},
|
|
16
16
|
popper: {
|
|
17
|
-
border: `1px solid ${theme.palette.mode === 'dark' ? theme.palette.dark.main : theme.palette.grey[100]}
|
|
17
|
+
border: `1px solid ${theme.palette.mode === 'dark' ? theme.palette.dark.main : theme.palette.grey[100]}`
|
|
18
18
|
},
|
|
19
19
|
clearIndicator: {
|
|
20
20
|
width: 'auto',
|
|
21
|
-
height: 'auto'
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
21
|
+
height: 'auto'
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
26
|
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import getColors from '../getColors'
|
|
1
|
+
import getColors from '../getColors';
|
|
2
2
|
|
|
3
3
|
function getColorStyle({ color, theme }) {
|
|
4
|
-
const colors = getColors(theme, color)
|
|
5
|
-
const { lighter, main } = colors
|
|
4
|
+
const colors = getColors(theme, color);
|
|
5
|
+
const { lighter, main } = colors;
|
|
6
6
|
|
|
7
7
|
return {
|
|
8
8
|
color: main,
|
|
9
|
-
backgroundColor: lighter
|
|
10
|
-
}
|
|
9
|
+
backgroundColor: lighter
|
|
10
|
+
};
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
export default function Badge(theme) {
|
|
14
|
-
const defaultLightBadge = getColorStyle({ color: 'primary', theme })
|
|
14
|
+
const defaultLightBadge = getColorStyle({ color: 'primary', theme });
|
|
15
15
|
|
|
16
16
|
return {
|
|
17
17
|
MuiBadge: {
|
|
@@ -19,7 +19,7 @@ export default function Badge(theme) {
|
|
|
19
19
|
standard: {
|
|
20
20
|
minWidth: theme.spacing(2),
|
|
21
21
|
height: theme.spacing(2),
|
|
22
|
-
padding: theme.spacing(0.5)
|
|
22
|
+
padding: theme.spacing(0.5)
|
|
23
23
|
},
|
|
24
24
|
light: {
|
|
25
25
|
...defaultLightBadge,
|
|
@@ -28,9 +28,9 @@ export default function Badge(theme) {
|
|
|
28
28
|
'&.MuiBadge-colorError': getColorStyle({ color: 'error', theme }),
|
|
29
29
|
'&.MuiBadge-colorInfo': getColorStyle({ color: 'info', theme }),
|
|
30
30
|
'&.MuiBadge-colorSuccess': getColorStyle({ color: 'success', theme }),
|
|
31
|
-
'&.MuiBadge-colorWarning': getColorStyle({ color: 'warning', theme })
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
31
|
+
'&.MuiBadge-colorWarning': getColorStyle({ color: 'warning', theme })
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
36
|
}
|