react-native-varia 0.5.0 → 0.5.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.
@@ -4,8 +4,8 @@ import Animated from 'react-native-reanimated'
4
4
  import {LinearTransition} from 'react-native-reanimated'
5
5
  import {StyleSheet, UnistylesVariants} from 'react-native-unistyles'
6
6
  import Text from './Text'
7
- import {AccordionStyles, AccordionDefaultVariants} from '../theme/Accordion'
8
- import {AlignSelf, Flex, PalettesWithNestedKeys} from '../style/varia/types'
7
+ import {AccordionStyles, AccordionDefaultVariants} from '../../theme/Accordion'
8
+ import {AlignSelf, Flex, PalettesWithNestedKeys} from '../../style/varia/types'
9
9
 
10
10
  const AnimatedView = Animated.createAnimatedComponent(View)
11
11
  type AccordionVariants = UnistylesVariants<typeof AccordionStyles>
@@ -1,9 +1,9 @@
1
1
  import {Text, View, ViewStyle, StyleProp} from 'react-native'
2
2
  import {StyleSheet, UnistylesVariants} from 'react-native-unistyles'
3
- import {BadgeStyles, BadgeDefaultVariants} from '../theme/Badge.recipe'
3
+ import {BadgeStyles, BadgeDefaultVariants} from '../../theme/Badge.recipe'
4
4
  import {ReactNode} from 'react'
5
- import {PalettesWithNestedKeys} from '../style/varia/types'
6
- import {HStack} from '../patterns'
5
+ import {PalettesWithNestedKeys} from '../../style/varia/types'
6
+ import {HStack} from '../../patterns'
7
7
 
8
8
  type VeritcalPosition = 'top' | 'bottom'
9
9
  type HorizontalPosition = 'left' | 'right'
@@ -1,11 +1,11 @@
1
1
  import {StyleProp, Text, TouchableOpacity, ViewStyle} from 'react-native'
2
2
  import {StyleSheet, UnistylesVariants} from 'react-native-unistyles'
3
- import {ButtonStyles, ButtonDefaultVariants} from '../theme/Button.recipe'
3
+ import {ButtonStyles, ButtonDefaultVariants} from '../../theme/Button.recipe'
4
4
  import {useMemo} from 'react'
5
5
  import {IconWrapperProps} from './IconWrapper'
6
6
  import Spinner, {SpinnerProps} from './Spinner'
7
- import {PalettesWithNestedKeys} from '../style/varia/types'
8
- import {getVariantValue} from '../style/varia/utils'
7
+ import {PalettesWithNestedKeys} from '../../style/varia/types'
8
+ import {getVariantValue} from '../../style/varia/utils'
9
9
 
10
10
  type TextAdjustment = 'singleLine' | 'multiline' | 'adjustToFit'
11
11
 
@@ -2,10 +2,13 @@ import React, {useCallback} from 'react'
2
2
  import {View, Text, Pressable} from 'react-native'
3
3
  import {StyleSheet} from 'react-native-unistyles'
4
4
  import {UnistylesVariants} from 'react-native-unistyles'
5
- import {CheckboxDefaultVariants, CheckboxStyles} from '../theme/Checkbox.recipe'
6
- import {PalettesWithNestedKeys} from '../style/varia/types'
5
+ import {
6
+ CheckboxDefaultVariants,
7
+ CheckboxStyles,
8
+ } from '../../theme/Checkbox.recipe'
9
+ import {PalettesWithNestedKeys} from '../../style/varia/types'
7
10
  import Svg, {Line} from 'react-native-svg'
8
- import {getVariantValue} from '../style/varia/utils'
11
+ import {getVariantValue} from '../../style/varia/utils'
9
12
 
10
13
  type CheckboxVariants = UnistylesVariants<typeof CheckboxStyles>
11
14
 
@@ -9,16 +9,15 @@ import Animated, {
9
9
  Extrapolation,
10
10
  } from 'react-native-reanimated'
11
11
  import Svg, {Circle, G} from 'react-native-svg'
12
- import {circleProgressTokens} from '../theme/CircleProgress.recipe'
12
+ import {circleProgressTokens} from '../../theme/CircleProgress.recipe'
13
13
  import {withUnistyles, StyleSheet} from 'react-native-unistyles'
14
- import {resolveColor} from '../style/varia/utils'
14
+ import {resolveColor} from '../../style/varia/utils'
15
15
  import {
16
16
  NestedColorsType,
17
17
  PalettesWithNestedKeys,
18
18
  progressDirection,
19
19
  rotationDirection,
20
- ThemeType,
21
- } from '../style/varia/types'
20
+ } from '../../style/varia/types'
22
21
  import {SharedValue} from 'react-native-reanimated'
23
22
 
24
23
  const AnimatedCircle = Animated.createAnimatedComponent(Circle)
@@ -1,7 +1,7 @@
1
1
  import {View} from 'react-native'
2
2
  import {StyleSheet} from 'react-native-unistyles'
3
- import {PalettesWithNestedKeys, ThemeColors} from '../style/varia/types'
4
- import {resolveColor} from '../style/varia/utils'
3
+ import {PalettesWithNestedKeys, ThemeColors} from '../../style/varia/types'
4
+ import {resolveColor} from '../../style/varia/utils'
5
5
 
6
6
  const Divider = ({
7
7
  color,
@@ -24,15 +24,15 @@ import Animated, {
24
24
  withTiming,
25
25
  } from 'react-native-reanimated'
26
26
  import {scheduleOnRN, scheduleOnUI} from 'react-native-worklets'
27
- import {DrawerTokens, DrawerStyles} from '../theme/Drawer.recipe'
28
- import {PalettesWithNestedKeys, ZIndex} from '../style/varia/types'
27
+ import {DrawerTokens, DrawerStyles} from '../../theme/Drawer.recipe'
28
+ import {PalettesWithNestedKeys, ZIndex} from '../../style/varia/types'
29
29
  import {
30
30
  StyleSheet,
31
31
  UnistylesRuntime,
32
32
  UnistylesVariants,
33
33
  } from 'react-native-unistyles'
34
- import {HStack} from '../patterns'
35
- import {ZINDEXES} from '../style/varia/constants'
34
+ import {HStack} from '../../patterns'
35
+ import {ZINDEXES} from '../../style/varia/constants'
36
36
 
37
37
  export type DrawerRef = {
38
38
  expand: () => void | null
@@ -1,7 +1,7 @@
1
1
  import React from 'react'
2
2
  import Text from './Text'
3
- import {DefaultFieldVariants, FieldStyles} from '../theme/Field.recipe'
4
- import {Flex, PalettesWithNestedKeys} from '../style/varia/types'
3
+ import {DefaultFieldVariants, FieldStyles} from '../../theme/Field.recipe'
4
+ import {Flex, PalettesWithNestedKeys} from '../../style/varia/types'
5
5
  import FieldContext, {
6
6
  FieldContextType,
7
7
  FieldVariants,
@@ -8,14 +8,14 @@ import Animated, {
8
8
  withTiming,
9
9
  } from 'react-native-reanimated'
10
10
  import {StyleSheet, UnistylesVariants} from 'react-native-unistyles'
11
- import Plus from '../icons/Plus'
11
+ import Plus from '../../icons/Plus'
12
12
  import {
13
13
  FloatingActionDefaultVariants,
14
14
  FloatingActionStyles,
15
- } from '../theme/FloatingAction'
15
+ } from '../../theme/FloatingAction'
16
16
  import {ViewStyle} from 'react-native'
17
- import {PalettesWithNestedKeys} from '../style/varia/types'
18
- import {getVariantValue} from '../style/varia/utils'
17
+ import {PalettesWithNestedKeys} from '../../style/varia/types'
18
+ import {getVariantValue} from '../../style/varia/utils'
19
19
 
20
20
  const AnimatedPressable = Animated.createAnimatedComponent(Pressable)
21
21
 
@@ -1,13 +1,13 @@
1
1
  import {View, StyleProp, ViewStyle} from 'react-native'
2
2
  import Svg, {Defs, LinearGradient, Stop, Rect} from 'react-native-svg'
3
3
  import {withUnistyles} from 'react-native-unistyles'
4
- import {gradientBackgroundTokens} from '../theme/GradientBackground.recipe'
4
+ import {gradientBackgroundTokens} from '../../theme/GradientBackground.recipe'
5
5
  import {
6
6
  NestedColorsType,
7
7
  PalettesWithNestedKeys,
8
8
  ThemeColors,
9
- } from '../style/varia/types'
10
- import {resolveColor} from '../style/varia/utils'
9
+ } from '../../style/varia/types'
10
+ import {resolveColor} from '../../style/varia/utils'
11
11
  import {StyleSheet} from 'react-native-unistyles'
12
12
 
13
13
  interface GradientBackgroundProps {
@@ -11,15 +11,15 @@ import {
11
11
  withUnistyles,
12
12
  StyleSheet,
13
13
  } from 'react-native-unistyles'
14
- import {gradientTextTokens} from '../theme/GradientText.recipe'
14
+ import {gradientTextTokens} from '../../theme/GradientText.recipe'
15
15
  import {
16
16
  NestedColorsType,
17
17
  PalettesWithNestedKeys,
18
18
  ThemeType,
19
- } from '../style/varia/types'
20
- import {getVariantValue, resolveColor} from '../style/varia/utils'
21
- import {ThemeColors} from '../style/varia/types'
22
- import {TextStyles} from '../theme/Text.recipe'
19
+ } from '../../style/varia/types'
20
+ import {getVariantValue, resolveColor} from '../../style/varia/utils'
21
+ import {ThemeColors} from '../../style/varia/types'
22
+ import {TextStyles} from '../../theme/Text.recipe'
23
23
 
24
24
  type AllTextVariants = UnistylesVariants<typeof TextStyles>
25
25
  type TextVariantsWithoutVariant = Omit<AllTextVariants, 'variant'>
@@ -9,13 +9,13 @@ import {
9
9
  import Svg from 'react-native-svg'
10
10
  import {StyleProp, View, ViewStyle} from 'react-native'
11
11
  import {StyleSheet, withUnistyles} from 'react-native-unistyles'
12
- import {IconTokens} from '../theme/IconWrapper.recipe'
12
+ import {IconTokens} from '../../theme/IconWrapper.recipe'
13
13
  import {
14
14
  NestedColorsType,
15
15
  PalettesWithNestedKeys,
16
16
  ThemeColors,
17
- } from '../style/varia/types'
18
- import {resolveColor} from '../style/varia/utils'
17
+ } from '../../style/varia/types'
18
+ import {resolveColor} from '../../style/varia/utils'
19
19
 
20
20
  interface SVGChildProps {
21
21
  color?: string
@@ -9,17 +9,17 @@ import {
9
9
  type ViewStyle,
10
10
  } from 'react-native'
11
11
  import {StyleSheet, UnistylesVariants} from 'react-native-unistyles'
12
- import {InputStyles, InputDefaultVariants} from '../theme/Input.recipe'
12
+ import {InputStyles, InputDefaultVariants} from '../../theme/Input.recipe'
13
13
  import {
14
14
  AlignSelf,
15
15
  Flex,
16
16
  MaxWidth,
17
17
  PalettesWithNestedKeys,
18
18
  StackDirection,
19
- } from '../style/varia/types'
19
+ } from '../../style/varia/types'
20
20
  import {useState} from 'react'
21
21
  import {IconWrapperProps} from './IconWrapper'
22
- import {getVariantValue} from '../style/varia/utils'
22
+ import {getVariantValue} from '../../style/varia/utils'
23
23
 
24
24
  type InputVariants = UnistylesVariants<typeof InputStyles>
25
25
 
@@ -8,8 +8,8 @@ import {
8
8
  } from 'react-native'
9
9
  import {StyleSheet, UnistylesVariants} from 'react-native-unistyles'
10
10
  import Text from './Text'
11
- import {PalettesWithNestedKeys, ThemeColors} from '../style/varia/types'
12
- import {DefaultTextVariants, TextStyles} from '../theme/Text.recipe'
11
+ import {PalettesWithNestedKeys, ThemeColors} from '../../style/varia/types'
12
+ import {DefaultTextVariants, TextStyles} from '../../theme/Text.recipe'
13
13
  type TextVariants = UnistylesVariants<typeof TextStyles>
14
14
  type LinkProps = TextVariants & {
15
15
  colorPalette?: PalettesWithNestedKeys
@@ -5,9 +5,9 @@ import {Portal} from '@gorhom/portal'
5
5
  import Svg, {Path} from 'react-native-svg'
6
6
  import {StyleSheet, UnistylesVariants} from 'react-native-unistyles'
7
7
  import Text from './Text'
8
- import {ModalStyles, ModalTokens} from '../theme/Modal.recipe'
9
- import {PalettesWithNestedKeys, ZIndex} from '../style/varia/types'
10
- import {ZINDEXES} from '../style/varia/constants'
8
+ import {ModalStyles, ModalTokens} from '../../theme/Modal.recipe'
9
+ import {PalettesWithNestedKeys, ZIndex} from '../../style/varia/types'
10
+ import {ZINDEXES} from '../../style/varia/constants'
11
11
 
12
12
  const AnimatedView = Animated.createAnimatedComponent(View)
13
13
  type ModalVariants = UnistylesVariants<typeof ModalStyles>
@@ -4,15 +4,15 @@ import {UnistylesVariants, StyleSheet} from 'react-native-unistyles'
4
4
  import {
5
5
  NumberInputStyles,
6
6
  NumberInputDefaultVariants,
7
- } from '../theme/NumberInput.recipe'
7
+ } from '../../theme/NumberInput.recipe'
8
8
  import {
9
9
  AlignSelf,
10
10
  PalettesWithNestedKeys,
11
11
  StackDirection,
12
- } from '../style/varia/types'
13
- import Plus from '../icons/Plus'
14
- import Minus from '../icons/Minus'
15
- import {computeFlexSync, getVariantValue} from '../style/varia/utils'
12
+ } from '../../style/varia/types'
13
+ import Plus from '../../icons/Plus'
14
+ import Minus from '../../icons/Minus'
15
+ import {computeFlexSync, getVariantValue} from '../../style/varia/utils'
16
16
 
17
17
  type NumberInputVariants = UnistylesVariants<typeof NumberInputStyles>
18
18
 
@@ -4,7 +4,7 @@ import {StyleSheet, UnistylesVariants} from 'react-native-unistyles'
4
4
  import {
5
5
  RadioGroupStyles,
6
6
  RadioGroupDefaultVariants,
7
- } from '../theme/RadioGroup.recipe'
7
+ } from '../../theme/RadioGroup.recipe'
8
8
  import {
9
9
  AlignItems,
10
10
  AlignSelf,
@@ -13,7 +13,7 @@ import {
13
13
  JustifyContent,
14
14
  PalettesWithNestedKeys,
15
15
  StackDirection,
16
- } from '../style/varia/types'
16
+ } from '../../style/varia/types'
17
17
 
18
18
  type RadioGroupVariants = UnistylesVariants<typeof RadioGroupStyles>
19
19
 
@@ -7,9 +7,9 @@ import {
7
7
  PalettesWithNestedKeys,
8
8
  TextSemanticSizes,
9
9
  ThemeColors,
10
- } from '../style/varia/types'
11
- import {TextStyles, DefaultTextVariants} from '../theme/Text.recipe'
12
- import {extractThemeColor} from '../style/varia/utils'
10
+ } from '../../style/varia/types'
11
+ import {TextStyles, DefaultTextVariants} from '../../theme/Text.recipe'
12
+ import {extractThemeColor} from '../../style/varia/utils'
13
13
 
14
14
  type ReTextVariants = UnistylesVariants<typeof TextStyles>
15
15
 
@@ -17,16 +17,16 @@ import {UnistylesVariants} from 'react-native-unistyles'
17
17
  import {Portal} from '@gorhom/portal'
18
18
  import Text from './Text'
19
19
  import {StyleSheet} from 'react-native-unistyles'
20
- import {SelectStyles, SelectDefaultVariants} from '../theme/Select.recipe'
20
+ import {SelectStyles, SelectDefaultVariants} from '../../theme/Select.recipe'
21
21
  import {
22
22
  AlignSelf,
23
23
  Flex,
24
24
  PalettesWithNestedKeys,
25
25
  StackDirection,
26
26
  ZIndex,
27
- } from '../style/varia/types'
28
- import {computeFlexSync} from '../style/varia/utils'
29
- import {ZINDEXES} from '../style/varia/constants'
27
+ } from '../../style/varia/types'
28
+ import {computeFlexSync} from '../../style/varia/utils'
29
+ import {ZINDEXES} from '../../style/varia/constants'
30
30
 
31
31
  type SelectVariants = UnistylesVariants<typeof SelectStyles>
32
32
 
@@ -7,9 +7,9 @@ import Animated, {
7
7
  useSharedValue,
8
8
  } from 'react-native-reanimated'
9
9
  import {runOnJS} from 'react-native-worklets'
10
- import {SliderStyles, SliderDefaultVariants} from '../theme/Slider.recipe'
11
- import {PalettesWithNestedKeys} from '../style/varia/types'
12
- import {getCompoundVariantValue} from '../style/varia/utils'
10
+ import {SliderStyles, SliderDefaultVariants} from '../../theme/Slider.recipe'
11
+ import {PalettesWithNestedKeys} from '../../style/varia/types'
12
+ import {getCompoundVariantValue} from '../../style/varia/utils'
13
13
 
14
14
  function throttle<T extends (...args: any[]) => any>(
15
15
  func: T,
@@ -10,8 +10,8 @@ import Animated, {
10
10
  import {scheduleOnRN} from 'react-native-worklets'
11
11
  import {StyleSheet, UnistylesVariants} from 'react-native-unistyles'
12
12
  import {Gesture, GestureDetector} from 'react-native-gesture-handler'
13
- import {SlideshowStyles, SlideshowTokens} from '../theme/Slideshow.recipe'
14
- import {PalettesWithNestedKeys} from '../style/varia/types'
13
+ import {SlideshowStyles, SlideshowTokens} from '../../theme/Slideshow.recipe'
14
+ import {PalettesWithNestedKeys} from '../../style/varia/types'
15
15
 
16
16
  export type SlideshowRef = {
17
17
  handleNext: () => void | null
@@ -9,10 +9,10 @@ import {
9
9
  NestedColorsType,
10
10
  PalettesWithNestedKeys,
11
11
  ThemeColors,
12
- } from '../style/varia/types'
13
- import {SpinnerTokens} from '../theme/Spinner.recipe'
14
- import {getVariantValue, resolveColor} from '../style/varia/utils'
15
- import {SpinnerStyles} from '../theme/Spinner.recipe'
12
+ } from '../../style/varia/types'
13
+ import {SpinnerTokens} from '../../theme/Spinner.recipe'
14
+ import {getVariantValue, resolveColor} from '../../style/varia/utils'
15
+ import {SpinnerStyles} from '../../theme/Spinner.recipe'
16
16
 
17
17
  type SpinnerVariants = UnistylesVariants<typeof SpinnerStyles>
18
18
  export type SpinnerProps = SpinnerVariants &
@@ -8,9 +8,9 @@ import Animated, {
8
8
  import {StyleSheet, UnistylesVariants} from 'react-native-unistyles'
9
9
  import {useAnimatedVariantColor} from 'react-native-unistyles/reanimated'
10
10
  import {ReactNode, useLayoutEffect, useRef} from 'react'
11
- import {SwitchTokens, SwitchStyles} from '../theme/Switch.recipe'
12
- import {AlignSelf, Flex, PalettesWithNestedKeys} from '../style/varia/types'
13
- import {getVariantValue} from '../style/varia/utils'
11
+ import {SwitchTokens, SwitchStyles} from '../../theme/Switch.recipe'
12
+ import {AlignSelf, Flex, PalettesWithNestedKeys} from '../../style/varia/types'
13
+ import {getVariantValue} from '../../style/varia/utils'
14
14
 
15
15
  const animations = {
16
16
  withSpring,
@@ -1,9 +1,9 @@
1
1
  import {Text as RNText, TextProps as RNTextProps} from 'react-native'
2
2
  import type {StyleProp, TextStyle} from 'react-native'
3
3
  import {StyleSheet, UnistylesVariants} from 'react-native-unistyles'
4
- import {DefaultTextVariants, TextStyles} from '../theme/Text.recipe'
5
- import {PalettesWithNestedKeys, ThemeColors} from '../style/varia/types'
6
- import {extractThemeColor} from '../style/varia/utils'
4
+ import {DefaultTextVariants, TextStyles} from '../../theme/Text.recipe'
5
+ import {PalettesWithNestedKeys, ThemeColors} from '../../style/varia/types'
6
+ import {extractThemeColor} from '../../style/varia/utils'
7
7
 
8
8
  type TextVariants = UnistylesVariants<typeof TextStyles>
9
9
  type TextProps = TextVariants &
@@ -9,12 +9,12 @@ import Animated, {
9
9
  Easing,
10
10
  } from 'react-native-reanimated'
11
11
  import {scheduleOnRN, scheduleOnUI} from 'react-native-worklets'
12
- import {ToastStyles, ToastDefaultVariants} from '../theme/Toast.recipe'
12
+ import {ToastStyles, ToastDefaultVariants} from '../../theme/Toast.recipe'
13
13
  import {UnistylesVariants} from 'react-native-unistyles'
14
- import {PalettesWithNestedKeys, ZIndex} from '../style/varia/types'
14
+ import {PalettesWithNestedKeys, ZIndex} from '../../style/varia/types'
15
15
  import Text from './Text'
16
- import {AnimatedHStack, VStack} from '../patterns'
17
- import {ZINDEXES} from '../style/varia/constants'
16
+ import {AnimatedHStack, VStack} from '../../patterns'
17
+ import {ZINDEXES} from '../../style/varia/constants'
18
18
 
19
19
  type ToastVariants = UnistylesVariants<typeof ToastStyles>
20
20
 
@@ -1,7 +1,7 @@
1
1
  import {createContext, useContext} from 'react'
2
2
  import {UnistylesVariants} from 'react-native-unistyles'
3
- import {FieldStyles} from '../../theme/Field.recipe'
4
- import {PalettesWithNestedKeys} from '../../style/varia/types'
3
+ import {FieldStyles} from '../../../theme/Field.recipe'
4
+ import {PalettesWithNestedKeys} from '../../../style/varia/types'
5
5
 
6
6
  export type FieldVariants = UnistylesVariants<typeof FieldStyles>
7
7
 
@@ -0,0 +1,184 @@
1
+ import {StyleSheet} from 'react-native-unistyles'
2
+ import {PalettesWithNestedKeys} from '../style/varia/types'
3
+
4
+ export const AccordionDefaultVariants = {
5
+ variant: 'solid',
6
+ size: 'md',
7
+ } as const
8
+ export const AccordionStyles = StyleSheet.create(theme => ({
9
+ itemContainer: (colorPalette: PalettesWithNestedKeys) => ({
10
+ borderRadius: 12,
11
+ variants: {
12
+ variant: {
13
+ solid: {
14
+ backgroundColor: theme.colors.bg.default,
15
+ borderColor: 'transparent',
16
+ borderWidth: 1,
17
+ },
18
+ outline: {
19
+ borderWidth: 1,
20
+ borderColor: theme.colors[colorPalette].a7,
21
+ },
22
+ subtle: {
23
+ backgroundColor: theme.colors[colorPalette]['a3'],
24
+ borderWidth: 0,
25
+ },
26
+ },
27
+ size: {
28
+ sm: {
29
+ minHeight: theme.sizes[9],
30
+ paddingHorizontal: theme.sizes['3.5'],
31
+ paddingVertical: theme.sizes[2],
32
+ gap: theme.spacing[2],
33
+ },
34
+ md: {
35
+ minHeight: theme.sizes[10],
36
+ paddingHorizontal: theme.sizes[4],
37
+ paddingVertical: theme.sizes[2],
38
+ gap: theme.spacing[2],
39
+ },
40
+ lg: {
41
+ minHeight: theme.sizes[11],
42
+ paddingHorizontal: theme.sizes['4.5'],
43
+ paddingVertical: theme.sizes[2],
44
+ gap: theme.spacing[2],
45
+ },
46
+ xl: {
47
+ minHeight: theme.sizes[12],
48
+ paddingHorizontal: theme.sizes[5],
49
+ paddingVertical: theme.sizes[2],
50
+ gap: theme.spacing['2.5'],
51
+ },
52
+ nosize: {},
53
+ },
54
+ active: {
55
+ true: {},
56
+ false: {},
57
+ },
58
+ },
59
+ compoundVariants: [
60
+ {
61
+ variant: 'solid',
62
+ active: true,
63
+ styles: {
64
+ borderColor: theme.colors[colorPalette].default,
65
+ },
66
+ },
67
+ {
68
+ variant: 'outline',
69
+ disabled: true,
70
+ styles: {},
71
+ },
72
+ {
73
+ variant: 'ghost',
74
+ disabled: true,
75
+ styles: {
76
+ backgroundColor: 'transparent',
77
+ },
78
+ },
79
+ {
80
+ variant: 'subtle',
81
+ disabled: true,
82
+ styles: {
83
+ backgroundColor: theme.colors.bg.disabled,
84
+ },
85
+ },
86
+ ],
87
+ }),
88
+ header: (colorPalette: PalettesWithNestedKeys) => ({
89
+ variants: {
90
+ variant: {
91
+ solid: {
92
+ backgroundColor: theme.colors.bg.default,
93
+ },
94
+ outline: {},
95
+ subtle: {},
96
+ },
97
+ size: {
98
+ sm: {
99
+ paddingHorizontal: theme.spacing[2],
100
+ height: theme.sizes[9],
101
+ },
102
+ md: {
103
+ paddingHorizontal: theme.spacing[2],
104
+ height: theme.sizes[10],
105
+ },
106
+ lg: {
107
+ paddingHorizontal: theme.spacing[2],
108
+ height: theme.sizes[11],
109
+ },
110
+ xl: {
111
+ paddingHorizontal: theme.spacing[3],
112
+ height: theme.sizes[12],
113
+ },
114
+ nosize: {},
115
+ },
116
+ active: {
117
+ true: {},
118
+ false: {},
119
+ },
120
+ },
121
+ compoundVariants: [
122
+ {
123
+ variant: 'solid',
124
+ active: true,
125
+ styles: {},
126
+ },
127
+ ],
128
+ }),
129
+ headerTitle: (colorPalette: PalettesWithNestedKeys) => ({
130
+ variants: {
131
+ variant: {
132
+ solid: {
133
+ color: theme.colors.fg.default,
134
+ },
135
+ outline: {
136
+ color: theme.colors[colorPalette].text,
137
+ },
138
+ subtle: {
139
+ color: theme.colors[colorPalette].text,
140
+ },
141
+ },
142
+ size: {
143
+ sm: {
144
+ fontSize: theme.fontSizes.sm,
145
+ },
146
+ md: {
147
+ fontSize: theme.fontSizes.md,
148
+ },
149
+ lg: {
150
+ fontSize: theme.fontSizes.md,
151
+ },
152
+ xl: {
153
+ fontSize: theme.fontSizes.lg,
154
+ },
155
+ nosize: {
156
+ fontSize: theme.fontSizes.md,
157
+ },
158
+ },
159
+ active: {
160
+ true: {},
161
+ false: {},
162
+ },
163
+ },
164
+ compoundVariants: [
165
+ {
166
+ variant: 'solid',
167
+ active: true,
168
+ styles: {
169
+ color: theme.colors[colorPalette].default,
170
+ },
171
+ },
172
+ {
173
+ variant: 'outline',
174
+ active: true,
175
+ styles: {},
176
+ },
177
+ {
178
+ variant: 'subtle',
179
+ active: true,
180
+ styles: {},
181
+ },
182
+ ],
183
+ }),
184
+ }))
@@ -0,0 +1,117 @@
1
+ import {StyleSheet} from 'react-native-unistyles'
2
+ import {PalettesWithNestedKeys} from '../style/varia/types'
3
+ import {textStyle} from '../style/varia/textStyles'
4
+
5
+ export const FloatingActionDefaultVariants = {
6
+ variant: 'solid',
7
+ size: 'md',
8
+ } as const
9
+
10
+ export const FloatingActionStyles = StyleSheet.create(theme => ({
11
+ buttonContainer: (colorPalette: PalettesWithNestedKeys) => ({
12
+ variants: {
13
+ variant: {
14
+ solid: {},
15
+ subtle: {},
16
+ outline: {},
17
+ ghost: {},
18
+ },
19
+ size: {
20
+ sm: {},
21
+ md: {},
22
+ lg: {},
23
+ },
24
+ },
25
+ }),
26
+ button: (colorPalette: PalettesWithNestedKeys) => ({
27
+ borderRadius: theme.radii.full,
28
+ variants: {
29
+ variant: {
30
+ solid: {
31
+ backgroundColor: theme.colors[colorPalette].default,
32
+ },
33
+ outline: {
34
+ borderWidth: 1,
35
+ borderColor: theme.colors[colorPalette].a7,
36
+ },
37
+ subtle: {
38
+ backgroundColor: theme.colors[colorPalette]['a3'],
39
+ },
40
+ ghost: {
41
+ backgroundColor: 'transparent',
42
+ },
43
+ },
44
+ size: {
45
+ sm: {
46
+ height: theme.sizes['8'],
47
+ width: theme.sizes['8'],
48
+ },
49
+ md: {
50
+ height: theme.sizes['10'],
51
+ width: theme.sizes['10'],
52
+ },
53
+ lg: {
54
+ height: theme.sizes['16'],
55
+ width: theme.sizes['16'],
56
+ },
57
+ },
58
+ },
59
+ }),
60
+ buttonIcon: (colorPalette: PalettesWithNestedKeys) => ({
61
+ variants: {
62
+ variant: {
63
+ solid: {
64
+ color: theme.colors.fg.default,
65
+ },
66
+ outline: {
67
+ color: theme.colors[colorPalette].text,
68
+ },
69
+ ghost: {
70
+ color: theme.colors.gray.text,
71
+ },
72
+ subtle: {
73
+ color: theme.colors[colorPalette].text,
74
+ },
75
+ },
76
+ size: {
77
+ sm: {},
78
+ md: {},
79
+ lg: {},
80
+ },
81
+ },
82
+ }),
83
+ item: (colorPalette: PalettesWithNestedKeys) => ({
84
+ borderRadius: theme.radii.full,
85
+ variants: {
86
+ variant: {
87
+ solid: {
88
+ backgroundColor: theme.colors[colorPalette].default,
89
+ },
90
+ outline: {
91
+ borderWidth: 1,
92
+ borderColor: theme.colors[colorPalette].a7,
93
+ },
94
+ subtle: {
95
+ backgroundColor: theme.colors[colorPalette]['a3'],
96
+ },
97
+ ghost: {
98
+ backgroundColor: 'transparent',
99
+ },
100
+ },
101
+ size: {
102
+ sm: {
103
+ height: theme.sizes['8'],
104
+ width: theme.sizes['8'],
105
+ },
106
+ md: {
107
+ height: theme.sizes['10'],
108
+ width: theme.sizes['10'],
109
+ },
110
+ lg: {
111
+ height: theme.sizes['16'],
112
+ width: theme.sizes['16'],
113
+ },
114
+ },
115
+ },
116
+ }),
117
+ }))
@@ -76,7 +76,7 @@ export const ToastStyles = StyleSheet.create(theme => ({
76
76
  variants: {
77
77
  variant: {
78
78
  solid: {
79
- color: theme.colors[colorPalette].fg,
79
+ color: theme.colors.fg.default,
80
80
  },
81
81
  subtle: {
82
82
  color: theme.colors.fg.default,
@@ -87,15 +87,12 @@ export const ToastStyles = StyleSheet.create(theme => ({
87
87
  },
88
88
  size: {
89
89
  sm: {
90
- // ...textStyle.xs,
91
90
  fontSize: theme.fontSizes.xs,
92
91
  },
93
92
  md: {
94
- // ...textStyle.xs,
95
93
  fontSize: theme.fontSizes.xs,
96
94
  },
97
95
  lg: {
98
- // ...textStyle.sm,
99
96
  fontSize: theme.fontSizes.sm,
100
97
  },
101
98
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-varia",
3
- "version": "0.5.0",
3
+ "version": "0.5.2",
4
4
  "bin": {
5
5
  "varia": "bin/cli.js"
6
6
  },
@@ -1,13 +0,0 @@
1
- import * as React from 'react';
2
- import { IconWrapperProps, ThemedIcon } from '../components/IconWrapper';
3
-
4
- const IconName = ({color, ...props}: Omit<IconWrapperProps, 'children' | 'colors'>) => {
5
- return (
6
- <ThemedIcon {...props} color={color}>
7
- <>
8
- {/* Icon content */}
9
- </>
10
- </ThemedIcon>
11
- );
12
- };
13
- export default IconName;