@elliemae/ds-pills 2.4.3-rc.6 → 2.4.3

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.
@@ -13,10 +13,9 @@ var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
13
13
  var Grid__default = /*#__PURE__*/_interopDefaultLegacy(Grid);
14
14
 
15
15
  /* eslint-disable max-lines */
16
-
17
- // =============================================================================
18
16
  // Common CSS
19
17
  // =============================================================================
18
+
20
19
  const borderOutside = function (color) {
21
20
  let size = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
22
21
  let zIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 2;
@@ -104,11 +103,10 @@ const StyledInputPillWrapper = /*#__PURE__*/styled__default["default"](Grid__def
104
103
  componentId: "sc-j0tlch-2"
105
104
  })(["", " background:", ";padding:0;", ":focus-within{", "}:active{", "}& .em-ds-input{outline:none !important;border:none !important;box-shadow:none !important;border-radius:0 !important;height:100%;background:transparent;width:", ";padding:0;margin:0 0 0 8px;}& .em-ds-input__tooltip-ref{height:100%;}"], commonPillWrapperCss, props => props.theme.colors.neutral['000'], _ref6 => {
106
105
  let {
107
- theme,
108
- hasError
106
+ value,
107
+ theme
109
108
  } = _ref6;
110
- if (hasError) return borderOutside(theme.colors.danger[900]);
111
- return borderOutside(theme.colors.brand[500]);
109
+ return borderOutside(value === '' ? theme.colors.neutral[400] : theme.colors.brand[500]);
112
110
  }, props => props.inputHasFocus ? borderOutside(props.theme.colors.brand[700], 2) : '', props => props.inputHasFocus ? borderOutside(props.theme.colors.brand[500]) : '', props => `${props.inputWidth + (props.value === '' ? 24 : 0)}px`);
113
111
  const StyledDropdownPillWrapper = /*#__PURE__*/styled__default["default"](Grid__default["default"]).withConfig({
114
112
  componentId: "sc-j0tlch-3"
@@ -24,13 +24,11 @@ const InputPill = /*#__PURE__*/React__default["default"].memo(_ref => {
24
24
  inputRender,
25
25
  onInputChange,
26
26
  onInputClear,
27
- innerRef,
28
- hasError,
29
- inputId
27
+ innerRef
30
28
  } = _ref;
31
29
  const ref = React.useRef(null);
32
30
  const InputComponent = React.useMemo(() => inputRender, [inputRender]);
33
- const pillUid = React.useMemo(() => inputId ?? `ds-pill-${uid.uid()}`, []);
31
+ const pillUid = React.useMemo(() => `ds-pill-${uid.uid()}`, []);
34
32
  const onCloseIconClick = React.useCallback(e => {
35
33
  if ([undefined, 'Enter', 'Space'].includes(e.code)) {
36
34
  e.preventDefault();
@@ -46,8 +44,7 @@ const InputPill = /*#__PURE__*/React__default["default"].memo(_ref => {
46
44
  cols: label === '' ? ['auto'] : ['auto', '24px'],
47
45
  inputWidth: inputWidth,
48
46
  value: label,
49
- inputHasFocus: inputHasFocus,
50
- hasError: hasError
47
+ inputHasFocus: inputHasFocus
51
48
  }, void 0, /*#__PURE__*/_jsx__default["default"](InputComponent, {
52
49
  id: pillUid,
53
50
  className: "ds-pill-focus-point",
package/cjs/props.js CHANGED
@@ -22,11 +22,8 @@ const DSPillV2PropTypes = {
22
22
  onInputChange: reactDesc.PropTypes.func.description('Callback triggered when user provides input to the input pill').defaultValue(() => null),
23
23
  onInputClear: reactDesc.PropTypes.func.description('Callback triggered when the user clears an input pill').defaultValue(() => null),
24
24
  inputWidth: reactDesc.PropTypes.number.description('Width in pixels for the input tag in the input pill').defaultValue(150),
25
- inputId: reactDesc.PropTypes.string.description('ID for the input pill').defaultValue(undefined),
26
25
  dropdownProps: reactDesc.PropTypes.object.description('Properties that will be used for the dropdown-menu').defaultValue({}),
27
- onDropdownClick: reactDesc.PropTypes.func.description('Callback when dropdown button is clicked or pressed').defaultValue(() => null),
28
- disabled: reactDesc.PropTypes.bool.description('Whether the pill should be disabled. Only for value and removable pill').defaultValue(false),
29
- hasError: reactDesc.PropTypes.bool.description('Whether the pill should be in an error state. Only for input pill').defaultValue(false)
26
+ onDropdownClick: reactDesc.PropTypes.func.description('Callback when dropdown button is clicked or pressed').defaultValue(() => null)
30
27
  };
31
28
  const DSPillButtonPropTypes = {
32
29
  type: reactDesc.PropTypes.oneOf(['only', 'left', 'right']).description('The position in which this button will be placed. Only used for css styling internally').defaultValue('right'),
@@ -40,7 +37,6 @@ const DSPillGroupPropTypes = {
40
37
  const DSPillV2DefaultProps = {
41
38
  innerRef: () => null,
42
39
  disabled: false,
43
- hasError: false,
44
40
  ariaLabel: '',
45
41
  size: 'm',
46
42
  labelTruncated: true,
@@ -4,10 +4,9 @@ import Grid from '@elliemae/ds-grid';
4
4
  import { DSButtonV2 } from '@elliemae/ds-button';
5
5
 
6
6
  /* eslint-disable max-lines */
7
-
8
- // =============================================================================
9
7
  // Common CSS
10
8
  // =============================================================================
9
+
11
10
  const borderOutside = function (color) {
12
11
  let size = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
13
12
  let zIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 2;
@@ -95,11 +94,10 @@ const StyledInputPillWrapper = /*#__PURE__*/styled(Grid).withConfig({
95
94
  componentId: "sc-j0tlch-2"
96
95
  })(["", " background:", ";padding:0;", ":focus-within{", "}:active{", "}& .em-ds-input{outline:none !important;border:none !important;box-shadow:none !important;border-radius:0 !important;height:100%;background:transparent;width:", ";padding:0;margin:0 0 0 8px;}& .em-ds-input__tooltip-ref{height:100%;}"], commonPillWrapperCss, props => props.theme.colors.neutral['000'], _ref6 => {
97
96
  let {
98
- theme,
99
- hasError
97
+ value,
98
+ theme
100
99
  } = _ref6;
101
- if (hasError) return borderOutside(theme.colors.danger[900]);
102
- return borderOutside(theme.colors.brand[500]);
100
+ return borderOutside(value === '' ? theme.colors.neutral[400] : theme.colors.brand[500]);
103
101
  }, props => props.inputHasFocus ? borderOutside(props.theme.colors.brand[700], 2) : '', props => props.inputHasFocus ? borderOutside(props.theme.colors.brand[500]) : '', props => `${props.inputWidth + (props.value === '' ? 24 : 0)}px`);
104
102
  const StyledDropdownPillWrapper = /*#__PURE__*/styled(Grid).withConfig({
105
103
  componentId: "sc-j0tlch-3"
@@ -15,13 +15,11 @@ const InputPill = /*#__PURE__*/React.memo(_ref => {
15
15
  inputRender,
16
16
  onInputChange,
17
17
  onInputClear,
18
- innerRef,
19
- hasError,
20
- inputId
18
+ innerRef
21
19
  } = _ref;
22
20
  const ref = useRef(null);
23
21
  const InputComponent = useMemo(() => inputRender, [inputRender]);
24
- const pillUid = useMemo(() => inputId ?? `ds-pill-${uid()}`, []);
22
+ const pillUid = useMemo(() => `ds-pill-${uid()}`, []);
25
23
  const onCloseIconClick = useCallback(e => {
26
24
  if ([undefined, 'Enter', 'Space'].includes(e.code)) {
27
25
  e.preventDefault();
@@ -37,8 +35,7 @@ const InputPill = /*#__PURE__*/React.memo(_ref => {
37
35
  cols: label === '' ? ['auto'] : ['auto', '24px'],
38
36
  inputWidth: inputWidth,
39
37
  value: label,
40
- inputHasFocus: inputHasFocus,
41
- hasError: hasError
38
+ inputHasFocus: inputHasFocus
42
39
  }, void 0, /*#__PURE__*/_jsx(InputComponent, {
43
40
  id: pillUid,
44
41
  className: "ds-pill-focus-point",
package/esm/props.js CHANGED
@@ -18,11 +18,8 @@ const DSPillV2PropTypes = {
18
18
  onInputChange: PropTypes.func.description('Callback triggered when user provides input to the input pill').defaultValue(() => null),
19
19
  onInputClear: PropTypes.func.description('Callback triggered when the user clears an input pill').defaultValue(() => null),
20
20
  inputWidth: PropTypes.number.description('Width in pixels for the input tag in the input pill').defaultValue(150),
21
- inputId: PropTypes.string.description('ID for the input pill').defaultValue(undefined),
22
21
  dropdownProps: PropTypes.object.description('Properties that will be used for the dropdown-menu').defaultValue({}),
23
- onDropdownClick: PropTypes.func.description('Callback when dropdown button is clicked or pressed').defaultValue(() => null),
24
- disabled: PropTypes.bool.description('Whether the pill should be disabled. Only for value and removable pill').defaultValue(false),
25
- hasError: PropTypes.bool.description('Whether the pill should be in an error state. Only for input pill').defaultValue(false)
22
+ onDropdownClick: PropTypes.func.description('Callback when dropdown button is clicked or pressed').defaultValue(() => null)
26
23
  };
27
24
  const DSPillButtonPropTypes = {
28
25
  type: PropTypes.oneOf(['only', 'left', 'right']).description('The position in which this button will be placed. Only used for css styling internally').defaultValue('right'),
@@ -36,7 +33,6 @@ const DSPillGroupPropTypes = {
36
33
  const DSPillV2DefaultProps = {
37
34
  innerRef: () => null,
38
35
  disabled: false,
39
- hasError: false,
40
36
  ariaLabel: '',
41
37
  size: 'm',
42
38
  labelTruncated: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-pills",
3
- "version": "2.4.3-rc.6",
3
+ "version": "2.4.3",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Pills",
6
6
  "module": "./esm/index.js",
@@ -144,20 +144,20 @@
144
144
  "build": "node ../../scripts/build/build.js"
145
145
  },
146
146
  "dependencies": {
147
- "@elliemae/ds-button": "2.4.3-rc.6",
148
- "@elliemae/ds-classnames": "2.4.3-rc.6",
149
- "@elliemae/ds-dropdownmenu": "2.4.3-rc.6",
150
- "@elliemae/ds-form": "2.4.3-rc.6",
151
- "@elliemae/ds-grid": "2.4.3-rc.6",
152
- "@elliemae/ds-icons": "2.4.3-rc.6",
153
- "@elliemae/ds-modal": "2.4.3-rc.6",
154
- "@elliemae/ds-popover": "2.4.3-rc.6",
155
- "@elliemae/ds-props-helpers": "2.4.3-rc.6",
156
- "@elliemae/ds-shared": "2.4.3-rc.6",
157
- "@elliemae/ds-system": "2.4.3-rc.6",
158
- "@elliemae/ds-tooltip": "2.4.3-rc.6",
159
- "@elliemae/ds-truncated-tooltip-text": "2.4.3-rc.6",
160
- "@elliemae/ds-utilities": "2.4.3-rc.6",
147
+ "@elliemae/ds-button": "2.4.3",
148
+ "@elliemae/ds-classnames": "2.4.3",
149
+ "@elliemae/ds-dropdownmenu": "2.4.3",
150
+ "@elliemae/ds-form": "2.4.3",
151
+ "@elliemae/ds-grid": "2.4.3",
152
+ "@elliemae/ds-icons": "2.4.3",
153
+ "@elliemae/ds-modal": "2.4.3",
154
+ "@elliemae/ds-popover": "2.4.3",
155
+ "@elliemae/ds-props-helpers": "2.4.3",
156
+ "@elliemae/ds-shared": "2.4.3",
157
+ "@elliemae/ds-system": "2.4.3",
158
+ "@elliemae/ds-tooltip": "2.4.3",
159
+ "@elliemae/ds-truncated-tooltip-text": "2.4.3",
160
+ "@elliemae/ds-utilities": "2.4.3",
161
161
  "prop-types": "~15.7.2",
162
162
  "react-desc": "~4.1.3",
163
163
  "uid": "~2.0.0"
@@ -1,13 +1,11 @@
1
1
  /// <reference types="react" />
2
- interface InputPillWrapperProps {
2
+ export declare const StyledLabelPillWrapper: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("@elliemae/ds-grid/types/react-desc-prop-types").DSGridT.Props & import("react").RefAttributes<HTMLDivElement>>, import("styled-components").DefaultTheme, {}, never>;
3
+ export declare const StyledValuePillWrapper: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("@elliemae/ds-grid/types/react-desc-prop-types").DSGridT.Props & import("react").RefAttributes<HTMLDivElement>>, import("styled-components").DefaultTheme, {}, never>;
4
+ export declare const StyledInputPillWrapper: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("@elliemae/ds-grid/types/react-desc-prop-types").DSGridT.Props & import("react").RefAttributes<HTMLDivElement>>, import("styled-components").DefaultTheme, {
3
5
  value: string;
4
6
  inputWidth: number;
5
7
  inputHasFocus: boolean;
6
- hasError: boolean;
7
- }
8
- export declare const StyledLabelPillWrapper: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("@elliemae/ds-grid/types/react-desc-prop-types").DSGridT.Props & import("react").RefAttributes<HTMLDivElement>>, import("styled-components").DefaultTheme, {}, never>;
9
- export declare const StyledValuePillWrapper: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("@elliemae/ds-grid/types/react-desc-prop-types").DSGridT.Props & import("react").RefAttributes<HTMLDivElement>>, import("styled-components").DefaultTheme, {}, never>;
10
- export declare const StyledInputPillWrapper: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("@elliemae/ds-grid/types/react-desc-prop-types").DSGridT.Props & import("react").RefAttributes<HTMLDivElement>>, import("styled-components").DefaultTheme, InputPillWrapperProps, never>;
8
+ }, never>;
11
9
  export declare const StyledDropdownPillWrapper: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("@elliemae/ds-grid/types/react-desc-prop-types").DSGridT.Props & import("react").RefAttributes<HTMLDivElement>>, import("styled-components").DefaultTheme, {}, never>;
12
10
  export declare const StyledReadonlyPillWrapper: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("@elliemae/ds-grid/types/react-desc-prop-types").DSGridT.Props & import("react").RefAttributes<HTMLDivElement>>, import("styled-components").DefaultTheme, {
13
11
  hasIconRight: boolean;
@@ -20,4 +18,3 @@ export declare const StyledPillButton: import("styled-components").StyledCompone
20
18
  width: string;
21
19
  height: string;
22
20
  }, never>;
23
- export {};
package/types/props.d.ts CHANGED
@@ -38,21 +38,12 @@ export declare const DSPillV2PropTypes: {
38
38
  inputWidth: {
39
39
  deprecated: import("react-desc").PropTypesDescValidator;
40
40
  };
41
- inputId: {
42
- deprecated: import("react-desc").PropTypesDescValidator;
43
- };
44
41
  dropdownProps: {
45
42
  deprecated: import("react-desc").PropTypesDescValidator;
46
43
  };
47
44
  onDropdownClick: {
48
45
  deprecated: import("react-desc").PropTypesDescValidator;
49
46
  };
50
- disabled: {
51
- deprecated: import("react-desc").PropTypesDescValidator;
52
- };
53
- hasError: {
54
- deprecated: import("react-desc").PropTypesDescValidator;
55
- };
56
47
  };
57
48
  export declare const DSPillButtonPropTypes: {
58
49
  type: {
@@ -76,7 +67,6 @@ export declare const DSPillGroupPropTypes: {
76
67
  export declare const DSPillV2DefaultProps: {
77
68
  innerRef: () => null;
78
69
  disabled: boolean;
79
- hasError: boolean;
80
70
  ariaLabel: string;
81
71
  size: string;
82
72
  labelTruncated: boolean;