@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.cjs CHANGED
@@ -2230,6 +2230,7 @@ var styles6 = reactNative.StyleSheet.create({
2230
2230
  var ICON_SIZE4 = 20;
2231
2231
  var ANIMATION_DURATION = 200;
2232
2232
  var OPTION_HORIZONTAL_PADDING = 16;
2233
+ var OPTION_MIN_WIDTH = 97;
2233
2234
  var SegmentedToggle = react.forwardRef(
2234
2235
  function SegmentedToggle2({
2235
2236
  options,
@@ -2259,7 +2260,7 @@ var SegmentedToggle = react.forwardRef(
2259
2260
  const [containerWidth, setContainerWidth] = react.useState(0);
2260
2261
  const availableOptionWidth = Math.max(0, (containerWidth - 12) / 2);
2261
2262
  const widestContentWidth = Math.max(...contentWidths);
2262
- const contentBasedOptionWidth = widestContentWidth > 0 ? widestContentWidth + OPTION_HORIZONTAL_PADDING * 2 : 0;
2263
+ const contentBasedOptionWidth = widestContentWidth > 0 ? Math.max(OPTION_MIN_WIDTH, widestContentWidth + OPTION_HORIZONTAL_PADDING * 2) : 0;
2263
2264
  const optionWidth = fullWidth ? availableOptionWidth : contentBasedOptionWidth;
2264
2265
  const indicatorTranslateX = progress.interpolate({
2265
2266
  inputRange: [0, 1],
@@ -2326,7 +2327,7 @@ var SegmentedToggle = react.forwardRef(
2326
2327
  accessibilityState: { selected, disabled },
2327
2328
  style: [
2328
2329
  styles7.option,
2329
- fullWidth ? styles7.optionFullWidth : optionWidth > 0 && { minWidth: optionWidth }
2330
+ fullWidth ? styles7.optionFullWidth : [styles7.optionContentWidth, optionWidth > 0 && { width: optionWidth }]
2330
2331
  ],
2331
2332
  children: /* @__PURE__ */ jsxRuntime.jsxs(
2332
2333
  reactNative.View,
@@ -2394,6 +2395,9 @@ var styles7 = reactNative.StyleSheet.create({
2394
2395
  flex: 1,
2395
2396
  minWidth: 0
2396
2397
  },
2398
+ optionContentWidth: {
2399
+ minWidth: OPTION_MIN_WIDTH
2400
+ },
2397
2401
  activeIndicator: {
2398
2402
  position: "absolute",
2399
2403
  top: 4,