-
Notifications
You must be signed in to change notification settings - Fork 619
Create shared UI library - @workspace/ui #7855
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
Merged
Merged
Changes from all commits
Commits
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
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.
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 @@ | ||
| export { default } from "@workspace/ui/postcss.config"; | ||
2 changes: 1 addition & 1 deletion
2
apps/dashboard/src/@/components/sponsored-transactions-table/SponsoredTransactionsTable.tsx
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 |
|---|---|---|
| @@ -1,83 +1,3 @@ | ||
| import { Slot } from "@radix-ui/react-slot"; | ||
| import { cva, type VariantProps } from "class-variance-authority"; | ||
| import * as React from "react"; | ||
|
|
||
| import { cn } from "@/lib/utils"; | ||
|
|
||
| const buttonVariants = cva( | ||
| "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50", | ||
| { | ||
| defaultVariants: { | ||
| size: "default", | ||
| variant: "default", | ||
| }, | ||
| variants: { | ||
| size: { | ||
| default: "h-10 px-4 py-2", | ||
| icon: "h-10 w-10", | ||
| lg: "h-11 rounded-md px-8", | ||
| sm: "h-9 rounded-md px-3", | ||
| }, | ||
| variant: { | ||
| default: "bg-foreground text-background hover:bg-foreground/90", | ||
| destructive: | ||
| "bg-destructive hover:bg-destructive/90 text-destructive-foreground ", | ||
| ghost: "hover:bg-accent hover:text-accent-foreground", | ||
| link: "underline-offset-4 hover:underline", | ||
| outline: | ||
| "border border-input bg-transparent hover:bg-accent hover:text-accent-foreground", | ||
| primary: "bg-primary hover:bg-primary/90 text-primary-foreground ", | ||
| secondary: | ||
| "bg-secondary hover:bg-secondary/80 text-secondary-foreground ", | ||
| upsell: | ||
| "bg-green-600 text-white hover:bg-green-700 shadow-lg hover:shadow-xl transform hover:-translate-y-0.5 transition-all duration-200", | ||
| }, | ||
| }, | ||
| }, | ||
| ); | ||
|
|
||
| export interface ButtonProps | ||
| extends React.ButtonHTMLAttributes<HTMLButtonElement>, | ||
| VariantProps<typeof buttonVariants> { | ||
| asChild?: boolean; | ||
| } | ||
|
|
||
| const Button = React.forwardRef<HTMLButtonElement, ButtonProps>( | ||
| ({ className, variant, size, asChild = false, disabled, ...props }, ref) => { | ||
| const Comp = asChild ? Slot : "button"; | ||
|
|
||
| // "button" elements automatically handle the `disabled` attribute. | ||
| // For non-button elements rendered via `asChild` (e.g. <a>), we still want | ||
| // to visually convey the disabled state and prevent user interaction. | ||
| // We do that by conditionally adding the same utility classes that the | ||
| // `disabled:` pseudo-variant would normally apply and by setting | ||
| // `aria-disabled` for accessibility. | ||
| const disabledClass = disabled ? "pointer-events-none opacity-50" : ""; | ||
|
|
||
| const btnOnlyProps = | ||
| Comp === "button" | ||
| ? { | ||
| type: | ||
| (props as React.ButtonHTMLAttributes<HTMLButtonElement>).type || | ||
| ("button" as const), | ||
| } | ||
| : undefined; | ||
|
|
||
| return ( | ||
| <Comp | ||
| aria-disabled={disabled ? true : undefined} | ||
| className={cn( | ||
| buttonVariants({ className, size, variant }), | ||
| disabledClass, | ||
| )} | ||
| disabled={disabled} | ||
| ref={ref} | ||
| {...props} | ||
| {...btnOnlyProps} | ||
| /> | ||
| ); | ||
| }, | ||
| ); | ||
| Button.displayName = "Button"; | ||
|
|
||
| export { Button, buttonVariants }; | ||
| "use client"; | ||
| export type { ButtonProps } from "@workspace/ui/components/button"; | ||
| export { Button, buttonVariants } from "@workspace/ui/components/button"; |
3 changes: 1 addition & 2 deletions
3
.../(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/(marketplace)/components/types.ts
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
2 changes: 1 addition & 1 deletion
2
.../(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/create/_common/chain-overview.tsx
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 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| import tailwindConfig from "@workspace/ui/tailwind.config"; | ||
| import type { Config } from "tailwindcss"; | ||
|
|
||
| const config: Config = { | ||
| ...tailwindConfig, | ||
| content: [ | ||
| "./src/**/*.{ts,tsx}", | ||
| // add contents of ui package | ||
| "../../packages/ui/src/**/*.{ts,tsx}", | ||
| ], | ||
| }; | ||
|
|
||
| export default config; |
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 |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| { | ||
| "$schema": "https://unpkg.com/knip@5/schema.json", | ||
| "ignore": ["src/components/ui/**", "src/app/insight/utils.ts"], | ||
| "ignoreDependencies": ["server-only"], | ||
| "ignoreDependencies": ["server-only", "@workspace/ui", "tailwindcss-animate"], | ||
| "next": true, | ||
| "project": ["src/**"] | ||
| } |
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.
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 @@ | ||
| export { default } from "@workspace/ui/postcss.config"; |
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
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.