This repository was archived by the owner on Sep 20, 2024. It is now read-only.
File tree 10 files changed +105
-23
lines changed
10 files changed +105
-23
lines changed Original file line number Diff line number Diff line change 53
53
"vue" : " ^2.6.10"
54
54
},
55
55
"devDependencies" : {
56
+ "@fortawesome/fontawesome-common-types" : " ^0.2.36" ,
56
57
"rimraf" : " ^3.0.2"
57
58
},
58
59
"keywords" : [
Original file line number Diff line number Diff line change
1
+ interface ChakraToastOptions {
2
+ position ?: 'bottom' | 'top' | 'right' | 'left'
3
+ duration ?: number
4
+ render ?: ( options : { onClose ?: VoidFunction , id : any } ) => any
5
+ title ?: string
6
+ description ?: string
7
+ status ?: 'info' | 'warning' | 'success' | 'error'
8
+ variant ?: 'solid' | 'subtle' | 'top-accent' | 'left-accent'
9
+ isClosable ?: boolean
10
+ }
11
+
12
+ function useToast ( ) : ( options : ChakraToastOptions ) => void
13
+
14
+ export default useToast
Original file line number Diff line number Diff line change
1
+ import CToast from './CToast'
2
+ export default CToast
Original file line number Diff line number Diff line change 1
1
import { PluginObject } from "vue"
2
+ import { IconPack } from "@fortawesome/fontawesome-common-types"
3
+ import { Theme } from "../../chakra-ui-theme/types"
2
4
3
- export type Theme = {
4
- breakpoints : any
5
- zIndices : any
6
- radii : any
7
- opacity : any
8
- borders : any
9
- colors : any
10
- borderWidths : any
11
- sizes : any
12
- shadows : any
13
- space : any
14
- fontSizes : any
15
- fonts : any
16
- fontWeights : any
17
- lineHeights : any
18
- letterSpacings : any
5
+ export type Icon = {
6
+ path : string
7
+ viewBox ?: string
8
+ attrs ?: any
19
9
}
20
10
21
11
export type Options = {
22
12
theme : Theme
23
13
extendTheme : Theme
24
14
icons : {
25
- extend : any
15
+ extend : { [ name : string ] : Icon }
26
16
iconPack : string
27
- iconSet : any
17
+ iconSet : IconPack
28
18
}
29
19
}
30
20
31
- export type Chakra = PluginObject < Options >
21
+ export type ChakraPlugin = PluginObject < Options >
32
22
33
- declare let chakra : Chakra
34
- export default chakra
23
+ declare let chakra : ChakraPlugin
24
+ export default chakra
Original file line number Diff line number Diff line change 1
- import Chakra from "./chakra"
1
+ import Chakra , { Icon } from "./chakra"
2
+ import { Theme } from "../../chakra-ui-theme/types"
3
+ import useToast from "../src/CToast"
4
+
5
+ declare module 'vue/types/vue' {
6
+ interface Vue {
7
+ $toast : ReturnType < typeof useToast >
8
+ $chakra : {
9
+ theme : Theme
10
+ icons : { [ name : string ] : Icon }
11
+ }
12
+ }
13
+ }
2
14
3
15
export * from './component'
4
- export default Chakra
16
+ export default Chakra
Original file line number Diff line number Diff line change 11
11
],
12
12
"files" : [" lib" ],
13
13
"main" : " lib/module.js" ,
14
+ "types" : " types/index.d.ts" ,
14
15
"scripts" : {
15
16
"dev" : " nuxt example/base" ,
16
17
"lint" : " eslint --ext .js,.vue ." ,
Original file line number Diff line number Diff line change
1
+ import Chakra , { Icon } from "./chakra"
2
+ import { Theme } from "../../chakra-ui-theme/types"
3
+ import useToast from "../src/CToast"
4
+
5
+ declare module '@nuxt/types' {
6
+ interface Context {
7
+ $toast ?: ReturnType < typeof useToast >
8
+ $chakra : {
9
+ theme : Theme
10
+ icons : { [ name : string ] : Icon }
11
+ }
12
+ }
13
+
14
+ interface NuxtAppOptions {
15
+ $toast ?: ReturnType < typeof useToast >
16
+ $chakra : {
17
+ theme : Theme
18
+ icons : { [ name : string ] : Icon }
19
+ }
20
+ }
21
+ }
22
+
23
+ declare module 'vue/types/vue' {
24
+ interface Vue {
25
+ $toast : ReturnType < typeof useToast >
26
+ $chakra : {
27
+ theme : Theme
28
+ icons : { [ name : string ] : Icon }
29
+ }
30
+ }
31
+ }
Original file line number Diff line number Diff line change 17
17
"license" : " MIT" ,
18
18
"main" : " dist/index.js" ,
19
19
"module" : " src/index.js" ,
20
+ "types" : " types/index.d.ts" ,
20
21
"files" : [
21
22
" dist" ,
22
23
" src"
Original file line number Diff line number Diff line change
1
+ export type Theme = {
2
+ breakpoints : { [ key : string ] : string }
3
+ zIndices : { [ key : string ] : string | number }
4
+ radii : { [ key : string ] : string }
5
+ opacity : { [ key : string ] : string }
6
+ borders : { [ key : string ] : string }
7
+ colors : { [ key : string ] : string | { [ opacity : string ] : string } }
8
+ fonts : {
9
+ heading : string
10
+ body : string
11
+ mono : string
12
+ }
13
+ fontSizes : { [ key : string ] : string }
14
+ fontWeights : { [ key : string ] : number }
15
+ letterSpacings : { [ key : string ] : string }
16
+ lineHeights : { [ key : string ] : string }
17
+ borderWidths : { [ key : string ] : string }
18
+ shadows : { [ key : string ] : string }
19
+ sizes : { [ key : string ] : string }
20
+ space : { [ key : string ] : string }
21
+ }
22
+
23
+ declare const theme : Theme
24
+
25
+ export default theme
Original file line number Diff line number Diff line change 3061
3061
unique-filename "^1.1.1"
3062
3062
which "^1.3.1"
3063
3063
3064
+ "@fortawesome/fontawesome-common-types@^0.2.36":
3065
+ version "0.2.36"
3066
+ resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-0.2.36.tgz#b44e52db3b6b20523e0c57ef8c42d315532cb903"
3067
+ integrity sha512-a/7BiSgobHAgBWeN7N0w+lAhInrGxksn13uK7231n2m8EDPE3BMCl9NZLTGrj9ZXfCmC6LM0QLqXidIizVQ6yg==
3068
+
3064
3069
"@gulp-sourcemaps/
[email protected] ":
3065
3070
version "1.0.0"
3066
3071
resolved "https://registry.yarnpkg.com/@gulp-sourcemaps/map-sources/-/map-sources-1.0.0.tgz#890ae7c5d8c877f6d384860215ace9d7ec945bda"
You can’t perform that action at this time.
0 commit comments