-
Notifications
You must be signed in to change notification settings - Fork 11
Integrate core design system in ui package #1269
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
Draft
praneshg239
wants to merge
4
commits into
main
Choose a base branch
from
core-design-system-integration
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
a551d02
Integrate core design system in ui package
praneshg239 2569747
Fix portal tailwind missing styles
praneshg239 998ff52
Update selectors for core and theme variants
praneshg239 197a2bf
Made color changes in new tailwind config and updated border colors a…
praneshg239 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3719,13 +3719,13 @@ export const commitDetailsStore: ICommitDetailsStore = { | |
| }, | ||
| { | ||
| content: | ||
| "- 'h-[36px] rounded-t-md border-x border-t border-transparent px-3.5 font-normal text-foreground-2 hover:text-foreground-1 data-[state=active]:border-borders-1 data-[state=active]:text-foreground-1 data-[state=active]:bg-background-1'", | ||
| "- 'h-[36px] rounded-t-md border-x border-t border-transparent px-3.5 font-normal text-foreground-2 hover:text-foreground-1 data-[state=active]:border-borders-2 data-[state=active]:text-foreground-1 data-[state=active]:bg-background-1'", | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. test |
||
| type: 'delete', | ||
| oldNumber: 33 | ||
| }, | ||
| { | ||
| content: | ||
| "+ 'h-[36px] rounded-t-md border-x border-t border-transparent px-3.5 font-normal text-foreground-2 hover:text-foreground-1 data-[state=active]:border-borders-1 data-[state=active]:bg-background-1 data-[state=active]:text-foreground-1'", | ||
| "+ 'h-[36px] rounded-t-md border-x border-t border-transparent px-3.5 font-normal text-foreground-2 hover:text-foreground-1 data-[state=active]:border-borders-2 data-[state=active]:bg-background-1 data-[state=active]:text-foreground-1'", | ||
| type: 'insert', | ||
| newNumber: 33 | ||
| }, | ||
|
|
@@ -3768,7 +3768,7 @@ export const commitDetailsStore: ICommitDetailsStore = { | |
| contentId: 'content-packages/ui/src/components/tabs.tsx::::packages/ui/src/components/tabs.tsx', | ||
| fileId: 'packages/ui/src/components/tabs.tsx::::packages/ui/src/components/tabs.tsx', | ||
| filePath: 'packages/ui/src/components/tabs.tsx', | ||
| raw: "diff --git a/packages/ui/src/components/tabs.tsx b/packages/ui/src/components/tabs.tsx\nindex 5cbae7da53b01c1fdcd7d7e940e0c2c6c10dfce4..631a8515f53931f3a9ec94f17fb4c3499bef513d 100644\n--- a/packages/ui/src/components/tabs.tsx\n+++ b/packages/ui/src/components/tabs.tsx\n@@ -11,7 +11,7 @@ const tabsListVariants = cva('inline-flex items-center text-foreground-4', {\n underline: 'h-11 justify-center gap-4',\n navigation: 'h-11 w-full justify-start gap-6 border-b border-borders-5 px-6',\n tabnav:\n- 'relative flex w-full before:absolute before:left-0 before:h-px before:w-full before:bg-borders-1 before:bottom-0'\n+ 'relative flex w-full before:absolute before:bottom-0 before:left-0 before:h-px before:w-full before:bg-borders-1'\n }\n },\n defaultVariants: {\n@@ -30,7 +30,7 @@ const tabsTriggerVariants = cva(\n navigation:\n 'm-0 -mb-px h-11 border-b border-solid border-b-transparent px-0 text-xs font-normal text-foreground-2 duration-150 ease-in-out hover:text-foreground-1 data-[state=active]:border-borders-9',\n tabnav:\n- 'h-[36px] rounded-t-md border-x border-t border-transparent px-3.5 font-normal text-foreground-2 hover:text-foreground-1 data-[state=active]:border-borders-1 data-[state=active]:text-foreground-1 data-[state=active]:bg-background-1'\n+ 'h-[36px] rounded-t-md border-x border-t border-transparent px-3.5 font-normal text-foreground-2 hover:text-foreground-1 data-[state=active]:border-borders-1 data-[state=active]:bg-background-1 data-[state=active]:text-foreground-1'\n }\n },\n defaultVariants: {\n" | ||
| raw: "diff --git a/packages/ui/src/components/tabs.tsx b/packages/ui/src/components/tabs.tsx\nindex 5cbae7da53b01c1fdcd7d7e940e0c2c6c10dfce4..631a8515f53931f3a9ec94f17fb4c3499bef513d 100644\n--- a/packages/ui/src/components/tabs.tsx\n+++ b/packages/ui/src/components/tabs.tsx\n@@ -11,7 +11,7 @@ const tabsListVariants = cva('inline-flex items-center text-foreground-4', {\n underline: 'h-11 justify-center gap-4',\n navigation: 'h-11 w-full justify-start gap-6 border-b border-borders-5 px-6',\n tabnav:\n- 'relative flex w-full before:absolute before:left-0 before:h-px before:w-full before:bg-borders-1 before:bottom-0'\n+ 'relative flex w-full before:absolute before:bottom-0 before:left-0 before:h-px before:w-full before:bg-borders-1'\n }\n },\n defaultVariants: {\n@@ -30,7 +30,7 @@ const tabsTriggerVariants = cva(\n navigation:\n 'm-0 -mb-px h-11 border-b border-solid border-b-transparent px-0 text-xs font-normal text-foreground-2 duration-150 ease-in-out hover:text-foreground-1 data-[state=active]:border-borders-9',\n tabnav:\n- 'h-[36px] rounded-t-md border-x border-t border-transparent px-3.5 font-normal text-foreground-2 hover:text-foreground-1 data-[state=active]:border-borders-2 data-[state=active]:text-foreground-1 data-[state=active]:bg-background-1'\n+ 'h-[36px] rounded-t-md border-x border-t border-transparent px-3.5 font-normal text-foreground-2 hover:text-foreground-1 data-[state=active]:border-borders-2 data-[state=active]:bg-background-1 data-[state=active]:text-foreground-1'\n }\n },\n defaultVariants: {\n" | ||
| }, | ||
| { | ||
| blocks: [ | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| import React from 'react' | ||
|
|
||
| import { Badge } from '@packages/ui/src/components/badge/badge' | ||
|
|
||
| /** | ||
| * This component showcases all the different badge variants and themes | ||
| * for demonstration purposes. | ||
| */ | ||
| export const BadgeShowcase = () => { | ||
| const variants = ['solid', 'surface', 'soft', 'outline'] | ||
| const themes = ['success', 'destructive', 'info', 'warning', 'muted'] | ||
|
|
||
| return ( | ||
| <div className="p-6 space-y-6"> | ||
| <h1 className="text-2xl font-bold mb-4">Badge Variants and Themes</h1> | ||
|
|
||
| {variants.map(variant => ( | ||
| <div key={variant} className="space-y-2"> | ||
| <h2 className="text-lg font-medium capitalize">{variant} Variant</h2> | ||
| <div className="flex flex-wrap gap-2"> | ||
| {themes.map(theme => ( | ||
| <Badge key={`${variant}-${theme}`} variant={variant as any} theme={theme as any}> | ||
| {theme} | ||
| </Badge> | ||
| ))} | ||
| </div> | ||
| </div> | ||
| ))} | ||
|
|
||
| <div className="mt-8"> | ||
| <h2 className="text-lg font-medium mb-2">Usage Example</h2> | ||
| <pre className="bg-gray-100 p-4 rounded-md text-sm"> | ||
| {`<Badge variant="solid" theme="success">success</Badge> | ||
| <Badge variant="outline" theme="success">success</Badge> | ||
| <Badge variant="soft" theme="destructive">destructive</Badge> | ||
| <Badge variant="surface" theme="info">info</Badge> | ||
| <Badge variant="outline" theme="muted">muted</Badge>`} | ||
| </pre> | ||
| </div> | ||
| </div> | ||
| ) | ||
| } | ||
|
|
||
| export default BadgeShowcase |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,169 @@ | ||
| import { useMemo } from 'react' | ||
|
|
||
| import * as styles from '@harnessio/core-design-system/styles-esm' | ||
| import { Badge, Text, Tooltip } from '@harnessio/ui/components' | ||
|
|
||
| import BadgeShowcase from './badge-showcase' | ||
|
|
||
| export default function TestComponent() { | ||
| const colorPalette = useMemo(() => { | ||
| const shades = Object.keys(styles.colors.colors.blue) | ||
|
|
||
| return { shades } | ||
| }, []) | ||
|
|
||
| return ( | ||
| <div className="p-8 bg-black text-white max-w-[800px] mx-auto my-6 grid gap-8"> | ||
| <div> | ||
| <Text as="h1" className="text-3xl font-bold mb-2"> | ||
| Badge | ||
| </Text> | ||
| <Text as="p" className="mb-10 text-gray-400"> | ||
| Different Badge variations | ||
| </Text> | ||
|
|
||
| {/* Original badges */} | ||
| {/* <div className="mb-8"> | ||
| <Text as="h2" className="text-xl font-semibold mb-4"> | ||
| Original Badge Components | ||
| </Text> | ||
| {/* Your existing badge examples here */} | ||
| {/* </div> */} | ||
|
|
||
| {/* New Badge Showcase with Variants and Themes */} | ||
| {/* <div className="bg-white text-black rounded-lg p-6"> | ||
| <BadgeShowcase /> | ||
| </div> */} | ||
|
|
||
| <div className="space-x-2"> | ||
| <Badge>Default</Badge> | ||
| <Badge variant="neutral">neutral</Badge> | ||
| <Badge variant="success">Success</Badge> | ||
| <Badge variant="warning">warning</Badge> | ||
| <Badge variant="danger">danger</Badge> | ||
| <Badge variant="info">info</Badge> | ||
| <Badge variant="merged">merged</Badge> | ||
| <Badge variant="ai">ai</Badge> | ||
| </div> | ||
|
|
||
| <Text as="p" className="mt-10 mb-5 text-gray-400"> | ||
| Rounded full | ||
| </Text> | ||
|
|
||
| <div className="space-x-2"> | ||
| <Badge borderRadius="full">Default</Badge> | ||
| <Badge borderRadius="full" variant="neutral"> | ||
| neutral | ||
| </Badge> | ||
| <Badge borderRadius="full" variant="success"> | ||
| {/* <Icon size={10} name="tick" /> <span>Success</span> */} | ||
| Success | ||
| </Badge> | ||
| <Badge borderRadius="full" variant="warning"> | ||
| warning | ||
| </Badge> | ||
| <Badge borderRadius="full" variant="danger"> | ||
| danger | ||
| </Badge> | ||
| <Badge borderRadius="full" variant="info"> | ||
| info | ||
| </Badge> | ||
| <Badge borderRadius="full" variant="merged"> | ||
| merged | ||
| </Badge> | ||
| <Badge borderRadius="full" variant="ai"> | ||
| ai | ||
| </Badge> | ||
| </div> | ||
|
|
||
| <Text as="p" className="mt-10 mb-5 text-gray-400"> | ||
| Size sm | ||
| </Text> | ||
|
|
||
| <div className="space-x-2"> | ||
| <Badge size="sm">Default</Badge> | ||
| <Badge size="sm" variant="neutral"> | ||
| neutral | ||
| </Badge> | ||
| <Badge size="sm" variant="success"> | ||
| {/* <Icon size={10} name="tick" /> <span>Success</span> */} | ||
| Success | ||
| </Badge> | ||
| <Badge size="sm" variant="warning"> | ||
| warning | ||
| </Badge> | ||
| <Badge size="sm" variant="danger"> | ||
| danger | ||
| </Badge> | ||
| <Badge size="sm" variant="info"> | ||
| info | ||
| </Badge> | ||
| <Badge size="sm" variant="merged"> | ||
| merged | ||
| </Badge> | ||
| <Badge size="sm" variant="ai"> | ||
| ai | ||
| </Badge> | ||
| </div> | ||
| </div> | ||
|
|
||
| <div style={{ backgroundColor: '#333' }} className="h-1" /> | ||
|
|
||
| <div> | ||
| <Text as="h1" className="text-3xl font-bold mb-2"> | ||
| Core color palette | ||
| </Text> | ||
| <Text as="p" className="mb-10 text-gray-400"> | ||
| The main color used to define the brand or highlight key elements. | ||
| </Text> | ||
|
|
||
| {/* Shades */} | ||
| <div className="flex mb-4"> | ||
| <div className="w-24"></div> {/* Empty space for color name column */} | ||
| {colorPalette.shades.map(shade => ( | ||
| <div key={shade} className="flex-1 text-center font-medium"> | ||
| {shade} | ||
| </div> | ||
| ))} | ||
| </div> | ||
|
|
||
| {/* Colors */} | ||
| <div className="space-y-2"> | ||
| {Object.keys(styles.colors.colors).map(colorName => { | ||
| const colorGroup = styles.colors.colors[colorName as keyof typeof styles.colors.colors] | ||
|
|
||
| return ( | ||
| <div key={colorName} className="flex items-center"> | ||
| <div className="w-24 font-medium capitalize text-white">{colorName}</div> | ||
|
|
||
| {colorPalette.shades.map(shade => { | ||
| const color = colorGroup[shade as keyof typeof colorGroup] | ||
| const colorValue = color?.$value || '' | ||
|
|
||
| return ( | ||
| <div key={shade} className="flex-1 flex justify-center"> | ||
| <Tooltip.Root> | ||
| <Tooltip.Trigger asChild> | ||
| <div | ||
| className="size-14 rounded-md" | ||
| style={{ | ||
| backgroundColor: colorValue, | ||
| border: '1px solid rgba(255,255,255,0.1)' | ||
| }} | ||
| /> | ||
| </Tooltip.Trigger> | ||
| <Tooltip.Content style={{ backgroundColor: 'black' }} side="top" align="center"> | ||
| --{color?.name}: {colorValue} | ||
| </Tooltip.Content> | ||
| </Tooltip.Root> | ||
| </div> | ||
| ) | ||
| })} | ||
| </div> | ||
| ) | ||
| })} | ||
| </div> | ||
| </div> | ||
| </div> | ||
| ) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.