@synerise/ds-input 0.20.7 → 0.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [0.21.0](https://github.com/synerise/synerise-design/compare/@synerise/ds-input@0.20.7...@synerise/ds-input@0.21.0) (2024-05-08)
7
+
8
+
9
+ ### Features
10
+
11
+ * **input:** add readOnly styles to textarea ([39044b3](https://github.com/synerise/synerise-design/commit/39044b31e890a6d2d7e9c1eddb6dfec25a0f860f))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [0.20.7](https://github.com/synerise/synerise-design/compare/@synerise/ds-input@0.20.6...@synerise/ds-input@0.20.7) (2024-04-29)
7
18
 
8
19
 
@@ -1,4 +1,4 @@
1
- var _excluded = ["disabled", "error", "rows", "wrapperStyle", "onBlur", "onFocus", "resize", "autoSize"];
1
+ var _excluded = ["disabled", "error", "rows", "wrapperStyle", "onBlur", "onFocus", "resize", "autoSize", "readOnly"];
2
2
 
3
3
  function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4
4
 
@@ -25,6 +25,7 @@ var Textarea = function Textarea(_ref) {
25
25
  _onFocus = _ref.onFocus,
26
26
  resize = _ref.resize,
27
27
  autoSize = _ref.autoSize,
28
+ readOnly = _ref.readOnly,
28
29
  props = _objectWithoutPropertiesLoose(_ref, _excluded);
29
30
 
30
31
  var _React$useState = React.useState(false),
@@ -39,7 +40,8 @@ var Textarea = function Textarea(_ref) {
39
40
  resize: resize,
40
41
  style: _objectSpread({
41
42
  height: autoSize ? 'auto' : rows * 17 + "px"
42
- }, wrapperStyle)
43
+ }, wrapperStyle),
44
+ isReadOnly: readOnly
43
45
  }, /*#__PURE__*/React.createElement(Scrollbar, {
44
46
  absolute: true,
45
47
  classes: "textarea-scrollbar"
@@ -47,6 +49,7 @@ var Textarea = function Textarea(_ref) {
47
49
  autoSize: autoSize
48
50
  }, props, {
49
51
  disabled: disabled,
52
+ readOnly: readOnly,
50
53
  onFocus: function onFocus(e) {
51
54
  _onFocus && _onFocus(e);
52
55
  setFocus(true);
@@ -4,4 +4,5 @@ export declare const TextareaWrapper: import("styled-components").StyledComponen
4
4
  isDisabled: boolean;
5
5
  isFocused: boolean;
6
6
  hasError: boolean;
7
+ isReadOnly?: boolean | undefined;
7
8
  }, never>;
@@ -6,6 +6,7 @@ export var TextareaWrapper = styled.div.withConfig({
6
6
  })(["position:relative;overflow:hidden;resize:", ";border-radius:3px;transition:background-color 0.3s ease-in-out,border 0.3s ease-in-out,box-shadow 0.3s ease-in-out;", " .scrollbar-container{height:100%;top:1px;bottom:0;right:1px;.ps__rail-y,.ps__thumb-x,.ps__rail-x{height:calc(100% - 1px);max-height:9px;}& > .textarea-scrollbar{&,& > div{height:calc(100% - 2px);}}}&&&{textarea{position:relative;min-height:100%;resize:none;background:transparent;border:0;box-shadow:none;outline:0;word-wrap:break-word;overflow-wrap:break-word;font-variant-numeric:normal;::placeholder,::-webkit-input-placeholder{line-height:1.38;}:-ms-input-placeholder{line-height:1.38;}}.ant-input-textarea{height:100%;}}"], function (props) {
7
7
  return props.resize ? props.resize : 'vertical';
8
8
  }, function (props) {
9
+ if (props.isReadOnly) return css(["border:1px solid ", ";background-color:", ";"], props.theme.palette['grey-300'], props.theme.palette['grey-050']);
9
10
  if (props.isDisabled) return css(["border:1px solid #dbe0e3;background-color:#f9fafb;cursor:not-allowed;"]);
10
11
  if (props.isFocused) return css(["box-shadow:inset 0 0 0 1px ", ";border:1px solid ", ";background-color:", ";&&&{textarea{&::-webkit-scrollbar-thumb{background-color:#e1e3e6;border:4px solid ", " !important;}}}"], props.theme.palette['blue-600'], props.theme.palette['blue-600'], props.theme.palette['blue-050'], props.theme.palette['blue-050']);
11
12
  if (props.hasError) return css(["background-color:", ";box-shadow:inset 0 0 0 1px ", ";border:1px solid ", ";"], props.theme.palette['red-050'], props.theme.palette['red-600'], props.theme.palette['red-600']);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-input",
3
- "version": "0.20.7",
3
+ "version": "0.21.0",
4
4
  "description": "Input UI Component for the Synerise Design System",
5
5
  "license": "ISC",
6
6
  "repository": "synerise/synerise-design",
@@ -52,5 +52,5 @@
52
52
  "@testing-library/react": "10.0.1",
53
53
  "@testing-library/user-event": "10.3.1"
54
54
  },
55
- "gitHead": "6f0dc42ae79cea009e60fdb1f91ef72dcc82998e"
55
+ "gitHead": "700312e731dcbedacd206fd1d3389e5725c80d24"
56
56
  }