This repository was archived by the owner on Sep 20, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 14 files changed +153
-50
lines changed Expand file tree Collapse file tree 14 files changed +153
-50
lines changed Original file line number Diff line number Diff line change 6
6
*
7
7
* This is a generated file. Do not edit it's contents.
8
8
*
9
- * This file was generated on 2023-03-28T16:40:42.002Z
9
+ * This file was generated on 2023-03-28T18:16:17.195Z
10
10
*/
11
11
12
12
import { ChakraProps , chakra } from "@chakra-ui/vue-system"
@@ -169,9 +169,16 @@ declare module "@vue/runtime-core" {
169
169
CStack : typeof import ( "@chakra-ui/vue-next" ) [ "CStack" ]
170
170
CStackDivider : typeof import ( "@chakra-ui/vue-next" ) [ "CStackDivider" ]
171
171
CStackItem : typeof import ( "@chakra-ui/vue-next" ) [ "CStackItem" ]
172
+ CTab : typeof import ( "@chakra-ui/vue-next" ) [ "CTab" ]
173
+ CTabIndicator : typeof import ( "@chakra-ui/vue-next" ) [ "CTabIndicator" ]
174
+ CTabList : typeof import ( "@chakra-ui/vue-next" ) [ "CTabList" ]
175
+ CTabPanel : typeof import ( "@chakra-ui/vue-next" ) [ "CTabPanel" ]
176
+ CTabPanels : typeof import ( "@chakra-ui/vue-next" ) [ "CTabPanels" ]
177
+ CTabTrigger : typeof import ( "@chakra-ui/vue-next" ) [ "CTabTrigger" ]
172
178
CTable : typeof import ( "@chakra-ui/vue-next" ) [ "CTable" ]
173
179
CTableCaption : typeof import ( "@chakra-ui/vue-next" ) [ "CTableCaption" ]
174
180
CTableContainer : typeof import ( "@chakra-ui/vue-next" ) [ "CTableContainer" ]
181
+ CTabs : typeof import ( "@chakra-ui/vue-next" ) [ "CTabs" ]
175
182
CTbody : typeof import ( "@chakra-ui/vue-next" ) [ "CTbody" ]
176
183
CTd : typeof import ( "@chakra-ui/vue-next" ) [ "CTd" ]
177
184
CText : typeof import ( "@chakra-ui/vue-next" ) [ "CText" ]
Original file line number Diff line number Diff line change 6
6
*
7
7
* This is a generated file. Do not edit it's contents.
8
8
*
9
- * This file was generated on 2023-03-28T16:40:42.002Z
9
+ * This file was generated on 2023-03-28T18:16:17.195Z
10
10
*/
11
11
12
12
import { ChakraProps , chakra } from "@chakra-ui/vue-system"
@@ -169,9 +169,16 @@ declare module "@vue/runtime-core" {
169
169
CStack : typeof import ( "@chakra-ui/vue-next" ) [ "CStack" ]
170
170
CStackDivider : typeof import ( "@chakra-ui/vue-next" ) [ "CStackDivider" ]
171
171
CStackItem : typeof import ( "@chakra-ui/vue-next" ) [ "CStackItem" ]
172
+ CTab : typeof import ( "@chakra-ui/vue-next" ) [ "CTab" ]
173
+ CTabIndicator : typeof import ( "@chakra-ui/vue-next" ) [ "CTabIndicator" ]
174
+ CTabList : typeof import ( "@chakra-ui/vue-next" ) [ "CTabList" ]
175
+ CTabPanel : typeof import ( "@chakra-ui/vue-next" ) [ "CTabPanel" ]
176
+ CTabPanels : typeof import ( "@chakra-ui/vue-next" ) [ "CTabPanels" ]
177
+ CTabTrigger : typeof import ( "@chakra-ui/vue-next" ) [ "CTabTrigger" ]
172
178
CTable : typeof import ( "@chakra-ui/vue-next" ) [ "CTable" ]
173
179
CTableCaption : typeof import ( "@chakra-ui/vue-next" ) [ "CTableCaption" ]
174
180
CTableContainer : typeof import ( "@chakra-ui/vue-next" ) [ "CTableContainer" ]
181
+ CTabs : typeof import ( "@chakra-ui/vue-next" ) [ "CTabs" ]
175
182
CTbody : typeof import ( "@chakra-ui/vue-next" ) [ "CTbody" ]
176
183
CTd : typeof import ( "@chakra-ui/vue-next" ) [ "CTd" ]
177
184
CText : typeof import ( "@chakra-ui/vue-next" ) [ "CText" ]
Original file line number Diff line number Diff line change 1
1
<template >
2
2
<chakra .div data-testid =" simple-tabs-example" >
3
- <c-tabs default-value = " two " >
3
+ <c-tabs v-model = " value " >
4
4
<c-tab-list >
5
5
<c-tab value =" one" > Item One </c-tab >
6
6
<c-tab value =" two" > Item Two </c-tab >
@@ -26,5 +26,6 @@ import {
26
26
CTabPanel ,
27
27
CTabPanels ,
28
28
CTabIndicator ,
29
- } from " ../../../../packages/c-tabs/src"
29
+ } from " @chakra-ui/vue-next"
30
+ const value = ref (" two" )
30
31
</script >
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import type * as NuxtAppTypes from "nuxt/app"
2
2
import { defineNuxtPlugin , useAppConfig } from "#imports"
3
3
import {
4
4
cookieStorageManagerSSR ,
5
+ localStorageManager ,
5
6
ColorModeConstants ,
6
7
extendTheme ,
7
8
ColorModeScriptProps ,
@@ -61,9 +62,9 @@ export default defineNuxtPlugin((nuxtApp) => {
61
62
: ssrColorMode ,
62
63
} ,
63
64
} ) ,
64
- colorModeManager : cookieStorageManagerSSR (
65
- ColorModeConstants . CookieStorageKey
66
- ) ,
65
+ colorModeManager : ! ! ssrColorMode
66
+ ? cookieStorageManagerSSR ( ColorModeConstants . CookieStorageKey )
67
+ : localStorageManager ,
67
68
icons : chakraConfig . icons ,
68
69
} )
69
70
Original file line number Diff line number Diff line change @@ -84,6 +84,7 @@ export const CAlert = defineComponent({
84
84
)
85
85
86
86
const themingProps = computed < ThemingProps > ( ( ) => ( {
87
+ styleConfig : props . styleConfig ,
87
88
colorScheme : colorScheme . value ,
88
89
variant : props . variant ,
89
90
} ) )
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ import type * as ZT from "@zag-js/types"
17
17
import { useId } from "@chakra-ui/vue-composables"
18
18
import { useMotions } from "@vueuse/motion"
19
19
import { useMultiStyleConfig } from "@chakra-ui/vue-system"
20
+ import { vueThemingProps } from "@chakra-ui/vue-utils"
20
21
21
22
type PopoverPropsContext = UsePopoverProps [ "context" ]
22
23
@@ -65,6 +66,7 @@ const VuePopoverProps = {
65
66
type : String as PropType < CPopoverProps [ "trigger" ] > ,
66
67
default : "click" ,
67
68
} ,
69
+ ...vueThemingProps ,
68
70
}
69
71
70
72
export const CPopover = defineComponent ( {
Original file line number Diff line number Diff line change 1
1
import { HTMLChakraProps , chakra } from "@chakra-ui/vue-system"
2
- import { defineComponent } from "vue"
2
+ import { computed , defineComponent } from "vue"
3
3
import { useTabsContext } from "./tabs.context"
4
4
5
5
export type CTabIndicatorProps = HTMLChakraProps < "div" >
6
6
export const CTabIndicator = defineComponent ( {
7
7
name : "CTabIndicator" ,
8
+ inheritAttrs : false ,
8
9
setup ( _ , { attrs, slots } ) {
9
10
const api = useTabsContext ( )
11
+ const tabIndicatorProps = computed ( ( ) => {
12
+ const { indicatorStyles, ...otherProps } = api . value . indicatorProps || { }
13
+ const { style, ...otherAttrs } = attrs || { }
14
+ return {
15
+ style : {
16
+ ...( indicatorStyles || { } ) ,
17
+ ...( style || { } ) ,
18
+ } ,
19
+ others : {
20
+ ...otherProps ,
21
+ ...otherAttrs ,
22
+ } ,
23
+ }
24
+ } )
10
25
return ( ) => (
11
- < chakra . div { ...api . value . indicatorProps } { ...attrs } >
26
+ < chakra . div
27
+ style = { tabIndicatorProps . value . style }
28
+ { ...tabIndicatorProps . value . others }
29
+ { ...attrs }
30
+ >
12
31
{ slots . default ?.( ) }
13
32
</ chakra . div >
14
33
)
Original file line number Diff line number Diff line change 1
- import { HTMLChakraProps , chakra } from "@chakra-ui/vue-system"
2
- import { defineComponent , watchEffect } from "vue"
3
- import { useTabsContext } from "./tabs.context"
1
+ import {
2
+ HTMLChakraProps ,
3
+ SystemStyleObject ,
4
+ chakra ,
5
+ } from "@chakra-ui/vue-system"
6
+ import { computed , defineComponent , watchEffect } from "vue"
7
+ import { useTabsContext , useTabsStyles } from "./tabs.context"
4
8
5
9
export type CTabListProps = HTMLChakraProps < "div" >
6
10
@@ -12,8 +16,20 @@ export const CTabList = defineComponent({
12
16
setup ( _ , { attrs, slots } ) {
13
17
const api = useTabsContext ( )
14
18
19
+ const styles = useTabsStyles ( )
20
+
21
+ const tablistStyles = computed < SystemStyleObject > ( ( ) => ( {
22
+ display : "flex" ,
23
+ ...styles . value . tablist ,
24
+ } ) )
25
+
15
26
return ( ) => (
16
- < chakra . div { ...api . value . tablistProps } { ...attrs } >
27
+ < chakra . div
28
+ __label = "tabs__tablist"
29
+ __css = { tablistStyles . value }
30
+ { ...api . value . tablistProps }
31
+ { ...attrs }
32
+ >
17
33
{ slots . default ?.( ) }
18
34
</ chakra . div >
19
35
)
Original file line number Diff line number Diff line change 9
9
type PropType ,
10
10
defineComponent ,
11
11
} from "vue"
12
- import { useTabsContext } from "./tabs.context"
12
+ import { useTabsContext , useTabsStyles } from "./tabs.context"
13
13
import type { connect } from "@zag-js/tabs"
14
14
15
15
type GetContentProps = Parameters <
@@ -34,11 +34,14 @@ export const CTabPanel = defineComponent({
34
34
} ,
35
35
setup ( props , { attrs, slots } ) {
36
36
const api = useTabsContext ( )
37
+ const styles = useTabsStyles ( )
37
38
38
39
return ( ) => (
39
40
< chakra . div
40
41
as = { props . as }
41
42
{ ...api . value . getContentProps ( { value : props . value } ) }
43
+ __label = "tabs__tabpanel"
44
+ __css = { styles . value . tabpanel }
42
45
{ ...attrs }
43
46
>
44
47
{ slots . default ?.( ) }
Original file line number Diff line number Diff line change 1
1
import { HTMLChakraProps , chakra } from "@chakra-ui/vue-system"
2
2
import { defineComponent } from "vue"
3
- import { useTabsContext } from "./tabs.context"
3
+ import { useTabsContext , useTabsStyles } from "./tabs.context"
4
4
5
5
export type CTabPanelsProps = HTMLChakraProps < "div" >
6
6
export const CTabPanels = defineComponent ( {
7
7
name : "CTabPanels" ,
8
8
setup ( _ , { attrs, slots } ) {
9
9
const api = useTabsContext ( )
10
+ const styles = useTabsStyles ( )
10
11
return ( ) => (
11
- < chakra . div { ...attrs } { ...api . value . contentGroupProps } >
12
+ < chakra . div
13
+ { ...api . value . contentGroupProps }
14
+ __label = "tabs__tabpanels"
15
+ __css = { styles . value . tabpanels }
16
+ { ...attrs }
17
+ >
12
18
{ slots . default ?.( ) }
13
19
</ chakra . div >
14
20
)
You can’t perform that action at this time.
0 commit comments