@semcore/input 4.41.0 → 4.41.1-prerelease.0
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/CHANGELOG.md +6 -0
- package/lib/cjs/Input.js +24 -24
- package/lib/es6/{Input.mjs → Input.js} +25 -25
- package/lib/es6/Input.js.map +1 -0
- package/lib/es6/index.d.js +2 -0
- package/lib/es6/index.d.js.map +1 -0
- package/lib/es6/{index.mjs → index.js} +1 -1
- package/lib/es6/index.js.map +1 -0
- package/package.json +6 -6
- package/lib/es6/Input.mjs.map +0 -1
- package/lib/es6/index.d.mjs +0 -2
- package/lib/es6/index.d.mjs.map +0 -1
- package/lib/es6/index.mjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangelog.com/en/1.0.0/).
|
|
4
4
|
|
|
5
|
+
## [4.41.1] - 2025-02-05
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
|
|
9
|
+
- Version patch update due to children dependencies update (`@semcore/utils` [4.45.0 ~> 4.45.1], `@semcore/flex-box` [5.40.0 ~> 5.40.1], `@semcore/core` [2.38.0 ~> 2.38.1]).
|
|
10
|
+
|
|
5
11
|
## [4.41.0] - 2025-02-03
|
|
6
12
|
|
|
7
13
|
### Changed
|
package/lib/cjs/Input.js
CHANGED
|
@@ -6,13 +6,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports["default"] = void 0;
|
|
9
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/
|
|
10
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/
|
|
11
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/
|
|
12
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/
|
|
13
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/
|
|
14
|
-
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/
|
|
15
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/
|
|
9
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
10
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
12
|
+
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
13
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
14
|
+
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
|
|
15
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
16
16
|
var _index = require("@semcore/utils/lib/core/index");
|
|
17
17
|
var _core = _interopRequireWildcard(require("@semcore/core"));
|
|
18
18
|
var _react = _interopRequireDefault(require("react"));
|
|
@@ -21,23 +21,23 @@ var _neighborLocation = _interopRequireDefault(require("@semcore/neighbor-locati
|
|
|
21
21
|
var _autoFocusEnhance = _interopRequireDefault(require("@semcore/utils/lib/enhances/autoFocusEnhance"));
|
|
22
22
|
var _keyboardFocusEnhance = _interopRequireDefault(require("@semcore/utils/lib/enhances/keyboardFocusEnhance"));
|
|
23
23
|
/*__reshadow-styles__:"./style/input.shadow.css"*/
|
|
24
|
-
var style = ( /*__reshadow_css_start__*/_index.sstyled.insert( /*__inner_css_start__*/".
|
|
25
|
-
"__SInput": "
|
|
26
|
-
"_disabled": "
|
|
27
|
-
"__SOutline": "
|
|
28
|
-
"__SValue": "
|
|
29
|
-
"__SAddon": "
|
|
30
|
-
"_size_m": "
|
|
31
|
-
"__SButton": "
|
|
32
|
-
"_size_l": "
|
|
33
|
-
"_focused": "
|
|
34
|
-
"_neighborLocation_right": "
|
|
35
|
-
"_neighborLocation_both": "
|
|
36
|
-
"_neighborLocation_left": "
|
|
37
|
-
"_interactive": "
|
|
38
|
-
"_state_normal": "
|
|
39
|
-
"_state_valid": "
|
|
40
|
-
"_state_invalid": "
|
|
24
|
+
var style = ( /*__reshadow_css_start__*/_index.sstyled.insert( /*__inner_css_start__*/".___SInput_187bx_gg_{display:inline-flex;width:100%;align-items:center;position:relative;z-index:0;vertical-align:middle;padding:1px;box-sizing:border-box}.___SInput_187bx_gg_ input:-webkit-autofill{border-radius:var(--intergalactic-control-rounded, 6px);-webkit-box-shadow:0 0 0 30px #faffbd inset}.___SInput_187bx_gg_ input:-webkit-autofill~.___SOutline_187bx_gg_{background-color:#faffbd}.___SValue_187bx_gg_{min-width:0;width:100%;height:100%;padding:0;border:0;box-sizing:border-box;color:var(--intergalactic-text-primary, #191b23);font-size:inherit;text-overflow:ellipsis;font-family:inherit;background:0 0}.___SValue_187bx_gg_:focus{outline:0}.___SValue_187bx_gg_::-moz-placeholder{color:var(--intergalactic-text-placeholder, #8a8e9b)}.___SValue_187bx_gg_::placeholder{color:var(--intergalactic-text-placeholder, #8a8e9b)}.___SValue_187bx_gg_:not(:disabled):-moz-read-only~.___SOutline_187bx_gg_{background:var(--intergalactic-bg-secondary-neutral, #f4f5f9)}.___SValue_187bx_gg_:not(:disabled):read-only~.___SOutline_187bx_gg_{background:var(--intergalactic-bg-secondary-neutral, #f4f5f9)}.___SValue_187bx_gg_:disabled{-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--intergalactic-disabled-opacity, 0.3)}.___SInput_187bx_gg_.__disabled_187bx_gg_ .___SOutline_187bx_gg_,.___SValue_187bx_gg_:disabled~.___SOutline_187bx_gg_{opacity:var(--intergalactic-disabled-opacity, 0.3);cursor:default;pointer-events:none}.___SOutline_187bx_gg_{position:absolute;top:0;right:0;bottom:0;left:0;border:1px solid;border-radius:var(--intergalactic-control-rounded, 6px);z-index:-1;background:var(--intergalactic-bg-primary-neutral, #ffffff)}.___SAddon_187bx_gg_{display:inline-flex;justify-content:center;align-items:center;flex:0 0 auto;padding:0 var(--intergalactic-spacing-2x, 8px);height:100%;color:var(--intergalactic-icon-secondary-neutral, #a9abb6)}.___SAddon_187bx_gg_.__interactive_187bx_gg_{cursor:pointer}@media (hover:hover){.___SAddon_187bx_gg_.__interactive_187bx_gg_:hover{color:var(--intergalactic-icon-secondary-neutral-hover-active, #878992)}}.___SAddon_187bx_gg_.__disabled_187bx_gg_{opacity:var(--intergalactic-disabled-opacity, 0.3);cursor:default;pointer-events:none}.___SAddon_187bx_gg_._size_m_187bx_gg_:not(.___SButton_187bx_gg_){padding:0 var(--intergalactic-spacing-2x, 8px)}.___SAddon_187bx_gg_._size_l_187bx_gg_:not(.___SButton_187bx_gg_){padding:0 var(--intergalactic-spacing-2x, 8px)0 var(--intergalactic-spacing-3x, 12px)}.___SInput_187bx_gg_ .___SAddon_187bx_gg_:nth-last-child(2){margin-right:-1px}.___SValue_187bx_gg_._size_m_187bx_gg_{padding:0 var(--intergalactic-spacing-2x, 8px)}.___SValue_187bx_gg_._size_l_187bx_gg_{padding:0 var(--intergalactic-spacing-3x, 12px)}.___SInput_187bx_gg_._size_m_187bx_gg_{font-size:var(--intergalactic-fs-200, 14px);height:var(--intergalactic-form-control-m, 28px)}.___SInput_187bx_gg_._size_l_187bx_gg_{font-size:var(--intergalactic-fs-300, 16px);height:var(--intergalactic-form-control-l, 40px)}.___SInput_187bx_gg_.__focused_187bx_gg_{z-index:1}.___SInput_187bx_gg_._state_normal_187bx_gg_ .___SOutline_187bx_gg_{border-color:var(--intergalactic-border-primary, #c4c7cf)}.___SInput_187bx_gg_._state_normal_187bx_gg_.__focused_187bx_gg_ .___SOutline_187bx_gg_{border-color:var(--intergalactic-border-info-active, #006dca);box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.5))}.___SInput_187bx_gg_._state_valid_187bx_gg_ .___SOutline_187bx_gg_{border-color:var(--intergalactic-border-success-active, #007c65)}.___SInput_187bx_gg_._state_valid_187bx_gg_.__focused_187bx_gg_ .___SOutline_187bx_gg_{border-color:var(--intergalactic-border-success-active, #007c65);box-shadow:var(--intergalactic-keyboard-focus-valid, 0px 0px 0px 3px rgba(0, 159, 129, 0.5))}.___SInput_187bx_gg_._state_invalid_187bx_gg_ .___SOutline_187bx_gg_{border-color:var(--intergalactic-border-critical-active, #d1002f)}.___SInput_187bx_gg_._state_invalid_187bx_gg_.__focused_187bx_gg_ .___SOutline_187bx_gg_{border-color:var(--intergalactic-border-critical-active, #d1002f);box-shadow:var(--intergalactic-keyboard-focus-invalid, 0px 0px 0px 3px rgba(255, 73, 83, 0.5))}.___SInput_187bx_gg_._neighborLocation_right_187bx_gg_ .___SOutline_187bx_gg_{border-top-right-radius:0;border-bottom-right-radius:0}.___SInput_187bx_gg_._neighborLocation_both_187bx_gg_ .___SOutline_187bx_gg_{border-radius:0;border-left:none}.___SInput_187bx_gg_._neighborLocation_left_187bx_gg_ .___SOutline_187bx_gg_{border-top-left-radius:0;border-bottom-left-radius:0;border-left:none}.___SValue_187bx_gg_._neighborLocation_right_187bx_gg_{padding-right:0}.___SValue_187bx_gg_._neighborLocation_both_187bx_gg_{padding-left:0;padding-right:0}.___SValue_187bx_gg_._neighborLocation_left_187bx_gg_{padding-left:0}" /*__inner_css_end__*/, "187bx_gg_") /*__reshadow_css_end__*/, {
|
|
25
|
+
"__SInput": "___SInput_187bx_gg_",
|
|
26
|
+
"_disabled": "__disabled_187bx_gg_",
|
|
27
|
+
"__SOutline": "___SOutline_187bx_gg_",
|
|
28
|
+
"__SValue": "___SValue_187bx_gg_",
|
|
29
|
+
"__SAddon": "___SAddon_187bx_gg_",
|
|
30
|
+
"_size_m": "_size_m_187bx_gg_",
|
|
31
|
+
"__SButton": "___SButton_187bx_gg_",
|
|
32
|
+
"_size_l": "_size_l_187bx_gg_",
|
|
33
|
+
"_focused": "__focused_187bx_gg_",
|
|
34
|
+
"_neighborLocation_right": "_neighborLocation_right_187bx_gg_",
|
|
35
|
+
"_neighborLocation_both": "_neighborLocation_both_187bx_gg_",
|
|
36
|
+
"_neighborLocation_left": "_neighborLocation_left_187bx_gg_",
|
|
37
|
+
"_interactive": "__interactive_187bx_gg_",
|
|
38
|
+
"_state_normal": "_state_normal_187bx_gg_",
|
|
39
|
+
"_state_valid": "_state_valid_187bx_gg_",
|
|
40
|
+
"_state_invalid": "_state_invalid_187bx_gg_"
|
|
41
41
|
});
|
|
42
42
|
var Input = /*#__PURE__*/function (_Component) {
|
|
43
43
|
(0, _inherits2["default"])(Input, _Component);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import _objectSpread from "@babel/runtime/helpers/
|
|
2
|
-
import _classCallCheck from "@babel/runtime/helpers/
|
|
3
|
-
import _createClass from "@babel/runtime/helpers/
|
|
4
|
-
import _assertThisInitialized from "@babel/runtime/helpers/
|
|
5
|
-
import _inherits from "@babel/runtime/helpers/
|
|
6
|
-
import _createSuper from "@babel/runtime/helpers/
|
|
7
|
-
import _defineProperty from "@babel/runtime/helpers/
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
2
|
+
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
3
|
+
import _createClass from "@babel/runtime/helpers/createClass";
|
|
4
|
+
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
5
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
6
|
+
import _createSuper from "@babel/runtime/helpers/createSuper";
|
|
7
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
8
|
import { sstyled as _sstyled } from "@semcore/utils/lib/core/index";
|
|
9
9
|
import { assignProps as _assignProps3 } from "@semcore/core";
|
|
10
10
|
import { assignProps as _assignProps2 } from "@semcore/core";
|
|
@@ -16,23 +16,23 @@ import NeighborLocation from '@semcore/neighbor-location';
|
|
|
16
16
|
import autoFocusEnhance from '@semcore/utils/lib/enhances/autoFocusEnhance';
|
|
17
17
|
import keyboardFocusEnhance from '@semcore/utils/lib/enhances/keyboardFocusEnhance';
|
|
18
18
|
/*__reshadow-styles__:"./style/input.shadow.css"*/
|
|
19
|
-
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".
|
|
20
|
-
"__SInput": "
|
|
21
|
-
"_disabled": "
|
|
22
|
-
"__SOutline": "
|
|
23
|
-
"__SValue": "
|
|
24
|
-
"__SAddon": "
|
|
25
|
-
"_size_m": "
|
|
26
|
-
"__SButton": "
|
|
27
|
-
"_size_l": "
|
|
28
|
-
"_focused": "
|
|
29
|
-
"_neighborLocation_right": "
|
|
30
|
-
"_neighborLocation_both": "
|
|
31
|
-
"_neighborLocation_left": "
|
|
32
|
-
"_interactive": "
|
|
33
|
-
"_state_normal": "
|
|
34
|
-
"_state_valid": "
|
|
35
|
-
"_state_invalid": "
|
|
19
|
+
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".___SInput_187bx_gg_{display:inline-flex;width:100%;align-items:center;position:relative;z-index:0;vertical-align:middle;padding:1px;box-sizing:border-box}.___SInput_187bx_gg_ input:-webkit-autofill{border-radius:var(--intergalactic-control-rounded, 6px);-webkit-box-shadow:0 0 0 30px #faffbd inset}.___SInput_187bx_gg_ input:-webkit-autofill~.___SOutline_187bx_gg_{background-color:#faffbd}.___SValue_187bx_gg_{min-width:0;width:100%;height:100%;padding:0;border:0;box-sizing:border-box;color:var(--intergalactic-text-primary, #191b23);font-size:inherit;text-overflow:ellipsis;font-family:inherit;background:0 0}.___SValue_187bx_gg_:focus{outline:0}.___SValue_187bx_gg_::-moz-placeholder{color:var(--intergalactic-text-placeholder, #8a8e9b)}.___SValue_187bx_gg_::placeholder{color:var(--intergalactic-text-placeholder, #8a8e9b)}.___SValue_187bx_gg_:not(:disabled):-moz-read-only~.___SOutline_187bx_gg_{background:var(--intergalactic-bg-secondary-neutral, #f4f5f9)}.___SValue_187bx_gg_:not(:disabled):read-only~.___SOutline_187bx_gg_{background:var(--intergalactic-bg-secondary-neutral, #f4f5f9)}.___SValue_187bx_gg_:disabled{-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--intergalactic-disabled-opacity, 0.3)}.___SInput_187bx_gg_.__disabled_187bx_gg_ .___SOutline_187bx_gg_,.___SValue_187bx_gg_:disabled~.___SOutline_187bx_gg_{opacity:var(--intergalactic-disabled-opacity, 0.3);cursor:default;pointer-events:none}.___SOutline_187bx_gg_{position:absolute;top:0;right:0;bottom:0;left:0;border:1px solid;border-radius:var(--intergalactic-control-rounded, 6px);z-index:-1;background:var(--intergalactic-bg-primary-neutral, #ffffff)}.___SAddon_187bx_gg_{display:inline-flex;justify-content:center;align-items:center;flex:0 0 auto;padding:0 var(--intergalactic-spacing-2x, 8px);height:100%;color:var(--intergalactic-icon-secondary-neutral, #a9abb6)}.___SAddon_187bx_gg_.__interactive_187bx_gg_{cursor:pointer}@media (hover:hover){.___SAddon_187bx_gg_.__interactive_187bx_gg_:hover{color:var(--intergalactic-icon-secondary-neutral-hover-active, #878992)}}.___SAddon_187bx_gg_.__disabled_187bx_gg_{opacity:var(--intergalactic-disabled-opacity, 0.3);cursor:default;pointer-events:none}.___SAddon_187bx_gg_._size_m_187bx_gg_:not(.___SButton_187bx_gg_){padding:0 var(--intergalactic-spacing-2x, 8px)}.___SAddon_187bx_gg_._size_l_187bx_gg_:not(.___SButton_187bx_gg_){padding:0 var(--intergalactic-spacing-2x, 8px)0 var(--intergalactic-spacing-3x, 12px)}.___SInput_187bx_gg_ .___SAddon_187bx_gg_:nth-last-child(2){margin-right:-1px}.___SValue_187bx_gg_._size_m_187bx_gg_{padding:0 var(--intergalactic-spacing-2x, 8px)}.___SValue_187bx_gg_._size_l_187bx_gg_{padding:0 var(--intergalactic-spacing-3x, 12px)}.___SInput_187bx_gg_._size_m_187bx_gg_{font-size:var(--intergalactic-fs-200, 14px);height:var(--intergalactic-form-control-m, 28px)}.___SInput_187bx_gg_._size_l_187bx_gg_{font-size:var(--intergalactic-fs-300, 16px);height:var(--intergalactic-form-control-l, 40px)}.___SInput_187bx_gg_.__focused_187bx_gg_{z-index:1}.___SInput_187bx_gg_._state_normal_187bx_gg_ .___SOutline_187bx_gg_{border-color:var(--intergalactic-border-primary, #c4c7cf)}.___SInput_187bx_gg_._state_normal_187bx_gg_.__focused_187bx_gg_ .___SOutline_187bx_gg_{border-color:var(--intergalactic-border-info-active, #006dca);box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.5))}.___SInput_187bx_gg_._state_valid_187bx_gg_ .___SOutline_187bx_gg_{border-color:var(--intergalactic-border-success-active, #007c65)}.___SInput_187bx_gg_._state_valid_187bx_gg_.__focused_187bx_gg_ .___SOutline_187bx_gg_{border-color:var(--intergalactic-border-success-active, #007c65);box-shadow:var(--intergalactic-keyboard-focus-valid, 0px 0px 0px 3px rgba(0, 159, 129, 0.5))}.___SInput_187bx_gg_._state_invalid_187bx_gg_ .___SOutline_187bx_gg_{border-color:var(--intergalactic-border-critical-active, #d1002f)}.___SInput_187bx_gg_._state_invalid_187bx_gg_.__focused_187bx_gg_ .___SOutline_187bx_gg_{border-color:var(--intergalactic-border-critical-active, #d1002f);box-shadow:var(--intergalactic-keyboard-focus-invalid, 0px 0px 0px 3px rgba(255, 73, 83, 0.5))}.___SInput_187bx_gg_._neighborLocation_right_187bx_gg_ .___SOutline_187bx_gg_{border-top-right-radius:0;border-bottom-right-radius:0}.___SInput_187bx_gg_._neighborLocation_both_187bx_gg_ .___SOutline_187bx_gg_{border-radius:0;border-left:none}.___SInput_187bx_gg_._neighborLocation_left_187bx_gg_ .___SOutline_187bx_gg_{border-top-left-radius:0;border-bottom-left-radius:0;border-left:none}.___SValue_187bx_gg_._neighborLocation_right_187bx_gg_{padding-right:0}.___SValue_187bx_gg_._neighborLocation_both_187bx_gg_{padding-left:0;padding-right:0}.___SValue_187bx_gg_._neighborLocation_left_187bx_gg_{padding-left:0}" /*__inner_css_end__*/, "187bx_gg_") /*__reshadow_css_end__*/, {
|
|
20
|
+
"__SInput": "___SInput_187bx_gg_",
|
|
21
|
+
"_disabled": "__disabled_187bx_gg_",
|
|
22
|
+
"__SOutline": "___SOutline_187bx_gg_",
|
|
23
|
+
"__SValue": "___SValue_187bx_gg_",
|
|
24
|
+
"__SAddon": "___SAddon_187bx_gg_",
|
|
25
|
+
"_size_m": "_size_m_187bx_gg_",
|
|
26
|
+
"__SButton": "___SButton_187bx_gg_",
|
|
27
|
+
"_size_l": "_size_l_187bx_gg_",
|
|
28
|
+
"_focused": "__focused_187bx_gg_",
|
|
29
|
+
"_neighborLocation_right": "_neighborLocation_right_187bx_gg_",
|
|
30
|
+
"_neighborLocation_both": "_neighborLocation_both_187bx_gg_",
|
|
31
|
+
"_neighborLocation_left": "_neighborLocation_left_187bx_gg_",
|
|
32
|
+
"_interactive": "__interactive_187bx_gg_",
|
|
33
|
+
"_state_normal": "_state_normal_187bx_gg_",
|
|
34
|
+
"_state_valid": "_state_valid_187bx_gg_",
|
|
35
|
+
"_state_invalid": "_state_invalid_187bx_gg_"
|
|
36
36
|
});
|
|
37
37
|
var Input = /*#__PURE__*/function (_Component) {
|
|
38
38
|
_inherits(Input, _Component);
|
|
@@ -225,4 +225,4 @@ export default createComponent(Input, {
|
|
|
225
225
|
Addon: Addon,
|
|
226
226
|
Value: Value
|
|
227
227
|
});
|
|
228
|
-
//# sourceMappingURL=Input.
|
|
228
|
+
//# sourceMappingURL=Input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Input.js","names":["React","createComponent","Component","sstyled","Root","Box","InvalidStateBox","NeighborLocation","autoFocusEnhance","keyboardFocusEnhance","style","_sstyled","insert","Input","_Component","_inherits","_super","_createSuper","_this","_classCallCheck","_len","arguments","length","args","Array","_key","call","apply","concat","_defineProperty","_assertThisInitialized","focused","createRef","event","_this$inputRef$curren","preventDefault","inputRef","current","focus","key","setTimeout","document","activeElement","body","_this$inputRef$curren2","setState","_createClass","value","getAddonProps","_this$asProps","asProps","disabled","size","onMouseDown","handleMouseDownAddon","getValueProps","_this$asProps2","state","role","placeholder","ariaHaspopup","ariaControls","ariaExpanded","ariaAutocomplete","ariaOwns","ariaActivedescendant","ref","onFocus","bindHandleValueFocused","onBlur","componentDidUpdate","prevProps","render","_ref","_this2","SInput","SOutline","_this$asProps3","Children","styles","neighborLocation","controlsLength","createElement","Detect","_ref4","cn","_objectSpread","_assignProps","handleKeyDown","Value","_Component2","_super2","uncontrolledProps","e","target","_ref2","SValue","_this$asProps4","_ref5","_assignProps2","defaultValue","Addon","props","_ref3","arguments[0]","SAddon","_ref6","_assignProps3"],"sources":["../../src/Input.jsx"],"sourcesContent":["import React from 'react';\nimport createComponent, { Component, sstyled, Root } from '@semcore/core';\nimport { Box, InvalidStateBox } from '@semcore/flex-box';\nimport NeighborLocation from '@semcore/neighbor-location';\nimport autoFocusEnhance from '@semcore/utils/lib/enhances/autoFocusEnhance';\nimport keyboardFocusEnhance from '@semcore/utils/lib/enhances/keyboardFocusEnhance';\n\nimport style from './style/input.shadow.css';\n\nclass Input extends Component {\n static displayName = 'Input';\n\n static defaultProps = {\n size: 'm',\n state: 'normal',\n };\n static style = style;\n\n state = {\n focused: false,\n };\n\n inputRef = React.createRef();\n\n handleMouseDownAddon = (event) => {\n event.preventDefault();\n this.inputRef.current?.focus();\n };\n handleKeyDown = (event) => {\n if (event.key === 'Enter') {\n setTimeout(() => {\n if (document.activeElement === document.body) {\n this.inputRef.current?.focus();\n }\n }, 10);\n }\n };\n\n bindHandleValueFocused = (focused) => () => this.setState({ focused });\n\n getAddonProps() {\n const { disabled, size } = this.asProps;\n return {\n disabled,\n onMouseDown: this.handleMouseDownAddon,\n size,\n };\n }\n\n getValueProps() {\n const {\n size,\n disabled,\n state,\n role,\n placeholder,\n // these props might be passed from the <Select /> component\n 'aria-haspopup': ariaHaspopup,\n 'aria-controls': ariaControls,\n 'aria-expanded': ariaExpanded,\n 'aria-autocomplete': ariaAutocomplete,\n 'aria-owns': ariaOwns,\n 'aria-activedescendant': ariaActivedescendant,\n } = this.asProps;\n\n return {\n ref: this.inputRef,\n size,\n disabled,\n state,\n onFocus: this.bindHandleValueFocused(true),\n onBlur: this.bindHandleValueFocused(false),\n role,\n placeholder,\n 'aria-haspopup': ariaHaspopup,\n 'aria-controls': ariaControls,\n 'aria-expanded': ariaExpanded,\n 'aria-autocomplete': ariaAutocomplete,\n 'aria-owns': ariaOwns,\n 'aria-activedescendant': ariaActivedescendant,\n };\n }\n\n componentDidUpdate(prevProps) {\n if (prevProps.disabled !== this.asProps.disabled && this.asProps.disabled) {\n this.setState({ focused: false });\n }\n }\n\n render() {\n const SInput = Root;\n const SOutline = 'div';\n const { Children, styles, neighborLocation, controlsLength, state } = this.asProps;\n const { focused } = this.state;\n return (\n <NeighborLocation.Detect neighborLocation={neighborLocation}>\n {(neighborLocation) =>\n sstyled(styles)(\n <SInput\n render={Box}\n focused={focused}\n onKeyDown={this.handleKeyDown}\n neighborLocation={neighborLocation}\n __excludeProps={[\n 'role',\n 'aria-haspopup',\n 'aria-controls',\n 'aria-expanded',\n 'placeholder',\n 'aria-autocomplete',\n 'aria-owns',\n 'aria-activedescendant',\n 'tabIndex',\n ]}\n >\n <NeighborLocation controlsLength={controlsLength}>\n <Children />\n </NeighborLocation>\n <SOutline>{state === 'invalid' && <InvalidStateBox />}</SOutline>\n </SInput>,\n )\n }\n </NeighborLocation.Detect>\n );\n }\n}\n\nclass Value extends Component {\n static defaultProps = {\n defaultValue: '',\n };\n static enhance = [keyboardFocusEnhance(), autoFocusEnhance()];\n\n uncontrolledProps() {\n return {\n value: (e) => e.target.value,\n };\n }\n\n render() {\n const SValue = Root;\n const { styles, neighborLocation, state } = this.asProps;\n\n return (\n <NeighborLocation.Detect neighborLocation={neighborLocation}>\n {(neighborLocation) =>\n sstyled(styles)(\n <SValue\n render={Box}\n neighborLocation={neighborLocation}\n tag='input'\n type='text'\n aria-invalid={state === 'invalid'}\n />,\n )\n }\n </NeighborLocation.Detect>\n );\n }\n}\n\nfunction Addon(props) {\n const SAddon = Root;\n const { Children, styles, neighborLocation } = props;\n return (\n <NeighborLocation.Detect neighborLocation={neighborLocation}>\n {(neighborLocation) =>\n sstyled(styles)(\n <SAddon render={Box} neighborLocation={neighborLocation}>\n <Children />\n </SAddon>,\n )\n }\n </NeighborLocation.Detect>\n );\n}\n\nexport default createComponent(Input, {\n Addon,\n Value,\n});\n"],"mappings":";;;;;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,eAAe,IAAIC,SAAS,EAAEC,OAAO,EAAEC,IAAI,QAAQ,eAAe;AACzE,SAASC,GAAG,EAAEC,eAAe,QAAQ,mBAAmB;AACxD,OAAOC,gBAAgB,MAAM,4BAA4B;AACzD,OAAOC,gBAAgB,MAAM,8CAA8C;AAC3E,OAAOC,oBAAoB,MAAM,kDAAkD;AAAC;AAAA,IAAAC,KAAA,+BAAAC,QAAA,CAAAC,MAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;AAAA;AAAA,IAI9EC,KAAK,0BAAAC,UAAA;EAAAC,SAAA,CAAAF,KAAA,EAAAC,UAAA;EAAA,IAAAE,MAAA,GAAAC,YAAA,CAAAJ,KAAA;EAAA,SAAAA,MAAA;IAAA,IAAAK,KAAA;IAAAC,eAAA,OAAAN,KAAA;IAAA,SAAAO,IAAA,GAAAC,SAAA,CAAAC,MAAA,EAAAC,IAAA,OAAAC,KAAA,CAAAJ,IAAA,GAAAK,IAAA,MAAAA,IAAA,GAAAL,IAAA,EAAAK,IAAA;MAAAF,IAAA,CAAAE,IAAA,IAAAJ,SAAA,CAAAI,IAAA;IAAA;IAAAP,KAAA,GAAAF,MAAA,CAAAU,IAAA,CAAAC,KAAA,CAAAX,MAAA,SAAAY,MAAA,CAAAL,IAAA;IAAAM,eAAA,CAAAC,sBAAA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,KAAA,CAAArB,EAAA,iBAAG,CACL;EAAA,CACV,CAEqB;AAE9B;AAEA,eAAepF,eAAe,CAACY,KAAK,EAAE;EACpCwF,KAAK,EAALA,KAAK;EACLZ,KAAK,EAALA;AACF,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import React from 'react';\nimport { Intergalactic, PropGetterFn, UnknownProperties } from '@semcore/core';\nimport { BoxProps } from '@semcore/flex-box';\nimport { NeighborItemProps, NeighborLocationProps } from '@semcore/neighbor-location';\nimport { WithAutoFocusEnhanceProps } from '@semcore/utils/lib/enhances/autoFocusEnhance';\n\nexport type InputSize = 'm' | 'l';\n\n/** @deprecated */\nexport interface IInputProps extends InputProps, UnknownProperties {}\nexport type InputProps = BoxProps &\n NeighborItemProps &\n NeighborLocationProps & {\n /**\n * Sets the input and addons to the disabled state\n * */\n disabled?: boolean;\n /**\n * Input size\n * @default m\n */\n size?: InputSize;\n /**\n * Sets the input state\n * @default normal\n */\n state?: 'normal' | 'invalid' | 'valid';\n };\n\n/** @deprecated */\nexport interface IInputValueProps extends InputValueProps, UnknownProperties {}\nexport type InputValueProps = BoxProps &\n NeighborItemProps &\n WithAutoFocusEnhanceProps & {\n /**\n * Input value\n */\n value?: string;\n /**\n * Default value if `value` property is not provided\n */\n defaultValue?: string;\n /**\n * Handler for changing the value\n */\n onChange?: (value: string, event: React.SyntheticEvent<HTMLInputElement>) => void;\n /**\n * @deprecated Set `disabled` on `Input` instead.\n * */\n disabled?: boolean;\n /**\n * Sets the input to the read-only state\n * */\n readOnly?: boolean;\n /**\n * Input size\n * @default m\n */\n size?: InputSize;\n /**\n * Placeholder for input\n */\n placeholder?: string;\n };\n\n/** @deprecated */\nexport interface IInputAddonProps extends InputAddonProps, UnknownProperties {}\nexport type InputAddonProps = BoxProps &\n NeighborItemProps & {\n /**\n * Adds styles for interactive icons\n */\n interactive?: boolean;\n /**\n * Blocks the addon\n * */\n disabled?: boolean;\n /**\n * Input size\n * @default m\n */\n size?: InputSize;\n };\n\n/** @deprecated */\nexport interface IInputCtx extends InputCtx, UnknownProperties {}\nexport type InputCtx = {\n getValueProps: PropGetterFn;\n getAddonProps: PropGetterFn;\n};\n\ndeclare const Input: Intergalactic.Component<'div', InputProps, InputCtx> & {\n Value: Intergalactic.Component<'input', InputValueProps>;\n Addon: Intergalactic.Component<'div', InputAddonProps>;\n};\nexport default Input;\n"],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { default } from './Input';
|
|
2
|
-
//# sourceMappingURL=index.
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["default"],"sources":["../../src/index.js"],"sourcesContent":["export { default } from './Input';\n"],"mappings":"AAAA,SAASA,OAAO,QAAQ,SAAS"}
|
package/package.json
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@semcore/input",
|
|
3
3
|
"description": "Semrush Input Component",
|
|
4
|
-
"version": "4.41.0",
|
|
4
|
+
"version": "4.41.1-prerelease.0",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
|
-
"module": "lib/es6/index.
|
|
6
|
+
"module": "lib/es6/index.js",
|
|
7
7
|
"typings": "lib/types/index.d.ts",
|
|
8
8
|
"sideEffects": false,
|
|
9
9
|
"author": "UI-kit team <ui-kit-team@semrush.com>",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@semcore/utils": "4.45.0",
|
|
13
|
-
"@semcore/neighbor-location": "4.38.0",
|
|
14
|
-
"@semcore/flex-box": "5.40.0"
|
|
12
|
+
"@semcore/utils": "4.45.1-prerelease.0",
|
|
13
|
+
"@semcore/neighbor-location": "4.38.1-prerelease.0",
|
|
14
|
+
"@semcore/flex-box": "5.40.1-prerelease.0"
|
|
15
15
|
},
|
|
16
16
|
"peerDependencies": {
|
|
17
|
-
"@semcore/core": "^2.
|
|
17
|
+
"@semcore/core": "^2.38.1-prerelease.0",
|
|
18
18
|
"react": "16.8 - 18",
|
|
19
19
|
"react-dom": "16.8 - 18"
|
|
20
20
|
},
|
package/lib/es6/Input.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Input.mjs","names":["React","createComponent","Component","sstyled","Root","Box","InvalidStateBox","NeighborLocation","autoFocusEnhance","keyboardFocusEnhance","style","_sstyled","insert","Input","_Component","_inherits","_super","_createSuper","_this","_classCallCheck","_len","arguments","length","args","Array","_key","call","apply","concat","_defineProperty","_assertThisInitialized","focused","createRef","event","_this$inputRef$curren","preventDefault","inputRef","current","focus","key","setTimeout","document","activeElement","body","_this$inputRef$curren2","setState","_createClass","value","getAddonProps","_this$asProps","asProps","disabled","size","onMouseDown","handleMouseDownAddon","getValueProps","_this$asProps2","state","role","placeholder","ariaHaspopup","ariaControls","ariaExpanded","ariaAutocomplete","ariaOwns","ariaActivedescendant","ref","onFocus","bindHandleValueFocused","onBlur","componentDidUpdate","prevProps","render","_ref","_this2","SInput","SOutline","_this$asProps3","Children","styles","neighborLocation","controlsLength","createElement","Detect","_ref4","cn","_objectSpread","_assignProps","handleKeyDown","Value","_Component2","_super2","uncontrolledProps","e","target","_ref2","SValue","_this$asProps4","_ref5","_assignProps2","defaultValue","Addon","props","_ref3","arguments[0]","SAddon","_ref6","_assignProps3"],"sources":["../../src/Input.jsx"],"sourcesContent":["import React from 'react';\nimport createComponent, { Component, sstyled, Root } from '@semcore/core';\nimport { Box, InvalidStateBox } from '@semcore/flex-box';\nimport NeighborLocation from '@semcore/neighbor-location';\nimport autoFocusEnhance from '@semcore/utils/lib/enhances/autoFocusEnhance';\nimport keyboardFocusEnhance from '@semcore/utils/lib/enhances/keyboardFocusEnhance';\n\nimport style from './style/input.shadow.css';\n\nclass Input extends Component {\n static displayName = 'Input';\n\n static defaultProps = {\n size: 'm',\n state: 'normal',\n };\n static style = style;\n\n state = {\n focused: false,\n };\n\n inputRef = React.createRef();\n\n handleMouseDownAddon = (event) => {\n event.preventDefault();\n this.inputRef.current?.focus();\n };\n handleKeyDown = (event) => {\n if (event.key === 'Enter') {\n setTimeout(() => {\n if (document.activeElement === document.body) {\n this.inputRef.current?.focus();\n }\n }, 10);\n }\n };\n\n bindHandleValueFocused = (focused) => () => this.setState({ focused });\n\n getAddonProps() {\n const { disabled, size } = this.asProps;\n return {\n disabled,\n onMouseDown: this.handleMouseDownAddon,\n size,\n };\n }\n\n getValueProps() {\n const {\n size,\n disabled,\n state,\n role,\n placeholder,\n // these props might be passed from the <Select /> component\n 'aria-haspopup': ariaHaspopup,\n 'aria-controls': ariaControls,\n 'aria-expanded': ariaExpanded,\n 'aria-autocomplete': ariaAutocomplete,\n 'aria-owns': ariaOwns,\n 'aria-activedescendant': ariaActivedescendant,\n } = this.asProps;\n\n return {\n ref: this.inputRef,\n size,\n disabled,\n state,\n onFocus: this.bindHandleValueFocused(true),\n onBlur: this.bindHandleValueFocused(false),\n role,\n placeholder,\n 'aria-haspopup': ariaHaspopup,\n 'aria-controls': ariaControls,\n 'aria-expanded': ariaExpanded,\n 'aria-autocomplete': ariaAutocomplete,\n 'aria-owns': ariaOwns,\n 'aria-activedescendant': ariaActivedescendant,\n };\n }\n\n componentDidUpdate(prevProps) {\n if (prevProps.disabled !== this.asProps.disabled && this.asProps.disabled) {\n this.setState({ focused: false });\n }\n }\n\n render() {\n const SInput = Root;\n const SOutline = 'div';\n const { Children, styles, neighborLocation, controlsLength, state } = this.asProps;\n const { focused } = this.state;\n return (\n <NeighborLocation.Detect neighborLocation={neighborLocation}>\n {(neighborLocation) =>\n sstyled(styles)(\n <SInput\n render={Box}\n focused={focused}\n onKeyDown={this.handleKeyDown}\n neighborLocation={neighborLocation}\n __excludeProps={[\n 'role',\n 'aria-haspopup',\n 'aria-controls',\n 'aria-expanded',\n 'placeholder',\n 'aria-autocomplete',\n 'aria-owns',\n 'aria-activedescendant',\n 'tabIndex',\n ]}\n >\n <NeighborLocation controlsLength={controlsLength}>\n <Children />\n </NeighborLocation>\n <SOutline>{state === 'invalid' && <InvalidStateBox />}</SOutline>\n </SInput>,\n )\n }\n </NeighborLocation.Detect>\n );\n }\n}\n\nclass Value extends Component {\n static defaultProps = {\n defaultValue: '',\n };\n static enhance = [keyboardFocusEnhance(), autoFocusEnhance()];\n\n uncontrolledProps() {\n return {\n value: (e) => e.target.value,\n };\n }\n\n render() {\n const SValue = Root;\n const { styles, neighborLocation, state } = this.asProps;\n\n return (\n <NeighborLocation.Detect neighborLocation={neighborLocation}>\n {(neighborLocation) =>\n sstyled(styles)(\n <SValue\n render={Box}\n neighborLocation={neighborLocation}\n tag='input'\n type='text'\n aria-invalid={state === 'invalid'}\n />,\n )\n }\n </NeighborLocation.Detect>\n );\n }\n}\n\nfunction Addon(props) {\n const SAddon = Root;\n const { Children, styles, neighborLocation } = props;\n return (\n <NeighborLocation.Detect neighborLocation={neighborLocation}>\n {(neighborLocation) =>\n sstyled(styles)(\n <SAddon render={Box} neighborLocation={neighborLocation}>\n <Children />\n </SAddon>,\n )\n }\n </NeighborLocation.Detect>\n );\n}\n\nexport default createComponent(Input, {\n Addon,\n Value,\n});\n"],"mappings":";;;;;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,eAAe,IAAIC,SAAS,EAAEC,OAAO,EAAEC,IAAI,QAAQ,eAAe;AACzE,SAASC,GAAG,EAAEC,eAAe,QAAQ,mBAAmB;AACxD,OAAOC,gBAAgB,MAAM,4BAA4B;AACzD,OAAOC,gBAAgB,MAAM,8CAA8C;AAC3E,OAAOC,oBAAoB,MAAM,kDAAkD;AAAC;AAAA,IAAAC,KAAA,+BAAAC,QAAA,CAAAC,MAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;AAAA;AAAA,IAI9EC,KAAK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CAA5CxB,QAAQ;IAAEC,MAAM,GAAuBuB,KAAK,CAAlCvB,MAAM;IAAEC,gBAAgB,GAAKsB,KAAK,CAA1BtB,gBAAgB;EAC1C,oBACEhF,KAAA,CAAAkF,aAAA,CAAC3E,gBAAgB,CAAC4E,MAAM;IAACH,gBAAgB,EAAEA;EAAiB,GACzD,UAACA,gBAAgB;IAAA,IAAA0B,KAAA;IAAA,OAAAA,KAAA,GAChBvG,OAAO,CAAC4E,MAAM,CAAC,eACb/E,KAAA,CAAAkF,aAAA,CAACuB,MAAM,EAAAC,KAAA,CAAArB,EAAA,WAAAC,aAAA,KAAAqB,aAAA;MAAA,oBAAgC3B;IAAgB,GAAAuB,KAAA,kBACrDvG,KAAA,CAAAkF,aAAA,CAACJ,QAAQ,EAAA4B,KAAA,CAAArB,EAAA,iBAAG,CACL;EAAA,CACV,CAEqB;AAE9B;AAEA,eAAepF,eAAe,CAACY,KAAK,EAAE;EACpCwF,KAAK,EAALA,KAAK;EACLZ,KAAK,EAALA;AACF,CAAC,CAAC"}
|
package/lib/es6/index.d.mjs
DELETED
package/lib/es6/index.d.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mjs","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import React from 'react';\nimport { Intergalactic, PropGetterFn, UnknownProperties } from '@semcore/core';\nimport { BoxProps } from '@semcore/flex-box';\nimport { NeighborItemProps, NeighborLocationProps } from '@semcore/neighbor-location';\nimport { WithAutoFocusEnhanceProps } from '@semcore/utils/lib/enhances/autoFocusEnhance';\n\nexport type InputSize = 'm' | 'l';\n\n/** @deprecated */\nexport interface IInputProps extends InputProps, UnknownProperties {}\nexport type InputProps = BoxProps &\n NeighborItemProps &\n NeighborLocationProps & {\n /**\n * Sets the input and addons to the disabled state\n * */\n disabled?: boolean;\n /**\n * Input size\n * @default m\n */\n size?: InputSize;\n /**\n * Sets the input state\n * @default normal\n */\n state?: 'normal' | 'invalid' | 'valid';\n };\n\n/** @deprecated */\nexport interface IInputValueProps extends InputValueProps, UnknownProperties {}\nexport type InputValueProps = BoxProps &\n NeighborItemProps &\n WithAutoFocusEnhanceProps & {\n /**\n * Input value\n */\n value?: string;\n /**\n * Default value if `value` property is not provided\n */\n defaultValue?: string;\n /**\n * Handler for changing the value\n */\n onChange?: (value: string, event: React.SyntheticEvent<HTMLInputElement>) => void;\n /**\n * @deprecated Set `disabled` on `Input` instead.\n * */\n disabled?: boolean;\n /**\n * Sets the input to the read-only state\n * */\n readOnly?: boolean;\n /**\n * Input size\n * @default m\n */\n size?: InputSize;\n /**\n * Placeholder for input\n */\n placeholder?: string;\n };\n\n/** @deprecated */\nexport interface IInputAddonProps extends InputAddonProps, UnknownProperties {}\nexport type InputAddonProps = BoxProps &\n NeighborItemProps & {\n /**\n * Adds styles for interactive icons\n */\n interactive?: boolean;\n /**\n * Blocks the addon\n * */\n disabled?: boolean;\n /**\n * Input size\n * @default m\n */\n size?: InputSize;\n };\n\n/** @deprecated */\nexport interface IInputCtx extends InputCtx, UnknownProperties {}\nexport type InputCtx = {\n getValueProps: PropGetterFn;\n getAddonProps: PropGetterFn;\n};\n\ndeclare const Input: Intergalactic.Component<'div', InputProps, InputCtx> & {\n Value: Intergalactic.Component<'input', InputValueProps>;\n Addon: Intergalactic.Component<'div', InputAddonProps>;\n};\nexport default Input;\n"],"mappings":""}
|
package/lib/es6/index.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["default"],"sources":["../../src/index.js"],"sourcesContent":["export { default } from './Input';\n"],"mappings":"AAAA,SAASA,OAAO,QAAQ,SAAS"}
|