@synerise/ds-input 0.20.5 → 0.20.7

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,26 @@
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.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
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **input:** fixes styles for input / select / textarea labels ([51f9d6b](https://github.com/synerise/synerise-design/commit/51f9d6bdf190a82d6e3b5ddb7437bfa81135d048))
12
+ * **input:** overwrite select margins within input group ([02e4e55](https://github.com/synerise/synerise-design/commit/02e4e555115e145395678b9529ac754bdedfe769))
13
+
14
+
15
+
16
+
17
+
18
+ ## [0.20.6](https://github.com/synerise/synerise-design/compare/@synerise/ds-input@0.20.5...@synerise/ds-input@0.20.6) (2024-04-15)
19
+
20
+ **Note:** Version bump only for package @synerise/ds-input
21
+
22
+
23
+
24
+
25
+
6
26
  ## [0.20.5](https://github.com/synerise/synerise-design/compare/@synerise/ds-input@0.20.4...@synerise/ds-input@0.20.5) (2024-04-05)
7
27
 
8
28
  **Note:** Version bump only for package @synerise/ds-input
package/dist/Input.js CHANGED
@@ -107,9 +107,9 @@ var createInputComponent = function createInputComponent(WrappedComponent) {
107
107
  useEffect(function () {
108
108
  if (inputRef.current) {
109
109
  // @ts-ignore
110
- var _getComputedStyle = getComputedStyle(inputRef.current.input),
111
- paddingLeft = _getComputedStyle.paddingLeft,
112
- paddingRight = _getComputedStyle.paddingRight;
110
+ var _getComputedStyle2 = getComputedStyle(inputRef.current.input),
111
+ paddingLeft = _getComputedStyle2.paddingLeft,
112
+ paddingRight = _getComputedStyle2.paddingRight;
113
113
 
114
114
  paddingDiff.current = parseFloat(paddingLeft) + parseFloat(paddingRight);
115
115
  }
@@ -6,7 +6,7 @@ export var InputGroupItem = styled.div.withConfig({
6
6
  export var InputGroupWrapper = styled.div.withConfig({
7
7
  displayName: "InputGroupstyles__InputGroupWrapper",
8
8
  componentId: "sc-1cn2cc5-1"
9
- })(["&&&{display:flex;min-width:0;", ";", "}"], function (props) {
9
+ })(["&&&{", "{.ds-select-container{margin-bottom:0;}}display:flex;min-width:0;", ";", "}"], InputGroupItem, function (props) {
10
10
  return props.compact ? '' : 'align-items: stretch';
11
11
  }, function (props) {
12
12
  return props.compact ? css(["", "{&:only-child{flex-grow:1;}&:not(:only-child){&:not(:last-child){margin-right:-1px;.ant-input,.ant-input-number,.ant-select-selector{border-top-right-radius:0px;border-bottom-right-radius:0px;}}&:last-child{.ant-input,.ant-input-number,.ant-select-selector{border-top-left-radius:0px;border-bottom-left-radius:0px;}flex:auto;}}"], InputGroupItem) : css(["", ":last-child{flex-grow:1;}", ":not(:last-child){margin-right:12px;}"], InputGroupItem, InputGroupItem);
@@ -1,4 +1,3 @@
1
- import * as React from 'react';
2
1
  import { LabelProps } from './Label.types';
3
- declare const Label: React.FC<LabelProps>;
2
+ declare const Label: ({ id, className, label, tooltip, tooltipConfig, style }: LabelProps) => JSX.Element;
4
3
  export default Label;
@@ -16,12 +16,16 @@ var Label = function Label(_ref) {
16
16
  style: style,
17
17
  htmlFor: id,
18
18
  className: className
19
- }, label, (tooltip || tooltipConfig) && /*#__PURE__*/React.createElement(Tooltip, _extends({
19
+ }, /*#__PURE__*/React.createElement(S.LabelText, {
20
+ ellipsis: {
21
+ tooltip: label
22
+ }
23
+ }, label), (tooltip || tooltipConfig) && /*#__PURE__*/React.createElement(Tooltip, _extends({
20
24
  title: tooltip,
21
25
  placement: "top",
22
26
  trigger: "hover",
23
27
  transitionName: "zoom-big-fast"
24
- }, tooltipConfig), /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(Icon, {
28
+ }, tooltipConfig), /*#__PURE__*/React.createElement(S.IconWrapper, null, /*#__PURE__*/React.createElement(Icon, {
25
29
  size: 24,
26
30
  component: /*#__PURE__*/React.createElement(InfoFillS, null)
27
31
  })))));
@@ -1 +1,9 @@
1
+ /// <reference types="react" />
1
2
  export declare const Label: import("styled-components").StyledComponent<"label", any, {}, never>;
3
+ export declare const IconWrapper: import("styled-components").StyledComponent<"span", any, {}, never>;
4
+ export declare const LabelText: import("styled-components").StyledComponent<({ size, className, children, ellipsis }: {
5
+ size?: import("@synerise/ds-typography").TextSize | undefined;
6
+ ellipsis?: import("@synerise/ds-typography/dist/Ellipsis").EllipsisProps | undefined;
7
+ children?: import("react").ReactNode;
8
+ className?: string | undefined;
9
+ }) => JSX.Element, any, {}, never>;
@@ -1,9 +1,16 @@
1
1
  import styled from 'styled-components';
2
- import { macro } from '@synerise/ds-typography'; // eslint-disable-next-line import/prefer-default-export
3
-
2
+ import { macro, Text } from '@synerise/ds-typography';
4
3
  export var Label = styled.label.withConfig({
5
4
  displayName: "Labelstyles__Label",
6
5
  componentId: "sc-1eottcg-0"
7
- })(["", ";height:17px;display:flex;align-items:center;cursor:pointer;white-space:nowrap;span{display:inline-block;", ";", ";}.ds-icon > svg{margin-top:-1px;fill:", ";}"], macro.heading, macro.small, macro.heading, function (props) {
6
+ })(["", ";height:17px;display:flex;align-items:center;cursor:pointer;white-space:nowrap;min-width:0;overflow:hidden;text-overflow:ellipsis;"], macro.heading);
7
+ export var IconWrapper = styled.span.withConfig({
8
+ displayName: "Labelstyles__IconWrapper",
9
+ componentId: "sc-1eottcg-1"
10
+ })(["display:inline-block;.ds-icon > svg{margin-top:-1px;fill:", ";}"], function (props) {
8
11
  return props.theme.palette['grey-400'];
9
- });
12
+ });
13
+ export var LabelText = styled(Text).withConfig({
14
+ displayName: "Labelstyles__LabelText",
15
+ componentId: "sc-1eottcg-2"
16
+ })([""]);
@@ -1,11 +1,10 @@
1
- import * as React from 'react';
2
- import TooltipExtendedProps from '@synerise/ds-tooltip/dist/Tooltip.types';
3
- import { TooltipProps } from 'antd/lib/tooltip';
1
+ import type { ReactNode } from 'react';
2
+ import type { TooltipProps } from '@synerise/ds-tooltip';
4
3
  export type LabelProps = {
5
4
  id?: string;
6
- label?: React.ReactNode;
7
- tooltip?: React.ReactNode;
8
- tooltipConfig?: TooltipExtendedProps & TooltipProps;
5
+ label?: ReactNode;
6
+ tooltip?: ReactNode;
7
+ tooltipConfig?: TooltipProps;
9
8
  style?: object;
10
9
  className?: string;
11
10
  };
@@ -8,8 +8,6 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
8
8
 
9
9
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
10
10
 
11
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
12
-
13
11
  function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
14
12
 
15
13
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
@@ -54,22 +52,12 @@ var generateId = function generateId() {
54
52
  };
55
53
 
56
54
  var AutosizeInput = /*#__PURE__*/function (_Component) {
57
- _inheritsLoose(AutosizeInput, _Component);
58
-
59
- AutosizeInput.getDerivedStateFromProps = function getDerivedStateFromProps(props, state) {
60
- var id = props.id;
61
- return id !== state.prevId ? {
62
- inputId: id || generateId(),
63
- prevId: id
64
- } : null;
65
- };
66
-
67
55
  function AutosizeInput(props) {
68
56
  var _this;
69
57
 
70
58
  _this = _Component.call(this, props) || this;
71
59
 
72
- _defineProperty(_assertThisInitialized(_this), "inputRef", function (el, originalElement) {
60
+ _defineProperty(_this, "inputRef", function (el, originalElement) {
73
61
  _this.input = el;
74
62
 
75
63
  if (typeof _this.props.inputRef === 'function') {
@@ -77,11 +65,11 @@ var AutosizeInput = /*#__PURE__*/function (_Component) {
77
65
  }
78
66
  });
79
67
 
80
- _defineProperty(_assertThisInitialized(_this), "placeHolderSizerRef", function (el) {
68
+ _defineProperty(_this, "placeHolderSizerRef", function (el) {
81
69
  _this.placeHolderSizer = el;
82
70
  });
83
71
 
84
- _defineProperty(_assertThisInitialized(_this), "sizerRef", function (el) {
72
+ _defineProperty(_this, "sizerRef", function (el) {
85
73
  var _this$props$transform = _this.props.transformRef,
86
74
  transformRef = _this$props$transform === void 0 ? function (el) {
87
75
  return el;
@@ -104,6 +92,16 @@ var AutosizeInput = /*#__PURE__*/function (_Component) {
104
92
  return _this;
105
93
  }
106
94
 
95
+ _inheritsLoose(AutosizeInput, _Component);
96
+
97
+ AutosizeInput.getDerivedStateFromProps = function getDerivedStateFromProps(props, state) {
98
+ var id = props.id;
99
+ return id !== state.prevId ? {
100
+ inputId: id || generateId(),
101
+ prevId: id
102
+ } : null;
103
+ };
104
+
107
105
  var _proto = AutosizeInput.prototype;
108
106
 
109
107
  _proto.componentDidMount = function componentDidMount() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-input",
3
- "version": "0.20.5",
3
+ "version": "0.20.7",
4
4
  "description": "Input UI Component for the Synerise Design System",
5
5
  "license": "ISC",
6
6
  "repository": "synerise/synerise-design",
@@ -33,11 +33,11 @@
33
33
  ],
34
34
  "types": "dist/index.d.ts",
35
35
  "dependencies": {
36
- "@synerise/ds-icon": "^0.60.6",
37
- "@synerise/ds-scrollbar": "^0.10.1",
38
- "@synerise/ds-tooltip": "^0.14.24",
39
- "@synerise/ds-typography": "^0.14.3",
40
- "@synerise/ds-utils": "^0.26.2",
36
+ "@synerise/ds-icon": "^0.60.7",
37
+ "@synerise/ds-scrollbar": "^0.10.2",
38
+ "@synerise/ds-tooltip": "^0.14.25",
39
+ "@synerise/ds-typography": "^0.15.0",
40
+ "@synerise/ds-utils": "^0.26.3",
41
41
  "antd-mask-input": "^0.1.13",
42
42
  "csstype": "2.6.9",
43
43
  "uuid": "^8.3.2"
@@ -49,7 +49,8 @@
49
49
  "styled-components": "5.0.1"
50
50
  },
51
51
  "devDependencies": {
52
- "@testing-library/react": "10.0.1"
52
+ "@testing-library/react": "10.0.1",
53
+ "@testing-library/user-event": "10.3.1"
53
54
  },
54
- "gitHead": "84c9ff34c60369cc819ab1d4307373fafaf06462"
55
+ "gitHead": "6f0dc42ae79cea009e60fdb1f91ef72dcc82998e"
55
56
  }