@helpwave/hightide-native 0.3.0 → 0.3.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
@@ -10,7 +10,7 @@
10
10
  "access": "public"
11
11
  },
12
12
  "license": "AGPL-3.0-only",
13
- "version": "0.3.0",
13
+ "version": "0.3.2",
14
14
  "type": "module",
15
15
  "files": [
16
16
  "src"
@@ -43,7 +43,7 @@
43
43
  },
44
44
  "dependencies": {
45
45
  "lucide-react-native": "0.561.0",
46
- "@helpwave/hightide-design": "0.3.0",
46
+ "@helpwave/hightide-design": "0.3.1",
47
47
  "@helpwave/hightide-utils": "0.1.0"
48
48
  },
49
49
  "peerDependencies": {
@@ -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 trackBorderWidth = toNumber(resolvedTrackStyle.borderWidth, 0)
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 - (trackBorderWidth * 2)
158
- const trackInnerHeight = trackHeight - (trackBorderWidth * 2)
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