@cashub/ui 0.24.0 → 0.24.2

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/Tab/Tab.js CHANGED
@@ -13,14 +13,14 @@ const Tab = _ref => {
13
13
  selected,
14
14
  onChange,
15
15
  mode = 'view',
16
- onNameChange
16
+ onTitleChange
17
17
  } = _ref;
18
18
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_TabContext.default.Provider, {
19
19
  value: {
20
20
  selected,
21
21
  onChange,
22
22
  mode,
23
- onNameChange
23
+ onTitleChange
24
24
  },
25
25
  children: children
26
26
  });
package/Tab/TabTab.js CHANGED
@@ -16,16 +16,17 @@ const TabTab = _ref => {
16
16
  let {
17
17
  children,
18
18
  name,
19
+ title,
19
20
  ...props
20
21
  } = _ref;
21
22
  const {
22
23
  selected,
23
24
  onChange,
24
25
  mode,
25
- onNameChange
26
+ onTitleChange
26
27
  } = (0, _react.useContext)(_TabContext.default);
27
28
  const [isModify, setIsModify] = (0, _react.useState)(false);
28
- const [currentName, setCurrentName] = (0, _react.useState)(name);
29
+ const [currentTitle, setCurrentTitle] = (0, _react.useState)(title);
29
30
  const handleClick = (0, _react.useCallback)(() => {
30
31
  if (selected !== name) {
31
32
  onChange(name);
@@ -36,22 +37,22 @@ const TabTab = _ref => {
36
37
  setIsModify(true);
37
38
  };
38
39
  const handleBlur = () => {
39
- onNameChange(name, currentName);
40
+ onTitleChange(name, currentTitle);
40
41
  setIsModify(false);
41
42
  };
42
43
  const handleKeyUp = event => {
43
44
  const key = event.keyCode;
44
45
  if (key === _utils.KEY_CODE.ENTER) {
45
- onNameChange(name, currentName);
46
+ onTitleChange(name, currentTitle);
46
47
  setIsModify(false);
47
48
  }
48
49
  };
49
50
  return isModify ? /*#__PURE__*/(0, _jsxRuntime.jsx)(InputTab, {
50
51
  role: "tab",
51
52
  type: "text",
52
- value: currentName,
53
+ value: currentTitle,
53
54
  onChange: event => {
54
- setCurrentName(event.target.value);
55
+ setCurrentTitle(event.target.value);
55
56
  },
56
57
  onBlur: handleBlur,
57
58
  onKeyUp: handleKeyUp,
Binary file
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@cashub/ui",
3
- "version": "0.24.0",
3
+ "version": "0.24.2",
4
4
  "private": false,
5
- "author": "CASHUB Team",
6
- "description": "CASHUB UI components library",
5
+ "author": "CasHUB Team",
6
+ "description": "CasHUB UI components library",
7
7
  "main": "index.js",
8
8
  "keywords": [
9
- "CASHUB"
9
+ "CasHUB"
10
10
  ],
11
11
  "license": "MIT",
12
12
  "dependencies": {