@butternutbox/pawprint-native 0.10.6 → 0.10.7

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.d.cts CHANGED
@@ -429,6 +429,7 @@ type InputFieldOwnProps = {
429
429
  hideStateIcons?: boolean;
430
430
  containerWidth?: number;
431
431
  containerHeight?: number;
432
+ hasInlineHelp?: boolean;
432
433
  };
433
434
  type InputFieldProps = InputFieldOwnProps & Omit<TextInputProps, keyof InputFieldOwnProps>;
434
435
  /**
@@ -573,6 +574,7 @@ declare function registerLogo(brand: LogoBrand, variant: LogoVariant, component:
573
574
 
574
575
  type NumberInputFieldOwnProps = {
575
576
  fieldText?: string;
577
+ inlineHelpText?: string;
576
578
  };
577
579
  type NumberInputFieldProps = NumberInputFieldOwnProps & Omit<InputFieldProps, keyof NumberInputFieldOwnProps>;
578
580
  /**
@@ -580,10 +582,11 @@ type NumberInputFieldProps = NumberInputFieldOwnProps & Omit<InputFieldProps, ke
580
582
  * Renders a centered number input sized to `numberField.size.large.height`.
581
583
  * When fieldText is provided, wraps input + text in a horizontal group.
582
584
  */
583
- declare const NumberInputField: React.ForwardRefExoticComponent<NumberInputFieldOwnProps & Omit<InputFieldProps, "fieldText"> & React.RefAttributes<TextInput>>;
585
+ declare const NumberInputField: React.ForwardRefExoticComponent<NumberInputFieldOwnProps & Omit<InputFieldProps, keyof NumberInputFieldOwnProps> & React.RefAttributes<TextInput>>;
584
586
 
585
587
  type NumberInputOwnProps = Pick<InputProps, "label" | "description" | "error" | "state" | "optionalText" | "onValueChange"> & {
586
588
  fieldText?: string;
589
+ inlineHelpText?: string;
587
590
  };
588
591
  type NumberInputProps = NumberInputOwnProps & Omit<InputFieldProps, keyof NumberInputOwnProps> & Omit<ViewProps, keyof NumberInputOwnProps>;
589
592
  declare const StyledRoot$5: _emotion_native.StyledComponent<ViewProps & {
@@ -1145,6 +1148,7 @@ type NumberFieldInputOwnProps = {
1145
1148
  decrementDisabled?: boolean;
1146
1149
  min?: number;
1147
1150
  max?: number;
1151
+ inlineHelpText?: string;
1148
1152
  };
1149
1153
  type NumberFieldInputProps = NumberFieldInputOwnProps & Omit<TextInputProps, keyof NumberFieldInputOwnProps>;
1150
1154
 
package/dist/index.d.ts CHANGED
@@ -429,6 +429,7 @@ type InputFieldOwnProps = {
429
429
  hideStateIcons?: boolean;
430
430
  containerWidth?: number;
431
431
  containerHeight?: number;
432
+ hasInlineHelp?: boolean;
432
433
  };
433
434
  type InputFieldProps = InputFieldOwnProps & Omit<TextInputProps, keyof InputFieldOwnProps>;
434
435
  /**
@@ -573,6 +574,7 @@ declare function registerLogo(brand: LogoBrand, variant: LogoVariant, component:
573
574
 
574
575
  type NumberInputFieldOwnProps = {
575
576
  fieldText?: string;
577
+ inlineHelpText?: string;
576
578
  };
577
579
  type NumberInputFieldProps = NumberInputFieldOwnProps & Omit<InputFieldProps, keyof NumberInputFieldOwnProps>;
578
580
  /**
@@ -580,10 +582,11 @@ type NumberInputFieldProps = NumberInputFieldOwnProps & Omit<InputFieldProps, ke
580
582
  * Renders a centered number input sized to `numberField.size.large.height`.
581
583
  * When fieldText is provided, wraps input + text in a horizontal group.
582
584
  */
583
- declare const NumberInputField: React.ForwardRefExoticComponent<NumberInputFieldOwnProps & Omit<InputFieldProps, "fieldText"> & React.RefAttributes<TextInput>>;
585
+ declare const NumberInputField: React.ForwardRefExoticComponent<NumberInputFieldOwnProps & Omit<InputFieldProps, keyof NumberInputFieldOwnProps> & React.RefAttributes<TextInput>>;
584
586
 
585
587
  type NumberInputOwnProps = Pick<InputProps, "label" | "description" | "error" | "state" | "optionalText" | "onValueChange"> & {
586
588
  fieldText?: string;
589
+ inlineHelpText?: string;
587
590
  };
588
591
  type NumberInputProps = NumberInputOwnProps & Omit<InputFieldProps, keyof NumberInputOwnProps> & Omit<ViewProps, keyof NumberInputOwnProps>;
589
592
  declare const StyledRoot$5: _emotion_native.StyledComponent<ViewProps & {
@@ -1145,6 +1148,7 @@ type NumberFieldInputOwnProps = {
1145
1148
  decrementDisabled?: boolean;
1146
1149
  min?: number;
1147
1150
  max?: number;
1151
+ inlineHelpText?: string;
1148
1152
  };
1149
1153
  type NumberFieldInputProps = NumberFieldInputOwnProps & Omit<TextInputProps, keyof NumberFieldInputOwnProps>;
1150
1154
 
package/dist/index.js CHANGED
@@ -4798,7 +4798,10 @@ var StyledInputWrapper = styled50(Animated.View)(({ theme: theme2, isDisabled, c
4798
4798
  flexShrink: containerWidth !== void 0 ? 0 : void 0
4799
4799
  };
4800
4800
  });
4801
- var StyledInput = styled50(TextInput)(({ theme: theme2 }) => {
4801
+ var StyledInput = styled50(TextInput)(({
4802
+ theme: theme2,
4803
+ hasInlineHelp
4804
+ }) => {
4802
4805
  var _a, _b;
4803
4806
  const { colour, field } = theme2.tokens.components.inputs;
4804
4807
  const typography = field.placeholder.default;
@@ -4808,7 +4811,7 @@ var StyledInput = styled50(TextInput)(({ theme: theme2 }) => {
4808
4811
  );
4809
4812
  const fontSize = parseTokenValue12(typography.fontSize);
4810
4813
  const letterSpacing = ((_a = typography.letterSpacing) == null ? void 0 : _a.endsWith("%")) ? parseFloat(typography.letterSpacing) / 100 * fontSize : parseFloat((_b = typography.letterSpacing) != null ? _b : "0");
4811
- return __spreadValues({
4814
+ return __spreadValues(__spreadValues({
4812
4815
  flex: 1,
4813
4816
  minWidth: 0,
4814
4817
  minHeight: 0,
@@ -4817,7 +4820,7 @@ var StyledInput = styled50(TextInput)(({ theme: theme2 }) => {
4817
4820
  fontFamily,
4818
4821
  fontSize,
4819
4822
  letterSpacing
4820
- }, {
4823
+ }, hasInlineHelp ? { position: "relative", top: -8 } : {}), {
4821
4824
  outlineStyle: "none",
4822
4825
  outlineWidth: 0,
4823
4826
  outlineColor: "transparent"
@@ -4842,6 +4845,7 @@ var InputField = React65.forwardRef(
4842
4845
  hideStateIcons,
4843
4846
  containerWidth,
4844
4847
  containerHeight,
4848
+ hasInlineHelp,
4845
4849
  style,
4846
4850
  editable,
4847
4851
  onFocus,
@@ -4854,6 +4858,7 @@ var InputField = React65.forwardRef(
4854
4858
  "hideStateIcons",
4855
4859
  "containerWidth",
4856
4860
  "containerHeight",
4861
+ "hasInlineHelp",
4857
4862
  "style",
4858
4863
  "editable",
4859
4864
  "onFocus",
@@ -4976,7 +4981,8 @@ var InputField = React65.forwardRef(
4976
4981
  placeholderTextColor: colour.field.text.placeholder,
4977
4982
  editable,
4978
4983
  onFocus: handleFocus,
4979
- onBlur: handleBlur
4984
+ onBlur: handleBlur,
4985
+ hasInlineHelp
4980
4986
  }, rest)
4981
4987
  ),
4982
4988
  trailingIcon && /* @__PURE__ */ jsx(StyledIconSlot, { children: trailingIcon }),
@@ -7727,8 +7733,12 @@ var StyledFieldTextWrapper = styled50(View)({
7727
7733
  flexShrink: 0,
7728
7734
  justifyContent: "center"
7729
7735
  });
7736
+ var StyledInputContainer = styled50(View)(({ hasInlineHelp }) => ({
7737
+ flexDirection: "column",
7738
+ gap: hasInlineHelp ? 2 : 0
7739
+ }));
7730
7740
  var NumberInputField = React65.forwardRef((_a, ref) => {
7731
- var _b = _a, { fieldText } = _b, props = __objRest(_b, ["fieldText"]);
7741
+ var _b = _a, { fieldText, inlineHelpText } = _b, props = __objRest(_b, ["fieldText", "inlineHelpText"]);
7732
7742
  const theme2 = useTheme();
7733
7743
  const { colour, description } = theme2.tokens.components.inputs;
7734
7744
  const fieldSize = parseTokenValue14(
@@ -7740,15 +7750,47 @@ var NumberInputField = React65.forwardRef((_a, ref) => {
7740
7750
  keyboardType: "numeric",
7741
7751
  hideStateIcons: true,
7742
7752
  containerWidth: fieldSize,
7743
- containerHeight: fieldSize,
7753
+ containerHeight: inlineHelpText ? void 0 : fieldSize,
7754
+ hasInlineHelp: !!inlineHelpText,
7744
7755
  ref,
7745
7756
  style: { textAlign: "center" }
7746
7757
  }, props)
7747
7758
  );
7748
- if (!fieldText) {
7749
- return inputElement;
7750
- }
7751
- return /* @__PURE__ */ jsxs(StyledFieldGroup, { children: [
7759
+ const fieldContent = inlineHelpText && fieldText ? /* @__PURE__ */ jsxs(StyledFieldGroup, { children: [
7760
+ /* @__PURE__ */ jsxs(StyledInputContainer, { hasInlineHelp: true, children: [
7761
+ inputElement,
7762
+ /* @__PURE__ */ jsx(
7763
+ View,
7764
+ {
7765
+ style: {
7766
+ position: "absolute",
7767
+ bottom: 4,
7768
+ left: 0,
7769
+ width: fieldSize,
7770
+ display: "flex",
7771
+ justifyContent: "center",
7772
+ alignItems: "center"
7773
+ },
7774
+ children: /* @__PURE__ */ jsx(
7775
+ Typography,
7776
+ {
7777
+ token: description.text.default,
7778
+ color: colour.description.default,
7779
+ children: inlineHelpText
7780
+ }
7781
+ )
7782
+ }
7783
+ )
7784
+ ] }),
7785
+ /* @__PURE__ */ jsx(StyledFieldTextWrapper, { children: /* @__PURE__ */ jsx(
7786
+ Typography,
7787
+ {
7788
+ token: description.text.default,
7789
+ color: colour.description.default,
7790
+ children: fieldText
7791
+ }
7792
+ ) })
7793
+ ] }) : fieldText ? /* @__PURE__ */ jsxs(StyledFieldGroup, { children: [
7752
7794
  inputElement,
7753
7795
  /* @__PURE__ */ jsx(StyledFieldTextWrapper, { children: /* @__PURE__ */ jsx(
7754
7796
  Typography,
@@ -7758,7 +7800,31 @@ var NumberInputField = React65.forwardRef((_a, ref) => {
7758
7800
  children: fieldText
7759
7801
  }
7760
7802
  ) })
7761
- ] });
7803
+ ] }) : inlineHelpText ? /* @__PURE__ */ jsxs(StyledInputContainer, { hasInlineHelp: true, children: [
7804
+ inputElement,
7805
+ /* @__PURE__ */ jsx(
7806
+ View,
7807
+ {
7808
+ style: {
7809
+ position: "absolute",
7810
+ bottom: 4,
7811
+ width: fieldSize,
7812
+ display: "flex",
7813
+ justifyContent: "center",
7814
+ alignItems: "center"
7815
+ },
7816
+ children: /* @__PURE__ */ jsx(
7817
+ Typography,
7818
+ {
7819
+ token: description.text.default,
7820
+ color: colour.description.default,
7821
+ children: inlineHelpText
7822
+ }
7823
+ )
7824
+ }
7825
+ )
7826
+ ] }) : inputElement;
7827
+ return fieldContent;
7762
7828
  });
7763
7829
  NumberInputField.displayName = "NumberInput.Field";
7764
7830
  var parseTokenValue15 = (value) => parseFloat(value);
@@ -7778,6 +7844,7 @@ var NumberInputRoot = React65.forwardRef(
7778
7844
  optionalText,
7779
7845
  onValueChange,
7780
7846
  fieldText,
7847
+ inlineHelpText,
7781
7848
  children
7782
7849
  } = _b, inputProps = __objRest(_b, [
7783
7850
  "label",
@@ -7787,6 +7854,7 @@ var NumberInputRoot = React65.forwardRef(
7787
7854
  "optionalText",
7788
7855
  "onValueChange",
7789
7856
  "fieldText",
7857
+ "inlineHelpText",
7790
7858
  "children"
7791
7859
  ]);
7792
7860
  if (children) {
@@ -7799,7 +7867,8 @@ var NumberInputRoot = React65.forwardRef(
7799
7867
  __spreadValues({
7800
7868
  state,
7801
7869
  onChangeText: onValueChange,
7802
- fieldText
7870
+ fieldText,
7871
+ inlineHelpText
7803
7872
  }, inputProps)
7804
7873
  ),
7805
7874
  description && /* @__PURE__ */ jsx(InputDescription, { state, children: description }),
@@ -10184,6 +10253,7 @@ var StyledFieldWrapper = styled50(View)(
10184
10253
  }) => __spreadValues({
10185
10254
  alignItems: "center",
10186
10255
  justifyContent: "center",
10256
+ position: "relative",
10187
10257
  width: fullWidth ? "100%" : fieldMinWidth,
10188
10258
  minWidth: fieldMinWidth,
10189
10259
  height: fieldHeight,
@@ -10195,19 +10265,27 @@ var StyledFieldWrapper = styled50(View)(
10195
10265
  overflow: "hidden"
10196
10266
  }, fullWidth && { flex: 1 })
10197
10267
  );
10198
- var StyledTextInput = styled50(TextInput)(({ inputColor, inputFontFamily, inputFontWeight, inputFontSize }) => __spreadProps(__spreadValues({
10199
- textAlign: "center",
10200
- outlineStyle: "none",
10201
- padding: 0,
10202
- minWidth: 0,
10203
- minHeight: 0,
10204
- width: "100%",
10205
- height: "100%",
10206
- color: inputColor,
10207
- fontFamily: inputFontFamily
10208
- }, inputFontWeight ? { fontWeight: inputFontWeight } : {}), {
10209
- fontSize: inputFontSize
10210
- }));
10268
+ var StyledTextInput = styled50(TextInput)(
10269
+ ({
10270
+ inputColor,
10271
+ inputFontFamily,
10272
+ inputFontWeight,
10273
+ inputFontSize,
10274
+ hasInlineHelp
10275
+ }) => __spreadValues(__spreadProps(__spreadValues({
10276
+ textAlign: "center",
10277
+ outlineStyle: "none",
10278
+ padding: 0,
10279
+ minWidth: 0,
10280
+ minHeight: 0,
10281
+ width: "100%",
10282
+ height: "100%",
10283
+ color: inputColor,
10284
+ fontFamily: inputFontFamily
10285
+ }, inputFontWeight ? { fontWeight: inputFontWeight } : {}), {
10286
+ fontSize: inputFontSize
10287
+ }), hasInlineHelp ? { position: "relative", top: -8 } : {})
10288
+ );
10211
10289
  var StyledRow = styled50(View)(({ rowGap }) => ({
10212
10290
  flexDirection: "row",
10213
10291
  alignItems: "center",
@@ -10228,6 +10306,7 @@ var NumberFieldInput = React65.forwardRef(
10228
10306
  decrementDisabled = false,
10229
10307
  min,
10230
10308
  max,
10309
+ inlineHelpText,
10231
10310
  style,
10232
10311
  onFocus,
10233
10312
  onBlur,
@@ -10247,6 +10326,7 @@ var NumberFieldInput = React65.forwardRef(
10247
10326
  "decrementDisabled",
10248
10327
  "min",
10249
10328
  "max",
10329
+ "inlineHelpText",
10250
10330
  "style",
10251
10331
  "onFocus",
10252
10332
  "onBlur",
@@ -10325,7 +10405,7 @@ var NumberFieldInput = React65.forwardRef(
10325
10405
  disabled: disabled || decrementDisabled || isAtMin
10326
10406
  }
10327
10407
  ),
10328
- /* @__PURE__ */ jsx(
10408
+ /* @__PURE__ */ jsxs(
10329
10409
  StyledFieldWrapper,
10330
10410
  {
10331
10411
  fieldBgColor: tokens3.colour.field.background.default,
@@ -10335,24 +10415,48 @@ var NumberFieldInput = React65.forwardRef(
10335
10415
  fieldHeight,
10336
10416
  fieldPaddingHorizontal,
10337
10417
  fullWidth,
10338
- children: /* @__PURE__ */ jsx(
10339
- StyledTextInput,
10340
- __spreadValues({
10341
- ref,
10342
- inputColor: tokens3.colour.field.text.default,
10343
- inputFontFamily: resolvedInputFontFamily,
10344
- inputFontWeight: resolvedInputFontFamily === typographyToken.fontFamily ? typographyToken.fontWeight : void 0,
10345
- inputFontSize: parseTokenValue34(typographyToken.fontSize),
10346
- keyboardType: "numeric",
10347
- editable: !disabled,
10348
- onFocus: handleFocus,
10349
- onBlur: handleBlur,
10350
- onChangeText: handleChangeText,
10351
- defaultValue,
10352
- value,
10353
- style
10354
- }, rest)
10355
- )
10418
+ children: [
10419
+ /* @__PURE__ */ jsx(
10420
+ StyledTextInput,
10421
+ __spreadValues({
10422
+ ref,
10423
+ inputColor: tokens3.colour.field.text.default,
10424
+ inputFontFamily: resolvedInputFontFamily,
10425
+ inputFontWeight: resolvedInputFontFamily === typographyToken.fontFamily ? typographyToken.fontWeight : void 0,
10426
+ inputFontSize: parseTokenValue34(typographyToken.fontSize),
10427
+ hasInlineHelp: !!inlineHelpText,
10428
+ keyboardType: "numeric",
10429
+ editable: !disabled,
10430
+ onFocus: handleFocus,
10431
+ onBlur: handleBlur,
10432
+ onChangeText: handleChangeText,
10433
+ defaultValue,
10434
+ value,
10435
+ style
10436
+ }, rest)
10437
+ ),
10438
+ inlineHelpText && /* @__PURE__ */ jsx(
10439
+ View,
10440
+ {
10441
+ style: {
10442
+ position: "absolute",
10443
+ bottom: 4,
10444
+ width: fieldMinWidth,
10445
+ display: "flex",
10446
+ justifyContent: "center",
10447
+ alignItems: "center"
10448
+ },
10449
+ children: /* @__PURE__ */ jsx(
10450
+ Typography,
10451
+ {
10452
+ token: inputTokens3.description.text.default,
10453
+ color: inputTokens3.colour.description.default,
10454
+ children: inlineHelpText
10455
+ }
10456
+ )
10457
+ }
10458
+ )
10459
+ ]
10356
10460
  }
10357
10461
  ),
10358
10462
  showIncrementButton && /* @__PURE__ */ jsx(