Skip to content

Commit adf8a65

Browse files
authored
fix(Infotable): simpler css on string cell (#6273)
1 parent 89ccfa0 commit adf8a65

File tree

5 files changed

+21
-9
lines changed

5 files changed

+21
-9
lines changed

.changeset/brown-sails-count.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@ultraviolet/ui": patch
3+
---
4+
5+
`InfoTable`: remove useless styling on string cells

packages/ui/src/components/compositions/InfoTable/__stories__/MultiLine.stories.tsx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { InfoTable } from '..'
2-
import { Stack } from '../../../Stack'
32

43
import type { StoryFn } from '@storybook/react-vite'
54
import type { ComponentProps } from 'react'
@@ -8,12 +7,10 @@ export const MultiLine: StoryFn<ComponentProps<typeof InfoTable>> = props => (
87
<InfoTable {...props}>
98
<InfoTable.Row templateColumns="repeat(2, 1fr)">
109
<InfoTable.Cell title="without multiLine">
11-
<Stack>
12-
cell cell cell cell cell cell cell cell cell cell cell cell cell cell
13-
cell cell cell cell cell cell cell cell cell cell cell cell cell cell
14-
cell cell cell cell cell cell cell cell cell cell cell cell cell cell
15-
cell cell
16-
</Stack>
10+
cell cell cell cell cell cell cell cell cell cell cell cell cell cell
11+
cell cell cell cell cell cell cell cell cell cell cell cell cell cell
12+
cell cell cell cell cell cell cell cell cell cell cell cell cell cell
13+
cell cell
1714
</InfoTable.Cell>
1815
<InfoTable.Cell multiline title="with multiLine">
1916
cell cell cell cell cell cell cell cell cell cell cell cell cell cell

packages/ui/src/components/compositions/InfoTable/__tests__/__snapshots__/index.test.tsx.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ exports[`infoTable > should work with CellWithCopybutton 1`] = `
142142
title
143143
</dt>
144144
<dd
145-
class="styles__dvjyo45 style__m4c9ow0 style_oneLine_true__m4c9ow3 style_prominence_default__m4c9ow4 style_sentiment_neutral__m4c9owb style_variant_body__m4c9owj style_undefined_compound_0__m4c9ow1a style_undefined_compound_64__m4c9ow32"
145+
class="styles__dvjyo45 styles__dvjyo46 style__m4c9ow0 style_oneLine_true__m4c9ow3 style_prominence_default__m4c9ow4 style_sentiment_neutral__m4c9owb style_variant_body__m4c9owj style_undefined_compound_0__m4c9ow1a style_undefined_compound_64__m4c9ow32"
146146
>
147147
<div
148148
class="styles__x6hyh50 styles_alignItems_center_xxsmall__x6hyh5d styles_gap_0.5rem_xxsmall__x6hyh52j"

packages/ui/src/components/compositions/InfoTable/components/Cell.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
'use client'
22

3+
import { cn } from '@ultraviolet/utils'
4+
35
import { Stack } from '../../../Stack'
46
import { Text } from '../../../Text'
57
import { infoTableStyle } from '../styles.css'
@@ -37,7 +39,10 @@ export const InfoTableCell = ({
3739
</Text>
3840
<Text
3941
as="dd"
40-
className={infoTableStyle.desc}
42+
className={cn(
43+
infoTableStyle.desc,
44+
typeof children === 'string' ? '' : infoTableStyle.descFlex,
45+
)}
4146
oneLine={!multiline}
4247
prominence="default"
4348
sentiment="neutral"

packages/ui/src/components/compositions/InfoTable/styles.css.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,16 @@ const term = style({
4242
display: 'inline-flex',
4343
gap: theme.space[1],
4444
})
45+
4546
const desc = style({
4647
color: theme.colors.neutral.text,
4748
margin: 0,
4849
minWidth: 0,
4950
width: '100%',
5051
maxWidth: '100%',
52+
})
53+
54+
const descFlex = style({
5155
display: 'flex',
5256
flexDirection: 'row',
5357
alignItems: 'center',
@@ -74,5 +78,6 @@ export const infoTableStyle = {
7478
cell,
7579
term,
7680
desc,
81+
descFlex,
7782
cellWithCopyButton,
7883
}

0 commit comments

Comments
 (0)