@butternutbox/pawprint-native 0.8.0 → 0.10.0

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,29 +1,28 @@
1
1
  import React from "react"
2
- import { Text, TextProps } from "react-native"
3
- import styled from "@emotion/native"
2
+ import { View, ViewProps } from "react-native"
3
+ import { useTheme } from "@emotion/react"
4
4
  import * as SelectPrimitive from "@rn-primitives/select"
5
+ import { Typography } from "../../atoms/Typography"
5
6
 
6
7
  type SelectFieldValueProps = {
7
8
  placeholder?: string
8
- } & Omit<TextProps, "children">
9
+ } & Omit<ViewProps, "children">
9
10
 
10
- const StyledValue = styled(Text)(({ theme }) => {
11
- const { colour } = theme.tokens.components.inputs
12
-
13
- return {
14
- flex: 1,
15
- minWidth: 0,
16
- textAlign: "left",
17
- color: colour.field.text.default
18
- }
19
- })
20
-
21
- export const SelectFieldValue = React.forwardRef<Text, SelectFieldValueProps>(
11
+ export const SelectFieldValue = React.forwardRef<View, SelectFieldValueProps>(
22
12
  ({ placeholder, ...rest }, ref) => {
13
+ const theme = useTheme()
14
+ const { colour, field } = theme.tokens.components.inputs
15
+
23
16
  return (
24
- <StyledValue ref={ref} {...rest}>
25
- <SelectPrimitive.Value placeholder={placeholder ?? ""} />
26
- </StyledValue>
17
+ <View ref={ref} style={{ flex: 1, minWidth: 0 }} {...rest}>
18
+ <Typography
19
+ token={field.placeholder.default}
20
+ color={colour.field.text.default}
21
+ align="left"
22
+ >
23
+ <SelectPrimitive.Value placeholder={placeholder ?? ""} />
24
+ </Typography>
25
+ </View>
27
26
  )
28
27
  }
29
28
  )