@semcore/input 3.7.2 → 4.0.0-beta.1
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 +3 -3
- package/lib/cjs/Input.js +17 -17
- package/lib/cjs/index.d.js.map +1 -1
- package/lib/es6/Input.js +17 -17
- package/lib/es6/index.d.js.map +1 -1
- package/lib/types/index.d.ts +79 -76
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangelog.com/en/1.0.0/).
|
|
4
4
|
|
|
5
|
-
## [
|
|
5
|
+
## [4.0.0] - 2023-07-15
|
|
6
6
|
|
|
7
|
-
###
|
|
7
|
+
### Break
|
|
8
8
|
|
|
9
|
-
-
|
|
9
|
+
- Strict, backward incompatible typings.
|
|
10
10
|
|
|
11
11
|
## [3.7.1] - 2023-06-27
|
|
12
12
|
|
package/lib/cjs/Input.js
CHANGED
|
@@ -20,23 +20,23 @@ var _neighborLocation = _interopRequireDefault(require("@semcore/neighbor-locati
|
|
|
20
20
|
var _autoFocusEnhance = _interopRequireDefault(require("@semcore/utils/lib/enhances/autoFocusEnhance"));
|
|
21
21
|
var _keyboardFocusEnhance = _interopRequireDefault(require("@semcore/utils/lib/enhances/keyboardFocusEnhance"));
|
|
22
22
|
/*__reshadow-styles__:"./style/input.shadow.css"*/
|
|
23
|
-
var style = ( /*__reshadow_css_start__*/_core.sstyled.insert( /*__inner_css_start__*/".
|
|
24
|
-
"__SInput": "
|
|
25
|
-
"__SOutline": "
|
|
26
|
-
"__SValue": "
|
|
27
|
-
"__SAddon": "
|
|
28
|
-
"_interactive": "
|
|
29
|
-
"_disabled": "
|
|
30
|
-
"_size_m": "
|
|
31
|
-
"__SButton": "
|
|
32
|
-
"_size_l": "
|
|
33
|
-
"_focused": "
|
|
34
|
-
"_state_normal": "
|
|
35
|
-
"_state_valid": "
|
|
36
|
-
"_state_invalid": "
|
|
37
|
-
"_neighborLocation_right": "
|
|
38
|
-
"_neighborLocation_both": "
|
|
39
|
-
"_neighborLocation_left": "
|
|
23
|
+
var style = ( /*__reshadow_css_start__*/_core.sstyled.insert( /*__inner_css_start__*/".___SInput_9ltgi_gg_{display:inline-flex;width:100%;align-items:center;position:relative;z-index:0;vertical-align:middle;padding:1px;box-sizing:border-box}.___SInput_9ltgi_gg_ input:-webkit-autofill{border-radius:var(--intergalactic-control-rounded, 6px);-webkit-box-shadow:0 0 0 30px #faffbd inset}.___SInput_9ltgi_gg_ input:-webkit-autofill~.___SOutline_9ltgi_gg_{background-color:#faffbd}.___SValue_9ltgi_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_9ltgi_gg_:focus{outline:0}.___SValue_9ltgi_gg_::-moz-placeholder{color:var(--intergalactic-text-placeholder, #8a8e9b)}.___SValue_9ltgi_gg_::placeholder{color:var(--intergalactic-text-placeholder, #8a8e9b)}.___SValue_9ltgi_gg_:not(:disabled):-moz-read-only~.___SOutline_9ltgi_gg_{background:var(--intergalactic-bg-secondary-neutral, #f4f5f9)}.___SValue_9ltgi_gg_:not(:disabled):read-only~.___SOutline_9ltgi_gg_{background:var(--intergalactic-bg-secondary-neutral, #f4f5f9)}.___SValue_9ltgi_gg_:disabled{-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--intergalactic-disabled-opacity, 0.3)}.___SValue_9ltgi_gg_:disabled~.___SOutline_9ltgi_gg_{opacity:var(--intergalactic-disabled-opacity, 0.3);cursor:default;pointer-events:none}.___SOutline_9ltgi_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_9ltgi_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_9ltgi_gg_.__interactive_9ltgi_gg_{cursor:pointer}@media (hover:hover){.___SAddon_9ltgi_gg_.__interactive_9ltgi_gg_:hover{color:var(--intergalactic-icon-secondary-neutral-hover-active, #8a8e9b)}}.___SAddon_9ltgi_gg_.__disabled_9ltgi_gg_{opacity:var(--intergalactic-disabled-opacity, 0.3);cursor:default;pointer-events:none}.___SAddon_9ltgi_gg_._size_m_9ltgi_gg_:not(.___SButton_9ltgi_gg_){padding:0 var(--intergalactic-spacing-2x, 8px)}.___SAddon_9ltgi_gg_._size_l_9ltgi_gg_:not(.___SButton_9ltgi_gg_){padding:0 var(--intergalactic-spacing-3x, 12px)}.___SInput_9ltgi_gg_ .___SAddon_9ltgi_gg_:nth-last-child(2){margin-right:-1px}.___SValue_9ltgi_gg_._size_m_9ltgi_gg_{padding:0 var(--intergalactic-spacing-2x, 8px)}.___SValue_9ltgi_gg_._size_l_9ltgi_gg_{padding:0 var(--intergalactic-spacing-3x, 12px)}.___SInput_9ltgi_gg_._size_m_9ltgi_gg_{font-size:var(--intergalactic-fs-200, 14px);height:var(--intergalactic-form-control-m, 28px)}.___SInput_9ltgi_gg_._size_l_9ltgi_gg_{font-size:var(--intergalactic-fs-300, 16px);height:var(--intergalactic-form-control-l, 40px)}.___SInput_9ltgi_gg_.__focused_9ltgi_gg_{z-index:1}.___SInput_9ltgi_gg_._state_normal_9ltgi_gg_ .___SOutline_9ltgi_gg_{border-color:var(--intergalactic-border-primary, #c4c7cf)}.___SInput_9ltgi_gg_._state_normal_9ltgi_gg_.__focused_9ltgi_gg_ .___SOutline_9ltgi_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_9ltgi_gg_._state_valid_9ltgi_gg_ .___SOutline_9ltgi_gg_{border-color:var(--intergalactic-border-success-active, #007c65)}.___SInput_9ltgi_gg_._state_valid_9ltgi_gg_.__focused_9ltgi_gg_ .___SOutline_9ltgi_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_9ltgi_gg_._state_invalid_9ltgi_gg_ .___SOutline_9ltgi_gg_{border-color:var(--intergalactic-border-critical-active, #d1002f)}.___SInput_9ltgi_gg_._state_invalid_9ltgi_gg_.__focused_9ltgi_gg_ .___SOutline_9ltgi_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_9ltgi_gg_._neighborLocation_right_9ltgi_gg_ .___SOutline_9ltgi_gg_{border-top-right-radius:0;border-bottom-right-radius:0}.___SInput_9ltgi_gg_._neighborLocation_both_9ltgi_gg_ .___SOutline_9ltgi_gg_{border-radius:0;border-left:none}.___SInput_9ltgi_gg_._neighborLocation_left_9ltgi_gg_ .___SOutline_9ltgi_gg_{border-top-left-radius:0;border-bottom-left-radius:0;border-left:none}.___SValue_9ltgi_gg_._neighborLocation_right_9ltgi_gg_{padding-right:0}.___SValue_9ltgi_gg_._neighborLocation_both_9ltgi_gg_{padding-left:0;padding-right:0}.___SValue_9ltgi_gg_._neighborLocation_left_9ltgi_gg_{padding-left:0}" /*__inner_css_end__*/, "9ltgi_gg_") /*__reshadow_css_end__*/, {
|
|
24
|
+
"__SInput": "___SInput_9ltgi_gg_",
|
|
25
|
+
"__SOutline": "___SOutline_9ltgi_gg_",
|
|
26
|
+
"__SValue": "___SValue_9ltgi_gg_",
|
|
27
|
+
"__SAddon": "___SAddon_9ltgi_gg_",
|
|
28
|
+
"_interactive": "__interactive_9ltgi_gg_",
|
|
29
|
+
"_disabled": "__disabled_9ltgi_gg_",
|
|
30
|
+
"_size_m": "_size_m_9ltgi_gg_",
|
|
31
|
+
"__SButton": "___SButton_9ltgi_gg_",
|
|
32
|
+
"_size_l": "_size_l_9ltgi_gg_",
|
|
33
|
+
"_focused": "__focused_9ltgi_gg_",
|
|
34
|
+
"_state_normal": "_state_normal_9ltgi_gg_",
|
|
35
|
+
"_state_valid": "_state_valid_9ltgi_gg_",
|
|
36
|
+
"_state_invalid": "_state_invalid_9ltgi_gg_",
|
|
37
|
+
"_neighborLocation_right": "_neighborLocation_right_9ltgi_gg_",
|
|
38
|
+
"_neighborLocation_both": "_neighborLocation_both_9ltgi_gg_",
|
|
39
|
+
"_neighborLocation_left": "_neighborLocation_left_9ltgi_gg_"
|
|
40
40
|
});
|
|
41
41
|
var Input = /*#__PURE__*/function (_Component) {
|
|
42
42
|
(0, _inherits2["default"])(Input, _Component);
|
package/lib/cjs/index.d.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import React from 'react';\nimport { PropGetterFn } from '@semcore/core';\nimport {
|
|
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 { INeighborItemProps, NeighborLocationProps } from '@semcore/neighbor-location';\nimport { IWithAutoFocusEnhanceProps } 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 INeighborItemProps &\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 INeighborItemProps &\n IWithAutoFocusEnhanceProps & {\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 * Sets the input to the disabled state\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\n/** @deprecated */\nexport interface IInputAddonProps extends InputAddonProps, UnknownProperties {}\nexport type InputAddonProps = BoxProps &\n INeighborItemProps & {\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/Input.js
CHANGED
|
@@ -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
|
-
"__SOutline": "
|
|
22
|
-
"__SValue": "
|
|
23
|
-
"__SAddon": "
|
|
24
|
-
"_interactive": "
|
|
25
|
-
"_disabled": "
|
|
26
|
-
"_size_m": "
|
|
27
|
-
"__SButton": "
|
|
28
|
-
"_size_l": "
|
|
29
|
-
"_focused": "
|
|
30
|
-
"_state_normal": "
|
|
31
|
-
"_state_valid": "
|
|
32
|
-
"_state_invalid": "
|
|
33
|
-
"_neighborLocation_right": "
|
|
34
|
-
"_neighborLocation_both": "
|
|
35
|
-
"_neighborLocation_left": "
|
|
19
|
+
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".___SInput_9ltgi_gg_{display:inline-flex;width:100%;align-items:center;position:relative;z-index:0;vertical-align:middle;padding:1px;box-sizing:border-box}.___SInput_9ltgi_gg_ input:-webkit-autofill{border-radius:var(--intergalactic-control-rounded, 6px);-webkit-box-shadow:0 0 0 30px #faffbd inset}.___SInput_9ltgi_gg_ input:-webkit-autofill~.___SOutline_9ltgi_gg_{background-color:#faffbd}.___SValue_9ltgi_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_9ltgi_gg_:focus{outline:0}.___SValue_9ltgi_gg_::-moz-placeholder{color:var(--intergalactic-text-placeholder, #8a8e9b)}.___SValue_9ltgi_gg_::placeholder{color:var(--intergalactic-text-placeholder, #8a8e9b)}.___SValue_9ltgi_gg_:not(:disabled):-moz-read-only~.___SOutline_9ltgi_gg_{background:var(--intergalactic-bg-secondary-neutral, #f4f5f9)}.___SValue_9ltgi_gg_:not(:disabled):read-only~.___SOutline_9ltgi_gg_{background:var(--intergalactic-bg-secondary-neutral, #f4f5f9)}.___SValue_9ltgi_gg_:disabled{-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--intergalactic-disabled-opacity, 0.3)}.___SValue_9ltgi_gg_:disabled~.___SOutline_9ltgi_gg_{opacity:var(--intergalactic-disabled-opacity, 0.3);cursor:default;pointer-events:none}.___SOutline_9ltgi_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_9ltgi_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_9ltgi_gg_.__interactive_9ltgi_gg_{cursor:pointer}@media (hover:hover){.___SAddon_9ltgi_gg_.__interactive_9ltgi_gg_:hover{color:var(--intergalactic-icon-secondary-neutral-hover-active, #8a8e9b)}}.___SAddon_9ltgi_gg_.__disabled_9ltgi_gg_{opacity:var(--intergalactic-disabled-opacity, 0.3);cursor:default;pointer-events:none}.___SAddon_9ltgi_gg_._size_m_9ltgi_gg_:not(.___SButton_9ltgi_gg_){padding:0 var(--intergalactic-spacing-2x, 8px)}.___SAddon_9ltgi_gg_._size_l_9ltgi_gg_:not(.___SButton_9ltgi_gg_){padding:0 var(--intergalactic-spacing-3x, 12px)}.___SInput_9ltgi_gg_ .___SAddon_9ltgi_gg_:nth-last-child(2){margin-right:-1px}.___SValue_9ltgi_gg_._size_m_9ltgi_gg_{padding:0 var(--intergalactic-spacing-2x, 8px)}.___SValue_9ltgi_gg_._size_l_9ltgi_gg_{padding:0 var(--intergalactic-spacing-3x, 12px)}.___SInput_9ltgi_gg_._size_m_9ltgi_gg_{font-size:var(--intergalactic-fs-200, 14px);height:var(--intergalactic-form-control-m, 28px)}.___SInput_9ltgi_gg_._size_l_9ltgi_gg_{font-size:var(--intergalactic-fs-300, 16px);height:var(--intergalactic-form-control-l, 40px)}.___SInput_9ltgi_gg_.__focused_9ltgi_gg_{z-index:1}.___SInput_9ltgi_gg_._state_normal_9ltgi_gg_ .___SOutline_9ltgi_gg_{border-color:var(--intergalactic-border-primary, #c4c7cf)}.___SInput_9ltgi_gg_._state_normal_9ltgi_gg_.__focused_9ltgi_gg_ .___SOutline_9ltgi_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_9ltgi_gg_._state_valid_9ltgi_gg_ .___SOutline_9ltgi_gg_{border-color:var(--intergalactic-border-success-active, #007c65)}.___SInput_9ltgi_gg_._state_valid_9ltgi_gg_.__focused_9ltgi_gg_ .___SOutline_9ltgi_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_9ltgi_gg_._state_invalid_9ltgi_gg_ .___SOutline_9ltgi_gg_{border-color:var(--intergalactic-border-critical-active, #d1002f)}.___SInput_9ltgi_gg_._state_invalid_9ltgi_gg_.__focused_9ltgi_gg_ .___SOutline_9ltgi_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_9ltgi_gg_._neighborLocation_right_9ltgi_gg_ .___SOutline_9ltgi_gg_{border-top-right-radius:0;border-bottom-right-radius:0}.___SInput_9ltgi_gg_._neighborLocation_both_9ltgi_gg_ .___SOutline_9ltgi_gg_{border-radius:0;border-left:none}.___SInput_9ltgi_gg_._neighborLocation_left_9ltgi_gg_ .___SOutline_9ltgi_gg_{border-top-left-radius:0;border-bottom-left-radius:0;border-left:none}.___SValue_9ltgi_gg_._neighborLocation_right_9ltgi_gg_{padding-right:0}.___SValue_9ltgi_gg_._neighborLocation_both_9ltgi_gg_{padding-left:0;padding-right:0}.___SValue_9ltgi_gg_._neighborLocation_left_9ltgi_gg_{padding-left:0}" /*__inner_css_end__*/, "9ltgi_gg_") /*__reshadow_css_end__*/, {
|
|
20
|
+
"__SInput": "___SInput_9ltgi_gg_",
|
|
21
|
+
"__SOutline": "___SOutline_9ltgi_gg_",
|
|
22
|
+
"__SValue": "___SValue_9ltgi_gg_",
|
|
23
|
+
"__SAddon": "___SAddon_9ltgi_gg_",
|
|
24
|
+
"_interactive": "__interactive_9ltgi_gg_",
|
|
25
|
+
"_disabled": "__disabled_9ltgi_gg_",
|
|
26
|
+
"_size_m": "_size_m_9ltgi_gg_",
|
|
27
|
+
"__SButton": "___SButton_9ltgi_gg_",
|
|
28
|
+
"_size_l": "_size_l_9ltgi_gg_",
|
|
29
|
+
"_focused": "__focused_9ltgi_gg_",
|
|
30
|
+
"_state_normal": "_state_normal_9ltgi_gg_",
|
|
31
|
+
"_state_valid": "_state_valid_9ltgi_gg_",
|
|
32
|
+
"_state_invalid": "_state_invalid_9ltgi_gg_",
|
|
33
|
+
"_neighborLocation_right": "_neighborLocation_right_9ltgi_gg_",
|
|
34
|
+
"_neighborLocation_both": "_neighborLocation_both_9ltgi_gg_",
|
|
35
|
+
"_neighborLocation_left": "_neighborLocation_left_9ltgi_gg_"
|
|
36
36
|
});
|
|
37
37
|
var Input = /*#__PURE__*/function (_Component) {
|
|
38
38
|
_inherits(Input, _Component);
|
package/lib/es6/index.d.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import React from 'react';\nimport { PropGetterFn } from '@semcore/core';\nimport {
|
|
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 { INeighborItemProps, NeighborLocationProps } from '@semcore/neighbor-location';\nimport { IWithAutoFocusEnhanceProps } 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 INeighborItemProps &\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 INeighborItemProps &\n IWithAutoFocusEnhanceProps & {\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 * Sets the input to the disabled state\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\n/** @deprecated */\nexport interface IInputAddonProps extends InputAddonProps, UnknownProperties {}\nexport type InputAddonProps = BoxProps &\n INeighborItemProps & {\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/types/index.d.ts
CHANGED
|
@@ -1,89 +1,92 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { PropGetterFn } from '@semcore/core';
|
|
3
|
-
import {
|
|
4
|
-
import { INeighborItemProps,
|
|
2
|
+
import { Intergalactic, PropGetterFn, UnknownProperties } from '@semcore/core';
|
|
3
|
+
import { BoxProps } from '@semcore/flex-box';
|
|
4
|
+
import { INeighborItemProps, NeighborLocationProps } from '@semcore/neighbor-location';
|
|
5
5
|
import { IWithAutoFocusEnhanceProps } from '@semcore/utils/lib/enhances/autoFocusEnhance';
|
|
6
6
|
|
|
7
|
-
/* utils type */
|
|
8
|
-
type CProps<Props, Ctx = {}, UCProps = {}> = Props & {
|
|
9
|
-
children?: ((props: Props & Ctx, handlers: UCProps) => React.ReactNode) | React.ReactNode;
|
|
10
|
-
};
|
|
11
|
-
type ReturnEl = React.ReactElement | null;
|
|
12
|
-
/* utils type */
|
|
13
|
-
|
|
14
7
|
export type InputSize = 'm' | 'l';
|
|
15
8
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
9
|
+
/** @deprecated */
|
|
10
|
+
export interface IInputProps extends InputProps, UnknownProperties {}
|
|
11
|
+
export type InputProps = BoxProps &
|
|
12
|
+
INeighborItemProps &
|
|
13
|
+
NeighborLocationProps & {
|
|
14
|
+
/**
|
|
15
|
+
* Sets the input and addons to the disabled state
|
|
16
|
+
* */
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Input size
|
|
20
|
+
* @default m
|
|
21
|
+
*/
|
|
22
|
+
size?: InputSize;
|
|
23
|
+
/**
|
|
24
|
+
* Sets the input state
|
|
25
|
+
* @default normal
|
|
26
|
+
*/
|
|
27
|
+
state?: 'normal' | 'invalid' | 'valid';
|
|
28
|
+
};
|
|
32
29
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
30
|
+
/** @deprecated */
|
|
31
|
+
export interface IInputValueProps extends InputValueProps, UnknownProperties {}
|
|
32
|
+
export type InputValueProps = BoxProps &
|
|
33
|
+
INeighborItemProps &
|
|
34
|
+
IWithAutoFocusEnhanceProps & {
|
|
35
|
+
/**
|
|
36
|
+
* Input value
|
|
37
|
+
*/
|
|
38
|
+
value?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Default value if `value` property is not provided
|
|
41
|
+
*/
|
|
42
|
+
defaultValue?: string;
|
|
43
|
+
/**
|
|
44
|
+
* Handler for changing the value
|
|
45
|
+
*/
|
|
46
|
+
onChange?: (value: string, event: React.SyntheticEvent<HTMLInputElement>) => void;
|
|
47
|
+
/**
|
|
48
|
+
* Sets the input to the disabled state
|
|
49
|
+
* */
|
|
50
|
+
disabled?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Sets the input to the read-only state
|
|
53
|
+
* */
|
|
54
|
+
readOnly?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Input size
|
|
57
|
+
* @default m
|
|
58
|
+
*/
|
|
59
|
+
size?: InputSize;
|
|
60
|
+
};
|
|
63
61
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
62
|
+
/** @deprecated */
|
|
63
|
+
export interface IInputAddonProps extends InputAddonProps, UnknownProperties {}
|
|
64
|
+
export type InputAddonProps = BoxProps &
|
|
65
|
+
INeighborItemProps & {
|
|
66
|
+
/**
|
|
67
|
+
* Adds styles for interactive icons
|
|
68
|
+
*/
|
|
69
|
+
interactive?: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Blocks the addon
|
|
72
|
+
* */
|
|
73
|
+
disabled?: boolean;
|
|
74
|
+
/**
|
|
75
|
+
* Input size
|
|
76
|
+
* @default m
|
|
77
|
+
*/
|
|
78
|
+
size?: InputSize;
|
|
79
|
+
};
|
|
79
80
|
|
|
80
|
-
|
|
81
|
+
/** @deprecated */
|
|
82
|
+
export interface IInputCtx extends InputCtx, UnknownProperties {}
|
|
83
|
+
export type InputCtx = {
|
|
81
84
|
getValueProps: PropGetterFn;
|
|
82
85
|
getAddonProps: PropGetterFn;
|
|
83
|
-
}
|
|
86
|
+
};
|
|
84
87
|
|
|
85
|
-
declare const Input:
|
|
86
|
-
Value: <
|
|
87
|
-
Addon: <
|
|
88
|
+
declare const Input: Intergalactic.Component<'div', InputProps, InputCtx> & {
|
|
89
|
+
Value: Intergalactic.Component<'input', InputValueProps>;
|
|
90
|
+
Addon: Intergalactic.Component<'div', InputAddonProps>;
|
|
88
91
|
};
|
|
89
92
|
export default Input;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@semcore/input",
|
|
3
3
|
"description": "Semrush Input Component",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "4.0.0-beta.1",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/es6/index.js",
|
|
7
7
|
"typings": "lib/types/index.d.ts",
|
|
@@ -9,12 +9,12 @@
|
|
|
9
9
|
"author": "UI-kit team <ui-kit-team@semrush.com>",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@semcore/utils": "
|
|
13
|
-
"@semcore/neighbor-location": "
|
|
14
|
-
"@semcore/flex-box": "
|
|
12
|
+
"@semcore/utils": "4.0.0-beta.1",
|
|
13
|
+
"@semcore/neighbor-location": "4.0.0-beta.1",
|
|
14
|
+
"@semcore/flex-box": "5.0.0-beta.1"
|
|
15
15
|
},
|
|
16
16
|
"peerDependencies": {
|
|
17
|
-
"@semcore/core": "
|
|
17
|
+
"@semcore/core": "2.0.0-beta.1",
|
|
18
18
|
"react": "16.8 - 18",
|
|
19
19
|
"react-dom": "16.8 - 18"
|
|
20
20
|
},
|