@helpwave/hightide-native 0.3.0 → 0.3.1
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
|
@@ -151,11 +151,15 @@ export const Switch = ({
|
|
|
151
151
|
const resolvedThumbActive = theme.components.switch.thumb(activeState, thumbStyle)
|
|
152
152
|
const trackWidth = toNumber(resolvedTrackStyle.width as string | number | undefined, 40)
|
|
153
153
|
const trackHeight = toNumber(resolvedTrackStyle.height as string | number | undefined, 28)
|
|
154
|
-
const
|
|
154
|
+
const fallbackBorderWidth = toNumber(resolvedTrackStyle.borderWidth, 0)
|
|
155
|
+
const trackBorderTop = toNumber(resolvedTrackStyle.borderTopWidth, fallbackBorderWidth)
|
|
156
|
+
const trackBorderRight = toNumber(resolvedTrackStyle.borderRightWidth, fallbackBorderWidth)
|
|
157
|
+
const trackBorderBottom = toNumber(resolvedTrackStyle.borderBottomWidth, fallbackBorderWidth)
|
|
158
|
+
const trackBorderLeft = toNumber(resolvedTrackStyle.borderLeftWidth, fallbackBorderWidth)
|
|
155
159
|
const thumbInactiveSize = toNumber(resolvedThumbInactive.width as string | number | undefined, 16)
|
|
156
160
|
const thumbActiveSize = toNumber(resolvedThumbActive.width as string | number | undefined, 20)
|
|
157
|
-
const trackInnerWidth = trackWidth -
|
|
158
|
-
const trackInnerHeight = trackHeight -
|
|
161
|
+
const trackInnerWidth = trackWidth - trackBorderLeft - trackBorderRight
|
|
162
|
+
const trackInnerHeight = trackHeight - trackBorderTop - trackBorderBottom
|
|
159
163
|
const thumbOffsetInactive = (trackInnerHeight - thumbInactiveSize) / 2
|
|
160
164
|
const thumbOffsetActive = trackInnerWidth - thumbActiveSize - (
|
|
161
165
|
(trackInnerHeight - thumbActiveSize) / 2
|