@butternutbox/pawprint-native 0.10.5 → 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/.turbo/turbo-build.log +7 -7
- package/CHANGELOG.md +13 -0
- package/dist/index.cjs +153 -47
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -3
- package/dist/index.d.ts +8 -3
- package/dist/index.js +153 -47
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/Illustration/Illustration.stories.tsx +3 -1
- package/src/components/atoms/Input/InputField.tsx +9 -1
- package/src/components/atoms/NumberInput/NumberInput.stories.tsx +22 -0
- package/src/components/atoms/NumberInput/NumberInput.tsx +5 -1
- package/src/components/atoms/NumberInput/NumberInputField.tsx +81 -18
- package/src/components/atoms/Typography/Typography.test.tsx +2 -2
- package/src/components/molecules/Drawer/Drawer.stories.tsx +58 -0
- package/src/components/molecules/Drawer/Drawer.tsx +10 -3
- package/src/components/molecules/Drawer/index.ts +5 -1
- package/src/components/molecules/NumberField/NumberField.stories.tsx +23 -0
- package/src/components/molecules/NumberField/NumberFieldInput.tsx +49 -14
package/.turbo/turbo-build.log
CHANGED
|
@@ -7,12 +7,12 @@
|
|
|
7
7
|
[34mCJS[39m Build start
|
|
8
8
|
[34mESM[39m Build start
|
|
9
9
|
[34mDTS[39m Build start
|
|
10
|
-
[32mCJS[39m [1mdist/index.cjs [22m[32m1.79 MB[39m
|
|
11
|
-
[32mCJS[39m [1mdist/index.cjs.map [22m[32m2.69 MB[39m
|
|
12
|
-
[32mCJS[39m ⚡️ Build success in 11501ms
|
|
13
10
|
[32mESM[39m [1mdist/index.js [22m[32m1.72 MB[39m
|
|
14
11
|
[32mESM[39m [1mdist/index.js.map [22m[32m2.69 MB[39m
|
|
15
|
-
[32mESM[39m ⚡️ Build success in
|
|
16
|
-
[
|
|
17
|
-
[
|
|
18
|
-
[
|
|
12
|
+
[32mESM[39m ⚡️ Build success in 11806ms
|
|
13
|
+
[32mCJS[39m [1mdist/index.cjs [22m[32m1.80 MB[39m
|
|
14
|
+
[32mCJS[39m [1mdist/index.cjs.map [22m[32m2.70 MB[39m
|
|
15
|
+
[32mCJS[39m ⚡️ Build success in 11807ms
|
|
16
|
+
[32mDTS[39m ⚡️ Build success in 24924ms
|
|
17
|
+
[32mDTS[39m [1mdist/index.d.cts [22m[32m91.44 KB[39m
|
|
18
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m91.44 KB[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @butternutbox/pawprint-native
|
|
2
2
|
|
|
3
|
+
## 0.10.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 7af3414: add inline help text to number fields
|
|
8
|
+
|
|
9
|
+
## 0.10.6
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 05e3901: fix hidden input value on android
|
|
14
|
+
- 9044a8f: allow drawer overlay to take top content
|
|
15
|
+
|
|
3
16
|
## 0.10.5
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
package/dist/index.cjs
CHANGED
|
@@ -4837,7 +4837,10 @@ var StyledInputWrapper = styled50__default.default(reactNative.Animated.View)(({
|
|
|
4837
4837
|
flexShrink: containerWidth !== void 0 ? 0 : void 0
|
|
4838
4838
|
};
|
|
4839
4839
|
});
|
|
4840
|
-
var StyledInput = styled50__default.default(reactNative.TextInput)(({
|
|
4840
|
+
var StyledInput = styled50__default.default(reactNative.TextInput)(({
|
|
4841
|
+
theme: theme2,
|
|
4842
|
+
hasInlineHelp
|
|
4843
|
+
}) => {
|
|
4841
4844
|
var _a, _b;
|
|
4842
4845
|
const { colour, field } = theme2.tokens.components.inputs;
|
|
4843
4846
|
const typography = field.placeholder.default;
|
|
@@ -4847,7 +4850,7 @@ var StyledInput = styled50__default.default(reactNative.TextInput)(({ theme: the
|
|
|
4847
4850
|
);
|
|
4848
4851
|
const fontSize = parseTokenValue12(typography.fontSize);
|
|
4849
4852
|
const letterSpacing = ((_a = typography.letterSpacing) == null ? void 0 : _a.endsWith("%")) ? parseFloat(typography.letterSpacing) / 100 * fontSize : parseFloat((_b = typography.letterSpacing) != null ? _b : "0");
|
|
4850
|
-
return __spreadValues({
|
|
4853
|
+
return __spreadValues(__spreadValues({
|
|
4851
4854
|
flex: 1,
|
|
4852
4855
|
minWidth: 0,
|
|
4853
4856
|
minHeight: 0,
|
|
@@ -4856,7 +4859,7 @@ var StyledInput = styled50__default.default(reactNative.TextInput)(({ theme: the
|
|
|
4856
4859
|
fontFamily,
|
|
4857
4860
|
fontSize,
|
|
4858
4861
|
letterSpacing
|
|
4859
|
-
}, {
|
|
4862
|
+
}, hasInlineHelp ? { position: "relative", top: -8 } : {}), {
|
|
4860
4863
|
outlineStyle: "none",
|
|
4861
4864
|
outlineWidth: 0,
|
|
4862
4865
|
outlineColor: "transparent"
|
|
@@ -4881,6 +4884,7 @@ var InputField = React65__default.default.forwardRef(
|
|
|
4881
4884
|
hideStateIcons,
|
|
4882
4885
|
containerWidth,
|
|
4883
4886
|
containerHeight,
|
|
4887
|
+
hasInlineHelp,
|
|
4884
4888
|
style,
|
|
4885
4889
|
editable,
|
|
4886
4890
|
onFocus,
|
|
@@ -4893,6 +4897,7 @@ var InputField = React65__default.default.forwardRef(
|
|
|
4893
4897
|
"hideStateIcons",
|
|
4894
4898
|
"containerWidth",
|
|
4895
4899
|
"containerHeight",
|
|
4900
|
+
"hasInlineHelp",
|
|
4896
4901
|
"style",
|
|
4897
4902
|
"editable",
|
|
4898
4903
|
"onFocus",
|
|
@@ -5015,7 +5020,8 @@ var InputField = React65__default.default.forwardRef(
|
|
|
5015
5020
|
placeholderTextColor: colour.field.text.placeholder,
|
|
5016
5021
|
editable,
|
|
5017
5022
|
onFocus: handleFocus,
|
|
5018
|
-
onBlur: handleBlur
|
|
5023
|
+
onBlur: handleBlur,
|
|
5024
|
+
hasInlineHelp
|
|
5019
5025
|
}, rest)
|
|
5020
5026
|
),
|
|
5021
5027
|
trailingIcon && /* @__PURE__ */ jsxRuntime.jsx(StyledIconSlot, { children: trailingIcon }),
|
|
@@ -7766,8 +7772,12 @@ var StyledFieldTextWrapper = styled50__default.default(reactNative.View)({
|
|
|
7766
7772
|
flexShrink: 0,
|
|
7767
7773
|
justifyContent: "center"
|
|
7768
7774
|
});
|
|
7775
|
+
var StyledInputContainer = styled50__default.default(reactNative.View)(({ hasInlineHelp }) => ({
|
|
7776
|
+
flexDirection: "column",
|
|
7777
|
+
gap: hasInlineHelp ? 2 : 0
|
|
7778
|
+
}));
|
|
7769
7779
|
var NumberInputField = React65__default.default.forwardRef((_a, ref) => {
|
|
7770
|
-
var _b = _a, { fieldText } = _b, props = __objRest(_b, ["fieldText"]);
|
|
7780
|
+
var _b = _a, { fieldText, inlineHelpText } = _b, props = __objRest(_b, ["fieldText", "inlineHelpText"]);
|
|
7771
7781
|
const theme2 = react.useTheme();
|
|
7772
7782
|
const { colour, description } = theme2.tokens.components.inputs;
|
|
7773
7783
|
const fieldSize = parseTokenValue14(
|
|
@@ -7779,15 +7789,47 @@ var NumberInputField = React65__default.default.forwardRef((_a, ref) => {
|
|
|
7779
7789
|
keyboardType: "numeric",
|
|
7780
7790
|
hideStateIcons: true,
|
|
7781
7791
|
containerWidth: fieldSize,
|
|
7782
|
-
containerHeight: fieldSize,
|
|
7792
|
+
containerHeight: inlineHelpText ? void 0 : fieldSize,
|
|
7793
|
+
hasInlineHelp: !!inlineHelpText,
|
|
7783
7794
|
ref,
|
|
7784
7795
|
style: { textAlign: "center" }
|
|
7785
7796
|
}, props)
|
|
7786
7797
|
);
|
|
7787
|
-
|
|
7788
|
-
|
|
7789
|
-
|
|
7790
|
-
|
|
7798
|
+
const fieldContent = inlineHelpText && fieldText ? /* @__PURE__ */ jsxRuntime.jsxs(StyledFieldGroup, { children: [
|
|
7799
|
+
/* @__PURE__ */ jsxRuntime.jsxs(StyledInputContainer, { hasInlineHelp: true, children: [
|
|
7800
|
+
inputElement,
|
|
7801
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7802
|
+
reactNative.View,
|
|
7803
|
+
{
|
|
7804
|
+
style: {
|
|
7805
|
+
position: "absolute",
|
|
7806
|
+
bottom: 4,
|
|
7807
|
+
left: 0,
|
|
7808
|
+
width: fieldSize,
|
|
7809
|
+
display: "flex",
|
|
7810
|
+
justifyContent: "center",
|
|
7811
|
+
alignItems: "center"
|
|
7812
|
+
},
|
|
7813
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7814
|
+
Typography,
|
|
7815
|
+
{
|
|
7816
|
+
token: description.text.default,
|
|
7817
|
+
color: colour.description.default,
|
|
7818
|
+
children: inlineHelpText
|
|
7819
|
+
}
|
|
7820
|
+
)
|
|
7821
|
+
}
|
|
7822
|
+
)
|
|
7823
|
+
] }),
|
|
7824
|
+
/* @__PURE__ */ jsxRuntime.jsx(StyledFieldTextWrapper, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7825
|
+
Typography,
|
|
7826
|
+
{
|
|
7827
|
+
token: description.text.default,
|
|
7828
|
+
color: colour.description.default,
|
|
7829
|
+
children: fieldText
|
|
7830
|
+
}
|
|
7831
|
+
) })
|
|
7832
|
+
] }) : fieldText ? /* @__PURE__ */ jsxRuntime.jsxs(StyledFieldGroup, { children: [
|
|
7791
7833
|
inputElement,
|
|
7792
7834
|
/* @__PURE__ */ jsxRuntime.jsx(StyledFieldTextWrapper, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7793
7835
|
Typography,
|
|
@@ -7797,7 +7839,31 @@ var NumberInputField = React65__default.default.forwardRef((_a, ref) => {
|
|
|
7797
7839
|
children: fieldText
|
|
7798
7840
|
}
|
|
7799
7841
|
) })
|
|
7800
|
-
] })
|
|
7842
|
+
] }) : inlineHelpText ? /* @__PURE__ */ jsxRuntime.jsxs(StyledInputContainer, { hasInlineHelp: true, children: [
|
|
7843
|
+
inputElement,
|
|
7844
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7845
|
+
reactNative.View,
|
|
7846
|
+
{
|
|
7847
|
+
style: {
|
|
7848
|
+
position: "absolute",
|
|
7849
|
+
bottom: 4,
|
|
7850
|
+
width: fieldSize,
|
|
7851
|
+
display: "flex",
|
|
7852
|
+
justifyContent: "center",
|
|
7853
|
+
alignItems: "center"
|
|
7854
|
+
},
|
|
7855
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7856
|
+
Typography,
|
|
7857
|
+
{
|
|
7858
|
+
token: description.text.default,
|
|
7859
|
+
color: colour.description.default,
|
|
7860
|
+
children: inlineHelpText
|
|
7861
|
+
}
|
|
7862
|
+
)
|
|
7863
|
+
}
|
|
7864
|
+
)
|
|
7865
|
+
] }) : inputElement;
|
|
7866
|
+
return fieldContent;
|
|
7801
7867
|
});
|
|
7802
7868
|
NumberInputField.displayName = "NumberInput.Field";
|
|
7803
7869
|
var parseTokenValue15 = (value) => parseFloat(value);
|
|
@@ -7817,6 +7883,7 @@ var NumberInputRoot = React65__default.default.forwardRef(
|
|
|
7817
7883
|
optionalText,
|
|
7818
7884
|
onValueChange,
|
|
7819
7885
|
fieldText,
|
|
7886
|
+
inlineHelpText,
|
|
7820
7887
|
children
|
|
7821
7888
|
} = _b, inputProps = __objRest(_b, [
|
|
7822
7889
|
"label",
|
|
@@ -7826,6 +7893,7 @@ var NumberInputRoot = React65__default.default.forwardRef(
|
|
|
7826
7893
|
"optionalText",
|
|
7827
7894
|
"onValueChange",
|
|
7828
7895
|
"fieldText",
|
|
7896
|
+
"inlineHelpText",
|
|
7829
7897
|
"children"
|
|
7830
7898
|
]);
|
|
7831
7899
|
if (children) {
|
|
@@ -7838,7 +7906,8 @@ var NumberInputRoot = React65__default.default.forwardRef(
|
|
|
7838
7906
|
__spreadValues({
|
|
7839
7907
|
state,
|
|
7840
7908
|
onChangeText: onValueChange,
|
|
7841
|
-
fieldText
|
|
7909
|
+
fieldText,
|
|
7910
|
+
inlineHelpText
|
|
7842
7911
|
}, inputProps)
|
|
7843
7912
|
),
|
|
7844
7913
|
description && /* @__PURE__ */ jsxRuntime.jsx(InputDescription, { state, children: description }),
|
|
@@ -9466,7 +9535,7 @@ var DrawerTrigger = React65__default.default.forwardRef(
|
|
|
9466
9535
|
}
|
|
9467
9536
|
);
|
|
9468
9537
|
DrawerTrigger.displayName = "Drawer.Trigger";
|
|
9469
|
-
var DrawerPortal = ({ children }) => {
|
|
9538
|
+
var DrawerPortal = ({ children, topContent }) => {
|
|
9470
9539
|
const { modalVisible, closeDrawer } = React65__default.default.useContext(DrawerContext);
|
|
9471
9540
|
if (!modalVisible) return null;
|
|
9472
9541
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -9477,7 +9546,10 @@ var DrawerPortal = ({ children }) => {
|
|
|
9477
9546
|
animationType: "none",
|
|
9478
9547
|
statusBarTranslucent: true,
|
|
9479
9548
|
onRequestClose: closeDrawer,
|
|
9480
|
-
children: /* @__PURE__ */ jsxRuntime.
|
|
9549
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles3.modalContainer, children: [
|
|
9550
|
+
children,
|
|
9551
|
+
topContent
|
|
9552
|
+
] })
|
|
9481
9553
|
}
|
|
9482
9554
|
);
|
|
9483
9555
|
};
|
|
@@ -10220,6 +10292,7 @@ var StyledFieldWrapper = styled50__default.default(reactNative.View)(
|
|
|
10220
10292
|
}) => __spreadValues({
|
|
10221
10293
|
alignItems: "center",
|
|
10222
10294
|
justifyContent: "center",
|
|
10295
|
+
position: "relative",
|
|
10223
10296
|
width: fullWidth ? "100%" : fieldMinWidth,
|
|
10224
10297
|
minWidth: fieldMinWidth,
|
|
10225
10298
|
height: fieldHeight,
|
|
@@ -10231,20 +10304,27 @@ var StyledFieldWrapper = styled50__default.default(reactNative.View)(
|
|
|
10231
10304
|
overflow: "hidden"
|
|
10232
10305
|
}, fullWidth && { flex: 1 })
|
|
10233
10306
|
);
|
|
10234
|
-
var StyledTextInput = styled50__default.default(reactNative.TextInput)(
|
|
10235
|
-
|
|
10236
|
-
|
|
10237
|
-
|
|
10238
|
-
|
|
10239
|
-
|
|
10240
|
-
|
|
10241
|
-
|
|
10242
|
-
|
|
10243
|
-
|
|
10244
|
-
|
|
10245
|
-
|
|
10246
|
-
|
|
10247
|
-
|
|
10307
|
+
var StyledTextInput = styled50__default.default(reactNative.TextInput)(
|
|
10308
|
+
({
|
|
10309
|
+
inputColor,
|
|
10310
|
+
inputFontFamily,
|
|
10311
|
+
inputFontWeight,
|
|
10312
|
+
inputFontSize,
|
|
10313
|
+
hasInlineHelp
|
|
10314
|
+
}) => __spreadValues(__spreadProps(__spreadValues({
|
|
10315
|
+
textAlign: "center",
|
|
10316
|
+
outlineStyle: "none",
|
|
10317
|
+
padding: 0,
|
|
10318
|
+
minWidth: 0,
|
|
10319
|
+
minHeight: 0,
|
|
10320
|
+
width: "100%",
|
|
10321
|
+
height: "100%",
|
|
10322
|
+
color: inputColor,
|
|
10323
|
+
fontFamily: inputFontFamily
|
|
10324
|
+
}, inputFontWeight ? { fontWeight: inputFontWeight } : {}), {
|
|
10325
|
+
fontSize: inputFontSize
|
|
10326
|
+
}), hasInlineHelp ? { position: "relative", top: -8 } : {})
|
|
10327
|
+
);
|
|
10248
10328
|
var StyledRow = styled50__default.default(reactNative.View)(({ rowGap }) => ({
|
|
10249
10329
|
flexDirection: "row",
|
|
10250
10330
|
alignItems: "center",
|
|
@@ -10265,6 +10345,7 @@ var NumberFieldInput = React65__default.default.forwardRef(
|
|
|
10265
10345
|
decrementDisabled = false,
|
|
10266
10346
|
min,
|
|
10267
10347
|
max,
|
|
10348
|
+
inlineHelpText,
|
|
10268
10349
|
style,
|
|
10269
10350
|
onFocus,
|
|
10270
10351
|
onBlur,
|
|
@@ -10284,6 +10365,7 @@ var NumberFieldInput = React65__default.default.forwardRef(
|
|
|
10284
10365
|
"decrementDisabled",
|
|
10285
10366
|
"min",
|
|
10286
10367
|
"max",
|
|
10368
|
+
"inlineHelpText",
|
|
10287
10369
|
"style",
|
|
10288
10370
|
"onFocus",
|
|
10289
10371
|
"onBlur",
|
|
@@ -10362,7 +10444,7 @@ var NumberFieldInput = React65__default.default.forwardRef(
|
|
|
10362
10444
|
disabled: disabled || decrementDisabled || isAtMin
|
|
10363
10445
|
}
|
|
10364
10446
|
),
|
|
10365
|
-
/* @__PURE__ */ jsxRuntime.
|
|
10447
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
10366
10448
|
StyledFieldWrapper,
|
|
10367
10449
|
{
|
|
10368
10450
|
fieldBgColor: tokens3.colour.field.background.default,
|
|
@@ -10372,24 +10454,48 @@ var NumberFieldInput = React65__default.default.forwardRef(
|
|
|
10372
10454
|
fieldHeight,
|
|
10373
10455
|
fieldPaddingHorizontal,
|
|
10374
10456
|
fullWidth,
|
|
10375
|
-
children:
|
|
10376
|
-
|
|
10377
|
-
|
|
10378
|
-
|
|
10379
|
-
|
|
10380
|
-
|
|
10381
|
-
|
|
10382
|
-
|
|
10383
|
-
|
|
10384
|
-
|
|
10385
|
-
|
|
10386
|
-
|
|
10387
|
-
|
|
10388
|
-
|
|
10389
|
-
|
|
10390
|
-
|
|
10391
|
-
|
|
10392
|
-
|
|
10457
|
+
children: [
|
|
10458
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10459
|
+
StyledTextInput,
|
|
10460
|
+
__spreadValues({
|
|
10461
|
+
ref,
|
|
10462
|
+
inputColor: tokens3.colour.field.text.default,
|
|
10463
|
+
inputFontFamily: resolvedInputFontFamily,
|
|
10464
|
+
inputFontWeight: resolvedInputFontFamily === typographyToken.fontFamily ? typographyToken.fontWeight : void 0,
|
|
10465
|
+
inputFontSize: parseTokenValue34(typographyToken.fontSize),
|
|
10466
|
+
hasInlineHelp: !!inlineHelpText,
|
|
10467
|
+
keyboardType: "numeric",
|
|
10468
|
+
editable: !disabled,
|
|
10469
|
+
onFocus: handleFocus,
|
|
10470
|
+
onBlur: handleBlur,
|
|
10471
|
+
onChangeText: handleChangeText,
|
|
10472
|
+
defaultValue,
|
|
10473
|
+
value,
|
|
10474
|
+
style
|
|
10475
|
+
}, rest)
|
|
10476
|
+
),
|
|
10477
|
+
inlineHelpText && /* @__PURE__ */ jsxRuntime.jsx(
|
|
10478
|
+
reactNative.View,
|
|
10479
|
+
{
|
|
10480
|
+
style: {
|
|
10481
|
+
position: "absolute",
|
|
10482
|
+
bottom: 4,
|
|
10483
|
+
width: fieldMinWidth,
|
|
10484
|
+
display: "flex",
|
|
10485
|
+
justifyContent: "center",
|
|
10486
|
+
alignItems: "center"
|
|
10487
|
+
},
|
|
10488
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
10489
|
+
Typography,
|
|
10490
|
+
{
|
|
10491
|
+
token: inputTokens3.description.text.default,
|
|
10492
|
+
color: inputTokens3.colour.description.default,
|
|
10493
|
+
children: inlineHelpText
|
|
10494
|
+
}
|
|
10495
|
+
)
|
|
10496
|
+
}
|
|
10497
|
+
)
|
|
10498
|
+
]
|
|
10393
10499
|
}
|
|
10394
10500
|
),
|
|
10395
10501
|
showIncrementButton && /* @__PURE__ */ jsxRuntime.jsx(
|