Skip to content

Commit

Permalink
feat!: update font, font-weight and remove Rubik (#840)
Browse files Browse the repository at this point in the history
* feat!: update font, font-weight and remove Rubik

* test: add more EV stories
  • Loading branch information
porcellus authored Jul 31, 2024
1 parent 99159a8 commit cadb778
Show file tree
Hide file tree
Showing 61 changed files with 157 additions and 402 deletions.
5 changes: 4 additions & 1 deletion .circleci/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@ then
cd ..
npm publish --tag latest
npm i || exit $?
npx -y chromatic --auto-accept-changes master
npx -y chromatic --auto-accept-changes --branch=master
npx -y chromatic --auto-accept-changes --branch=$version
else
cd ..
npm publish --tag version-$version
npm i || exit $?
npx -y chromatic --auto-accept-changes --branch=$version
fi
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [unreleased]

## [0.45.0] - 2024-07-31

### Breaking changes

- Updated the font and font-weights in the default styles
- We no longer load the Rubik font by default

## [0.44.0] - 2024-07-15

- Removes the default `maxAgeInSeconds` value (previously 300 seconds) in EmailVerification Claim. If the claim value is true and `maxAgeInSeconds` is not provided, it will not be refreshed.
Expand Down
1 change: 0 additions & 1 deletion examples/for-tests-react-16/src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
justify-content: stretch;
width: 100vw;
height: 100vh;
font-family: Rubik;
}

.fill {
Expand Down
1 change: 0 additions & 1 deletion examples/for-tests/src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
justify-content: stretch;
width: 100vw;
height: 100vh;
font-family: Rubik;
}

.fill {
Expand Down
18 changes: 3 additions & 15 deletions lib/build/emailpasswordprebuiltui.js

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

16 changes: 3 additions & 13 deletions lib/build/emailverification-shared2.js

Large diffs are not rendered by default.

4 changes: 1 addition & 3 deletions lib/build/emailverificationprebuiltui.js

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

2 changes: 1 addition & 1 deletion lib/build/genericComponentOverrideContext.js

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

60 changes: 8 additions & 52 deletions lib/build/index2.js

Large diffs are not rendered by default.

18 changes: 3 additions & 15 deletions lib/build/multifactorauthprebuiltui.js

Large diffs are not rendered by default.

51 changes: 9 additions & 42 deletions lib/build/passwordlessprebuiltui.js

Large diffs are not rendered by default.

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

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

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

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

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

1 change: 0 additions & 1 deletion lib/build/recipe/session/components/themes/themeBase.d.ts

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

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

1 change: 0 additions & 1 deletion lib/build/recipe/totp/components/themes/themeBase.d.ts

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

22 changes: 4 additions & 18 deletions lib/build/sessionprebuiltui.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion lib/build/styles/styles.d.ts

This file was deleted.

24 changes: 4 additions & 20 deletions lib/build/thirdpartyprebuiltui.js

Large diffs are not rendered by default.

22 changes: 4 additions & 18 deletions lib/build/totpprebuiltui.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/build/version.d.ts

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

2 changes: 1 addition & 1 deletion lib/ts/components/assets/errorLargeIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default function ErrorLargeIcon(): JSX.Element {
</g>
<text
fill="#fff"
font-family="Rubik-Bold, Rubik"
font-family="Arial-Bold, Arial"
font-size="18px"
fontWeight="700"
transform="translate(-824.894 -352.483) translate(838.997 377.437)">
Expand Down
4 changes: 1 addition & 3 deletions lib/ts/recipe/authRecipe/components/theme/authPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
*/

import { SuperTokensBranding } from "../../../../../components/SuperTokensBranding";
import { hasFontDefined } from "../../../../../styles/styles";
import SuperTokens from "../../../../../superTokens";
import UserContextWrapper from "../../../../../usercontext/userContextWrapper";
import GeneralError from "../../../../emailpassword/components/library/generalError";
Expand Down Expand Up @@ -69,11 +68,10 @@ export function AuthPageTheme(props: AuthPageThemeProps): JSX.Element {

function AuthPageThemeWrapper(props: AuthPageThemeProps): JSX.Element {
const rootStyle = SuperTokens.getInstanceOrThrow().rootStyle;
const hasFont = hasFontDefined(rootStyle);

return (
<UserContextWrapper userContext={props.userContext}>
<ThemeBase loadDefaultFont={!hasFont} userStyles={[rootStyle]}>
<ThemeBase userStyles={[rootStyle]}>
<AuthPageTheme {...props} />
</ThemeBase>
</UserContextWrapper>
Expand Down
13 changes: 4 additions & 9 deletions lib/ts/recipe/authRecipe/components/theme/themeBase.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,13 @@ import styles from "../../../../styles/styles.css";

import type { PropsWithChildren } from "react";

export const ThemeBase: React.FC<
PropsWithChildren<{ loadDefaultFont: boolean; userStyles: Array<string | undefined> }>
> = ({ children, userStyles, loadDefaultFont }) => {
export const ThemeBase: React.FC<PropsWithChildren<{ userStyles: Array<string | undefined> }>> = ({
children,
userStyles,
}) => {
return (
<Fragment>
{children}
{loadDefaultFont && (
<link
href="//fonts.googleapis.com/css2?family=Rubik:wght@300;400;500;600;700"
rel="stylesheet"
type="text/css"></link>
)}
<style>
{styles}
{userStyles.join("\n")}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
/*
* Imports.
*/
import { hasFontDefined } from "../../../../../styles/styles";
import SuperTokens from "../../../../../superTokens";
import UserContextWrapper from "../../../../../usercontext/userContextWrapper";
import { ThemeBase } from "../themeBase";
Expand Down Expand Up @@ -46,13 +45,12 @@ export function ResetPasswordUsingTokenTheme(props: ResetPasswordUsingTokenTheme

function ResetPasswordUsingTokenThemeWrapper(props: ResetPasswordUsingTokenThemeProps): JSX.Element {
const rootStyle = SuperTokens.getInstanceOrThrow().rootStyle;
const hasFont = hasFontDefined(rootStyle) || hasFontDefined(props.config.recipeRootStyle);
const userStyles = props.submitNewPasswordForm
? props.config.resetPasswordUsingTokenFeature.submitNewPasswordForm.style
: props.config.resetPasswordUsingTokenFeature.enterEmailForm.style;
return (
<UserContextWrapper userContext={props.userContext}>
<ThemeBase loadDefaultFont={!hasFont} userStyles={[rootStyle, props.config.recipeRootStyle, userStyles]}>
<ThemeBase userStyles={[rootStyle, props.config.recipeRootStyle, userStyles]}>
<ResetPasswordUsingTokenTheme {...props} />
</ThemeBase>
</UserContextWrapper>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import STGeneralError from "supertokens-web-js/utils/error";

import { withOverride } from "../../../../../components/componentOverride/withOverride";
import { hasFontDefined } from "../../../../../styles/styles";
import SuperTokens from "../../../../../superTokens";
import { useUserContext } from "../../../../../usercontext";
import UserContextWrapper from "../../../../../usercontext/userContextWrapper";
Expand Down Expand Up @@ -78,13 +77,12 @@ export const SignInForm = withOverride(

function SignInTheme(props: SignInThemeProps): JSX.Element {
const rootStyle = SuperTokens.getInstanceOrThrow().rootStyle;
const hasFont = hasFontDefined(rootStyle) || hasFontDefined(props.config.recipeRootStyle);

const activeStyle = props.config.signInAndUpFeature.signInForm.style;

return (
<UserContextWrapper userContext={props.userContext}>
<ThemeBase loadDefaultFont={!hasFont} userStyles={[rootStyle, props.config.recipeRootStyle, activeStyle]}>
<ThemeBase userStyles={[rootStyle, props.config.recipeRootStyle, activeStyle]}>
<SignInForm {...props} />
</ThemeBase>
</UserContextWrapper>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import STGeneralError from "supertokens-web-js/lib/build/error";

import { withOverride } from "../../../../../components/componentOverride/withOverride";
import { hasFontDefined } from "../../../../../styles/styles";
import SuperTokens from "../../../../../superTokens";
import { useUserContext } from "../../../../../usercontext";
import UserContextWrapper from "../../../../../usercontext/userContextWrapper";
Expand Down Expand Up @@ -76,13 +75,12 @@ export const SignUpForm = withOverride(

function SignUpTheme(props: SignUpThemeProps): JSX.Element {
const rootStyle = SuperTokens.getInstanceOrThrow().rootStyle;
const hasFont = hasFontDefined(rootStyle) || hasFontDefined(props.config.recipeRootStyle);

const activeStyle = props.config.signInAndUpFeature.signUpForm.style;

return (
<UserContextWrapper userContext={props.userContext}>
<ThemeBase loadDefaultFont={!hasFont} userStyles={[rootStyle, props.config.recipeRootStyle, activeStyle]}>
<ThemeBase userStyles={[rootStyle, props.config.recipeRootStyle, activeStyle]}>
<SignUpForm {...props} />
</ThemeBase>
</UserContextWrapper>
Expand Down
14 changes: 3 additions & 11 deletions lib/ts/recipe/emailpassword/components/themes/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@

[data-supertokens~="label"] {
text-align: left;
font-weight: 500;
font-weight: 400;
font-size: var(--font-size-1);
line-height: 24px;
color: rgb(var(--palette-textLabel));
Expand All @@ -148,19 +148,11 @@
margin-top: 11px;
}

[data-supertokens~="headerTinyTitle"] {
margin-top: 13px;
font-size: var(--font-size-3);
letter-spacing: 1.1px;
font-weight: 500;
line-height: 28px;
}

[data-supertokens~="sendVerifyEmailText"] {
line-height: 21px;
font-size: var(--font-size-1);
text-align: center;
font-weight: 300;
font-weight: 400;
letter-spacing: 0.8px;
}

Expand All @@ -177,7 +169,7 @@

[data-supertokens~="sendVerifyEmailResend"] {
margin-top: 13px;
font-weight: 300;
font-weight: 400;
}

[data-supertokens~="sendVerifyEmailResend"]:hover {
Expand Down
13 changes: 4 additions & 9 deletions lib/ts/recipe/emailpassword/components/themes/themeBase.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,13 @@ import styles from "./styles.css";

import type { PropsWithChildren } from "react";

export const ThemeBase: React.FC<
PropsWithChildren<{ loadDefaultFont: boolean; userStyles: Array<string | undefined> }>
> = ({ children, userStyles, loadDefaultFont }) => {
export const ThemeBase: React.FC<PropsWithChildren<{ userStyles: Array<string | undefined> }>> = ({
children,
userStyles,
}) => {
return (
<Fragment>
{children}
{loadDefaultFont && (
<link
href="//fonts.googleapis.com/css2?family=Rubik:wght@300;400;500;600;700"
rel="stylesheet"
type="text/css"></link>
)}
<style>
{styles}
{userStyles.join("\n")}
Expand Down
Loading

0 comments on commit cadb778

Please sign in to comment.