@ecohouse/ui 0.1.22 → 0.1.24

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/dist/index.js CHANGED
@@ -2224,6 +2224,7 @@ var styles6 = StyleSheet.create({
2224
2224
  var ICON_SIZE4 = 20;
2225
2225
  var ANIMATION_DURATION = 200;
2226
2226
  var OPTION_HORIZONTAL_PADDING = 16;
2227
+ var OPTION_MIN_WIDTH = 97;
2227
2228
  var SegmentedToggle = forwardRef(
2228
2229
  function SegmentedToggle2({
2229
2230
  options,
@@ -2253,7 +2254,7 @@ var SegmentedToggle = forwardRef(
2253
2254
  const [containerWidth, setContainerWidth] = useState(0);
2254
2255
  const availableOptionWidth = Math.max(0, (containerWidth - 12) / 2);
2255
2256
  const widestContentWidth = Math.max(...contentWidths);
2256
- const contentBasedOptionWidth = widestContentWidth > 0 ? widestContentWidth + OPTION_HORIZONTAL_PADDING * 2 : 0;
2257
+ const contentBasedOptionWidth = widestContentWidth > 0 ? Math.max(OPTION_MIN_WIDTH, widestContentWidth + OPTION_HORIZONTAL_PADDING * 2) : 0;
2257
2258
  const optionWidth = fullWidth ? availableOptionWidth : contentBasedOptionWidth;
2258
2259
  const indicatorTranslateX = progress.interpolate({
2259
2260
  inputRange: [0, 1],
@@ -2320,7 +2321,7 @@ var SegmentedToggle = forwardRef(
2320
2321
  accessibilityState: { selected, disabled },
2321
2322
  style: [
2322
2323
  styles7.option,
2323
- fullWidth ? styles7.optionFullWidth : optionWidth > 0 && { minWidth: optionWidth }
2324
+ fullWidth ? styles7.optionFullWidth : [styles7.optionContentWidth, optionWidth > 0 && { width: optionWidth }]
2324
2325
  ],
2325
2326
  children: /* @__PURE__ */ jsxs(
2326
2327
  View,
@@ -2388,6 +2389,9 @@ var styles7 = StyleSheet.create({
2388
2389
  flex: 1,
2389
2390
  minWidth: 0
2390
2391
  },
2392
+ optionContentWidth: {
2393
+ minWidth: OPTION_MIN_WIDTH
2394
+ },
2391
2395
  activeIndicator: {
2392
2396
  position: "absolute",
2393
2397
  top: 4,