musae 0.2.15 → 0.2.16
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/dist/components/avatar/group.d.ts +1 -1
- package/dist/components/avatar/group.js +10 -8
- package/dist/components/bench/bench.d.ts +4 -0
- package/dist/components/bench/bench.js +150 -0
- package/dist/components/bench/hooks.d.ts +22 -0
- package/dist/components/bench/hooks.js +111 -0
- package/dist/components/bench/index.d.ts +4 -0
- package/dist/components/bench/types.d.ts +78 -0
- package/dist/components/dialog/dialog.js +1 -1
- package/dist/components/dialog/popup.js +2 -2
- package/dist/components/dialog/types.d.ts +5 -0
- package/dist/components/divider/divider.d.ts +1 -1
- package/dist/components/divider/divider.js +4 -4
- package/dist/components/drawer/drawer.js +1 -1
- package/dist/components/layout/header.js +2 -2
- package/dist/components/layout/sider.d.ts +2 -2
- package/dist/components/layout/sider.js +7 -9
- package/dist/components/menu/context.js +0 -1
- package/dist/components/menu/hooks.d.ts +2 -3
- package/dist/components/menu/hooks.js +2 -4
- package/dist/components/menu/item.js +91 -109
- package/dist/components/menu/menu.js +0 -3
- package/dist/components/menu/types.d.ts +0 -8
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/dist/stylex.css +13 -2
- package/package.json +7 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { type AvatarGroupProps } from "./types";
|
|
3
|
-
declare const Group: ({ children: _children, shape, size, max }: AvatarGroupProps) => React.JSX.Element;
|
|
3
|
+
declare const Group: ({ children: _children, shape, size, max, }: AvatarGroupProps) => React.JSX.Element;
|
|
4
4
|
export default Group;
|
|
@@ -5,6 +5,7 @@ import { useClassNames } from '../../hooks/use-class-names.js';
|
|
|
5
5
|
import { ComponentToken, AvatarClassToken } from '../../utils/class-name.js';
|
|
6
6
|
import Popover from '../popover/popover.js';
|
|
7
7
|
import Avatar from './avatar.js';
|
|
8
|
+
import clsx from 'clsx';
|
|
8
9
|
|
|
9
10
|
var _Group = function Group(_ref) {
|
|
10
11
|
var _children = _ref.children,
|
|
@@ -14,13 +15,12 @@ var _Group = function Group(_ref) {
|
|
|
14
15
|
size = _ref$size === void 0 ? "medium" : _ref$size,
|
|
15
16
|
_ref$max = _ref.max,
|
|
16
17
|
max = _ref$max === void 0 ? 3 : _ref$max;
|
|
18
|
+
var classNames = useClassNames(ComponentToken.Avatar);
|
|
17
19
|
var styled = {
|
|
18
20
|
className: "musae-3nfvp2 musae-87ps6o"
|
|
19
21
|
};
|
|
20
|
-
var classNames = useClassNames(ComponentToken.Avatar);
|
|
21
22
|
var children = useMemo(function () {
|
|
22
|
-
var
|
|
23
|
-
var _children$reduce = __children.reduce(function (prev, child, index) {
|
|
23
|
+
var _Children$toArray$red = Children.toArray(_children).reduce(function (prev, child, index) {
|
|
24
24
|
// @ts-ignore
|
|
25
25
|
var element = /*#__PURE__*/cloneElement(child, {
|
|
26
26
|
key: "avatars-".concat(index)
|
|
@@ -33,13 +33,15 @@ var _Group = function Group(_ref) {
|
|
|
33
33
|
}
|
|
34
34
|
return prev;
|
|
35
35
|
}, [[], []]),
|
|
36
|
-
|
|
37
|
-
visible =
|
|
38
|
-
hidden =
|
|
36
|
+
_Children$toArray$red2 = _slicedToArray(_Children$toArray$red, 2),
|
|
37
|
+
visible = _Children$toArray$red2[0],
|
|
38
|
+
hidden = _Children$toArray$red2[1];
|
|
39
39
|
// got hidden nodes, show ellipse node
|
|
40
40
|
if (hidden.length > 0) {
|
|
41
41
|
visible.push( /*#__PURE__*/React.createElement(Popover, {
|
|
42
|
-
description: /*#__PURE__*/React.createElement(_Group,
|
|
42
|
+
description: /*#__PURE__*/React.createElement(_Group, {
|
|
43
|
+
max: Infinity
|
|
44
|
+
}, hidden),
|
|
43
45
|
key: "avatars-hidden",
|
|
44
46
|
placement: "top"
|
|
45
47
|
}, /*#__PURE__*/React.createElement(Avatar, {
|
|
@@ -54,7 +56,7 @@ var _Group = function Group(_ref) {
|
|
|
54
56
|
size: size
|
|
55
57
|
}
|
|
56
58
|
}, /*#__PURE__*/React.createElement("div", {
|
|
57
|
-
className: (classNames[AvatarClassToken.Group], styled.className),
|
|
59
|
+
className: clsx(classNames[AvatarClassToken.Group], styled.className),
|
|
58
60
|
style: styled.style
|
|
59
61
|
}, children));
|
|
60
62
|
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { BenchProps } from "./types";
|
|
3
|
+
declare const Bench: ({ children, title, logo, navigations, className, style, trailing, onNavigate, location, defaultExpandedKeys, classNames: { main: mainClassName }, }: BenchProps) => React.JSX.Element;
|
|
4
|
+
export default Bench;
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Layout } from '../layout/index.js';
|
|
4
|
+
import _stylex from '../../node_modules/.pnpm/@stylexjs_stylex@0.7.5/node_modules/@stylexjs/stylex/lib/es/stylex.js';
|
|
5
|
+
import Divider from '../divider/divider.js';
|
|
6
|
+
import { useLogo, useNavigations } from './hooks.js';
|
|
7
|
+
import Menu from '../menu/menu.js';
|
|
8
|
+
import { useTheme } from '../theme/hooks.js';
|
|
9
|
+
import { ColorToken } from '../../utils/colors.js';
|
|
10
|
+
import { typography } from '../theme/theme.js';
|
|
11
|
+
import clsx from 'clsx';
|
|
12
|
+
|
|
13
|
+
var Header = Layout.Header,
|
|
14
|
+
Main = Layout.Main,
|
|
15
|
+
Sider = Layout.Sider;
|
|
16
|
+
var styles = {
|
|
17
|
+
bench: {
|
|
18
|
+
"default": {
|
|
19
|
+
$$css: true
|
|
20
|
+
},
|
|
21
|
+
sider: function sider(props) {
|
|
22
|
+
return [{
|
|
23
|
+
borderRightWidth: "musae-1xkobc8",
|
|
24
|
+
borderInlineStartWidth: null,
|
|
25
|
+
borderInlineEndWidth: null,
|
|
26
|
+
borderRightStyle: "musae-32b0ac",
|
|
27
|
+
borderInlineStartStyle: null,
|
|
28
|
+
borderInlineEndStyle: null,
|
|
29
|
+
borderRightColor: "musae-104k1kx",
|
|
30
|
+
borderInlineStartColor: null,
|
|
31
|
+
borderInlineEndColor: null,
|
|
32
|
+
paddingInline: "musae-gj1dgu",
|
|
33
|
+
paddingStart: null,
|
|
34
|
+
paddingLeft: null,
|
|
35
|
+
paddingEnd: null,
|
|
36
|
+
paddingRight: null,
|
|
37
|
+
position: "musae-7wzq59",
|
|
38
|
+
height: "musae-1r05exa",
|
|
39
|
+
top: "musae-kwake1",
|
|
40
|
+
overflowY: "musae-10wlt62 musae-r8ctv5",
|
|
41
|
+
$$css: true
|
|
42
|
+
}, {
|
|
43
|
+
"--borderRightColor": props.outlineColor != null ? props.outlineColor : "initial"
|
|
44
|
+
}];
|
|
45
|
+
},
|
|
46
|
+
main: {
|
|
47
|
+
$$css: true
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
header: {
|
|
51
|
+
"default": {
|
|
52
|
+
gap: "musae-vbka3v",
|
|
53
|
+
rowGap: null,
|
|
54
|
+
columnGap: null,
|
|
55
|
+
boxShadow: "musae-ezd0au",
|
|
56
|
+
$$css: true
|
|
57
|
+
},
|
|
58
|
+
navigation: {
|
|
59
|
+
marginLeft: "musae-19i9eir",
|
|
60
|
+
marginInlineStart: null,
|
|
61
|
+
marginInlineEnd: null,
|
|
62
|
+
marginRight: "musae-ack27t",
|
|
63
|
+
height: "musae-b27hse",
|
|
64
|
+
$$css: true
|
|
65
|
+
},
|
|
66
|
+
divider: {
|
|
67
|
+
height: "musae-lry4nc",
|
|
68
|
+
$$css: true
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
var Bench = function Bench(_ref) {
|
|
73
|
+
var children = _ref.children,
|
|
74
|
+
title = _ref.title,
|
|
75
|
+
logo = _ref.logo,
|
|
76
|
+
_ref$navigations = _ref.navigations,
|
|
77
|
+
navigations = _ref$navigations === void 0 ? [] : _ref$navigations,
|
|
78
|
+
className = _ref.className,
|
|
79
|
+
style = _ref.style,
|
|
80
|
+
trailing = _ref.trailing,
|
|
81
|
+
onNavigate = _ref.onNavigate,
|
|
82
|
+
location = _ref.location,
|
|
83
|
+
defaultExpandedKeys = _ref.defaultExpandedKeys,
|
|
84
|
+
_ref$classNames = _ref.classNames,
|
|
85
|
+
_ref$classNames2 = _ref$classNames === void 0 ? {} : _ref$classNames,
|
|
86
|
+
mainClassName = _ref$classNames2.main;
|
|
87
|
+
var theme = useTheme();
|
|
88
|
+
var _logo = useLogo(logo);
|
|
89
|
+
var _useNavigations = useNavigations({
|
|
90
|
+
navigations: navigations,
|
|
91
|
+
onNavigate: onNavigate,
|
|
92
|
+
location: location
|
|
93
|
+
}),
|
|
94
|
+
navigate = _useNavigations.navigate,
|
|
95
|
+
topMenuItems = _useNavigations.topMenuItems,
|
|
96
|
+
sideMenuItems = _useNavigations.sideMenuItems,
|
|
97
|
+
selectedKeys = _useNavigations.selectedKeys;
|
|
98
|
+
var styled = {
|
|
99
|
+
bench: _stylex.props(styles.bench["default"]),
|
|
100
|
+
header: _stylex.props(styles.header["default"]),
|
|
101
|
+
main: _stylex.props(styles.bench.main),
|
|
102
|
+
sider: _stylex.props(styles.bench.sider({
|
|
103
|
+
outlineColor: theme.colors[ColorToken.OutlineVariant]
|
|
104
|
+
})),
|
|
105
|
+
title: _stylex.props(typography.title.large),
|
|
106
|
+
divider: _stylex.props(styles.header.divider),
|
|
107
|
+
headerNavigation: _stylex.props(styles.header.navigation)
|
|
108
|
+
};
|
|
109
|
+
return /*#__PURE__*/React.createElement(Layout, {
|
|
110
|
+
className: clsx(styled.bench.className, className),
|
|
111
|
+
style: _objectSpread(_objectSpread({}, styled.bench.style), style)
|
|
112
|
+
}, /*#__PURE__*/React.createElement(Header, {
|
|
113
|
+
className: styled.header.className,
|
|
114
|
+
style: styled.header.style
|
|
115
|
+
}, !!_logo && /*#__PURE__*/React.createElement("img", {
|
|
116
|
+
src: _logo === null || _logo === void 0 ? void 0 : _logo.url,
|
|
117
|
+
alt: "logo"
|
|
118
|
+
}), !!_logo && ( /*#__PURE__*/React.createElement("div", {
|
|
119
|
+
className: styled.divider.className,
|
|
120
|
+
style: styled.divider.style
|
|
121
|
+
}, /*#__PURE__*/React.createElement(Divider, {
|
|
122
|
+
type: "vertical"
|
|
123
|
+
}))), /*#__PURE__*/React.createElement("span", {
|
|
124
|
+
className: styled.title.className,
|
|
125
|
+
style: styled.title.style
|
|
126
|
+
}, title), /*#__PURE__*/React.createElement(Menu, _objectSpread({
|
|
127
|
+
items: topMenuItems,
|
|
128
|
+
onClick: navigate,
|
|
129
|
+
mode: "horizontal",
|
|
130
|
+
className: styled.headerNavigation.className,
|
|
131
|
+
style: styled.headerNavigation.style
|
|
132
|
+
}, !!selectedKeys[0] && {
|
|
133
|
+
selectedKeys: [selectedKeys[0]]
|
|
134
|
+
})), trailing), sideMenuItems.length > 0 && ( /*#__PURE__*/React.createElement(Sider, {
|
|
135
|
+
className: styled.sider.className,
|
|
136
|
+
style: styled.sider.style
|
|
137
|
+
}, /*#__PURE__*/React.createElement(Menu, _objectSpread({
|
|
138
|
+
items: sideMenuItems,
|
|
139
|
+
onClick: navigate,
|
|
140
|
+
defaultExpandedKeys: defaultExpandedKeys
|
|
141
|
+
}, !!selectedKeys[1] && {
|
|
142
|
+
selectedKeys: [selectedKeys[1]]
|
|
143
|
+
})))), /*#__PURE__*/React.createElement(Main, {
|
|
144
|
+
className: clsx(mainClassName, styled.main.className),
|
|
145
|
+
style: styled.main.style
|
|
146
|
+
}, children));
|
|
147
|
+
};
|
|
148
|
+
var Bench$1 = Bench;
|
|
149
|
+
|
|
150
|
+
export { Bench$1 as default };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type Key } from "react";
|
|
2
|
+
import type { BenchProps, Logo, NavigationItem } from "./types";
|
|
3
|
+
import { MenuItem } from "../menu";
|
|
4
|
+
/**
|
|
5
|
+
* @description
|
|
6
|
+
* logo
|
|
7
|
+
*/
|
|
8
|
+
export declare const useLogo: (logo?: string | Logo) => Logo | null;
|
|
9
|
+
/**
|
|
10
|
+
* @description
|
|
11
|
+
* menu
|
|
12
|
+
*/
|
|
13
|
+
export declare const useNavigations: ({ navigations, onNavigate, location, }: {
|
|
14
|
+
navigations: NavigationItem[];
|
|
15
|
+
onNavigate: BenchProps["onNavigate"];
|
|
16
|
+
location?: string;
|
|
17
|
+
}) => {
|
|
18
|
+
selectedKeys: [(Key | undefined)?, (Key | undefined)?];
|
|
19
|
+
topMenuItems: MenuItem[];
|
|
20
|
+
sideMenuItems: MenuItem[];
|
|
21
|
+
navigate: (path: Key) => void;
|
|
22
|
+
};
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
2
|
+
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
3
|
+
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
4
|
+
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
5
|
+
import { useMemo } from 'react';
|
|
6
|
+
import { useEvent, isUndefined } from '@aiszlab/relax';
|
|
7
|
+
|
|
8
|
+
var _excluded = ["path", "children"],
|
|
9
|
+
_excluded2 = ["children"];
|
|
10
|
+
/**
|
|
11
|
+
* @description
|
|
12
|
+
* logo
|
|
13
|
+
*/
|
|
14
|
+
var useLogo = function useLogo(logo) {
|
|
15
|
+
return useMemo(function () {
|
|
16
|
+
if (!logo) return null;
|
|
17
|
+
if (typeof logo === "string") {
|
|
18
|
+
return {
|
|
19
|
+
url: logo
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
return logo;
|
|
23
|
+
}, [logo]);
|
|
24
|
+
};
|
|
25
|
+
var _toMenuItem3 = function toMenuItem(_ref, parentKeys, paths) {
|
|
26
|
+
var path = _ref.path,
|
|
27
|
+
children = _ref.children,
|
|
28
|
+
item = _objectWithoutProperties(_ref, _excluded);
|
|
29
|
+
// convert children
|
|
30
|
+
var _reduce = (children !== null && children !== void 0 ? children : []).reduce(function (_ref2, child) {
|
|
31
|
+
var _ref3 = _slicedToArray(_ref2, 2),
|
|
32
|
+
_menuItems = _ref3[0],
|
|
33
|
+
_paths = _ref3[1];
|
|
34
|
+
var _toMenuItem = _toMenuItem3(child, [].concat(_toConsumableArray(parentKeys), [path]), _paths),
|
|
35
|
+
_toMenuItem2 = _slicedToArray(_toMenuItem, 2),
|
|
36
|
+
menuItem = _toMenuItem2[0],
|
|
37
|
+
paths = _toMenuItem2[1];
|
|
38
|
+
_menuItems.push(menuItem);
|
|
39
|
+
return [_menuItems, paths];
|
|
40
|
+
}, [[], new Map(paths.set(path, parentKeys))]),
|
|
41
|
+
_reduce2 = _slicedToArray(_reduce, 2),
|
|
42
|
+
_menuItems = _reduce2[0],
|
|
43
|
+
_paths = _reduce2[1];
|
|
44
|
+
// return with paths
|
|
45
|
+
return [_objectSpread({
|
|
46
|
+
key: path,
|
|
47
|
+
children: _menuItems
|
|
48
|
+
}, item), _paths];
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* @description
|
|
52
|
+
* menu
|
|
53
|
+
*/
|
|
54
|
+
var useNavigations = function useNavigations(_ref4) {
|
|
55
|
+
var navigations = _ref4.navigations,
|
|
56
|
+
onNavigate = _ref4.onNavigate,
|
|
57
|
+
location = _ref4.location;
|
|
58
|
+
// menu click handler => jump link
|
|
59
|
+
var navigate = useEvent(function (path) {
|
|
60
|
+
if (onNavigate) {
|
|
61
|
+
onNavigate(path.toString());
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
window.open(path.toString(), "_self");
|
|
65
|
+
});
|
|
66
|
+
// convert navigations into diff menus
|
|
67
|
+
var _useMemo = useMemo(function () {
|
|
68
|
+
return navigations.reduce(function (_ref5, item) {
|
|
69
|
+
var _ref6 = _slicedToArray(_ref5, 3),
|
|
70
|
+
topMenuItems = _ref6[0],
|
|
71
|
+
sideNavigations = _ref6[1],
|
|
72
|
+
paths = _ref6[2];
|
|
73
|
+
var _toMenuItem4 = _toMenuItem3(item, [], paths),
|
|
74
|
+
_toMenuItem5 = _slicedToArray(_toMenuItem4, 2),
|
|
75
|
+
_toMenuItem5$ = _toMenuItem5[0],
|
|
76
|
+
children = _toMenuItem5$.children,
|
|
77
|
+
_menuItem = _objectWithoutProperties(_toMenuItem5$, _excluded2),
|
|
78
|
+
_paths = _toMenuItem5[1];
|
|
79
|
+
topMenuItems.set(item.path, _menuItem);
|
|
80
|
+
sideNavigations.set(item.path, children);
|
|
81
|
+
return [topMenuItems, sideNavigations, _paths];
|
|
82
|
+
}, [new Map(), new Map(), new Map()]);
|
|
83
|
+
}, [navigations]),
|
|
84
|
+
_useMemo2 = _slicedToArray(_useMemo, 3),
|
|
85
|
+
topMenuItems = _useMemo2[0],
|
|
86
|
+
sideNavigations = _useMemo2[1],
|
|
87
|
+
paths = _useMemo2[2];
|
|
88
|
+
// menu selected keys
|
|
89
|
+
var selectedKeys = useMemo(function () {
|
|
90
|
+
var _paths$get$at, _paths$get;
|
|
91
|
+
if (isUndefined(location)) return [];
|
|
92
|
+
return [(_paths$get$at = (_paths$get = paths.get(location)) === null || _paths$get === void 0 ? void 0 : _paths$get.at(0)) !== null && _paths$get$at !== void 0 ? _paths$get$at : location, location];
|
|
93
|
+
}, [location, paths]);
|
|
94
|
+
var sideMenuItems = useMemo(function () {
|
|
95
|
+
var _sideNavigations$get;
|
|
96
|
+
if (!selectedKeys[0]) {
|
|
97
|
+
return [];
|
|
98
|
+
}
|
|
99
|
+
return (_sideNavigations$get = sideNavigations.get(selectedKeys[0])) !== null && _sideNavigations$get !== void 0 ? _sideNavigations$get : [];
|
|
100
|
+
}, [sideNavigations, selectedKeys]);
|
|
101
|
+
return {
|
|
102
|
+
selectedKeys: selectedKeys,
|
|
103
|
+
topMenuItems: useMemo(function () {
|
|
104
|
+
return Array.from(topMenuItems.values());
|
|
105
|
+
}, [topMenuItems]),
|
|
106
|
+
sideMenuItems: sideMenuItems,
|
|
107
|
+
navigate: navigate
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
export { useLogo, useNavigations };
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { Key, ReactNode } from "react";
|
|
2
|
+
import { ComponentProps } from "../../types/element";
|
|
3
|
+
export type Logo = {
|
|
4
|
+
/**
|
|
5
|
+
* @description
|
|
6
|
+
* url
|
|
7
|
+
*/
|
|
8
|
+
url: string;
|
|
9
|
+
};
|
|
10
|
+
export type NavigationItem = {
|
|
11
|
+
/**
|
|
12
|
+
* @description
|
|
13
|
+
* path
|
|
14
|
+
*/
|
|
15
|
+
path: string;
|
|
16
|
+
/**
|
|
17
|
+
* @description
|
|
18
|
+
* label
|
|
19
|
+
* @default void 0
|
|
20
|
+
*/
|
|
21
|
+
label: ReactNode;
|
|
22
|
+
/**
|
|
23
|
+
* @description
|
|
24
|
+
* children
|
|
25
|
+
*/
|
|
26
|
+
children?: NavigationItem[];
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* @description
|
|
30
|
+
* workbench props
|
|
31
|
+
*/
|
|
32
|
+
export type BenchProps = ComponentProps & {
|
|
33
|
+
/**
|
|
34
|
+
* @description
|
|
35
|
+
* logo
|
|
36
|
+
*/
|
|
37
|
+
logo?: string | Logo;
|
|
38
|
+
/**
|
|
39
|
+
* @description
|
|
40
|
+
* title
|
|
41
|
+
*/
|
|
42
|
+
title?: ReactNode;
|
|
43
|
+
/**
|
|
44
|
+
* @description
|
|
45
|
+
* children
|
|
46
|
+
*/
|
|
47
|
+
children?: ReactNode;
|
|
48
|
+
/**
|
|
49
|
+
* @description
|
|
50
|
+
* navigations
|
|
51
|
+
*/
|
|
52
|
+
navigations?: NavigationItem[];
|
|
53
|
+
/**
|
|
54
|
+
* @description
|
|
55
|
+
* trailing
|
|
56
|
+
*/
|
|
57
|
+
trailing?: ReactNode;
|
|
58
|
+
/**
|
|
59
|
+
* @description
|
|
60
|
+
* navigate handler
|
|
61
|
+
*/
|
|
62
|
+
onNavigate?: (path: string) => void;
|
|
63
|
+
/**
|
|
64
|
+
* @description
|
|
65
|
+
* location
|
|
66
|
+
*/
|
|
67
|
+
location?: string;
|
|
68
|
+
/**
|
|
69
|
+
* @description
|
|
70
|
+
* default expanded keys
|
|
71
|
+
*/
|
|
72
|
+
defaultExpandedKeys?: Key[];
|
|
73
|
+
/**
|
|
74
|
+
* @description
|
|
75
|
+
* class names
|
|
76
|
+
*/
|
|
77
|
+
classNames?: Partial<Record<"main", string>>;
|
|
78
|
+
};
|
|
@@ -12,7 +12,7 @@ var Dialog = function Dialog(_ref) {
|
|
|
12
12
|
_ref$closable = _ref.closable,
|
|
13
13
|
closable = _ref$closable === void 0 ? true : _ref$closable,
|
|
14
14
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
15
|
-
/// `Portal` should disappear after `Dialog` disappear completely
|
|
15
|
+
/// `Portal` should disappear after `Dialog` disappear animation completely
|
|
16
16
|
var _useBoolean = useBoolean(false),
|
|
17
17
|
_useBoolean2 = _slicedToArray(_useBoolean, 2),
|
|
18
18
|
_isVisible = _useBoolean2[0],
|
|
@@ -114,7 +114,7 @@ var Popup = function Popup(_ref) {
|
|
|
114
114
|
var theme = useTheme();
|
|
115
115
|
var panelRef = useRef(null);
|
|
116
116
|
var overlayRef = useRef(null);
|
|
117
|
-
|
|
117
|
+
// children render hooks
|
|
118
118
|
var footer = useFooter([props$1.footer, props$1.onConfirm, onClose]);
|
|
119
119
|
var _useClosable = useClosable({
|
|
120
120
|
closable: closable,
|
|
@@ -159,7 +159,7 @@ var Popup = function Popup(_ref) {
|
|
|
159
159
|
}))();
|
|
160
160
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
161
161
|
}, [open]);
|
|
162
|
-
|
|
162
|
+
// when open, try focus dialog
|
|
163
163
|
useEffect(function () {
|
|
164
164
|
if (!open) return;
|
|
165
165
|
if (contains(scope.current, document.activeElement)) return;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { CSSProperties, ReactNode } from "react";
|
|
2
2
|
import type { Closable } from "../../hooks/use-closable";
|
|
3
3
|
import { RequiredIn } from "@aiszlab/relax/types";
|
|
4
|
+
import { PortalProps } from "../portal/types";
|
|
4
5
|
/**
|
|
5
6
|
* @description
|
|
6
7
|
* dialog props
|
|
@@ -62,6 +63,10 @@ export interface DialogProps {
|
|
|
62
63
|
* @default void 0
|
|
63
64
|
*/
|
|
64
65
|
onClose?: VoidFunction;
|
|
66
|
+
/**
|
|
67
|
+
* @link {PortalProps.container}
|
|
68
|
+
*/
|
|
69
|
+
container?: PortalProps["container"];
|
|
65
70
|
}
|
|
66
71
|
/**
|
|
67
72
|
* @description
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { type DividerProps } from "./types";
|
|
2
2
|
import React from "react";
|
|
3
|
-
declare const Divider: ({ align, children, type, className, style }: DividerProps) => React.JSX.Element;
|
|
3
|
+
declare const Divider: ({ align, children, type, className, style, }: DividerProps) => React.JSX.Element;
|
|
4
4
|
export default Divider;
|
|
@@ -32,7 +32,7 @@ var styles = {
|
|
|
32
32
|
},
|
|
33
33
|
vertical: function vertical(props) {
|
|
34
34
|
return [{
|
|
35
|
-
|
|
35
|
+
width: "musae-131wp52",
|
|
36
36
|
backgroundColor: "musae-q1mx2j",
|
|
37
37
|
$$css: true
|
|
38
38
|
}, {
|
|
@@ -132,13 +132,13 @@ var Divider = function Divider(_ref) {
|
|
|
132
132
|
backgroundColor: theme.colors[ColorToken.OutlineVariant],
|
|
133
133
|
offset: offset
|
|
134
134
|
})),
|
|
135
|
-
label: props(
|
|
135
|
+
label: props(styles.label[type], typography.body.small)
|
|
136
136
|
};
|
|
137
137
|
return /*#__PURE__*/React.createElement("div", {
|
|
138
|
-
className: clsx(
|
|
138
|
+
className: clsx(classNames[DividerClassToken.Divider], className, styled.divider.className),
|
|
139
139
|
style: _objectSpread(_objectSpread({}, styled.divider.style), style)
|
|
140
140
|
}, !!children && ( /*#__PURE__*/React.createElement("span", {
|
|
141
|
-
className: clsx(
|
|
141
|
+
className: clsx(classNames[DividerClassToken.Label], styled.label.className),
|
|
142
142
|
style: styled.label.style
|
|
143
143
|
}, children)));
|
|
144
144
|
};
|
|
@@ -16,7 +16,7 @@ var Drawer = function Drawer(_ref) {
|
|
|
16
16
|
_ref$placement = _ref.placement,
|
|
17
17
|
placement = _ref$placement === void 0 ? "right" : _ref$placement,
|
|
18
18
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
19
|
-
/// `Portal` should disappear after `
|
|
19
|
+
/// `Portal` should disappear after `Drawer` disappear animation completely
|
|
20
20
|
var _useBoolean = useBoolean(false),
|
|
21
21
|
_useBoolean2 = _slicedToArray(_useBoolean, 2),
|
|
22
22
|
_isVisible = _useBoolean2[0],
|
|
@@ -8,6 +8,8 @@ import clsx from 'clsx';
|
|
|
8
8
|
var styles = {
|
|
9
9
|
header: function header(props) {
|
|
10
10
|
return [{
|
|
11
|
+
display: "musae-78zum5",
|
|
12
|
+
alignItems: "musae-6s0dn4",
|
|
11
13
|
height: "musae-b4kbli",
|
|
12
14
|
paddingInline: "musae-1mmg125",
|
|
13
15
|
paddingStart: null,
|
|
@@ -18,8 +20,6 @@ var styles = {
|
|
|
18
20
|
position: "musae-7wzq59",
|
|
19
21
|
top: "musae-13vifvy",
|
|
20
22
|
zIndex: "musae-1ac462h",
|
|
21
|
-
display: "musae-78zum5",
|
|
22
|
-
alignItems: "musae-6s0dn4",
|
|
23
23
|
backgroundColor: "musae-q1mx2j",
|
|
24
24
|
$$css: true
|
|
25
25
|
}, {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SiderProps } from "./types";
|
|
1
|
+
import type { SiderProps } from "./types";
|
|
2
2
|
import React from "react";
|
|
3
|
-
declare const Sider: (
|
|
3
|
+
declare const Sider: ({ style, children, className }: SiderProps) => React.JSX.Element;
|
|
4
4
|
export default Sider;
|
|
@@ -1,18 +1,16 @@
|
|
|
1
|
-
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
2
1
|
import { Grid } from '../grid/index.js';
|
|
3
2
|
import React from 'react';
|
|
4
|
-
import clsx from 'clsx';
|
|
5
3
|
|
|
6
|
-
var Sider = function Sider(
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
var Sider = function Sider(_ref) {
|
|
5
|
+
var style = _ref.style,
|
|
6
|
+
children = _ref.children,
|
|
7
|
+
className = _ref.className;
|
|
10
8
|
return /*#__PURE__*/React.createElement(Grid.Col, {
|
|
11
|
-
style:
|
|
12
|
-
className:
|
|
9
|
+
style: style,
|
|
10
|
+
className: className,
|
|
13
11
|
span: 5,
|
|
14
12
|
as: "aside"
|
|
15
|
-
},
|
|
13
|
+
}, children);
|
|
16
14
|
};
|
|
17
15
|
|
|
18
16
|
export { Sider as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { type ReactNode } from "react";
|
|
2
|
-
import type { ContextValue, MenuProps, Mode
|
|
2
|
+
import type { ContextValue, MenuProps, Mode } from "./types";
|
|
3
3
|
import type { Size } from "../../types/element";
|
|
4
4
|
/**
|
|
5
5
|
* @description
|
|
@@ -26,10 +26,9 @@ export declare const useItemChildren: ({ prefix, label, suffix, hasChildren, isE
|
|
|
26
26
|
* @description
|
|
27
27
|
* context value
|
|
28
28
|
*/
|
|
29
|
-
export declare const useContextValue: ({ onClick, setTrigger,
|
|
29
|
+
export declare const useContextValue: ({ onClick, setTrigger, size, ...props }: {
|
|
30
30
|
onClick: MenuProps["onClick"];
|
|
31
31
|
setTrigger: ContextValue["collect"];
|
|
32
|
-
variant: Variant;
|
|
33
32
|
size: Size;
|
|
34
33
|
} & Pick<MenuProps, "defaultExpandedKeys" | "defaultSelectedKeys" | "expandedKeys" | "selectedKeys">) => ContextValue;
|
|
35
34
|
/**
|
|
@@ -9,7 +9,7 @@ import { useControlledState } from '@aiszlab/relax';
|
|
|
9
9
|
import { props } from '../../node_modules/.pnpm/@stylexjs_stylex@0.7.5/node_modules/@stylexjs/stylex/lib/es/stylex.js';
|
|
10
10
|
import KeyboardArrowUp from '../icon/icons/hardware/keyboard-arrow-up.js';
|
|
11
11
|
|
|
12
|
-
var _excluded = ["onClick", "setTrigger", "
|
|
12
|
+
var _excluded = ["onClick", "setTrigger", "size"];
|
|
13
13
|
var styles = {
|
|
14
14
|
collapser: function collapser(props) {
|
|
15
15
|
return [{
|
|
@@ -83,7 +83,6 @@ var useContextValue = function useContextValue(_ref2) {
|
|
|
83
83
|
var _props$defaultSelecte, _props$defaultExpande;
|
|
84
84
|
var onClick = _ref2.onClick,
|
|
85
85
|
setTrigger = _ref2.setTrigger,
|
|
86
|
-
variant = _ref2.variant,
|
|
87
86
|
size = _ref2.size,
|
|
88
87
|
props = _objectWithoutProperties(_ref2, _excluded);
|
|
89
88
|
var _useControlledState = useControlledState(props.selectedKeys, {
|
|
@@ -141,13 +140,12 @@ var useContextValue = function useContextValue(_ref2) {
|
|
|
141
140
|
return {
|
|
142
141
|
selectedKeys: selectedKeys,
|
|
143
142
|
expandedKeys: expandedKeys,
|
|
144
|
-
variant: variant,
|
|
145
143
|
click: click,
|
|
146
144
|
toggle: toggle,
|
|
147
145
|
collect: collect,
|
|
148
146
|
size: size
|
|
149
147
|
};
|
|
150
|
-
}, [selectedKeys, expandedKeys, click, toggle, collect,
|
|
148
|
+
}, [selectedKeys, expandedKeys, click, toggle, collect, size]);
|
|
151
149
|
};
|
|
152
150
|
/**
|
|
153
151
|
* @description
|
|
@@ -6,7 +6,7 @@ import { useMenuContext, useItemChildren } from './hooks.js';
|
|
|
6
6
|
import { useClassNames } from '../../hooks/use-class-names.js';
|
|
7
7
|
import { ComponentToken, MenuClassToken } from '../../utils/class-name.js';
|
|
8
8
|
import { props } from '../../node_modules/.pnpm/@stylexjs_stylex@0.7.5/node_modules/@stylexjs/stylex/lib/es/stylex.js';
|
|
9
|
-
import {
|
|
9
|
+
import { spacing } from '../theme/tokens.stylex.js';
|
|
10
10
|
import { useTheme } from '../theme/hooks.js';
|
|
11
11
|
import { ColorToken } from '../../utils/colors.js';
|
|
12
12
|
import clsx from 'clsx';
|
|
@@ -25,91 +25,66 @@ var styles = {
|
|
|
25
25
|
userSelect: "musae-87ps6o",
|
|
26
26
|
willChange: "musae-1aaibe2",
|
|
27
27
|
transitionProperty: "musae-xy01e9",
|
|
28
|
-
transitionDuration: "musae-
|
|
28
|
+
transitionDuration: "musae-13dflua",
|
|
29
29
|
$$css: true
|
|
30
30
|
}
|
|
31
31
|
},
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
backgroundColor: "musae-rl4t6d",
|
|
36
|
-
$$css: true
|
|
37
|
-
}, {
|
|
38
|
-
"--1e2mv7m": props.backgroundColor != null ? props.backgroundColor : "initial"
|
|
39
|
-
}];
|
|
40
|
-
},
|
|
41
|
-
outlined: function outlined(props) {
|
|
42
|
-
return [{
|
|
43
|
-
border: "musae-1eubc7e",
|
|
44
|
-
borderWidth: null,
|
|
45
|
-
borderInlineWidth: null,
|
|
46
|
-
borderInlineStartWidth: null,
|
|
47
|
-
borderLeftWidth: null,
|
|
48
|
-
borderInlineEndWidth: null,
|
|
49
|
-
borderRightWidth: null,
|
|
50
|
-
borderBlockWidth: null,
|
|
51
|
-
borderTopWidth: null,
|
|
52
|
-
borderBottomWidth: null,
|
|
53
|
-
borderStyle: null,
|
|
54
|
-
borderInlineStyle: null,
|
|
55
|
-
borderInlineStartStyle: null,
|
|
56
|
-
borderLeftStyle: null,
|
|
57
|
-
borderInlineEndStyle: null,
|
|
58
|
-
borderRightStyle: null,
|
|
59
|
-
borderBlockStyle: null,
|
|
60
|
-
borderTopStyle: null,
|
|
61
|
-
borderBottomStyle: null,
|
|
62
|
-
borderColor: null,
|
|
63
|
-
borderInlineColor: null,
|
|
64
|
-
borderInlineStartColor: null,
|
|
65
|
-
borderLeftColor: null,
|
|
66
|
-
borderInlineEndColor: null,
|
|
67
|
-
borderRightColor: null,
|
|
68
|
-
borderBlockColor: null,
|
|
69
|
-
borderTopColor: null,
|
|
70
|
-
borderBottomColor: null,
|
|
71
|
-
$$css: true
|
|
72
|
-
}, {
|
|
73
|
-
"--1n3s2ii": "".concat(sizes.smallest, " solid ").concat(props.borderColor) != null ? "".concat(sizes.smallest, " solid ").concat(props.borderColor) : "initial"
|
|
74
|
-
}];
|
|
75
|
-
},
|
|
76
|
-
text: function text(props) {
|
|
77
|
-
return [{
|
|
78
|
-
color: "musae-vm0q45",
|
|
32
|
+
mode: {
|
|
33
|
+
menuitem: {
|
|
34
|
+
horizontal: {
|
|
79
35
|
$$css: true
|
|
80
|
-
},
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
},
|
|
85
|
-
selected: {
|
|
86
|
-
filled: function filled(props) {
|
|
87
|
-
return [{
|
|
88
|
-
backgroundColor: "musae-q1mx2j",
|
|
89
|
-
color: "musae-19dipnz",
|
|
36
|
+
},
|
|
37
|
+
vertical: {
|
|
38
|
+
marginBottom: "musae-rsi211",
|
|
39
|
+
marginTop: "musae-3yben5 musae-cu8lob",
|
|
90
40
|
$$css: true
|
|
91
|
-
},
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
},
|
|
96
|
-
outlined: function outlined(props) {
|
|
97
|
-
return [{
|
|
98
|
-
backgroundColor: "musae-q1mx2j",
|
|
99
|
-
color: "musae-19dipnz",
|
|
41
|
+
},
|
|
42
|
+
inline: {
|
|
43
|
+
marginBottom: "musae-rsi211",
|
|
44
|
+
marginTop: "musae-3yben5 musae-cu8lob",
|
|
100
45
|
$$css: true
|
|
101
|
-
}
|
|
102
|
-
"--backgroundColor": props.backgroundColor != null ? props.backgroundColor : "initial",
|
|
103
|
-
"--color": props.color != null ? props.color : "initial"
|
|
104
|
-
}];
|
|
46
|
+
}
|
|
105
47
|
},
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
48
|
+
item: {
|
|
49
|
+
horizontal: function horizontal(props) {
|
|
50
|
+
return [{
|
|
51
|
+
height: "musae-b27hse",
|
|
52
|
+
position: "musae-1n2onr6",
|
|
53
|
+
"::after_content": "musae-1s928wv",
|
|
54
|
+
"::after_position": "musae-1j6awrg",
|
|
55
|
+
"::after_insetInline": "musae-b7ltuz",
|
|
56
|
+
"::after_insetInlineStart": null,
|
|
57
|
+
"::after_insetInlineEnd": null,
|
|
58
|
+
"::after_left": null,
|
|
59
|
+
"::after_right": null,
|
|
60
|
+
"::after_bottom": "musae-1xrz1ek",
|
|
61
|
+
"::after_borderBottomWidth": "musae-zueuoj",
|
|
62
|
+
"::after_willChange": "musae-7h5a58",
|
|
63
|
+
"::after_transitionProperty": "musae-w91p3u",
|
|
64
|
+
"::after_transitionDuration": "musae-t0fc71",
|
|
65
|
+
":not(:hover)::after_borderBottomColor": "musae-q3rc72",
|
|
66
|
+
":hover::after_borderBottomColor": "musae-1kev6kp",
|
|
67
|
+
$$css: true
|
|
68
|
+
}, {
|
|
69
|
+
"--1nc1zz8": props.outlineColor != null ? props.outlineColor : "initial"
|
|
70
|
+
}];
|
|
71
|
+
},
|
|
72
|
+
vertical: function vertical(props) {
|
|
73
|
+
return [{
|
|
74
|
+
backgroundColor: "musae-rl4t6d",
|
|
75
|
+
$$css: true
|
|
76
|
+
}, {
|
|
77
|
+
"--1e2mv7m": props.backgroundColor != null ? props.backgroundColor : "initial"
|
|
78
|
+
}];
|
|
79
|
+
},
|
|
80
|
+
inline: function inline(props) {
|
|
81
|
+
return [{
|
|
82
|
+
backgroundColor: "musae-rl4t6d",
|
|
83
|
+
$$css: true
|
|
84
|
+
}, {
|
|
85
|
+
"--1e2mv7m": props.backgroundColor != null ? props.backgroundColor : "initial"
|
|
86
|
+
}];
|
|
87
|
+
}
|
|
113
88
|
}
|
|
114
89
|
},
|
|
115
90
|
size: {
|
|
@@ -189,32 +164,36 @@ var styles = {
|
|
|
189
164
|
}];
|
|
190
165
|
}
|
|
191
166
|
},
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
vertical: {
|
|
198
|
-
marginBottom: "musae-rsi211",
|
|
199
|
-
marginTop: "musae-3yben5 musae-cu8lob",
|
|
200
|
-
$$css: true
|
|
201
|
-
},
|
|
202
|
-
inline: {
|
|
203
|
-
marginBottom: "musae-rsi211",
|
|
204
|
-
marginTop: "musae-3yben5 musae-cu8lob",
|
|
167
|
+
selected: {
|
|
168
|
+
inline: function inline(props) {
|
|
169
|
+
return [{
|
|
170
|
+
backgroundColor: "musae-q1mx2j",
|
|
171
|
+
color: "musae-19dipnz",
|
|
205
172
|
$$css: true
|
|
206
|
-
}
|
|
173
|
+
}, {
|
|
174
|
+
"--backgroundColor": props.backgroundColor != null ? props.backgroundColor : "initial",
|
|
175
|
+
"--color": props.color != null ? props.color : "initial"
|
|
176
|
+
}];
|
|
207
177
|
},
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
vertical: {
|
|
178
|
+
vertical: function vertical(props) {
|
|
179
|
+
return [{
|
|
180
|
+
backgroundColor: "musae-q1mx2j",
|
|
181
|
+
color: "musae-19dipnz",
|
|
213
182
|
$$css: true
|
|
214
|
-
},
|
|
215
|
-
|
|
183
|
+
}, {
|
|
184
|
+
"--backgroundColor": props.backgroundColor != null ? props.backgroundColor : "initial",
|
|
185
|
+
"--color": props.color != null ? props.color : "initial"
|
|
186
|
+
}];
|
|
187
|
+
},
|
|
188
|
+
horizontal: function horizontal(props) {
|
|
189
|
+
return [{
|
|
190
|
+
color: "musae-19dipnz",
|
|
191
|
+
"::after_borderBottomColor": "musae-auefp2",
|
|
216
192
|
$$css: true
|
|
217
|
-
}
|
|
193
|
+
}, {
|
|
194
|
+
"--color": props.color != null ? props.color : "initial",
|
|
195
|
+
"--imnen1": props.color != null ? props.color : "initial"
|
|
196
|
+
}];
|
|
218
197
|
}
|
|
219
198
|
}
|
|
220
199
|
};
|
|
@@ -238,7 +217,6 @@ var Item = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
238
217
|
expandedKeys = _useMenuContext.expandedKeys,
|
|
239
218
|
_click = _useMenuContext.click,
|
|
240
219
|
toggle = _useMenuContext.toggle,
|
|
241
|
-
variant = _useMenuContext.variant,
|
|
242
220
|
size = _useMenuContext.size;
|
|
243
221
|
var classNames = useClassNames(ComponentToken.Menu);
|
|
244
222
|
var isSelected = selectedKeys.has(value);
|
|
@@ -247,6 +225,8 @@ var Item = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
247
225
|
var hasChildren = !!props$1.children;
|
|
248
226
|
var itemRef = useRef(null);
|
|
249
227
|
var isInline = mode === "inline";
|
|
228
|
+
var isVertical = mode === "vertical";
|
|
229
|
+
var isHorizontal = mode === "horizontal";
|
|
250
230
|
// delay disappear after hover leave
|
|
251
231
|
var _useLazyBoolean = useLazyBoolean(),
|
|
252
232
|
_useLazyBoolean2 = _slicedToArray(_useLazyBoolean, 2),
|
|
@@ -280,16 +260,18 @@ var Item = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
280
260
|
menuItem: props(styles.mode.menuitem[mode]),
|
|
281
261
|
item: props(styles["default"].item, styles.size[size]({
|
|
282
262
|
level: level
|
|
283
|
-
}), styles.
|
|
284
|
-
|
|
285
|
-
}),
|
|
263
|
+
}), styles.mode.item[mode](_objectSpread(_objectSpread(_objectSpread({}, isInline && {
|
|
264
|
+
backgroundColor: theme.colors[ColorToken.SurfaceContainerHighest]
|
|
265
|
+
}), isVertical && {
|
|
286
266
|
backgroundColor: theme.colors[ColorToken.SurfaceContainerHighest]
|
|
287
|
-
}),
|
|
288
|
-
|
|
289
|
-
})), isSelected && styles.selected[
|
|
267
|
+
}), isHorizontal && {
|
|
268
|
+
outlineColor: theme.colors[ColorToken.Primary]
|
|
269
|
+
})), isSelected && styles.selected[mode](_objectSpread(_objectSpread({}, (isInline || isVertical) && {
|
|
290
270
|
backgroundColor: theme.colors[ColorToken.SurfaceContainerHighest],
|
|
291
271
|
color: theme.colors[ColorToken.Primary]
|
|
292
|
-
}),
|
|
272
|
+
}), isHorizontal && {
|
|
273
|
+
color: theme.colors[ColorToken.Primary]
|
|
274
|
+
})), typography.label[size])
|
|
293
275
|
};
|
|
294
276
|
return /*#__PURE__*/React.createElement("li", _objectSpread({
|
|
295
277
|
role: "menuitem",
|
|
@@ -19,8 +19,6 @@ var Menu = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
19
19
|
var onClick = _ref.onClick,
|
|
20
20
|
className = _ref.className,
|
|
21
21
|
style = _ref.style,
|
|
22
|
-
_ref$variant = _ref.variant,
|
|
23
|
-
variant = _ref$variant === void 0 ? "filled" : _ref$variant,
|
|
24
22
|
_ref$size = _ref.size,
|
|
25
23
|
size = _ref$size === void 0 ? "medium" : _ref$size,
|
|
26
24
|
_ref$mode = _ref.mode,
|
|
@@ -47,7 +45,6 @@ var Menu = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
47
45
|
defaultExpandedKeys: defaultExpandedKeys,
|
|
48
46
|
onClick: onClick,
|
|
49
47
|
setTrigger: setTrigger,
|
|
50
|
-
variant: variant,
|
|
51
48
|
size: size
|
|
52
49
|
});
|
|
53
50
|
useImperativeHandle(ref, function () {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { Key, ReactNode } from "react";
|
|
2
2
|
import type { ComponentProps, Size } from "../../types/element";
|
|
3
3
|
import type { WithLevel } from "../../types/element";
|
|
4
|
-
export type Variant = "filled" | "outlined" | "text";
|
|
5
4
|
export type Mode = "vertical" | "horizontal" | "inline";
|
|
6
5
|
/**
|
|
7
6
|
* @author murukal
|
|
@@ -35,7 +34,6 @@ export interface ContextValue {
|
|
|
35
34
|
* expanded keys
|
|
36
35
|
*/
|
|
37
36
|
expandedKeys: Set<Key>;
|
|
38
|
-
variant: Variant;
|
|
39
37
|
size: Size;
|
|
40
38
|
}
|
|
41
39
|
/**
|
|
@@ -56,12 +54,6 @@ export interface MenuProps extends ComponentProps {
|
|
|
56
54
|
* mode
|
|
57
55
|
*/
|
|
58
56
|
mode?: Mode;
|
|
59
|
-
/**
|
|
60
|
-
* @description
|
|
61
|
-
* you can use the variant in the Menu component to change the hover style of the Menu items.
|
|
62
|
-
* @default "filled"
|
|
63
|
-
*/
|
|
64
|
-
variant?: Variant;
|
|
65
57
|
/**
|
|
66
58
|
* @description
|
|
67
59
|
* size
|
package/dist/index.d.ts
CHANGED
|
@@ -56,6 +56,7 @@ export { VisuallyHidden } from "./components/visually-hidden";
|
|
|
56
56
|
export { NumberInput } from "./components/number-input";
|
|
57
57
|
export { Popconfirm } from "./components/popconfirm";
|
|
58
58
|
export { Highlight } from "./components/highlight";
|
|
59
|
+
export { Bench } from "./components/bench";
|
|
59
60
|
/**
|
|
60
61
|
* @description
|
|
61
62
|
* hooks
|
|
@@ -71,3 +72,4 @@ export type { Option } from "./types/option";
|
|
|
71
72
|
export type { MenuItem, MenuRef } from "./components/menu";
|
|
72
73
|
export type { TreeProps } from "./components/tree";
|
|
73
74
|
export type { TourStep } from "./components/tour";
|
|
75
|
+
export type { NavigationItem } from "./components/bench";
|
package/dist/index.js
CHANGED
|
@@ -53,6 +53,7 @@ export { default as VisuallyHidden } from './components/visually-hidden/visually
|
|
|
53
53
|
export { default as NumberInput } from './components/number-input/number-input.js';
|
|
54
54
|
export { default as Popconfirm } from './components/popconfirm/popconfirm.js';
|
|
55
55
|
export { default as Highlight } from './components/highlight/highlight.js';
|
|
56
|
+
export { default as Bench } from './components/bench/bench.js';
|
|
56
57
|
export { useMessage } from './components/message/hooks.js';
|
|
57
58
|
export { default as Message } from './components/message/messager.js';
|
|
58
59
|
export { useNotification } from './components/notification/hooks.js';
|
package/dist/stylex.css
CHANGED
|
@@ -35,7 +35,6 @@
|
|
|
35
35
|
.musae-1jb30j6:not(#\#){padding:var(--musae-1wblvyz)}
|
|
36
36
|
.musae-12ldsqu:not(#\#){padding:var(--musae-oohzsl)}
|
|
37
37
|
.musae-8kignx:not(#\#){padding:var(--musae-qk2ac7)}
|
|
38
|
-
.musae-1eubc7e:hover:not(#\#){border:var(--1n3s2ii,revert)}
|
|
39
38
|
.musae-9r1u3d:not(#\#):not(#\#){border-color:transparent}
|
|
40
39
|
.musae-eqt46j:not(#\#):not(#\#){border-color:var(--borderColor,revert)}
|
|
41
40
|
.musae-12oqio5:not(#\#):not(#\#){border-radius:4px}
|
|
@@ -249,7 +248,6 @@ html[dir='rtl'] .musae-p4054r:not(#\#):not(#\#):not(#\#){text-align:left}
|
|
|
249
248
|
.musae-rycbv3:not(#\#):not(#\#):not(#\#){transform:translateX(50%) translateY(-50%)}
|
|
250
249
|
.musae-1vfo23u:not(#\#):not(#\#):not(#\#){transform:translateX(50%) translateY(50%)}
|
|
251
250
|
.musae-1v0jg1i:not(#\#):not(#\#):not(#\#){transform:var(--transform,revert)}
|
|
252
|
-
.musae-1g2r6go:not(#\#):not(#\#):not(#\#){transition-duration:.1s}
|
|
253
251
|
.musae-13dflua:not(#\#):not(#\#):not(#\#){transition-duration:.2s}
|
|
254
252
|
.musae-1d8287x:not(#\#):not(#\#):not(#\#){transition-duration:.3s}
|
|
255
253
|
.musae-fagghw:not(#\#):not(#\#):not(#\#){transition-property:all}
|
|
@@ -299,6 +297,9 @@ html[dir='rtl'] .musae-p4054r:not(#\#):not(#\#):not(#\#){text-align:left}
|
|
|
299
297
|
.musae-43481e:not(#\#):not(#\#):not(#\#):not(#\#){border-bottom-color:var(--borderBottomColor,revert)}
|
|
300
298
|
.musae-1q0q8m5:not(#\#):not(#\#):not(#\#):not(#\#){border-bottom-style:solid}
|
|
301
299
|
.musae-lntmim:not(#\#):not(#\#):not(#\#):not(#\#){border-bottom-width:var(--musae-1ax7z96)}
|
|
300
|
+
.musae-104k1kx:not(#\#):not(#\#):not(#\#):not(#\#){border-right-color:var(--borderRightColor,revert)}
|
|
301
|
+
.musae-32b0ac:not(#\#):not(#\#):not(#\#):not(#\#){border-right-style:solid}
|
|
302
|
+
.musae-1xkobc8:not(#\#):not(#\#):not(#\#):not(#\#){border-right-width:var(--musae-1ax7z96)}
|
|
302
303
|
.musae-is9nib:not(#\#):not(#\#):not(#\#):not(#\#){border-top-color:var(--borderTopColor,revert)}
|
|
303
304
|
.musae-13fuv20:not(#\#):not(#\#):not(#\#):not(#\#){border-top-style:solid}
|
|
304
305
|
.musae-1yeim8r:not(#\#):not(#\#):not(#\#):not(#\#){border-top-width:var(--musae-1ax7z96)}
|
|
@@ -335,6 +336,8 @@ html[dir='rtl'] .musae-p4054r:not(#\#):not(#\#):not(#\#){text-align:left}
|
|
|
335
336
|
.musae-hq7bbv:not(#\#):not(#\#):not(#\#):not(#\#){margin-bottom:var(--musae-15cw4i4)}
|
|
336
337
|
.musae-a4cli4:not(#\#):not(#\#):not(#\#):not(#\#){margin-bottom:var(--musae-1tzp6vk)}
|
|
337
338
|
.musae-rsi211:not(#\#):not(#\#):not(#\#):not(#\#){margin-bottom:var(--musae-qk2ac7)}
|
|
339
|
+
.musae-19i9eir:not(#\#):not(#\#):not(#\#):not(#\#){margin-left:var(--musae-1ncxh3n)}
|
|
340
|
+
.musae-ack27t:not(#\#):not(#\#):not(#\#):not(#\#){margin-right:auto}
|
|
338
341
|
.musae-1vc729f:not(#\#):not(#\#):not(#\#):not(#\#){margin-right:var(--musae-qk2ac7)}
|
|
339
342
|
.musae-dj266r:not(#\#):not(#\#):not(#\#):not(#\#){margin-top:0}
|
|
340
343
|
.musae-lpx92y:not(#\#):not(#\#):not(#\#):not(#\#){margin-top:calc(-1 * var(--musae-1qsoxbc))}
|
|
@@ -402,6 +405,8 @@ html[dir='rtl'] .musae-p4054r:not(#\#):not(#\#):not(#\#){text-align:left}
|
|
|
402
405
|
.musae-145rzd9:not(#\#):not(#\#):not(#\#):not(#\#){width:var(--musae-rlgvtq)}
|
|
403
406
|
.musae-1ha45ep:not(#\#):not(#\#):not(#\#):not(#\#){width:var(--musae-xrqq76)}
|
|
404
407
|
.musae-17fnjtu:not(#\#):not(#\#):not(#\#):not(#\#){width:var(--width,revert)}
|
|
408
|
+
.musae-q3rc72:not(:hover):not(#\#):not(#\#):not(#\#):not(#\#)::after{border-bottom-color:transparent}
|
|
409
|
+
.musae-1kev6kp:hover:not(#\#):not(#\#):not(#\#):not(#\#)::after{border-bottom-color:var(--1nc1zz8,revert)}
|
|
405
410
|
.musae-1su0kt9:not(:last-of-type):not(#\#):not(#\#):not(#\#):not(#\#)::after{height:var(--musae-rlgvtq)}
|
|
406
411
|
.musae-1o8gf8:not(:last-of-type):not(#\#):not(#\#):not(#\#):not(#\#)::after{top:50%}
|
|
407
412
|
.musae-vpkyr8:not(:last-of-type):not(#\#):not(#\#):not(#\#):not(#\#)::after{width:var(--musae-1ax7z96)}
|
|
@@ -425,6 +430,7 @@ html[dir='rtl'] .musae-p4054r:not(#\#):not(#\#):not(#\#){text-align:left}
|
|
|
425
430
|
.musae-ilzmfn:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{border-width:var(--musae-1hydgie)}
|
|
426
431
|
.musae-1nc033x:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{inset-block:0}
|
|
427
432
|
.musae-d54j2p:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{inset-block:0}
|
|
433
|
+
.musae-b7ltuz:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{inset-inline:0}
|
|
428
434
|
.musae-t448kv:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{transition:all .2s}
|
|
429
435
|
.musae-1uowca5:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-scrollbar{background-color:transparent}
|
|
430
436
|
.musae-27d4w3:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{background-color:var(--15iyedw,revert)}
|
|
@@ -460,16 +466,21 @@ html[dir='rtl'] .musae-91zhsk:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#
|
|
|
460
466
|
.musae-q1m6zb:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{transform:translate(100%,-160%) rotate(45deg)}
|
|
461
467
|
.musae-t0fc71:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{transition-duration:.2s}
|
|
462
468
|
.musae-6orayw:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{transition-property:border-color,border-width}
|
|
469
|
+
.musae-w91p3u:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{transition-property:border-color}
|
|
463
470
|
.musae-170pinb:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{visibility:visible}
|
|
464
471
|
.musae-11srvyv:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{visibility:visible}
|
|
465
472
|
.musae-yttlx6:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{will-change:border-color,border-width}
|
|
473
|
+
.musae-7h5a58:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{will-change:border-color}
|
|
466
474
|
.musae-c28cl8:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::view-transition-new(root){z-index:var(--musae-1vh8wei)}
|
|
467
475
|
.musae-ktw8en:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::view-transition-old(root){z-index:var(--musae-1vh8wei)}
|
|
468
476
|
.musae-1ly6cpr:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{z-index:var(--musae-1vh8wei)}
|
|
469
477
|
.musae-9xs3e7:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::view-transition-old(root){z-index:var(--musae-dlxqgz)}
|
|
470
478
|
.musae-qotmtd:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::view-transition-new(root){z-index:var(--musae-dlxqgz)}
|
|
479
|
+
.musae-auefp2:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{border-bottom-color:var(--imnen1,revert)}
|
|
480
|
+
.musae-zueuoj:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{border-bottom-width:var(--musae-jdzqnm)}
|
|
471
481
|
.musae-1p9jk5k:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{border-left-width:var(--musae-1aj7t22)}
|
|
472
482
|
.musae-1dn9wut:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{border-top-width:var(--musae-1aj7t22)}
|
|
483
|
+
.musae-1xrz1ek:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{bottom:0}
|
|
473
484
|
.musae-ec44on:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{height:calc(var(--musae-1l9c3uf) / 2)}
|
|
474
485
|
.musae-17xd6cp:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{height:var(--12qatcd,revert)}
|
|
475
486
|
.musae-1yecmy3:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{height:var(--1whluux,revert)}
|
package/package.json
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "musae",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.16",
|
|
4
4
|
"description": "musae-ui",
|
|
5
5
|
"author": "tutu@fantufantu.com",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"scripts": {
|
|
9
9
|
"test": "jest",
|
|
10
|
+
"test:coverage": "jest --coverage",
|
|
10
11
|
"dev": "rollup -c -w --environment NODE_ENV:development",
|
|
11
12
|
"build": "rollup -c --environment NODE_ENV:production",
|
|
12
13
|
"prepublishOnly": "rm -rf dist && npm run build",
|
|
13
|
-
"preinstall": "npx @aiszlab/watchdog preinstall"
|
|
14
|
+
"preinstall": "npx @aiszlab/watchdog preinstall",
|
|
15
|
+
"authors": "zx scripts/contributors.mjs"
|
|
14
16
|
},
|
|
15
17
|
"exports": {
|
|
16
18
|
".": {
|
|
@@ -59,7 +61,7 @@
|
|
|
59
61
|
"@testing-library/user-event": "^14.5.2",
|
|
60
62
|
"@types/dom-view-transitions": "^1.0.5",
|
|
61
63
|
"@types/jest": "^29.5.12",
|
|
62
|
-
"@types/node": "^
|
|
64
|
+
"@types/node": "^22.2.0",
|
|
63
65
|
"@types/react": "^18.3.3",
|
|
64
66
|
"@types/react-dom": "^18.3.0",
|
|
65
67
|
"babel-jest": "^29.7.0",
|
|
@@ -71,7 +73,8 @@
|
|
|
71
73
|
"react": "^18.3.1",
|
|
72
74
|
"react-dom": "^18.3.1",
|
|
73
75
|
"rollup": "^4.20.0",
|
|
74
|
-
"typescript": "^5.5.4"
|
|
76
|
+
"typescript": "^5.5.4",
|
|
77
|
+
"zx": "^8.1.4"
|
|
75
78
|
},
|
|
76
79
|
"peerDependencies": {
|
|
77
80
|
"react": "^18",
|