react-native-varia 0.5.1 → 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.
- package/lib/components/context/Field.tsx +2 -2
- package/package.json +1 -1
- package/lib/components/ui/context/Field.tsx +0 -27
- /package/lib/components/{ui/Accordion.tsx → Accordion.tsx} +0 -0
- /package/lib/components/{ui/Badge.tsx → Badge.tsx} +0 -0
- /package/lib/components/{ui/Button.tsx → Button.tsx} +0 -0
- /package/lib/components/{ui/Checkbox.tsx → Checkbox.tsx} +0 -0
- /package/lib/components/{ui/CircleProgress.tsx → CircleProgress.tsx} +0 -0
- /package/lib/components/{ui/Divider.tsx → Divider.tsx} +0 -0
- /package/lib/components/{ui/Drawer.tsx → Drawer.tsx} +0 -0
- /package/lib/components/{ui/Field.tsx → Field.tsx} +0 -0
- /package/lib/components/{ui/FloatingAction.tsx → FloatingAction.tsx} +0 -0
- /package/lib/components/{ui/GradientBackground.tsx → GradientBackground.tsx} +0 -0
- /package/lib/components/{ui/GradientText.tsx → GradientText.tsx} +0 -0
- /package/lib/components/{ui/IconWrapper.tsx → IconWrapper.tsx} +0 -0
- /package/lib/components/{ui/Input.tsx → Input.tsx} +0 -0
- /package/lib/components/{ui/Link.tsx → Link.tsx} +0 -0
- /package/lib/components/{ui/Modal.tsx → Modal.tsx} +0 -0
- /package/lib/components/{ui/NumberInput.tsx → NumberInput.tsx} +0 -0
- /package/lib/components/{ui/RadioGroup.tsx → RadioGroup.tsx} +0 -0
- /package/lib/components/{ui/ReText.tsx → ReText.tsx} +0 -0
- /package/lib/components/{ui/Select.tsx → Select.tsx} +0 -0
- /package/lib/components/{ui/Slider.tsx → Slider.tsx} +0 -0
- /package/lib/components/{ui/Slideshow.tsx → Slideshow.tsx} +0 -0
- /package/lib/components/{ui/Spinner.tsx → Spinner.tsx} +0 -0
- /package/lib/components/{ui/Switch.tsx → Switch.tsx} +0 -0
- /package/lib/components/{ui/Text.tsx → Text.tsx} +0 -0
- /package/lib/components/{ui/Toast.tsx → Toast.tsx} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {createContext, useContext} from 'react'
|
|
2
2
|
import {UnistylesVariants} from 'react-native-unistyles'
|
|
3
|
-
import {FieldStyles} from '
|
|
4
|
-
import {PalettesWithNestedKeys} from '
|
|
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
|
|
package/package.json
CHANGED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import {createContext, useContext} from 'react'
|
|
2
|
-
import {UnistylesVariants} from 'react-native-unistyles'
|
|
3
|
-
import {FieldStyles} from '../../../theme/Field.recipe'
|
|
4
|
-
import {PalettesWithNestedKeys} from '../../../style/varia/types'
|
|
5
|
-
|
|
6
|
-
export type FieldVariants = UnistylesVariants<typeof FieldStyles>
|
|
7
|
-
|
|
8
|
-
export type FieldContextType = {
|
|
9
|
-
error?: string
|
|
10
|
-
variant?: FieldVariants['variant']
|
|
11
|
-
size?: FieldVariants['size']
|
|
12
|
-
colorPalette?: PalettesWithNestedKeys
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
const FieldContext = createContext<FieldContextType | undefined>(undefined)
|
|
16
|
-
|
|
17
|
-
export function useField() {
|
|
18
|
-
const context = useContext(FieldContext)
|
|
19
|
-
if (!context) {
|
|
20
|
-
throw new Error(
|
|
21
|
-
'Field subcomponents (Label, Error) must be used inside Field.Root',
|
|
22
|
-
)
|
|
23
|
-
}
|
|
24
|
-
return context
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export default FieldContext
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|