@butternutbox/pawprint-native 0.19.0 → 0.19.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/.turbo/turbo-build.log +7 -7
- package/CHANGELOG.md +14 -0
- package/dist/index.cjs +156 -122
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +156 -122
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/Button/Button.stories.tsx +6 -4
- package/src/components/atoms/Switch/Switch.tsx +20 -12
- package/src/components/molecules/NativeSelectPicker/NativeSelectPicker.tsx +9 -2
package/package.json
CHANGED
|
@@ -4,10 +4,12 @@ import { Button } from "./Button"
|
|
|
4
4
|
import type { ButtonProps } from "./Button"
|
|
5
5
|
import { Typography } from "../Typography"
|
|
6
6
|
import { Icon } from "../Icon"
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
import {
|
|
8
|
+
Check,
|
|
9
|
+
IosShare,
|
|
10
|
+
Whatsapp,
|
|
11
|
+
KeyboardDoubleArrowDown
|
|
12
|
+
} from "@butternutbox/pawprint-icons/core"
|
|
11
13
|
|
|
12
14
|
export default {
|
|
13
15
|
title: "Atoms/Button",
|
|
@@ -151,16 +151,22 @@ export const Switch = React.forwardRef<View, SwitchProps>(
|
|
|
151
151
|
|
|
152
152
|
return (
|
|
153
153
|
<StyledContainer
|
|
154
|
-
ref={ref}
|
|
155
154
|
switchGap={parseTokenValue(spacing.gap)}
|
|
156
155
|
switchOpacity={disabled ? parseFloat(opacity.disabled) : 1}
|
|
157
156
|
{...rest}
|
|
157
|
+
pointerEvents={disabled ? "none" : "auto"}
|
|
158
158
|
>
|
|
159
159
|
<SwitchPrimitive.Root
|
|
160
|
+
ref={ref as any}
|
|
160
161
|
checked={isChecked}
|
|
161
162
|
onCheckedChange={handleCheckedChange}
|
|
162
163
|
disabled={disabled}
|
|
163
|
-
|
|
164
|
+
style={
|
|
165
|
+
{
|
|
166
|
+
width: controlWidth,
|
|
167
|
+
height: controlHeight
|
|
168
|
+
} as any
|
|
169
|
+
}
|
|
164
170
|
>
|
|
165
171
|
<StyledControlTrack
|
|
166
172
|
switchChecked={isChecked}
|
|
@@ -170,17 +176,19 @@ export const Switch = React.forwardRef<View, SwitchProps>(
|
|
|
170
176
|
controlBorderColor={colour.control.border.default}
|
|
171
177
|
controlBgChecked={colour.control.background.selected}
|
|
172
178
|
controlBgDefault={colour.control.background.default}
|
|
173
|
-
pointerEvents=
|
|
179
|
+
pointerEvents="none"
|
|
174
180
|
>
|
|
175
|
-
<
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
181
|
+
<SwitchPrimitive.Thumb asChild>
|
|
182
|
+
<StyledThumb
|
|
183
|
+
thumbSize={thumbSize}
|
|
184
|
+
thumbBgColor={
|
|
185
|
+
isChecked
|
|
186
|
+
? colour.thumb.background.selected
|
|
187
|
+
: colour.thumb.background.default
|
|
188
|
+
}
|
|
189
|
+
style={{ transform: [{ translateX: thumbTranslateX }] }}
|
|
190
|
+
/>
|
|
191
|
+
</SwitchPrimitive.Thumb>
|
|
184
192
|
</StyledControlTrack>
|
|
185
193
|
</SwitchPrimitive.Root>
|
|
186
194
|
|
|
@@ -7,7 +7,8 @@ import {
|
|
|
7
7
|
FlatList,
|
|
8
8
|
TouchableWithoutFeedback,
|
|
9
9
|
View,
|
|
10
|
-
ViewProps
|
|
10
|
+
ViewProps,
|
|
11
|
+
useWindowDimensions
|
|
11
12
|
} from "react-native"
|
|
12
13
|
import { useSharedValue, useAnimatedStyle } from "react-native-reanimated"
|
|
13
14
|
import { KeyboardArrowDown } from "@butternutbox/pawprint-icons/core"
|
|
@@ -96,6 +97,7 @@ const NativeSelectPicker = React.forwardRef<View, NativeSelectPickerProps>(
|
|
|
96
97
|
) => {
|
|
97
98
|
const [isOpen, setIsOpen] = useState(false)
|
|
98
99
|
const { iconAnimationStyles } = useIconAnimation()
|
|
100
|
+
const { height: windowHeight } = useWindowDimensions()
|
|
99
101
|
|
|
100
102
|
const hasPlaceholder =
|
|
101
103
|
placeholder &&
|
|
@@ -231,7 +233,12 @@ const NativeSelectPicker = React.forwardRef<View, NativeSelectPickerProps>(
|
|
|
231
233
|
)
|
|
232
234
|
}}
|
|
233
235
|
style={{
|
|
234
|
-
|
|
236
|
+
// Fill the bottom-sheet dialog (sized 40-80% of the
|
|
237
|
+
// screen) rather than a tiny fixed cap, so all options
|
|
238
|
+
// are reachable/scrollable on Android like the iOS
|
|
239
|
+
// ActionSheet. Previously capped at spacing["8xl"],
|
|
240
|
+
// which showed only ~1 row.
|
|
241
|
+
maxHeight: windowHeight * 0.7
|
|
235
242
|
}}
|
|
236
243
|
/>
|
|
237
244
|
</S.AndroidDialog>
|