-
Notifications
You must be signed in to change notification settings - Fork 1
[CDX-430] Scope all Tailwind classes to work on the library's components only #49
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
base: main
Are you sure you want to change the base?
Changes from all commits
33a59e0
0ac6eb4
d7149c6
efbff28
69e40df
d102277
09f2591
e8e9b3d
5ddd3fc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,32 +5,33 @@ import { ComponentOverrideProps, IncludeComponentOverrides } from '@/types'; | |
| import { cva, VariantProps } from 'class-variance-authority'; | ||
|
|
||
| const badgeVariants = cva( | ||
| "cio-components cio-badge inline-flex items-center gap-1.5 whitespace-nowrap font-medium transition-all [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-3 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive overflow-hidden tracking-tighter", | ||
| "cio-components cio-badge cio:inline-flex cio:items-center cio:gap-1.5 cio:whitespace-nowrap cio:font-medium cio:transition-all cio:[&_svg]:pointer-events-none cio:[&_svg:not([class*='cio:size-'])]:size-3 cio:shrink-0 cio:[&_svg]:shrink-0 cio:outline-none cio:focus-visible:border-ring cio:focus-visible:ring-ring/50 cio:focus-visible:ring-[3px] cio:aria-invalid:ring-destructive/20 cio:dark:aria-invalid:ring-destructive/40 cio:aria-invalid:border-destructive cio:overflow-hidden cio:tracking-tighter", | ||
|
constructor-claude-bedrock[bot] marked this conversation as resolved.
constructor-claude-bedrock[bot] marked this conversation as resolved.
esezen marked this conversation as resolved.
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. Important Issue: The arbitrary variant |
||
| { | ||
| variants: { | ||
| variant: { | ||
| default: | ||
| 'border-transparent bg-primary text-primary-foreground shadow-xs hover:bg-primary/90', | ||
| secondary: 'border-transparent bg-secondary shadow-xs hover:bg-secondary/90', | ||
| 'cio:border-transparent cio:bg-primary cio:text-primary-foreground cio:shadow-xs cio:hover:bg-primary/90', | ||
| secondary: | ||
| 'cio:border-transparent cio:bg-secondary cio:shadow-xs cio:hover:bg-secondary/90', | ||
| outline: | ||
| 'border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50', | ||
| 'cio:border cio:bg-background cio:shadow-xs cio:hover:bg-accent cio:hover:text-accent-foreground cio:dark:bg-input/30 cio:dark:border-input cio:dark:hover:bg-input/50', | ||
| destructive: | ||
| 'border-transparent bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60', | ||
| 'cio:border-transparent cio:bg-destructive cio:text-white cio:shadow-xs cio:hover:bg-destructive/90 cio:focus-visible:ring-destructive/20 cio:dark:focus-visible:ring-destructive/40 cio:dark:bg-destructive/60', | ||
| }, | ||
| size: { | ||
| sm: 'h-4 px-1 text-xs leading-3', | ||
| md: 'h-5 py-1 px-2 text-[13px] leading-4', | ||
| lg: 'h-6 py-1 px-2 text-sm leading-4', | ||
| sm: 'cio:h-4 cio:px-1 cio:text-xs cio:leading-3', | ||
| md: 'cio:h-5 cio:py-1 cio:px-2 cio:text-[13px] cio:leading-4', | ||
| lg: 'cio:h-6 cio:py-1 cio:px-2 cio:text-sm cio:leading-4', | ||
| }, | ||
| shape: { | ||
| beveled: 'rounded-sm', | ||
| rounded: 'rounded-full', | ||
| text: 'bg-transparent', | ||
| sharp: 'rounded-none', | ||
| beveled: 'cio:rounded-sm', | ||
| rounded: 'cio:rounded-full', | ||
| text: 'cio:bg-transparent', | ||
| sharp: 'cio:rounded-none', | ||
| }, | ||
| state: { | ||
| default: '', | ||
| disabled: 'text-[#0A0F2940] bg-secondary pointer-events-none', | ||
| disabled: 'cio:text-[#0A0F2940] cio:bg-secondary cio:pointer-events-none', | ||
| }, | ||
| isNumber: { | ||
| true: '', | ||
|
|
@@ -41,17 +42,17 @@ const badgeVariants = cva( | |
| { | ||
| isNumber: true, | ||
| size: 'sm', | ||
| class: 'px-0 min-w-4 justify-center', | ||
| class: 'cio:px-0 cio:min-w-4 cio:justify-center', | ||
| }, | ||
| { | ||
| isNumber: true, | ||
| size: 'md', | ||
| class: 'p-0.5 min-w-5 justify-center', | ||
| class: 'cio:p-0.5 cio:min-w-5 cio:justify-center', | ||
| }, | ||
| { | ||
| isNumber: true, | ||
| size: 'lg', | ||
| class: 'p-0.5 min-w-6 justify-center', | ||
| class: 'cio:p-0.5 cio:min-w-6 cio:justify-center', | ||
| }, | ||
| ], | ||
| defaultVariants: { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,30 +5,31 @@ import { ComponentOverrideProps, IncludeComponentOverrides } from '@/types'; | |
| import { cva, VariantProps } from 'class-variance-authority'; | ||
|
|
||
| const buttonVariants = cva( | ||
| "cio-components cio-button cursor-pointer inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-sm text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive cursor-pointer", | ||
| "cio-components cio-button cio:cursor-pointer cio:inline-flex cio:items-center cio:justify-center cio:gap-2 cio:whitespace-nowrap cio:rounded-sm cio:text-sm cio:font-medium cio:transition-all cio:disabled:pointer-events-none cio:disabled:opacity-50 cio:[&_svg]:pointer-events-none cio:[&_svg:not([class*='cio:size-'])]:size-4 cio:shrink-0 cio:[&_svg]:shrink-0 cio:outline-none cio:focus-visible:border-ring cio:focus-visible:ring-ring/50 cio:focus-visible:ring-[3px] cio:aria-invalid:ring-destructive/20 cio:dark:aria-invalid:ring-destructive/40 cio:aria-invalid:border-destructive", | ||
|
constructor-claude-bedrock[bot] marked this conversation as resolved.
esezen marked this conversation as resolved.
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. Important Issue: Same malformed arbitrary variant as in |
||
| { | ||
| variants: { | ||
| variant: { | ||
| default: 'bg-primary text-primary-foreground shadow-xs hover:bg-primary/90', | ||
| secondary: 'bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80', | ||
| default: 'cio:bg-primary cio:text-primary-foreground cio:shadow-xs cio:hover:bg-primary/90', | ||
| secondary: | ||
| 'cio:bg-secondary cio:text-secondary-foreground cio:shadow-xs cio:hover:bg-secondary/80', | ||
| outline: | ||
| 'border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50', | ||
| ghost: 'hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50', | ||
| link: 'text-primary underline-offset-4 hover:underline', | ||
| 'cio:border cio:bg-background cio:shadow-xs cio:hover:bg-accent cio:hover:text-accent-foreground cio:dark:bg-input/30 cio:dark:border-input cio:dark:hover:bg-input/50', | ||
| ghost: 'cio:hover:bg-accent cio:hover:text-accent-foreground cio:dark:hover:bg-accent/50', | ||
| link: 'cio:text-primary cio:underline-offset-4 cio:hover:underline', | ||
| destructive: | ||
| 'bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60', | ||
| 'cio:bg-destructive cio:text-white cio:shadow-xs cio:hover:bg-destructive/90 cio:focus-visible:ring-destructive/20 cio:dark:focus-visible:ring-destructive/40 cio:dark:bg-destructive/60', | ||
| }, | ||
| size: { | ||
| sm: 'h-6 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5', | ||
| md: 'h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5', | ||
| default: 'h-10 px-4 py-2 has-[>svg]:px-3', | ||
| xl: 'h-12 rounded-md px-6 has-[>svg]:px-4', | ||
| icon: 'size-9', | ||
| sm: 'cio:h-6 cio:rounded-md cio:gap-1.5 cio:px-3 cio:has-[>svg]:px-2.5', | ||
| md: 'cio:h-8 cio:rounded-md cio:gap-1.5 cio:px-3 cio:has-[>svg]:px-2.5', | ||
| default: 'cio:h-10 cio:px-4 cio:py-2 cio:has-[>svg]:px-3', | ||
| xl: 'cio:h-12 cio:rounded-md cio:px-6 cio:has-[>svg]:px-4', | ||
| icon: 'cio:size-9', | ||
| }, | ||
| shape: { | ||
| beveled: 'rounded-sm', | ||
| rounded: 'rounded-full', | ||
| sharp: 'rounded-none', | ||
| beveled: 'cio:rounded-sm', | ||
| rounded: 'cio:rounded-full', | ||
| sharp: 'cio:rounded-none', | ||
| }, | ||
| }, | ||
| defaultVariants: { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.