8000 refactor (Text): Migrate Text to v1 in SDK by paanSinghCoder · Pull Request #994 · raystack/frontier · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

refactor (Text): Migrate Text to v1 in SDK #994

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions sdks/js/packages/core/react/components/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Flex, Text } from '@raystack/apsara';
import { Flex, Text } from '@raystack/apsara/v1';
import React, { ComponentPropsWithRef } from 'react';
import logo from '~/react/assets/logo.png';

Expand Down Expand Up @@ -29,7 +29,7 @@ export const Header = ({ title, logo }: HeaderProps) => {
>
<div>{logo ? logo : defaultLogo}</div>
<div className={styles.title}>
<Text size={9}>{title}</Text>
<Text className={styles.titleText}>{title}</Text>
</div>
</Flex>
);
Expand Down
4 changes: 2 additions & 2 deletions sdks/js/packages/core/react/components/Layout/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Flex, Text } from '@raystack/apsara';
import { Flex, Text } from '@raystack/apsara/v1';
import { PropsWithChildren } from 'react';
import styles from './layout.module.css';

Expand All @@ -10,7 +10,7 @@ export function Layout({ title, children }: PropsWithChildren<LayoutProps>) {
return (
<Flex direction="column" style={{ width: '100%' }}>
<Flex className={styles.header}>
<Text size={6}>{title}</Text>
<Text size="large" weight="medium">{title}</Text>
</Flex>
<Flex direction="column" gap="large" className={styles.container}>
{children}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
} from 'react-image-crop';
import { UploadIcon } from '@radix-ui/react-icons';
import React, { useRef, useState } from 'react';

import { Dialog, Flex, Text } from '@raystack/apsara';
import { Button, Avatar, Image } from '@raystack/apsara/v1';

Expand All @@ -15,7 +16,7 @@
interface CropModalProps {
imgSrc?: string;
onClose: () => void;
onSave: (data: string) => void;

Check warning on line 19 in sdks/js/packages/core/react/components/avatar-upload/index.tsx

View workflow job for this annotation

GitHub Actions / JS SDK Lint

'data' is defined but never used
}

function CropModal({ onClose, imgSrc, onSave }: CropModalProps) {
Expand Down Expand Up @@ -99,7 +100,7 @@
borderBottom: '1px solid var(--border-subtle)'
}}
>
<Text size={6} style={{ fontWeight: '500' }}>
<Text size="large" weight="medium">
Crop your photo
</Text>
<Image
Expand Down Expand Up @@ -165,7 +166,7 @@
interface AvatarUploadProps {
subText?: string;
value?: string;
onChange?: (value: string) => void;

Check warning on line 169 in sdks/js/packages/core/react/components/avatar-upload/index.tsx

View workflow job for this annotation

GitHub Actions / JS SDK Lint

'value' is defined but never used
disabled?: boolean;
initials?: string;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Flex, Text } from '@raystack/apsara';
import { Button, Skeleton } from '@raystack/apsara/v1';

import { Flex } from '@raystack/apsara';
import { Button, Skeleton, Text, toast } from '@raystack/apsara/v1';
import {
DEFAULT_DATE_FORMAT,
SUBSCRIPTION_STATES
Expand All @@ -16,7 +17,6 @@ import {
getPlanIntervalName,
getPlanNameWithInterval
} from '~/react/utils';
import { toast } from '@raystack/apsara/v1';

interface ChangeBannerProps {
isLoading?: boolean;
Expand Down Expand Up @@ -147,7 +147,7 @@ export function UpcomingPlanChangeBanner({
<Flex className={styles.changeBannerBox} justify={'between'}>
<Flex gap="small" className={styles.flex1} align={'center'}>
<InfoCircledIcon className={styles.currentPlanInfoText} />
<Text>
<Text size="regular" variant="primary">
Your {currentPlanName} will be{' '}
{planAction?.btnDoneLabel.toLowerCase()} to {upcomingPlanName} from{' '}
{expiryDate}.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
'use client';

import { Button } from '@raystack/apsara/v1';
import { Flex, Text, TextField } from '@raystack/apsara';
import { Button, Link, Text } from '@raystack/apsara/v1';
import { Flex, TextField } from '@raystack/apsara';
import React, {
ComponentPropsWithRef,
useCallback,
useEffect,
useRef,
useState
} from 'react';
import { Link } from '@raystack/apsara/v1';
import { Container } from '~/react/components/Container';
import { Header } from '~/react/components/Header';
import { useFrontier } from '~/react/contexts/FrontierContext';
Expand Down Expand Up @@ -81,7 +80,7 @@
setLoading(false);
}
},
[otp]

Check warning on line 83 in sdks/js/packages/core/react/components/onboarding/magiclink-verify.tsx

View workflow job for this annotation

GitHub Actions / JS SDK Lint

React Hook useCallback has missing dependencies: 'client' and 'stateParam'. Either include them or remove the dependency array
);

return (
Expand All @@ -89,9 +88,9 @@
<Flex direction={'column'} gap="medium">
<Header logo={logo} title={title} />
{emailParam && (
<Text>
<Text size="regular">
We have sent an OTP. Please check your inbox at
<b> {emailParam}</b>
<Text as="span" weight="medium"> {emailParam}</Text>
</Text>
)}
</Flex>
Expand All @@ -113,7 +112,7 @@
className={styles.textFieldCode}
/>

<Text size={2} className={styles.error}>
<Text size="small" variant="danger" className={styles.error}>
{submitError && String(submitError)}
</Text>
</Flex>
Expand All @@ -131,7 +130,7 @@
</form>

<Link href={config.redirectLogin || ''} data-test-id="back-to-login">
<Text size={2}>Back to login</Text>
<Text size="small">Back to login</Text>
</Link>
</Container>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { yupResolver } from '@hookform/resolvers/yup';
import { Flex, Text, TextField } from '@raystack/apsara';
import { Button, Separator } from '@raystack/apsara/v1';
import { TextField } from '@raystack/apsara';
import { Button, Flex, Separator, Text } from '@raystack/apsara/v1';
import React, { useCallback, useState } from 'react';
import { Controller, useForm } from 'react-hook-form';
import * as yup from 'yup';
Expand Down Expand Up @@ -135,9 +135,9 @@ export const MagicLink = ({ open = false, ...props }: MagicLinkProps) => {
/>

<Text
size={1}
size="micro"
variant="danger"
style={{
color: 'var(--foreground-danger)',
position: 'absolute',
top: 'calc(100% + 4px)'
}}
Expand Down
5 changes: 2 additions & 3 deletions sdks/js/packages/core/react/components/onboarding/oidc.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Button } from '@raystack/apsara/v1';
import { Text } from '@raystack/apsara';
import { Button, Text } from '@raystack/apsara/v1';
import React from 'react';
import GoogleLogo from '~/react/assets/logos/google-logo.svg';
import { capitalize } from '~/utils';
Expand Down Expand Up @@ -30,6 +29,6 @@ export const OIDCButton = ({
style={{ marginRight: '4px' }}
/>
) : null}
<Text>Continue with {capitalize(provider)}</Text>
<Text size="regular">Continue with {capitalize(provider)}</Text>
</Button>
);
6 changes: 3 additions & 3 deletions sdks/js/packages/core/react/components/onboarding/signin.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Flex, Text } from '@raystack/apsara';
import { Link } from '@raystack/apsara/v1';
import { Flex } from '@raystack/apsara';
import { Link, Text } from '@raystack/apsara/v1';
import React, { ComponentPropsWithRef, useCallback } from 'react';
import { useFrontier } from '~/react/contexts/FrontierContext';
import { Container } from '../Container';
Expand Down Expand Up @@ -63,7 +63,7 @@ export const SignIn = ({
</Flex>
{footer && (
<div style={{ fontWeight: '400' }}>
<Text size={2}>
<Text size="small">
Don&apos;t have an account?{' '}
<Link
href={config.redirectSignup || ''}
Expand Down
5 changes: 2 additions & 3 deletions sdks/js/packages/core/react/components/onboarding/signup.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Flex, Text } from '@raystack/apsara';
import { Link } from '@raystack/apsara/v1';
import { Link, Flex, Text } from '@raystack/apsara/v1';
import React, { ComponentPropsWithRef, useCallback } from 'react';
import { useFrontier } from '~/react/contexts/FrontierContext';
import { Container } from '../Container';
Expand Down Expand Up @@ -63,7 +62,7 @@ export const SignUp = ({
{mailotp && <MagicLink />}
</Flex>
<div style={{ fontWeight: '400' }}>
<Text size={2}>
<Text size="small">
Already have an account?{' '}
<Link
href={config.redirectLogin || ''}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ export const Subscribe = ({
gap="large"
>
<Flex direction="column" gap="small" style={{ width: '100%' }}>
<Text size={6} className={styles.subscribeTitle}>{title}</Text>
<Text size={4} className={styles.subscribeDescription}>{desc}</Text>
<Text size="large" weight="medium" className={styles.subscribeTitle}>{title}</Text>
<Text size="regular" className={styles.subscribeDescription}>{desc}</Text>
</Flex>
<InputField
{...register('name')}
Expand Down
4 changes: 2 additions & 2 deletions sdks/js/packages/core/react/components/onboarding/updates.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
title?: string;
preferenceTitle?: string;
preferenceDescription?: string;
onSubmit?: (data: FormData) => void;

Check warning on line 25 in sdks/js/packages/core/react/components/onboarding/updates.tsx

View workflow job for this annotation

GitHub Actions / JS SDK Lint

'data' is defined but never used
};

export const Updates = ({
Expand Down Expand Up @@ -71,7 +71,7 @@
>
<Flex direction="column" gap="medium">
<Flex justify="between">
<Text size={6} weight={500}>
<Text size="large" weight="medium">
{preferenceTitle}
</Text>
{isFetching ? (
Expand All @@ -90,7 +90,7 @@
/>
)}
</Flex>
<Text size={4} style={{ color: 'var(--foreground-muted)' }}>
<Text size="regular" variant="secondary">
{preferenceDescription}
</Text>
</Flex>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export const AddServiceAccount = () => {
>
<form >
<Flex justify="between" className={styles.addDialogForm}>
<Text size={6} weight={500}>
<Text size="large" weight="medium">
New Service Account
</Text>

Expand All @@ -150,7 +150,7 @@ export const AddServiceAccount = () => {
gap="medium"
className={styles.addDialogFormContent}
>
<Text>
<Text size="regular">
Create a dedicated service account to facilitate secure API
interactions on behalf of the organization.
</Text>
Expand All @@ -171,7 +171,7 @@ export const AddServiceAccount = () => {
control={control}
/>
)}
<Text size={1} variant="danger">
<Text size="micro" variant="danger">
{errors.title && String(errors.title?.message)}
</Text>
</InputField>
Expand Down Expand Up @@ -208,7 +208,7 @@ export const AddServiceAccount = () => {
control={control}
/>
)}
<Text size={1} variant="danger">
<Text size="micro" variant="danger">
{errors.project_id && String(errors.project_id?.message)}
</Text>
</InputField>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export const DeleteServiceAccount = () => {
className={styles.addDialogContent}
>
<Flex justify="between" className={styles.addDialogForm}>
<Text size={6} weight={500}>
<Text size="large" weight="medium">
Delete Service Account
</Text>

Expand All @@ -65,7 +65,7 @@ export const DeleteServiceAccount = () => {
gap="medium"
className={styles.addDialogFormContent}
>
<Text>
<Text size="regular">
This is an irreversible and permanent action doing this might result
in deletion of the service account and the keys associated with it.
Do you wish to proceed?
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Flex, EmptyState, Button, Text, Skeleton, Image } from '@raystack/apsara/v1';
import styles from './styles.module.css';
import keyIcon from '~/react/assets/key.svg';
import { DataTable } from '@raystack/apsara';
import { useFrontier } from '~/react/contexts/FrontierContext';
Expand All @@ -15,6 +14,7 @@ import { ExclamationTriangleIcon } from '@radix-ui/react-icons';
import { getColumns } from './columns';
import { V1Beta1ServiceUser } from '~/api-client/dist';
import { Outlet, useLocation, useNavigate } from '@tanstack/react-router';
import styles from './styles.module.css';

const NoServiceAccounts = ({
config
Expand Down Expand Up @@ -75,12 +75,12 @@ const Headings = ({
{isLoading ? (
<Skeleton containerClassName={styles.flex1} />
) : (
<Text size={6}>Service Accounts</Text>
<Text size="large" weight="medium">Service Accounts</Text>
)}
{isLoading ? (
<Skeleton containerClassName={styles.flex1} />
) : (
<Text size={4} variant="secondary">
<Text size="regular" variant="secondary">
Create a non-human identity to allow access to {appName.toLowerCase()}{' '}
resources
</Text>
Expand Down Expand Up @@ -213,7 +213,7 @@ export default function ApiKeys() {
return (
<Flex direction="column" style={{ width: '100%' }}>
<Flex className={styles.header}>
<Text size={6}>API</Text>
<Text size="large" weight="medium">API</Text>
</Flex>
<Flex justify="center" align="center">
{canUpdateWorkspace || isLoading ? (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
=> {}
}: {
serviceUserId: string;
onAddToken: (token: V1Beta1ServiceUserToken) => void;

Check warning on line 24 in sdks/js/packages/core/react/components/organization/api-keys/service-user/add-token.tsx

View workflow job for this annotation

GitHub Actions / JS SDK Lint

'token' is defined but never used
}) {
const { client, activeOrganization } = useFrontier();
const {
Expand Down Expand Up @@ -74,7 +74,7 @@
name="title"
control={control}
/>
< D7C4 Text size={1} variant="danger" className={styles.addKeyInputError}>
<Text size="micro" variant="danger" className={styles.addKeyInputError}>
{errors.title && String(errors.title?.message)}
</Text>
</Flex>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export const DeleteServiceAccountKey = () => {
className={styles.addDialogContent}
>
<Flex justify="between" className={styles.addDialogForm}>
<Text size={6} weight={500}>
<Text size="large" weight="medium">
Revoke API Key
</Text>

Expand All @@ -77,7 +77,7 @@ export const DeleteServiceAccountKey = () => {
gap="medium"
className={styles.addDialogFormContent}
>
<Text>
<Text size="regular">
This is an irreversible action doing this might lead to
discontinuation of access to the {appName} features. Do you wish to
proceed?
Expand Down
Loading
Loading
0