Skip to content

Commit

Permalink
Rename card component.
Browse files Browse the repository at this point in the history
  • Loading branch information
homotechsual committed Aug 3, 2024
1 parent 5d89f25 commit 53929e0
Show file tree
Hide file tree
Showing 16 changed files with 3,538 additions and 3,672 deletions.
Binary file modified .yarn/install-state.gz
Binary file not shown.
1,063 changes: 1,063 additions & 0 deletions docs/component-library/new/Card/index.mdx

Large diffs are not rendered by default.

1,192 changes: 0 additions & 1,192 deletions docs/component-library/new/Simplecard/index.mdx

This file was deleted.

3,092 changes: 1,546 additions & 1,546 deletions docs/component-library/new/TimeLine/index.mdx

Large diffs are not rendered by default.

38 changes: 19 additions & 19 deletions docusaurus.community.code-workspace
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"folders": [
{
"path": "."
}
],
"settings": {
"prettier.prettierPath": ".yarn/sdks/prettier",
"typescript.tsdk": ".yarn/sdks/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true,
"cSpell.words": [
"deflist",
"iconify",
"katex",
"rehype"
],
"discord.enabled": true
}
}
{
"folders": [
{
"path": "."
}
],
"settings": {
"prettier.prettierPath": ".yarn/sdks/prettier",
"typescript.tsdk": ".yarn/sdks/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true,
"cSpell.words": [
"deflist",
"iconify",
"katex",
"rehype"
],
"discord.enabled": true
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"engines": {
"node": ">=18.14"
},
"packageManager": "yarn@4.2.2+sha512.c44e283c54e02de9d1da8687025b030078c1b9648d2895a65aab8e64225bfb7becba87e1809fc0b4b6778bbd47a1e2ab6ac647de4c5e383a53a7c17db6c3ff4b",
"packageManager": "yarn@4.4.0",
"dependenciesMeta": {
"@docusaurus/tsconfig": {
"unplugged": true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,63 +1,63 @@
import React, { CSSProperties, ReactNode } from 'react';
import clsx from 'clsx';

interface CardBodyProps {
className?: string;
style?: CSSProperties;
children: ReactNode;
textAlign?: string;
variant?: string;
italic?: boolean;
noDecoration?: boolean;
transform?: string;
breakWord?: boolean;
truncate?: boolean;
weight?: string;
}

const CardBody: React.FC<CardBodyProps> = ({
className,
style,
children,
textAlign,
variant,
italic = false,
noDecoration = false,
transform,
breakWord = false,
truncate = false,
weight,
}) => {
const text = textAlign ? `text--${textAlign}` : '';
const textColor = variant ? `text--${variant}` : '';
const textItalic = italic ? 'text--italic' : '';
const textDecoration = noDecoration ? 'text-no-decoration' : '';
const textType = transform ? `text--${transform}` : '';
const textBreak = breakWord ? 'text--break' : '';
const textTruncate = truncate ? 'text--truncate' : '';
const textWeight = weight ? `text--${weight}` : '';

return (
<div
className={clsx(
'card__body',
className,
text,
textType,
textColor,
textItalic,
textDecoration,
textBreak,
textTruncate,
textWeight
)}
style={style}
>
{children}
</div>
);
};

export default CardBody;


import React, { CSSProperties, ReactNode } from 'react';
import clsx from 'clsx';

interface CardBodyProps {
className?: string;
style?: CSSProperties;
children: ReactNode;
textAlign?: string;
variant?: string;
italic?: boolean;
noDecoration?: boolean;
transform?: string;
breakWord?: boolean;
truncate?: boolean;
weight?: string;
}

const CardBody: React.FC<CardBodyProps> = ({
className,
style,
children,
textAlign,
variant,
italic = false,
noDecoration = false,
transform,
breakWord = false,
truncate = false,
weight,
}) => {
const text = textAlign ? `text--${textAlign}` : '';
const textColor = variant ? `text--${variant}` : '';
const textItalic = italic ? 'text--italic' : '';
const textDecoration = noDecoration ? 'text-no-decoration' : '';
const textType = transform ? `text--${transform}` : '';
const textBreak = breakWord ? 'text--break' : '';
const textTruncate = truncate ? 'text--truncate' : '';
const textWeight = weight ? `text--${weight}` : '';

return (
<div
className={clsx(
'card__body',
className,
text,
textType,
textColor,
textItalic,
textDecoration,
textBreak,
textTruncate,
textWeight
)}
style={style}
>
{children}
</div>
);
};

export default CardBody;

Original file line number Diff line number Diff line change
@@ -1,64 +1,64 @@
import React, { CSSProperties, ReactNode } from 'react';
import clsx from 'clsx';

interface CardFooterProps {
className?: string;
style?: CSSProperties;
children: ReactNode;
textAlign?: string;
variant?: string;
italic?: boolean;
noDecoration?: boolean;
transform?: string;
breakWord?: boolean;
truncate?: boolean;
weight?: string;
}

const CardFooter: React.FC<CardFooterProps> = ({
className,
style,
children,
textAlign,
variant,
italic = false,
noDecoration = false,
transform,
breakWord = false,
truncate = false,
weight,
}) => {
const text = textAlign ? `text--${textAlign}` : '';
const textColor = variant ? `text--${variant}` : '';
const textItalic = italic ? 'text--italic' : '';
const textDecoration = noDecoration ? 'text-no-decoration' : '';
const textType = transform ? `text--${transform}` : '';
const textBreak = breakWord ? 'text--break' : '';
const textTruncate = truncate ? 'text--truncate' : '';
const textWeight = weight ? `text--${weight}` : '';

return (
<div
className={clsx(
'card__footer',
className,
text,
textType,
textColor,
textItalic,
textDecoration,
textBreak,
textTruncate,
textWeight
)}
style={style}
>
{children}
</div>
);
};

export default CardFooter;



import React, { CSSProperties, ReactNode } from 'react';
import clsx from 'clsx';

interface CardFooterProps {
className?: string;
style?: CSSProperties;
children: ReactNode;
textAlign?: string;
variant?: string;
italic?: boolean;
noDecoration?: boolean;
transform?: string;
breakWord?: boolean;
truncate?: boolean;
weight?: string;
}

const CardFooter: React.FC<CardFooterProps> = ({
className,
style,
children,
textAlign,
variant,
italic = false,
noDecoration = false,
transform,
breakWord = false,
truncate = false,
weight,
}) => {
const text = textAlign ? `text--${textAlign}` : '';
const textColor = variant ? `text--${variant}` : '';
const textItalic = italic ? 'text--italic' : '';
const textDecoration = noDecoration ? 'text-no-decoration' : '';
const textType = transform ? `text--${transform}` : '';
const textBreak = breakWord ? 'text--break' : '';
const textTruncate = truncate ? 'text--truncate' : '';
const textWeight = weight ? `text--${weight}` : '';

return (
<div
className={clsx(
'card__footer',
className,
text,
textType,
textColor,
textItalic,
textDecoration,
textBreak,
textTruncate,
textWeight
)}
style={style}
>
{children}
</div>
);
};

export default CardFooter;


32 changes: 32 additions & 0 deletions src/components/Card/CardHeader/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import React, { CSSProperties } from 'react';
import clsx from 'clsx';

const CardHeader = ({
className, // Custom CSS classes for the component
style, // Custom CSS styles for the component
children, // The content of the component
textAlign, // Text alignment
variant, // Text color variant
italic = false, // Italic text
noDecoration = false, // No text decoration
transform, // Text transformation
breakWord = false, // Break word
truncate = false, // Truncate text
weight, // Text weight
}) => {
const text = textAlign ? `text--${textAlign}` :'';
const textColor = variant ? `text--${variant}` : '';
const textItalic = italic ? 'text--italic' : '';
const textDecoration = noDecoration ? 'text-no-decoration' : '';
const textType = transform ? `text--${transform}` : '';
const textBreak = breakWord ? 'text--break' : '';
const textTruncate = truncate ? 'text--truncate' : '';
const textWeight = weight ? `text--${weight}` : '';
return (
<div className={clsx('card__header', className, text, textType, textColor, textItalic, textDecoration, textBreak, textTruncate, textWeight)} style={style} >
{children}
</div>
);
}

export default CardHeader;
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
import React, { CSSProperties } from 'react';
import clsx from 'clsx';
import useBaseUrl from '@docusaurus/useBaseUrl';

interface CardImageProps {
className?: string;
style?: CSSProperties;
cardImageUrl: string;
alt: string;
title: string;
}

const CardImage: React.FC<CardImageProps> = ({
className,
style,
cardImageUrl,
alt,
title,
}) => {
const generatedCardImageUrl = useBaseUrl(cardImageUrl);

return (

<img className={clsx('card__image', className)} style={style} src={generatedCardImageUrl} alt={alt} title={title} />

);
};

export default CardImage;
import React, { CSSProperties } from 'react';
import clsx from 'clsx';
import useBaseUrl from '@docusaurus/useBaseUrl';

interface CardImageProps {
className?: string;
style?: CSSProperties;
cardImageUrl: string;
alt: string;
title: string;
}

const CardImage: React.FC<CardImageProps> = ({
className,
style,
cardImageUrl,
alt,
title,
}) => {
const generatedCardImageUrl = useBaseUrl(cardImageUrl);

return (

<img className={clsx('card__image', className)} style={style} src={generatedCardImageUrl} alt={alt} title={title} />

);
};

export default CardImage;
Loading

0 comments on commit 53929e0

Please sign in to comment.