@semcore/inline-input 3.0.23 → 3.0.25

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 CHANGED
@@ -2,89 +2,11 @@
2
2
 
3
3
  CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangelog.com/en/1.0.0/).
4
4
 
5
- ## [3.0.23] - 2022-09-29
5
+ ## [3.0.25] - 2022-10-06
6
6
 
7
7
  ### Changed
8
8
 
9
- - Version patch update due to children dependencies update (`@semcore/icon` [2.30.4 ~> 2.31.0]).
10
-
11
- ## [3.0.22] - 2022-09-21
12
-
13
- ### Changed
14
-
15
- - Version patch update due to children dependencies update (`@semcore/icon` [2.30.3 ~> 2.30.4]).
16
-
17
- ## [3.0.21] - 2022-09-21
18
-
19
- ### Changed
20
-
21
- - Version patch update due to children dependencies update (`@semcore/icon` [2.30.2 ~> 2.30.3]).
22
-
23
- ## [3.0.20] - 2022-09-20
24
-
25
- ### Changed
26
-
27
- - Version patch update due to children dependencies update (`@semcore/spin` [4.0.9 ~> 4.0.10]).
28
-
29
- ## [3.0.19] - 2022-08-31
30
-
31
- ### Changed
32
-
33
- - Version patch update due to children dependencies update (`@semcore/tooltip` [5.0.12 ~> 5.0.13]).
34
-
35
- ## [3.0.18] - 2022-08-30
36
-
37
- ### Changed
38
-
39
- - Version patch update due to children dependencies update (`@semcore/flex-box` [4.5.10 ~> 4.5.11], `@semcore/icon` [2.30.1 ~> 2.30.2], `@semcore/utils` [3.37.0 ~> 3.37.1]).
40
-
41
- ## [3.0.17] - 2022-08-18
42
-
43
- ### Changed
44
-
45
- - Version patch update due to children dependencies update (`@semcore/icon` [2.30.0 ~> 2.30.1]).
46
-
47
- ## [3.0.16] - 2022-08-18
48
-
49
- ### Changed
50
-
51
- - Version patch update due to children dependencies update (`@semcore/icon` [2.29.5 ~> 2.30.0]).
52
-
53
- ## [3.0.15] - 2022-08-18
54
-
55
- ### Changed
56
-
57
- - Version patch update due to children dependencies update (`@semcore/flex-box` [4.5.9 ~> 4.5.10], `@semcore/icon` [2.29.4 ~> 2.29.5], `@semcore/utils` [3.36.0 ~> 3.37.0]).
58
-
59
- ## [3.0.14] - 2022-08-11
60
-
61
- ### Changed
62
-
63
- - Version patch update due to children dependencies update (`@semcore/flex-box` [4.5.8 ~> 4.5.9], `@semcore/icon` [2.29.3 ~> 2.29.4], `@semcore/utils` [3.35.1 ~> 3.36.0]).
64
-
65
- ## [3.0.13] - 2022-07-25
66
-
67
- ### Changed
68
-
69
- - Version patch update due to children dependencies update (`@semcore/icon` [2.29.1 ~> 2.29.2]).
70
-
71
- ## [3.0.12] - 2022-07-22
72
-
73
- ### Changed
74
-
75
- - Version patch update due to children dependencies update (`@semcore/flex-box` [4.5.6 ~> 4.5.7], `@semcore/icon` [2.29.0 ~> 2.29.1], `@semcore/utils` [3.34.0 ~> 3.35.0]).
76
-
77
- ## [3.0.11] - 2022-07-21
78
-
79
- ### Changed
80
-
81
- - Version patch update due to children dependencies update (`@semcore/icon` [2.28.0 ~> 2.29.0]).
82
-
83
- ## [3.0.10] - 2022-07-07
84
-
85
- ### Changed
86
-
87
- - Version patch update due to children dependencies update (`@semcore/flex-box` [4.5.5 ~> 4.5.6], `@semcore/icon` [2.27.0 ~> 2.28.0], `@semcore/utils` [3.33.0 ~> 3.34.0]).
9
+ - Version patch update due to children dependencies update (`@semcore/icon` [2.32.2 ~> 2.33.0]).
88
10
 
89
11
  ## [3.0.9] - 2022-06-03
90
12
 
@@ -98,36 +20,6 @@ CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangel
98
20
 
99
21
  - Version patch update due to children dependencies update (`@semcore/flex-box` [4.5.4 ~> 4.5.5], `@semcore/icon` [2.26.1 ~> 2.27.0], `@semcore/utils` [3.32.2 ~> 3.33.0], `@semcore/button` [4.0.5 ~> 4.0.6]).
100
22
 
101
- ## [3.0.7] - 2022-05-31
102
-
103
- ### Changed
104
-
105
- - Version patch update due to children dependencies update (`@semcore/flex-box` [4.5.3 ~> 4.5.4], `@semcore/icon` [2.26.0 ~> 2.26.1], `@semcore/utils` [3.32.1 ~> 3.32.2], `@semcore/button` [4.0.4 ~> 4.0.5]).
106
-
107
- ## [3.0.6] - 2022-05-27
108
-
109
- ### Changed
110
-
111
- - Version patch update due to children dependencies update (`@semcore/button` [4.0.3 ~> 4.0.4]).
112
-
113
- ## [3.0.5] - 2022-05-23
114
-
115
- ### Changed
116
-
117
- - Version patch update due to children dependencies update (`@semcore/icon` [2.25.1 ~> 2.26.0]).
118
-
119
- ## [3.0.4] - 2022-05-23
120
-
121
- ### Changed
122
-
123
- - Version patch update due to children dependencies update (`@semcore/button` [4.0.2 ~> 4.0.3]).
124
-
125
- ## [3.0.3] - 2022-05-19
126
-
127
- ### Changed
128
-
129
- - Version patch update due to children dependencies update (`@semcore/flex-box` [4.5.1 ~> 4.5.3], `@semcore/icon` [2.25.0 ~> 2.25.1], `@semcore/utils` [3.32.0 ~> 3.32.1], `@semcore/button` [4.0.1 ~> 4.0.2]).
130
-
131
23
  ## [3.0.2] - 2022-05-19
132
24
 
133
25
  ### Fixed
@@ -156,12 +48,6 @@ CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangel
156
48
 
157
49
  - Version patch update due to children dependencies update (`@semcore/icon` [2.21.0 ~> 2.24.0]).
158
50
 
159
- ## [2.0.1] - 2022-04-28
160
-
161
- ### Changed
162
-
163
- - Version patch update due to children dependencies update (`@semcore/icon` [2.20.0 ~> 2.21.0]).
164
-
165
51
  ## [2.0.0] - 2022-04-07
166
52
 
167
53
  ### Changed
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright ©, 2022, Semrush Inc. (written by Roman Lysov, Sergey Kobets, Mikhail Karachev, Julia Mnizhek, Elena Krasnopolskaia, Mikhail Sereniti).
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -56,21 +56,21 @@ var style = (
56
56
  /*__reshadow_css_start__*/
57
57
  _core.sstyled.insert(
58
58
  /*__inner_css_start__*/
59
- ".___SInlineInput_ymdmf_gg_{display:inline-flex;width:100%;height:100%;align-items:center;position:relative;z-index:0;vertical-align:middle;padding:1px;box-sizing:border-box;background-color:#ffffff}.___SInlineInput_ymdmf_gg_.__disabled_ymdmf_gg_{cursor:default;pointer-events:none;opacity:0.3}.___SValue_ymdmf_gg_{min-width:0;width:100%;height:100%;padding:0 4px;border:none;box-sizing:border-box;color:#191b23;font-size:inherit;line-height:1.2;text-overflow:ellipsis;font-family:inherit;background:transparent;min-height:1em}.___SValue_ymdmf_gg_:focus{outline:none}.___SValue_ymdmf_gg_::-moz-placeholder{color:#a9abb6}.___SValue_ymdmf_gg_:-ms-input-placeholder{color:#a9abb6}.___SValue_ymdmf_gg_::placeholder{color:#a9abb6}.___SValue_ymdmf_gg_.__disabled_ymdmf_gg_{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.___SUnderline_ymdmf_gg_{display:flex;flex-direction:row;align-items:center;flex-grow:1;width:100%;height:100%;min-height:1em;border:1px solid transparent;border-bottom:1px solid #c4c7cf}.___SAddon_ymdmf_gg_{display:inline-flex;justify-content:center;align-items:center;flex:0 0 auto;height:100%;color:#a9abb6;padding:0 4px}.___SAddon_ymdmf_gg_.__disabled_ymdmf_gg_{opacity:0.3;cursor:default;pointer-events:none}.___SConfirmIcon_ymdmf_gg_{color:#00c192;cursor:pointer}.___SConfirmIcon_ymdmf_gg_:hover{color:#009f81}.___SCancelIcon_ymdmf_gg_{color:#a9abb6;cursor:pointer}.___SCancelIcon_ymdmf_gg_:hover{color:#8a8e9b}.___SInlineInput_ymdmf_gg_.__focused_ymdmf_gg_{z-index:1}.___SInlineInput_ymdmf_gg_.__focused_ymdmf_gg_ .___SUnderline_ymdmf_gg_{border-bottom-color:#008ff8;box-shadow:0 0 0 3px rgba(0, 143, 248, 0.2)}.___SInlineInput_ymdmf_gg_._state_valid_ymdmf_gg_ .___SUnderline_ymdmf_gg_{border-bottom-color:#59ddaa}.___SInlineInput_ymdmf_gg_._state_valid_ymdmf_gg_.__focused_ymdmf_gg_ .___SUnderline_ymdmf_gg_{border-bottom-color:#009f81;box-shadow:0px 0px 0px 3px rgba(0, 159, 129, 0.2)}.___SInlineInput_ymdmf_gg_._state_invalid_ymdmf_gg_ .___SUnderline_ymdmf_gg_{border-bottom-color:#ffaeb5}.___SInlineInput_ymdmf_gg_._state_invalid_ymdmf_gg_.__focused_ymdmf_gg_ .___SUnderline_ymdmf_gg_{border-bottom-color:#ff4953;box-shadow:0px 0px 0px 3px rgba(255, 73, 83, 0.2)}"
59
+ ":root {\n\n /* DEPRECATED START\n Deprecated variables should never be used in\n components styles but preserved for backward\n compatibility if they used in projects\n like `<Badge bg=\"red\">alpha</Badge>`\n */\n /* DEPRECATED END */\n}\n\n.___SInlineInput_1bjan_gg_ {\n display: inline-flex;\n width: 100%;\n height: 100%;\n align-items: center;\n position: relative;\n z-index: 0;\n vertical-align: middle;\n padding: 1px;\n box-sizing: border-box;\n\n background-color: #ffffff;\n}\n\n.___SInlineInput_1bjan_gg_.__disabled_1bjan_gg_ {\n cursor: default;\n pointer-events: none;\n opacity: 0.3;\n}\n\n.___SValue_1bjan_gg_ {\n /* hack for firefox */\n min-width: 0;\n\n width: 100%;\n height: 100%;\n padding: 0px 4px;\n border: none;\n box-sizing: border-box;\n color: #191b23;\n font-size: inherit;\n line-height: 1.2;\n text-overflow: ellipsis;\n font-family: inherit;\n background: transparent;\n min-height: 1em\n}\n\n.___SValue_1bjan_gg_:focus {\n outline: none;\n }\n\n.___SValue_1bjan_gg_::-moz-placeholder {\n color: #a9abb6;\n }\n\n.___SValue_1bjan_gg_::placeholder {\n color: #a9abb6;\n }\n\n.___SValue_1bjan_gg_.__disabled_1bjan_gg_ {\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n }\n\n.___SUnderline_1bjan_gg_ {\n display: flex;\n flex-direction: row;\n align-items: center;\n flex-grow: 1;\n width: 100%;\n height: 100%;\n min-height: 1em;\n border: 1px solid transparent;\n border-bottom: 1px solid #c4c7cf;\n}\n\n.___SAddon_1bjan_gg_ {\n display: inline-flex;\n justify-content: center;\n align-items: center;\n flex: 0 0 auto;\n height: 100%;\n color: #a9abb6;\n padding: 0 4px;\n}\n\n.___SAddon_1bjan_gg_.__disabled_1bjan_gg_ {\n opacity: 0.3;\n cursor: default;\n pointer-events: none;\n}\n\n.___SConfirmIcon_1bjan_gg_ {\n color: #00c192;\n cursor: pointer;\n}\n\n.___SConfirmIcon_1bjan_gg_:hover {\n color: #009f81;\n}\n\n.___SCancelIcon_1bjan_gg_ {\n color: #a9abb6;\n cursor: pointer;\n}\n\n.___SCancelIcon_1bjan_gg_:hover {\n color: #8a8e9b;\n}\n\n.___SInlineInput_1bjan_gg_.__focused_1bjan_gg_ {\n z-index: 1;\n}\n\n.___SInlineInput_1bjan_gg_.__focused_1bjan_gg_ .___SUnderline_1bjan_gg_ {\n border-bottom-color: #008ff8;\n box-shadow: 0 0 0 3px rgba(0, 143, 248, 0.2);\n}\n\n.___SInlineInput_1bjan_gg_._state_valid_1bjan_gg_ .___SUnderline_1bjan_gg_ {\n border-bottom-color: #59ddaa;\n}\n\n.___SInlineInput_1bjan_gg_._state_valid_1bjan_gg_.__focused_1bjan_gg_ .___SUnderline_1bjan_gg_ {\n border-bottom-color: #009f81;\n box-shadow: 0px 0px 0px 3px rgba(0, 159, 129, 0.2);\n}\n\n.___SInlineInput_1bjan_gg_._state_invalid_1bjan_gg_ .___SUnderline_1bjan_gg_ {\n border-bottom-color: #ffaeb5;\n}\n\n.___SInlineInput_1bjan_gg_._state_invalid_1bjan_gg_.__focused_1bjan_gg_ .___SUnderline_1bjan_gg_ {\n border-bottom-color: #ff4953;\n box-shadow: 0px 0px 0px 3px rgba(255, 73, 83, 0.2);\n}\n"
60
60
  /*__inner_css_end__*/
61
- , "ymdmf_gg_")
61
+ , "1bjan_gg_")
62
62
  /*__reshadow_css_end__*/
63
63
  , {
64
- "__SInlineInput": "___SInlineInput_ymdmf_gg_",
65
- "_disabled": "__disabled_ymdmf_gg_",
66
- "__SValue": "___SValue_ymdmf_gg_",
67
- "__SUnderline": "___SUnderline_ymdmf_gg_",
68
- "__SAddon": "___SAddon_ymdmf_gg_",
69
- "__SConfirmIcon": "___SConfirmIcon_ymdmf_gg_",
70
- "__SCancelIcon": "___SCancelIcon_ymdmf_gg_",
71
- "_focused": "__focused_ymdmf_gg_",
72
- "_state_valid": "_state_valid_ymdmf_gg_",
73
- "_state_invalid": "_state_invalid_ymdmf_gg_"
64
+ "__SInlineInput": "___SInlineInput_1bjan_gg_",
65
+ "_disabled": "__disabled_1bjan_gg_",
66
+ "__SValue": "___SValue_1bjan_gg_",
67
+ "__SUnderline": "___SUnderline_1bjan_gg_",
68
+ "__SAddon": "___SAddon_1bjan_gg_",
69
+ "__SConfirmIcon": "___SConfirmIcon_1bjan_gg_",
70
+ "__SCancelIcon": "___SCancelIcon_1bjan_gg_",
71
+ "_focused": "__focused_1bjan_gg_",
72
+ "_state_valid": "_state_valid_1bjan_gg_",
73
+ "_state_invalid": "_state_invalid_1bjan_gg_"
74
74
  });
75
75
 
76
76
  var isFocusOutsideOf = function isFocusOutsideOf(element) {
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=index.d.js.map
@@ -0,0 +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 { IBoxProps } from '@semcore/flex-box';\n\n/* utils type */\ntype CProps<Props, Ctx = {}, UCProps = {}> = Props & {\n children?:\n | ((props: Props & Ctx, handlers: UCProps) => React.ReactNode)\n | React.ReactNode\n | React.ReactNode[];\n};\n/* utils type */\n\nexport interface IInlineInputProps extends IBoxProps {\n /**\n * Visual state of inline input\n * @default normal\n */\n state?: 'normal' | 'valid' | 'invalid';\n /**\n * Disabled input and shows spinner instead of confirm control\n * @default false\n */\n loading?: boolean;\n /**\n * Disabled input and controls\n * @default false\n */\n disabled?: boolean;\n /**\n * Fired with entered value when user clicks confirm control or hits `Enter` or `Space`\n */\n onConfirm?: (\n value: string,\n event: React.MouseEvent | React.FocusEvent | React.KeyboardEvent,\n ) => void;\n /**\n * Fired with value (or defaultValue) that was provided during component mount when user clicks cancel control or hits `Escape`\n */\n onCancel?: (\n prevValue: string,\n event: React.MouseEvent | React.FocusEvent | React.KeyboardEvent,\n ) => void;\n /**\n * Text value of input. Should be used with `onChange` property together\n */\n value?: string;\n /**\n * Initial text value of input\n */\n defaultValue?: string;\n /**\n * Makes component to catch browser focus on component mount\n * @default false\n */\n autoFocus?: boolean;\n /**\n * Gray text displayed in empty input\n */\n placeholder?: string;\n /**\n * Fired on every input value change. Should be used with `value` property together\n */\n onChange?: (value: string, event: React.ChangeEvent) => void;\n /**\n * Fired when browser focus leaves component.\n */\n onBlur?: (event: React.FocusEvent) => void;\n /**\n * Fired when browser focus enters component.\n */\n onFocus?: (event: React.FocusEvent) => void;\n /**\n * defines callback (`onCancel` or `onConfirm`) triggered when `blur` event out of container fired\n * Triggered after all previous macrotasks completed (internally called inside of `setTimeout`)\n */\n onBlurBehavior?: 'cancel' | 'confirm';\n}\n\nexport interface IInlineInputAddonProps extends IBoxProps {}\nexport interface IInlineInputValueProps extends IBoxProps {\n /**\n * id attribute of input tag\n */\n id?: string;\n /**\n * when `true`, element is focused immediately after mount\n */\n autoFocus?: boolean;\n /**\n * value of input tag\n */\n value?: string;\n /**\n * uncontrolled value of input tag\n */\n defaultValue?: string;\n /**\n * callback invoked on every change of input tag value\n */\n onChange?: (value: string, event: React.ChangeEvent) => void;\n /**\n * visual state of component\n */\n state?: 'normal' | 'valid' | 'invalid';\n /**\n * shows spinner in `InlineInput.ConfirmControl` and disables other interactive elements\n */\n loading?: boolean;\n /**\n * disables interactive elements\n */\n disabled?: boolean;\n /**\n * gray text in empty input tag\n */\n placeholder?: string;\n}\nexport interface IInlineInputConfirmControlProps extends IBoxProps {\n /**\n * Text of tooltip\n * @default Confirm\n */\n title?: string;\n /**\n * Icon component\n * @default CheckM\n */\n icon?: React.FC;\n}\nexport interface IInlineInputCancelControlProps extends IBoxProps {\n /**\n * Text of tooltip\n * @default Cancel\n */\n title?: string;\n /**\n * Icon component\n * @default CloseM\n */\n icon?: React.FC;\n}\n\ninterface IInlineInputCtx {\n getAddonProps: PropGetterFn;\n getConfirmControlProps: PropGetterFn;\n getCancelControlProps: PropGetterFn;\n getValueProps: PropGetterFn;\n}\n\ndeclare const InlineInput: (<T>(\n props: CProps<IInlineInputProps & T, IInlineInputCtx>,\n) => React.ReactElement) & {\n Addon: <T>(props: CProps<IInlineInputAddonProps & T, IInlineInputProps>) => React.ReactElement;\n Value: <T>(props: CProps<IInlineInputValueProps & T, IInlineInputProps>) => React.ReactElement;\n ConfirmControl: <T>(\n props: CProps<IInlineInputConfirmControlProps & T, IInlineInputProps>,\n ) => React.ReactElement;\n CancelControl: <T>(\n props: CProps<IInlineInputCancelControlProps & T, IInlineInputProps>,\n ) => React.ReactElement;\n};\nexport default InlineInput;\n"],"mappings":""}
@@ -33,21 +33,21 @@ var style = (
33
33
  /*__reshadow_css_start__*/
34
34
  _sstyled.insert(
35
35
  /*__inner_css_start__*/
36
- ".___SInlineInput_ymdmf_gg_{display:inline-flex;width:100%;height:100%;align-items:center;position:relative;z-index:0;vertical-align:middle;padding:1px;box-sizing:border-box;background-color:#ffffff}.___SInlineInput_ymdmf_gg_.__disabled_ymdmf_gg_{cursor:default;pointer-events:none;opacity:0.3}.___SValue_ymdmf_gg_{min-width:0;width:100%;height:100%;padding:0 4px;border:none;box-sizing:border-box;color:#191b23;font-size:inherit;line-height:1.2;text-overflow:ellipsis;font-family:inherit;background:transparent;min-height:1em}.___SValue_ymdmf_gg_:focus{outline:none}.___SValue_ymdmf_gg_::-moz-placeholder{color:#a9abb6}.___SValue_ymdmf_gg_:-ms-input-placeholder{color:#a9abb6}.___SValue_ymdmf_gg_::placeholder{color:#a9abb6}.___SValue_ymdmf_gg_.__disabled_ymdmf_gg_{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.___SUnderline_ymdmf_gg_{display:flex;flex-direction:row;align-items:center;flex-grow:1;width:100%;height:100%;min-height:1em;border:1px solid transparent;border-bottom:1px solid #c4c7cf}.___SAddon_ymdmf_gg_{display:inline-flex;justify-content:center;align-items:center;flex:0 0 auto;height:100%;color:#a9abb6;padding:0 4px}.___SAddon_ymdmf_gg_.__disabled_ymdmf_gg_{opacity:0.3;cursor:default;pointer-events:none}.___SConfirmIcon_ymdmf_gg_{color:#00c192;cursor:pointer}.___SConfirmIcon_ymdmf_gg_:hover{color:#009f81}.___SCancelIcon_ymdmf_gg_{color:#a9abb6;cursor:pointer}.___SCancelIcon_ymdmf_gg_:hover{color:#8a8e9b}.___SInlineInput_ymdmf_gg_.__focused_ymdmf_gg_{z-index:1}.___SInlineInput_ymdmf_gg_.__focused_ymdmf_gg_ .___SUnderline_ymdmf_gg_{border-bottom-color:#008ff8;box-shadow:0 0 0 3px rgba(0, 143, 248, 0.2)}.___SInlineInput_ymdmf_gg_._state_valid_ymdmf_gg_ .___SUnderline_ymdmf_gg_{border-bottom-color:#59ddaa}.___SInlineInput_ymdmf_gg_._state_valid_ymdmf_gg_.__focused_ymdmf_gg_ .___SUnderline_ymdmf_gg_{border-bottom-color:#009f81;box-shadow:0px 0px 0px 3px rgba(0, 159, 129, 0.2)}.___SInlineInput_ymdmf_gg_._state_invalid_ymdmf_gg_ .___SUnderline_ymdmf_gg_{border-bottom-color:#ffaeb5}.___SInlineInput_ymdmf_gg_._state_invalid_ymdmf_gg_.__focused_ymdmf_gg_ .___SUnderline_ymdmf_gg_{border-bottom-color:#ff4953;box-shadow:0px 0px 0px 3px rgba(255, 73, 83, 0.2)}"
36
+ ":root {\n\n /* DEPRECATED START\n Deprecated variables should never be used in\n components styles but preserved for backward\n compatibility if they used in projects\n like `<Badge bg=\"red\">alpha</Badge>`\n */\n /* DEPRECATED END */\n}\n\n.___SInlineInput_1bjan_gg_ {\n display: inline-flex;\n width: 100%;\n height: 100%;\n align-items: center;\n position: relative;\n z-index: 0;\n vertical-align: middle;\n padding: 1px;\n box-sizing: border-box;\n\n background-color: #ffffff;\n}\n\n.___SInlineInput_1bjan_gg_.__disabled_1bjan_gg_ {\n cursor: default;\n pointer-events: none;\n opacity: 0.3;\n}\n\n.___SValue_1bjan_gg_ {\n /* hack for firefox */\n min-width: 0;\n\n width: 100%;\n height: 100%;\n padding: 0px 4px;\n border: none;\n box-sizing: border-box;\n color: #191b23;\n font-size: inherit;\n line-height: 1.2;\n text-overflow: ellipsis;\n font-family: inherit;\n background: transparent;\n min-height: 1em\n}\n\n.___SValue_1bjan_gg_:focus {\n outline: none;\n }\n\n.___SValue_1bjan_gg_::-moz-placeholder {\n color: #a9abb6;\n }\n\n.___SValue_1bjan_gg_::placeholder {\n color: #a9abb6;\n }\n\n.___SValue_1bjan_gg_.__disabled_1bjan_gg_ {\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n }\n\n.___SUnderline_1bjan_gg_ {\n display: flex;\n flex-direction: row;\n align-items: center;\n flex-grow: 1;\n width: 100%;\n height: 100%;\n min-height: 1em;\n border: 1px solid transparent;\n border-bottom: 1px solid #c4c7cf;\n}\n\n.___SAddon_1bjan_gg_ {\n display: inline-flex;\n justify-content: center;\n align-items: center;\n flex: 0 0 auto;\n height: 100%;\n color: #a9abb6;\n padding: 0 4px;\n}\n\n.___SAddon_1bjan_gg_.__disabled_1bjan_gg_ {\n opacity: 0.3;\n cursor: default;\n pointer-events: none;\n}\n\n.___SConfirmIcon_1bjan_gg_ {\n color: #00c192;\n cursor: pointer;\n}\n\n.___SConfirmIcon_1bjan_gg_:hover {\n color: #009f81;\n}\n\n.___SCancelIcon_1bjan_gg_ {\n color: #a9abb6;\n cursor: pointer;\n}\n\n.___SCancelIcon_1bjan_gg_:hover {\n color: #8a8e9b;\n}\n\n.___SInlineInput_1bjan_gg_.__focused_1bjan_gg_ {\n z-index: 1;\n}\n\n.___SInlineInput_1bjan_gg_.__focused_1bjan_gg_ .___SUnderline_1bjan_gg_ {\n border-bottom-color: #008ff8;\n box-shadow: 0 0 0 3px rgba(0, 143, 248, 0.2);\n}\n\n.___SInlineInput_1bjan_gg_._state_valid_1bjan_gg_ .___SUnderline_1bjan_gg_ {\n border-bottom-color: #59ddaa;\n}\n\n.___SInlineInput_1bjan_gg_._state_valid_1bjan_gg_.__focused_1bjan_gg_ .___SUnderline_1bjan_gg_ {\n border-bottom-color: #009f81;\n box-shadow: 0px 0px 0px 3px rgba(0, 159, 129, 0.2);\n}\n\n.___SInlineInput_1bjan_gg_._state_invalid_1bjan_gg_ .___SUnderline_1bjan_gg_ {\n border-bottom-color: #ffaeb5;\n}\n\n.___SInlineInput_1bjan_gg_._state_invalid_1bjan_gg_.__focused_1bjan_gg_ .___SUnderline_1bjan_gg_ {\n border-bottom-color: #ff4953;\n box-shadow: 0px 0px 0px 3px rgba(255, 73, 83, 0.2);\n}\n"
37
37
  /*__inner_css_end__*/
38
- , "ymdmf_gg_")
38
+ , "1bjan_gg_")
39
39
  /*__reshadow_css_end__*/
40
40
  , {
41
- "__SInlineInput": "___SInlineInput_ymdmf_gg_",
42
- "_disabled": "__disabled_ymdmf_gg_",
43
- "__SValue": "___SValue_ymdmf_gg_",
44
- "__SUnderline": "___SUnderline_ymdmf_gg_",
45
- "__SAddon": "___SAddon_ymdmf_gg_",
46
- "__SConfirmIcon": "___SConfirmIcon_ymdmf_gg_",
47
- "__SCancelIcon": "___SCancelIcon_ymdmf_gg_",
48
- "_focused": "__focused_ymdmf_gg_",
49
- "_state_valid": "_state_valid_ymdmf_gg_",
50
- "_state_invalid": "_state_invalid_ymdmf_gg_"
41
+ "__SInlineInput": "___SInlineInput_1bjan_gg_",
42
+ "_disabled": "__disabled_1bjan_gg_",
43
+ "__SValue": "___SValue_1bjan_gg_",
44
+ "__SUnderline": "___SUnderline_1bjan_gg_",
45
+ "__SAddon": "___SAddon_1bjan_gg_",
46
+ "__SConfirmIcon": "___SConfirmIcon_1bjan_gg_",
47
+ "__SCancelIcon": "___SCancelIcon_1bjan_gg_",
48
+ "_focused": "__focused_1bjan_gg_",
49
+ "_state_valid": "_state_valid_1bjan_gg_",
50
+ "_state_invalid": "_state_invalid_1bjan_gg_"
51
51
  });
52
52
  import CheckM from '@semcore/icon/Check/m';
53
53
  import CloseM from '@semcore/icon/Close/m';
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.d.js.map
@@ -0,0 +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 { IBoxProps } from '@semcore/flex-box';\n\n/* utils type */\ntype CProps<Props, Ctx = {}, UCProps = {}> = Props & {\n children?:\n | ((props: Props & Ctx, handlers: UCProps) => React.ReactNode)\n | React.ReactNode\n | React.ReactNode[];\n};\n/* utils type */\n\nexport interface IInlineInputProps extends IBoxProps {\n /**\n * Visual state of inline input\n * @default normal\n */\n state?: 'normal' | 'valid' | 'invalid';\n /**\n * Disabled input and shows spinner instead of confirm control\n * @default false\n */\n loading?: boolean;\n /**\n * Disabled input and controls\n * @default false\n */\n disabled?: boolean;\n /**\n * Fired with entered value when user clicks confirm control or hits `Enter` or `Space`\n */\n onConfirm?: (\n value: string,\n event: React.MouseEvent | React.FocusEvent | React.KeyboardEvent,\n ) => void;\n /**\n * Fired with value (or defaultValue) that was provided during component mount when user clicks cancel control or hits `Escape`\n */\n onCancel?: (\n prevValue: string,\n event: React.MouseEvent | React.FocusEvent | React.KeyboardEvent,\n ) => void;\n /**\n * Text value of input. Should be used with `onChange` property together\n */\n value?: string;\n /**\n * Initial text value of input\n */\n defaultValue?: string;\n /**\n * Makes component to catch browser focus on component mount\n * @default false\n */\n autoFocus?: boolean;\n /**\n * Gray text displayed in empty input\n */\n placeholder?: string;\n /**\n * Fired on every input value change. Should be used with `value` property together\n */\n onChange?: (value: string, event: React.ChangeEvent) => void;\n /**\n * Fired when browser focus leaves component.\n */\n onBlur?: (event: React.FocusEvent) => void;\n /**\n * Fired when browser focus enters component.\n */\n onFocus?: (event: React.FocusEvent) => void;\n /**\n * defines callback (`onCancel` or `onConfirm`) triggered when `blur` event out of container fired\n * Triggered after all previous macrotasks completed (internally called inside of `setTimeout`)\n */\n onBlurBehavior?: 'cancel' | 'confirm';\n}\n\nexport interface IInlineInputAddonProps extends IBoxProps {}\nexport interface IInlineInputValueProps extends IBoxProps {\n /**\n * id attribute of input tag\n */\n id?: string;\n /**\n * when `true`, element is focused immediately after mount\n */\n autoFocus?: boolean;\n /**\n * value of input tag\n */\n value?: string;\n /**\n * uncontrolled value of input tag\n */\n defaultValue?: string;\n /**\n * callback invoked on every change of input tag value\n */\n onChange?: (value: string, event: React.ChangeEvent) => void;\n /**\n * visual state of component\n */\n state?: 'normal' | 'valid' | 'invalid';\n /**\n * shows spinner in `InlineInput.ConfirmControl` and disables other interactive elements\n */\n loading?: boolean;\n /**\n * disables interactive elements\n */\n disabled?: boolean;\n /**\n * gray text in empty input tag\n */\n placeholder?: string;\n}\nexport interface IInlineInputConfirmControlProps extends IBoxProps {\n /**\n * Text of tooltip\n * @default Confirm\n */\n title?: string;\n /**\n * Icon component\n * @default CheckM\n */\n icon?: React.FC;\n}\nexport interface IInlineInputCancelControlProps extends IBoxProps {\n /**\n * Text of tooltip\n * @default Cancel\n */\n title?: string;\n /**\n * Icon component\n * @default CloseM\n */\n icon?: React.FC;\n}\n\ninterface IInlineInputCtx {\n getAddonProps: PropGetterFn;\n getConfirmControlProps: PropGetterFn;\n getCancelControlProps: PropGetterFn;\n getValueProps: PropGetterFn;\n}\n\ndeclare const InlineInput: (<T>(\n props: CProps<IInlineInputProps & T, IInlineInputCtx>,\n) => React.ReactElement) & {\n Addon: <T>(props: CProps<IInlineInputAddonProps & T, IInlineInputProps>) => React.ReactElement;\n Value: <T>(props: CProps<IInlineInputValueProps & T, IInlineInputProps>) => React.ReactElement;\n ConfirmControl: <T>(\n props: CProps<IInlineInputConfirmControlProps & T, IInlineInputProps>,\n ) => React.ReactElement;\n CancelControl: <T>(\n props: CProps<IInlineInputCancelControlProps & T, IInlineInputProps>,\n ) => React.ReactElement;\n};\nexport default InlineInput;\n"],"mappings":""}
package/package.json CHANGED
@@ -1,17 +1,13 @@
1
1
  {
2
2
  "name": "@semcore/inline-input",
3
3
  "description": "Semrush Input Component",
4
- "version": "3.0.23",
4
+ "version": "3.0.25",
5
5
  "main": "lib/cjs/index.js",
6
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
- "scripts": {
12
- "build": "build --source=js",
13
- "test": "jest"
14
- },
15
11
  "dependencies": {
16
12
  "@semcore/flex-box": "^4.5.0",
17
13
  "@semcore/icon": "^2.19.3",
@@ -20,6 +16,7 @@
20
16
  "@semcore/utils": "^3.31.1"
21
17
  },
22
18
  "devDependencies": {
19
+ "@types/react": "16.8 - 17",
23
20
  "@semcore/button": "*",
24
21
  "@semcore/jest-preset-ui": "*",
25
22
  "@semcore/spin": "*",
@@ -36,5 +33,9 @@
36
33
  "type": "git",
37
34
  "url": "https://github.com/semrush/intergalactic.git",
38
35
  "directory": "semcore/inline-input"
36
+ },
37
+ "scripts": {
38
+ "build": "pnpm semcore-builder --source=js",
39
+ "test": "jest"
39
40
  }
40
- }
41
+ }
@@ -1,163 +0,0 @@
1
- import React from 'react';
2
- import { PropGetterFn } from '@semcore/core';
3
- import { IBoxProps } from '@semcore/flex-box';
4
-
5
- /* utils type */
6
- type CProps<Props, Ctx = {}, UCProps = {}> = Props & {
7
- children?:
8
- | ((props: Props & Ctx, handlers: UCProps) => React.ReactNode)
9
- | React.ReactNode
10
- | React.ReactNode[];
11
- };
12
- /* utils type */
13
-
14
- export interface IInlineInputProps extends IBoxProps {
15
- /**
16
- * Visual state of inline input
17
- * @default normal
18
- */
19
- state?: 'normal' | 'valid' | 'invalid';
20
- /**
21
- * Disabled input and shows spinner instead of confirm control
22
- * @default false
23
- */
24
- loading?: boolean;
25
- /**
26
- * Disabled input and controls
27
- * @default false
28
- */
29
- disabled?: boolean;
30
- /**
31
- * Fired with entered value when user clicks confirm control or hits `Enter` or `Space`
32
- */
33
- onConfirm?: (
34
- value: string,
35
- event: React.MouseEvent | React.FocusEvent | React.KeyboardEvent,
36
- ) => void;
37
- /**
38
- * Fired with value (or defaultValue) that was provided during component mount when user clicks cancel control or hits `Escape`
39
- */
40
- onCancel?: (
41
- prevValue: string,
42
- event: React.MouseEvent | React.FocusEvent | React.KeyboardEvent,
43
- ) => void;
44
- /**
45
- * Text value of input. Should be used with `onChange` property together
46
- */
47
- value?: string;
48
- /**
49
- * Initial text value of input
50
- */
51
- defaultValue?: string;
52
- /**
53
- * Makes component to catch browser focus on component mount
54
- * @default false
55
- */
56
- autoFocus?: boolean;
57
- /**
58
- * Gray text displayed in empty input
59
- */
60
- placeholder?: string;
61
- /**
62
- * Fired on every input value change. Should be used with `value` property together
63
- */
64
- onChange?: (value: string, event: React.ChangeEvent) => void;
65
- /**
66
- * Fired when browser focus leaves component.
67
- */
68
- onBlur?: (event: React.FocusEvent) => void;
69
- /**
70
- * Fired when browser focus enters component.
71
- */
72
- onFocus?: (event: React.FocusEvent) => void;
73
- /**
74
- * defines callback (`onCancel` or `onConfirm`) triggered when `blur` event out of container fired
75
- * Triggered after all previous macrotasks completed (internally called inside of `setTimeout`)
76
- */
77
- onBlurBehavior?: 'cancel' | 'confirm';
78
- }
79
-
80
- export interface IInlineInputAddonProps extends IBoxProps {}
81
- export interface IInlineInputValueProps extends IBoxProps {
82
- /**
83
- * id attribute of input tag
84
- */
85
- id?: string;
86
- /**
87
- * when `true`, element is focused immediately after mount
88
- */
89
- autoFocus?: boolean;
90
- /**
91
- * value of input tag
92
- */
93
- value?: string;
94
- /**
95
- * uncontrolled value of input tag
96
- */
97
- defaultValue?: string;
98
- /**
99
- * callback invoked on every change of input tag value
100
- */
101
- onChange?: (value: string, event: React.ChangeEvent) => void;
102
- /**
103
- * visual state of component
104
- */
105
- state?: 'normal' | 'valid' | 'invalid';
106
- /**
107
- * shows spinner in `InlineInput.ConfirmControl` and disables other interactive elements
108
- */
109
- loading?: boolean;
110
- /**
111
- * disables interactive elements
112
- */
113
- disabled?: boolean;
114
- /**
115
- * gray text in empty input tag
116
- */
117
- placeholder?: string;
118
- }
119
- export interface IInlineInputConfirmControlProps extends IBoxProps {
120
- /**
121
- * Text of tooltip
122
- * @default Confirm
123
- */
124
- title?: string;
125
- /**
126
- * Icon component
127
- * @default CheckM
128
- */
129
- icon?: React.FC;
130
- }
131
- export interface IInlineInputCancelControlProps extends IBoxProps {
132
- /**
133
- * Text of tooltip
134
- * @default Cancel
135
- */
136
- title?: string;
137
- /**
138
- * Icon component
139
- * @default CloseM
140
- */
141
- icon?: React.FC;
142
- }
143
-
144
- interface IInlineInputCtx {
145
- getAddonProps: PropGetterFn;
146
- getConfirmControlProps: PropGetterFn;
147
- getCancelControlProps: PropGetterFn;
148
- getValueProps: PropGetterFn;
149
- }
150
-
151
- declare const InlineInput: (<T>(
152
- props: CProps<IInlineInputProps & T, IInlineInputCtx>,
153
- ) => React.ReactElement) & {
154
- Addon: <T>(props: CProps<IInlineInputAddonProps & T, IInlineInputProps>) => React.ReactElement;
155
- Value: <T>(props: CProps<IInlineInputValueProps & T, IInlineInputProps>) => React.ReactElement;
156
- ConfirmControl: <T>(
157
- props: CProps<IInlineInputConfirmControlProps & T, IInlineInputProps>,
158
- ) => React.ReactElement;
159
- CancelControl: <T>(
160
- props: CProps<IInlineInputCancelControlProps & T, IInlineInputProps>,
161
- ) => React.ReactElement;
162
- };
163
- export default InlineInput;
@@ -1,163 +0,0 @@
1
- import React from 'react';
2
- import { PropGetterFn } from '@semcore/core';
3
- import { IBoxProps } from '@semcore/flex-box';
4
-
5
- /* utils type */
6
- type CProps<Props, Ctx = {}, UCProps = {}> = Props & {
7
- children?:
8
- | ((props: Props & Ctx, handlers: UCProps) => React.ReactNode)
9
- | React.ReactNode
10
- | React.ReactNode[];
11
- };
12
- /* utils type */
13
-
14
- export interface IInlineInputProps extends IBoxProps {
15
- /**
16
- * Visual state of inline input
17
- * @default normal
18
- */
19
- state?: 'normal' | 'valid' | 'invalid';
20
- /**
21
- * Disabled input and shows spinner instead of confirm control
22
- * @default false
23
- */
24
- loading?: boolean;
25
- /**
26
- * Disabled input and controls
27
- * @default false
28
- */
29
- disabled?: boolean;
30
- /**
31
- * Fired with entered value when user clicks confirm control or hits `Enter` or `Space`
32
- */
33
- onConfirm?: (
34
- value: string,
35
- event: React.MouseEvent | React.FocusEvent | React.KeyboardEvent,
36
- ) => void;
37
- /**
38
- * Fired with value (or defaultValue) that was provided during component mount when user clicks cancel control or hits `Escape`
39
- */
40
- onCancel?: (
41
- prevValue: string,
42
- event: React.MouseEvent | React.FocusEvent | React.KeyboardEvent,
43
- ) => void;
44
- /**
45
- * Text value of input. Should be used with `onChange` property together
46
- */
47
- value?: string;
48
- /**
49
- * Initial text value of input
50
- */
51
- defaultValue?: string;
52
- /**
53
- * Makes component to catch browser focus on component mount
54
- * @default false
55
- */
56
- autoFocus?: boolean;
57
- /**
58
- * Gray text displayed in empty input
59
- */
60
- placeholder?: string;
61
- /**
62
- * Fired on every input value change. Should be used with `value` property together
63
- */
64
- onChange?: (value: string, event: React.ChangeEvent) => void;
65
- /**
66
- * Fired when browser focus leaves component.
67
- */
68
- onBlur?: (event: React.FocusEvent) => void;
69
- /**
70
- * Fired when browser focus enters component.
71
- */
72
- onFocus?: (event: React.FocusEvent) => void;
73
- /**
74
- * defines callback (`onCancel` or `onConfirm`) triggered when `blur` event out of container fired
75
- * Triggered after all previous macrotasks completed (internally called inside of `setTimeout`)
76
- */
77
- onBlurBehavior?: 'cancel' | 'confirm';
78
- }
79
-
80
- export interface IInlineInputAddonProps extends IBoxProps {}
81
- export interface IInlineInputValueProps extends IBoxProps {
82
- /**
83
- * id attribute of input tag
84
- */
85
- id?: string;
86
- /**
87
- * when `true`, element is focused immediately after mount
88
- */
89
- autoFocus?: boolean;
90
- /**
91
- * value of input tag
92
- */
93
- value?: string;
94
- /**
95
- * uncontrolled value of input tag
96
- */
97
- defaultValue?: string;
98
- /**
99
- * callback invoked on every change of input tag value
100
- */
101
- onChange?: (value: string, event: React.ChangeEvent) => void;
102
- /**
103
- * visual state of component
104
- */
105
- state?: 'normal' | 'valid' | 'invalid';
106
- /**
107
- * shows spinner in `InlineInput.ConfirmControl` and disables other interactive elements
108
- */
109
- loading?: boolean;
110
- /**
111
- * disables interactive elements
112
- */
113
- disabled?: boolean;
114
- /**
115
- * gray text in empty input tag
116
- */
117
- placeholder?: string;
118
- }
119
- export interface IInlineInputConfirmControlProps extends IBoxProps {
120
- /**
121
- * Text of tooltip
122
- * @default Confirm
123
- */
124
- title?: string;
125
- /**
126
- * Icon component
127
- * @default CheckM
128
- */
129
- icon?: React.FC;
130
- }
131
- export interface IInlineInputCancelControlProps extends IBoxProps {
132
- /**
133
- * Text of tooltip
134
- * @default Cancel
135
- */
136
- title?: string;
137
- /**
138
- * Icon component
139
- * @default CloseM
140
- */
141
- icon?: React.FC;
142
- }
143
-
144
- interface IInlineInputCtx {
145
- getAddonProps: PropGetterFn;
146
- getConfirmControlProps: PropGetterFn;
147
- getCancelControlProps: PropGetterFn;
148
- getValueProps: PropGetterFn;
149
- }
150
-
151
- declare const InlineInput: (<T>(
152
- props: CProps<IInlineInputProps & T, IInlineInputCtx>,
153
- ) => React.ReactElement) & {
154
- Addon: <T>(props: CProps<IInlineInputAddonProps & T, IInlineInputProps>) => React.ReactElement;
155
- Value: <T>(props: CProps<IInlineInputValueProps & T, IInlineInputProps>) => React.ReactElement;
156
- ConfirmControl: <T>(
157
- props: CProps<IInlineInputConfirmControlProps & T, IInlineInputProps>,
158
- ) => React.ReactElement;
159
- CancelControl: <T>(
160
- props: CProps<IInlineInputCancelControlProps & T, IInlineInputProps>,
161
- ) => React.ReactElement;
162
- };
163
- export default InlineInput;