Skip to content

Commit 9237db1

Browse files
committed
refactor: faq vanilla extract
1 parent 4fb8e97 commit 9237db1

File tree

4 files changed

+23
-36
lines changed

4 files changed

+23
-36
lines changed

.changeset/cute-carrots-smell.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@ultraviolet/plus": minor
3+
---
4+
5+
Refactor component `FAQ` to use vanilla extract instead of Emotion

packages/plus/src/components/FAQ/__tests__/__snapshots__/index.test.tsx.snap

Lines changed: 8 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,11 @@
22

33
exports[`fAQ > should work with default props 1`] = `
44
<DocumentFragment>
5-
.emotion-0 {
6-
padding: 1rem;
7-
text-align: left;
8-
}
9-
10-
<div
5+
<div
116
data-testid="testing"
127
>
138
<div
14-
class="emotion-0 emotion-1 uv_1p7tz3i1"
9+
class="styles__5imqkb0 uv_1p7tz3i1"
1510
data-disabled="false"
1611
data-is-active="false"
1712
>
@@ -39,16 +34,11 @@ exports[`fAQ > should work with default props 1`] = `
3934

4035
exports[`fAQ > should work with illustrationTest 1`] = `
4136
<DocumentFragment>
42-
.emotion-0 {
43-
padding: 1rem;
44-
text-align: left;
45-
}
46-
47-
<div
37+
<div
4838
data-testid="testing"
4939
>
5040
<div
51-
class="emotion-0 emotion-1 uv_1p7tz3i1"
41+
class="styles__5imqkb0 uv_1p7tz3i1"
5242
data-disabled="false"
5343
data-is-active="false"
5444
>
@@ -82,16 +72,11 @@ exports[`fAQ > should work with illustrationTest 1`] = `
8272

8373
exports[`fAQ > should work with notes 1`] = `
8474
<DocumentFragment>
85-
.emotion-0 {
86-
padding: 1rem;
87-
text-align: left;
88-
}
89-
90-
<div
75+
<div
9176
data-testid="testing"
9277
>
9378
<div
94-
class="emotion-0 emotion-1 uv_1p7tz3i1"
79+
class="styles__5imqkb0 uv_1p7tz3i1"
9580
data-disabled="false"
9681
data-is-active="false"
9782
>
@@ -124,16 +109,11 @@ exports[`fAQ > should work with notes 1`] = `
124109

125110
exports[`fAQ > should work with productIconName 1`] = `
126111
<DocumentFragment>
127-
.emotion-0 {
128-
padding: 1rem;
129-
text-align: left;
130-
}
131-
132-
<div
112+
<div
133113
data-testid="testing"
134114
>
135115
<div
136-
class="emotion-0 emotion-1 uv_1p7tz3i1"
116+
class="styles__5imqkb0 uv_1p7tz3i1"
137117
data-disabled="false"
138118
data-is-active="false"
139119
>

packages/plus/src/components/FAQ/index.tsx

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
'use client'
22

3-
import styled from '@emotion/styled'
43
import * as ProductIcon from '@ultraviolet/icons/product'
54
import { Bullet, Card, Stack, Text } from '@ultraviolet/ui'
65
import type { PascalToCamelCaseWithoutSuffix } from '../../types'
7-
8-
const StyledCard = styled(Card)`
9-
padding: ${({ theme }) => theme.space['2']};
10-
text-align: left;
11-
`
6+
import { faq } from './styles.css'
127

138
type FAQProps = {
149
description: string
@@ -37,7 +32,7 @@ export const FAQ = ({
3732
: null
3833

3934
return (
40-
<StyledCard>
35+
<Card className={faq}>
4136
<Stack direction="row" gap={2}>
4237
<div>
4338
{!productIconName && illustrationText ? (
@@ -59,6 +54,6 @@ export const FAQ = ({
5954
</Text>
6055
</div>
6156
</Stack>
62-
</StyledCard>
57+
</Card>
6358
)
6459
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { theme } from '@ultraviolet/themes'
2+
import { style } from '@vanilla-extract/css'
3+
4+
export const faq = style({
5+
padding: theme.space[2],
6+
textAlign: 'left',
7+
})

0 commit comments

Comments
 (0)