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.
Files changed (150) hide show
  1. package/README.md +4 -2
  2. package/dist/components/avatar/avatar.js +1 -1
  3. package/dist/components/breadcrumb/breadcrumb.js +1 -1
  4. package/dist/components/breadcrumb/item.js +1 -1
  5. package/dist/components/button/button.js +14 -16
  6. package/dist/components/calendar/calendar.js +1 -1
  7. package/dist/components/calendar/hooks.js +5 -5
  8. package/dist/components/checkbox/checkbox.d.ts +1 -1
  9. package/dist/components/checkbox/checkbox.js +205 -143
  10. package/dist/components/checkbox/group.d.ts +1 -1
  11. package/dist/components/checkbox/group.js +20 -19
  12. package/dist/components/checkbox/index.d.ts +2 -2
  13. package/dist/components/checkbox/types.d.ts +31 -4
  14. package/dist/components/clock/column.js +1 -1
  15. package/dist/components/collapse/collapse.js +1 -1
  16. package/dist/components/collapse/item.js +15 -9
  17. package/dist/components/date-picker/date-picker.js +1 -1
  18. package/dist/components/dialog/dialog.js +1 -1
  19. package/dist/components/dialog/popup.js +5 -5
  20. package/dist/components/divider/divider.js +1 -1
  21. package/dist/components/drawer/drawer.js +1 -1
  22. package/dist/components/drawer/popup.js +17 -17
  23. package/dist/components/empty/empty.js +1 -1
  24. package/dist/components/floating-action-button/floatable.d.ts +4 -0
  25. package/dist/components/floating-action-button/floatable.js +83 -0
  26. package/dist/components/floating-action-button/floating-action-button.d.ts +4 -0
  27. package/dist/components/floating-action-button/floating-action-button.js +26 -0
  28. package/dist/components/floating-action-button/index.d.ts +2 -0
  29. package/dist/components/floating-action-button/types.d.ts +44 -0
  30. package/dist/components/form/field/error.d.ts +2 -2
  31. package/dist/components/form/field/error.js +36 -22
  32. package/dist/components/form/field/field.js +6 -21
  33. package/dist/components/form/field/layout.js +1 -1
  34. package/dist/components/grid/col.js +1 -1
  35. package/dist/components/grid/row.js +1 -1
  36. package/dist/components/icon/icon.d.ts +1 -1
  37. package/dist/components/icon/icon.js +5 -3
  38. package/dist/components/icon/types.d.ts +6 -1
  39. package/dist/components/image/image.js +3 -2
  40. package/dist/components/image/preview/operations.js +5 -5
  41. package/dist/components/image/preview/preview.js +1 -1
  42. package/dist/components/input/input.d.ts +6 -6
  43. package/dist/components/input/input.js +9 -15
  44. package/dist/components/layout/header.js +2 -2
  45. package/dist/components/layout/layout.js +1 -1
  46. package/dist/components/loading/loading.js +2 -2
  47. package/dist/components/menu/group.js +29 -9
  48. package/dist/components/menu/hooks.js +1 -1
  49. package/dist/components/menu/item.js +1 -1
  50. package/dist/components/menu/menu.js +3 -1
  51. package/dist/components/notification/holder.js +14 -15
  52. package/dist/components/notification/notification.js +3 -3
  53. package/dist/components/otp-input/otp-input.js +1 -1
  54. package/dist/components/pagination/hooks.d.ts +4 -2
  55. package/dist/components/pagination/hooks.js +9 -4
  56. package/dist/components/pagination/item.js +6 -8
  57. package/dist/components/pagination/pagination.d.ts +1 -1
  58. package/dist/components/pagination/pagination.js +37 -9
  59. package/dist/components/pagination/types.d.ts +6 -0
  60. package/dist/components/picker/picker.js +2 -2
  61. package/dist/components/popover/popover.js +1 -1
  62. package/dist/components/popper/dropdown.js +3 -3
  63. package/dist/components/popper/popper.js +1 -1
  64. package/dist/components/portal/portal.js +6 -2
  65. package/dist/components/portal/types.d.ts +6 -0
  66. package/dist/components/progress/circular.js +1 -1
  67. package/dist/components/progress/linear.js +1 -1
  68. package/dist/components/radio/radio.js +1 -1
  69. package/dist/components/rate/rate.js +1 -1
  70. package/dist/components/rate/star.js +3 -3
  71. package/dist/components/ripple/ripple.js +1 -1
  72. package/dist/components/select/hooks.d.ts +1 -1
  73. package/dist/components/select/select.d.ts +1 -1
  74. package/dist/components/select/select.js +5 -5
  75. package/dist/components/select/selector.d.ts +3 -6
  76. package/dist/components/select/selector.js +16 -10
  77. package/dist/components/select/types.d.ts +3 -1
  78. package/dist/components/space/space.js +1 -1
  79. package/dist/components/steps/item.d.ts +1 -1
  80. package/dist/components/steps/item.js +77 -16
  81. package/dist/components/steps/steps.d.ts +1 -1
  82. package/dist/components/steps/steps.js +6 -4
  83. package/dist/components/steps/types.d.ts +15 -0
  84. package/dist/components/switch/switch.d.ts +1 -1
  85. package/dist/components/switch/switch.js +22 -22
  86. package/dist/components/table/body.js +1 -1
  87. package/dist/components/table/header/cell.js +3 -3
  88. package/dist/components/table/header/header.js +2 -2
  89. package/dist/components/tabs/hooks.d.ts +40 -0
  90. package/dist/components/tabs/hooks.js +98 -0
  91. package/dist/components/tabs/navigation.d.ts +4 -0
  92. package/dist/components/tabs/navigation.js +159 -0
  93. package/dist/components/tabs/panels.d.ts +4 -0
  94. package/dist/components/tabs/panels.js +78 -0
  95. package/dist/components/tabs/tab.d.ts +4 -0
  96. package/dist/components/tabs/tab.js +19 -0
  97. package/dist/components/tabs/tabs.d.ts +1 -1
  98. package/dist/components/tabs/tabs.js +24 -94
  99. package/dist/components/tabs/types.d.ts +50 -9
  100. package/dist/components/tag/tag.js +1 -1
  101. package/dist/components/theme/hooks.js +3 -3
  102. package/dist/components/theme/tokens.stylex.d.ts +1 -0
  103. package/dist/components/time-picker/panel.js +1 -1
  104. package/dist/components/time-picker/time-picker.js +1 -1
  105. package/dist/components/timeline/item.d.ts +1 -1
  106. package/dist/components/timeline/item.js +107 -119
  107. package/dist/components/timeline/timeline.d.ts +1 -1
  108. package/dist/components/timeline/timeline.js +8 -4
  109. package/dist/components/timeline/types.d.ts +16 -0
  110. package/dist/components/tour/tour.js +4 -3
  111. package/dist/components/transfer/context.d.ts +6 -0
  112. package/dist/components/transfer/context.js +11 -0
  113. package/dist/components/transfer/hooks.d.ts +19 -0
  114. package/dist/components/transfer/hooks.js +49 -0
  115. package/dist/components/transfer/index.d.ts +2 -0
  116. package/dist/components/transfer/item.d.ts +4 -0
  117. package/dist/components/transfer/item.js +25 -0
  118. package/dist/components/transfer/list.d.ts +4 -0
  119. package/dist/components/transfer/list.js +122 -0
  120. package/dist/components/transfer/transfer.d.ts +4 -0
  121. package/dist/components/transfer/transfer.js +82 -0
  122. package/dist/components/transfer/types.d.ts +83 -0
  123. package/dist/components/tree/context.js +2 -0
  124. package/dist/components/tree/hooks.d.ts +13 -2
  125. package/dist/components/tree/hooks.js +19 -2
  126. package/dist/components/tree/list.js +16 -9
  127. package/dist/components/tree/node.d.ts +1 -1
  128. package/dist/components/tree/node.js +24 -14
  129. package/dist/components/tree/tree.d.ts +1 -1
  130. package/dist/components/tree/tree.js +13 -9
  131. package/dist/components/tree/types.d.ts +18 -23
  132. package/dist/components/waterfall/sequential.js +4 -1
  133. package/dist/components/waterfall/waterfall.js +6 -3
  134. package/dist/hooks/use-class-names.d.ts +27 -1
  135. package/dist/hooks/use-container.d.ts +11 -0
  136. package/dist/hooks/use-container.js +23 -0
  137. package/dist/hooks/use-expandable.d.ts +11 -0
  138. package/dist/hooks/use-expandable.js +37 -0
  139. package/dist/index.d.ts +2 -0
  140. package/dist/index.js +2 -0
  141. package/dist/stylex.css +61 -40
  142. package/dist/utils/class-name.d.ts +96 -16
  143. package/dist/utils/class-name.js +69 -13
  144. package/package.json +21 -11
  145. package/dist/components/tabs/item.d.ts +0 -4
  146. package/dist/components/tabs/item.js +0 -22
  147. package/dist/hooks/use-expand-effect.d.ts +0 -12
  148. package/dist/hooks/use-expand-effect.js +0 -34
  149. /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
  150. /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.6.1/node_modules/@stylexjs/stylex/lib/es/stylex.js';
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.6.1/node_modules/@stylexjs/stylex/lib/es/stylex.js';
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.6.1/node_modules/@stylexjs/stylex/lib/es/stylex.js';
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.6.1/node_modules/@stylexjs/stylex/lib/es/stylex.js';
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-1tjciyl",
16
+ left: "musae-u96u03",
17
17
  insetInlineStart: null,
18
18
  insetInlineEnd: null,
19
- right: "musae-15gpytn",
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-1tjciyl musae-15gpytn musae-wa60dl musae-gj1dgu musae-78zum5 musae-1q0g3np musae-1qughib musae-6s0dn4"
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
- open: true
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.6.1/node_modules/@stylexjs/stylex/lib/es/stylex.js';
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
- borderRadius: import("@stylexjs/stylex/lib/StyleXTypes").StyleXVar<string>;
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
- transition: string;
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.6.1/node_modules/@stylexjs/stylex/lib/es/stylex.js';
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-78zum5",
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
- transition: "musae-nz68lp",
48
- transitionBehavior: null,
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("div", {
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.6.1/node_modules/@stylexjs/stylex/lib/es/stylex.js';
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-9oc6z4",
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.6.1/node_modules/@stylexjs/stylex/lib/es/stylex.js';
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.6.1/node_modules/@stylexjs/stylex/lib/es/stylex.js';
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-1799ia1",
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.6.1/node_modules/@stylexjs/stylex/lib/es/stylex.js';
10
- import { useExpandEffect } from '../../hooks/use-expand-effect.js';
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
- useExpandEffect({
100
- animate,
101
- target: scope,
102
- expanded
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.6.1/node_modules/@stylexjs/stylex/lib/es/stylex.js';
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.6.1/node_modules/@stylexjs/stylex/lib/es/stylex.js';
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], className, styled.className),
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.6.1/node_modules/@stylexjs/stylex/lib/es/stylex.js';
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-9oc6z4",
29
- insetInline: "musae-l33w4x",
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-9oc6z4",
39
- insetInlineEnd: "musae-hw0b42",
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-9oc6z4",
46
- insetInlineStart: "musae-1at4hj2",
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-1sh2tzk",
53
- insetInline: "musae-l33w4x",
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-1sh2tzk",
63
- insetInlineStart: "musae-1at4hj2",
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-1sh2tzk",
70
- insetInlineEnd: "musae-hw0b42",
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.6.1/node_modules/@stylexjs/stylex/lib/es/stylex.js';
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-1q12cbh",
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 destory
175
+ // after duration, `Notification` will auto destroy
176
176
  useTimeout(async () => {
177
177
  await animate(scope.current, {
178
178
  opacity: 0,
@@ -67,7 +67,7 @@ const OtpInput = ({
67
67
  className: styled.input.className,
68
68
  style: {
69
69
  ...styled.input.style,
70
- minWidth: "unset"
70
+ minWidth: 0
71
71
  },
72
72
  ref: inputRef => {
73
73
  inputRefs.current[index] = inputRef;
@@ -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, ...props }: {
8
+ export declare const usePagiantion: ({ total, siblings, boundaries, pageSize: _pageSize, }: {
9
9
  total: number;
10
10
  siblings: number;
11
11
  boundaries: number;
12
- pageSize: number;
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, ...props }) => {
12
- const pageSize = props.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-1pqvcko musae-13amitz"
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 ? add(5) : subtract(5);
51
+ isNegative ? subtract(5) : add(5);
55
52
  }
56
- }, React.createElement(MoreHoriz, null), createElement(isNegative ? KeyboardDoubleArrowLeft : KeyboardDoubleArrowRight, {
57
- className: styled.hidden.className,
58
- style: styled.hidden.style
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;