amssui 1.0.19 → 1.0.22

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/es/index.d.ts CHANGED
@@ -1,2 +1,4 @@
1
1
  export type { ButtonModalProps } from './button-modal';
2
2
  export { default as ButtonModal } from './button-modal';
3
+ export type { MenuNavIconProps } from './menu-nav-icon-button';
4
+ export { default as MenuNavIconButton } from './menu-nav-icon-button';
package/es/index.js CHANGED
@@ -1 +1,2 @@
1
- export { default as ButtonModal } from './button-modal';
1
+ export { default as ButtonModal } from './button-modal';
2
+ export { default as MenuNavIconButton } from './menu-nav-icon-button';
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ export declare type MenuNavIconProps = {
3
+ onChange?: (status: boolean) => void;
4
+ onClick?: () => void;
5
+ status?: boolean;
6
+ };
7
+ declare const MenuNavIconButton: React.FC<MenuNavIconProps>;
8
+ export default MenuNavIconButton;
@@ -0,0 +1,61 @@
1
+ var __read = this && this.__read || function (o, n) {
2
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
3
+ if (!m) return o;
4
+ var i = m.call(o),
5
+ r,
6
+ ar = [],
7
+ e;
8
+
9
+ try {
10
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
11
+ ar.push(r.value);
12
+ }
13
+ } catch (error) {
14
+ e = {
15
+ error: error
16
+ };
17
+ } finally {
18
+ try {
19
+ if (r && !r.done && (m = i["return"])) m.call(i);
20
+ } finally {
21
+ if (e) throw e.error;
22
+ }
23
+ }
24
+
25
+ return ar;
26
+ };
27
+
28
+ import { useControllableValue } from 'ahooks';
29
+ import classNames from 'classnames';
30
+ import React from 'react';
31
+
32
+ var MenuNavIconButton = function MenuNavIconButton(props) {
33
+ var _onClick = props.onClick;
34
+
35
+ var _a = __read(useControllableValue(props, {
36
+ valuePropName: 'status'
37
+ }), 2),
38
+ status = _a[0],
39
+ setStatus = _a[1];
40
+
41
+ return /*#__PURE__*/React.createElement("div", {
42
+ className: classNames('menu-nav-icon', {
43
+ open: status
44
+ }),
45
+ onClick: function onClick() {
46
+ var nextStatus = !status;
47
+ setStatus(nextStatus);
48
+ _onClick === null || _onClick === void 0 ? void 0 : _onClick();
49
+ }
50
+ }, /*#__PURE__*/React.createElement("div", {
51
+ className: "menu-nav-icon-wrap"
52
+ }, /*#__PURE__*/React.createElement("span", {
53
+ className: "menu-nav-icon-bar"
54
+ }), /*#__PURE__*/React.createElement("span", {
55
+ className: "menu-nav-icon-bar"
56
+ }), /*#__PURE__*/React.createElement("span", {
57
+ className: "menu-nav-icon-bar"
58
+ })));
59
+ };
60
+
61
+ export default MenuNavIconButton;
@@ -0,0 +1,33 @@
1
+ .menu-nav-icon-wrap {
2
+ display: flex;
3
+ flex-direction: column;
4
+ align-items: flex-start;
5
+ width: 44px;
6
+ padding: 9px 10px;
7
+ border: 1px solid transparent;
8
+ border-radius: 4px;
9
+ }
10
+ .menu-nav-icon-bar {
11
+ display: inline-block;
12
+ width: 22px;
13
+ height: 2px;
14
+ margin-top: 4px;
15
+ background-color: #fff;
16
+ border-radius: 1px;
17
+ }
18
+ .menu-nav-icon span {
19
+ display: block;
20
+ transform: rotate(0deg);
21
+ transition: 0.25s ease-in-out;
22
+ }
23
+ .menu-nav-icon.open span:nth-child(1) {
24
+ position: relative;
25
+ top: 6px;
26
+ transform: rotate(45deg);
27
+ }
28
+ .menu-nav-icon.open span:nth-child(2) {
29
+ transform: rotate(-45deg);
30
+ }
31
+ .menu-nav-icon.open span:nth-child(3) {
32
+ width: 0;
33
+ }
@@ -0,0 +1 @@
1
+ import './index.less';
@@ -0,0 +1 @@
1
+ import './index.less';
@@ -0,0 +1,38 @@
1
+ .menu-nav-icon-wrap {
2
+ display: flex;
3
+ flex-direction: column;
4
+ align-items: flex-start;
5
+ width: 44px;
6
+ padding: 9px 10px;
7
+ border: 1px solid transparent;
8
+ border-radius: 4px;
9
+ }
10
+
11
+ .menu-nav-icon-bar {
12
+ display: inline-block;
13
+ width: 22px;
14
+ height: 2px;
15
+ margin-top: 4px;
16
+ background-color: #fff;
17
+ border-radius: 1px;
18
+ }
19
+
20
+ .menu-nav-icon span {
21
+ display: block;
22
+ transform: rotate(0deg);
23
+ transition: 0.25s ease-in-out;
24
+ }
25
+
26
+ .menu-nav-icon.open span:nth-child(1) {
27
+ position: relative;
28
+ top: 6px;
29
+ transform: rotate(45deg);
30
+ }
31
+
32
+ .menu-nav-icon.open span:nth-child(2) {
33
+ transform: rotate(-45deg);
34
+ }
35
+
36
+ .menu-nav-icon.open span:nth-child(3) {
37
+ width: 0;
38
+ }
package/lib/index.d.ts CHANGED
@@ -1,2 +1,4 @@
1
1
  export type { ButtonModalProps } from './button-modal';
2
2
  export { default as ButtonModal } from './button-modal';
3
+ export type { MenuNavIconProps } from './menu-nav-icon-button';
4
+ export { default as MenuNavIconButton } from './menu-nav-icon-button';
package/lib/index.js CHANGED
@@ -9,7 +9,7 @@ var __importDefault = this && this.__importDefault || function (mod) {
9
9
  Object.defineProperty(exports, "__esModule", {
10
10
  value: true
11
11
  });
12
- exports.ButtonModal = void 0;
12
+ exports.MenuNavIconButton = exports.ButtonModal = void 0;
13
13
 
14
14
  var button_modal_1 = require("./button-modal");
15
15
 
@@ -18,4 +18,13 @@ Object.defineProperty(exports, "ButtonModal", {
18
18
  get: function get() {
19
19
  return __importDefault(button_modal_1)["default"];
20
20
  }
21
+ });
22
+
23
+ var menu_nav_icon_button_1 = require("./menu-nav-icon-button");
24
+
25
+ Object.defineProperty(exports, "MenuNavIconButton", {
26
+ enumerable: true,
27
+ get: function get() {
28
+ return __importDefault(menu_nav_icon_button_1)["default"];
29
+ }
21
30
  });
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ export declare type MenuNavIconProps = {
3
+ onChange?: (status: boolean) => void;
4
+ onClick?: () => void;
5
+ status?: boolean;
6
+ };
7
+ declare const MenuNavIconButton: React.FC<MenuNavIconProps>;
8
+ export default MenuNavIconButton;
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+
3
+ var __read = this && this.__read || function (o, n) {
4
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
5
+ if (!m) return o;
6
+ var i = m.call(o),
7
+ r,
8
+ ar = [],
9
+ e;
10
+
11
+ try {
12
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
13
+ ar.push(r.value);
14
+ }
15
+ } catch (error) {
16
+ e = {
17
+ error: error
18
+ };
19
+ } finally {
20
+ try {
21
+ if (r && !r.done && (m = i["return"])) m.call(i);
22
+ } finally {
23
+ if (e) throw e.error;
24
+ }
25
+ }
26
+
27
+ return ar;
28
+ };
29
+
30
+ var __importDefault = this && this.__importDefault || function (mod) {
31
+ return mod && mod.__esModule ? mod : {
32
+ "default": mod
33
+ };
34
+ };
35
+
36
+ Object.defineProperty(exports, "__esModule", {
37
+ value: true
38
+ });
39
+
40
+ var ahooks_1 = require("ahooks");
41
+
42
+ var classnames_1 = __importDefault(require("classnames"));
43
+
44
+ var react_1 = __importDefault(require("react"));
45
+
46
+ var MenuNavIconButton = function MenuNavIconButton(props) {
47
+ var _onClick = props.onClick;
48
+
49
+ var _a = __read((0, ahooks_1.useControllableValue)(props, {
50
+ valuePropName: 'status'
51
+ }), 2),
52
+ status = _a[0],
53
+ setStatus = _a[1];
54
+
55
+ return react_1["default"].createElement("div", {
56
+ className: (0, classnames_1["default"])('menu-nav-icon', {
57
+ open: status
58
+ }),
59
+ onClick: function onClick() {
60
+ var nextStatus = !status;
61
+ setStatus(nextStatus);
62
+ _onClick === null || _onClick === void 0 ? void 0 : _onClick();
63
+ }
64
+ }, react_1["default"].createElement("div", {
65
+ className: "menu-nav-icon-wrap"
66
+ }, react_1["default"].createElement("span", {
67
+ className: "menu-nav-icon-bar"
68
+ }), react_1["default"].createElement("span", {
69
+ className: "menu-nav-icon-bar"
70
+ }), react_1["default"].createElement("span", {
71
+ className: "menu-nav-icon-bar"
72
+ })));
73
+ };
74
+
75
+ exports["default"] = MenuNavIconButton;
@@ -0,0 +1,33 @@
1
+ .menu-nav-icon-wrap {
2
+ display: flex;
3
+ flex-direction: column;
4
+ align-items: flex-start;
5
+ width: 44px;
6
+ padding: 9px 10px;
7
+ border: 1px solid transparent;
8
+ border-radius: 4px;
9
+ }
10
+ .menu-nav-icon-bar {
11
+ display: inline-block;
12
+ width: 22px;
13
+ height: 2px;
14
+ margin-top: 4px;
15
+ background-color: #fff;
16
+ border-radius: 1px;
17
+ }
18
+ .menu-nav-icon span {
19
+ display: block;
20
+ transform: rotate(0deg);
21
+ transition: 0.25s ease-in-out;
22
+ }
23
+ .menu-nav-icon.open span:nth-child(1) {
24
+ position: relative;
25
+ top: 6px;
26
+ transform: rotate(45deg);
27
+ }
28
+ .menu-nav-icon.open span:nth-child(2) {
29
+ transform: rotate(-45deg);
30
+ }
31
+ .menu-nav-icon.open span:nth-child(3) {
32
+ width: 0;
33
+ }
@@ -0,0 +1 @@
1
+ import './index.less';
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+
7
+ require("./index.less");
@@ -0,0 +1,38 @@
1
+ .menu-nav-icon-wrap {
2
+ display: flex;
3
+ flex-direction: column;
4
+ align-items: flex-start;
5
+ width: 44px;
6
+ padding: 9px 10px;
7
+ border: 1px solid transparent;
8
+ border-radius: 4px;
9
+ }
10
+
11
+ .menu-nav-icon-bar {
12
+ display: inline-block;
13
+ width: 22px;
14
+ height: 2px;
15
+ margin-top: 4px;
16
+ background-color: #fff;
17
+ border-radius: 1px;
18
+ }
19
+
20
+ .menu-nav-icon span {
21
+ display: block;
22
+ transform: rotate(0deg);
23
+ transition: 0.25s ease-in-out;
24
+ }
25
+
26
+ .menu-nav-icon.open span:nth-child(1) {
27
+ position: relative;
28
+ top: 6px;
29
+ transform: rotate(45deg);
30
+ }
31
+
32
+ .menu-nav-icon.open span:nth-child(2) {
33
+ transform: rotate(-45deg);
34
+ }
35
+
36
+ .menu-nav-icon.open span:nth-child(3) {
37
+ width: 0;
38
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "amssui",
3
- "version": "1.0.19",
3
+ "version": "1.0.22",
4
4
  "description": "react ui library",
5
5
  "author": "jason <usochen@gmail.com>",
6
6
  "main": "./lib/index.js",
@@ -31,13 +31,13 @@
31
31
  ],
32
32
  "dependencies": {
33
33
  "@ahooksjs/use-url-state": "^2.5.8",
34
- "a-icons": "^1.0.81",
34
+ "a-icons": "^1.0.83",
35
35
  "aa-utils": "^2.0.35",
36
36
  "ahooks": "^3.0.8"
37
37
  },
38
38
  "peerDependencies": {
39
39
  "react": "^16.8.6 || ^17.0 || ^18.0",
40
- "react-vant": "^2.0.0-alpha.41"
40
+ "react-vant": "^2.0.0-alpha.41 || ^3.0.0"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@types/enzyme": "^3.10.5",
@@ -48,5 +48,5 @@
48
48
  "node": ">=10.0.0"
49
49
  },
50
50
  "license": "MIT",
51
- "gitHead": "b0a0e42e40dc05d01770b43640169dd051bd60f3"
51
+ "gitHead": "9fdda4197f9bfd225a2fd786ad4c178fe16937a5"
52
52
  }