@butternutbox/pawprint-native 1.1.1 → 1.1.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/package.json
CHANGED
|
@@ -87,9 +87,11 @@ const StyledSegmentItem = styled(Pressable)<{
|
|
|
87
87
|
const StyledIntrinsicClip = styled(View)<{
|
|
88
88
|
clipBorderRadius: number
|
|
89
89
|
clipBgColor: string
|
|
90
|
+
clipHeight: number
|
|
90
91
|
clipWidth?: number
|
|
91
|
-
}>(({ clipBorderRadius, clipBgColor, clipWidth }) => ({
|
|
92
|
+
}>(({ clipBorderRadius, clipBgColor, clipHeight, clipWidth }) => ({
|
|
92
93
|
overflow: "hidden",
|
|
94
|
+
height: clipHeight,
|
|
93
95
|
borderRadius: clipBorderRadius,
|
|
94
96
|
backgroundColor: clipBgColor,
|
|
95
97
|
alignSelf: "flex-start",
|
|
@@ -282,12 +284,14 @@ type IntrinsicTrackProps = ViewProps & {
|
|
|
282
284
|
scrollIndicatorPaddingOuter: number
|
|
283
285
|
scrollIndicatorPaddingInner: number
|
|
284
286
|
}
|
|
287
|
+
trackHeight: number
|
|
285
288
|
renderItems: () => React.ReactNode
|
|
286
289
|
forwardedRef: React.Ref<View>
|
|
287
290
|
}
|
|
288
291
|
|
|
289
292
|
const IntrinsicTrack = ({
|
|
290
293
|
containerProps,
|
|
294
|
+
trackHeight,
|
|
291
295
|
renderItems,
|
|
292
296
|
forwardedRef,
|
|
293
297
|
...rest
|
|
@@ -325,6 +329,7 @@ const IntrinsicTrack = ({
|
|
|
325
329
|
<StyledIntrinsicClip
|
|
326
330
|
clipBorderRadius={containerProps.containerBorderRadius}
|
|
327
331
|
clipBgColor={containerProps.containerBgColor}
|
|
332
|
+
clipHeight={trackHeight}
|
|
328
333
|
clipWidth={
|
|
329
334
|
containerWidth > 0 && contentWidth > 0
|
|
330
335
|
? Math.min(contentWidth, containerWidth)
|
|
@@ -426,7 +431,7 @@ const SegmentedControlRoot = React.forwardRef<View, SegmentedControlProps>(
|
|
|
426
431
|
ref
|
|
427
432
|
) => {
|
|
428
433
|
const theme = useTheme()
|
|
429
|
-
const { spacing, borderRadius, colour } =
|
|
434
|
+
const { spacing, borderRadius, colour, controlItem } =
|
|
430
435
|
theme.tokens.components.segmentedControl
|
|
431
436
|
const { dimensions } = theme.tokens.semantics
|
|
432
437
|
|
|
@@ -505,10 +510,15 @@ const SegmentedControlRoot = React.forwardRef<View, SegmentedControlProps>(
|
|
|
505
510
|
scrollIndicatorPaddingInner: parseTokenValue(dimensions.spacing.sm)
|
|
506
511
|
}
|
|
507
512
|
|
|
513
|
+
const trackHeight =
|
|
514
|
+
parseTokenValue(controlItem.size.small.height) +
|
|
515
|
+
parseTokenValue(spacing.verticalPadding) * 2
|
|
516
|
+
|
|
508
517
|
if (layout === "intrinsic") {
|
|
509
518
|
return (
|
|
510
519
|
<IntrinsicTrack
|
|
511
520
|
containerProps={containerProps}
|
|
521
|
+
trackHeight={trackHeight}
|
|
512
522
|
renderItems={renderItems}
|
|
513
523
|
forwardedRef={ref}
|
|
514
524
|
{...rest}
|