glints-aries 4.0.209 → 4.0.211
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/es/@next/Button/ButtonStyle.js +1 -1
- package/es/@next/Button/PrimaryButtonStyle.js +1 -1
- package/es/@next/CurrencyInput/CurrencyInput.js +2 -5
- package/es/@next/TextInput/TextInput.d.ts +4 -2
- package/es/@next/TextInput/TextInput.js +3 -7
- package/lib/@next/Button/ButtonStyle.js +1 -1
- package/lib/@next/Button/PrimaryButtonStyle.js +1 -1
- package/lib/@next/CurrencyInput/CurrencyInput.js +2 -7
- package/lib/@next/TextInput/TextInput.d.ts +4 -2
- package/lib/@next/TextInput/TextInput.js +3 -7
- package/package.json +1 -1
|
@@ -15,7 +15,7 @@ var buttonSizeStyleMap = {
|
|
|
15
15
|
export var StyledButton = styled.button.withConfig({
|
|
16
16
|
displayName: "ButtonStyle__StyledButton",
|
|
17
17
|
componentId: "sc-8t0676-0"
|
|
18
|
-
})(["display:flex;gap:8px;border-width:1px;border-style:solid;border-radius:", ";flex-direction:row;align-items:center;justify-content:center;flex:none;order:0;flex-grow:0;color:", ";background:", ";border-color:", ";box-shadow:", ";&:hover{cursor:pointer;background:", ";}&:focus{outline:none;border-color:", ";box-shadow:", ";}&:active{background:", ";border:1px solid ", ";box-shadow:", ";}&:active > svg{fill:", ";}&:disabled{color:", ";background:", ";}&:disabled svg{fill:", ";}", " svg{width:16px;height:16px;fill:", ";}.spinner-container{position:absolute;}&[data-active='true']{color:", ";background:", ";}&[data-full-width='true']{width:100%;}&[data-icon='true']{gap:4px;}&[data-active='true'] svg{fill:", ";}&[data-loading='true']{background:", ";color:transparent;}&[data-loading='true'] svg{fill:transparent;}&[data-loading='true'] .spinner-container svg{fill:", ";}"], borderRadius4, Neutral.B18, Neutral.B100, Neutral.B68, button, Neutral.B99, Neutral.B68, buttonFocused, Neutral.B95, Neutral.B68, insetButtonPressed, Neutral.B40, Neutral.B68, Neutral.B95, Neutral.B85, function (_ref) {
|
|
18
|
+
})(["display:flex;gap:8px;border-width:1px;border-style:solid;border-radius:", ";flex-direction:row;align-items:center;justify-content:center;flex:none;order:0;flex-grow:0;color:", ";background:", ";border-color:", ";box-shadow:", ";&:hover{cursor:pointer;background:", ";}&:focus{outline:none;border-color:", ";box-shadow:", ";}&:active{background:", ";border:1px solid ", ";box-shadow:", ";}&:active > svg{fill:", ";}&:disabled{color:", ";background:", ";pointer-events:none;}&:disabled svg{fill:", ";}", " svg{width:16px;height:16px;fill:", ";}.spinner-container{position:absolute;}&[data-active='true']{color:", ";background:", ";}&[data-full-width='true']{width:100%;}&[data-icon='true']{gap:4px;}&[data-active='true'] svg{fill:", ";}&[data-loading='true']{background:", ";color:transparent;}&[data-loading='true'] svg{fill:transparent;}&[data-loading='true'] .spinner-container svg{fill:", ";}"], borderRadius4, Neutral.B18, Neutral.B100, Neutral.B68, button, Neutral.B99, Neutral.B68, buttonFocused, Neutral.B95, Neutral.B68, insetButtonPressed, Neutral.B40, Neutral.B68, Neutral.B95, Neutral.B85, function (_ref) {
|
|
19
19
|
var _ref$size = _ref.size,
|
|
20
20
|
size = _ref$size === void 0 ? 'default' : _ref$size;
|
|
21
21
|
var sizeStyle = buttonSizeStyleMap[size];
|
|
@@ -4,4 +4,4 @@ import { Button } from './Button';
|
|
|
4
4
|
export var PrimaryButton = styled(Button).withConfig({
|
|
5
5
|
displayName: "PrimaryButtonStyle__PrimaryButton",
|
|
6
6
|
componentId: "sc-1iczr6c-0"
|
|
7
|
-
})(["color:", ";background:", ";border:none;&:hover{background:", ";opacity:0.9;box-shadow:0px 1px 0px rgba(0,0,0,0.08),inset 0px -1px 0px rgba(0,0,0,0.2);}&:active{background:", ";opacity:1;}&[data-loading='true']{background:", ";}svg{fill:", ";}"], Neutral.B100, Blue.S99, Blue.S100, Blue.S100, Neutral.B95, Neutral.B100);
|
|
7
|
+
})(["color:", ";background:", ";border:none;&:hover{background:", ";opacity:0.9;box-shadow:0px 1px 0px rgba(0,0,0,0.08),inset 0px -1px 0px rgba(0,0,0,0.2);}&:active{background:", ";opacity:1;border:0;}&[data-loading='true']{background:", ";}svg{fill:", ";}"], Neutral.B100, Blue.S99, Blue.S100, Blue.S100, Neutral.B95, Neutral.B100);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
|
3
3
|
var _excluded = ["locale", "value", "onChange", "currencyCode", "currencySymbol"];
|
|
4
|
-
import React
|
|
4
|
+
import React from 'react';
|
|
5
5
|
import { Input } from '../Input/Input';
|
|
6
6
|
export var CurrencyInput = /*#__PURE__*/React.forwardRef(function CurrencyInput(_ref, ref) {
|
|
7
7
|
var _ref$locale = _ref.locale,
|
|
@@ -50,13 +50,10 @@ export var CurrencyInput = /*#__PURE__*/React.forwardRef(function CurrencyInput(
|
|
|
50
50
|
}
|
|
51
51
|
return '$';
|
|
52
52
|
};
|
|
53
|
-
var
|
|
54
|
-
formattedValue = _useState[0],
|
|
55
|
-
setFormattedValue = _useState[1];
|
|
53
|
+
var formattedValue = formatter.format(getRawNumber(value.toString()));
|
|
56
54
|
var handleChange = function handleChange(e) {
|
|
57
55
|
var rawValue = getRawNumber(e.currentTarget.value);
|
|
58
56
|
onChange(rawValue);
|
|
59
|
-
setFormattedValue(formatter.format(rawValue));
|
|
60
57
|
};
|
|
61
58
|
return /*#__PURE__*/React.createElement(Input, _extends({
|
|
62
59
|
ref: ref,
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { InputProps } from '../Input/Input';
|
|
3
|
-
export declare type TextInputProps = Omit<InputProps, 'type'> & {
|
|
3
|
+
export declare type TextInputProps = Omit<InputProps, 'type' | 'onChange'> & {
|
|
4
4
|
canClear?: boolean;
|
|
5
|
+
onChange?: (value: string) => void;
|
|
5
6
|
};
|
|
6
|
-
export declare const TextInput: React.ForwardRefExoticComponent<Omit<InputProps, "type"> & {
|
|
7
|
+
export declare const TextInput: React.ForwardRefExoticComponent<Omit<InputProps, "type" | "onChange"> & {
|
|
7
8
|
canClear?: boolean;
|
|
9
|
+
onChange?: (value: string) => void;
|
|
8
10
|
} & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -24,19 +24,15 @@ export var TextInput = /*#__PURE__*/React.forwardRef(function TextInput(_ref, re
|
|
|
24
24
|
var _useState = useState(suffix),
|
|
25
25
|
suffixValue = _useState[0],
|
|
26
26
|
setSuffixValue = _useState[1];
|
|
27
|
-
var _useState2 = useState(value),
|
|
28
|
-
currentValue = _useState2[0],
|
|
29
|
-
setCurrentValue = _useState2[1];
|
|
30
27
|
var handleClearIconClick = function handleClearIconClick() {
|
|
31
|
-
|
|
28
|
+
onChange == null ? void 0 : onChange('');
|
|
32
29
|
setSuffixValue(suffix);
|
|
33
30
|
};
|
|
34
31
|
var handleChange = function handleChange(e) {
|
|
35
32
|
var val = e.currentTarget.value;
|
|
36
33
|
var currSuffix = canClear && !!val ? /*#__PURE__*/React.createElement(ClearIcon, null) : suffixValue;
|
|
37
|
-
setCurrentValue(val);
|
|
38
34
|
setSuffixValue(currSuffix);
|
|
39
|
-
onChange == null ? void 0 : onChange(
|
|
35
|
+
onChange == null ? void 0 : onChange(val);
|
|
40
36
|
};
|
|
41
37
|
useEffect(function () {
|
|
42
38
|
setSuffixValue(suffix);
|
|
@@ -45,7 +41,7 @@ export var TextInput = /*#__PURE__*/React.forwardRef(function TextInput(_ref, re
|
|
|
45
41
|
ref: ref,
|
|
46
42
|
type: "text",
|
|
47
43
|
suffix: suffixValue,
|
|
48
|
-
value:
|
|
44
|
+
value: value,
|
|
49
45
|
onChange: handleChange
|
|
50
46
|
}, props));
|
|
51
47
|
});
|
|
@@ -22,7 +22,7 @@ var buttonSizeStyleMap = {
|
|
|
22
22
|
var StyledButton = _styledComponents["default"].button.withConfig({
|
|
23
23
|
displayName: "ButtonStyle__StyledButton",
|
|
24
24
|
componentId: "sc-8t0676-0"
|
|
25
|
-
})(["display:flex;gap:8px;border-width:1px;border-style:solid;border-radius:", ";flex-direction:row;align-items:center;justify-content:center;flex:none;order:0;flex-grow:0;color:", ";background:", ";border-color:", ";box-shadow:", ";&:hover{cursor:pointer;background:", ";}&:focus{outline:none;border-color:", ";box-shadow:", ";}&:active{background:", ";border:1px solid ", ";box-shadow:", ";}&:active > svg{fill:", ";}&:disabled{color:", ";background:", ";}&:disabled svg{fill:", ";}", " svg{width:16px;height:16px;fill:", ";}.spinner-container{position:absolute;}&[data-active='true']{color:", ";background:", ";}&[data-full-width='true']{width:100%;}&[data-icon='true']{gap:4px;}&[data-active='true'] svg{fill:", ";}&[data-loading='true']{background:", ";color:transparent;}&[data-loading='true'] svg{fill:transparent;}&[data-loading='true'] .spinner-container svg{fill:", ";}"], _borderRadius.borderRadius4, _colors.Neutral.B18, _colors.Neutral.B100, _colors.Neutral.B68, _dropShadow.button, _colors.Neutral.B99, _colors.Neutral.B68, _dropShadow.buttonFocused, _colors.Neutral.B95, _colors.Neutral.B68, _dropShadow.insetButtonPressed, _colors.Neutral.B40, _colors.Neutral.B68, _colors.Neutral.B95, _colors.Neutral.B85, function (_ref) {
|
|
25
|
+
})(["display:flex;gap:8px;border-width:1px;border-style:solid;border-radius:", ";flex-direction:row;align-items:center;justify-content:center;flex:none;order:0;flex-grow:0;color:", ";background:", ";border-color:", ";box-shadow:", ";&:hover{cursor:pointer;background:", ";}&:focus{outline:none;border-color:", ";box-shadow:", ";}&:active{background:", ";border:1px solid ", ";box-shadow:", ";}&:active > svg{fill:", ";}&:disabled{color:", ";background:", ";pointer-events:none;}&:disabled svg{fill:", ";}", " svg{width:16px;height:16px;fill:", ";}.spinner-container{position:absolute;}&[data-active='true']{color:", ";background:", ";}&[data-full-width='true']{width:100%;}&[data-icon='true']{gap:4px;}&[data-active='true'] svg{fill:", ";}&[data-loading='true']{background:", ";color:transparent;}&[data-loading='true'] svg{fill:transparent;}&[data-loading='true'] .spinner-container svg{fill:", ";}"], _borderRadius.borderRadius4, _colors.Neutral.B18, _colors.Neutral.B100, _colors.Neutral.B68, _dropShadow.button, _colors.Neutral.B99, _colors.Neutral.B68, _dropShadow.buttonFocused, _colors.Neutral.B95, _colors.Neutral.B68, _dropShadow.insetButtonPressed, _colors.Neutral.B40, _colors.Neutral.B68, _colors.Neutral.B95, _colors.Neutral.B85, function (_ref) {
|
|
26
26
|
var _ref$size = _ref.size,
|
|
27
27
|
size = _ref$size === void 0 ? 'default' : _ref$size;
|
|
28
28
|
var sizeStyle = buttonSizeStyleMap[size];
|
|
@@ -9,5 +9,5 @@ var _Button = require("./Button");
|
|
|
9
9
|
var PrimaryButton = (0, _styledComponents["default"])(_Button.Button).withConfig({
|
|
10
10
|
displayName: "PrimaryButtonStyle__PrimaryButton",
|
|
11
11
|
componentId: "sc-1iczr6c-0"
|
|
12
|
-
})(["color:", ";background:", ";border:none;&:hover{background:", ";opacity:0.9;box-shadow:0px 1px 0px rgba(0,0,0,0.08),inset 0px -1px 0px rgba(0,0,0,0.2);}&:active{background:", ";opacity:1;}&[data-loading='true']{background:", ";}svg{fill:", ";}"], _colors.Neutral.B100, _colors.Blue.S99, _colors.Blue.S100, _colors.Blue.S100, _colors.Neutral.B95, _colors.Neutral.B100);
|
|
12
|
+
})(["color:", ";background:", ";border:none;&:hover{background:", ";opacity:0.9;box-shadow:0px 1px 0px rgba(0,0,0,0.08),inset 0px -1px 0px rgba(0,0,0,0.2);}&:active{background:", ";opacity:1;border:0;}&[data-loading='true']{background:", ";}svg{fill:", ";}"], _colors.Neutral.B100, _colors.Blue.S99, _colors.Blue.S100, _colors.Blue.S100, _colors.Neutral.B95, _colors.Neutral.B100);
|
|
13
13
|
exports.PrimaryButton = PrimaryButton;
|
|
@@ -5,11 +5,9 @@ exports.__esModule = true;
|
|
|
5
5
|
exports.CurrencyInput = void 0;
|
|
6
6
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
7
7
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
8
|
-
var _react =
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _Input = require("../Input/Input");
|
|
10
10
|
var _excluded = ["locale", "value", "onChange", "currencyCode", "currencySymbol"];
|
|
11
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
12
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
13
11
|
var CurrencyInput = /*#__PURE__*/_react["default"].forwardRef(function CurrencyInput(_ref, ref) {
|
|
14
12
|
var _ref$locale = _ref.locale,
|
|
15
13
|
locale = _ref$locale === void 0 ? 'en' : _ref$locale,
|
|
@@ -57,13 +55,10 @@ var CurrencyInput = /*#__PURE__*/_react["default"].forwardRef(function CurrencyI
|
|
|
57
55
|
}
|
|
58
56
|
return '$';
|
|
59
57
|
};
|
|
60
|
-
var
|
|
61
|
-
formattedValue = _useState[0],
|
|
62
|
-
setFormattedValue = _useState[1];
|
|
58
|
+
var formattedValue = formatter.format(getRawNumber(value.toString()));
|
|
63
59
|
var handleChange = function handleChange(e) {
|
|
64
60
|
var rawValue = getRawNumber(e.currentTarget.value);
|
|
65
61
|
onChange(rawValue);
|
|
66
|
-
setFormattedValue(formatter.format(rawValue));
|
|
67
62
|
};
|
|
68
63
|
return /*#__PURE__*/_react["default"].createElement(_Input.Input, (0, _extends2["default"])({
|
|
69
64
|
ref: ref,
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { InputProps } from '../Input/Input';
|
|
3
|
-
export declare type TextInputProps = Omit<InputProps, 'type'> & {
|
|
3
|
+
export declare type TextInputProps = Omit<InputProps, 'type' | 'onChange'> & {
|
|
4
4
|
canClear?: boolean;
|
|
5
|
+
onChange?: (value: string) => void;
|
|
5
6
|
};
|
|
6
|
-
export declare const TextInput: React.ForwardRefExoticComponent<Omit<InputProps, "type"> & {
|
|
7
|
+
export declare const TextInput: React.ForwardRefExoticComponent<Omit<InputProps, "type" | "onChange"> & {
|
|
7
8
|
canClear?: boolean;
|
|
9
|
+
onChange?: (value: string) => void;
|
|
8
10
|
} & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -31,19 +31,15 @@ var TextInput = /*#__PURE__*/_react["default"].forwardRef(function TextInput(_re
|
|
|
31
31
|
var _useState = (0, _react.useState)(suffix),
|
|
32
32
|
suffixValue = _useState[0],
|
|
33
33
|
setSuffixValue = _useState[1];
|
|
34
|
-
var _useState2 = (0, _react.useState)(value),
|
|
35
|
-
currentValue = _useState2[0],
|
|
36
|
-
setCurrentValue = _useState2[1];
|
|
37
34
|
var handleClearIconClick = function handleClearIconClick() {
|
|
38
|
-
|
|
35
|
+
onChange == null ? void 0 : onChange('');
|
|
39
36
|
setSuffixValue(suffix);
|
|
40
37
|
};
|
|
41
38
|
var handleChange = function handleChange(e) {
|
|
42
39
|
var val = e.currentTarget.value;
|
|
43
40
|
var currSuffix = canClear && !!val ? /*#__PURE__*/_react["default"].createElement(ClearIcon, null) : suffixValue;
|
|
44
|
-
setCurrentValue(val);
|
|
45
41
|
setSuffixValue(currSuffix);
|
|
46
|
-
onChange == null ? void 0 : onChange(
|
|
42
|
+
onChange == null ? void 0 : onChange(val);
|
|
47
43
|
};
|
|
48
44
|
(0, _react.useEffect)(function () {
|
|
49
45
|
setSuffixValue(suffix);
|
|
@@ -52,7 +48,7 @@ var TextInput = /*#__PURE__*/_react["default"].forwardRef(function TextInput(_re
|
|
|
52
48
|
ref: ref,
|
|
53
49
|
type: "text",
|
|
54
50
|
suffix: suffixValue,
|
|
55
|
-
value:
|
|
51
|
+
value: value,
|
|
56
52
|
onChange: handleChange
|
|
57
53
|
}, props));
|
|
58
54
|
});
|