@pinuts/bsr-uikit-relaunch 0.2.11 → 0.2.12
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NumberInputField.d.ts","sourceRoot":"","sources":["../../../src/items/NumberInputField/NumberInputField.jsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"NumberInputField.d.ts","sourceRoot":"","sources":["../../../src/items/NumberInputField/NumberInputField.jsx"],"names":[],"mappings":";AAkLA,6EAAqE;kBAjLJ,OAAO"}
|
|
@@ -48,7 +48,8 @@ const NumberInputField = _ref => {
|
|
|
48
48
|
viewMode,
|
|
49
49
|
step = 1,
|
|
50
50
|
min = 0,
|
|
51
|
-
max = 1000
|
|
51
|
+
max = 1000,
|
|
52
|
+
showButtons = false
|
|
52
53
|
} = _ref;
|
|
53
54
|
const [numberValue, setNumberValue] = (0, _react.useState)(() => parseFloat(value || 0, 10));
|
|
54
55
|
(0, _react.useEffect)(() => setNumberValue(parseFloat(value || 0, 10)), [value]);
|
|
@@ -91,19 +92,22 @@ const NumberInputField = _ref => {
|
|
|
91
92
|
};
|
|
92
93
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
93
94
|
className: "d-flex flex-row"
|
|
94
|
-
}, /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
95
|
-
color: "tuerkis-20",
|
|
95
|
+
}, showButtons && /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
96
96
|
circular: true,
|
|
97
97
|
onClick: decrement,
|
|
98
98
|
ariaLabel: "" // Button is hidden from screenreaders
|
|
99
99
|
,
|
|
100
|
-
inputProps: buttonInputProps
|
|
100
|
+
inputProps: buttonInputProps,
|
|
101
|
+
className: 'p-0 btn-decrement',
|
|
102
|
+
color: "brick"
|
|
101
103
|
}, /*#__PURE__*/_react.default.createElement(_Icon.default, {
|
|
102
|
-
icon: "
|
|
104
|
+
icon: "Minus",
|
|
103
105
|
height: "16",
|
|
104
|
-
width: "16"
|
|
106
|
+
width: "16",
|
|
107
|
+
stroke: "white",
|
|
108
|
+
fill: "white"
|
|
105
109
|
})), /*#__PURE__*/_react.default.createElement("input", _extends({
|
|
106
|
-
className: getClassNames(['mx-2 ps-4', formControlClassNames]),
|
|
110
|
+
className: getClassNames(['input mx-2 ps-4', formControlClassNames]),
|
|
107
111
|
type: "number",
|
|
108
112
|
step: step
|
|
109
113
|
}, field, ariaAttributes, inputProps, {
|
|
@@ -112,24 +116,28 @@ const NumberInputField = _ref => {
|
|
|
112
116
|
max: max,
|
|
113
117
|
onChange: handleInputChange,
|
|
114
118
|
inputMode: "numeric"
|
|
115
|
-
})), /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
116
|
-
color: "tuerkis-20",
|
|
119
|
+
})), showButtons && /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
117
120
|
circular: true,
|
|
118
121
|
onClick: increment,
|
|
119
122
|
ariaLabel: "" // Button is hidden from screenreaders
|
|
120
123
|
,
|
|
121
|
-
inputProps: buttonInputProps
|
|
124
|
+
inputProps: buttonInputProps,
|
|
125
|
+
className: 'p-0 btn-increment',
|
|
126
|
+
color: "brick"
|
|
122
127
|
}, /*#__PURE__*/_react.default.createElement(_Icon.default, {
|
|
123
|
-
icon: "
|
|
128
|
+
icon: "Plus",
|
|
124
129
|
height: "16",
|
|
125
|
-
width: "16"
|
|
130
|
+
width: "16",
|
|
131
|
+
stroke: "white",
|
|
132
|
+
fill: "white"
|
|
126
133
|
})));
|
|
127
134
|
};
|
|
128
135
|
NumberInputField.propTypes = {
|
|
129
136
|
..._FormFieldChildPropTypes.default,
|
|
130
137
|
step: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
131
138
|
max: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
132
|
-
min: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number])
|
|
139
|
+
min: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
140
|
+
showButtons: _propTypes.default.bool
|
|
133
141
|
};
|
|
134
142
|
const HigherOrderNumberInputField = (0, _withFieldGroup.default)(NumberInputField);
|
|
135
143
|
|
package/dist/styles/_form.scss
CHANGED
|
@@ -315,6 +315,23 @@ button {
|
|
|
315
315
|
justify-content: center;
|
|
316
316
|
min-height: $base-gap * 10;
|
|
317
317
|
}
|
|
318
|
+
&.btn-orange {
|
|
319
|
+
background-color: $bsr-orange-100;
|
|
320
|
+
color: $bsr-white-100;
|
|
321
|
+
border-color: $bsr-orange-100;
|
|
322
|
+
gap: $base-gap * 3;
|
|
323
|
+
justify-content: center;
|
|
324
|
+
min-height: $base-gap * 10;
|
|
325
|
+
}
|
|
326
|
+
&.btn-decrement,
|
|
327
|
+
&.btn-increment {
|
|
328
|
+
&:hover {
|
|
329
|
+
svg path {
|
|
330
|
+
fill: $bsr-brick-100;
|
|
331
|
+
stroke: $bsr-brick-100;
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
}
|
|
318
335
|
}
|
|
319
336
|
|
|
320
337
|
button[type="submit"] {
|