musae 0.2.5 → 0.2.7
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/README.md +4 -2
- package/dist/components/avatar/avatar.js +1 -1
- package/dist/components/breadcrumb/breadcrumb.js +1 -1
- package/dist/components/breadcrumb/item.js +1 -1
- package/dist/components/button/button.js +14 -16
- package/dist/components/calendar/calendar.js +1 -1
- package/dist/components/calendar/hooks.js +5 -5
- package/dist/components/checkbox/checkbox.d.ts +1 -1
- package/dist/components/checkbox/checkbox.js +205 -143
- package/dist/components/checkbox/group.d.ts +1 -1
- package/dist/components/checkbox/group.js +20 -19
- package/dist/components/checkbox/index.d.ts +2 -2
- package/dist/components/checkbox/types.d.ts +31 -4
- package/dist/components/clock/column.js +1 -1
- package/dist/components/collapse/collapse.js +1 -1
- package/dist/components/collapse/item.js +15 -9
- package/dist/components/date-picker/date-picker.js +1 -1
- package/dist/components/dialog/dialog.js +1 -1
- package/dist/components/dialog/popup.js +5 -5
- package/dist/components/divider/divider.js +1 -1
- package/dist/components/drawer/drawer.js +1 -1
- package/dist/components/drawer/popup.js +17 -17
- package/dist/components/empty/empty.js +1 -1
- package/dist/components/floating-action-button/floatable.d.ts +4 -0
- package/dist/components/floating-action-button/floatable.js +83 -0
- package/dist/components/floating-action-button/floating-action-button.d.ts +4 -0
- package/dist/components/floating-action-button/floating-action-button.js +26 -0
- package/dist/components/floating-action-button/index.d.ts +2 -0
- package/dist/components/floating-action-button/types.d.ts +44 -0
- package/dist/components/form/field/error.d.ts +2 -2
- package/dist/components/form/field/error.js +36 -22
- package/dist/components/form/field/field.js +6 -21
- package/dist/components/form/field/layout.js +1 -1
- package/dist/components/grid/col.js +1 -1
- package/dist/components/grid/row.js +1 -1
- package/dist/components/icon/icon.d.ts +1 -1
- package/dist/components/icon/icon.js +5 -3
- package/dist/components/icon/types.d.ts +6 -1
- package/dist/components/image/image.js +3 -2
- package/dist/components/image/preview/operations.js +5 -5
- package/dist/components/image/preview/preview.js +1 -1
- package/dist/components/input/input.d.ts +6 -6
- package/dist/components/input/input.js +9 -15
- package/dist/components/layout/header.js +2 -2
- package/dist/components/layout/layout.js +1 -1
- package/dist/components/loading/loading.js +2 -2
- package/dist/components/menu/group.js +29 -9
- package/dist/components/menu/hooks.js +1 -1
- package/dist/components/menu/item.js +1 -1
- package/dist/components/menu/menu.js +3 -1
- package/dist/components/notification/holder.js +14 -15
- package/dist/components/notification/notification.js +3 -3
- package/dist/components/otp-input/otp-input.js +1 -1
- package/dist/components/pagination/hooks.d.ts +4 -2
- package/dist/components/pagination/hooks.js +9 -4
- package/dist/components/pagination/item.js +6 -8
- package/dist/components/pagination/pagination.d.ts +1 -1
- package/dist/components/pagination/pagination.js +37 -9
- package/dist/components/pagination/types.d.ts +6 -0
- package/dist/components/picker/picker.js +2 -2
- package/dist/components/popover/popover.js +1 -1
- package/dist/components/popper/dropdown.js +3 -3
- package/dist/components/popper/popper.js +1 -1
- package/dist/components/portal/portal.js +6 -2
- package/dist/components/portal/types.d.ts +6 -0
- package/dist/components/progress/circular.js +1 -1
- package/dist/components/progress/linear.js +1 -1
- package/dist/components/radio/radio.js +1 -1
- package/dist/components/rate/rate.js +1 -1
- package/dist/components/rate/star.js +3 -3
- package/dist/components/ripple/ripple.js +1 -1
- package/dist/components/select/hooks.d.ts +1 -1
- package/dist/components/select/select.d.ts +1 -1
- package/dist/components/select/select.js +5 -5
- package/dist/components/select/selector.d.ts +3 -6
- package/dist/components/select/selector.js +16 -10
- package/dist/components/select/types.d.ts +3 -1
- package/dist/components/space/space.js +1 -1
- package/dist/components/steps/item.d.ts +1 -1
- package/dist/components/steps/item.js +77 -16
- package/dist/components/steps/steps.d.ts +1 -1
- package/dist/components/steps/steps.js +6 -4
- package/dist/components/steps/types.d.ts +15 -0
- package/dist/components/switch/switch.d.ts +1 -1
- package/dist/components/switch/switch.js +22 -22
- package/dist/components/table/body.js +1 -1
- package/dist/components/table/header/cell.js +3 -3
- package/dist/components/table/header/header.js +2 -2
- package/dist/components/tabs/hooks.d.ts +40 -0
- package/dist/components/tabs/hooks.js +98 -0
- package/dist/components/tabs/navigation.d.ts +4 -0
- package/dist/components/tabs/navigation.js +159 -0
- package/dist/components/tabs/panels.d.ts +4 -0
- package/dist/components/tabs/panels.js +78 -0
- package/dist/components/tabs/tab.d.ts +4 -0
- package/dist/components/tabs/tab.js +19 -0
- package/dist/components/tabs/tabs.d.ts +1 -1
- package/dist/components/tabs/tabs.js +24 -94
- package/dist/components/tabs/types.d.ts +50 -9
- package/dist/components/tag/tag.js +1 -1
- package/dist/components/theme/hooks.js +3 -3
- package/dist/components/theme/tokens.stylex.d.ts +1 -0
- package/dist/components/time-picker/panel.js +1 -1
- package/dist/components/time-picker/time-picker.js +1 -1
- package/dist/components/timeline/item.d.ts +1 -1
- package/dist/components/timeline/item.js +107 -119
- package/dist/components/timeline/timeline.d.ts +1 -1
- package/dist/components/timeline/timeline.js +8 -4
- package/dist/components/timeline/types.d.ts +16 -0
- package/dist/components/tour/tour.js +4 -3
- package/dist/components/transfer/context.d.ts +6 -0
- package/dist/components/transfer/context.js +11 -0
- package/dist/components/transfer/hooks.d.ts +19 -0
- package/dist/components/transfer/hooks.js +49 -0
- package/dist/components/transfer/index.d.ts +2 -0
- package/dist/components/transfer/item.d.ts +4 -0
- package/dist/components/transfer/item.js +25 -0
- package/dist/components/transfer/list.d.ts +4 -0
- package/dist/components/transfer/list.js +122 -0
- package/dist/components/transfer/transfer.d.ts +4 -0
- package/dist/components/transfer/transfer.js +82 -0
- package/dist/components/transfer/types.d.ts +83 -0
- package/dist/components/tree/context.js +2 -0
- package/dist/components/tree/hooks.d.ts +13 -2
- package/dist/components/tree/hooks.js +19 -2
- package/dist/components/tree/list.js +16 -9
- package/dist/components/tree/node.d.ts +1 -1
- package/dist/components/tree/node.js +24 -14
- package/dist/components/tree/tree.d.ts +1 -1
- package/dist/components/tree/tree.js +13 -9
- package/dist/components/tree/types.d.ts +18 -23
- package/dist/components/waterfall/sequential.js +4 -1
- package/dist/components/waterfall/waterfall.js +6 -3
- package/dist/hooks/use-class-names.d.ts +27 -1
- package/dist/hooks/use-container.d.ts +11 -0
- package/dist/hooks/use-container.js +23 -0
- package/dist/hooks/use-expandable.d.ts +11 -0
- package/dist/hooks/use-expandable.js +37 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/stylex.css +61 -40
- package/dist/utils/class-name.d.ts +96 -16
- package/dist/utils/class-name.js +69 -13
- package/package.json +21 -11
- package/dist/components/tabs/item.d.ts +0 -4
- package/dist/components/tabs/item.js +0 -22
- package/dist/hooks/use-expand-effect.d.ts +0 -12
- package/dist/hooks/use-expand-effect.js +0 -34
- /package/dist/node_modules/.pnpm/{@aiszlab_relax@1.2.55_react-dom@18.3.1_react@18.3.1 → @aiszlab_relax@1.2.59_react-dom@18.3.1_react@18.3.1__react@18.3.1}/node_modules/@aiszlab/relax/dist/dom/contains.js +0 -0
- /package/dist/node_modules/.pnpm/{@stylexjs_stylex@0.6.1 → @stylexjs_stylex@0.7.5}/node_modules/@stylexjs/stylex/lib/es/stylex.js +0 -0
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { useClassNames } from '../../hooks/use-class-names.js';
|
|
3
3
|
import { ComponentToken, GridClassToken } from '../../utils/class-name.js';
|
|
4
4
|
import clsx from 'clsx';
|
|
5
|
-
import { props } from '../../node_modules/.pnpm/@stylexjs_stylex@0.
|
|
5
|
+
import { props } from '../../node_modules/.pnpm/@stylexjs_stylex@0.7.5/node_modules/@stylexjs/stylex/lib/es/stylex.js';
|
|
6
6
|
|
|
7
7
|
const styles = {
|
|
8
8
|
col: props => [{
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { useClassNames } from '../../hooks/use-class-names.js';
|
|
3
3
|
import { ComponentToken, GridClassToken } from '../../utils/class-name.js';
|
|
4
4
|
import clsx from 'clsx';
|
|
5
|
-
import { props } from '../../node_modules/.pnpm/@stylexjs_stylex@0.
|
|
5
|
+
import { props } from '../../node_modules/.pnpm/@stylexjs_stylex@0.7.5/node_modules/@stylexjs/stylex/lib/es/stylex.js';
|
|
6
6
|
import { useGutters } from '../../hooks/use-gutters.js';
|
|
7
7
|
|
|
8
8
|
const styles = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { IconProps } from "./types";
|
|
3
|
-
declare const Icon: ({ as, color, size, onClick, style, className }: IconProps) => React.JSX.Element;
|
|
3
|
+
declare const Icon: ({ as, color, size, onClick, style, className, ...props }: IconProps) => React.JSX.Element;
|
|
4
4
|
export default Icon;
|
|
@@ -2,7 +2,7 @@ import React, { useMemo, createElement } from 'react';
|
|
|
2
2
|
import { isFunction } from '@aiszlab/relax';
|
|
3
3
|
import { ComponentToken, IconClassToken } from '../../utils/class-name.js';
|
|
4
4
|
import clsx from 'clsx';
|
|
5
|
-
import { props } from '../../node_modules/.pnpm/@stylexjs_stylex@0.
|
|
5
|
+
import { props } from '../../node_modules/.pnpm/@stylexjs_stylex@0.7.5/node_modules/@stylexjs/stylex/lib/es/stylex.js';
|
|
6
6
|
import { useClassNames } from '../../hooks/use-class-names.js';
|
|
7
7
|
|
|
8
8
|
const styles = {
|
|
@@ -26,7 +26,8 @@ const Icon = ({
|
|
|
26
26
|
size,
|
|
27
27
|
onClick,
|
|
28
28
|
style,
|
|
29
|
-
className
|
|
29
|
+
className,
|
|
30
|
+
...props$1
|
|
30
31
|
}) => {
|
|
31
32
|
const classNames = useClassNames(ComponentToken.Icon);
|
|
32
33
|
const asProps = useMemo(() => {
|
|
@@ -49,7 +50,8 @@ const Icon = ({
|
|
|
49
50
|
...styled.style,
|
|
50
51
|
...style
|
|
51
52
|
},
|
|
52
|
-
onClick: onClick
|
|
53
|
+
onClick: onClick,
|
|
54
|
+
...props$1
|
|
53
55
|
}, children);
|
|
54
56
|
};
|
|
55
57
|
var Icon$1 = Icon;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CSSProperties, FC, MouseEventHandler, ReactNode, ReactPortal } from "react";
|
|
1
|
+
import type { CSSProperties, FC, HTMLAttributes, MouseEventHandler, ReactNode, ReactPortal } from "react";
|
|
2
2
|
import { ComponentProps } from "../../types/element";
|
|
3
3
|
export type AsProps = Required<Pick<IconProps, "size">>;
|
|
4
4
|
type Size = "small" | "medium" | "large";
|
|
@@ -27,5 +27,10 @@ export interface IconProps extends ComponentProps {
|
|
|
27
27
|
* click handler
|
|
28
28
|
*/
|
|
29
29
|
onClick?: MouseEventHandler<HTMLSpanElement>;
|
|
30
|
+
/**
|
|
31
|
+
* @description
|
|
32
|
+
* role
|
|
33
|
+
*/
|
|
34
|
+
role?: HTMLAttributes<HTMLSpanElement>["role"];
|
|
30
35
|
}
|
|
31
36
|
export {};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import React, { useContext } from 'react';
|
|
2
2
|
import Preview from './preview/preview.js';
|
|
3
3
|
import PreviewGroupContext from './preview/context.js';
|
|
4
|
-
import { useBoolean, useEvent } from '@aiszlab/relax';
|
|
4
|
+
import { useBoolean, useImageLoader, useEvent } from '@aiszlab/relax';
|
|
5
5
|
|
|
6
6
|
const Image = ({ src, alt, width, height }) => {
|
|
7
7
|
const [isOpen, { turnOn, turnOff }] = useBoolean(false);
|
|
8
8
|
const contextValue = useContext(PreviewGroupContext);
|
|
9
|
+
const status = useImageLoader({ src });
|
|
9
10
|
const click = useEvent(() => {
|
|
10
11
|
// if current image is in preview group
|
|
11
12
|
// just use preview group to preview image
|
|
@@ -17,7 +18,7 @@ const Image = ({ src, alt, width, height }) => {
|
|
|
17
18
|
turnOn();
|
|
18
19
|
});
|
|
19
20
|
return (React.createElement(React.Fragment, null,
|
|
20
|
-
React.createElement("img", { src: src, alt: alt, onClick: click, width: width, height: height }),
|
|
21
|
+
status === "loaded" && React.createElement("img", { src: src, alt: alt, onClick: click, width: width, height: height }),
|
|
21
22
|
isOpen && !contextValue && React.createElement(Preview, { src: src, onClose: turnOff, alt: alt })));
|
|
22
23
|
};
|
|
23
24
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useContext } from 'react';
|
|
2
|
-
import _stylex from '../../../node_modules/.pnpm/@stylexjs_stylex@0.
|
|
2
|
+
import _stylex from '../../../node_modules/.pnpm/@stylexjs_stylex@0.7.5/node_modules/@stylexjs/stylex/lib/es/stylex.js';
|
|
3
3
|
import Portal from '../../portal/portal.js';
|
|
4
4
|
import { useTheme } from '../../theme/hooks.js';
|
|
5
5
|
import { ColorToken } from '../../../utils/colors.js';
|
|
@@ -13,10 +13,10 @@ import KeyboardArrowRight from '../../icon/icons/hardware/keyboard-arrow-right.j
|
|
|
13
13
|
const styles = {
|
|
14
14
|
footer: props => [{
|
|
15
15
|
position: "musae-ixxii4",
|
|
16
|
-
left: "musae-
|
|
16
|
+
left: "musae-u96u03",
|
|
17
17
|
insetInlineStart: null,
|
|
18
18
|
insetInlineEnd: null,
|
|
19
|
-
right: "musae-
|
|
19
|
+
right: "musae-3m8u43",
|
|
20
20
|
bottom: "musae-1ii70tt",
|
|
21
21
|
display: "musae-78zum5",
|
|
22
22
|
flexDirection: "musae-dt5ytf",
|
|
@@ -74,7 +74,7 @@ const Operations = ({
|
|
|
74
74
|
className: "musae-1qtgrog musae-14l26ut"
|
|
75
75
|
},
|
|
76
76
|
navigations: {
|
|
77
|
-
className: "musae-ixxii4 musae-
|
|
77
|
+
className: "musae-ixxii4 musae-u96u03 musae-3m8u43 musae-wa60dl musae-gj1dgu musae-78zum5 musae-1q0g3np musae-1qughib musae-6s0dn4"
|
|
78
78
|
},
|
|
79
79
|
footer: _stylex.props(styles.footer({
|
|
80
80
|
color: theme.colors[ColorToken.OnSurface]
|
|
@@ -98,7 +98,7 @@ const Operations = ({
|
|
|
98
98
|
} = useContext(PreviewGroupContext) ?? {};
|
|
99
99
|
const isMultiple = total > 1;
|
|
100
100
|
return React.createElement(Portal, {
|
|
101
|
-
|
|
101
|
+
lockable: true
|
|
102
102
|
}, React.createElement("div", {
|
|
103
103
|
className: styled.operations.className,
|
|
104
104
|
style: styled.operations.style
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { forwardRef, useState, useImperativeHandle } from 'react';
|
|
2
2
|
import Dialog from '../../dialog/dialog.js';
|
|
3
3
|
import Operations from './operations.js';
|
|
4
|
-
import _stylex from '../../../node_modules/.pnpm/@stylexjs_stylex@0.
|
|
4
|
+
import _stylex from '../../../node_modules/.pnpm/@stylexjs_stylex@0.7.5/node_modules/@stylexjs/stylex/lib/es/stylex.js';
|
|
5
5
|
|
|
6
6
|
const styles = {
|
|
7
7
|
image: props => [{
|
|
@@ -4,22 +4,22 @@ export declare const styles: Readonly<{
|
|
|
4
4
|
readonly wrapper: (props: {
|
|
5
5
|
outlineColor: CSSProperties["borderColor"];
|
|
6
6
|
}) => Readonly<[import("@stylexjs/stylex/lib/StyleXTypes").MapNamespace<{
|
|
7
|
-
display: "flex";
|
|
7
|
+
display: "inline-flex";
|
|
8
8
|
alignItems: "center";
|
|
9
9
|
cursor: "text";
|
|
10
|
+
borderRadius: import("@stylexjs/stylex/lib/StyleXTypes").StyleXVar<string>;
|
|
11
|
+
verticalAlign: string;
|
|
10
12
|
minHeight: import("@stylexjs/stylex/lib/StyleXTypes").StyleXVar<string>;
|
|
11
13
|
minWidth: import("@stylexjs/stylex/lib/StyleXTypes").StyleXVar<string>;
|
|
12
|
-
|
|
14
|
+
maxWidth: import("@stylexjs/stylex/lib/StyleXTypes").StyleXVar<string>;
|
|
13
15
|
boxShadow: string;
|
|
14
16
|
margin: import("@stylexjs/stylex/lib/StyleXTypes").StyleXVar<string>;
|
|
15
17
|
paddingBlock: import("@stylexjs/stylex/lib/StyleXTypes").StyleXVar<string>;
|
|
16
18
|
paddingInline: import("@stylexjs/stylex/lib/StyleXTypes").StyleXVar<string>;
|
|
17
|
-
|
|
19
|
+
transitionProperty: string;
|
|
20
|
+
transitionDuration: string;
|
|
18
21
|
willChange: string;
|
|
19
22
|
}>, import("@stylexjs/stylex/lib/StyleXTypes").InlineStyles]>;
|
|
20
|
-
readonly flexible: Readonly<{
|
|
21
|
-
readonly minWidth: import("@stylexjs/stylex/lib/StyleXTypes").StyleXClassNameFor<"minWidth", null>;
|
|
22
|
-
}>;
|
|
23
23
|
readonly focused: (props: {
|
|
24
24
|
outlineColor: CSSProperties["borderColor"];
|
|
25
25
|
}) => Readonly<[import("@stylexjs/stylex/lib/StyleXTypes").MapNamespace<{
|
|
@@ -2,7 +2,7 @@ import React, { forwardRef, useRef, useImperativeHandle } from 'react';
|
|
|
2
2
|
import { useInputEvents, useWrapperEvents } from './hooks.js';
|
|
3
3
|
import { useControlledState, useFocus } from '@aiszlab/relax';
|
|
4
4
|
import { ComponentToken, InputClassToken } from '../../utils/class-name.js';
|
|
5
|
-
import { props } from '../../node_modules/.pnpm/@stylexjs_stylex@0.
|
|
5
|
+
import { props } from '../../node_modules/.pnpm/@stylexjs_stylex@0.7.5/node_modules/@stylexjs/stylex/lib/es/stylex.js';
|
|
6
6
|
import { sizes } from '../theme/tokens.stylex.js';
|
|
7
7
|
import { useTheme } from '../theme/hooks.js';
|
|
8
8
|
import { ColorToken } from '../../utils/colors.js';
|
|
@@ -12,11 +12,9 @@ import { typography } from '../theme/theme.js';
|
|
|
12
12
|
|
|
13
13
|
const styles = {
|
|
14
14
|
wrapper: props => [{
|
|
15
|
-
display: "musae-
|
|
15
|
+
display: "musae-3nfvp2",
|
|
16
16
|
alignItems: "musae-6s0dn4",
|
|
17
17
|
cursor: "musae-1ed109x",
|
|
18
|
-
minHeight: "musae-1v3fk47",
|
|
19
|
-
minWidth: "musae-1fpxtso",
|
|
20
18
|
borderRadius: "musae-7bdoj",
|
|
21
19
|
borderStartStartRadius: null,
|
|
22
20
|
borderStartEndRadius: null,
|
|
@@ -26,6 +24,10 @@ const styles = {
|
|
|
26
24
|
borderTopRightRadius: null,
|
|
27
25
|
borderBottomLeftRadius: null,
|
|
28
26
|
borderBottomRightRadius: null,
|
|
27
|
+
verticalAlign: "musae-3ajldb",
|
|
28
|
+
minHeight: "musae-1v3fk47",
|
|
29
|
+
minWidth: "musae-1fpxtso",
|
|
30
|
+
maxWidth: "musae-kfv0gj",
|
|
29
31
|
boxShadow: "musae-igitpm",
|
|
30
32
|
margin: "musae-ieb5ut",
|
|
31
33
|
marginInline: null,
|
|
@@ -44,21 +46,13 @@ const styles = {
|
|
|
44
46
|
paddingLeft: null,
|
|
45
47
|
paddingEnd: null,
|
|
46
48
|
paddingRight: null,
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
transitionDelay: null,
|
|
50
|
-
transitionDuration: null,
|
|
51
|
-
transitionProperty: null,
|
|
52
|
-
transitionTimingFunction: null,
|
|
49
|
+
transitionProperty: "musae-kdsq27",
|
|
50
|
+
transitionDuration: "musae-13dflua",
|
|
53
51
|
willChange: "musae-1o9dqaq",
|
|
54
52
|
$$css: true
|
|
55
53
|
}, {
|
|
56
54
|
"--boxShadow": `inset 0px 0px 0px ${sizes.smallest} ${props.outlineColor}` != null ? `inset 0px 0px 0px ${sizes.smallest} ${props.outlineColor}` : "initial"
|
|
57
55
|
}],
|
|
58
|
-
flexible: {
|
|
59
|
-
minWidth: null,
|
|
60
|
-
$$css: true
|
|
61
|
-
},
|
|
62
56
|
focused: props => [{
|
|
63
57
|
boxShadow: "musae-igitpm",
|
|
64
58
|
$$css: true
|
|
@@ -182,7 +176,7 @@ const Input = forwardRef(({
|
|
|
182
176
|
className: "musae-jbqb8w musae-ohadnq musae-2vzm80 musae-yumy05 musae-1vwksmh musae-98rzlu"
|
|
183
177
|
}
|
|
184
178
|
};
|
|
185
|
-
return React.createElement("
|
|
179
|
+
return React.createElement("span", {
|
|
186
180
|
ref: wrapperRef,
|
|
187
181
|
className: clsx(classNames[InputClassToken.Wrapper], {
|
|
188
182
|
[classNames[InputClassToken.Focused]]: isFocused,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { useTheme } from '../theme/hooks.js';
|
|
3
|
-
import { props } from '../../node_modules/.pnpm/@stylexjs_stylex@0.
|
|
3
|
+
import { props } from '../../node_modules/.pnpm/@stylexjs_stylex@0.7.5/node_modules/@stylexjs/stylex/lib/es/stylex.js';
|
|
4
4
|
import { ColorToken } from '../../utils/colors.js';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
|
|
@@ -14,7 +14,7 @@ const styles = {
|
|
|
14
14
|
paddingRight: null,
|
|
15
15
|
marginBottom: "musae-hq7bbv",
|
|
16
16
|
position: "musae-7wzq59",
|
|
17
|
-
top: "musae-
|
|
17
|
+
top: "musae-13vifvy",
|
|
18
18
|
zIndex: "musae-1ac462h",
|
|
19
19
|
display: "musae-78zum5",
|
|
20
20
|
alignItems: "musae-6s0dn4",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Grid } from '../grid/index.js';
|
|
3
3
|
import { useChildren, ChildToken } from './hooks.js';
|
|
4
|
-
import _stylex from '../../node_modules/.pnpm/@stylexjs_stylex@0.
|
|
4
|
+
import _stylex from '../../node_modules/.pnpm/@stylexjs_stylex@0.7.5/node_modules/@stylexjs/stylex/lib/es/stylex.js';
|
|
5
5
|
import { useTheme } from '../theme/hooks.js';
|
|
6
6
|
import { ColorToken } from '../../utils/colors.js';
|
|
7
7
|
import clsx from 'clsx';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { props } from '../../node_modules/.pnpm/@stylexjs_stylex@0.
|
|
2
|
+
import { props } from '../../node_modules/.pnpm/@stylexjs_stylex@0.7.5/node_modules/@stylexjs/stylex/lib/es/stylex.js';
|
|
3
3
|
import { useClassNames } from '../../hooks/use-class-names.js';
|
|
4
4
|
import { ComponentToken, LoadingClassToken } from '../../utils/class-name.js';
|
|
5
5
|
import clsx from 'clsx';
|
|
@@ -66,7 +66,7 @@ const styles = {
|
|
|
66
66
|
"::after_content": "musae-1s928wv",
|
|
67
67
|
"::after_display": "musae-hkezso",
|
|
68
68
|
"::after_position": "musae-1j6awrg",
|
|
69
|
-
"::after_inset": "musae-
|
|
69
|
+
"::after_inset": "musae-arstr8",
|
|
70
70
|
"::after_insetInline": null,
|
|
71
71
|
"::after_insetInlineStart": null,
|
|
72
72
|
"::after_insetInlineEnd": null,
|
|
@@ -5,9 +5,9 @@ import { ComponentToken, MenuClassToken } from '../../utils/class-name.js';
|
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
import Item from './item.js';
|
|
7
7
|
import { useMenuContext } from './hooks.js';
|
|
8
|
-
import { useRefs } from '@aiszlab/relax';
|
|
9
|
-
import { props } from '../../node_modules/.pnpm/@stylexjs_stylex@0.
|
|
10
|
-
import {
|
|
8
|
+
import { useRefs, useUpdateEffect } from '@aiszlab/relax';
|
|
9
|
+
import { props } from '../../node_modules/.pnpm/@stylexjs_stylex@0.7.5/node_modules/@stylexjs/stylex/lib/es/stylex.js';
|
|
10
|
+
import { useExpandable } from '../../hooks/use-expandable.js';
|
|
11
11
|
import { useTheme } from '../theme/hooks.js';
|
|
12
12
|
import { ColorToken } from '../../utils/colors.js';
|
|
13
13
|
|
|
@@ -44,6 +44,20 @@ const styles = {
|
|
|
44
44
|
}, {
|
|
45
45
|
"--color": props.color != null ? props.color : "initial"
|
|
46
46
|
}],
|
|
47
|
+
horizontal: {
|
|
48
|
+
display: "musae-78zum5",
|
|
49
|
+
flexDirection: "musae-1q0g3np",
|
|
50
|
+
gap: "musae-vbka3v",
|
|
51
|
+
rowGap: null,
|
|
52
|
+
columnGap: null,
|
|
53
|
+
$$css: true
|
|
54
|
+
},
|
|
55
|
+
vertical: {
|
|
56
|
+
$$css: true
|
|
57
|
+
},
|
|
58
|
+
inline: {
|
|
59
|
+
$$css: true
|
|
60
|
+
},
|
|
47
61
|
hidden: {
|
|
48
62
|
display: "musae-1s85apg",
|
|
49
63
|
$$css: true
|
|
@@ -96,15 +110,21 @@ const Group = forwardRef(({
|
|
|
96
110
|
const groupRef = useRefs(ref, scope);
|
|
97
111
|
const theme = useTheme();
|
|
98
112
|
const isInline = mode === "inline";
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
113
|
+
const {
|
|
114
|
+
expand,
|
|
115
|
+
collapse
|
|
116
|
+
} = useExpandable();
|
|
117
|
+
useUpdateEffect(async () => {
|
|
118
|
+
if (expanded) {
|
|
119
|
+
await expand([scope, animate]);
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
await collapse([scope, animate]);
|
|
123
|
+
}, [expanded]);
|
|
104
124
|
const styled = {
|
|
105
125
|
group: props(styles.group.default({
|
|
106
126
|
color: theme.colors[ColorToken.OnSurface]
|
|
107
|
-
}), !expanded && styles.group.hidden),
|
|
127
|
+
}), styles.group[mode], !expanded && styles.group.hidden),
|
|
108
128
|
submenu: props(styles.submenu[mode])
|
|
109
129
|
};
|
|
110
130
|
return React.createElement("ul", {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useMemo, useCallback, useContext } from 'react';
|
|
2
2
|
import Context from './context.js';
|
|
3
3
|
import { useControlledState } from '@aiszlab/relax';
|
|
4
|
-
import { props } from '../../node_modules/.pnpm/@stylexjs_stylex@0.
|
|
4
|
+
import { props } from '../../node_modules/.pnpm/@stylexjs_stylex@0.7.5/node_modules/@stylexjs/stylex/lib/es/stylex.js';
|
|
5
5
|
import KeyboardArrowUp from '../icon/icons/hardware/keyboard-arrow-up.js';
|
|
6
6
|
|
|
7
7
|
const styles = {
|
|
@@ -2,7 +2,7 @@ import React, { forwardRef, useRef } from 'react';
|
|
|
2
2
|
import { useMenuContext, useItemChildren } from './hooks.js';
|
|
3
3
|
import { useClassNames } from '../../hooks/use-class-names.js';
|
|
4
4
|
import { ComponentToken, MenuClassToken } from '../../utils/class-name.js';
|
|
5
|
-
import { props } from '../../node_modules/.pnpm/@stylexjs_stylex@0.
|
|
5
|
+
import { props } from '../../node_modules/.pnpm/@stylexjs_stylex@0.7.5/node_modules/@stylexjs/stylex/lib/es/stylex.js';
|
|
6
6
|
import { sizes, spacing } from '../theme/tokens.stylex.js';
|
|
7
7
|
import { useTheme } from '../theme/hooks.js';
|
|
8
8
|
import { ColorToken } from '../../utils/colors.js';
|
|
@@ -60,7 +60,9 @@ const Menu = forwardRef(({
|
|
|
60
60
|
ref: targetRef,
|
|
61
61
|
items: items,
|
|
62
62
|
mode: mode,
|
|
63
|
-
className: clsx(classNames[MenuClassToken.Menu],
|
|
63
|
+
className: clsx(classNames[MenuClassToken.Menu], {
|
|
64
|
+
[classNames[MenuClassToken.MenuHorizontal]]: mode === "horizontal"
|
|
65
|
+
}, className, styled.className),
|
|
64
66
|
style: {
|
|
65
67
|
...styled.style,
|
|
66
68
|
...style
|
|
@@ -2,7 +2,7 @@ import React, { forwardRef, useState, useImperativeHandle } from 'react';
|
|
|
2
2
|
import Portal from '../portal/portal.js';
|
|
3
3
|
import { AnimatePresence } from 'framer-motion';
|
|
4
4
|
import Notification from './notification.js';
|
|
5
|
-
import { props } from '../../node_modules/.pnpm/@stylexjs_stylex@0.
|
|
5
|
+
import { props } from '../../node_modules/.pnpm/@stylexjs_stylex@0.7.5/node_modules/@stylexjs/stylex/lib/es/stylex.js';
|
|
6
6
|
import { useEvent } from '@aiszlab/relax';
|
|
7
7
|
|
|
8
8
|
const styles = {
|
|
@@ -25,8 +25,8 @@ const styles = {
|
|
|
25
25
|
$$css: true
|
|
26
26
|
},
|
|
27
27
|
top: {
|
|
28
|
-
top: "musae-
|
|
29
|
-
insetInline: "musae-
|
|
28
|
+
top: "musae-13vifvy",
|
|
29
|
+
insetInline: "musae-17y0mx6",
|
|
30
30
|
insetInlineStart: null,
|
|
31
31
|
insetInlineEnd: null,
|
|
32
32
|
left: null,
|
|
@@ -35,22 +35,22 @@ const styles = {
|
|
|
35
35
|
$$css: true
|
|
36
36
|
},
|
|
37
37
|
topRight: {
|
|
38
|
-
top: "musae-
|
|
39
|
-
insetInlineEnd: "musae-
|
|
38
|
+
top: "musae-13vifvy",
|
|
39
|
+
insetInlineEnd: "musae-tijo5x",
|
|
40
40
|
left: null,
|
|
41
41
|
right: null,
|
|
42
42
|
$$css: true
|
|
43
43
|
},
|
|
44
44
|
topLeft: {
|
|
45
|
-
top: "musae-
|
|
46
|
-
insetInlineStart: "musae-
|
|
45
|
+
top: "musae-13vifvy",
|
|
46
|
+
insetInlineStart: "musae-1o0tod",
|
|
47
47
|
left: null,
|
|
48
48
|
right: null,
|
|
49
49
|
$$css: true
|
|
50
50
|
},
|
|
51
51
|
bottom: {
|
|
52
|
-
bottom: "musae-
|
|
53
|
-
insetInline: "musae-
|
|
52
|
+
bottom: "musae-1ey2m1c",
|
|
53
|
+
insetInline: "musae-17y0mx6",
|
|
54
54
|
insetInlineStart: null,
|
|
55
55
|
insetInlineEnd: null,
|
|
56
56
|
left: null,
|
|
@@ -59,15 +59,15 @@ const styles = {
|
|
|
59
59
|
$$css: true
|
|
60
60
|
},
|
|
61
61
|
bottomLeft: {
|
|
62
|
-
bottom: "musae-
|
|
63
|
-
insetInlineStart: "musae-
|
|
62
|
+
bottom: "musae-1ey2m1c",
|
|
63
|
+
insetInlineStart: "musae-1o0tod",
|
|
64
64
|
left: null,
|
|
65
65
|
right: null,
|
|
66
66
|
$$css: true
|
|
67
67
|
},
|
|
68
68
|
bottomRight: {
|
|
69
|
-
bottom: "musae-
|
|
70
|
-
insetInlineEnd: "musae-
|
|
69
|
+
bottom: "musae-1ey2m1c",
|
|
70
|
+
insetInlineEnd: "musae-tijo5x",
|
|
71
71
|
left: null,
|
|
72
72
|
right: null,
|
|
73
73
|
$$css: true
|
|
@@ -114,8 +114,7 @@ const Holder = forwardRef((_, ref) => {
|
|
|
114
114
|
return React.createElement(Portal, {
|
|
115
115
|
destroyable: true,
|
|
116
116
|
open: notifications.size > 0,
|
|
117
|
-
key: placement
|
|
118
|
-
lockable: false
|
|
117
|
+
key: placement
|
|
119
118
|
}, React.createElement("div", {
|
|
120
119
|
className: styled.className,
|
|
121
120
|
style: styled.style
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import _stylex from '../../node_modules/.pnpm/@stylexjs_stylex@0.
|
|
1
|
+
import _stylex from '../../node_modules/.pnpm/@stylexjs_stylex@0.7.5/node_modules/@stylexjs/stylex/lib/es/stylex.js';
|
|
2
2
|
import React, { useEffect, createElement } from 'react';
|
|
3
3
|
import { usePresence, useAnimate } from 'framer-motion';
|
|
4
4
|
import { useTheme } from '../theme/hooks.js';
|
|
@@ -52,7 +52,7 @@ const styles = {
|
|
|
52
52
|
transitionDuration: "musae-13dflua",
|
|
53
53
|
transform: "musae-1v0jg1i",
|
|
54
54
|
opacity: "musae-g01cxk",
|
|
55
|
-
marginTop: "musae-
|
|
55
|
+
marginTop: "musae-dj266r",
|
|
56
56
|
display: "musae-rvj5dj",
|
|
57
57
|
gap: "musae-vbka3v",
|
|
58
58
|
rowGap: null,
|
|
@@ -172,7 +172,7 @@ const Notification = ({
|
|
|
172
172
|
const [scope, animate] = useAnimate();
|
|
173
173
|
const _placement = PLACEMENTS[direction];
|
|
174
174
|
const classNames = useClassNames(ComponentToken.Notification);
|
|
175
|
-
// after duration, `Notification` will auto
|
|
175
|
+
// after duration, `Notification` will auto destroy
|
|
176
176
|
useTimeout(async () => {
|
|
177
177
|
await animate(scope.current, {
|
|
178
178
|
opacity: 0,
|
|
@@ -5,11 +5,11 @@ import { type PaginationItems } from "./types";
|
|
|
5
5
|
* @description
|
|
6
6
|
* use pagination
|
|
7
7
|
*/
|
|
8
|
-
export declare const usePagiantion: ({ total, siblings, boundaries,
|
|
8
|
+
export declare const usePagiantion: ({ total, siblings, boundaries, pageSize: _pageSize, }: {
|
|
9
9
|
total: number;
|
|
10
10
|
siblings: number;
|
|
11
11
|
boundaries: number;
|
|
12
|
-
pageSize
|
|
12
|
+
pageSize?: number;
|
|
13
13
|
}) => {
|
|
14
14
|
paginationItems: PaginationItems;
|
|
15
15
|
add: (step?: number) => void;
|
|
@@ -18,4 +18,6 @@ export declare const usePagiantion: ({ total, siblings, boundaries, ...props }:
|
|
|
18
18
|
page: number;
|
|
19
19
|
hasPrev: boolean;
|
|
20
20
|
hasNext: boolean;
|
|
21
|
+
pageSize: number;
|
|
22
|
+
onPageSizeChange: (pageSize: number) => void;
|
|
21
23
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useCounter, range, clamp } from '@aiszlab/relax';
|
|
1
|
+
import { useControlledState, useCounter, range, clamp } from '@aiszlab/relax';
|
|
2
2
|
import { useMemo } from 'react';
|
|
3
3
|
import { PaginationItemType } from './types.js';
|
|
4
4
|
|
|
@@ -8,9 +8,9 @@ import { PaginationItemType } from './types.js';
|
|
|
8
8
|
* @description
|
|
9
9
|
* use pagination
|
|
10
10
|
*/
|
|
11
|
-
const usePagiantion = ({ total, siblings, boundaries,
|
|
12
|
-
const pageSize =
|
|
13
|
-
const pages = Math.ceil(total / pageSize);
|
|
11
|
+
const usePagiantion = ({ total, siblings, boundaries, pageSize: _pageSize, }) => {
|
|
12
|
+
const [pageSize, setPageSize] = useControlledState(_pageSize, { defaultState: 10 });
|
|
13
|
+
const pages = useMemo(() => Math.ceil(total / Math.max(1, pageSize)), [total, pageSize]);
|
|
14
14
|
const [page, { add, subtract, setCount }] = useCounter(1, {
|
|
15
15
|
min: 1,
|
|
16
16
|
max: pages,
|
|
@@ -40,6 +40,9 @@ const usePagiantion = ({ total, siblings, boundaries, ...props }) => {
|
|
|
40
40
|
const hasPrev = page > 1;
|
|
41
41
|
// whether next button is usable
|
|
42
42
|
const hasNext = page < pages;
|
|
43
|
+
const onPageSizeChange = (pageSize) => {
|
|
44
|
+
setPageSize(pageSize);
|
|
45
|
+
};
|
|
43
46
|
return {
|
|
44
47
|
paginationItems,
|
|
45
48
|
add,
|
|
@@ -48,6 +51,8 @@ const usePagiantion = ({ total, siblings, boundaries, ...props }) => {
|
|
|
48
51
|
page,
|
|
49
52
|
hasPrev,
|
|
50
53
|
hasNext,
|
|
54
|
+
pageSize,
|
|
55
|
+
onPageSizeChange,
|
|
51
56
|
};
|
|
52
57
|
};
|
|
53
58
|
|
|
@@ -37,10 +37,7 @@ const Item = ({
|
|
|
37
37
|
if (value === PaginationItemType.MorePrev || value === PaginationItemType.MoreNext) {
|
|
38
38
|
const styled = {
|
|
39
39
|
more: {
|
|
40
|
-
className: "musae-
|
|
41
|
-
},
|
|
42
|
-
hidden: {
|
|
43
|
-
className: "musae-1s85apg"
|
|
40
|
+
className: "musae-1aldg33 musae-1oew0n0"
|
|
44
41
|
}
|
|
45
42
|
};
|
|
46
43
|
const isNegative = value === PaginationItemType.MorePrev;
|
|
@@ -51,11 +48,12 @@ const Item = ({
|
|
|
51
48
|
className: styled.more.className,
|
|
52
49
|
style: styled.more.style,
|
|
53
50
|
onClick: () => {
|
|
54
|
-
isNegative ?
|
|
51
|
+
isNegative ? subtract(5) : add(5);
|
|
55
52
|
}
|
|
56
|
-
}, React.createElement(MoreHoriz,
|
|
57
|
-
|
|
58
|
-
|
|
53
|
+
}, React.createElement(MoreHoriz, {
|
|
54
|
+
role: "separator"
|
|
55
|
+
}), createElement(isNegative ? KeyboardDoubleArrowLeft : KeyboardDoubleArrowRight, {
|
|
56
|
+
role: "button"
|
|
59
57
|
}));
|
|
60
58
|
}
|
|
61
59
|
return React.createElement(Button, {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { PagiantionProps } from "./types";
|
|
3
|
-
declare const Pagination: ({ total, siblings, boundaries, pageSize }: PagiantionProps) => React.JSX.Element;
|
|
3
|
+
declare const Pagination: ({ total, siblings, boundaries, pageSize: _pageSize, pageSizes, }: PagiantionProps) => React.JSX.Element;
|
|
4
4
|
export default Pagination;
|