@synerise/ds-select 1.0.4 → 1.1.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
+ # [1.1.0](https://github.com/synerise/synerise-design/compare/@synerise/ds-select@1.0.4...@synerise/ds-select@1.1.0) (2025-04-16)
7
+
8
+
9
+ ### Features
10
+
11
+ * **form-field:** add form-field component ([7f6b191](https://github.com/synerise/synerise-design/commit/7f6b191132a3b0d694c21fb4d649f4deea6acb89))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [1.0.4](https://github.com/synerise/synerise-design/compare/@synerise/ds-select@1.0.3...@synerise/ds-select@1.0.4) (2025-04-02)
7
18
 
8
19
  **Note:** Version bump only for package @synerise/ds-select
package/dist/Select.js CHANGED
@@ -1,22 +1,22 @@
1
1
  var _excluded = ["label", "description", "errorText", "error", "tooltip", "tooltipConfig", "clearTooltip", "prefixel", "suffixel", "style", "listHeight", "className", "getPopupContainer", "grey", "dropdownClassName", "asFormElement"];
2
- function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
3
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
4
- function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
5
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
2
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
3
+ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
4
+ function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); }
5
+ function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
6
6
  import React, { Component } from 'react';
7
- import { ErrorText, Description } from '@synerise/ds-typography';
8
7
  import '@synerise/ds-core/dist/js/style';
9
8
  import "./style/index.css";
10
9
  import Icon, { Close3M, CloseS } from '@synerise/ds-icon';
11
10
  import Tooltip from '@synerise/ds-tooltip';
11
+ import FormField from '@synerise/ds-form-field';
12
12
  import { getPopupContainer as defaultGetPopupContainer } from '@synerise/ds-utils';
13
13
  import classNames from 'classnames';
14
14
  import * as S from './Select.styles';
15
15
  var Select = /*#__PURE__*/function (_Component) {
16
- _inheritsLoose(Select, _Component);
17
16
  function Select() {
18
17
  return _Component.apply(this, arguments) || this;
19
18
  }
19
+ _inheritsLoose(Select, _Component);
20
20
  var _proto = Select.prototype;
21
21
  _proto.render = function render() {
22
22
  var _classNames;
@@ -44,11 +44,13 @@ var Select = /*#__PURE__*/function (_Component) {
44
44
  return /*#__PURE__*/React.createElement(S.SelectContainer, {
45
45
  className: "ds-select-container",
46
46
  hasBottomMargin: hasBottomMargin
47
- }, /*#__PURE__*/React.createElement(S.Label, {
47
+ }, /*#__PURE__*/React.createElement(FormField, {
48
+ errorText: errorText,
49
+ description: description,
48
50
  label: label,
49
51
  tooltip: tooltip,
50
52
  tooltipConfig: tooltipConfig
51
- }), /*#__PURE__*/React.createElement(S.SelectWrapper, {
53
+ }, /*#__PURE__*/React.createElement(S.SelectWrapper, {
52
54
  grey: grey,
53
55
  error: Boolean(errorText),
54
56
  className: classNames('ds-select-wrapper', {
@@ -78,9 +80,7 @@ var Select = /*#__PURE__*/function (_Component) {
78
80
  error: errorText || error
79
81
  }),
80
82
  dropdownClassName: classNames('ps__child--consume', dropdownClassName)
81
- })), !!suffixel && /*#__PURE__*/React.createElement(S.SuffixWrapper, null, suffixel)), (errorText || description) && /*#__PURE__*/React.createElement(S.ContentBelow, null, errorText && /*#__PURE__*/React.createElement(ErrorText, null, errorText), description && /*#__PURE__*/React.createElement(Description, {
82
- disabled: antdProps.disabled
83
- }, description)));
83
+ })), !!suffixel && /*#__PURE__*/React.createElement(S.SuffixWrapper, null, suffixel))));
84
84
  };
85
85
  return Select;
86
86
  }(Component);
@@ -10,9 +10,6 @@ export declare const AntdSelect: import("styled-components").StyledComponent<Rea
10
10
  }, never>;
11
11
  export declare const AntdSelectOption: import("styled-components").StyledComponent<import("rc-select/lib/Option").OptionFC, any, {}, never>;
12
12
  export declare const AntdSelectOptGroup: import("styled-components").StyledComponent<import("rc-select/lib/OptGroup").OptionGroupFC, any, {}, never>;
13
- export declare const LabelWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
14
- export declare const ContentBelow: import("styled-components").StyledComponent<"div", any, {}, never>;
15
- export declare const Label: import("styled-components").StyledComponent<({ id, className, label, tooltip, tooltipConfig, style }: import("@synerise/ds-input/dist/Label/Label.types").LabelProps) => React.JSX.Element, any, {}, never>;
16
13
  export declare const PrefixWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
17
14
  export declare const SuffixWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
18
15
  export declare const SelectWrapper: import("styled-components").StyledComponent<"div", any, {
@@ -1,6 +1,5 @@
1
1
  import styled, { css } from 'styled-components';
2
2
  import Select from 'antd/lib/select';
3
- import { Label as DSLabel } from '@synerise/ds-input';
4
3
  var OptGroup = Select.OptGroup,
5
4
  Option = Select.Option;
6
5
  var errorStyle = function errorStyle(props) {
@@ -52,33 +51,21 @@ export var AntdSelectOptGroup = styled(OptGroup).withConfig({
52
51
  displayName: "Selectstyles__AntdSelectOptGroup",
53
52
  componentId: "sc-n9lk0v-3"
54
53
  })([""]);
55
- export var LabelWrapper = styled.div.withConfig({
56
- displayName: "Selectstyles__LabelWrapper",
57
- componentId: "sc-n9lk0v-4"
58
- })(["margin:0 0 8px 0;"]);
59
- export var ContentBelow = styled.div.withConfig({
60
- displayName: "Selectstyles__ContentBelow",
61
- componentId: "sc-n9lk0v-5"
62
- })(["margin-top:8px;"]);
63
- export var Label = styled(DSLabel).withConfig({
64
- displayName: "Selectstyles__Label",
65
- componentId: "sc-n9lk0v-6"
66
- })(["margin-bottom:8px;span > .ds-icon > svg{margin-top:-1px;}"]);
67
54
  export var PrefixWrapper = styled.div.withConfig({
68
55
  displayName: "Selectstyles__PrefixWrapper",
69
- componentId: "sc-n9lk0v-7"
56
+ componentId: "sc-n9lk0v-4"
70
57
  })(["border-radius:3px 0 0 3px;margin-right:-2px;padding-right:1px;", ";"], function (props) {
71
58
  return addonStyles(props);
72
59
  });
73
60
  export var SuffixWrapper = styled.div.withConfig({
74
61
  displayName: "Selectstyles__SuffixWrapper",
75
- componentId: "sc-n9lk0v-8"
62
+ componentId: "sc-n9lk0v-5"
76
63
  })(["border-radius:0 3px 3px 0;margin-left:-1px;", ";"], function (props) {
77
64
  return addonStyles(props);
78
65
  });
79
66
  export var SelectWrapper = styled.div.withConfig({
80
67
  displayName: "Selectstyles__SelectWrapper",
81
- componentId: "sc-n9lk0v-9"
68
+ componentId: "sc-n9lk0v-6"
82
69
  })(["display:flex;", ""], function (props) {
83
70
  return props.grey && !props.error && css(["&&{.ant-select-selector{background-color:", ";}}"], props.theme.palette['grey-050']);
84
71
  });
@@ -1,15 +1,9 @@
1
- import type { SelectProps, SelectValue } from 'antd/lib/select';
2
- import type { TooltipProps } from 'antd/lib/tooltip';
3
1
  import type { ReactNode, ReactText } from 'react';
2
+ import type { SelectProps, SelectValue } from 'antd/lib/select';
4
3
  import type { CSSObject } from 'styled-components';
5
- import type TooltipExtendedProps from '@synerise/ds-tooltip/dist/Tooltip.types';
6
- export interface Props<T = SelectValue> extends Omit<SelectProps<T>, 'listHeight'> {
7
- errorText?: ReactNode | string;
4
+ import type { FormFieldCommonProps } from '@synerise/ds-form-field';
5
+ export type Props<T = SelectValue> = Omit<SelectProps<T>, 'listHeight'> & {
8
6
  error?: boolean;
9
- label?: ReactNode;
10
- description?: ReactNode;
11
- tooltip?: ReactNode;
12
- tooltipConfig?: TooltipExtendedProps & TooltipProps;
13
7
  clearTooltip?: string;
14
8
  prefixel?: ReactNode;
15
9
  suffixel?: ReactNode;
@@ -17,4 +11,4 @@ export interface Props<T = SelectValue> extends Omit<SelectProps<T>, 'listHeight
17
11
  grey?: boolean;
18
12
  asFormElement?: boolean;
19
13
  selectorStyle?: CSSObject;
20
- }
14
+ } & FormFieldCommonProps;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-select",
3
- "version": "1.0.4",
3
+ "version": "1.1.0",
4
4
  "description": "Select UI Component for the Synerise Design System",
5
5
  "license": "ISC",
6
6
  "repository": "synerise/synerise-design",
@@ -34,10 +34,9 @@
34
34
  ],
35
35
  "types": "dist/index.d.ts",
36
36
  "dependencies": {
37
- "@synerise/ds-icon": "^1.3.0",
38
- "@synerise/ds-input": "^1.0.4",
39
- "@synerise/ds-tooltip": "^1.1.3",
40
- "@synerise/ds-typography": "^1.0.4",
37
+ "@synerise/ds-form-field": "^1.1.0",
38
+ "@synerise/ds-icon": "^1.4.0",
39
+ "@synerise/ds-tooltip": "^1.1.4",
41
40
  "@synerise/ds-utils": "^1.0.1",
42
41
  "classnames": "2.3.2"
43
42
  },
@@ -47,5 +46,5 @@
47
46
  "react": ">=16.9.0 <= 18.3.1",
48
47
  "styled-components": "^5.3.3"
49
48
  },
50
- "gitHead": "dc78b03be09e793ec84f1dafc59c5616e77f1196"
49
+ "gitHead": "6735f9babfeef53122f54ca86cba5f581e8870d9"
51
50
  }