Skip to content
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

New plugin search color scheme #1756

Merged
merged 67 commits into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
00df394
Make the Marketplace Search green
hasparus Oct 23, 2024
774f318
Add new fonts
hasparus Oct 23, 2024
309d792
Style colors
hasparus Oct 25, 2024
5452c6f
Style some more, use container queries
hasparus Oct 25, 2024
f281313
Mobile tweaks
hasparus Oct 25, 2024
cf008db
Style nextra's Tabs in MarketplaceSearch
hasparus Oct 26, 2024
824e460
Rename .black to .neutral
hasparus Oct 26, 2024
43eebd2
Merge branch 'main' into green-plugin-search
hasparus Oct 26, 2024
fabb7a3
Add a changeset
hasparus Oct 26, 2024
57136d3
Remove an old comment
hasparus Oct 26, 2024
38b019e
Change MarketplaceSearch to render a <section>
hasparus Oct 26, 2024
5e29d73
Merge branch 'main' into green-plugin-search
hasparus Oct 28, 2024
ed143fc
Format
hasparus Oct 28, 2024
9229157
Fix lint errors
hasparus Oct 28, 2024
718be3b
Build Components before Storybook
hasparus Oct 28, 2024
4687c79
Fix focus styles and tab indexes
hasparus Oct 28, 2024
e8a01f7
Add one more hive-focus style
hasparus Oct 28, 2024
31c74dc
Add 2D focusgroup behavior to MarketplaceList
hasparus Oct 28, 2024
5652e82
Add a surprisingly nice hover style
hasparus Oct 28, 2024
2f90916
Merge branch 'main' into green-plugin-search
hasparus Oct 31, 2024
6176306
Get rid of a CSS Module
hasparus Oct 31, 2024
96f810e
Change selector to style only direct separator child
hasparus Nov 1, 2024
29c3d3c
Remove redundant !important
hasparus Nov 1, 2024
7ac60c3
Add a comment documenting why is this here
hasparus Nov 1, 2024
279fa15
Expose MainProductCard and AncillaryProductCard
hasparus Nov 1, 2024
5a457af
Add TextLink
hasparus Nov 1, 2024
20cabcc
Add heading size xs used in designs
hasparus Nov 1, 2024
1803f22
Add ExploreMainProductCards
hasparus Nov 1, 2024
8895d70
Add a missing export
hasparus Nov 1, 2024
e50093e
Fix lint errors
hasparus Nov 1, 2024
3dc4529
Tweak padding on large screen
hasparus Nov 1, 2024
b69ee41
Use overflow-visible instead
hasparus Nov 1, 2024
0b6682d
Add one more w-full for mobiles
hasparus Nov 1, 2024
58238fe
Change size-[28px] to size-7
hasparus Nov 4, 2024
77c216d
Improve TextLink in dark mode
hasparus Nov 4, 2024
6130cd3
Tweak styles
hasparus Nov 4, 2024
43cec98
Add a comment, update style to use hidden
hasparus Nov 4, 2024
42d4152
Refactor
hasparus Nov 4, 2024
fd9321c
Merge branch 'main' into green-plugin-search
hasparus Nov 4, 2024
46030ce
Refactor my reactism
hasparus Nov 5, 2024
971aedd
Make the lettermarks font smaller
hasparus Nov 5, 2024
cee41fa
Move dummy to storybook file
hasparus Nov 5, 2024
e6f84fb
Use githubusercontent URLs
hasparus Nov 5, 2024
8cdb38b
Use ICON_PREFIX for posterity
hasparus Nov 5, 2024
7205c12
Fix icons I replaced wrongly
hasparus Nov 5, 2024
738f68f
Format
hasparus Nov 6, 2024
aedeea8
Fix a type error
hasparus Nov 6, 2024
9a7781c
Fix stories
hasparus Nov 6, 2024
0242f3c
Remove useRef in favor of parentElement
hasparus Nov 6, 2024
035fbd4
Code review fixes
hasparus Nov 6, 2024
d2fec7e
Remove marketplace-search.css
hasparus Nov 6, 2024
f84f989
Revert the change to postcss.config.cjs
hasparus Nov 6, 2024
b78cb29
Fix styles
hasparus Nov 6, 2024
cb976bf
Remove --filter for components build
hasparus Nov 6, 2024
d850653
Use new shared Tailwind config
hasparus Nov 6, 2024
812b576
Use moduleResolution: bundler
hasparus Nov 6, 2024
923b019
Work around Tailwind ESLint issue
hasparus Nov 6, 2024
ef720ea
fix an import
hasparus Nov 6, 2024
0ba7c7d
Fix postcss config
hasparus Nov 6, 2024
9566e86
Update packages/components/src/components/explore-main-product-cards.tsx
hasparus Nov 6, 2024
639d97a
Update packages/components/src/components/marketplace-search.stories.ts
hasparus Nov 6, 2024
9581443
Update packages/components/src/components/tools-and-libraries-cards.tsx
hasparus Nov 6, 2024
e77caec
Update tailwind.config.ts
hasparus Nov 6, 2024
8bae7ca
Fix images, add inner ring
hasparus Nov 6, 2024
22b7ef5
Fix empty state
hasparus Nov 6, 2024
49f54ad
Merge branch 'main' into green-plugin-search
hasparus Nov 7, 2024
d1b8558
chore(dependencies): updated changesets for modified dependencies
github-actions[bot] Nov 7, 2024
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
6 changes: 6 additions & 0 deletions .changeset/@theguild_components-1756-dependencies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@theguild/components": patch
---
dependencies updates:
- Removed dependency [`@theguild/tailwind-config@0.5.0` ↗︎](https://www.npmjs.com/package/@theguild/tailwind-config/v/0.5.0) (from `dependencies`)
- Added dependency [`@theguild/tailwind-config@0.6.0-alpha-20241106003557-2c94714753ba2342f442f836b4683119985ee2c5` ↗︎](https://www.npmjs.com/package/@theguild/tailwind-config/v/0.6.0) (to `peerDependencies`)
5 changes: 5 additions & 0 deletions .changeset/pink-grapes-compete.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@theguild/components': minor
---

Add green colorScheme to MarketplaceSearch and MarketplaceList, change display to grid
1 change: 1 addition & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ module.exports = {
'aa-SourceHeaderTitle',
'hive-focus',
'hive-focus-within',
'@container', // Tailwind ESLint Plugin doesn't see the Container Queries classes but it does see prefixes like @sm:
],
},
},
Expand Down
13 changes: 3 additions & 10 deletions .storybook/hive-theme-decorator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,10 @@ import { StoryContext } from '@storybook/react';
import { cn } from '../packages/components/src/cn';

const neueMontreal = localFont({
// TODO: Swap to variable version.
// TODO: We only use 400 and 500 weights, right?
src: [
{ path: '../fonts/NeueMontreal-Light.otf', weight: '300' },
{ path: '../fonts/NeueMontreal-Light.otf', style: 'italic' },
{ path: '../fonts/NeueMontreal-Regular.otf', weight: '400' },
{ path: '../fonts/NeueMontreal-Italic.otf', weight: '400', style: 'italic' },
{ path: '../fonts/NeueMontreal-Medium.otf', weight: '500' },
{ path: '../fonts/NeueMontreal-MediumItalic.otf', weight: '500', style: 'italic' },
{ path: '../fonts/PPNeueMontreal-Regular.woff2', weight: '400' },
{ path: '../fonts/PPNeueMontreal-Medium.woff2', weight: '500' },
{ path: '../fonts/NeueMontreal-Bold.otf', weight: '700' },
{ path: '../fonts/NeueMontreal-BoldItalic.otf', weight: '700', style: 'italic' },
],
dimaMachina marked this conversation as resolved.
Show resolved Hide resolved
variable: '--font-sans',
});
Expand All @@ -28,7 +21,7 @@ export const hiveThemeDecorator = (Story: () => React.ReactNode, ctx: StoryConte
className={cn(
'text-green-1000',
neueMontreal.variable,
ctx.parameters.forcedLightMode && 'light',
ctx.parameters.forcedLightMode ? 'light' : 'dark:text-white',
)}
style={{
fontFamily: 'var(--font-sans)',
Expand Down
Binary file removed .storybook/public/fonts/NeueMontreal-BoldItalic.otf
Binary file not shown.
Binary file removed .storybook/public/fonts/NeueMontreal-Italic.otf
Binary file not shown.
Binary file removed .storybook/public/fonts/NeueMontreal-Light.otf
Binary file not shown.
Binary file not shown.
Binary file removed .storybook/public/fonts/NeueMontreal-Medium.otf
Binary file not shown.
Binary file not shown.
Binary file removed .storybook/public/fonts/NeueMontreal-Regular.otf
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"@svgr/webpack": "8.1.0",
"@theguild/eslint-config": "0.12.1",
"@theguild/prettier-config": "2.0.7",
"@theguild/tailwind-config": "0.5.0",
"@theguild/tailwind-config": "0.6.0-alpha-20241106003557-2c94714753ba2342f442f836b4683119985ee2c5",
"@types/jest-image-snapshot": "6.4.0",
"@types/react": "18.3.12",
"@types/react-paginate": "7.1.4",
Expand Down
3 changes: 2 additions & 1 deletion packages/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"types:check": "tsc --noEmit"
},
"peerDependencies": {
"@theguild/tailwind-config": "0.6.0-alpha-20241106003557-2c94714753ba2342f442f836b4683119985ee2c5",
"next": "^13 || ^14 || ^15.0.0",
"react": "^18.2.0",
"react-dom": "^18.2.0"
Expand All @@ -66,7 +67,6 @@
"@giscus/react": "3.0.0",
"@next/bundle-analyzer": "15.0.2",
"@radix-ui/react-navigation-menu": "^1.2.0",
"@theguild/tailwind-config": "0.5.0",
"clsx": "2.1.1",
"fuzzy": "0.1.3",
"next-videos": "1.5.0",
Expand All @@ -81,6 +81,7 @@
"devDependencies": {
"@svgr/babel-plugin-remove-jsx-attribute": "^8.0.0",
"@theguild/editor": "workspace:*",
"@theguild/tailwind-config": "0.6.0-alpha-20241106003557-2c94714753ba2342f442f836b4683119985ee2c5",
"@types/dedent": "0.7.2",
"@types/react": "18.3.12",
"@types/react-dom": "18.3.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { Meta, StoryObj } from '@storybook/react';
dimaMachina marked this conversation as resolved.
Show resolved Hide resolved
import { hiveThemeDecorator } from '../../../../.storybook/hive-theme-decorator';
import {
ExploreMainProductCards,
ExploreMainProductCardsProps,
} from './explore-main-product-cards';

export default {
title: 'Hive/ExploreMainProductCards',
component: ExploreMainProductCards,
decorators: [hiveThemeDecorator],
parameters: {
forcedLightMode: true,
},
} satisfies Meta;

export const Default: StoryObj<ExploreMainProductCardsProps> = {
name: 'ExploreMainProductCards',
};
37 changes: 37 additions & 0 deletions packages/components/src/components/explore-main-product-cards.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { HTMLAttributes } from 'react';
import { cn } from '../cn';
import { PRODUCTS } from '../products';
import { Heading } from './heading';
import { ArrowIcon } from './icons';
import { TextLink } from './text-link';
import { MainProductCard } from './tools-and-libraries-cards';

export interface ExploreMainProductCardsProps extends HTMLAttributes<HTMLDivElement> {}

export function ExploreMainProductCards({ className, ...rest }: ExploreMainProductCardsProps) {
return (
<section
className={cn(
'relative isolate flex flex-wrap gap-6 px-4 py-6 lg:gap-12 lg:py-24 xl:px-[120px]',
className,
)}
{...rest}
>
<div className="[@media(min-width:1490px)]:w-[293px]">
<Heading as="h2" size="xs" className="text-pretty">
Explore Hive 360° GraphQL Ecosystem to reach full potential
</Heading>
{/* TODO: Replace with a link to the Libraries page */}
<TextLink href="https://github.com/the-guild-org" className="mt-4 lg:mt-6">
Learn more
<ArrowIcon />
</TextLink>
</div>
<ul className="-mx-12 -my-2 flex shrink-0 grow gap-[22px] overflow-auto px-12 py-2 [@media(max-width:1490px)]:w-full [@media(min-width:1490px)]:overflow-visible [&>:nth-child(n+4)]:[@media(min-width:1490px)]:hidden">
{[PRODUCTS.HIVE, PRODUCTS.YOGA, PRODUCTS.MESH, PRODUCTS.CODEGEN].map(product => (
<MainProductCard key={product.name} as="li" product={product} />
))}
</ul>
</section>
);
}
5 changes: 4 additions & 1 deletion packages/components/src/components/heading.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { cn } from '../cn';

export interface HeadingProps extends ComponentPropsWithoutRef<'h1'> {
as: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'div' | 'p' | 'span';
size: 'xl' | 'lg' | 'md' | 'sm';
size: 'xl' | 'lg' | 'md' | 'sm' | 'xs';
}
export function Heading({ as: _as, size, className, children, ...rest }: HeadingProps) {
const Level = _as || 'h2';
Expand All @@ -24,6 +24,9 @@ export function Heading({ as: _as, size, className, children, ...rest }: Heading
case 'sm':
sizeStyle = 'text-[40px] leading-[1.2] tracking-[-0.2px]';
break;
case 'xs':
sizeStyle = 'text-[32px]/[1.25] tracking-[-0.16px]';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we use an object instead? more readable

const sizeStyle = {
  xl: '',
  lg: '',
  md: '',
  sm: '',
  xs: ''
}[size]

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

break;
}

const id =
Expand Down
7 changes: 6 additions & 1 deletion packages/components/src/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,15 @@ export {
type GraphQLConfCardProps,
} from './hive-navigation';
export { HiveFooter } from './hive-footer';
export { ToolsAndLibrariesCards } from './tools-and-libraries-cards';
export {
ToolsAndLibrariesCards,
MainProductCard,
AncillaryProductCard,
} from './tools-and-libraries-cards';
export * from './decorations';
export * from './call-to-action';
export * from './cookies-consent';
export * from './heading';
export * from './info-card';
export * from './stud';
export * from './explore-main-product-cards';
26 changes: 0 additions & 26 deletions packages/components/src/components/marketplace-list.stories.ts

This file was deleted.

56 changes: 56 additions & 0 deletions packages/components/src/components/marketplace-list.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import { Meta, StoryObj } from '@storybook/react';
import { hiveThemeDecorator } from '../../../../.storybook/hive-theme-decorator';
import { MarketplaceList } from './marketplace-list';
import { Default as MarketplaceSearchDefaultStory } from './marketplace-search.stories';

const meta: Meta<typeof MarketplaceList> = {
title: 'Components/MarketplaceList',
component: MarketplaceList,
argTypes: {
title: {
name: 'Title',
},
placeholder: {
name: 'No Results Placeholder',
},
pagination: {
name: 'Products / Page',
},
items: {
name: 'Items',
},
colorScheme: {
control: {
type: 'select',
},
options: ['green', 'black'],
},
},
decorators: [
hiveThemeDecorator,
Story => (
<div className="p-2">
<Story />
</div>
),
],
};

export default meta;

type Story = StoryObj<typeof MarketplaceList>;

export const Default: Story = {
name: 'MarketplaceList',
args: {
title: 'Trending & Last Update',
placeholder: 'There are no items available...',
pagination: 4,
items: MarketplaceSearchDefaultStory.args?.primaryList?.items ?? [],
},
};

export const Green: Story = {
name: 'MarketplaceList Green',
args: { ...Default.args, colorScheme: 'green' },
};
Loading
Loading