@@ -3,7 +3,15 @@ import type {
33 DialogContentProps as _DialogContentProps ,
44 DialogContentEmits ,
55} from ' reka-ui'
6- import { injectThemeContext } from ' ../ThemeProvider.vue'
6+ import {
7+ DialogPortal ,
8+ DialogContent ,
9+ DialogOverlay ,
10+ DialogClose ,
11+ } from ' reka-ui'
12+ import { Icon } from ' @iconify/vue'
13+ import IconButton from ' ../button/IconButton.vue'
14+ import ThemeWrapper from ' ../provider/ThemeWrapper.vue'
715
816export interface DialogContentProps extends _DialogContentProps {
917 to? : string | HTMLElement
@@ -19,15 +27,7 @@ export interface DialogContentProps extends _DialogContentProps {
1927 </script >
2028
2129<script setup lang="ts">
22- import {
23- DialogPortal ,
24- DialogContent ,
25- DialogOverlay ,
26- DialogClose ,
27- } from ' reka-ui'
28- import { Icon } from ' @iconify/vue'
2930import { useForwardPropsEmits } from ' ../util'
30- import IconButton from ' ../button/IconButton.vue'
3131
3232defineOptions ({
3333 inheritAttrs: false ,
@@ -37,7 +37,6 @@ const props = withDefaults(defineProps<DialogContentProps>(), {
3737 size: ' 3' ,
3838 maxWidth: ' 600px' ,
3939})
40- const theme = injectThemeContext ()
4140const emits = defineEmits <DialogContentEmits >()
4241const forwarded = useForwardPropsEmits (props , emits , [
4342 ' to' , ' align' , ' class' , ' size' ,
@@ -49,47 +48,43 @@ const forwarded = useForwardPropsEmits(props, emits, [
4948
5049<template >
5150 <DialogPortal :to =" props.to" >
52- <DialogOverlay
53- class =" ui-root ui-DialogOverlay"
54- :data-accent-color =" theme.accentColor.value"
55- :data-gray-color =" theme.grayColor.value"
56- :data-radius =" theme.radius.value"
57- :data-scaling =" theme.scaling.value"
58- >
59- <div class =" ui-DialogWrapper" >
60- <div class =" ui-DialogContainer" >
61- <DialogContent
62- class =" ui-DialogContent"
63- :class =" `r-size-${props.size}`"
64- v-bind =" {
65- ...$attrs,
66- ...forwarded,
67- }"
68- :style =" {
69- width: props.width,
70- height: props.height,
71- minWidth: props.minWidth,
72- maxWidth: props.maxWidth,
73- minHeight: props.minHeight,
74- maxHeight: props.maxHeight,
75- }"
76- >
77- <IconButton
78- v-if =" props.closeIcon"
79- class =" ui-DialogContentClose"
80- :as =" DialogClose"
81- type =" button"
82- variant =" ghost"
83- color =" gray"
84- aria-label =" Close"
51+ <ThemeWrapper >
52+ <DialogOverlay class =" ui-DialogOverlay" >
53+ <div class =" ui-DialogWrapper" >
54+ <div class =" ui-DialogContainer" >
55+ <DialogContent
56+ class =" ui-DialogContent"
57+ :class =" `r-size-${props.size}`"
58+ v-bind =" {
59+ ...$attrs,
60+ ...forwarded,
61+ }"
62+ :style =" {
63+ width: props.width,
64+ height: props.height,
65+ minWidth: props.minWidth,
66+ maxWidth: props.maxWidth,
67+ minHeight: props.minHeight,
68+ maxHeight: props.maxHeight,
69+ }"
8570 >
86- <Icon icon =" lucide:x" />
87- </IconButton >
88- <slot ></slot >
89- </DialogContent >
71+ <IconButton
72+ v-if =" props.closeIcon"
73+ class =" ui-DialogContentClose"
74+ :as =" DialogClose"
75+ type =" button"
76+ variant =" ghost"
77+ color =" gray"
78+ aria-label =" Close"
79+ >
80+ <Icon icon =" lucide:x" />
81+ </IconButton >
82+ <slot ></slot >
83+ </DialogContent >
84+ </div >
9085 </div >
91- </div >
92- </DialogOverlay >
86+ </DialogOverlay >
87+ </ThemeWrapper >
9388 </DialogPortal >
9489</template >
9590
0 commit comments