@elliemae/ds-controlled-form 2.3.0-rc.1 → 2.3.1-rc.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.
@@ -25,7 +25,7 @@ var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
25
25
  var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
26
26
  var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
27
27
 
28
- const _excluded = ["id", "disabled", "readOnly", "label", "aria-label", "aria-controls", "onKeyDown"];
28
+ const _excluded = ["id", "disabled", "readOnly", "label", "aria-label", "aria-controls", "onKeyDown", "className"];
29
29
 
30
30
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
31
31
 
@@ -42,7 +42,8 @@ const DSControlledCheckbox = props => {
42
42
  innerRef,
43
43
  tabIndex,
44
44
  ariaLabel: legacyAriaLabel,
45
- ariaControls: legacyAriaControls
45
+ ariaControls: legacyAriaControls,
46
+ 'data-testid': dataTestid = 'ds-checkbox-container'
46
47
  } = propsWithDefault;
47
48
  const handleOnKeyDown = React.useCallback(e => {
48
49
  if (checkboxRef.current && e.key === 'Enter') {
@@ -60,18 +61,21 @@ const DSControlledCheckbox = props => {
60
61
  label: globalLabel,
61
62
  'aria-label': ariaLabel,
62
63
  'aria-controls': ariaControls,
63
- onKeyDown
64
+ onKeyDown,
65
+ className
64
66
  } = _useGetGlobalAttribut,
65
67
  restGlobals = _objectWithoutProperties__default["default"](_useGetGlobalAttribut, _excluded);
66
68
 
67
69
  return /*#__PURE__*/_jsx__default["default"](styles.StyledContainer, {
68
- "data-testid": "ds-checkbox-container"
70
+ "data-testid": dataTestid,
71
+ className: className
69
72
  }, void 0, /*#__PURE__*/_jsx__default["default"](styles.StyledCheckBox, {
70
73
  checked: checked,
71
74
  hasError: hasError,
72
75
  disabled: disabled,
73
76
  readOnly: readOnly
74
77
  }, void 0, /*#__PURE__*/jsxRuntime.jsx(styles.StyledInput, _objectSpread(_objectSpread({}, restGlobals), {}, {
78
+ "data-testid": "ds-checkbox",
75
79
  id: id,
76
80
  ref: ref => setMultipleRefs.setMultipleRefs([checkboxRef, innerRef])(ref),
77
81
  onKeyDown: handleOnKeyDown,
@@ -15,7 +15,7 @@ import { setMultipleRefs } from './utils/setMultipleRefs.js';
15
15
  import { useValidateProps } from './config/useValidateProps.js';
16
16
  import { jsx } from 'react/jsx-runtime';
17
17
 
18
- const _excluded = ["id", "disabled", "readOnly", "label", "aria-label", "aria-controls", "onKeyDown"];
18
+ const _excluded = ["id", "disabled", "readOnly", "label", "aria-label", "aria-controls", "onKeyDown", "className"];
19
19
 
20
20
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
21
21
 
@@ -32,7 +32,8 @@ const DSControlledCheckbox = props => {
32
32
  innerRef,
33
33
  tabIndex,
34
34
  ariaLabel: legacyAriaLabel,
35
- ariaControls: legacyAriaControls
35
+ ariaControls: legacyAriaControls,
36
+ 'data-testid': dataTestid = 'ds-checkbox-container'
36
37
  } = propsWithDefault;
37
38
  const handleOnKeyDown = useCallback(e => {
38
39
  if (checkboxRef.current && e.key === 'Enter') {
@@ -50,18 +51,21 @@ const DSControlledCheckbox = props => {
50
51
  label: globalLabel,
51
52
  'aria-label': ariaLabel,
52
53
  'aria-controls': ariaControls,
53
- onKeyDown
54
+ onKeyDown,
55
+ className
54
56
  } = _useGetGlobalAttribut,
55
57
  restGlobals = _objectWithoutProperties(_useGetGlobalAttribut, _excluded);
56
58
 
57
59
  return /*#__PURE__*/_jsx(StyledContainer, {
58
- "data-testid": "ds-checkbox-container"
60
+ "data-testid": dataTestid,
61
+ className: className
59
62
  }, void 0, /*#__PURE__*/_jsx(StyledCheckBox, {
60
63
  checked: checked,
61
64
  hasError: hasError,
62
65
  disabled: disabled,
63
66
  readOnly: readOnly
64
67
  }, void 0, /*#__PURE__*/jsx(StyledInput, _objectSpread(_objectSpread({}, restGlobals), {}, {
68
+ "data-testid": "ds-checkbox",
65
69
  id: id,
66
70
  ref: ref => setMultipleRefs([checkboxRef, innerRef])(ref),
67
71
  onKeyDown: handleOnKeyDown,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-controlled-form",
3
- "version": "2.3.0-rc.1",
3
+ "version": "2.3.1-rc.0",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Controlled Form Controllers",
6
6
  "module": "./esm/index.js",
@@ -720,15 +720,15 @@
720
720
  "build": "node ../../scripts/build/build.js"
721
721
  },
722
722
  "dependencies": {
723
- "@elliemae/ds-button": "2.3.0-rc.1",
724
- "@elliemae/ds-form-layout-blocks": "2.3.0-rc.1",
725
- "@elliemae/ds-grid": "2.3.0-rc.1",
726
- "@elliemae/ds-icon": "2.3.0-rc.1",
727
- "@elliemae/ds-icons": "2.3.0-rc.1",
728
- "@elliemae/ds-props-helpers": "2.3.0-rc.1",
729
- "@elliemae/ds-system": "2.3.0-rc.1",
730
- "@elliemae/ds-tooltip": "2.3.0-rc.1",
731
- "@elliemae/ds-truncated-tooltip-text": "2.3.0-rc.1",
723
+ "@elliemae/ds-button": "2.3.1-rc.0",
724
+ "@elliemae/ds-form-layout-blocks": "2.3.1-rc.0",
725
+ "@elliemae/ds-grid": "2.3.1-rc.0",
726
+ "@elliemae/ds-icon": "2.3.1-rc.0",
727
+ "@elliemae/ds-icons": "2.3.1-rc.0",
728
+ "@elliemae/ds-props-helpers": "2.3.1-rc.0",
729
+ "@elliemae/ds-system": "2.3.1-rc.0",
730
+ "@elliemae/ds-tooltip": "2.3.1-rc.0",
731
+ "@elliemae/ds-truncated-tooltip-text": "2.3.1-rc.0",
732
732
  "prop-types": "~15.7.2",
733
733
  "react-desc": "~4.1.3",
734
734
  "react-popper": "~2.2.5",
@@ -5,6 +5,7 @@ export declare namespace DSControlledCheckboxT {
5
5
  checked: boolean | 'mixed';
6
6
  tabIndex?: number;
7
7
  hasError?: boolean;
8
+ 'data-testid'?: string;
8
9
  }
9
10
  interface OptionalProps {
10
11
  innerRef: React.RefObject<HTMLInputElement> | React.LegacyRef<HTMLInputElement>;