@elliemae/ds-tabs 2.0.0-rc.1 → 2.0.0-rc.10

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/cjs/TabBar.js CHANGED
@@ -1,7 +1,6 @@
1
1
  'use strict';
2
2
 
3
3
  var _jsx = require('@babel/runtime/helpers/jsx');
4
- var _defineProperty = require('@babel/runtime/helpers/defineProperty');
5
4
  require('core-js/modules/esnext.async-iterator.map.js');
6
5
  require('core-js/modules/esnext.iterator.map.js');
7
6
  var React = require('react');
@@ -17,7 +16,6 @@ var jsxRuntime = require('react/jsx-runtime');
17
16
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
18
17
 
19
18
  var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
20
- var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
21
19
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
22
20
  var RequiredMark__default = /*#__PURE__*/_interopDefaultLegacy(RequiredMark);
23
21
  var memoizeOne__default = /*#__PURE__*/_interopDefaultLegacy(memoizeOne);
@@ -72,7 +70,7 @@ class TabBar extends React.Component {
72
70
  constructor(_props) {
73
71
  super(_props);
74
72
 
75
- _defineProperty__default["default"](this, "handleTabClick", (tabId, e) => {
73
+ this.handleTabClick = (tabId, e) => {
76
74
  const {
77
75
  tabListRef,
78
76
  props
@@ -107,9 +105,9 @@ class TabBar extends React.Component {
107
105
 
108
106
  e.preventDefault();
109
107
  onTabClick(tabId);
110
- });
108
+ };
111
109
 
112
- _defineProperty__default["default"](this, "handleKeyPress", (tabId, e, index) => {
110
+ this.handleKeyPress = (tabId, e, index) => {
113
111
  const {
114
112
  tabs,
115
113
  handleDownArrow,
@@ -146,9 +144,9 @@ class TabBar extends React.Component {
146
144
  if (e.keyCode === 38 && handleUpArrow) {
147
145
  handleUpArrow(e);
148
146
  }
149
- });
147
+ };
150
148
 
151
- _defineProperty__default["default"](this, "handleTabsHeadersHorizontalScroll", lodash.debounce(() => {
149
+ this.handleTabsHeadersHorizontalScroll = lodash.debounce(() => {
152
150
  const {
153
151
  tabListRef,
154
152
  props
@@ -172,9 +170,8 @@ class TabBar extends React.Component {
172
170
  withRightGradients
173
171
  });
174
172
  }
175
- }, 50));
176
-
177
- _defineProperty__default["default"](this, "renderTabs", memoizeOne__default["default"]((activeTab, tabs) => {
173
+ }, 50);
174
+ this.renderTabs = memoizeOne__default["default"]((activeTab, tabs) => {
178
175
  const {
179
176
  showSeparator
180
177
  } = this.props;
@@ -223,8 +220,7 @@ class TabBar extends React.Component {
223
220
  })]
224
221
  }, tabId)];
225
222
  }, null);
226
- }));
227
-
223
+ });
228
224
  this.tabListRef = /*#__PURE__*/React__default["default"].createRef();
229
225
  this.resizeObserver = new resizeObserver.ResizeObserver(() => this.setIndicatorStyle());
230
226
  this.state = {
package/cjs/TabsPanels.js CHANGED
@@ -1,7 +1,6 @@
1
1
  'use strict';
2
2
 
3
3
  var _jsx = require('@babel/runtime/helpers/jsx');
4
- var _defineProperty = require('@babel/runtime/helpers/defineProperty');
5
4
  require('core-js/modules/web.dom-collections.iterator.js');
6
5
  require('core-js/modules/esnext.async-iterator.map.js');
7
6
  require('core-js/modules/esnext.iterator.map.js');
@@ -14,7 +13,6 @@ var PanelContainer = require('./PanelContainer.js');
14
13
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
15
14
 
16
15
  var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
17
- var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
18
16
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
19
17
  var memoizeOne__default = /*#__PURE__*/_interopDefaultLegacy(memoizeOne);
20
18
  var SwipeableViews__default = /*#__PURE__*/_interopDefaultLegacy(SwipeableViews);
@@ -29,8 +27,7 @@ const getIdByIndex = (children, index) => children && children[index].props.tabI
29
27
  class TabsPanels extends React.Component {
30
28
  constructor() {
31
29
  super(...arguments);
32
-
33
- _defineProperty__default["default"](this, "renderPanels", memoizeOne__default["default"]((activeTab, tabsComponents) => {
30
+ this.renderPanels = memoizeOne__default["default"]((activeTab, tabsComponents) => {
34
31
  const {
35
32
  animated,
36
33
  onlyRenderActiveTab,
@@ -61,7 +58,7 @@ class TabsPanels extends React.Component {
61
58
  style: style
62
59
  }, panelId, shouldRender && content);
63
60
  }, null);
64
- }));
61
+ });
65
62
  }
66
63
 
67
64
  render() {
package/esm/TabBar.js CHANGED
@@ -1,5 +1,4 @@
1
1
  import _jsx from '@babel/runtime/helpers/esm/jsx';
2
- import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
3
2
  import 'core-js/modules/esnext.async-iterator.map.js';
4
3
  import 'core-js/modules/esnext.iterator.map.js';
5
4
  import React, { Component } from 'react';
@@ -61,7 +60,7 @@ class TabBar extends Component {
61
60
  constructor(_props) {
62
61
  super(_props);
63
62
 
64
- _defineProperty(this, "handleTabClick", (tabId, e) => {
63
+ this.handleTabClick = (tabId, e) => {
65
64
  const {
66
65
  tabListRef,
67
66
  props
@@ -96,9 +95,9 @@ class TabBar extends Component {
96
95
 
97
96
  e.preventDefault();
98
97
  onTabClick(tabId);
99
- });
98
+ };
100
99
 
101
- _defineProperty(this, "handleKeyPress", (tabId, e, index) => {
100
+ this.handleKeyPress = (tabId, e, index) => {
102
101
  const {
103
102
  tabs,
104
103
  handleDownArrow,
@@ -135,9 +134,9 @@ class TabBar extends Component {
135
134
  if (e.keyCode === 38 && handleUpArrow) {
136
135
  handleUpArrow(e);
137
136
  }
138
- });
137
+ };
139
138
 
140
- _defineProperty(this, "handleTabsHeadersHorizontalScroll", debounce(() => {
139
+ this.handleTabsHeadersHorizontalScroll = debounce(() => {
141
140
  const {
142
141
  tabListRef,
143
142
  props
@@ -161,9 +160,8 @@ class TabBar extends Component {
161
160
  withRightGradients
162
161
  });
163
162
  }
164
- }, 50));
165
-
166
- _defineProperty(this, "renderTabs", memoizeOne((activeTab, tabs) => {
163
+ }, 50);
164
+ this.renderTabs = memoizeOne((activeTab, tabs) => {
167
165
  const {
168
166
  showSeparator
169
167
  } = this.props;
@@ -212,8 +210,7 @@ class TabBar extends Component {
212
210
  })]
213
211
  }, tabId)];
214
212
  }, null);
215
- }));
216
-
213
+ });
217
214
  this.tabListRef = /*#__PURE__*/React.createRef();
218
215
  this.resizeObserver = new ResizeObserver(() => this.setIndicatorStyle());
219
216
  this.state = {
package/esm/TabsPanels.js CHANGED
@@ -1,5 +1,4 @@
1
1
  import _jsx from '@babel/runtime/helpers/esm/jsx';
2
- import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
3
2
  import 'core-js/modules/web.dom-collections.iterator.js';
4
3
  import 'core-js/modules/esnext.async-iterator.map.js';
5
4
  import 'core-js/modules/esnext.iterator.map.js';
@@ -19,8 +18,7 @@ const getIdByIndex = (children, index) => children && children[index].props.tabI
19
18
  class TabsPanels extends Component {
20
19
  constructor() {
21
20
  super(...arguments);
22
-
23
- _defineProperty(this, "renderPanels", memoizeOne((activeTab, tabsComponents) => {
21
+ this.renderPanels = memoizeOne((activeTab, tabsComponents) => {
24
22
  const {
25
23
  animated,
26
24
  onlyRenderActiveTab,
@@ -51,7 +49,7 @@ class TabsPanels extends Component {
51
49
  style: style
52
50
  }, panelId, shouldRender && content);
53
51
  }, null);
54
- }));
52
+ });
55
53
  }
56
54
 
57
55
  render() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-tabs",
3
- "version": "2.0.0-rc.1",
3
+ "version": "2.0.0-rc.10",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Tabs",
6
6
  "module": "./esm/index.js",
@@ -72,20 +72,27 @@
72
72
  "build": "node ../../scripts/build/build.js"
73
73
  },
74
74
  "dependencies": {
75
- "@elliemae/ds-button": "2.0.0-rc.1",
76
- "@elliemae/ds-classnames": "2.0.0-rc.1",
77
- "@elliemae/ds-form": "2.0.0-rc.1",
78
- "@elliemae/ds-icons": "2.0.0-rc.1",
75
+ "@elliemae/ds-button": "2.0.0-rc.10",
76
+ "@elliemae/ds-classnames": "2.0.0-rc.10",
77
+ "@elliemae/ds-form": "2.0.0-rc.10",
78
+ "@elliemae/ds-icons": "2.0.0-rc.10",
79
79
  "memoize-one": "~5.1.1",
80
80
  "prop-types": "~15.7.2",
81
81
  "react-desc": "~4.1.3",
82
82
  "react-swipeable-views": "~0.13.9",
83
83
  "resize-observer": "~1.0.2"
84
84
  },
85
+ "devDependencies": {
86
+ "@testing-library/jest-dom": "~5.15.0",
87
+ "@testing-library/react": "~12.1.2",
88
+ "@testing-library/user-event": "~13.5.0",
89
+ "styled-components": "~5.3.3"
90
+ },
85
91
  "peerDependencies": {
86
92
  "lodash": "^4.17.21",
87
93
  "react": "^17.0.2",
88
- "react-dom": "^17.0.2"
94
+ "react-dom": "^17.0.2",
95
+ "styled-components": "^5.3.3"
89
96
  },
90
97
  "publishConfig": {
91
98
  "access": "public",
package/types/DSTab.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ /// <reference path="../../../../shared/typings/react-desc.d.ts" />
1
2
  /// <reference types="react" />
2
3
  declare const DSTab: {
3
4
  ({ tabId, title, required }: {
@@ -8,15 +9,43 @@ declare const DSTab: {
8
9
  displayName: string;
9
10
  propTypes: {
10
11
  /** unique id for tab */
11
- tabId: any;
12
+ tabId: {
13
+ defaultValue<T = unknown>(arg: T): {
14
+ deprecated: import("react-desc").PropTypesDescValidator;
15
+ };
16
+ isRequired: import("react-desc").PropTypesDescValidator;
17
+ };
12
18
  /** tab title */
13
- title: any;
19
+ title: {
20
+ defaultValue<T = unknown>(arg: T): {
21
+ deprecated: import("react-desc").PropTypesDescValidator;
22
+ };
23
+ isRequired: import("react-desc").PropTypesDescValidator;
24
+ };
14
25
  /** Show a required mark next to the title */
15
- required: any;
26
+ required: {
27
+ defaultValue<T = unknown>(arg: T): {
28
+ deprecated: import("react-desc").PropTypesDescValidator;
29
+ };
30
+ isRequired: import("react-desc").PropTypesDescValidator;
31
+ };
16
32
  /** Whether or not it's a ds-tab from DSMobile tabs */
17
- isDSMobile: any;
33
+ isDSMobile: {
34
+ defaultValue<T = unknown>(arg: T): {
35
+ deprecated: import("react-desc").PropTypesDescValidator;
36
+ };
37
+ isRequired: import("react-desc").PropTypesDescValidator;
38
+ };
18
39
  };
19
40
  };
20
- declare const DSTabWithSchema: any;
41
+ declare const DSTabWithSchema: {
42
+ (props?: {
43
+ tabId?: string | undefined;
44
+ title?: string | undefined;
45
+ required?: boolean | undefined;
46
+ } | undefined): JSX.Element;
47
+ propTypes: unknown;
48
+ toTypescript: () => import("react-desc").TypescriptSchema;
49
+ };
21
50
  export { DSTab, DSTabWithSchema };
22
51
  export default DSTab;
package/types/DSTabs.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ /// <reference path="../../../../shared/typings/react-desc.d.ts" />
1
2
  /// <reference types="react" />
2
3
  declare const DSTabs: {
3
4
  ({ containerProps, innerRef, animated, enableMouseEvents, allowTextSelection, onTabChange, tabsListAriaLabel, type, tabBarExtraContent, children: tabs, onlyRenderActiveTab, activeTab, withCarousel, firstSubtabRef, lastTabRef, flexibleTabsHeaders, fixedTabsHeaders, isDSMobile, }: {
@@ -22,43 +23,151 @@ declare const DSTabs: {
22
23
  }): JSX.Element;
23
24
  propTypes: {
24
25
  /** Whether the tab transition should animate or not */
25
- animated: any;
26
+ animated: {
27
+ defaultValue<T = unknown>(arg: T): {
28
+ deprecated: import("react-desc").PropTypesDescValidator;
29
+ };
30
+ isRequired: import("react-desc").PropTypesDescValidator;
31
+ };
26
32
  /** Enables tab transition with mouse drag events */
27
- enableMouseEvents: any;
33
+ enableMouseEvents: {
34
+ defaultValue<T = unknown>(arg: T): {
35
+ deprecated: import("react-desc").PropTypesDescValidator;
36
+ };
37
+ isRequired: import("react-desc").PropTypesDescValidator;
38
+ };
28
39
  /** Allow text selection when mouse drag events are active */
29
- allowTextSelection: any;
40
+ allowTextSelection: {
41
+ defaultValue<T = unknown>(arg: T): {
42
+ deprecated: import("react-desc").PropTypesDescValidator;
43
+ };
44
+ isRequired: import("react-desc").PropTypesDescValidator;
45
+ };
30
46
  /** Handler when a user clicks on a different tab */
31
- onTabChange: any;
47
+ onTabChange: {
48
+ defaultValue<T = unknown>(arg: T): {
49
+ deprecated: import("react-desc").PropTypesDescValidator;
50
+ };
51
+ isRequired: import("react-desc").PropTypesDescValidator;
52
+ };
32
53
  /** Tab type */
33
- type: any;
54
+ type: {
55
+ defaultValue<T = unknown>(arg: T): {
56
+ deprecated: import("react-desc").PropTypesDescValidator;
57
+ };
58
+ isRequired: import("react-desc").PropTypesDescValidator;
59
+ };
34
60
  /** Extra content next to the tabs pills */
35
- tabBarExtraContent: any;
61
+ tabBarExtraContent: {
62
+ defaultValue<T = unknown>(arg: T): {
63
+ deprecated: import("react-desc").PropTypesDescValidator;
64
+ };
65
+ isRequired: import("react-desc").PropTypesDescValidator;
66
+ };
36
67
  /** Only renders the active tab in the DOM */
37
- onlyRenderActiveTab: any;
68
+ onlyRenderActiveTab: {
69
+ defaultValue<T = unknown>(arg: T): {
70
+ deprecated: import("react-desc").PropTypesDescValidator;
71
+ };
72
+ isRequired: import("react-desc").PropTypesDescValidator;
73
+ };
38
74
  /** Mobile only flexible tabs mode */
39
- flexibleTabsHeaders: any;
75
+ flexibleTabsHeaders: {
76
+ defaultValue<T = unknown>(arg: T): {
77
+ deprecated: import("react-desc").PropTypesDescValidator;
78
+ };
79
+ isRequired: import("react-desc").PropTypesDescValidator;
80
+ };
40
81
  /** Mobile only fixed tabs mode */
41
- fixedTabsHeaders: any;
82
+ fixedTabsHeaders: {
83
+ defaultValue<T = unknown>(arg: T): {
84
+ deprecated: import("react-desc").PropTypesDescValidator;
85
+ };
86
+ isRequired: import("react-desc").PropTypesDescValidator;
87
+ };
42
88
  /** Whether or not it's a ds-tab from DSMobile tabs */
43
- isDSMobile: any;
89
+ isDSMobile: {
90
+ defaultValue<T = unknown>(arg: T): {
91
+ deprecated: import("react-desc").PropTypesDescValidator;
92
+ };
93
+ isRequired: import("react-desc").PropTypesDescValidator;
94
+ };
44
95
  /** Activate carousel behavior */
45
- withCarousel: any;
96
+ withCarousel: {
97
+ defaultValue<T = unknown>(arg: T): {
98
+ deprecated: import("react-desc").PropTypesDescValidator;
99
+ };
100
+ isRequired: import("react-desc").PropTypesDescValidator;
101
+ };
46
102
  /** The active tabId */
47
- activeTab: any;
103
+ activeTab: {
104
+ defaultValue<T = unknown>(arg: T): {
105
+ deprecated: import("react-desc").PropTypesDescValidator;
106
+ };
107
+ isRequired: import("react-desc").PropTypesDescValidator;
108
+ };
48
109
  /** tabs children */
49
110
  children: any;
50
111
  /** Aria label for the list */
51
- tabsListAriaLabel: any;
112
+ tabsListAriaLabel: {
113
+ defaultValue<T = unknown>(arg: T): {
114
+ deprecated: import("react-desc").PropTypesDescValidator;
115
+ };
116
+ isRequired: import("react-desc").PropTypesDescValidator;
117
+ };
52
118
  /** Additional properties for the container */
53
- containerProps: any;
119
+ containerProps: {
120
+ defaultValue<T = unknown>(arg: T): {
121
+ deprecated: import("react-desc").PropTypesDescValidator;
122
+ };
123
+ isRequired: import("react-desc").PropTypesDescValidator;
124
+ };
54
125
  /** REF */
55
- innerRef: any;
126
+ innerRef: {
127
+ defaultValue<T = unknown>(arg: T): {
128
+ deprecated: import("react-desc").PropTypesDescValidator;
129
+ };
130
+ isRequired: import("react-desc").PropTypesDescValidator;
131
+ };
56
132
  /** internal ref to handle keyboard a11y behavior */
57
- firstSubtabRef: any;
133
+ firstSubtabRef: {
134
+ defaultValue<T = unknown>(arg: T): {
135
+ deprecated: import("react-desc").PropTypesDescValidator;
136
+ };
137
+ isRequired: import("react-desc").PropTypesDescValidator;
138
+ };
58
139
  /** internal ref to handle keyboard a11y behavior */
59
- lastTabRef: any;
140
+ lastTabRef: {
141
+ defaultValue<T = unknown>(arg: T): {
142
+ deprecated: import("react-desc").PropTypesDescValidator;
143
+ };
144
+ isRequired: import("react-desc").PropTypesDescValidator;
145
+ };
60
146
  };
61
147
  };
62
- declare const DSTabsWithSchema: any;
148
+ declare const DSTabsWithSchema: {
149
+ (props?: {
150
+ containerProps?: {} | undefined;
151
+ innerRef: any;
152
+ animated?: boolean | undefined;
153
+ enableMouseEvents?: boolean | undefined;
154
+ allowTextSelection?: boolean | undefined;
155
+ onTabChange?: (() => null) | undefined;
156
+ tabsListAriaLabel?: string | undefined;
157
+ type?: string | undefined;
158
+ tabBarExtraContent?: undefined;
159
+ children: any;
160
+ onlyRenderActiveTab?: boolean | undefined;
161
+ activeTab: any;
162
+ withCarousel?: boolean | undefined;
163
+ firstSubtabRef: any;
164
+ lastTabRef: any;
165
+ flexibleTabsHeaders: any;
166
+ fixedTabsHeaders: any;
167
+ isDSMobile?: boolean | undefined;
168
+ } | undefined): JSX.Element;
169
+ propTypes: unknown;
170
+ toTypescript: () => import("react-desc").TypescriptSchema; /** Handler when a user clicks on a different tab */
171
+ };
63
172
  export { DSTabs, DSTabsWithSchema };
64
173
  export default DSTabs;