@tamagui/logo 1.0.1-rc.9 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,40 +1,16 @@
1
- import { forwardRef, useEffect, useState } from 'react'
2
- import { Circle, ThemeName, XStack, XStackProps, YStack } from 'tamagui'
1
+ import { forwardRef, memo, useEffect, useState } from 'react'
2
+ import { Circle, XStack, XStackProps, YStack } from 'tamagui'
3
3
 
4
- export const tints: ThemeName[] = [
5
- 'orange',
6
- 'yellow',
7
- 'green',
8
- 'blue',
9
- 'purple',
10
- 'pink',
11
- 'red',
12
- ]
13
-
14
- export const logoColors = tints.map((t) => `var(--${t}9)`)
4
+ import { useTint } from './useTint'
15
5
 
16
6
  type LogoProps = {
17
- onHoverLetter?: (i: number) => void
18
7
  showWords?: boolean
19
- color?: string
20
8
  downscale?: number
21
- pathPrefix?: string
22
9
  animated?: boolean
23
10
  } & XStackProps
24
11
 
25
12
  export const TamaguiLogo = forwardRef<any, LogoProps>(
26
- (
27
- {
28
- showWords,
29
- color,
30
- downscale,
31
- onHoverLetter,
32
- pathPrefix,
33
- animated,
34
- ...props
35
- }: LogoProps,
36
- ref,
37
- ) => {
13
+ ({ showWords, downscale, animated, ...props }: LogoProps, ref) => {
38
14
  return (
39
15
  <XStack
40
16
  tag="span"
@@ -44,157 +20,126 @@ export const TamaguiLogo = forwardRef<any, LogoProps>(
44
20
  space="$5"
45
21
  {...props}
46
22
  >
47
- <LogoIcon
48
- pathPrefix={pathPrefix}
49
- downscale={(downscale ?? 1) * (showWords ? 2 : 1.5)}
50
- color={color}
51
- />
23
+ <LogoIcon downscale={(downscale ?? 1) * (showWords ? 2 : 1.5)} />
52
24
  {showWords && (
53
25
  <YStack tag="span" marginBottom={-4}>
54
- <LogoWords
55
- animated={animated}
56
- onHoverLetter={onHoverLetter}
57
- downscale={downscale ?? 2}
58
- color={color}
59
- />
26
+ <LogoWords animated={animated} downscale={downscale ?? 2} />
60
27
  </YStack>
61
28
  )}
62
29
  </XStack>
63
30
  )
64
- },
65
- )
66
-
67
- export const LogoWords = ({
68
- color,
69
- downscale = 1,
70
- onHoverLetter,
71
- animated,
72
- }: {
73
- color?: string
74
- downscale?: number
75
- onHoverLetter?: any
76
- animated?: boolean
77
- }) => {
78
- const [index, setIndex] = useState(3)
79
- const [hovered, setHovered] = useState(false)
80
- const [mounted, setMounted] = useState<'start' | 'animate' | 'done'>('start')
81
-
82
- const updateHoveredLetter = (index: number) => {
83
- setIndex(index)
84
- setTimeout(() => {
85
- onHoverLetter?.(index)
86
- })
87
31
  }
32
+ )
88
33
 
89
- useEffect(() => {
90
- setTimeout(() => {
91
- setMounted('animate')
92
- })
34
+ export const LogoWords = memo(
35
+ ({ downscale = 1, animated }: { downscale?: number; animated?: boolean }) => {
36
+ const Tint = useTint()
37
+ const { tintIndex: index, tint } = Tint
38
+ const tints = Tint.tints.map((t) => `var(--${t}9)`)
39
+ const [hovered, setHovered] = useState(false)
40
+ const [mounted, setMounted] = useState<'start' | 'animate' | 'done'>('start')
93
41
 
94
- setTimeout(() => {
95
- setMounted('done')
96
- }, 1500)
97
- }, [])
42
+ useEffect(() => {
43
+ setTimeout(() => {
44
+ setMounted('animate')
45
+ })
98
46
 
99
- useEffect(() => {
100
- // temp hack
101
- return globalThis['onChangeTint']?.((index) => {
102
- setIndex(index)
103
- })
104
- }, [])
47
+ setTimeout(() => {
48
+ setMounted('done')
49
+ }, 1500)
50
+ }, [])
105
51
 
106
- const getColor = (i: number) => {
107
- const isActive = mounted !== 'start' && i === index
108
- if (mounted !== 'done' || hovered) {
109
- return isActive ? 'var(--color)' : logoColors[index]
110
- }
111
- if (hovered && isActive) {
112
- return 'var(--color)'
52
+ const getColor = (i: number) => {
53
+ const isActive = mounted !== 'start' && i === index
54
+ if (mounted !== 'done' || hovered) {
55
+ return isActive ? 'var(--color)' : tints[index]
56
+ }
57
+ if (hovered && isActive) {
58
+ return 'var(--color)'
59
+ }
60
+ return tints[i]
113
61
  }
114
- return logoColors[i]
115
- }
116
62
 
117
- const x =
118
- index * 18.5 +
119
- (18 / 2) * (index / logoColors.length) +
120
- 3 +
121
- (index === 6 ? -3 : 0)
63
+ const x = Math.round(
64
+ index * 18.5 + (18 / 2) * (index / tints.length) + 3 + (index === 6 ? -3 : 0)
65
+ )
122
66
 
123
- return (
124
- <XStack
125
- onHoverIn={() => setHovered(true)}
126
- onHoverOut={() => setHovered(false)}
127
- paddingVertical="$2"
128
- marginVertical="$-2"
129
- position="relative"
130
- >
131
- {animated && (
132
- <Circle
133
- animation="quick"
134
- position="absolute"
135
- top={0}
136
- left={0}
137
- y={mounted === 'start' ? -30 : -3}
138
- // the last i is less wide
139
- x={x}
140
- size={4}
141
- backgroundColor={logoColors[index]}
142
- />
143
- )}
144
- <svg
145
- width={373 * (1 / downscale) * 0.333333334}
146
- height={41 * (1 / downscale) * 0.333333334}
147
- viewBox="0 0 373 41"
67
+ return (
68
+ <XStack
69
+ onHoverIn={() => setHovered(true)}
70
+ onHoverOut={() => setHovered(false)}
71
+ paddingVertical="$2"
72
+ marginVertical="$-2"
73
+ position="relative"
148
74
  >
149
- <polygon
150
- shapeRendering="crispEdges"
151
- fill={color || getColor(0)}
152
- points="24.3870968 40.1612903 24.3870968 8.67741935 32.2580645 8.67741935 32.2580645 0.806451613 0.774193548 0.806451613 0.774193548 8.67741935 8.64516129 8.67741935 8.64516129 40.1612903"
153
- onMouseEnter={() => updateHoveredLetter(0)}
154
- />
155
- <path
156
- shapeRendering="crispEdges"
157
- fill={color || getColor(1)}
158
- d="M87.3548387,0.806451613 L87.3548387,8.67741935 L95.2258065,8.67741935 L95.2258065,40.1612903 L79.483871,40.1612903 L79.483871,24.4193548 L71.6129032,24.4193548 L71.6129032,40.1612903 L55.8709677,40.1612903 L55.8709677,8.67741935 L63.7419355,8.67741935 L63.7419355,0.806451613 L87.3548387,0.806451613 Z M79.483871,8.67741935 L71.6129032,8.67741935 L71.6129032,16.5483871 L79.483871,16.5483871 L79.483871,8.67741935 Z"
159
- fillRule="nonzero"
160
- onMouseEnter={() => updateHoveredLetter(1)}
161
- />
162
- <polygon
163
- shapeRendering="crispEdges"
164
- fill={color || getColor(2)}
165
- points="130.645161 40.1612903 130.645161 22.4516129 138.516129 22.4516129 138.516129 40.1612903 154.258065 40.1612903 154.258065 0.806451613 142.451613 0.806451613 142.451613 8.67741935 126.709677 8.67741935 126.709677 0.806451613 114.903226 0.806451613 114.903226 40.1612903"
166
- onMouseEnter={() => updateHoveredLetter(2)}
167
- />
168
- <path
169
- fill={color || getColor(3)}
170
- d="M205.419355,0.806451613 L205.419355,8.67741935 L213.290323,8.67741935 L213.290323,40.1612903 L197.548387,40.1612903 L197.548387,24.4193548 L189.677419,24.4193548 L189.677419,40.1612903 L173.935484,40.1612903 L173.935484,8.67741935 L181.806452,8.67741935 L181.806452,0.806451613 L205.419355,0.806451613 Z M197.548387,8.67741935 L189.677419,8.67741935 L189.677419,16.5483871 L197.548387,16.5483871 L197.548387,8.67741935 Z"
171
- fillRule="nonzero"
172
- onMouseEnter={() => updateHoveredLetter(3)}
173
- />
174
- <polygon
175
- shapeRendering="crispEdges"
176
- fill={color || getColor(4)}
177
- points="264.451613 40.1612903 264.451613 32.2903226 272.322581 32.2903226 272.322581 16.5483871 256.580645 16.5483871 256.580645 32.2903226 248.709677 32.2903226 248.709677 8.67741935 272.322581 8.67741935 272.322581 0.806451613 240.83871 0.806451613 240.83871 8.67741935 232.967742 8.67741935 232.967742 32.2903226 240.83871 32.2903226 240.83871 40.1612903"
178
- onMouseEnter={() => updateHoveredLetter(4)}
179
- />
180
- <polygon
181
- shapeRendering="crispEdges"
182
- fill={color || getColor(5)}
183
- points="323.483871 40.1612903 323.483871 32.2903226 331.354839 32.2903226 331.354839 0.806451613 315.612903 0.806451613 315.612903 32.2903226 307.741935 32.2903226 307.741935 0.806451613 292 0.806451613 292 32.2903226 299.870968 32.2903226 299.870968 40.1612903"
184
- onMouseEnter={() => updateHoveredLetter(5)}
185
- />
186
- <polygon
187
- shapeRendering="crispEdges"
188
- fill={color || getColor(6)}
189
- points="372.677419 40.1612903 372.677419 0.806451613 356.935484 0.806451613 356.935484 40.1612903"
190
- onMouseEnter={() => updateHoveredLetter(6)}
191
- />
192
- </svg>
193
- </XStack>
194
- )
195
- }
75
+ {animated && (
76
+ <Circle
77
+ animation="quick"
78
+ position="absolute"
79
+ top={0}
80
+ left={0}
81
+ y={mounted === 'start' ? -30 : -3}
82
+ // the last i is less wide
83
+ x={x}
84
+ size={4}
85
+ backgroundColor={tint}
86
+ />
87
+ )}
88
+ <svg
89
+ width={373 * (1 / downscale) * 0.333333334}
90
+ height={41 * (1 / downscale) * 0.333333334}
91
+ viewBox="0 0 373 41"
92
+ >
93
+ <polygon
94
+ shapeRendering="crispEdges"
95
+ fill={getColor(0)}
96
+ points="24.3870968 40.1612903 24.3870968 8.67741935 32.2580645 8.67741935 32.2580645 0.806451613 0.774193548 0.806451613 0.774193548 8.67741935 8.64516129 8.67741935 8.64516129 40.1612903"
97
+ onMouseEnter={() => Tint.setTintIndex(0)}
98
+ />
99
+ <path
100
+ shapeRendering="crispEdges"
101
+ fill={getColor(1)}
102
+ d="M87.3548387,0.806451613 L87.3548387,8.67741935 L95.2258065,8.67741935 L95.2258065,40.1612903 L79.483871,40.1612903 L79.483871,24.4193548 L71.6129032,24.4193548 L71.6129032,40.1612903 L55.8709677,40.1612903 L55.8709677,8.67741935 L63.7419355,8.67741935 L63.7419355,0.806451613 L87.3548387,0.806451613 Z M79.483871,8.67741935 L71.6129032,8.67741935 L71.6129032,16.5483871 L79.483871,16.5483871 L79.483871,8.67741935 Z"
103
+ fillRule="nonzero"
104
+ onMouseEnter={() => Tint.setTintIndex(1)}
105
+ />
106
+ <polygon
107
+ shapeRendering="crispEdges"
108
+ fill={getColor(2)}
109
+ points="130.645161 40.1612903 130.645161 22.4516129 138.516129 22.4516129 138.516129 40.1612903 154.258065 40.1612903 154.258065 0.806451613 142.451613 0.806451613 142.451613 8.67741935 126.709677 8.67741935 126.709677 0.806451613 114.903226 0.806451613 114.903226 40.1612903"
110
+ onMouseEnter={() => Tint.setTintIndex(2)}
111
+ />
112
+ <path
113
+ fill={getColor(3)}
114
+ d="M205.419355,0.806451613 L205.419355,8.67741935 L213.290323,8.67741935 L213.290323,40.1612903 L197.548387,40.1612903 L197.548387,24.4193548 L189.677419,24.4193548 L189.677419,40.1612903 L173.935484,40.1612903 L173.935484,8.67741935 L181.806452,8.67741935 L181.806452,0.806451613 L205.419355,0.806451613 Z M197.548387,8.67741935 L189.677419,8.67741935 L189.677419,16.5483871 L197.548387,16.5483871 L197.548387,8.67741935 Z"
115
+ fillRule="nonzero"
116
+ onMouseEnter={() => Tint.setTintIndex(3)}
117
+ />
118
+ <polygon
119
+ shapeRendering="crispEdges"
120
+ fill={getColor(4)}
121
+ points="264.451613 40.1612903 264.451613 32.2903226 272.322581 32.2903226 272.322581 16.5483871 256.580645 16.5483871 256.580645 32.2903226 248.709677 32.2903226 248.709677 8.67741935 272.322581 8.67741935 272.322581 0.806451613 240.83871 0.806451613 240.83871 8.67741935 232.967742 8.67741935 232.967742 32.2903226 240.83871 32.2903226 240.83871 40.1612903"
122
+ onMouseEnter={() => Tint.setTintIndex(4)}
123
+ />
124
+ <polygon
125
+ shapeRendering="crispEdges"
126
+ fill={getColor(5)}
127
+ points="323.483871 40.1612903 323.483871 32.2903226 331.354839 32.2903226 331.354839 0.806451613 315.612903 0.806451613 315.612903 32.2903226 307.741935 32.2903226 307.741935 0.806451613 292 0.806451613 292 32.2903226 299.870968 32.2903226 299.870968 40.1612903"
128
+ onMouseEnter={() => Tint.setTintIndex(5)}
129
+ />
130
+ <polygon
131
+ shapeRendering="crispEdges"
132
+ fill={getColor(6)}
133
+ points="372.677419 40.1612903 372.677419 0.806451613 356.935484 0.806451613 356.935484 40.1612903"
134
+ onMouseEnter={() => Tint.setTintIndex(6)}
135
+ />
136
+ </svg>
137
+ </XStack>
138
+ )
139
+ }
140
+ )
196
141
 
197
- export const LogoIcon = ({ downscale = 2, pathPrefix }: any) => {
142
+ export const LogoIcon = ({ downscale = 2 }: any) => {
198
143
  return (
199
144
  <YStack
200
145
  tag="span"
@@ -209,7 +154,7 @@ export const LogoIcon = ({ downscale = 2, pathPrefix }: any) => {
209
154
  className="tamagui-icon"
210
155
  width={450 / 8 / downscale}
211
156
  height={420 / 8 / downscale}
212
- src={`${pathPrefix || ''}/tamagui-icon.svg`}
157
+ src={`/tamagui-icon.svg`}
213
158
  />
214
159
  </YStack>
215
160
  )
package/src/index.tsx CHANGED
@@ -1 +1,3 @@
1
1
  export * from './TamaguiLogo'
2
+ export * from './tints'
3
+ export * from './useTint'
package/src/tints.tsx ADDED
@@ -0,0 +1,54 @@
1
+ import { useEffect, useState } from 'react'
2
+ import { ThemeName } from 'tamagui'
3
+
4
+ const families = Object.freeze({
5
+ tamagui: ['orange', 'yellow', 'green', 'blue', 'purple', 'pink', 'red'],
6
+ xmas: ['red', 'green', 'red', 'green', 'red', 'green', 'red'],
7
+ }) as {
8
+ [key in 'tamagui' | 'xmas']: ThemeName[]
9
+ }
10
+
11
+ type TintFamily = keyof typeof families
12
+
13
+ let fam: TintFamily = 'tamagui'
14
+
15
+ export function getTints() {
16
+ return {
17
+ name: fam || 'tamagui',
18
+ tints: families[fam] || families.tamagui,
19
+ families,
20
+ }
21
+ }
22
+
23
+ export function useTints() {
24
+ const [val, setVal] = useState(getTints())
25
+
26
+ useEffect(() => {
27
+ return onTintFamilyChange(() => {
28
+ setVal(getTints())
29
+ })
30
+ }, [])
31
+
32
+ return val
33
+ }
34
+
35
+ export const setTintFamily = (next: TintFamily) => {
36
+ if (!families[next]) throw `impossible`
37
+ fam = next
38
+ listeners.forEach((l) => l(next))
39
+ }
40
+
41
+ export const setNextTintFamily = () => {
42
+ setTintFamily(fam === 'tamagui' ? 'xmas' : 'tamagui')
43
+ }
44
+
45
+ type ChangeHandler = (next: TintFamily) => void
46
+
47
+ const listeners = new Set<ChangeHandler>()
48
+
49
+ export const onTintFamilyChange = (cb: ChangeHandler) => {
50
+ listeners.add(cb)
51
+ return () => {
52
+ listeners.delete(cb)
53
+ }
54
+ }
@@ -0,0 +1,62 @@
1
+ import { useMemo, useSyncExternalStore } from 'react'
2
+ import { Theme, ThemeName } from 'tamagui'
3
+
4
+ import { getTints, setNextTintFamily, useTints } from './tints'
5
+
6
+ // TODO useSyncExternalStore
7
+
8
+ // no localstorage because its not important to remember and causes a flicker
9
+ // const tintVal = typeof localStorage !== 'undefined' ? localStorage.getItem('tint') : 0
10
+ // const tint = tintVal ? +tintVal 0
11
+ export const initialTint = 3
12
+
13
+ let current = initialTint
14
+
15
+ const listeners = new Set<Function>()
16
+
17
+ export const onTintChange = (listener: (cur: number) => void) => {
18
+ listeners.add(listener)
19
+ return () => {
20
+ listeners.delete(listener)
21
+ }
22
+ }
23
+
24
+ const numTints = getTints().tints.length
25
+
26
+ export const setTintIndex = (next: number) => {
27
+ const val = next % numTints
28
+ if (val === current) return
29
+ current = val
30
+ listeners.forEach((x) => x(val))
31
+ }
32
+
33
+ export const useTint = () => {
34
+ const index = useSyncExternalStore(
35
+ onTintChange,
36
+ () => current,
37
+ () => initialTint
38
+ )
39
+ const tintsContext = useTints()
40
+ const { tints } = tintsContext
41
+
42
+ return {
43
+ ...tintsContext,
44
+ tints: tintsContext.tints as ThemeName[],
45
+ tintIndex: index,
46
+ tint: tints[index] as ThemeName,
47
+ setTintIndex,
48
+ setNextTintFamily,
49
+ setNextTint: () => {
50
+ setTintIndex(index + 1)
51
+ },
52
+ } as const
53
+ }
54
+
55
+ export const ThemeTint = (props: { children: any }) => {
56
+ return (
57
+ <Theme name={useTint().tint}>
58
+ {/* */}
59
+ {useMemo(() => props.children, [props.children])}
60
+ </Theme>
61
+ )
62
+ }
@@ -1,29 +1,21 @@
1
1
  /// <reference types="react" />
2
- import { ThemeName } from 'tamagui';
3
- export declare const tints: ThemeName[];
4
- export declare const logoColors: string[];
5
2
  export declare const TamaguiLogo: import("react").ForwardRefExoticComponent<{
6
- onHoverLetter?: ((i: number) => void) | undefined;
7
3
  showWords?: boolean | undefined;
8
- color?: string | undefined;
9
4
  downscale?: number | undefined;
10
- pathPrefix?: string | undefined;
11
5
  animated?: boolean | undefined;
12
- } & Omit<import("react-native").ViewProps, "display" | "children"> & import("tamagui").RNWViewProps & import("tamagui").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{}, "elevation" | "fullscreen"> & {
6
+ } & Omit<import("react-native").ViewProps, "children" | "display"> & import("tamagui").RNWViewProps & import("tamagui").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{}, "elevation" | "fullscreen"> & {
13
7
  readonly fullscreen?: boolean | undefined;
14
8
  readonly elevation?: import("tamagui").SizeTokens | undefined;
15
- } & import("@tamagui/core").MediaProps<Partial<Omit<import("react-native").ViewProps, "display" | "children"> & import("tamagui").RNWViewProps & import("tamagui").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{}, "elevation" | "fullscreen"> & {
9
+ } & import("@tamagui/core").MediaProps<Partial<Omit<import("react-native").ViewProps, "children" | "display"> & import("tamagui").RNWViewProps & import("tamagui").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{}, "elevation" | "fullscreen"> & {
16
10
  readonly fullscreen?: boolean | undefined;
17
11
  readonly elevation?: import("tamagui").SizeTokens | undefined;
18
- }>> & import("@tamagui/core").PseudoProps<Partial<Omit<import("react-native").ViewProps, "display" | "children"> & import("tamagui").RNWViewProps & import("tamagui").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{}, "elevation" | "fullscreen"> & {
12
+ }>> & import("@tamagui/core").PseudoProps<Partial<Omit<import("react-native").ViewProps, "children" | "display"> & import("tamagui").RNWViewProps & import("tamagui").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{}, "elevation" | "fullscreen"> & {
19
13
  readonly fullscreen?: boolean | undefined;
20
14
  readonly elevation?: import("tamagui").SizeTokens | undefined;
21
15
  }>> & import("react").RefAttributes<any>>;
22
- export declare const LogoWords: ({ color, downscale, onHoverLetter, animated, }: {
23
- color?: string | undefined;
16
+ export declare const LogoWords: import("react").MemoExoticComponent<({ downscale, animated }: {
24
17
  downscale?: number | undefined;
25
- onHoverLetter?: any;
26
18
  animated?: boolean | undefined;
27
- }) => JSX.Element;
28
- export declare const LogoIcon: ({ downscale, pathPrefix }: any) => JSX.Element;
19
+ }) => JSX.Element>;
20
+ export declare const LogoIcon: ({ downscale }: any) => JSX.Element;
29
21
  //# sourceMappingURL=TamaguiLogo.d.ts.map
package/types/index.d.ts CHANGED
@@ -1,2 +1,4 @@
1
1
  export * from './TamaguiLogo';
2
+ export * from './tints';
3
+ export * from './useTint';
2
4
  //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,27 @@
1
+ declare const families: {
2
+ tamagui: string[];
3
+ xmas: string[];
4
+ };
5
+ type TintFamily = keyof typeof families;
6
+ export declare function getTints(): {
7
+ name: "tamagui" | "xmas";
8
+ tints: string[];
9
+ families: {
10
+ tamagui: string[];
11
+ xmas: string[];
12
+ };
13
+ };
14
+ export declare function useTints(): {
15
+ name: "tamagui" | "xmas";
16
+ tints: string[];
17
+ families: {
18
+ tamagui: string[];
19
+ xmas: string[];
20
+ };
21
+ };
22
+ export declare const setTintFamily: (next: TintFamily) => void;
23
+ export declare const setNextTintFamily: () => void;
24
+ type ChangeHandler = (next: TintFamily) => void;
25
+ export declare const onTintFamilyChange: (cb: ChangeHandler) => () => void;
26
+ export {};
27
+ //# sourceMappingURL=tints.d.ts.map
@@ -0,0 +1,21 @@
1
+ /// <reference types="react" />
2
+ export declare const initialTint = 3;
3
+ export declare const onTintChange: (listener: (cur: number) => void) => () => void;
4
+ export declare const setTintIndex: (next: number) => void;
5
+ export declare const useTint: () => {
6
+ readonly tints: string[];
7
+ readonly tintIndex: number;
8
+ readonly tint: string;
9
+ readonly setTintIndex: (next: number) => void;
10
+ readonly setNextTintFamily: () => void;
11
+ readonly setNextTint: () => void;
12
+ readonly name: "tamagui" | "xmas";
13
+ readonly families: {
14
+ tamagui: string[];
15
+ xmas: string[];
16
+ };
17
+ };
18
+ export declare const ThemeTint: (props: {
19
+ children: any;
20
+ }) => JSX.Element;
21
+ //# sourceMappingURL=useTint.d.ts.map