Skip to content

Commit ab53a50

Browse files
committed
feat: Update color scheme and component styling
- Change primary color from indigo (#4f46e5) to golden yellow (#ffb900) - Update Storybook theme colors - Modify Avatar default colors - Enhance Card component with image support and styling improvements - Update Tag and Tiptap link styles to use new primary color - Bump package version to 1.0.204
1 parent 6a124cb commit ab53a50

File tree

13 files changed

+80
-26
lines changed

13 files changed

+80
-26
lines changed

.storybook/theme.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ export default create({
1010
appBg: "#1b1f23",
1111
appContentBg: "#1b1f23",
1212
appBorderColor: "#1b1f23",
13-
colorPrimary: "#4f46e5",
13+
colorPrimary: "#ffb900",
1414
textColor: "#9ca3af",
1515
barBg: "#1b1f23",
16-
barTextColor: "#4f46e5",
16+
barTextColor: "#ffb900",
1717
barSelectedColor: "#4338ca",
1818
barHoverColor: "#4338ca",
1919
appBorderRadius: 0,
20-
colorSecondary: "#4f46e5"
20+
colorSecondary: "#ffb900"
2121
});

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@programmer_network/yail",
3-
"version": "1.0.202",
3+
"version": "1.0.204",
44
"description": "Programmer Network's official UI library for React",
55
"author": "Aleksandar Grbic - (https://programmer.network)",
66
"publishConfig": {

src/Components/Avatar/__snapshots__/Avatar.test.tsx.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ exports[`Avatar component > renders correctly - snapshot test 1`] = `
3434
mask="url(#:r2:)"
3535
>
3636
<rect
37-
fill="#6366f1"
37+
fill="#ad46ff"
3838
height="36"
3939
width="36"
4040
/>
4141
<rect
42-
fill="#bae6fd"
42+
fill="#ffb900"
4343
height="36"
4444
rx="6"
4545
transform="translate(7 1) rotate(73 18 18) scale(1.1)"

src/Components/Avatar/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const Avatar: FC<IAvatarProps> = ({
99
src,
1010
alt = "John Doe",
1111
size = 50,
12-
colors = ["#6366f1", "#bae6fd"],
12+
colors = ["#ad46ff", "#ffb900"],
1313
className
1414
}) => {
1515
const classes = classNames(

src/Components/Card/Card.stories.tsx

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
import { Meta } from "@storybook/react";
1+
import { Meta, StoryObj } from "@storybook/react";
22
import { NavLink } from "react-router-dom";
33
import { withRouter } from "storybook-addon-remix-react-router";
44

55
import Card from ".";
6-
import { ICard } from "./types";
76

8-
const CardStories: Meta<ICard> = {
7+
const CardStories: Meta<typeof Card> = {
98
title: "Components/Card",
109
decorators: [withRouter],
1110
component: Card,
@@ -14,6 +13,8 @@ const CardStories: Meta<ICard> = {
1413
}
1514
};
1615

16+
type Story = StoryObj<typeof Card>;
17+
1718
export const Default = () => {
1819
return (
1920
<div className='yl-mt-8'>
@@ -25,6 +26,7 @@ export const Default = () => {
2526
description:
2627
"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Cum, nesciunt.",
2728
author: "John Doe",
29+
authorUrl: "/john-doe",
2830
date: "2021-10-10T00:00:00.000Z",
2931
tags: [
3032
{ name: "Tag 1", url: "/" },
@@ -58,4 +60,30 @@ export const WithExternalLink = () => {
5860
);
5961
};
6062

63+
export const WithImage: Story = {
64+
args: {
65+
NavLink,
66+
data: {
67+
title: "Beautiful Mountain Landscape",
68+
titleUrl: "/mountain-landscape",
69+
description:
70+
"A stunning view of snow-capped mountains at sunrise, showcasing nature's raw beauty and majesty.",
71+
author: "John Doe",
72+
authorUrl: "/authors/john-doe",
73+
date: "2024-02-15",
74+
image: "https://images.unsplash.com/photo-1706463629335-d92264bbfd6f",
75+
tags: [
76+
{ name: "nature", url: "/tags/nature" },
77+
{ name: "landscape", url: "/tags/landscape" },
78+
{ name: "mountains", url: "/tags/mountains" },
79+
{ name: "sunrise", url: "/tags/sunrise" },
80+
{ name: "nature", url: "/tags/nature" },
81+
{ name: "landscape", url: "/tags/landscape" },
82+
{ name: "mountains", url: "/tags/mountains" },
83+
{ name: "sunrise", url: "/tags/sunrise" }
84+
]
85+
}
86+
}
87+
};
88+
6189
export default CardStories;

src/Components/Card/index.tsx

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,40 @@ import URLUtils from "Utils/URL";
88
import { ICard } from "./types";
99

1010
const Card: FC<ICard> = ({ data, className, NavLink }) => {
11-
const { title, description, author, date, tags, titleUrl, authorUrl } = data;
11+
const { title, description, author, date, tags, titleUrl, authorUrl, image } =
12+
data;
1213

1314
return (
1415
<div
1516
className={classNames(
16-
"group yl-flex yl-flex-col yl-justify-between yl-border-2 yl-border-border yl-rounded-lg yl-p-6",
17+
"yl-flex yl-flex-col yl-justify-between yl-border yl-border-border/30 yl-rounded-lg yl-overflow-hidden",
1718
className
1819
)}
1920
>
20-
<div>
21+
{image && (
22+
<div className='yl-w-full yl-h-48 yl-relative'>
23+
<img
24+
src={image}
25+
alt={title}
26+
className='yl-w-full yl-h-full yl-object-cover'
27+
/>
28+
</div>
29+
)}
30+
<div className='yl-p-6'>
2131
<div className='yl-flex yl-items-center'>
2232
<div className='yl-flex yl-flex-1 yl-justify-between yl-gap-2 md:yl-my-1'>
2333
<div className='yl-flex yl-flex-col md:yl-flex-row md:yl-items-center md:yl-gap-2'>
2434
{author && (
2535
<>
2636
{authorUrl ? (
27-
<NavLink to={authorUrl}>
28-
<span className='yl-flex yl-items-center yl-gap-2 yl-text-secondary hover:yl-text-primary yl-cursor-pointer'>
29-
{author}
30-
</span>
37+
<NavLink
38+
to={authorUrl}
39+
className='yl-flex yl-items-center yl-gap-2 yl-text-primary yl-cursor-pointer'
40+
>
41+
{author}
3142
</NavLink>
3243
) : (
33-
<span className='yl-flex yl-items-center yl-gap-2 yl-text-secondary hover:yl-text-primary'>
44+
<span className='yl-flex yl-items-center yl-gap-2 yl-text-primary hover:yl-text-primary'>
3445
{author}
3546
</span>
3647
)}
@@ -60,12 +71,12 @@ const Card: FC<ICard> = ({ data, className, NavLink }) => {
6071
<Paragraph className='yl-py-4'>{description}</Paragraph>
6172
</div>
6273
{tags && tags.length > 0 && (
63-
<div className='yl-mt-2 yl-flex yl-items-center yl-gap-2'>
74+
<div className='yl-mt-2 yl-flex yl-items-center yl-gap-2 !yl-px-6 yl-pb-4 yl-flex-wrap'>
6475
{tags.map((tag, index) => (
6576
<NavLink
6677
key={index}
6778
to={tag.url}
68-
className='hover:yl-text-stroke yl-text-secondary hover:yl-underline hover:yl-opacity-80 active:yl-opacity-50'
79+
className='hover:yl-text-stroke yl-text-primary hover:yl-underline hover:yl-opacity-80 active:yl-opacity-50'
6980
>
7081
#{tag.name}
7182
</NavLink>

src/Components/Card/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export interface ICardData {
1111
name: string;
1212
url: string;
1313
}[];
14+
image?: string;
1415
}
1516

1617
export interface ICard {

src/Components/Cards/index.tsx

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,13 @@ import Card from "Components/Card";
55

66
import { ICardsProps } from "./types";
77

8-
const Cards: FC<ICardsProps> = ({ className, cards, columns, NavLink }) => {
8+
const Cards: FC<ICardsProps> = ({
9+
className,
10+
cardClassName,
11+
cards,
12+
columns,
13+
NavLink
14+
}) => {
915
return (
1016
<div
1117
data-testid='cards'
@@ -25,7 +31,14 @@ const Cards: FC<ICardsProps> = ({ className, cards, columns, NavLink }) => {
2531
})}
2632
>
2733
{cards.map((card, index) => {
28-
return <Card key={index} data={card} NavLink={NavLink} />;
34+
return (
35+
<Card
36+
key={index}
37+
data={card}
38+
NavLink={NavLink}
39+
className={cardClassName}
40+
/>
41+
);
2942
})}
3043
</div>
3144
);

src/Components/Cards/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ export interface ICardsProps {
99
>;
1010
columns: number;
1111
className?: string;
12+
cardClassName?: string;
1213
}

src/Components/Inputs/Tiptap/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export const typograyClassNames = {
6464
),
6565
a: (className?: string) =>
6666
classNames(
67-
"hover:yl-text-stroke yl-text-primary hover:yl-underline hover:yl-opacity-80 active:yl-opacity-50",
67+
"yl-break-all hover:yl-text-stroke yl-text-primary hover:yl-underline hover:yl-opacity-80 active:yl-opacity-50",
6868
className
6969
),
7070
ul: (className?: string) =>

src/Components/Tag/__snapshots__/Tag.test.tsx.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
exports[`Tag component > renders correctly - snapshot test 1`] = `
44
<DocumentFragment>
55
<div
6-
class="yl-rounded-md yl-bg-transparent yl-text-base yl-text-text last:yl-mr-0 hover:yl-border-border hover:yl-text-text"
6+
class="yl-rounded-md yl-bg-transparent yl-text-base yl-text-primary last:yl-mr-0 hover:yl-border-border hover:yl-text-text"
77
>
88
<span>
99
#example

src/Components/Tag/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const Tag: FC<ITagProps> = ({ name, className = null, onClick }) => {
88
<div
99
onClick={onClick}
1010
className={classNames(
11-
"yl-rounded-md yl-bg-transparent yl-text-base yl-text-text last:yl-mr-0 hover:yl-border-border hover:yl-text-text",
11+
"yl-rounded-md yl-bg-transparent yl-text-base yl-text-primary last:yl-mr-0 hover:yl-border-border hover:yl-text-text",
1212
className,
1313
{
1414
"yl-cursor-pointer": onClick

src/tailwind.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
@layer base {
66
:root {
7-
--color-primary: 79 57 246;
7+
--color-primary: 255 185 0;
88
--color-secondary: 156 163 175;
99
--color-background: 18 20 22;
1010
--color-text: 212 212 212;

0 commit comments

Comments
 (0)