@butternutbox/pawprint-native 0.23.2 → 0.23.3

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
@@ -215,7 +215,14 @@ var Typography = React66.forwardRef(
215
215
  "textTransform",
216
216
  "textDecoration"
217
217
  ]);
218
- const style = __spreadValues(__spreadValues(__spreadValues({}, nativeTokenToStyle(token)), color2 ? { color: color2 } : {}), getCommonStyles(align2, textTransform2, textDecoration2));
218
+ const style = __spreadValues(__spreadValues(__spreadValues({
219
+ // Token-mode text is component-owned and lives inside flex rows
220
+ // (buttons, tabs, tags). `flexShrink` lets it wrap to multiple lines
221
+ // when the row is narrower than the text, instead of laying out on one
222
+ // line and overflowing/clipping — a `<Text>` nested in a flex `<View>`
223
+ // won't re-wrap on its own after the parent's width is resolved.
224
+ flexShrink: 1
225
+ }, nativeTokenToStyle(token)), color2 ? { color: color2 } : {}), getCommonStyles(align2, textTransform2, textDecoration2));
219
226
  return /* @__PURE__ */ jsx(
220
227
  StyledText,
221
228
  __spreadValues({
@@ -1189,9 +1196,6 @@ var StyledButton = styled51(Pressable)(
1189
1196
  opacity: buttonOpacity
1190
1197
  }, buttonBorderWidth ? { borderWidth: buttonBorderWidth, borderColor: buttonBorderColor } : {}), buttonFullWidth ? { width: "100%" } : {})
1191
1198
  );
1192
- var StyledTextWrapper = styled51(View)(({ textOpacity, fullWidth }) => __spreadValues({
1193
- opacity: textOpacity
1194
- }, fullWidth ? { flexShrink: 1 } : {}));
1195
1199
  var StyledSpinnerWrapper = styled51(View)({
1196
1200
  position: "absolute",
1197
1201
  alignItems: "center",
@@ -1282,7 +1286,7 @@ var Button = React66.forwardRef(
1282
1286
  }, rest), {
1283
1287
  children: [
1284
1288
  startIcon && /* @__PURE__ */ jsx(IconWrapper, { children: startIcon }),
1285
- /* @__PURE__ */ jsx(StyledTextWrapper, { textOpacity: loading ? 0 : 1, fullWidth, children: /* @__PURE__ */ jsx(
1289
+ /* @__PURE__ */ jsx(
1286
1290
  Typography,
1287
1291
  {
1288
1292
  token: {
@@ -1292,11 +1296,11 @@ var Button = React66.forwardRef(
1292
1296
  lineHeight: typography.lineHeight,
1293
1297
  letterSpacing: typography.letterSpacing
1294
1298
  },
1295
- color: variantStyles.textColor,
1299
+ color: loading ? "transparent" : variantStyles.textColor,
1296
1300
  align: "center",
1297
1301
  children
1298
1302
  }
1299
- ) }),
1303
+ ),
1300
1304
  endIcon && /* @__PURE__ */ jsx(IconWrapper, { children: endIcon }),
1301
1305
  loading && /* @__PURE__ */ jsx(StyledSpinnerWrapper, { children: /* @__PURE__ */ jsx(
1302
1306
  Spinner,
@@ -4891,6 +4895,9 @@ var StyledTag = styled51(View)(({ theme: theme2, tagVariant, tagSize }) => {
4891
4895
  backgroundColor: backgroundColorMap[tagVariant]
4892
4896
  };
4893
4897
  });
4898
+ var StyledLabel = styled51(View)({
4899
+ flexShrink: 1
4900
+ });
4894
4901
  var Tag = React66.forwardRef(
4895
4902
  (_a, ref) => {
4896
4903
  var _b = _a, { variant = "primary", size = "medium", icon, children } = _b, rest = __objRest(_b, ["variant", "size", "icon", "children"]);
@@ -4928,14 +4935,14 @@ var Tag = React66.forwardRef(
4928
4935
  colour: iconColourMap[variant]
4929
4936
  }
4930
4937
  ),
4931
- /* @__PURE__ */ jsx(
4938
+ /* @__PURE__ */ jsx(StyledLabel, { children: /* @__PURE__ */ jsx(
4932
4939
  Typography,
4933
4940
  {
4934
4941
  token: typography[size].default,
4935
4942
  color: textColorMap[variant],
4936
4943
  children
4937
4944
  }
4938
- )
4945
+ ) })
4939
4946
  ] }));
4940
4947
  }
4941
4948
  );
@@ -5184,7 +5191,7 @@ var StyledLabelWrapper = styled51(View)({
5184
5191
  justifyContent: "space-between",
5185
5192
  width: "100%"
5186
5193
  });
5187
- var StyledLabel = styled51(View)(({ labelGap }) => ({
5194
+ var StyledLabel2 = styled51(View)(({ labelGap }) => ({
5188
5195
  flexDirection: "row",
5189
5196
  alignItems: "center",
5190
5197
  gap: labelGap
@@ -5215,7 +5222,7 @@ var TextAreaLabel = React66.forwardRef(
5215
5222
  const showCharacterCount = maxLength !== void 0 && currentLength !== void 0;
5216
5223
  const isOverLimit = currentLength !== void 0 && maxLength !== void 0 && currentLength > maxLength;
5217
5224
  return /* @__PURE__ */ jsxs(StyledLabelWrapper, __spreadProps(__spreadValues({ ref }, rest), { children: [
5218
- /* @__PURE__ */ jsxs(StyledLabel, { labelGap: parseTokenValue20(spacing.label.gap), children: [
5225
+ /* @__PURE__ */ jsxs(StyledLabel2, { labelGap: parseTokenValue20(spacing.label.gap), children: [
5219
5226
  /* @__PURE__ */ jsx(
5220
5227
  Typography,
5221
5228
  {
@@ -8930,7 +8937,7 @@ var StyledContentWrapper = styled51(View)(({ theme: theme2 }) => {
8930
8937
  minWidth: 0
8931
8938
  };
8932
8939
  });
8933
- var StyledTextWrapper2 = styled51(View)({
8940
+ var StyledTextWrapper = styled51(View)({
8934
8941
  flex: 1,
8935
8942
  minWidth: 0
8936
8943
  });
@@ -8965,7 +8972,7 @@ var SelectFieldItem = React66.forwardRef(
8965
8972
  children: /* @__PURE__ */ jsx(Slot, { ref, children: /* @__PURE__ */ jsxs(StyledItem3, __spreadProps(__spreadValues({ disabled, style: { backgroundColor } }, rest), { children: [
8966
8973
  leadingIcon && /* @__PURE__ */ jsx(StyledIconWrapper3, { children: leadingIcon }),
8967
8974
  /* @__PURE__ */ jsxs(StyledContentWrapper, { children: [
8968
- /* @__PURE__ */ jsx(StyledTextWrapper2, { children: /* @__PURE__ */ jsx(StyledItemText, { style: { color: textColor }, children: itemText }) }),
8975
+ /* @__PURE__ */ jsx(StyledTextWrapper, { children: /* @__PURE__ */ jsx(StyledItemText, { style: { color: textColor }, children: itemText }) }),
8969
8976
  hintText && /* @__PURE__ */ jsx(
8970
8977
  StyledHintText,
8971
8978
  {
@@ -12343,7 +12350,11 @@ var StyledTab = styled51(Pressable)(
12343
12350
  alignItems: "center",
12344
12351
  justifyContent: "center",
12345
12352
  gap: tabGap,
12346
- height: tabHeight,
12353
+ // `minHeight` (not a fixed `height`) so a tab whose label wraps to more
12354
+ // than one line — e.g. long translated copy in `fixed` layout — grows to
12355
+ // fit instead of clipping/overflowing. The list's `alignItems: "stretch"`
12356
+ // then matches every tab to the tallest, keeping labels vertically aligned.
12357
+ minHeight: tabHeight,
12347
12358
  minWidth: tabMinWidth,
12348
12359
  paddingTop: tabPaddingTop,
12349
12360
  paddingBottom: tabPaddingBottom,
@@ -12400,7 +12411,7 @@ var TabNavigationTab = React66.forwardRef(
12400
12411
  children: [
12401
12412
  avatar && /* @__PURE__ */ jsx(Avatar, __spreadValues({}, avatar)),
12402
12413
  icon && /* @__PURE__ */ jsx(Icon, { icon, customColour: textColour, "aria-hidden": true }),
12403
- /* @__PURE__ */ jsx(Typography, { token, color: textColour, children })
12414
+ /* @__PURE__ */ jsx(Typography, { token, color: textColour, align: "center", children })
12404
12415
  ]
12405
12416
  })
12406
12417
  ) });