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

style(v2)/fix component style #714

Merged
merged 2 commits into from
Nov 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 6 additions & 4 deletions packages/ui/src/components/button/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { tv, type VariantProps } from 'tailwind-variants'
import Root from './button.svelte'

const buttonVariants = tv({
base: 'inline-flex items-center justify-center whitespace-nowrap rounded-button text-button2 font-medium ring-offset-surface transition-all focus-visible:outline-none focus-visible:ring-1.5 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50',
base: 'inline-flex items-center justify-center whitespace-nowrap rounded-button text-button2 font-medium font-sans ring-offset-surface transition-all focus-visible:outline-none focus-visible:ring-1.5 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50',
variants: {
variant: {
solid: 'hover:outline-none hover:ring-1.5 hover:ring-offset-2',
Expand All @@ -16,7 +16,7 @@ const buttonVariants = tv({
lg: 'h-10 px-5',
},
color: {
primary: 'text-on-primary-container focus-visible:ring-primary-container',
primary: 'focus-visible:ring-primary-container',
neutral: 'text-on-surface focus-visible:ring-surface-container-low',
error: 'text-on-error-container focus-visible:ring-error-container',
secondary:
Expand All @@ -27,7 +27,8 @@ const buttonVariants = tv({
{
variant: 'solid',
color: 'primary',
class: 'bg-primary-container hover:ring-primary-container',
class:
'bg-primary-container hover:ring-primary-container text-on-primary-container ',
},
{
variant: 'solid',
Expand All @@ -47,7 +48,8 @@ const buttonVariants = tv({
{
variant: 'outlined',
color: 'primary',
class: 'ring-primary-container hover:bg-primary-container',
class:
'ring-primary hover:bg-primary-container text-primary hover:text-on-primary-container',
},
{
variant: 'outlined',
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/table/table-cell.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<td
class="{cn(
'p-4 align-middle [&:has([role=checkbox])]:pr-0 text-on-surface font-normal text-body1',
'p-4 align-middle data-[rowspan=true]:align-top [&:has([role=checkbox])]:pr-0 text-on-surface font-normal font-sarabun text-body1',
className,
)}"
{...$$restProps}
Expand Down
5 changes: 3 additions & 2 deletions packages/ui/src/components/table/table.stories.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ This example demonstrates the use of each sub-component:
- **Table.Row**: Represents a row within either the header or the body.
- **Table.Head**: Column headers, typically styled differently from body cells.
- **Table.Body**: Contains the main content rows.
- **Table.Cell**: Represents an individual data cell, with support for styling and spans.
- **Table.Cell**: Represents an individual data cell, with support for styling and spans.
**(don't forget to use data-rowspan='true' or 'false' to apply correct style)**
`,
},
},
Expand All @@ -44,7 +45,7 @@ This example demonstrates the use of each sub-component:
</Table.Header>
<Table.Body>
<Table.Row class="border-b-0">
<Table.Cell rowspan="{2}">INV001</Table.Cell>
<Table.Cell data-rowspan="{true}" rowspan="{2}">INV001</Table.Cell>
<Table.Cell>Paid</Table.Cell>
<Table.Cell>Credit Card</Table.Cell>
<Table.Cell>$250.00</Table.Cell>
Expand Down
Loading