@semcore/input 3.0.14 → 3.0.16

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,6 +2,18 @@
2
2
 
3
3
  CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangelog.com/en/1.0.0/).
4
4
 
5
+ ## [3.0.16] - 2022-10-04
6
+
7
+ ### Changed
8
+
9
+ - Version patch update due to children dependencies update (`@semcore/utils` [3.37.1 ~> 3.37.2], `@semcore/flex-box` [4.5.11 ~> 4.5.12]).
10
+
11
+ ## [3.0.15] - 2022-08-30
12
+
13
+ ### Changed
14
+
15
+ - Version patch update due to children dependencies update (`@semcore/utils` [3.37.0 ~> 3.37.1], `@semcore/flex-box` [4.5.10 ~> 4.5.11]).
16
+
5
17
  ## [3.0.14] - 2022-08-23
6
18
 
7
19
  ### Added
package/lib/cjs/Input.js CHANGED
@@ -52,26 +52,26 @@ var style = (
52
52
  /*__reshadow_css_start__*/
53
53
  _core.sstyled.insert(
54
54
  /*__inner_css_start__*/
55
- ".___SInput_1sg9h_gg_{display:inline-flex;width:100%;align-items:center;position:relative;z-index:0;vertical-align:middle;padding:1px;box-sizing:border-box}.___SInput_1sg9h_gg_ input:-webkit-autofill{border-radius:6px;-webkit-box-shadow:0 0 0 30px #faffbd inset}.___SInput_1sg9h_gg_ input:-webkit-autofill~.___SOutline_1sg9h_gg_{background-color:#faffbd}.___SValue_1sg9h_gg_{min-width:0;width:100%;height:100%;padding:0;border:none;box-sizing:border-box;color:#191b23;font-size:inherit;text-overflow:ellipsis;font-family:inherit;background:transparent}.___SValue_1sg9h_gg_:focus{outline:none}.___SValue_1sg9h_gg_::-moz-placeholder{color:#a9abb6}.___SValue_1sg9h_gg_:-ms-input-placeholder{color:#a9abb6}.___SValue_1sg9h_gg_::placeholder{color:#a9abb6}.___SValue_1sg9h_gg_:-moz-read-only~.___SOutline_1sg9h_gg_{background:#f4f5f9}.___SValue_1sg9h_gg_:read-only~.___SOutline_1sg9h_gg_{background:#f4f5f9}.___SValue_1sg9h_gg_:disabled{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;opacity:0.3}.___SValue_1sg9h_gg_:disabled~.___SOutline_1sg9h_gg_{opacity:0.3;cursor:default;pointer-events:none}.___SOutline_1sg9h_gg_{position:absolute;top:0;right:0;bottom:0;left:0;border:1px solid;border-radius:6px;z-index:-1;background:#fff}.___SAddon_1sg9h_gg_{display:inline-flex;justify-content:center;align-items:center;flex:0 0 auto;padding:0 8px;height:100%;color:#a9abb6}.___SAddon_1sg9h_gg_.__interactive_1sg9h_gg_{cursor:pointer}.___SAddon_1sg9h_gg_.__interactive_1sg9h_gg_:hover{color:#8a8e9b}.___SAddon_1sg9h_gg_.__disabled_1sg9h_gg_{opacity:0.3;cursor:default;pointer-events:none}.___SInput_1sg9h_gg_._size_m_1sg9h_gg_{font-size:14px;height:28px}.___SValue_1sg9h_gg_._size_l_1sg9h_gg_,.___SValue_1sg9h_gg_._size_m_1sg9h_gg_{padding:0 8px}.___SInput_1sg9h_gg_._size_l_1sg9h_gg_{font-size:16px;height:40px;padding-left:4px;padding-right:4px}.___SInput_1sg9h_gg_.__focused_1sg9h_gg_{z-index:1}.___SInput_1sg9h_gg_._state_normal_1sg9h_gg_ .___SOutline_1sg9h_gg_{border-color:#c4c7cf}.___SInput_1sg9h_gg_._state_normal_1sg9h_gg_ .___SValue_1sg9h_gg_:focus~.___SOutline_1sg9h_gg_{border-color:#008ff8;box-shadow:0 0 0 3px rgba(0, 143, 248, 0.2)}.___SInput_1sg9h_gg_._state_valid_1sg9h_gg_ .___SOutline_1sg9h_gg_{border-color:#59ddaa}.___SInput_1sg9h_gg_._state_valid_1sg9h_gg_ .___SValue_1sg9h_gg_:focus~.___SOutline_1sg9h_gg_{border-color:#009f81;box-shadow:0px 0px 0px 3px rgba(0, 159, 129, 0.2)}.___SInput_1sg9h_gg_._state_invalid_1sg9h_gg_ .___SOutline_1sg9h_gg_{border-color:#ffaeb5}.___SInput_1sg9h_gg_._state_invalid_1sg9h_gg_ .___SValue_1sg9h_gg_:focus~.___SOutline_1sg9h_gg_{border-color:#ff4953;box-shadow:0px 0px 0px 3px rgba(255, 73, 83, 0.2)}.___SInput_1sg9h_gg_._neighborLocation_right_1sg9h_gg_ .___SOutline_1sg9h_gg_{border-top-right-radius:0;border-bottom-right-radius:0}.___SInput_1sg9h_gg_._neighborLocation_both_1sg9h_gg_ .___SOutline_1sg9h_gg_{border-radius:0;border-left:none}.___SInput_1sg9h_gg_._neighborLocation_left_1sg9h_gg_ .___SOutline_1sg9h_gg_{border-top-left-radius:0;border-bottom-left-radius:0;border-left:none}.___SAddon_1sg9h_gg_._neighborLocation_right_1sg9h_gg_{padding-right:8px}.___SAddon_1sg9h_gg_._neighborLocation_left_1sg9h_gg_{padding-left:8px}.___SValue_1sg9h_gg_._neighborLocation_right_1sg9h_gg_{padding-right:0}.___SValue_1sg9h_gg_._neighborLocation_both_1sg9h_gg_{padding-left:0;padding-right:0}.___SValue_1sg9h_gg_._neighborLocation_left_1sg9h_gg_{padding-left:0}"
55
+ ".___SInput_n024_gg_{display:inline-flex;width:100%;align-items:center;position:relative;z-index:0;vertical-align:middle;padding:1px;box-sizing:border-box}.___SInput_n024_gg_ input:-webkit-autofill{border-radius:6px;-webkit-box-shadow:0 0 0 30px #faffbd inset}.___SInput_n024_gg_ input:-webkit-autofill~.___SOutline_n024_gg_{background-color:#faffbd}.___SValue_n024_gg_{min-width:0;width:100%;height:100%;padding:0;border:none;box-sizing:border-box;color:#191b23;font-size:inherit;text-overflow:ellipsis;font-family:inherit;background:transparent}.___SValue_n024_gg_:focus{outline:none}.___SValue_n024_gg_::-moz-placeholder{color:#a9abb6}.___SValue_n024_gg_::placeholder{color:#a9abb6}.___SValue_n024_gg_:-moz-read-only~.___SOutline_n024_gg_{background:#f4f5f9}.___SValue_n024_gg_:read-only~.___SOutline_n024_gg_{background:#f4f5f9}.___SValue_n024_gg_:disabled{-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:0.3}.___SValue_n024_gg_:disabled~.___SOutline_n024_gg_{opacity:0.3;cursor:default;pointer-events:none}.___SOutline_n024_gg_{position:absolute;top:0;right:0;bottom:0;left:0;border:1px solid;border-radius:6px;z-index:-1;background:#fff}.___SAddon_n024_gg_{display:inline-flex;justify-content:center;align-items:center;flex:0 0 auto;padding:0 8px;height:100%;color:#a9abb6}.___SAddon_n024_gg_.__interactive_n024_gg_{cursor:pointer}.___SAddon_n024_gg_.__interactive_n024_gg_:hover{color:#8a8e9b}.___SAddon_n024_gg_.__disabled_n024_gg_{opacity:0.3;cursor:default;pointer-events:none}.___SInput_n024_gg_._size_m_n024_gg_{font-size:14px;height:28px}.___SValue_n024_gg_._size_l_n024_gg_,.___SValue_n024_gg_._size_m_n024_gg_{padding:0 8px}.___SInput_n024_gg_._size_l_n024_gg_{font-size:16px;height:40px;padding-left:4px;padding-right:4px}.___SInput_n024_gg_.__focused_n024_gg_{z-index:1}.___SInput_n024_gg_._state_normal_n024_gg_ .___SOutline_n024_gg_{border-color:#c4c7cf}.___SInput_n024_gg_._state_normal_n024_gg_ .___SValue_n024_gg_:focus~.___SOutline_n024_gg_{border-color:#008ff8;box-shadow:0 0 0 3px rgba(0, 143, 248, 0.2)}.___SInput_n024_gg_._state_valid_n024_gg_ .___SOutline_n024_gg_{border-color:#59ddaa}.___SInput_n024_gg_._state_valid_n024_gg_ .___SValue_n024_gg_:focus~.___SOutline_n024_gg_{border-color:#009f81;box-shadow:0px 0px 0px 3px rgba(0, 159, 129, 0.2)}.___SInput_n024_gg_._state_invalid_n024_gg_ .___SOutline_n024_gg_{border-color:#ffaeb5}.___SInput_n024_gg_._state_invalid_n024_gg_ .___SValue_n024_gg_:focus~.___SOutline_n024_gg_{border-color:#ff4953;box-shadow:0px 0px 0px 3px rgba(255, 73, 83, 0.2)}.___SInput_n024_gg_._neighborLocation_right_n024_gg_ .___SOutline_n024_gg_{border-top-right-radius:0;border-bottom-right-radius:0}.___SInput_n024_gg_._neighborLocation_both_n024_gg_ .___SOutline_n024_gg_{border-radius:0;border-left:none}.___SInput_n024_gg_._neighborLocation_left_n024_gg_ .___SOutline_n024_gg_{border-top-left-radius:0;border-bottom-left-radius:0;border-left:none}.___SAddon_n024_gg_._neighborLocation_right_n024_gg_{padding-right:8px}.___SAddon_n024_gg_._neighborLocation_left_n024_gg_{padding-left:8px}.___SValue_n024_gg_._neighborLocation_right_n024_gg_{padding-right:0}.___SValue_n024_gg_._neighborLocation_both_n024_gg_{padding-left:0;padding-right:0}.___SValue_n024_gg_._neighborLocation_left_n024_gg_{padding-left:0}"
56
56
  /*__inner_css_end__*/
57
- , "1sg9h_gg_")
57
+ , "n024_gg_")
58
58
  /*__reshadow_css_end__*/
59
59
  , {
60
- "__SInput": "___SInput_1sg9h_gg_",
61
- "__SOutline": "___SOutline_1sg9h_gg_",
62
- "__SValue": "___SValue_1sg9h_gg_",
63
- "__SAddon": "___SAddon_1sg9h_gg_",
64
- "_interactive": "__interactive_1sg9h_gg_",
65
- "_disabled": "__disabled_1sg9h_gg_",
66
- "_size_m": "_size_m_1sg9h_gg_",
67
- "_size_l": "_size_l_1sg9h_gg_",
68
- "_focused": "__focused_1sg9h_gg_",
69
- "_state_normal": "_state_normal_1sg9h_gg_",
70
- "_state_valid": "_state_valid_1sg9h_gg_",
71
- "_state_invalid": "_state_invalid_1sg9h_gg_",
72
- "_neighborLocation_right": "_neighborLocation_right_1sg9h_gg_",
73
- "_neighborLocation_both": "_neighborLocation_both_1sg9h_gg_",
74
- "_neighborLocation_left": "_neighborLocation_left_1sg9h_gg_"
60
+ "__SInput": "___SInput_n024_gg_",
61
+ "__SOutline": "___SOutline_n024_gg_",
62
+ "__SValue": "___SValue_n024_gg_",
63
+ "__SAddon": "___SAddon_n024_gg_",
64
+ "_interactive": "__interactive_n024_gg_",
65
+ "_disabled": "__disabled_n024_gg_",
66
+ "_size_m": "_size_m_n024_gg_",
67
+ "_size_l": "_size_l_n024_gg_",
68
+ "_focused": "__focused_n024_gg_",
69
+ "_state_normal": "_state_normal_n024_gg_",
70
+ "_state_valid": "_state_valid_n024_gg_",
71
+ "_state_invalid": "_state_invalid_n024_gg_",
72
+ "_neighborLocation_right": "_neighborLocation_right_n024_gg_",
73
+ "_neighborLocation_both": "_neighborLocation_both_n024_gg_",
74
+ "_neighborLocation_left": "_neighborLocation_left_n024_gg_"
75
75
  });
76
76
 
77
77
  var Input = /*#__PURE__*/function (_Component) {
@@ -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';\nimport { INeighborItemProps, INeighborLocationProps } from '@semcore/neighbor-location';\nimport { IWithAutoFocusEnhanceProps } from '@semcore/utils/lib/enhances/autoFocusEnhance';\n\n/* utils type */\ntype CProps<Props, Ctx = {}, UCProps = {}> = Props & {\n children?: ((props: Props & Ctx, handlers: UCProps) => React.ReactNode) | React.ReactNode;\n};\ntype ReturnEl = React.ReactElement | null;\n/* utils type */\n\nexport type InputSize = 'm' | 'l';\n\nexport interface IInputProps extends IBoxProps, INeighborItemProps, INeighborLocationProps {\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\nexport interface IInputValueProps\n extends IBoxProps,\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\nexport interface IInputAddonProps extends IBoxProps, 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\ninterface IInputCtx {\n getValueProps: PropGetterFn;\n getAddonProps: PropGetterFn;\n}\n\ndeclare const Input: (<T>(props: CProps<IInputProps & T, IInputCtx>) => ReturnEl) & {\n Value: <T>(props: IInputValueProps & T) => ReturnEl;\n Addon: <T>(props: CProps<IInputAddonProps & T, IInputProps>) => ReturnEl;\n};\nexport default Input;\n"],"mappings":""}
package/lib/es6/Input.js CHANGED
@@ -30,26 +30,26 @@ var style = (
30
30
  /*__reshadow_css_start__*/
31
31
  _sstyled.insert(
32
32
  /*__inner_css_start__*/
33
- ".___SInput_1sg9h_gg_{display:inline-flex;width:100%;align-items:center;position:relative;z-index:0;vertical-align:middle;padding:1px;box-sizing:border-box}.___SInput_1sg9h_gg_ input:-webkit-autofill{border-radius:6px;-webkit-box-shadow:0 0 0 30px #faffbd inset}.___SInput_1sg9h_gg_ input:-webkit-autofill~.___SOutline_1sg9h_gg_{background-color:#faffbd}.___SValue_1sg9h_gg_{min-width:0;width:100%;height:100%;padding:0;border:none;box-sizing:border-box;color:#191b23;font-size:inherit;text-overflow:ellipsis;font-family:inherit;background:transparent}.___SValue_1sg9h_gg_:focus{outline:none}.___SValue_1sg9h_gg_::-moz-placeholder{color:#a9abb6}.___SValue_1sg9h_gg_:-ms-input-placeholder{color:#a9abb6}.___SValue_1sg9h_gg_::placeholder{color:#a9abb6}.___SValue_1sg9h_gg_:-moz-read-only~.___SOutline_1sg9h_gg_{background:#f4f5f9}.___SValue_1sg9h_gg_:read-only~.___SOutline_1sg9h_gg_{background:#f4f5f9}.___SValue_1sg9h_gg_:disabled{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;opacity:0.3}.___SValue_1sg9h_gg_:disabled~.___SOutline_1sg9h_gg_{opacity:0.3;cursor:default;pointer-events:none}.___SOutline_1sg9h_gg_{position:absolute;top:0;right:0;bottom:0;left:0;border:1px solid;border-radius:6px;z-index:-1;background:#fff}.___SAddon_1sg9h_gg_{display:inline-flex;justify-content:center;align-items:center;flex:0 0 auto;padding:0 8px;height:100%;color:#a9abb6}.___SAddon_1sg9h_gg_.__interactive_1sg9h_gg_{cursor:pointer}.___SAddon_1sg9h_gg_.__interactive_1sg9h_gg_:hover{color:#8a8e9b}.___SAddon_1sg9h_gg_.__disabled_1sg9h_gg_{opacity:0.3;cursor:default;pointer-events:none}.___SInput_1sg9h_gg_._size_m_1sg9h_gg_{font-size:14px;height:28px}.___SValue_1sg9h_gg_._size_l_1sg9h_gg_,.___SValue_1sg9h_gg_._size_m_1sg9h_gg_{padding:0 8px}.___SInput_1sg9h_gg_._size_l_1sg9h_gg_{font-size:16px;height:40px;padding-left:4px;padding-right:4px}.___SInput_1sg9h_gg_.__focused_1sg9h_gg_{z-index:1}.___SInput_1sg9h_gg_._state_normal_1sg9h_gg_ .___SOutline_1sg9h_gg_{border-color:#c4c7cf}.___SInput_1sg9h_gg_._state_normal_1sg9h_gg_ .___SValue_1sg9h_gg_:focus~.___SOutline_1sg9h_gg_{border-color:#008ff8;box-shadow:0 0 0 3px rgba(0, 143, 248, 0.2)}.___SInput_1sg9h_gg_._state_valid_1sg9h_gg_ .___SOutline_1sg9h_gg_{border-color:#59ddaa}.___SInput_1sg9h_gg_._state_valid_1sg9h_gg_ .___SValue_1sg9h_gg_:focus~.___SOutline_1sg9h_gg_{border-color:#009f81;box-shadow:0px 0px 0px 3px rgba(0, 159, 129, 0.2)}.___SInput_1sg9h_gg_._state_invalid_1sg9h_gg_ .___SOutline_1sg9h_gg_{border-color:#ffaeb5}.___SInput_1sg9h_gg_._state_invalid_1sg9h_gg_ .___SValue_1sg9h_gg_:focus~.___SOutline_1sg9h_gg_{border-color:#ff4953;box-shadow:0px 0px 0px 3px rgba(255, 73, 83, 0.2)}.___SInput_1sg9h_gg_._neighborLocation_right_1sg9h_gg_ .___SOutline_1sg9h_gg_{border-top-right-radius:0;border-bottom-right-radius:0}.___SInput_1sg9h_gg_._neighborLocation_both_1sg9h_gg_ .___SOutline_1sg9h_gg_{border-radius:0;border-left:none}.___SInput_1sg9h_gg_._neighborLocation_left_1sg9h_gg_ .___SOutline_1sg9h_gg_{border-top-left-radius:0;border-bottom-left-radius:0;border-left:none}.___SAddon_1sg9h_gg_._neighborLocation_right_1sg9h_gg_{padding-right:8px}.___SAddon_1sg9h_gg_._neighborLocation_left_1sg9h_gg_{padding-left:8px}.___SValue_1sg9h_gg_._neighborLocation_right_1sg9h_gg_{padding-right:0}.___SValue_1sg9h_gg_._neighborLocation_both_1sg9h_gg_{padding-left:0;padding-right:0}.___SValue_1sg9h_gg_._neighborLocation_left_1sg9h_gg_{padding-left:0}"
33
+ ".___SInput_n024_gg_{display:inline-flex;width:100%;align-items:center;position:relative;z-index:0;vertical-align:middle;padding:1px;box-sizing:border-box}.___SInput_n024_gg_ input:-webkit-autofill{border-radius:6px;-webkit-box-shadow:0 0 0 30px #faffbd inset}.___SInput_n024_gg_ input:-webkit-autofill~.___SOutline_n024_gg_{background-color:#faffbd}.___SValue_n024_gg_{min-width:0;width:100%;height:100%;padding:0;border:none;box-sizing:border-box;color:#191b23;font-size:inherit;text-overflow:ellipsis;font-family:inherit;background:transparent}.___SValue_n024_gg_:focus{outline:none}.___SValue_n024_gg_::-moz-placeholder{color:#a9abb6}.___SValue_n024_gg_::placeholder{color:#a9abb6}.___SValue_n024_gg_:-moz-read-only~.___SOutline_n024_gg_{background:#f4f5f9}.___SValue_n024_gg_:read-only~.___SOutline_n024_gg_{background:#f4f5f9}.___SValue_n024_gg_:disabled{-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:0.3}.___SValue_n024_gg_:disabled~.___SOutline_n024_gg_{opacity:0.3;cursor:default;pointer-events:none}.___SOutline_n024_gg_{position:absolute;top:0;right:0;bottom:0;left:0;border:1px solid;border-radius:6px;z-index:-1;background:#fff}.___SAddon_n024_gg_{display:inline-flex;justify-content:center;align-items:center;flex:0 0 auto;padding:0 8px;height:100%;color:#a9abb6}.___SAddon_n024_gg_.__interactive_n024_gg_{cursor:pointer}.___SAddon_n024_gg_.__interactive_n024_gg_:hover{color:#8a8e9b}.___SAddon_n024_gg_.__disabled_n024_gg_{opacity:0.3;cursor:default;pointer-events:none}.___SInput_n024_gg_._size_m_n024_gg_{font-size:14px;height:28px}.___SValue_n024_gg_._size_l_n024_gg_,.___SValue_n024_gg_._size_m_n024_gg_{padding:0 8px}.___SInput_n024_gg_._size_l_n024_gg_{font-size:16px;height:40px;padding-left:4px;padding-right:4px}.___SInput_n024_gg_.__focused_n024_gg_{z-index:1}.___SInput_n024_gg_._state_normal_n024_gg_ .___SOutline_n024_gg_{border-color:#c4c7cf}.___SInput_n024_gg_._state_normal_n024_gg_ .___SValue_n024_gg_:focus~.___SOutline_n024_gg_{border-color:#008ff8;box-shadow:0 0 0 3px rgba(0, 143, 248, 0.2)}.___SInput_n024_gg_._state_valid_n024_gg_ .___SOutline_n024_gg_{border-color:#59ddaa}.___SInput_n024_gg_._state_valid_n024_gg_ .___SValue_n024_gg_:focus~.___SOutline_n024_gg_{border-color:#009f81;box-shadow:0px 0px 0px 3px rgba(0, 159, 129, 0.2)}.___SInput_n024_gg_._state_invalid_n024_gg_ .___SOutline_n024_gg_{border-color:#ffaeb5}.___SInput_n024_gg_._state_invalid_n024_gg_ .___SValue_n024_gg_:focus~.___SOutline_n024_gg_{border-color:#ff4953;box-shadow:0px 0px 0px 3px rgba(255, 73, 83, 0.2)}.___SInput_n024_gg_._neighborLocation_right_n024_gg_ .___SOutline_n024_gg_{border-top-right-radius:0;border-bottom-right-radius:0}.___SInput_n024_gg_._neighborLocation_both_n024_gg_ .___SOutline_n024_gg_{border-radius:0;border-left:none}.___SInput_n024_gg_._neighborLocation_left_n024_gg_ .___SOutline_n024_gg_{border-top-left-radius:0;border-bottom-left-radius:0;border-left:none}.___SAddon_n024_gg_._neighborLocation_right_n024_gg_{padding-right:8px}.___SAddon_n024_gg_._neighborLocation_left_n024_gg_{padding-left:8px}.___SValue_n024_gg_._neighborLocation_right_n024_gg_{padding-right:0}.___SValue_n024_gg_._neighborLocation_both_n024_gg_{padding-left:0;padding-right:0}.___SValue_n024_gg_._neighborLocation_left_n024_gg_{padding-left:0}"
34
34
  /*__inner_css_end__*/
35
- , "1sg9h_gg_")
35
+ , "n024_gg_")
36
36
  /*__reshadow_css_end__*/
37
37
  , {
38
- "__SInput": "___SInput_1sg9h_gg_",
39
- "__SOutline": "___SOutline_1sg9h_gg_",
40
- "__SValue": "___SValue_1sg9h_gg_",
41
- "__SAddon": "___SAddon_1sg9h_gg_",
42
- "_interactive": "__interactive_1sg9h_gg_",
43
- "_disabled": "__disabled_1sg9h_gg_",
44
- "_size_m": "_size_m_1sg9h_gg_",
45
- "_size_l": "_size_l_1sg9h_gg_",
46
- "_focused": "__focused_1sg9h_gg_",
47
- "_state_normal": "_state_normal_1sg9h_gg_",
48
- "_state_valid": "_state_valid_1sg9h_gg_",
49
- "_state_invalid": "_state_invalid_1sg9h_gg_",
50
- "_neighborLocation_right": "_neighborLocation_right_1sg9h_gg_",
51
- "_neighborLocation_both": "_neighborLocation_both_1sg9h_gg_",
52
- "_neighborLocation_left": "_neighborLocation_left_1sg9h_gg_"
38
+ "__SInput": "___SInput_n024_gg_",
39
+ "__SOutline": "___SOutline_n024_gg_",
40
+ "__SValue": "___SValue_n024_gg_",
41
+ "__SAddon": "___SAddon_n024_gg_",
42
+ "_interactive": "__interactive_n024_gg_",
43
+ "_disabled": "__disabled_n024_gg_",
44
+ "_size_m": "_size_m_n024_gg_",
45
+ "_size_l": "_size_l_n024_gg_",
46
+ "_focused": "__focused_n024_gg_",
47
+ "_state_normal": "_state_normal_n024_gg_",
48
+ "_state_valid": "_state_valid_n024_gg_",
49
+ "_state_invalid": "_state_invalid_n024_gg_",
50
+ "_neighborLocation_right": "_neighborLocation_right_n024_gg_",
51
+ "_neighborLocation_both": "_neighborLocation_both_n024_gg_",
52
+ "_neighborLocation_left": "_neighborLocation_left_n024_gg_"
53
53
  });
54
54
 
55
55
  var Input = /*#__PURE__*/function (_Component) {
@@ -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';\nimport { INeighborItemProps, INeighborLocationProps } from '@semcore/neighbor-location';\nimport { IWithAutoFocusEnhanceProps } from '@semcore/utils/lib/enhances/autoFocusEnhance';\n\n/* utils type */\ntype CProps<Props, Ctx = {}, UCProps = {}> = Props & {\n children?: ((props: Props & Ctx, handlers: UCProps) => React.ReactNode) | React.ReactNode;\n};\ntype ReturnEl = React.ReactElement | null;\n/* utils type */\n\nexport type InputSize = 'm' | 'l';\n\nexport interface IInputProps extends IBoxProps, INeighborItemProps, INeighborLocationProps {\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\nexport interface IInputValueProps\n extends IBoxProps,\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\nexport interface IInputAddonProps extends IBoxProps, 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\ninterface IInputCtx {\n getValueProps: PropGetterFn;\n getAddonProps: PropGetterFn;\n}\n\ndeclare const Input: (<T>(props: CProps<IInputProps & T, IInputCtx>) => ReturnEl) & {\n Value: <T>(props: IInputValueProps & T) => ReturnEl;\n Addon: <T>(props: CProps<IInputAddonProps & T, IInputProps>) => ReturnEl;\n};\nexport default Input;\n"],"mappings":""}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@semcore/input",
3
3
  "description": "Semrush Input Component",
4
- "version": "3.0.14",
4
+ "version": "3.0.16",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/es6/index.js",
7
7
  "typings": "lib/types/index.d.ts",
@@ -9,7 +9,7 @@
9
9
  "author": "UI-kit team <ui-kit-team@semrush.com>",
10
10
  "license": "MIT",
11
11
  "scripts": {
12
- "build": "build --source=js",
12
+ "build": "pnpm semcore-builder --source=js",
13
13
  "test": "jest"
14
14
  },
15
15
  "dependencies": {
@@ -30,6 +30,7 @@
30
30
  "directory": "semcore/input"
31
31
  },
32
32
  "devDependencies": {
33
+ "@types/react": "16.8 - 17",
33
34
  "@semcore/jest-preset-ui": "1.0.0",
34
35
  "@semcore/icon": "*"
35
36
  }
@@ -1,89 +0,0 @@
1
- import React from 'react';
2
- import { PropGetterFn } from '@semcore/core';
3
- import { IBoxProps } from '@semcore/flex-box';
4
- import { INeighborItemProps, INeighborLocationProps } from '@semcore/neighbor-location';
5
- import { IWithAutoFocusEnhanceProps } from '@semcore/utils/lib/enhances/autoFocusEnhance';
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
- export type InputSize = 'm' | 'l';
15
-
16
- export interface IInputProps extends IBoxProps, INeighborItemProps, INeighborLocationProps {
17
- /**
18
- * Sets the input and addons to the disabled state
19
- * */
20
- disabled?: boolean;
21
- /**
22
- * Input size
23
- * @default m
24
- */
25
- size?: InputSize;
26
- /**
27
- * Sets the input state
28
- * @default normal
29
- */
30
- state?: 'normal' | 'invalid' | 'valid';
31
- }
32
-
33
- export interface IInputValueProps
34
- extends IBoxProps,
35
- INeighborItemProps,
36
- IWithAutoFocusEnhanceProps {
37
- /**
38
- * Input value
39
- */
40
- value?: string;
41
- /**
42
- * Default value if `value` property is not provided
43
- */
44
- defaultValue?: string;
45
- /**
46
- * Handler for changing the value
47
- */
48
- onChange?: (value: string, event: React.SyntheticEvent<HTMLInputElement>) => void;
49
- /**
50
- * Sets the input to the disabled state
51
- * */
52
- disabled?: boolean;
53
- /**
54
- * Sets the input to the read-only state
55
- * */
56
- readOnly?: boolean;
57
- /**
58
- * Input size
59
- * @default m
60
- */
61
- size?: InputSize;
62
- }
63
-
64
- export interface IInputAddonProps extends IBoxProps, INeighborItemProps {
65
- /**
66
- * Adds styles for interactive icons
67
- */
68
- interactive?: boolean;
69
- /**
70
- * Blocks the addon
71
- * */
72
- disabled?: boolean;
73
- /**
74
- * Input size
75
- * @default m
76
- */
77
- size?: InputSize;
78
- }
79
-
80
- interface IInputCtx {
81
- getValueProps: PropGetterFn;
82
- getAddonProps: PropGetterFn;
83
- }
84
-
85
- declare const Input: (<T>(props: CProps<IInputProps & T, IInputCtx>) => ReturnEl) & {
86
- Value: <T>(props: IInputValueProps & T) => ReturnEl;
87
- Addon: <T>(props: CProps<IInputAddonProps & T, IInputProps>) => ReturnEl;
88
- };
89
- export default Input;
@@ -1,89 +0,0 @@
1
- import React from 'react';
2
- import { PropGetterFn } from '@semcore/core';
3
- import { IBoxProps } from '@semcore/flex-box';
4
- import { INeighborItemProps, INeighborLocationProps } from '@semcore/neighbor-location';
5
- import { IWithAutoFocusEnhanceProps } from '@semcore/utils/lib/enhances/autoFocusEnhance';
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
- export type InputSize = 'm' | 'l';
15
-
16
- export interface IInputProps extends IBoxProps, INeighborItemProps, INeighborLocationProps {
17
- /**
18
- * Sets the input and addons to the disabled state
19
- * */
20
- disabled?: boolean;
21
- /**
22
- * Input size
23
- * @default m
24
- */
25
- size?: InputSize;
26
- /**
27
- * Sets the input state
28
- * @default normal
29
- */
30
- state?: 'normal' | 'invalid' | 'valid';
31
- }
32
-
33
- export interface IInputValueProps
34
- extends IBoxProps,
35
- INeighborItemProps,
36
- IWithAutoFocusEnhanceProps {
37
- /**
38
- * Input value
39
- */
40
- value?: string;
41
- /**
42
- * Default value if `value` property is not provided
43
- */
44
- defaultValue?: string;
45
- /**
46
- * Handler for changing the value
47
- */
48
- onChange?: (value: string, event: React.SyntheticEvent<HTMLInputElement>) => void;
49
- /**
50
- * Sets the input to the disabled state
51
- * */
52
- disabled?: boolean;
53
- /**
54
- * Sets the input to the read-only state
55
- * */
56
- readOnly?: boolean;
57
- /**
58
- * Input size
59
- * @default m
60
- */
61
- size?: InputSize;
62
- }
63
-
64
- export interface IInputAddonProps extends IBoxProps, INeighborItemProps {
65
- /**
66
- * Adds styles for interactive icons
67
- */
68
- interactive?: boolean;
69
- /**
70
- * Blocks the addon
71
- * */
72
- disabled?: boolean;
73
- /**
74
- * Input size
75
- * @default m
76
- */
77
- size?: InputSize;
78
- }
79
-
80
- interface IInputCtx {
81
- getValueProps: PropGetterFn;
82
- getAddonProps: PropGetterFn;
83
- }
84
-
85
- declare const Input: (<T>(props: CProps<IInputProps & T, IInputCtx>) => ReturnEl) & {
86
- Value: <T>(props: IInputValueProps & T) => ReturnEl;
87
- Addon: <T>(props: CProps<IInputAddonProps & T, IInputProps>) => ReturnEl;
88
- };
89
- export default Input;