@joelbarron/react-web-dev-kit 0.1.9 → 0.1.10
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/dist/auth/client.d.ts +46 -0
- package/dist/auth/client.d.ts.map +1 -0
- package/dist/auth/client.js +379 -0
- package/dist/auth/constants/countryCallingCodes.d.ts +9 -0
- package/dist/auth/constants/countryCallingCodes.d.ts.map +1 -0
- package/dist/auth/constants/countryCallingCodes.js +209 -0
- package/dist/auth/constants/gender.d.ts +9 -0
- package/dist/auth/constants/gender.d.ts.map +1 -0
- package/dist/auth/constants/gender.js +12 -0
- package/dist/auth/constants/index.d.ts +3 -0
- package/dist/auth/constants/index.d.ts.map +1 -0
- package/dist/auth/constants/index.js +2 -0
- package/dist/auth/forms/account/AuthAccountConfirmationForm.d.ts +18 -0
- package/dist/auth/forms/account/AuthAccountConfirmationForm.d.ts.map +1 -0
- package/dist/auth/forms/account/AuthAccountConfirmationForm.js +167 -0
- package/dist/auth/forms/account/index.d.ts +2 -0
- package/dist/auth/forms/account/index.d.ts.map +1 -0
- package/dist/auth/forms/account/index.js +1 -0
- package/dist/auth/forms/errorParser.d.ts +7 -0
- package/dist/auth/forms/errorParser.d.ts.map +1 -0
- package/dist/auth/forms/errorParser.js +65 -0
- package/dist/auth/forms/index.d.ts +6 -0
- package/dist/auth/forms/index.d.ts.map +1 -0
- package/dist/auth/forms/index.js +5 -0
- package/dist/auth/forms/password/AuthForgotPasswordForm.d.ts +16 -0
- package/dist/auth/forms/password/AuthForgotPasswordForm.d.ts.map +1 -0
- package/dist/auth/forms/password/AuthForgotPasswordForm.js +109 -0
- package/dist/auth/forms/password/AuthPasswordResetConfirmForm.d.ts +17 -0
- package/dist/auth/forms/password/AuthPasswordResetConfirmForm.d.ts.map +1 -0
- package/dist/auth/forms/password/AuthPasswordResetConfirmForm.js +163 -0
- package/dist/auth/forms/password/AuthResetPasswordForm.d.ts +12 -0
- package/dist/auth/forms/password/AuthResetPasswordForm.d.ts.map +1 -0
- package/dist/auth/forms/password/AuthResetPasswordForm.js +22 -0
- package/dist/auth/forms/password/index.d.ts +4 -0
- package/dist/auth/forms/password/index.d.ts.map +1 -0
- package/dist/auth/forms/password/index.js +3 -0
- package/dist/auth/forms/password/passwordValidation.d.ts +3 -0
- package/dist/auth/forms/password/passwordValidation.d.ts.map +1 -0
- package/dist/auth/forms/password/passwordValidation.js +45 -0
- package/dist/auth/forms/sign-in/AuthOtpSignInForm.d.ts +24 -0
- package/dist/auth/forms/sign-in/AuthOtpSignInForm.d.ts.map +1 -0
- package/dist/auth/forms/sign-in/AuthOtpSignInForm.js +227 -0
- package/dist/auth/forms/sign-in/AuthPasswordSignInForm.d.ts +22 -0
- package/dist/auth/forms/sign-in/AuthPasswordSignInForm.d.ts.map +1 -0
- package/dist/auth/forms/sign-in/AuthPasswordSignInForm.js +148 -0
- package/dist/auth/forms/sign-in/index.d.ts +3 -0
- package/dist/auth/forms/sign-in/index.d.ts.map +1 -0
- package/dist/auth/forms/sign-in/index.js +2 -0
- package/dist/auth/forms/sign-up/AuthSignUpForm.d.ts +37 -0
- package/dist/auth/forms/sign-up/AuthSignUpForm.d.ts.map +1 -0
- package/dist/auth/forms/sign-up/AuthSignUpForm.js +193 -0
- package/dist/auth/forms/sign-up/index.d.ts +2 -0
- package/dist/auth/forms/sign-up/index.d.ts.map +1 -0
- package/dist/auth/forms/sign-up/index.js +1 -0
- package/dist/auth/fuse/createFuseAuthViews.d.ts +25 -0
- package/dist/auth/fuse/createFuseAuthViews.d.ts.map +1 -0
- package/dist/auth/fuse/createFuseAuthViews.js +510 -0
- package/dist/auth/fuse/fuseAdapter.d.ts +42 -0
- package/dist/auth/fuse/fuseAdapter.d.ts.map +1 -0
- package/dist/auth/fuse/fuseAdapter.js +291 -0
- package/dist/auth/fuse/fuseIntegration.d.ts +74 -0
- package/dist/auth/fuse/fuseIntegration.d.ts.map +1 -0
- package/dist/auth/fuse/fuseIntegration.js +121 -0
- package/dist/auth/fuse/index.d.ts +4 -0
- package/dist/auth/fuse/index.d.ts.map +1 -0
- package/dist/auth/fuse/index.js +3 -0
- package/dist/auth/index.d.ts +11 -0
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/auth/index.js +10 -0
- package/dist/auth/provider.d.ts +35 -0
- package/dist/auth/provider.d.ts.map +1 -0
- package/dist/auth/provider.js +133 -0
- package/dist/auth/query.d.ts +23 -0
- package/dist/auth/query.d.ts.map +1 -0
- package/dist/auth/query.js +103 -0
- package/dist/auth/routes.d.ts +37 -0
- package/dist/auth/routes.d.ts.map +1 -0
- package/dist/auth/routes.js +75 -0
- package/dist/auth/social/providerAuth.d.ts +101 -0
- package/dist/auth/social/providerAuth.d.ts.map +1 -0
- package/dist/auth/social/providerAuth.js +207 -0
- package/dist/auth/storage.d.ts +3 -0
- package/dist/auth/storage.d.ts.map +1 -0
- package/dist/auth/storage.js +20 -0
- package/dist/auth/types.d.ts +238 -0
- package/dist/auth/types.d.ts.map +1 -0
- package/dist/auth/types.js +1 -0
- package/dist/auth/ui/AuthPageTitle.d.ts +7 -0
- package/dist/auth/ui/AuthPageTitle.d.ts.map +1 -0
- package/dist/auth/ui/AuthPageTitle.js +7 -0
- package/dist/auth/ui/AuthPagesMessageSection.d.ts +3 -0
- package/dist/auth/ui/AuthPagesMessageSection.d.ts.map +1 -0
- package/dist/auth/ui/AuthPagesMessageSection.js +39 -0
- package/dist/auth/ui/AuthPrimaryButton.d.ts +9 -0
- package/dist/auth/ui/AuthPrimaryButton.d.ts.map +1 -0
- package/dist/auth/ui/AuthPrimaryButton.js +19 -0
- package/dist/auth/ui/AuthRoleSelectionDialog.d.ts +14 -0
- package/dist/auth/ui/AuthRoleSelectionDialog.d.ts.map +1 -0
- package/dist/auth/ui/AuthRoleSelectionDialog.js +39 -0
- package/dist/auth/ui/AuthRoutePageWrapper.d.ts +12 -0
- package/dist/auth/ui/AuthRoutePageWrapper.d.ts.map +1 -0
- package/dist/auth/ui/AuthRoutePageWrapper.js +61 -0
- package/dist/auth/ui/AuthSecondaryButton.d.ts +7 -0
- package/dist/auth/ui/AuthSecondaryButton.d.ts.map +1 -0
- package/dist/auth/ui/AuthSecondaryButton.js +18 -0
- package/dist/auth/ui/AuthSocialProviderButton.d.ts +11 -0
- package/dist/auth/ui/AuthSocialProviderButton.d.ts.map +1 -0
- package/dist/auth/ui/AuthSocialProviderButton.js +33 -0
- package/dist/auth/ui/index.d.ts +9 -0
- package/dist/auth/ui/index.d.ts.map +1 -0
- package/dist/auth/ui/index.js +8 -0
- package/dist/auth/ui/types.d.ts +15 -0
- package/dist/auth/ui/types.d.ts.map +1 -0
- package/dist/auth/ui/types.js +1 -0
- package/dist/config/createConfig.d.ts +14 -0
- package/dist/config/createConfig.d.ts.map +1 -0
- package/dist/config/createConfig.js +179 -0
- package/dist/config/defaults.d.ts +3 -0
- package/dist/config/defaults.d.ts.map +1 -0
- package/dist/config/defaults.js +39 -0
- package/dist/config/index.d.ts +5 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +4 -0
- package/dist/config/merge.d.ts +2 -0
- package/dist/config/merge.d.ts.map +1 -0
- package/dist/config/merge.js +18 -0
- package/dist/config/types.d.ts +53 -0
- package/dist/config/types.d.ts.map +1 -0
- package/dist/config/types.js +1 -0
- package/dist/core/buttons/JBButton.d.ts +8 -0
- package/dist/core/buttons/JBButton.d.ts.map +1 -0
- package/dist/core/buttons/JBButton.js +55 -0
- package/dist/core/buttons/index.d.ts +2 -0
- package/dist/core/buttons/index.d.ts.map +1 -0
- package/dist/core/buttons/index.js +1 -0
- package/dist/core/dialogs/JBConfirmDialog.d.ts +15 -0
- package/dist/core/dialogs/JBConfirmDialog.d.ts.map +1 -0
- package/dist/core/dialogs/JBConfirmDialog.js +6 -0
- package/dist/core/dialogs/index.d.ts +2 -0
- package/dist/core/dialogs/index.d.ts.map +1 -0
- package/dist/core/dialogs/index.js +1 -0
- package/dist/core/index.d.ts +5 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +4 -0
- package/dist/core/layout/JBContentContainer.d.ts +31 -0
- package/dist/core/layout/JBContentContainer.d.ts.map +1 -0
- package/dist/core/layout/JBContentContainer.js +50 -0
- package/dist/core/layout/JBFormHeader.d.ts +3 -0
- package/dist/core/layout/JBFormHeader.d.ts.map +1 -0
- package/dist/core/layout/JBFormHeader.js +131 -0
- package/dist/core/layout/index.d.ts +3 -0
- package/dist/core/layout/index.d.ts.map +1 -0
- package/dist/core/layout/index.js +2 -0
- package/dist/core/skeletons/JBFormContentSkeleton.d.ts +5 -0
- package/dist/core/skeletons/JBFormContentSkeleton.d.ts.map +1 -0
- package/dist/core/skeletons/JBFormContentSkeleton.js +12 -0
- package/dist/core/skeletons/JBFormHeaderSkeleton.d.ts +6 -0
- package/dist/core/skeletons/JBFormHeaderSkeleton.d.ts.map +1 -0
- package/dist/core/skeletons/JBFormHeaderSkeleton.js +19 -0
- package/dist/core/skeletons/index.d.ts +3 -0
- package/dist/core/skeletons/index.d.ts.map +1 -0
- package/dist/core/skeletons/index.js +2 -0
- package/dist/forms/JBAutocompleteField.d.ts +12 -0
- package/dist/forms/JBAutocompleteField.d.ts.map +1 -0
- package/dist/forms/JBAutocompleteField.js +20 -0
- package/dist/forms/JBCheckboxField.d.ts +12 -0
- package/dist/forms/JBCheckboxField.d.ts.map +1 -0
- package/dist/forms/JBCheckboxField.js +36 -0
- package/dist/forms/JBDatePickerField.d.ts +13 -0
- package/dist/forms/JBDatePickerField.d.ts.map +1 -0
- package/dist/forms/JBDatePickerField.js +67 -0
- package/dist/forms/JBRadioGroupField.d.ts +10 -0
- package/dist/forms/JBRadioGroupField.d.ts.map +1 -0
- package/dist/forms/JBRadioGroupField.js +8 -0
- package/dist/forms/JBSelectField.d.ts +9 -0
- package/dist/forms/JBSelectField.d.ts.map +1 -0
- package/dist/forms/JBSelectField.js +8 -0
- package/dist/forms/JBSwitchField.d.ts +11 -0
- package/dist/forms/JBSwitchField.d.ts.map +1 -0
- package/dist/forms/JBSwitchField.js +10 -0
- package/dist/forms/JBTextField.d.ts +6 -0
- package/dist/forms/JBTextField.d.ts.map +1 -0
- package/dist/forms/JBTextField.js +8 -0
- package/dist/forms/JBTimePickerField.d.ts +12 -0
- package/dist/forms/JBTimePickerField.d.ts.map +1 -0
- package/dist/forms/JBTimePickerField.js +35 -0
- package/dist/forms/index.d.ts +13 -0
- package/dist/forms/index.d.ts.map +1 -0
- package/dist/forms/index.js +12 -0
- package/dist/forms/rules.d.ts +16 -0
- package/dist/forms/rules.d.ts.map +1 -0
- package/dist/forms/rules.js +21 -0
- package/dist/forms/types.d.ts +12 -0
- package/dist/forms/types.d.ts.map +1 -0
- package/dist/forms/types.js +1 -0
- package/dist/forms/utils.d.ts +5 -0
- package/dist/forms/utils.d.ts.map +1 -0
- package/dist/forms/utils.js +7 -0
- package/dist/forms/zod.d.ts +4 -0
- package/dist/forms/zod.d.ts.map +1 -0
- package/dist/forms/zod.js +9 -0
- package/dist/grid/JBGrid.d.ts +3 -0
- package/dist/grid/JBGrid.d.ts.map +1 -0
- package/dist/grid/JBGrid.js +338 -0
- package/dist/grid/JBGridHeader.d.ts +3 -0
- package/dist/grid/JBGridHeader.d.ts.map +1 -0
- package/dist/grid/JBGridHeader.js +93 -0
- package/dist/grid/JBGridLoading.d.ts +9 -0
- package/dist/grid/JBGridLoading.d.ts.map +1 -0
- package/dist/grid/JBGridLoading.js +14 -0
- package/dist/grid/JBGridProviders.d.ts +13 -0
- package/dist/grid/JBGridProviders.d.ts.map +1 -0
- package/dist/grid/JBGridProviders.js +54 -0
- package/dist/grid/JBGridSkeleton.d.ts +7 -0
- package/dist/grid/JBGridSkeleton.d.ts.map +1 -0
- package/dist/grid/JBGridSkeleton.js +6 -0
- package/dist/grid/defaults.d.ts +4 -0
- package/dist/grid/defaults.d.ts.map +1 -0
- package/dist/grid/defaults.js +29 -0
- package/dist/grid/index.d.ts +8 -0
- package/dist/grid/index.d.ts.map +1 -0
- package/dist/grid/index.js +7 -0
- package/dist/grid/types.d.ts +197 -0
- package/dist/grid/types.d.ts.map +1 -0
- package/dist/grid/types.js +1 -0
- package/dist/hooks/index.d.ts +4 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +3 -0
- package/dist/hooks/useJBDebouncedValue.d.ts +2 -0
- package/dist/hooks/useJBDebouncedValue.d.ts.map +1 -0
- package/dist/hooks/useJBDebouncedValue.js +11 -0
- package/dist/hooks/useJBEntityFormController.d.ts +54 -0
- package/dist/hooks/useJBEntityFormController.d.ts.map +1 -0
- package/dist/hooks/useJBEntityFormController.js +156 -0
- package/dist/hooks/useJBRedirect.d.ts +10 -0
- package/dist/hooks/useJBRedirect.d.ts.map +1 -0
- package/dist/hooks/useJBRedirect.js +11 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/query/createQueryClient.d.ts +8 -0
- package/dist/query/createQueryClient.d.ts.map +1 -0
- package/dist/query/createQueryClient.js +25 -0
- package/dist/query/http.d.ts +3 -0
- package/dist/query/http.d.ts.map +1 -0
- package/dist/query/http.js +12 -0
- package/dist/query/index.d.ts +4 -0
- package/dist/query/index.d.ts.map +1 -0
- package/dist/query/index.js +3 -0
- package/dist/query/types.d.ts +7 -0
- package/dist/query/types.d.ts.map +1 -0
- package/dist/query/types.js +1 -0
- package/dist/utils/errors.d.ts +10 -0
- package/dist/utils/errors.d.ts.map +1 -0
- package/dist/utils/errors.js +55 -0
- package/dist/utils/format.d.ts +4 -0
- package/dist/utils/format.d.ts.map +1 -0
- package/dist/utils/format.js +28 -0
- package/dist/utils/geo.d.ts +9 -0
- package/dist/utils/geo.d.ts.map +1 -0
- package/dist/utils/geo.js +186 -0
- package/dist/utils/index.d.ts +6 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +5 -0
- package/dist/utils/query.d.ts +2 -0
- package/dist/utils/query.d.ts.map +1 -0
- package/dist/utils/query.js +4 -0
- package/dist/utils/regex.d.ts +7 -0
- package/dist/utils/regex.d.ts.map +1 -0
- package/dist/utils/regex.js +6 -0
- package/package.json +3 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ComponentType, ReactNode } from 'react';
|
|
2
|
+
import { AuthPageWrapperProps } from '../routes';
|
|
3
|
+
import { AuthMessageSectionProps, AuthPageLayoutVariant } from './types';
|
|
4
|
+
type AuthRoutePageWrapperProps = AuthPageWrapperProps & {
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
layoutVariant?: AuthPageLayoutVariant;
|
|
7
|
+
messageSectionProps?: AuthMessageSectionProps;
|
|
8
|
+
MessageSectionComponent?: ComponentType<AuthMessageSectionProps>;
|
|
9
|
+
};
|
|
10
|
+
export declare function AuthRoutePageWrapper(props: AuthRoutePageWrapperProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=AuthRoutePageWrapper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthRoutePageWrapper.d.ts","sourceRoot":"","sources":["../../../src/auth/ui/AuthRoutePageWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AAEjD,OAAO,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAEzE,KAAK,yBAAyB,GAAG,oBAAoB,GAAG;IACtD,QAAQ,EAAE,SAAS,CAAC;IACpB,aAAa,CAAC,EAAE,qBAAqB,CAAC;IACtC,mBAAmB,CAAC,EAAE,uBAAuB,CAAC;IAC9C,uBAAuB,CAAC,EAAE,aAAa,CAAC,uBAAuB,CAAC,CAAC;CAClE,CAAC;AAEF,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,yBAAyB,2CAuFpE"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import Box from '@mui/material/Box';
|
|
3
|
+
import Paper from '@mui/material/Paper';
|
|
4
|
+
import { AuthPagesMessageSection } from './AuthPagesMessageSection';
|
|
5
|
+
export function AuthRoutePageWrapper(props) {
|
|
6
|
+
const { children, routeKey, layoutVariant = 'split', messageSectionProps, MessageSectionComponent = AuthPagesMessageSection } = props;
|
|
7
|
+
const isSignOut = routeKey === 'signOut';
|
|
8
|
+
if (layoutVariant === 'modern') {
|
|
9
|
+
return (_jsx(Box, { sx: {
|
|
10
|
+
display: 'flex',
|
|
11
|
+
minWidth: 0,
|
|
12
|
+
flex: '1 1 auto',
|
|
13
|
+
flexDirection: 'column',
|
|
14
|
+
alignItems: 'center',
|
|
15
|
+
justifyContent: 'center',
|
|
16
|
+
width: '100%',
|
|
17
|
+
p: { xs: 0, sm: 2, md: 4 }
|
|
18
|
+
}, children: _jsxs(Paper, { sx: {
|
|
19
|
+
display: 'flex',
|
|
20
|
+
flexDirection: { xs: 'column', lg: 'row' },
|
|
21
|
+
minHeight: { xs: '100dvh', sm: 'auto' },
|
|
22
|
+
width: '100%',
|
|
23
|
+
maxWidth: { lg: 1280 },
|
|
24
|
+
overflow: 'hidden',
|
|
25
|
+
borderRadius: { xs: 0, sm: 3 },
|
|
26
|
+
boxShadow: { xs: 'none', lg: 1 }
|
|
27
|
+
}, children: [_jsx(Box, { sx: {
|
|
28
|
+
width: { xs: '100%', lg: '50%' },
|
|
29
|
+
px: { xs: 2, sm: 4, md: 8 },
|
|
30
|
+
py: { xs: 3, sm: 5, md: 8 },
|
|
31
|
+
borderRight: (theme) => ({ xs: 0, lg: theme.direction === 'ltr' ? 1 : 0 }),
|
|
32
|
+
borderLeft: (theme) => ({ xs: 0, lg: theme.direction === 'rtl' ? 1 : 0 }),
|
|
33
|
+
borderColor: 'divider',
|
|
34
|
+
display: 'flex',
|
|
35
|
+
alignItems: 'center',
|
|
36
|
+
justifyContent: 'center'
|
|
37
|
+
}, children: children }), _jsx(Box, { sx: { display: { xs: 'none', lg: 'flex' }, width: '50%', minWidth: 0 }, children: _jsx(MessageSectionComponent, { ...(messageSectionProps ?? {}) }) })] }) }));
|
|
38
|
+
}
|
|
39
|
+
return (_jsxs(Box, { sx: {
|
|
40
|
+
display: 'flex',
|
|
41
|
+
minWidth: 0,
|
|
42
|
+
flex: '1 1 auto',
|
|
43
|
+
flexDirection: { xs: 'column', sm: 'row' },
|
|
44
|
+
alignItems: { xs: 'center', md: 'flex-start' },
|
|
45
|
+
justifyContent: { sm: 'center', md: 'flex-start' }
|
|
46
|
+
}, children: [_jsx(Paper, { sx: {
|
|
47
|
+
height: { xs: '100%', sm: 'auto', md: '100%' },
|
|
48
|
+
width: { xs: '100%', sm: 'auto', md: layoutVariant === 'split' ? '50%' : '100%' },
|
|
49
|
+
px: { xs: 2, sm: 6, md: 8 },
|
|
50
|
+
py: { xs: layoutVariant === 'fullScreen' ? 2 : 1, sm: 6, md: layoutVariant === 'fullScreen' ? 12 : 8 },
|
|
51
|
+
borderRadius: { xs: 0, sm: 3, md: 0 },
|
|
52
|
+
boxShadow: { xs: 'none', sm: 1, md: 'none' },
|
|
53
|
+
display: { md: 'flex' },
|
|
54
|
+
alignItems: { md: 'center' },
|
|
55
|
+
justifyContent: { md: 'flex-end' },
|
|
56
|
+
borderRight: (theme) => (theme.direction === 'ltr' ? 1 : 0),
|
|
57
|
+
borderLeft: (theme) => (theme.direction === 'rtl' ? 1 : 0),
|
|
58
|
+
borderColor: 'divider',
|
|
59
|
+
...(isSignOut ? { alignItems: { xs: 'center', md: 'center' } } : null)
|
|
60
|
+
}, children: children }), _jsx(MessageSectionComponent, { ...(messageSectionProps ?? {}) })] }));
|
|
61
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ButtonProps } from "@mui/material/Button";
|
|
2
|
+
type AuthSecondaryButtonProps = Omit<ButtonProps, "variant"> & {
|
|
3
|
+
to?: string;
|
|
4
|
+
};
|
|
5
|
+
export declare function AuthSecondaryButton(props: AuthSecondaryButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export {};
|
|
7
|
+
//# sourceMappingURL=AuthSecondaryButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthSecondaryButton.d.ts","sourceRoot":"","sources":["../../../src/auth/ui/AuthSecondaryButton.tsx"],"names":[],"mappings":"AAAA,OAAe,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAE3D,KAAK,wBAAwB,GAAG,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,GAAG;IAC7D,EAAE,CAAC,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,2CAsBlE"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import Button from "@mui/material/Button";
|
|
3
|
+
export function AuthSecondaryButton(props) {
|
|
4
|
+
const { sx, ...rest } = props;
|
|
5
|
+
return (_jsx(Button, { ...rest, variant: "outlined", sx: {
|
|
6
|
+
width: "100%",
|
|
7
|
+
minHeight: 38,
|
|
8
|
+
borderWidth: 1,
|
|
9
|
+
borderColor: "rgba(15, 23, 42, 0.28)",
|
|
10
|
+
color: "text.primary",
|
|
11
|
+
fontWeight: 600,
|
|
12
|
+
"&:hover": {
|
|
13
|
+
borderWidth: 1,
|
|
14
|
+
borderColor: "rgba(15, 23, 42, 0.45)",
|
|
15
|
+
},
|
|
16
|
+
...(sx ?? {}),
|
|
17
|
+
} }));
|
|
18
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ButtonProps } from '@mui/material/Button';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { SocialProvider } from '../types';
|
|
4
|
+
type AuthSocialProviderButtonProps = Omit<ButtonProps, 'variant' | 'color'> & {
|
|
5
|
+
provider: SocialProvider | 'sms';
|
|
6
|
+
loading?: boolean;
|
|
7
|
+
loadingLabel?: ReactNode;
|
|
8
|
+
};
|
|
9
|
+
export declare function AuthSocialProviderButton(props: AuthSocialProviderButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=AuthSocialProviderButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthSocialProviderButton.d.ts","sourceRoot":"","sources":["../../../src/auth/ui/AuthSocialProviderButton.tsx"],"names":[],"mappings":"AAIA,OAAe,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAE3D,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE1C,KAAK,6BAA6B,GAAG,IAAI,CAAC,WAAW,EAAE,SAAS,GAAG,OAAO,CAAC,GAAG;IAC5E,QAAQ,EAAE,cAAc,GAAG,KAAK,CAAC;IACjC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,SAAS,CAAC;CAC1B,CAAC;AAgBF,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,6BAA6B,2CAkC5E"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import AppleIcon from '@mui/icons-material/Apple';
|
|
3
|
+
import FacebookIcon from '@mui/icons-material/Facebook';
|
|
4
|
+
import GoogleIcon from '@mui/icons-material/Google';
|
|
5
|
+
import PhoneIphoneIcon from "@mui/icons-material/PhoneIphone";
|
|
6
|
+
import Button from '@mui/material/Button';
|
|
7
|
+
import CircularProgress from '@mui/material/CircularProgress';
|
|
8
|
+
const providerIcon = {
|
|
9
|
+
google: _jsx(GoogleIcon, { fontSize: 'small' }),
|
|
10
|
+
facebook: _jsx(FacebookIcon, { fontSize: 'small' }),
|
|
11
|
+
apple: _jsx(AppleIcon, { fontSize: 'small' }),
|
|
12
|
+
sms: _jsx(PhoneIphoneIcon, { fontSize: 'small' })
|
|
13
|
+
};
|
|
14
|
+
const providerLabel = {
|
|
15
|
+
google: 'Google',
|
|
16
|
+
facebook: 'Facebook',
|
|
17
|
+
apple: 'Apple',
|
|
18
|
+
sms: 'SMS'
|
|
19
|
+
};
|
|
20
|
+
export function AuthSocialProviderButton(props) {
|
|
21
|
+
const { provider, loading = false, loadingLabel, children, disabled, sx, ...rest } = props;
|
|
22
|
+
const label = children ?? providerLabel[provider];
|
|
23
|
+
return (_jsx(Button, { ...rest, variant: 'outlined', color: 'inherit', disabled: Boolean(disabled) || loading, "aria-label": providerLabel[provider], startIcon: loading ? (_jsx(CircularProgress, { size: 16, color: 'inherit' })) : (providerIcon[provider]), sx: {
|
|
24
|
+
width: '100%',
|
|
25
|
+
minWidth: 0,
|
|
26
|
+
minHeight: 38,
|
|
27
|
+
justifyContent: 'center',
|
|
28
|
+
'& .MuiButton-startIcon': {
|
|
29
|
+
marginRight: 1
|
|
30
|
+
},
|
|
31
|
+
...(sx ?? {})
|
|
32
|
+
}, children: loading ? loadingLabel ?? label : label }));
|
|
33
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './types';
|
|
2
|
+
export * from './AuthPagesMessageSection';
|
|
3
|
+
export * from './AuthRoutePageWrapper';
|
|
4
|
+
export * from './AuthPrimaryButton';
|
|
5
|
+
export * from './AuthSecondaryButton';
|
|
6
|
+
export * from './AuthSocialProviderButton';
|
|
7
|
+
export * from './AuthRoleSelectionDialog';
|
|
8
|
+
export * from './AuthPageTitle';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/auth/ui/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './types';
|
|
2
|
+
export * from './AuthPagesMessageSection';
|
|
3
|
+
export * from './AuthRoutePageWrapper';
|
|
4
|
+
export * from './AuthPrimaryButton';
|
|
5
|
+
export * from './AuthSecondaryButton';
|
|
6
|
+
export * from './AuthSocialProviderButton';
|
|
7
|
+
export * from './AuthRoleSelectionDialog';
|
|
8
|
+
export * from './AuthPageTitle';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ComponentType, ReactNode } from 'react';
|
|
2
|
+
export type AuthLinkComponentProps = {
|
|
3
|
+
to: string;
|
|
4
|
+
className?: string;
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
};
|
|
7
|
+
export type AuthLinkComponent = ComponentType<AuthLinkComponentProps>;
|
|
8
|
+
export type AuthPageLayoutVariant = 'split' | 'fullScreen' | 'modern';
|
|
9
|
+
export type AuthMessageSectionProps = {
|
|
10
|
+
titleLines?: string[];
|
|
11
|
+
description?: string;
|
|
12
|
+
footerText?: string;
|
|
13
|
+
avatarUrls?: string[];
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/auth/ui/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEjD,MAAM,MAAM,sBAAsB,GAAG;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,aAAa,CAAC,sBAAsB,CAAC,CAAC;AAEtE,MAAM,MAAM,qBAAqB,GAAG,OAAO,GAAG,YAAY,GAAG,QAAQ,CAAC;AAEtE,MAAM,MAAM,uBAAuB,GAAG;IACpC,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { JBApiHostConfig, JBAppConfig, JBAppConfigOverrides, JBAppStage, JBAuthProfileRoleOption, JBAuthSocialConfig, JBStageValueMap } from './types';
|
|
2
|
+
export declare const createJBWebConfig: (baseConfig?: JBAppConfigOverrides, overrides?: JBAppConfigOverrides) => JBAppConfig;
|
|
3
|
+
export declare const resolveApiHostByStage: (hostConfig: JBApiHostConfig, stage: JBAppStage) => string;
|
|
4
|
+
export declare const getStageValue: <T>(stageMap: JBStageValueMap<T> | undefined, stage: JBAppStage, fallback?: T) => T | undefined;
|
|
5
|
+
export declare const getApiBaseUrl: (config: JBAppConfig) => string;
|
|
6
|
+
export declare const getConfigStageValue: <T>(config: Pick<JBAppConfig, "stage">, stageMap: JBStageValueMap<T> | undefined, fallback?: T) => T | undefined;
|
|
7
|
+
export declare const createJBWebConfigFromEnv: (baseConfig?: JBAppConfigOverrides, env?: Record<string, string | undefined>) => JBAppConfig;
|
|
8
|
+
export declare const getAuthBasePath: (config: JBAppConfig) => string;
|
|
9
|
+
export declare const getAuthProfileRoles: (config: JBAppConfig) => JBAuthProfileRoleOption[];
|
|
10
|
+
export declare const getAuthSignupProfileRoles: (config: JBAppConfig) => JBAuthProfileRoleOption[];
|
|
11
|
+
export declare const getAuthDefaultProfileRole: (config: JBAppConfig) => string | undefined;
|
|
12
|
+
export declare const getAuthSocialConfig: (config: JBAppConfig) => JBAuthSocialConfig;
|
|
13
|
+
export declare const getAuthShowDebugSocial: (config: JBAppConfig) => boolean;
|
|
14
|
+
//# sourceMappingURL=createConfig.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createConfig.d.ts","sourceRoot":"","sources":["../../src/config/createConfig.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,eAAe,EACf,WAAW,EACX,oBAAoB,EACpB,UAAU,EAEV,uBAAuB,EACvB,kBAAkB,EAElB,eAAe,EAChB,MAAM,SAAS,CAAC;AAEjB,eAAO,MAAM,iBAAiB,GAC5B,aAAa,oBAAoB,EACjC,YAAY,oBAAoB,KAC/B,WA6BF,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAAI,YAAY,eAAe,EAAE,OAAO,UAAU,KAAG,MAEtF,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,CAAC,EAC7B,UAAU,eAAe,CAAC,CAAC,CAAC,GAAG,SAAS,EACxC,OAAO,UAAU,EACjB,WAAW,CAAC,KACX,CAAC,GAAG,SAQN,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,QAAQ,WAAW,KAAG,MAEnD,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,CAAC,EACnC,QAAQ,IAAI,CAAC,WAAW,EAAE,OAAO,CAAC,EAClC,UAAU,eAAe,CAAC,CAAC,CAAC,GAAG,SAAS,EACxC,WAAW,CAAC,KACX,CAAC,GAAG,SAEN,CAAC;AAEF,eAAO,MAAM,wBAAwB,GACnC,aAAa,oBAAoB,EACjC,MAAM,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,KACvC,WA2IF,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,QAAQ,WAAW,KAAG,MAErD,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,QAAQ,WAAW,KAAG,uBAAuB,EAEhF,CAAC;AAEF,eAAO,MAAM,yBAAyB,GAAI,QAAQ,WAAW,KAAG,uBAAuB,EAEtF,CAAC;AAEF,eAAO,MAAM,yBAAyB,GAAI,QAAQ,WAAW,KAAG,MAAM,GAAG,SAExE,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,QAAQ,WAAW,KAAG,kBAEzD,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAAI,QAAQ,WAAW,KAAG,OAE5D,CAAC"}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import { defaultJBAppConfig } from './defaults';
|
|
2
|
+
import { deepMerge } from './merge';
|
|
3
|
+
export const createJBWebConfig = (baseConfig, overrides) => {
|
|
4
|
+
const withBase = deepMerge(defaultJBAppConfig, baseConfig);
|
|
5
|
+
const resolvedConfig = deepMerge(withBase, overrides);
|
|
6
|
+
const signupRoles = (resolvedConfig.auth?.profileRoles ?? []).filter((role) => role.allowSignup === true);
|
|
7
|
+
const defaultProfileRole = resolvedConfig.auth?.defaultProfileRole;
|
|
8
|
+
if (defaultProfileRole) {
|
|
9
|
+
const hasValidDefaultSignupRole = signupRoles.some((role) => role.value === defaultProfileRole);
|
|
10
|
+
if (!hasValidDefaultSignupRole) {
|
|
11
|
+
throw new Error(`[jb-web-config] auth.defaultProfileRole="${defaultProfileRole}" must exist in auth.profileRoles with allowSignup=true.`);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
const socialConfig = resolvedConfig.auth?.social;
|
|
15
|
+
if (socialConfig) {
|
|
16
|
+
Object.keys(socialConfig).forEach((providerName) => {
|
|
17
|
+
const providerConfig = socialConfig[providerName];
|
|
18
|
+
if (providerConfig?.enabled && !providerConfig.clientId?.trim()) {
|
|
19
|
+
throw new Error(`[jb-web-config] auth.social.${providerName}.clientId is required when auth.social.${providerName}.enabled=true.`);
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
return resolvedConfig;
|
|
24
|
+
};
|
|
25
|
+
export const resolveApiHostByStage = (hostConfig, stage) => {
|
|
26
|
+
return hostConfig[stage];
|
|
27
|
+
};
|
|
28
|
+
export const getStageValue = (stageMap, stage, fallback) => {
|
|
29
|
+
if (!stageMap) {
|
|
30
|
+
return fallback;
|
|
31
|
+
}
|
|
32
|
+
const lowerStage = stage.toLowerCase();
|
|
33
|
+
const value = stageMap[stage] ?? stageMap[lowerStage];
|
|
34
|
+
return value ?? fallback;
|
|
35
|
+
};
|
|
36
|
+
export const getApiBaseUrl = (config) => {
|
|
37
|
+
return resolveApiHostByStage(config.api.host, config.stage);
|
|
38
|
+
};
|
|
39
|
+
export const getConfigStageValue = (config, stageMap, fallback) => {
|
|
40
|
+
return getStageValue(stageMap, config.stage, fallback);
|
|
41
|
+
};
|
|
42
|
+
export const createJBWebConfigFromEnv = (baseConfig, env) => {
|
|
43
|
+
const resolveRuntimeEnv = () => {
|
|
44
|
+
if (env) {
|
|
45
|
+
return env;
|
|
46
|
+
}
|
|
47
|
+
try {
|
|
48
|
+
const importMetaEnv = import.meta.env;
|
|
49
|
+
if (importMetaEnv && typeof importMetaEnv === 'object') {
|
|
50
|
+
return importMetaEnv;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
catch {
|
|
54
|
+
// Ignore import.meta access errors outside of ESM/runtime contexts.
|
|
55
|
+
}
|
|
56
|
+
if (typeof globalThis !== 'undefined') {
|
|
57
|
+
const globalEnv = globalThis.__ENV__;
|
|
58
|
+
if (globalEnv && typeof globalEnv === 'object') {
|
|
59
|
+
return globalEnv;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return {};
|
|
63
|
+
};
|
|
64
|
+
const runtimeEnv = resolveRuntimeEnv();
|
|
65
|
+
const parseEnvList = (value) => {
|
|
66
|
+
if (!value) {
|
|
67
|
+
return undefined;
|
|
68
|
+
}
|
|
69
|
+
const normalizedValue = value.trim();
|
|
70
|
+
if (!normalizedValue) {
|
|
71
|
+
return undefined;
|
|
72
|
+
}
|
|
73
|
+
if (normalizedValue.startsWith('[') && normalizedValue.endsWith(']')) {
|
|
74
|
+
try {
|
|
75
|
+
const parsed = JSON.parse(normalizedValue);
|
|
76
|
+
if (Array.isArray(parsed)) {
|
|
77
|
+
return parsed
|
|
78
|
+
.map((item) => String(item).trim())
|
|
79
|
+
.filter(Boolean);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
catch {
|
|
83
|
+
// If JSON parsing fails, continue with comma-separated parsing.
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return normalizedValue
|
|
87
|
+
.split(',')
|
|
88
|
+
.map((item) => item.trim())
|
|
89
|
+
.filter(Boolean);
|
|
90
|
+
};
|
|
91
|
+
const parseBooleanEnv = (value) => {
|
|
92
|
+
if (typeof value === 'undefined') {
|
|
93
|
+
return undefined;
|
|
94
|
+
}
|
|
95
|
+
if (value === 'true') {
|
|
96
|
+
return true;
|
|
97
|
+
}
|
|
98
|
+
if (value === 'false') {
|
|
99
|
+
return false;
|
|
100
|
+
}
|
|
101
|
+
return undefined;
|
|
102
|
+
};
|
|
103
|
+
const googleEnabled = parseBooleanEnv(runtimeEnv.VITE_AUTH_SOCIAL_GOOGLE_ENABLED);
|
|
104
|
+
const facebookEnabled = parseBooleanEnv(runtimeEnv.VITE_AUTH_SOCIAL_FACEBOOK_ENABLED);
|
|
105
|
+
const appleEnabled = parseBooleanEnv(runtimeEnv.VITE_AUTH_SOCIAL_APPLE_ENABLED);
|
|
106
|
+
const apiHostOverrides = {};
|
|
107
|
+
const setApiHost = (stage, value) => {
|
|
108
|
+
if (!value) {
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
const normalizedValue = value.trim();
|
|
112
|
+
if (!normalizedValue) {
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
apiHostOverrides[stage] = normalizedValue;
|
|
116
|
+
};
|
|
117
|
+
setApiHost('PRODUCTION', runtimeEnv.VITE_API_HOST_PRODUCTION);
|
|
118
|
+
setApiHost('QA', runtimeEnv.VITE_API_HOST_QA);
|
|
119
|
+
setApiHost('DEVELOPMENT', runtimeEnv.VITE_API_HOST_DEVELOPMENT);
|
|
120
|
+
setApiHost('LOCAL', runtimeEnv.VITE_API_HOST_LOCAL);
|
|
121
|
+
return createJBWebConfig(baseConfig, {
|
|
122
|
+
debug: runtimeEnv.VITE_DEBUG === 'true' ? true : undefined,
|
|
123
|
+
stage: runtimeEnv.VITE_STAGE,
|
|
124
|
+
api: Object.keys(apiHostOverrides).length > 0 ? { host: apiHostOverrides } : undefined,
|
|
125
|
+
integrations: {
|
|
126
|
+
mapboxToken: runtimeEnv.VITE_MAPBOX_TOKEN
|
|
127
|
+
},
|
|
128
|
+
auth: {
|
|
129
|
+
apiBasePath: runtimeEnv.VITE_AUTH_BASE_PATH,
|
|
130
|
+
showDebugSocial: parseBooleanEnv(runtimeEnv.VITE_AUTH_SHOW_DEBUG_SOCIAL),
|
|
131
|
+
social: {
|
|
132
|
+
google: {
|
|
133
|
+
...(typeof googleEnabled === 'boolean' ? { enabled: googleEnabled } : {}),
|
|
134
|
+
clientId: runtimeEnv.VITE_AUTH_SOCIAL_GOOGLE_CLIENT_ID,
|
|
135
|
+
redirectUri: runtimeEnv.VITE_AUTH_SOCIAL_GOOGLE_REDIRECT_URI,
|
|
136
|
+
scope: runtimeEnv.VITE_AUTH_SOCIAL_GOOGLE_SCOPE,
|
|
137
|
+
scopes: parseEnvList(runtimeEnv.VITE_AUTH_SOCIAL_GOOGLE_SCOPES)
|
|
138
|
+
},
|
|
139
|
+
facebook: {
|
|
140
|
+
...(typeof facebookEnabled === 'boolean' ? { enabled: facebookEnabled } : {}),
|
|
141
|
+
clientId: runtimeEnv.VITE_AUTH_SOCIAL_FACEBOOK_CLIENT_ID,
|
|
142
|
+
redirectUri: runtimeEnv.VITE_AUTH_SOCIAL_FACEBOOK_REDIRECT_URI,
|
|
143
|
+
scope: runtimeEnv.VITE_AUTH_SOCIAL_FACEBOOK_SCOPE,
|
|
144
|
+
scopes: parseEnvList(runtimeEnv.VITE_AUTH_SOCIAL_FACEBOOK_SCOPES)
|
|
145
|
+
},
|
|
146
|
+
apple: {
|
|
147
|
+
...(typeof appleEnabled === 'boolean' ? { enabled: appleEnabled } : {}),
|
|
148
|
+
clientId: runtimeEnv.VITE_AUTH_SOCIAL_APPLE_CLIENT_ID,
|
|
149
|
+
redirectUri: runtimeEnv.VITE_AUTH_SOCIAL_APPLE_REDIRECT_URI,
|
|
150
|
+
scope: runtimeEnv.VITE_AUTH_SOCIAL_APPLE_SCOPE,
|
|
151
|
+
scopes: parseEnvList(runtimeEnv.VITE_AUTH_SOCIAL_APPLE_SCOPES),
|
|
152
|
+
usePopup: parseBooleanEnv(runtimeEnv.VITE_AUTH_SOCIAL_APPLE_USE_POPUP),
|
|
153
|
+
responseMode: runtimeEnv.VITE_AUTH_SOCIAL_APPLE_RESPONSE_MODE,
|
|
154
|
+
responseType: runtimeEnv.VITE_AUTH_SOCIAL_APPLE_RESPONSE_TYPE,
|
|
155
|
+
state: runtimeEnv.VITE_AUTH_SOCIAL_APPLE_STATE,
|
|
156
|
+
nonce: runtimeEnv.VITE_AUTH_SOCIAL_APPLE_NONCE
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
};
|
|
162
|
+
export const getAuthBasePath = (config) => {
|
|
163
|
+
return config.auth?.apiBasePath || '/authentication';
|
|
164
|
+
};
|
|
165
|
+
export const getAuthProfileRoles = (config) => {
|
|
166
|
+
return config.auth?.profileRoles ?? [];
|
|
167
|
+
};
|
|
168
|
+
export const getAuthSignupProfileRoles = (config) => {
|
|
169
|
+
return getAuthProfileRoles(config).filter((role) => role.allowSignup);
|
|
170
|
+
};
|
|
171
|
+
export const getAuthDefaultProfileRole = (config) => {
|
|
172
|
+
return config.auth?.defaultProfileRole;
|
|
173
|
+
};
|
|
174
|
+
export const getAuthSocialConfig = (config) => {
|
|
175
|
+
return config.auth?.social ?? defaultJBAppConfig.auth.social;
|
|
176
|
+
};
|
|
177
|
+
export const getAuthShowDebugSocial = (config) => {
|
|
178
|
+
return config.auth?.showDebugSocial ?? defaultJBAppConfig.auth.showDebugSocial;
|
|
179
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../src/config/defaults.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEtC,eAAO,MAAM,kBAAkB,EAAE,WAuChC,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export const defaultJBAppConfig = {
|
|
2
|
+
debug: false,
|
|
3
|
+
forceHideStage: false,
|
|
4
|
+
stage: 'DEVELOPMENT',
|
|
5
|
+
defaultRows: 30,
|
|
6
|
+
maxRows: 999999999,
|
|
7
|
+
momentLocale: 'es-mx',
|
|
8
|
+
defaultLocaleDate: 'es',
|
|
9
|
+
dateFormat: 'YYYY-MM-DD',
|
|
10
|
+
dateTimeFormat: 'dddd DD MMM YYYY HH:mm:ss',
|
|
11
|
+
defaultFormatDateAPI: 'YYYY-MM-DD',
|
|
12
|
+
api: {
|
|
13
|
+
version: 'v1',
|
|
14
|
+
host: {
|
|
15
|
+
PRODUCTION: 'https://api.example.com',
|
|
16
|
+
QA: 'https://api-qa.example.com',
|
|
17
|
+
DEVELOPMENT: 'http://127.0.0.1:8000',
|
|
18
|
+
LOCAL: 'http://localhost:8000'
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
auth: {
|
|
22
|
+
apiBasePath: '/authentication',
|
|
23
|
+
showDebugSocial: false,
|
|
24
|
+
profileRoles: [],
|
|
25
|
+
defaultProfileRole: undefined,
|
|
26
|
+
social: {
|
|
27
|
+
google: {
|
|
28
|
+
enabled: false
|
|
29
|
+
},
|
|
30
|
+
facebook: {
|
|
31
|
+
enabled: false
|
|
32
|
+
},
|
|
33
|
+
apple: {
|
|
34
|
+
enabled: false
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
integrations: {}
|
|
39
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"merge.d.ts","sourceRoot":"","sources":["../../src/config/merge.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,SAAS,GAAI,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,EAAE,YAAY,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAG,CAqB3G,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
const isPlainObject = (value) => typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
2
|
+
export const deepMerge = (base, overrides) => {
|
|
3
|
+
if (!overrides) {
|
|
4
|
+
return { ...base };
|
|
5
|
+
}
|
|
6
|
+
const output = { ...base };
|
|
7
|
+
for (const [key, overrideValue] of Object.entries(overrides)) {
|
|
8
|
+
const baseValue = output[key];
|
|
9
|
+
if (isPlainObject(baseValue) && isPlainObject(overrideValue)) {
|
|
10
|
+
output[key] = deepMerge(baseValue, overrideValue);
|
|
11
|
+
continue;
|
|
12
|
+
}
|
|
13
|
+
if (overrideValue !== undefined) {
|
|
14
|
+
output[key] = overrideValue;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
return output;
|
|
18
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export type JBAppStage = 'PRODUCTION' | 'QA' | 'DEVELOPMENT' | 'LOCAL';
|
|
2
|
+
export type JBAppStageLowercase = Lowercase<JBAppStage>;
|
|
3
|
+
export type JBStageValueMap<T> = Partial<Record<JBAppStage, T>> & Partial<Record<JBAppStageLowercase, T>>;
|
|
4
|
+
export type JBApiHostConfig = Record<JBAppStage, string>;
|
|
5
|
+
export type JBAuthProfileRoleOption = {
|
|
6
|
+
value: string;
|
|
7
|
+
label: string;
|
|
8
|
+
allowSignup?: boolean;
|
|
9
|
+
};
|
|
10
|
+
export type JBSocialProviderName = 'google' | 'facebook' | 'apple';
|
|
11
|
+
export type JBAuthSocialProviderConfig = {
|
|
12
|
+
enabled: boolean;
|
|
13
|
+
clientId?: string;
|
|
14
|
+
redirectUri?: string;
|
|
15
|
+
scope?: string;
|
|
16
|
+
scopes?: string[];
|
|
17
|
+
usePopup?: boolean;
|
|
18
|
+
responseMode?: 'web_message' | 'form_post' | 'query' | 'fragment';
|
|
19
|
+
responseType?: 'code' | 'id_token' | 'code id_token';
|
|
20
|
+
state?: string;
|
|
21
|
+
nonce?: string;
|
|
22
|
+
};
|
|
23
|
+
export type JBAuthSocialConfig = Record<JBSocialProviderName, JBAuthSocialProviderConfig>;
|
|
24
|
+
export type JBAppConfig = {
|
|
25
|
+
debug: boolean;
|
|
26
|
+
forceHideStage: boolean;
|
|
27
|
+
stage: JBAppStage;
|
|
28
|
+
defaultRows: number;
|
|
29
|
+
maxRows: number;
|
|
30
|
+
momentLocale: string;
|
|
31
|
+
defaultLocaleDate: string;
|
|
32
|
+
dateFormat: string;
|
|
33
|
+
dateTimeFormat: string;
|
|
34
|
+
defaultFormatDateAPI: string;
|
|
35
|
+
api: {
|
|
36
|
+
version: string;
|
|
37
|
+
host: JBApiHostConfig;
|
|
38
|
+
};
|
|
39
|
+
auth: {
|
|
40
|
+
apiBasePath: string;
|
|
41
|
+
showDebugSocial: boolean;
|
|
42
|
+
profileRoles: JBAuthProfileRoleOption[];
|
|
43
|
+
defaultProfileRole?: string;
|
|
44
|
+
social: JBAuthSocialConfig;
|
|
45
|
+
};
|
|
46
|
+
integrations: Record<string, unknown>;
|
|
47
|
+
};
|
|
48
|
+
type JBDeepPartial<T> = T extends Array<infer U> ? Array<JBDeepPartial<U>> : T extends object ? {
|
|
49
|
+
[K in keyof T]?: JBDeepPartial<T[K]>;
|
|
50
|
+
} : T;
|
|
51
|
+
export type JBAppConfigOverrides = JBDeepPartial<JBAppConfig>;
|
|
52
|
+
export {};
|
|
53
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/config/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG,YAAY,GAAG,IAAI,GAAG,aAAa,GAAG,OAAO,CAAC;AACvE,MAAM,MAAM,mBAAmB,GAAG,SAAS,CAAC,UAAU,CAAC,CAAC;AACxD,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,mBAAmB,EAAE,CAAC,CAAC,CAAC,CAAC;AAE1G,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;AAEzD,MAAM,MAAM,uBAAuB,GAAG;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,QAAQ,GAAG,UAAU,GAAG,OAAO,CAAC;AAEnE,MAAM,MAAM,0BAA0B,GAAG;IACvC,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,aAAa,GAAG,WAAW,GAAG,OAAO,GAAG,UAAU,CAAC;IAClE,YAAY,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,eAAe,CAAC;IACrD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,oBAAoB,EAAE,0BAA0B,CAAC,CAAC;AAE1F,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,EAAE,OAAO,CAAC;IACf,cAAc,EAAE,OAAO,CAAC;IACxB,KAAK,EAAE,UAAU,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,GAAG,EAAE;QACH,OAAO,EAAE,MAAM,CAAC;QAChB,IAAI,EAAE,eAAe,CAAC;KACvB,CAAC;IACF,IAAI,EAAE;QACJ,WAAW,EAAE,MAAM,CAAC;QACpB,eAAe,EAAE,OAAO,CAAC;QACzB,YAAY,EAAE,uBAAuB,EAAE,CAAC;QACxC,kBAAkB,CAAC,EAAE,MAAM,CAAC;QAC5B,MAAM,EAAE,kBAAkB,CAAC;KAC5B,CAAC;IACF,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACvC,CAAC;AAEF,KAAK,aAAa,CAAC,CAAC,IAAI,CAAC,SAAS,KAAK,CAAC,MAAM,CAAC,CAAC,GAC5C,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,GACvB,CAAC,SAAS,MAAM,GACd;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,GACxC,CAAC,CAAC;AAER,MAAM,MAAM,oBAAoB,GAAG,aAAa,CAAC,WAAW,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ButtonProps } from '@mui/material';
|
|
2
|
+
export type JBButtonAction = 'save' | 'edit' | 'cancel' | 'delete' | 'primary' | 'secondary';
|
|
3
|
+
export type JBButtonProps = Omit<ButtonProps, 'size' | 'action'> & {
|
|
4
|
+
action?: JBButtonAction;
|
|
5
|
+
size?: ButtonProps['size'];
|
|
6
|
+
};
|
|
7
|
+
export declare function JBButton(props: JBButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
//# sourceMappingURL=JBButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"JBButton.d.ts","sourceRoot":"","sources":["../../../src/core/buttons/JBButton.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAU,WAAW,EAAE,MAAM,eAAe,CAAC;AAGpD,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,WAAW,CAAC;AAE7F,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,WAAW,EAAE,MAAM,GAAG,QAAQ,CAAC,GAAG;IACjE,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,IAAI,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CAC5B,CAAC;AA6BF,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,2CA6C5C"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import CloseRoundedIcon from '@mui/icons-material/CloseRounded';
|
|
3
|
+
import DeleteRoundedIcon from '@mui/icons-material/DeleteRounded';
|
|
4
|
+
import EditRoundedIcon from '@mui/icons-material/EditRounded';
|
|
5
|
+
import SaveRoundedIcon from '@mui/icons-material/SaveRounded';
|
|
6
|
+
import { Button } from '@mui/material';
|
|
7
|
+
const ACTION_VARIANT = {
|
|
8
|
+
save: 'contained',
|
|
9
|
+
edit: 'contained',
|
|
10
|
+
cancel: 'outlined',
|
|
11
|
+
delete: 'contained',
|
|
12
|
+
primary: 'contained',
|
|
13
|
+
secondary: 'contained'
|
|
14
|
+
};
|
|
15
|
+
const ACTION_COLOR = {
|
|
16
|
+
save: 'primary',
|
|
17
|
+
edit: 'warning',
|
|
18
|
+
cancel: undefined,
|
|
19
|
+
delete: 'error',
|
|
20
|
+
primary: 'primary',
|
|
21
|
+
secondary: 'secondary'
|
|
22
|
+
};
|
|
23
|
+
const ACTION_ICON = {
|
|
24
|
+
save: _jsx(SaveRoundedIcon, { fontSize: "small" }),
|
|
25
|
+
edit: _jsx(EditRoundedIcon, { fontSize: "small" }),
|
|
26
|
+
cancel: _jsx(CloseRoundedIcon, { fontSize: "small" }),
|
|
27
|
+
delete: _jsx(DeleteRoundedIcon, { fontSize: "small" }),
|
|
28
|
+
primary: undefined,
|
|
29
|
+
secondary: undefined
|
|
30
|
+
};
|
|
31
|
+
export function JBButton(props) {
|
|
32
|
+
const { action, size = 'large', variant, color, startIcon, sx, children, ...rest } = props;
|
|
33
|
+
const resolvedVariant = variant ?? (action ? ACTION_VARIANT[action] : 'contained');
|
|
34
|
+
const resolvedColor = color ?? (action ? ACTION_COLOR[action] : 'primary');
|
|
35
|
+
const resolvedStartIcon = startIcon ?? (action ? ACTION_ICON[action] : undefined);
|
|
36
|
+
return (_jsx(Button, { ...rest, size: size, variant: resolvedVariant, color: resolvedColor, startIcon: resolvedStartIcon, sx: [
|
|
37
|
+
() => ({
|
|
38
|
+
borderRadius: 1.5,
|
|
39
|
+
minHeight: 42,
|
|
40
|
+
px: 2.25,
|
|
41
|
+
fontWeight: 700,
|
|
42
|
+
...(resolvedVariant === 'contained'
|
|
43
|
+
? {
|
|
44
|
+
boxShadow: 'none',
|
|
45
|
+
backgroundImage: 'none',
|
|
46
|
+
'&:hover': {
|
|
47
|
+
boxShadow: 'none',
|
|
48
|
+
backgroundImage: 'none'
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
: {})
|
|
52
|
+
}),
|
|
53
|
+
...(Array.isArray(sx) ? sx : sx ? [sx] : [])
|
|
54
|
+
], children: children }));
|
|
55
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/buttons/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC"}
|