@@ -75,7 +75,7 @@ export default component$(() => {
75
75
76
76
const { theme, setTheme } = useTheme ( ) ;
77
77
78
- const themeComputedObject = useComputed$ ( ( ) => {
78
+ const themeComputedObjectSig = useComputed$ ( ( ) => {
79
79
const themeArray = Array . isArray ( theme ) ? theme : theme ?. split ( ' ' ) ;
80
80
return {
81
81
mode : themeArray ?. [ 0 ] || 'light' ,
@@ -86,8 +86,8 @@ export default component$(() => {
86
86
} ;
87
87
} ) ;
88
88
89
- const themeStoreToThemeClasses = $ ( ( ) => {
90
- const { mode, style, base, primary, borderRadius } = themeComputedObject . value ;
89
+ const themeStoreToThemeClasses$ = $ ( ( ) => {
90
+ const { mode, style, base, primary, borderRadius } = themeComputedObjectSig . value ;
91
91
return [ mode , style , base , primary , borderRadius ] ;
92
92
} ) ;
93
93
return (
@@ -117,11 +117,11 @@ export default component$(() => {
117
117
< label class = "mb-1 block font-medium" > Preset</ label >
118
118
< select
119
119
class = "bg-background rounded-base h-12 min-w-80 border p-2"
120
- value = { themeComputedObject . value . style }
120
+ value = { themeComputedObjectSig . value . style }
121
121
onChange$ = { async ( e , el ) => {
122
- themeComputedObject . value . style = el . value ;
123
- console . log ( 'themeComputedObject.value' , themeComputedObject . value ) ;
124
- setTheme ( await themeStoreToThemeClasses ( ) ) ;
122
+ themeComputedObjectSig . value . style = el . value ;
123
+ console . log ( 'themeComputedObject.value' , themeComputedObjectSig . value ) ;
124
+ setTheme ( await themeStoreToThemeClasses$ ( ) ) ;
125
125
} }
126
126
>
127
127
< option value = { 'simple' } > Simple</ option >
@@ -132,17 +132,17 @@ export default component$(() => {
132
132
< label class = "mb-1 mt-8 block font-medium" > Base</ label >
133
133
< div class = "flex" >
134
134
{ baseOptions . map ( ( base ) => {
135
- const isActive = themeComputedObject . value . base === base ;
135
+ const isActive = themeComputedObjectSig . value . base === base ;
136
136
137
137
return (
138
138
< Button
139
139
key = { base }
140
140
look = "ghost"
141
141
size = "icon"
142
142
onClick$ = { async ( ) => {
143
- themeComputedObject . value . base = base ;
143
+ themeComputedObjectSig . value . base = base ;
144
144
145
- setTheme ( await themeStoreToThemeClasses ( ) ) ;
145
+ setTheme ( await themeStoreToThemeClasses$ ( ) ) ;
146
146
} }
147
147
class = { cn (
148
148
'flex h-4 w-4 items-center justify-center rounded-none' ,
@@ -167,7 +167,7 @@ export default component$(() => {
167
167
< label class = "mb-1 mt-8 block font-medium" > Primary</ label >
168
168
< div class = "grid grid-cols-[repeat(22,1fr)]" >
169
169
{ primaryOptions . map ( ( primary ) => {
170
- const isActive = themeComputedObject . value . primary === primary ;
170
+ const isActive = themeComputedObjectSig . value . primary === primary ;
171
171
172
172
if (
173
173
primary . includes ( 'slate-100' ) ||
@@ -189,8 +189,8 @@ export default component$(() => {
189
189
look = "ghost"
190
190
size = "icon"
191
191
onClick$ = { async ( ) => {
192
- themeComputedObject . value . primary = primary ;
193
- setTheme ( await themeStoreToThemeClasses ( ) ) ;
192
+ themeComputedObjectSig . value . primary = primary ;
193
+ setTheme ( await themeStoreToThemeClasses$ ( ) ) ;
194
194
} }
195
195
class = { cn (
196
196
'flex h-4 w-4 items-center justify-center rounded-none' ,
@@ -437,14 +437,14 @@ export default component$(() => {
437
437
< div class = "flex flex-col space-y-2" >
438
438
{ borderRadiusOptions . map ( ( borderRadius ) => {
439
439
const isActive =
440
- themeComputedObject . value . borderRadius === borderRadius ;
440
+ themeComputedObjectSig . value . borderRadius === borderRadius ;
441
441
return (
442
442
< Button
443
443
key = { borderRadius }
444
444
look = "outline"
445
445
onClick$ = { async ( ) => {
446
- themeComputedObject . value . borderRadius = borderRadius ;
447
- setTheme ( await themeStoreToThemeClasses ( ) ) ;
446
+ themeComputedObjectSig . value . borderRadius = borderRadius ;
447
+ setTheme ( await themeStoreToThemeClasses$ ( ) ) ;
448
448
} }
449
449
class = { cn ( isActive && 'border-ring mb-2' ) }
450
450
>
@@ -458,13 +458,15 @@ export default component$(() => {
458
458
Dark Mode{ ' ' }
459
459
< input
460
460
type = "checkbox"
461
- checked = { themeComputedObject . value . mode === 'dark' }
461
+ checked = { themeComputedObjectSig . value . mode === 'dark' }
462
462
onClick$ = { async ( ) => {
463
- themeComputedObject . value . mode =
464
- themeComputedObject . value . mode . includes ( 'light' ) ? 'dark' : 'light' ;
463
+ themeComputedObjectSig . value . mode =
464
+ themeComputedObjectSig . value . mode . includes ( 'light' )
465
+ ? 'dark'
466
+ : 'light' ;
465
467
466
- console . log ( themeComputedObject . value . mode ) ;
467
- setTheme ( await themeStoreToThemeClasses ( ) ) ;
468
+ console . log ( themeComputedObjectSig . value . mode ) ;
469
+ setTheme ( await themeStoreToThemeClasses$ ( ) ) ;
468
470
} }
469
471
/>
470
472
</ div >
0 commit comments