Skip to content

Commit

Permalink
fix: Jan review 1
Browse files Browse the repository at this point in the history
  • Loading branch information
bharatkashyap committed Feb 6, 2025
1 parent a7fd3a5 commit a2d8d67
Show file tree
Hide file tree
Showing 13 changed files with 25 additions and 108 deletions.
2 changes: 2 additions & 0 deletions docs/data/toolpad/core/introduction/base-concepts.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ To translate all your Toolpad components, you can provide translations through t

```tsx
import { createTheme, ThemeProvider } from '@mui/material/styles';
import { hiIN as coreHiIn } from '@mui/material/locale';
import hiIN from '@toolpad/core/locales/hiIN';

const theme = createTheme({
Expand All @@ -128,6 +129,7 @@ const theme = createTheme({
primary: { main: '#1976d2' },
},
},
coreHiIn,
hiIN,
});

Expand Down
7 changes: 1 addition & 6 deletions docs/pages/toolpad/core/api/account.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
{
"props": {
"localeText": {
"type": {
"name": "shape",
"description": "{ accountPreviewIconButtonLabel?: string, accountPreviewTitle?: string, accountSignInLabel?: string, accountSignOutLabel?: string }"
}
},
"localeText": { "type": { "name": "object" } },
"slotProps": {
"type": {
"name": "shape",
Expand Down
7 changes: 1 addition & 6 deletions docs/pages/toolpad/core/api/app-provider.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,7 @@
},
"default": "null"
},
"localeText": {
"type": {
"name": "shape",
"description": "{ accountPreviewIconButtonLabel?: string, accountPreviewTitle?: string, accountSignInLabel?: string, accountSignOutLabel?: string, alert?: string, cancel?: string, close?: string, confirm?: string, delete?: string, email?: string, loading?: string, magicLinkSignInTitle?: string, oauthSignInTitle?: string, ok?: string, or?: string, passkey?: string, passkeySignInTitle?: string, password?: string, save?: string, signInRememberMe?: string, signInSubtitle?: string, signInTitle?: string, to?: string, username?: string, with?: string }"
}
},
"localeText": { "type": { "name": "object" } },
"navigation": {
"type": {
"name": "arrayOf",
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/toolpad/core/api/dashboard-layout.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"slotProps": {
"type": {
"name": "shape",
"description": "{ appTitle?: { branding?: { homeUrl?: string, logo?: node, title?: string } }, sidebarFooter?: { mini: bool }, toolbarAccount?: { localeText?: { accountPreviewIconButtonLabel?: string, accountPreviewTitle?: string, accountSignInLabel?: string, accountSignOutLabel?: string }, slotProps?: { popover?: object, popoverContent?: object, preview?: object, signInButton?: object, signOutButton?: object }, slots?: { popover?: elementType, popoverContent?: elementType, preview?: elementType, signInButton?: elementType, signOutButton?: elementType } }, toolbarActions?: object }"
"description": "{ appTitle?: { branding?: { homeUrl?: string, logo?: node, title?: string } }, sidebarFooter?: { mini: bool }, toolbarAccount?: { localeText?: object, slotProps?: { popover?: object, popoverContent?: object, preview?: object, signInButton?: object, signOutButton?: object }, slots?: { popover?: elementType, popoverContent?: elementType, preview?: elementType, signInButton?: elementType, signOutButton?: elementType } }, toolbarActions?: object }"
},
"default": "{}"
},
Expand Down
9 changes: 1 addition & 8 deletions docs/pages/toolpad/core/api/localization-provider.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
{
"props": {
"localeText": {
"type": {
"name": "shape",
"description": "{ accountPreviewIconButtonLabel?: string, accountPreviewTitle?: string, accountSignInLabel?: string, accountSignOutLabel?: string, alert?: string, cancel?: string, close?: string, confirm?: string, delete?: string, email?: string, loading?: string, magicLinkSignInTitle?: string, oauthSignInTitle?: string, ok?: string, or?: string, passkey?: string, passkeySignInTitle?: string, password?: string, save?: string, signInRememberMe?: string, signInSubtitle?: string, signInTitle?: string, to?: string, username?: string, with?: string }"
}
}
},
"props": { "localeText": { "type": { "name": "object" } } },
"name": "LocalizationProvider",
"imports": ["import { LocalizationProvider } from '@toolpad/core/AppProvider';"],
"classes": [],
Expand Down
7 changes: 1 addition & 6 deletions docs/pages/toolpad/core/api/sign-in-page.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
{
"props": {
"localeText": {
"type": {
"name": "shape",
"description": "{ email?: string, or?: string, passkey?: string, password?: string, signInRememberMe?: string, signInSubtitle?: string, signInTitle?: string, to?: string, with?: string }"
}
},
"localeText": { "type": { "name": "object" } },
"providers": {
"type": { "name": "arrayOf", "description": "Array<{ id: string, name: string }>" },
"default": "[]"
Expand Down
7 changes: 1 addition & 6 deletions packages/toolpad-core/src/Account/Account.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -211,12 +211,7 @@ Account.propTypes /* remove-proptypes */ = {
/**
* The labels for the account component.
*/
localeText: PropTypes.shape({
accountPreviewIconButtonLabel: PropTypes.string,
accountPreviewTitle: PropTypes.string,
accountSignInLabel: PropTypes.string,
accountSignOutLabel: PropTypes.string,
}),
localeText: PropTypes.object,
/**
* The props used for each slot inside.
*/
Expand Down
28 changes: 1 addition & 27 deletions packages/toolpad-core/src/AppProvider/AppProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -213,33 +213,7 @@ AppProvider.propTypes /* remove-proptypes */ = {
/**
* Locale text for components
*/
localeText: PropTypes.shape({
accountPreviewIconButtonLabel: PropTypes.string,
accountPreviewTitle: PropTypes.string,
accountSignInLabel: PropTypes.string,
accountSignOutLabel: PropTypes.string,
alert: PropTypes.string,
cancel: PropTypes.string,
close: PropTypes.string,
confirm: PropTypes.string,
delete: PropTypes.string,
email: PropTypes.string,
loading: PropTypes.string,
magicLinkSignInTitle: PropTypes.string,
oauthSignInTitle: PropTypes.string,
ok: PropTypes.string,
or: PropTypes.string,
passkey: PropTypes.string,
passkeySignInTitle: PropTypes.string,
password: PropTypes.string,
save: PropTypes.string,
signInRememberMe: PropTypes.string,
signInSubtitle: PropTypes.string,
signInTitle: PropTypes.string,
to: PropTypes.string,
username: PropTypes.string,
with: PropTypes.string,
}),
localeText: PropTypes.object,
/**
* Navigation definition for the app.
* @default []
Expand Down
28 changes: 1 addition & 27 deletions packages/toolpad-core/src/AppProvider/LocalizationProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,33 +87,7 @@ LocalizationProvider.propTypes /* remove-proptypes */ = {
/**
* Locale for components texts
*/
localeText: PropTypes.shape({
accountPreviewIconButtonLabel: PropTypes.string,
accountPreviewTitle: PropTypes.string,
accountSignInLabel: PropTypes.string,
accountSignOutLabel: PropTypes.string,
alert: PropTypes.string,
cancel: PropTypes.string,
close: PropTypes.string,
confirm: PropTypes.string,
delete: PropTypes.string,
email: PropTypes.string,
loading: PropTypes.string,
magicLinkSignInTitle: PropTypes.string,
oauthSignInTitle: PropTypes.string,
ok: PropTypes.string,
or: PropTypes.string,
passkey: PropTypes.string,
passkeySignInTitle: PropTypes.string,
password: PropTypes.string,
save: PropTypes.string,
signInRememberMe: PropTypes.string,
signInSubtitle: PropTypes.string,
signInTitle: PropTypes.string,
to: PropTypes.string,
username: PropTypes.string,
with: PropTypes.string,
}),
localeText: PropTypes.object,
} as any;

export { LocalizationProvider };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -545,12 +545,7 @@ DashboardLayout.propTypes /* remove-proptypes */ = {
mini: PropTypes.bool.isRequired,
}),
toolbarAccount: PropTypes.shape({
localeText: PropTypes.shape({
accountPreviewIconButtonLabel: PropTypes.string,
accountPreviewTitle: PropTypes.string,
accountSignInLabel: PropTypes.string,
accountSignOutLabel: PropTypes.string,
}),
localeText: PropTypes.object,
slotProps: PropTypes.shape({
popover: PropTypes.object,
popoverContent: PropTypes.object,
Expand Down
12 changes: 1 addition & 11 deletions packages/toolpad-core/src/SignInPage/SignInPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -731,17 +731,7 @@ SignInPage.propTypes /* remove-proptypes */ = {
/**
* The labels for the account component.
*/
localeText: PropTypes.shape({
email: PropTypes.string,
or: PropTypes.string,
passkey: PropTypes.string,
password: PropTypes.string,
signInRememberMe: PropTypes.string,
signInSubtitle: PropTypes.string,
signInTitle: PropTypes.string,
to: PropTypes.string,
with: PropTypes.string,
}),
localeText: PropTypes.object,
/**
* The list of authentication providers to display.
* @default []
Expand Down
13 changes: 9 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions scripts/generateProptypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ async function generateProptypes(
filePath: tsFile,
project,
shouldResolveObject: ({ name }) => {
const propsToNotResolve = ['localeText'];
if (propsToNotResolve.includes(name)) {
return false;
}
if (
name.toLowerCase().endsWith('classes') ||
name === 'theme' ||
Expand Down

0 comments on commit a2d8d67

Please sign in to comment.