11'use client'
22
3- import styled from '@emotion/styled'
43import { AlertCircleIcon , CheckIcon } from '@ultraviolet/icons'
54import type { ComponentProps } from 'react'
65import { useMemo } from 'react'
@@ -15,20 +14,10 @@ import { DialogCancelButton } from './components/CancelButton'
1514import { DialogStack } from './components/Stack'
1615import { DialogText } from './components/Text'
1716import type { DialogSentiment } from './constants'
17+ import { dialogTitle , dialogXsmall } from './styles.css'
1818
1919const DIALOG_SIZE = 'xsmall'
2020
21- const StyledTextTitle = styled ( Text ) `
22- margin-top: ${ ( { theme } ) => theme . space [ '2' ] } ;
23- margin-bottom: ${ ( { theme } ) => theme . space [ '1' ] } ;
24- `
25-
26- const StyledModal = styled ( Modal ) `
27- &[data-size="${ DIALOG_SIZE } "] {
28- width: 32.5rem; // size is on purpose different than a modal
29- }
30- `
31-
3221type DialogProps = Pick <
3322 ComponentProps < typeof Modal > ,
3423 | 'ariaLabel'
@@ -75,13 +64,14 @@ export const BaseDialog = ({
7564 < CheckIcon />
7665 ) }
7766 </ Bullet >
78- < StyledTextTitle
67+ < Text
7968 as = "h2"
69+ className = { dialogTitle }
8070 sentiment = "neutral"
8171 variant = "headingSmallStronger"
8272 >
8373 { title }
84- </ StyledTextTitle >
74+ </ Text >
8575 </ >
8676 )
8777
@@ -93,9 +83,9 @@ export const BaseDialog = ({
9383 )
9484
9585 return (
96- < StyledModal
86+ < Modal
9787 ariaLabel = { ariaLabel }
98- className = { className }
88+ className = { ` ${ className ? ` ${ className } ` : '' } ${ dialogXsmall } ` }
9989 data-testid = { dataTestId }
10090 disclosure = { disclosure }
10191 hideOnClickOutside = { hideOnClickOutside }
@@ -121,7 +111,7 @@ export const BaseDialog = ({
121111 </ DialogContext . Provider >
122112 )
123113 }
124- </ StyledModal >
114+ </ Modal >
125115 )
126116}
127117
0 commit comments