musae 0.2.0 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist/components/avatar/avatar.d.ts +5 -1
  2. package/dist/components/avatar/avatar.js +35 -11
  3. package/dist/components/avatar/group.d.ts +1 -1
  4. package/dist/components/avatar/group.js +32 -3
  5. package/dist/components/avatar/types.d.ts +5 -3
  6. package/dist/components/button/button.js +5 -3
  7. package/dist/components/calendar/calendar.d.ts +1 -1
  8. package/dist/components/calendar/calendar.js +10 -3
  9. package/dist/components/calendar/hooks.d.ts +7 -2
  10. package/dist/components/calendar/hooks.js +13 -8
  11. package/dist/components/dialog/popup.js +3 -3
  12. package/dist/components/drawer/popup.js +15 -15
  13. package/dist/components/image/preview/operations.js +3 -3
  14. package/dist/components/layout/header.js +1 -1
  15. package/dist/components/menu/item.js +4 -7
  16. package/dist/components/notification/holder.js +12 -12
  17. package/dist/components/notification/notification.js +1 -1
  18. package/dist/components/popover/popover.d.ts +1 -1
  19. package/dist/components/popover/popover.js +17 -10
  20. package/dist/components/popover/types.d.ts +12 -1
  21. package/dist/components/popper/dropdown.js +12 -12
  22. package/dist/components/popper/popper.d.ts +1 -1
  23. package/dist/components/popper/popper.js +2 -2
  24. package/dist/components/popper/types.d.ts +6 -1
  25. package/dist/components/radio/radio.d.ts +1 -1
  26. package/dist/components/radio/radio.js +24 -13
  27. package/dist/components/rate/star.js +2 -2
  28. package/dist/components/space/space.d.ts +1 -1
  29. package/dist/components/space/space.js +14 -5
  30. package/dist/components/space/types.d.ts +10 -2
  31. package/dist/components/switch/switch.js +4 -4
  32. package/dist/components/table/header.js +1 -1
  33. package/dist/components/tour/tour.js +1 -1
  34. package/dist/hooks/use-image.d.ts +11 -0
  35. package/dist/hooks/use-image.js +34 -0
  36. package/dist/stylex.css +19 -17
  37. package/package.json +3 -3
@@ -1,4 +1,8 @@
1
1
  import React from "react";
2
2
  import type { AvatarProps } from "./types";
3
- declare const Avatar: ({ src, alt, shape: _shape, size: _size }: AvatarProps) => React.JSX.Element;
3
+ /**
4
+ * @description
5
+ * `Avatar`
6
+ */
7
+ declare const Avatar: React.ForwardRefExoticComponent<AvatarProps & React.RefAttributes<HTMLSpanElement>>;
4
8
  export default Avatar;
@@ -1,4 +1,4 @@
1
- import React, { useContext } from 'react';
1
+ import React, { forwardRef, useContext } from 'react';
2
2
  import { props } from '../../node_modules/@stylexjs/stylex/lib/es/stylex.js';
3
3
  import { Context } from './context.js';
4
4
  import { useTheme } from '../theme/hooks.js';
@@ -6,9 +6,11 @@ import { ColorToken } from '../../utils/colors.js';
6
6
  import { useClassNames } from '../../hooks/use-class-names.js';
7
7
  import { ComponentToken, AvatarClassToken } from '../../utils/class-name.js';
8
8
  import clsx from 'clsx';
9
+ import { typography } from '../theme/theme.js';
10
+ import { useImage } from '../../hooks/use-image.js';
9
11
 
10
12
  const styles = {
11
- avatar: {
13
+ avatar: props => [{
12
14
  borderWidth: "musae-1i8jmgv",
13
15
  borderInlineWidth: null,
14
16
  borderInlineStartWidth: null,
@@ -38,8 +40,16 @@ const styles = {
38
40
  borderBottomColor: null,
39
41
  boxSizing: "musae-9f619",
40
42
  display: "musae-3nfvp2",
43
+ backgroundColor: "musae-q1mx2j",
44
+ color: "musae-19dipnz",
45
+ alignItems: "musae-6s0dn4",
46
+ justifyContent: "musae-l56j7k",
47
+ userSelect: "musae-87ps6o",
41
48
  $$css: true
42
- },
49
+ }, {
50
+ "--backgroundColor": props.backgroundColor != null ? props.backgroundColor : "initial",
51
+ "--color": props.color != null ? props.color : "initial"
52
+ }],
43
53
  image: {
44
54
  width: "musae-wfgd1y",
45
55
  height: "musae-b27hse",
@@ -112,20 +122,31 @@ const styles = {
112
122
  $$css: true
113
123
  }
114
124
  };
115
- const Avatar = ({
125
+ /**
126
+ * @description
127
+ * `Avatar`
128
+ */
129
+ const Avatar = forwardRef(({
116
130
  src,
117
131
  alt,
118
132
  shape: _shape = "circular",
119
- size: _size = "medium"
120
- }) => {
133
+ size: _size = "medium",
134
+ ...props$1
135
+ }, ref) => {
121
136
  const theme = useTheme();
122
137
  const group = useContext(Context);
123
138
  const isInGroup = !!group;
124
139
  const size = group?.size ?? _size;
125
140
  const shape = group?.shape ?? _shape;
126
141
  const classNames = useClassNames(ComponentToken.Avatar);
142
+ const isLoaded = useImage({
143
+ src
144
+ });
127
145
  const styled = {
128
- avatar: props(styles.avatar, styles[size], styles[shape], isInGroup && styles.overlapping({
146
+ avatar: props(typography.label[size], styles.avatar({
147
+ backgroundColor: theme.colors[ColorToken.PrimaryContainer],
148
+ color: theme.colors[ColorToken.Primary]
149
+ }), styles[size], styles[shape], isInGroup && styles.overlapping({
129
150
  outlineColor: theme.colors[ColorToken.OnPrimary]
130
151
  })),
131
152
  image: {
@@ -133,14 +154,17 @@ const Avatar = ({
133
154
  }
134
155
  };
135
156
  return React.createElement("span", {
157
+ ...props$1,
136
158
  className: clsx(classNames[AvatarClassToken.Avatar], styled.avatar.className),
137
- style: styled.avatar.style
138
- }, React.createElement("img", {
159
+ style: styled.avatar.style,
160
+ ref: ref
161
+ }, isLoaded === "loaded" ? React.createElement("img", {
162
+ draggable: false,
139
163
  src: src,
140
164
  alt: alt,
141
165
  className: styled.image.className,
142
166
  style: styled.image.style
143
- }));
144
- };
167
+ }) : alt?.slice(0, 2).toUpperCase());
168
+ });
145
169
 
146
170
  export { Avatar as default };
@@ -1,4 +1,4 @@
1
1
  import React from "react";
2
2
  import { type AvatarGroupProps } from "./types";
3
- declare const Group: ({ 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;
@@ -1,18 +1,47 @@
1
- import React from 'react';
1
+ import React, { useMemo, Children, cloneElement } from 'react';
2
2
  import { Context } from './context.js';
3
3
  import { useClassNames } from '../../hooks/use-class-names.js';
4
4
  import { ComponentToken, AvatarClassToken } from '../../utils/class-name.js';
5
+ import Popover from '../popover/popover.js';
6
+ import Avatar from './avatar.js';
5
7
 
6
8
  const Group = ({
7
- children,
9
+ children: _children,
8
10
  shape = "circular",
9
11
  size = "medium",
10
12
  max = 3
11
13
  }) => {
12
14
  const styled = {
13
- className: "musae-3nfvp2"
15
+ className: "musae-3nfvp2 musae-87ps6o"
14
16
  };
15
17
  const classNames = useClassNames(ComponentToken.Avatar);
18
+ const children = useMemo(() => {
19
+ const __children = Children.toArray(_children);
20
+ const [visible, hidden] = __children.reduce((prev, child, index) => {
21
+ // @ts-ignore
22
+ const element = cloneElement(child, {
23
+ key: `avatars-${index}`
24
+ });
25
+ // great than max, hide current node
26
+ if (index >= max) {
27
+ prev[1].push(element);
28
+ } else {
29
+ prev[0].push(element);
30
+ }
31
+ return prev;
32
+ }, [[], []]);
33
+ // got hidden nodes, show ellipse node
34
+ if (hidden.length > 0) {
35
+ visible.push(React.createElement(Popover, {
36
+ description: React.createElement(Group, null, hidden),
37
+ key: "avatars-hidden",
38
+ placement: "top"
39
+ }, React.createElement(Avatar, {
40
+ alt: `+${hidden.length}`
41
+ })));
42
+ }
43
+ return visible;
44
+ }, [_children, max]);
16
45
  return React.createElement(Context.Provider, {
17
46
  value: {
18
47
  shape,
@@ -1,4 +1,4 @@
1
- import type { ReactNode } from "react";
1
+ import type { ReactNode, RefAttributes } from "react";
2
2
  type Size = "small" | "medium" | "large";
3
3
  type Shape = "circular" | "squared";
4
4
  /**
@@ -14,7 +14,9 @@ export type AvatarProps = {
14
14
  src?: string;
15
15
  /**
16
16
  * @description
17
- * alt
17
+ * alt, (fallback usage)
18
+ * if user do not provide `src`, or `src` is invalid
19
+ * show `alt`
18
20
  * @default void 0
19
21
  */
20
22
  alt?: string;
@@ -70,7 +72,7 @@ export type TypedAvatar = {
70
72
  * @description
71
73
  * component self
72
74
  */
73
- (props: AvatarProps): JSX.Element;
75
+ (props: AvatarProps & RefAttributes<HTMLSpanElement>): ReactNode;
74
76
  /**
75
77
  * @description
76
78
  * group
@@ -227,7 +227,9 @@ const Button = forwardRef(({
227
227
  onPointerEnter,
228
228
  onPointerLeave,
229
229
  type = "button",
230
- ...props$1
230
+ onClick: _onClick,
231
+ prefix,
232
+ suffix
231
233
  }, ref) => {
232
234
  const classNames = useClassNames(ComponentToken.Button);
233
235
  const theme = useTheme();
@@ -236,7 +238,7 @@ const Button = forwardRef(({
236
238
  clear,
237
239
  ripples
238
240
  } = useButton({
239
- onClick: props$1.onClick
241
+ onClick: _onClick
240
242
  });
241
243
  const styled = {
242
244
  button: props(styles.button, typography.label[size],
@@ -274,7 +276,7 @@ const Button = forwardRef(({
274
276
  onPointerEnter: onPointerEnter,
275
277
  onPointerLeave: onPointerLeave,
276
278
  type: type
277
- }, props$1.prefix, children, props$1.suffix, ripple && React.createElement(Ripple, {
279
+ }, prefix, children, suffix, ripple && React.createElement(Ripple, {
278
280
  ripples: ripples,
279
281
  onClear: clear
280
282
  }));
@@ -1,4 +1,4 @@
1
1
  import React from "react";
2
2
  import type { CalendarProps } from "./types";
3
- declare const Calendar: ({ className, style, ...props }: CalendarProps) => React.JSX.Element;
3
+ declare const Calendar: ({ className, style, value, onClick: _onClick, focusedAt: _focusedAt }: CalendarProps) => React.JSX.Element;
4
4
  export default Calendar;
@@ -32,19 +32,26 @@ const styles = {
32
32
  const Calendar = ({
33
33
  className,
34
34
  style,
35
- ...props$1
35
+ value,
36
+ onClick: _onClick,
37
+ focusedAt: _focusedAt
36
38
  }) => {
37
39
  const {
38
40
  timespan,
39
41
  onClick
40
- } = useValue([props$1.value, props$1.onClick]);
42
+ } = useValue({
43
+ onClick: _onClick,
44
+ value
45
+ });
41
46
  const {
42
47
  focusedAt,
43
48
  toPrevYear,
44
49
  toPrevMonth,
45
50
  toNextYear,
46
51
  toNextMonth
47
- } = useFocusedAt([props$1.focusedAt]);
52
+ } = useFocusedAt({
53
+ focusedAt: _focusedAt
54
+ });
48
55
  const dateCells = useDateCells([timespan, focusedAt, onClick]);
49
56
  const headCells = useHeadCells();
50
57
  const classNames = useClassNames(ComponentToken.Calendar);
@@ -16,7 +16,10 @@ export declare const useDateCells: ([timespan, focusedAt, click]: [Timespan, Day
16
16
  * @description
17
17
  * time span
18
18
  */
19
- export declare const useValue: ([value, _click]: [CalendarProps["value"], CalendarProps["onClick"]]) => {
19
+ export declare const useValue: ({ onClick: _click, value, }: {
20
+ value: CalendarProps["value"];
21
+ onClick: CalendarProps["onClick"];
22
+ }) => {
20
23
  timespan: Timespan;
21
24
  onClick: (_value: Dayjs) => void;
22
25
  };
@@ -24,7 +27,9 @@ export declare const useValue: ([value, _click]: [CalendarProps["value"], Calend
24
27
  * @description
25
28
  * point at
26
29
  */
27
- export declare const useFocusedAt: ([_focusedAt]: [CalendarProps["focusedAt"]]) => {
30
+ export declare const useFocusedAt: ({ focusedAt: _focusedAt }: {
31
+ focusedAt: CalendarProps["focusedAt"];
32
+ }) => {
28
33
  focusedAt: dayjs.Dayjs;
29
34
  toNextYear: () => void;
30
35
  toPrevYear: () => void;
@@ -2,7 +2,7 @@ import dayjs from 'dayjs';
2
2
  import React, { useMemo, useCallback } from 'react';
3
3
  import { useClassNames } from '../../hooks/use-class-names.js';
4
4
  import { ComponentToken, CalendarClassToken } from '../../utils/class-name.js';
5
- import { isArray, useControlledState } from '@aiszlab/relax';
5
+ import { toArray, useControlledState } from '@aiszlab/relax';
6
6
  import { Timespan } from '../../utils/timespan.js';
7
7
  import clsx from 'clsx';
8
8
  import { props } from '../../node_modules/@stylexjs/stylex/lib/es/stylex.js';
@@ -41,21 +41,21 @@ const styles = {
41
41
  $$css: true
42
42
  },
43
43
  range: {
44
- "::before_insetInlineStart": "musae-1682cnc",
44
+ "::before_insetInlineStart": "musae-1kfboi8",
45
45
  "::before_left": null,
46
46
  "::before_right": null,
47
- "::before_insetInlineEnd": "musae-typ5od",
47
+ "::before_insetInlineEnd": "musae-1x8jx26",
48
48
  $$css: true
49
49
  },
50
50
  from: {
51
51
  "::before_insetInlineStart": "musae-fbisj7",
52
52
  "::before_left": null,
53
53
  "::before_right": null,
54
- "::before_insetInlineEnd": "musae-typ5od",
54
+ "::before_insetInlineEnd": "musae-1x8jx26",
55
55
  $$css: true
56
56
  },
57
57
  to: {
58
- "::before_insetInlineStart": "musae-1682cnc",
58
+ "::before_insetInlineStart": "musae-1kfboi8",
59
59
  "::before_left": null,
60
60
  "::before_right": null,
61
61
  "::before_insetInlineEnd": "musae-1gkks1t",
@@ -147,14 +147,17 @@ const useDateCells = ([timespan, focusedAt, click]) => {
147
147
  * @description
148
148
  * time span
149
149
  */
150
- const useValue = ([value, _click]) => {
150
+ const useValue = ({
151
+ onClick: _click,
152
+ value
153
+ }) => {
151
154
  /// change handler
152
155
  const onClick = useCallback(_value => {
153
156
  _click?.(_value);
154
157
  }, [_click]);
155
158
  /// time span
156
159
  const timespan = useMemo(() => {
157
- const [from, to] = isArray(value) ? value : [value, void 0];
160
+ const [from, to] = toArray(value);
158
161
  return new Timespan({
159
162
  from,
160
163
  to
@@ -169,7 +172,9 @@ const useValue = ([value, _click]) => {
169
172
  * @description
170
173
  * point at
171
174
  */
172
- const useFocusedAt = ([_focusedAt]) => {
175
+ const useFocusedAt = ({
176
+ focusedAt: _focusedAt
177
+ }) => {
173
178
  const [focusedAt, setFocusedAt] = useControlledState(_focusedAt, {
174
179
  defaultState: dayjs()
175
180
  });
@@ -19,8 +19,8 @@ const styles = {
19
19
  },
20
20
  overlay: props => [{
21
21
  position: "musae-10l6tqk",
22
- top: "musae-13vifvy",
23
- left: "musae-u96u03",
22
+ top: "musae-9oc6z4",
23
+ left: "musae-1tjciyl",
24
24
  insetInlineStart: null,
25
25
  insetInlineEnd: null,
26
26
  width: "musae-n9wirt",
@@ -137,7 +137,7 @@ const Popup = ({
137
137
  }, [open]);
138
138
  const styled = {
139
139
  popup: {
140
- className: "musae-ixxii4 musae-13vifvy musae-u96u03 musae-n9wirt musae-1dr59a3 musae-47corl musae-1tv1kli musae-78zum5 musae-l56j7k musae-6s0dn4"
140
+ className: "musae-ixxii4 musae-9oc6z4 musae-1tjciyl musae-n9wirt musae-1dr59a3 musae-47corl musae-1tv1kli musae-78zum5 musae-l56j7k musae-6s0dn4"
141
141
  },
142
142
  overlay: props(styles.overlay({
143
143
  backgroundColor: theme.colors[ColorToken.SurfaceDim]
@@ -14,7 +14,7 @@ import { contains } from '../../node_modules/@aiszlab/relax/dist/dom/contains.js
14
14
  const styles = {
15
15
  popup: {
16
16
  position: "musae-ixxii4",
17
- inset: "musae-10a8y8t",
17
+ inset: "musae-ezip7x",
18
18
  insetInline: null,
19
19
  insetInlineStart: null,
20
20
  insetInlineEnd: null,
@@ -29,7 +29,7 @@ const styles = {
29
29
  },
30
30
  overlay: props => [{
31
31
  position: "musae-10l6tqk",
32
- inset: "musae-10a8y8t",
32
+ inset: "musae-ezip7x",
33
33
  insetInline: null,
34
34
  insetInlineStart: null,
35
35
  insetInlineEnd: null,
@@ -61,44 +61,44 @@ const styles = {
61
61
  "--transform": props.transform != null ? props.transform : "initial"
62
62
  }],
63
63
  right: props => [{
64
- right: "musae-3m8u43",
64
+ right: "musae-15gpytn",
65
65
  insetInlineStart: null,
66
66
  insetInlineEnd: null,
67
- top: "musae-13vifvy",
68
- bottom: "musae-1ey2m1c",
67
+ top: "musae-9oc6z4",
68
+ bottom: "musae-1sh2tzk",
69
69
  width: "musae-17fnjtu",
70
70
  $$css: true
71
71
  }, {
72
72
  "--width": (val => typeof val === "number" ? val + "px" : val != null ? val : "initial")(props.size)
73
73
  }],
74
74
  left: props => [{
75
- left: "musae-u96u03",
75
+ left: "musae-1tjciyl",
76
76
  insetInlineStart: null,
77
77
  insetInlineEnd: null,
78
- top: "musae-13vifvy",
79
- bottom: "musae-1ey2m1c",
78
+ top: "musae-9oc6z4",
79
+ bottom: "musae-1sh2tzk",
80
80
  width: "musae-17fnjtu",
81
81
  $$css: true
82
82
  }, {
83
83
  "--width": (val => typeof val === "number" ? val + "px" : val != null ? val : "initial")(props.size)
84
84
  }],
85
85
  bottom: props => [{
86
- bottom: "musae-1ey2m1c",
87
- left: "musae-u96u03",
86
+ bottom: "musae-1sh2tzk",
87
+ left: "musae-1tjciyl",
88
88
  insetInlineStart: null,
89
89
  insetInlineEnd: null,
90
- right: "musae-3m8u43",
90
+ right: "musae-15gpytn",
91
91
  height: "musae-1jwls1v",
92
92
  $$css: true
93
93
  }, {
94
94
  "--height": (val => typeof val === "number" ? val + "px" : val != null ? val : "initial")(props.size)
95
95
  }],
96
96
  top: props => [{
97
- top: "musae-13vifvy",
98
- left: "musae-u96u03",
97
+ top: "musae-9oc6z4",
98
+ left: "musae-1tjciyl",
99
99
  insetInlineStart: null,
100
100
  insetInlineEnd: null,
101
- right: "musae-3m8u43",
101
+ right: "musae-15gpytn",
102
102
  height: "musae-1jwls1v",
103
103
  $$css: true
104
104
  }, {
@@ -187,7 +187,7 @@ const Popup = ({
187
187
  }, [open]);
188
188
  const styled = {
189
189
  popup: {
190
- className: "musae-ixxii4 musae-10a8y8t musae-47corl musae-mn8nw1"
190
+ className: "musae-ixxii4 musae-ezip7x musae-47corl musae-mn8nw1"
191
191
  },
192
192
  overlay: props(styles.overlay({
193
193
  backgroundColor: theme.colors[ColorToken.SurfaceDim]
@@ -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-u96u03",
16
+ left: "musae-1tjciyl",
17
17
  insetInlineStart: null,
18
18
  insetInlineEnd: null,
19
- right: "musae-3m8u43",
19
+ right: "musae-15gpytn",
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-u96u03 musae-3m8u43 musae-wa60dl musae-gj1dgu musae-78zum5 musae-1q0g3np musae-1qughib musae-6s0dn4"
77
+ className: "musae-ixxii4 musae-1tjciyl musae-15gpytn 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]
@@ -14,7 +14,7 @@ const styles = {
14
14
  paddingRight: null,
15
15
  marginBottom: "musae-hq7bbv",
16
16
  position: "musae-7wzq59",
17
- top: "musae-13vifvy",
17
+ top: "musae-9oc6z4",
18
18
  zIndex: "musae-1ac462h",
19
19
  display: "musae-78zum5",
20
20
  alignItems: "musae-6s0dn4",
@@ -17,13 +17,10 @@ const styles = {
17
17
  display: "musae-78zum5",
18
18
  alignItems: "musae-6s0dn4",
19
19
  cursor: "musae-1ypdohk",
20
- transition: "musae-2zkx75",
21
- transitionBehavior: null,
22
- transitionDelay: null,
23
- transitionDuration: null,
24
- transitionProperty: null,
25
- transitionTimingFunction: null,
20
+ userSelect: "musae-87ps6o",
26
21
  willChange: "musae-1aaibe2",
22
+ transitionProperty: "musae-xy01e9",
23
+ transitionDuration: "musae-1g2r6go",
27
24
  $$css: true
28
25
  }
29
26
  },
@@ -265,8 +262,8 @@ const Item = forwardRef(({
265
262
  ...styled.menuItem
266
263
  }, React.createElement("div", {
267
264
  ref: itemRef,
268
- style: styled.item.style,
269
265
  className: clsx(classNames[MenuClassToken.Item], className, styled.item.className),
266
+ style: styled.item.style,
270
267
  onClick: click,
271
268
  ...hoverProps
272
269
  }, _children.prefix, _children.label, _children.suffix), isInline && props$1.children, !isInline && !!props$1.children && React.createElement(Popper, {
@@ -25,8 +25,8 @@ const styles = {
25
25
  $$css: true
26
26
  },
27
27
  top: {
28
- top: "musae-13vifvy",
29
- insetInline: "musae-17y0mx6",
28
+ top: "musae-9oc6z4",
29
+ insetInline: "musae-l33w4x",
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-13vifvy",
39
- insetInlineEnd: "musae-tijo5x",
38
+ top: "musae-9oc6z4",
39
+ insetInlineEnd: "musae-hw0b42",
40
40
  left: null,
41
41
  right: null,
42
42
  $$css: true
43
43
  },
44
44
  topLeft: {
45
- top: "musae-13vifvy",
46
- insetInlineStart: "musae-1o0tod",
45
+ top: "musae-9oc6z4",
46
+ insetInlineStart: "musae-1at4hj2",
47
47
  left: null,
48
48
  right: null,
49
49
  $$css: true
50
50
  },
51
51
  bottom: {
52
- bottom: "musae-1ey2m1c",
53
- insetInline: "musae-17y0mx6",
52
+ bottom: "musae-1sh2tzk",
53
+ insetInline: "musae-l33w4x",
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-1ey2m1c",
63
- insetInlineStart: "musae-1o0tod",
62
+ bottom: "musae-1sh2tzk",
63
+ insetInlineStart: "musae-1at4hj2",
64
64
  left: null,
65
65
  right: null,
66
66
  $$css: true
67
67
  },
68
68
  bottomRight: {
69
- bottom: "musae-1ey2m1c",
70
- insetInlineEnd: "musae-tijo5x",
69
+ bottom: "musae-1sh2tzk",
70
+ insetInlineEnd: "musae-hw0b42",
71
71
  left: null,
72
72
  right: null,
73
73
  $$css: true
@@ -52,7 +52,7 @@ const styles = {
52
52
  transitionDuration: "musae-13dflua",
53
53
  transform: "musae-1v0jg1i",
54
54
  opacity: "musae-g01cxk",
55
- marginTop: "musae-dj266r",
55
+ marginTop: "musae-1q12cbh",
56
56
  display: "musae-rvj5dj",
57
57
  gap: "musae-vbka3v",
58
58
  rowGap: null,
@@ -1,4 +1,4 @@
1
1
  import React from "react";
2
2
  import type { ChildProps, PopoverProps } from "./types";
3
- declare const Popover: <P extends ChildProps<T>, T extends HTMLElement>({ triggerBy: _triggerBy, title, description, ...props }: PopoverProps<P, T>) => React.JSX.Element;
3
+ declare const Popover: <P extends ChildProps<T>, T extends HTMLElement>({ triggerBy: _triggerBy, title, description, placement, className, style, children: _children, }: PopoverProps<P, T>) => React.JSX.Element;
4
4
  export default Popover;
@@ -23,7 +23,10 @@ const Popover = ({
23
23
  triggerBy: _triggerBy = "hover",
24
24
  title,
25
25
  description,
26
- ...props
26
+ placement = "bottom",
27
+ className,
28
+ style,
29
+ children: _children
27
30
  }) => {
28
31
  const _ref = useRef(null);
29
32
  const [_isOpen, {
@@ -32,7 +35,7 @@ const Popover = ({
32
35
  }] = useBoolean(false);
33
36
  const triggerBy = useMemo(() => new Set(toArray(_triggerBy)), [_triggerBy]);
34
37
  const classNames = useClassNames(ComponentToken.Popover);
35
- const childRef = useRefs(_ref, props.children.props.ref);
38
+ const childRef = useRefs(_ref, _children.props.ref);
36
39
  const click = useEvent(e => {
37
40
  toggle();
38
41
  e.stopPropagation();
@@ -41,12 +44,12 @@ const Popover = ({
41
44
  turnOn();
42
45
  });
43
46
  const [isHovered, hoverProps] = useHover({
44
- onEnter: () => chain(props.children.props.onMouseOver, props.children.props.onMouseEnter, props.children.props.onPointerEnter),
45
- onLeave: () => chain(props.children.props.onMouseLeave, props.children.props.onPointerLeave)
47
+ onEnter: () => chain(_children.props.onMouseOver, _children.props.onMouseEnter, _children.props.onPointerEnter),
48
+ onLeave: () => chain(_children.props.onMouseLeave, _children.props.onPointerLeave)
46
49
  });
47
50
  const [isFocused, focusProps] = useFocus({
48
- onFocus: props.children.props.onFocus,
49
- onBlur: props.children.props.onBlur
51
+ onFocus: _children.props.onFocus,
52
+ onBlur: _children.props.onBlur
50
53
  });
51
54
  const isOpen = useMemo(() => {
52
55
  // allow hover
@@ -57,7 +60,7 @@ const Popover = ({
57
60
  return _isOpen;
58
61
  }, [triggerBy, isHovered, _isOpen, isFocused]);
59
62
  // @ts-ignore
60
- const children = cloneElement(props.children, {
63
+ const children = cloneElement(_children, {
61
64
  ref: childRef,
62
65
  ...hoverProps,
63
66
  ...focusProps,
@@ -81,10 +84,14 @@ const Popover = ({
81
84
  ...(triggerBy.has("hover") && {
82
85
  onPointerEnter: enterPopper,
83
86
  onPointerLeave: leavePopper
84
- })
87
+ }),
88
+ placement: placement
85
89
  }, React.createElement("div", {
86
- className: clsx(classNames[PopoverClassToken.Popover], styled.popover.className),
87
- style: styled.popover.style
90
+ className: clsx(classNames[PopoverClassToken.Popover], className, styled.popover.className),
91
+ style: {
92
+ ...styled.popover.style,
93
+ ...style
94
+ }
88
95
  }, !!title && React.createElement(React.Fragment, null, React.createElement("div", {
89
96
  className: clsx(classNames[PopoverClassToken.Title], styled.title.className),
90
97
  style: styled.title.style
@@ -1,6 +1,7 @@
1
1
  import type { DOMAttributes, ReactElement, ReactNode, RefAttributes } from "react";
2
2
  import type { ComponentProps } from "../../types/element";
3
- export type ChildProps<T> = Pick<DOMAttributes<T>, "onPointerEnter" | "onMouseEnter" | "onMouseOver" | "onMouseLeave" | "onPointerLeave" | "onClick" | "onContextMenu" | "onFocus" | "onBlur"> & RefAttributes<T>;
3
+ import type { Placement } from "@floating-ui/dom";
4
+ export type ChildProps<T> = Pick<DOMAttributes<T>, "onMouseEnter" | "onMouseOver" | "onMouseLeave" | "onPointerEnter" | "onPointerLeave" | "onClick" | "onContextMenu" | "onFocus" | "onBlur"> & RefAttributes<T>;
4
5
  type TriggerBy = "hover" | "focus" | "click" | "contextMenu";
5
6
  /**
6
7
  * @description
@@ -10,22 +11,32 @@ export type PopoverProps<P extends ChildProps<T>, T extends HTMLElement> = Compo
10
11
  /**
11
12
  * @description
12
13
  * a trigger element.
14
+ * @requires
13
15
  */
14
16
  children: ReactElement<P>;
15
17
  /**
16
18
  * @description
17
19
  * title
20
+ * @default void 0
18
21
  */
19
22
  title?: ReactNode;
20
23
  /**
21
24
  * @description
22
25
  * description
26
+ * @requires
23
27
  */
24
28
  description: ReactNode;
25
29
  /**
26
30
  * @description
27
31
  * trigger by
32
+ * @default "hover"
28
33
  */
29
34
  triggerBy?: TriggerBy | TriggerBy[];
35
+ /**
36
+ * @description
37
+ * popover placement
38
+ * @default "bottom"
39
+ */
40
+ placement?: Placement;
30
41
  };
31
42
  export {};
@@ -3,7 +3,7 @@ import { ComponentToken, PopperClassToken } from '../../utils/class-name.js';
3
3
  import { useClassNames } from '../../hooks/use-class-names.js';
4
4
  import { props } from '../../node_modules/@stylexjs/stylex/lib/es/stylex.js';
5
5
  import clsx from 'clsx';
6
- import { isFunction, isVoid } from '@aiszlab/relax';
6
+ import { isFunction } from '@aiszlab/relax';
7
7
  import { autoUpdate, computePosition, flip, offset, arrow } from '@floating-ui/dom';
8
8
  import { useOffsets } from './hooks.js';
9
9
  import { useTheme } from '../theme/hooks.js';
@@ -16,8 +16,8 @@ const styles = {
16
16
  zIndex: "musae-1axsr4t",
17
17
  position: "musae-10l6tqk",
18
18
  backgroundColor: "musae-q1mx2j",
19
- top: "musae-13vifvy",
20
- insetInlineStart: "musae-1o0tod",
19
+ top: "musae-9oc6z4",
20
+ insetInlineStart: "musae-1at4hj2",
21
21
  left: null,
22
22
  right: null,
23
23
  boxShadow: "musae-ezd0au",
@@ -47,7 +47,6 @@ const styles = {
47
47
  width: "musae-103s5vv",
48
48
  height: "musae-jazk0b",
49
49
  backgroundColor: "musae-q1mx2j",
50
- top: "musae-1vwp36r",
51
50
  transform: "musae-1158fpu",
52
51
  $$css: true
53
52
  }, {
@@ -58,7 +57,7 @@ const styles = {
58
57
  const Dropdown = ({
59
58
  open,
60
59
  children,
61
- placement = "bottom-start",
60
+ placement,
62
61
  style,
63
62
  className,
64
63
  onExit,
@@ -99,14 +98,19 @@ const Dropdown = ({
99
98
  }).then(({
100
99
  x,
101
100
  y,
102
- middlewareData
101
+ middlewareData,
102
+ placement: _placement
103
103
  }) => {
104
+ const [side] = _placement.split("-");
104
105
  // set float element styles
105
106
  floatable.current.style.translate = `${x}px ${y}px`;
106
107
  // set arrwo styles
107
108
  if (middlewareData.arrow && !!arrowRef.current) {
108
- arrowRef.current.style.insetInlineStart = isVoid(middlewareData.arrow.x) ? "" : `${middlewareData.arrow.x}px`;
109
- arrowRef.current.style.insetBlockStart = `${middlewareData.arrow.y ?? 0 - 8}px`;
109
+ const offsetY = `${middlewareData.arrow.y ?? 0 - 8}px`;
110
+ const offsetX = `${middlewareData.arrow.x ?? 0}px`;
111
+ arrowRef.current.style.insetInlineStart = offsetX;
112
+ side === "top" && (arrowRef.current.style.insetBlockEnd = offsetY);
113
+ side === "bottom" && (arrowRef.current.style.insetBlockStart = offsetY);
110
114
  }
111
115
  }).catch(() => null);
112
116
  });
@@ -127,8 +131,6 @@ const Dropdown = ({
127
131
  (async () => {
128
132
  if (open) {
129
133
  floatable.current.style.display = "";
130
- floatable.current.style.opacity = "0";
131
- floatable.current.style.opacity = "scale(0, 0)";
132
134
  await animate(floatable.current, {
133
135
  opacity: 1,
134
136
  transform: "scale(1, 1)"
@@ -147,8 +149,6 @@ const Dropdown = ({
147
149
  duration: 0.2
148
150
  }).then(() => {
149
151
  floatable.current.style.display = "none";
150
- floatable.current.style.opacity = "";
151
- floatable.current.style.transform = "";
152
152
  })]);
153
153
  onExited?.();
154
154
  })();
@@ -1,4 +1,4 @@
1
1
  import React from "react";
2
2
  import type { PopperProps } from "./types";
3
- declare const Popper: ({ destroyable, ...props }: PopperProps) => React.JSX.Element;
3
+ declare const Popper: ({ destroyable, placement, ...props }: PopperProps) => React.JSX.Element;
4
4
  export default Popper;
@@ -2,9 +2,9 @@ import React from 'react';
2
2
  import Portal from '../portal/portal.js';
3
3
  import Dropdown from './dropdown.js';
4
4
 
5
- const Popper = ({ destroyable, ...props }) => {
5
+ const Popper = ({ destroyable, placement = "bottom-start", ...props }) => {
6
6
  return (React.createElement(Portal, { open: props.open, lockable: false, destroyable: destroyable },
7
- React.createElement(Dropdown, { ...props })));
7
+ React.createElement(Dropdown, { ...props, placement: placement })));
8
8
  };
9
9
 
10
10
  export { Popper as default };
@@ -61,4 +61,9 @@ export interface PopperProps extends Pick<DOMAttributes<HTMLDivElement>, "onMous
61
61
  */
62
62
  arrow?: boolean;
63
63
  }
64
- export type DropdownProps = Omit<PopperProps, "portal">;
64
+ export type DropdownProps = Omit<PopperProps, "portal" | "placement"> & {
65
+ /**
66
+ * {@link} `PopperProps`.`placement`
67
+ */
68
+ placement: Placement;
69
+ };
@@ -1,4 +1,4 @@
1
1
  import React from "react";
2
- import { RadioProps } from "./types";
2
+ import type { RadioProps } from "./types";
3
3
  declare const Radio: ({ children, value, checked, disabled, ...props }: RadioProps) => React.JSX.Element;
4
4
  export default Radio;
@@ -22,7 +22,7 @@ const styles = {
22
22
  $$css: true
23
23
  }
24
24
  },
25
- toggler: {
25
+ trigger: {
26
26
  default: props => [{
27
27
  visibility: "musae-lshs6z",
28
28
  height: "musae-jazk0b",
@@ -73,12 +73,9 @@ const styles = {
73
73
  "::after_borderTopRightRadius": null,
74
74
  "::after_borderBottomLeftRadius": null,
75
75
  "::after_borderBottomRightRadius": null,
76
- "::after_transition": "musae-w0vqy",
77
- "::after_transitionBehavior": null,
78
- "::after_transitionDelay": null,
79
- "::after_transitionDuration": null,
80
- "::after_transitionProperty": null,
81
- "::after_transitionTimingFunction": null,
76
+ "::after_willChange": "musae-yttlx6",
77
+ "::after_transitionProperty": "musae-6orayw",
78
+ "::after_transitionDuration": "musae-t0fc71",
82
79
  $$css: true
83
80
  }, {
84
81
  "--joftei": props.borderColor != null ? props.borderColor : "initial"
@@ -107,6 +104,15 @@ const styles = {
107
104
  "--joftei": props.borderColor != null ? props.borderColor : "initial"
108
105
  }],
109
106
  disabled: props => [{
107
+ borderColor: "musae-eqt46j",
108
+ borderInlineColor: null,
109
+ borderInlineStartColor: null,
110
+ borderLeftColor: null,
111
+ borderInlineEndColor: null,
112
+ borderRightColor: null,
113
+ borderBlockColor: null,
114
+ borderTopColor: null,
115
+ borderBottomColor: null,
110
116
  "::before_content": "musae-1cpjm7i",
111
117
  "::before_position": "musae-1hmns74",
112
118
  "::before_visibility": "musae-11srvyv",
@@ -124,8 +130,13 @@ const styles = {
124
130
  "::before_borderBottomRightRadius": null,
125
131
  $$css: true
126
132
  }, {
133
+ "--borderColor": props.backgroundColor != null ? props.backgroundColor : "initial",
127
134
  "--1lrm08k": props.backgroundColor != null ? props.backgroundColor : "initial"
128
- }]
135
+ }],
136
+ unckecked: {
137
+ "::before": null,
138
+ $$css: true
139
+ }
129
140
  },
130
141
  label: {
131
142
  default: {
@@ -176,13 +187,13 @@ const Radio = ({
176
187
  }, [isChecked, contextValue, value, isDisabled]);
177
188
  const styled = {
178
189
  radio: props(styles.radio.default, isDisabled && styles.radio.disabled),
179
- trigger: props(styles.toggler.default({
190
+ trigger: props(styles.trigger.default({
180
191
  borderColor: theme.colors[ColorToken.Outline]
181
- }), isChecked && (isDisabled ? styles.toggler.disabled({
182
- backgroundColor: theme.colors[ColorToken.InversePrimary]
183
- }) : styles.toggler.default({
192
+ }), isChecked && styles.trigger.checked({
184
193
  borderColor: theme.colors[ColorToken.Primary]
185
- }))),
194
+ }), isDisabled && styles.trigger.disabled({
195
+ backgroundColor: theme.colors[ColorToken.InversePrimary]
196
+ }), !isChecked && styles.trigger.unckecked),
186
197
  label: props(typography.body.medium, styles.label.default)
187
198
  };
188
199
  return React.createElement("label", {
@@ -36,10 +36,10 @@ const styles = {
36
36
  position: "musae-10l6tqk",
37
37
  width: "musae-1gn8jaj",
38
38
  height: "musae-b27hse",
39
- insetInlineStart: "musae-1o0tod",
39
+ insetInlineStart: "musae-1at4hj2",
40
40
  left: null,
41
41
  right: null,
42
- top: "musae-13vifvy",
42
+ top: "musae-9oc6z4",
43
43
  opacity: "musae-g01cxk",
44
44
  userSelect: "musae-87ps6o",
45
45
  overflow: "musae-b3r6kr",
@@ -1,4 +1,4 @@
1
1
  import React from "react";
2
2
  import type { SpaceProps } from "./types";
3
- declare const Space: ({ gutter, children, className, style }: SpaceProps) => React.JSX.Element;
3
+ declare const Space: ({ gutter, children, className, style, type }: SpaceProps) => React.JSX.Element;
4
4
  export default Space;
@@ -6,21 +6,30 @@ import clsx from 'clsx';
6
6
  const styles = {
7
7
  space: props => [{
8
8
  display: "musae-78zum5",
9
- flexDirection: "musae-1q0g3np",
10
9
  columnGap: "musae-4rvf3u",
11
10
  rowGap: "musae-m8a6f2",
12
- alignItems: "musae-6s0dn4",
13
11
  $$css: true
14
12
  }, {
15
13
  "--columnGap": (val => typeof val === "number" ? val + "px" : val != null ? val : "initial")(props.columnGap),
16
14
  "--rowGap": (val => typeof val === "number" ? val + "px" : val != null ? val : "initial")(props.rowGap)
17
- }]
15
+ }],
16
+ horizontal: {
17
+ flexDirection: "musae-1q0g3np",
18
+ alignItems: "musae-6s0dn4",
19
+ $$css: true
20
+ },
21
+ vertical: {
22
+ flexDirection: "musae-dt5ytf",
23
+ justifyContent: "musae-l56j7k",
24
+ $$css: true
25
+ }
18
26
  };
19
27
  const Space = ({
20
28
  gutter = 4,
21
29
  children,
22
30
  className,
23
- style
31
+ style,
32
+ type = "horizontal"
24
33
  }) => {
25
34
  const [columnGap, rowGap] = useGutters({
26
35
  gutter
@@ -28,7 +37,7 @@ const Space = ({
28
37
  const styled = props(styles.space({
29
38
  columnGap,
30
39
  rowGap
31
- }));
40
+ }), styles[type]);
32
41
  return React.createElement("div", {
33
42
  className: clsx(className, styled.className),
34
43
  style: {
@@ -1,6 +1,7 @@
1
1
  import type { ReactNode } from "react";
2
- import { Gutter } from "../../hooks/use-gutters";
3
- import { ComponentProps } from "../../types/element";
2
+ import type { Gutter } from "../../hooks/use-gutters";
3
+ import type { ComponentProps } from "../../types/element";
4
+ type Type = "horizontal" | "vertical";
4
5
  /**
5
6
  * @description
6
7
  * space props
@@ -18,4 +19,11 @@ export type SpaceProps = ComponentProps & {
18
19
  * @default 4
19
20
  */
20
21
  gutter?: Gutter;
22
+ /**
23
+ * @description
24
+ * direction
25
+ * @default "horizontal"
26
+ */
27
+ type?: Type;
21
28
  };
29
+ export {};
@@ -192,20 +192,20 @@ const styles = {
192
192
  $$css: true
193
193
  },
194
194
  checked: {
195
- marginInlineStart: "musae-1lziwak",
195
+ marginInlineStart: "musae-1tt3wx9",
196
196
  marginLeft: null,
197
197
  marginRight: null,
198
- marginInlineEnd: "musae-14z9mp",
198
+ marginInlineEnd: "musae-fbia9g",
199
199
  $$css: true
200
200
  }
201
201
  },
202
202
  trailing: {
203
203
  default: {
204
204
  marginTop: "musae-ncydc0",
205
- marginInlineEnd: "musae-14z9mp",
205
+ marginInlineEnd: "musae-fbia9g",
206
206
  marginLeft: null,
207
207
  marginRight: null,
208
- marginInlineStart: "musae-1lziwak",
208
+ marginInlineStart: "musae-1tt3wx9",
209
209
  $$css: true
210
210
  },
211
211
  checked: {
@@ -24,7 +24,7 @@ const styles = {
24
24
  ":not(:last-of-type)::after_height": "musae-1su0kt9",
25
25
  ":not(:last-of-type)::after_backgroundColor": "musae-9cqmhv",
26
26
  ":not(:last-of-type)::after_transform": "musae-1kmnipp",
27
- ":not(:last-of-type)::after_insetInlineEnd": "musae-192i3sz",
27
+ ":not(:last-of-type)::after_insetInlineEnd": "musae-1sd0t5p",
28
28
  ":not(:last-of-type)::after_left": null,
29
29
  ":not(:last-of-type)::after_right": null,
30
30
  $$css: true
@@ -17,7 +17,7 @@ import { useGutters } from '../../hooks/use-gutters.js';
17
17
  const styles = {
18
18
  overlay: props => [{
19
19
  position: "musae-10l6tqk",
20
- inset: "musae-10a8y8t",
20
+ inset: "musae-ezip7x",
21
21
  insetInline: null,
22
22
  insetInlineStart: null,
23
23
  insetInlineEnd: null,
@@ -0,0 +1,11 @@
1
+ import { HTMLAttributeReferrerPolicy } from "react";
2
+ /**
3
+ * @description
4
+ * prefetch image
5
+ * if image load failed, get fail status
6
+ */
7
+ export declare const useImage: ({ src, crossOrigin, referrerPolicy, }: {
8
+ src?: string;
9
+ crossOrigin?: string;
10
+ referrerPolicy?: HTMLAttributeReferrerPolicy;
11
+ }) => false | "error" | "loaded";
@@ -0,0 +1,34 @@
1
+ import { useState, useEffect } from 'react';
2
+
3
+ /**
4
+ * @description
5
+ * prefetch image
6
+ * if image load failed, get fail status
7
+ */
8
+ const useImage = ({ src, crossOrigin, referrerPolicy = "no-referrer", }) => {
9
+ const [isLoaded, setIsLoaded] = useState(false);
10
+ useEffect(() => {
11
+ if (!src) {
12
+ return;
13
+ }
14
+ setIsLoaded(false);
15
+ const image = new Image();
16
+ image.onload = () => {
17
+ setIsLoaded("loaded");
18
+ };
19
+ image.onerror = () => {
20
+ setIsLoaded("error");
21
+ };
22
+ image.crossOrigin = crossOrigin ?? null;
23
+ image.referrerPolicy = referrerPolicy;
24
+ image.src = src;
25
+ return () => {
26
+ image.onload = null;
27
+ image.onerror = null;
28
+ image.remove();
29
+ };
30
+ }, [src, crossOrigin, referrerPolicy]);
31
+ return isLoaded;
32
+ };
33
+
34
+ export { useImage };
package/dist/stylex.css CHANGED
@@ -25,7 +25,7 @@
25
25
  .musae-1pk7hnv:not(#\#){grid:'leading description'}
26
26
  .musae-1js343y:not(#\#){grid:'leading title closer' 'leading description description'}
27
27
  .musae-1l2suiq:not(#\#){grid:'leading title' '. description'}
28
- .musae-10a8y8t:not(#\#){inset:0}
28
+ .musae-ezip7x:not(#\#){inset:0px}
29
29
  .musae-1ug7cio:not(#\#){margin:var(--musae-15cw4i4)}
30
30
  .musae-ieb5ut:not(#\#){margin:var(--musae-1wblvyz)}
31
31
  .musae-1eddoca:not(#\#){margin:var(--musae-68a8pz)}
@@ -60,7 +60,7 @@
60
60
  .musae-1vkuzbb:not(#\#):not(#\#){gap:var(--musae-oohzsl)}
61
61
  .musae-29tp26:not(#\#):not(#\#){gap:var(--musae-qk2ac7)}
62
62
  .musae-vbka3v:not(#\#):not(#\#){gap:var(--musae-vk5id6)}
63
- .musae-17y0mx6:not(#\#):not(#\#){inset-inline:0}
63
+ .musae-l33w4x:not(#\#):not(#\#){inset-inline:0px}
64
64
  .musae-e8uvvx:not(#\#):not(#\#){list-style:none}
65
65
  .musae-nweklb:not(#\#):not(#\#){margin-block:var(--musae-15cw4i4)}
66
66
  .musae-dbe9a9:not(#\#):not(#\#){margin-block:var(--musae-qk2ac7)}
@@ -83,7 +83,6 @@
83
83
  .musae-1xkwav8:not(#\#):not(#\#){padding-inline:var(--musae-oohzsl)}
84
84
  .musae-381k9q:not(#\#):not(#\#){padding-inline:var(--musae-qk2ac7)}
85
85
  .musae-iujutg:not(#\#):not(#\#){padding-inline:var(--musae-vk5id6)}
86
- .musae-2zkx75:not(#\#):not(#\#){transition:all .1s}
87
86
  .musae-1ng1d19:not(#\#):not(#\#){transition:all .2s}
88
87
  .musae-nz68lp:not(#\#):not(#\#){transition:box-shadow .2s}
89
88
  .musae-1trvaba:not(#\#):not(#\#){transition:transform .2s}
@@ -151,8 +150,8 @@
151
150
  .musae-4qzwkw:not(#\#):not(#\#):not(#\#){grid-column-end:var(--gridColumnEnd,revert)}
152
151
  .musae-8a1x49:not(#\#):not(#\#):not(#\#){grid-column-start:auto}
153
152
  .musae-1aeqsfb:not(#\#):not(#\#):not(#\#){grid-template-columns:repeat(24,minmax(0,1fr))}
154
- .musae-tijo5x:not(#\#):not(#\#):not(#\#){inset-inline-end:0}
155
- .musae-1o0tod:not(#\#):not(#\#):not(#\#){inset-inline-start:0}
153
+ .musae-hw0b42:not(#\#):not(#\#):not(#\#){inset-inline-end:0px}
154
+ .musae-1at4hj2:not(#\#):not(#\#):not(#\#){inset-inline-start:0px}
156
155
  .musae-ncxdh4:not(#\#):not(#\#):not(#\#){inset-inline-start:calc(100% - var(--musae-rlgvtq) - var(--musae-1h5s2h0))}
157
156
  .musae-1auf0oo:not(#\#):not(#\#):not(#\#){inset-inline-start:var(--musae-1h5s2h0)}
158
157
  .musae-hf0782:not(#\#):not(#\#):not(#\#){inset-inline-start:var(--musae-h30iw9)}
@@ -178,10 +177,10 @@
178
177
  .musae-5agonf:not(#\#):not(#\#):not(#\#){line-height:52px}
179
178
  .musae-1kke7aa:not(#\#):not(#\#):not(#\#){line-height:64px}
180
179
  .musae-3ct3a4:not(#\#):not(#\#):not(#\#){list-style-type:none}
181
- .musae-14z9mp:not(#\#):not(#\#):not(#\#){margin-inline-end:0}
180
+ .musae-fbia9g:not(#\#):not(#\#):not(#\#){margin-inline-end:0px}
182
181
  .musae-10qwhln:not(#\#):not(#\#):not(#\#){margin-inline-end:calc(-100% - var(--musae-rlgvtq) - var(--musae-jdzqnm) * 4 - var(--musae-jdzqnm))}
183
182
  .musae-16ph6eo:not(#\#):not(#\#):not(#\#){margin-inline-end:calc(100% + var(--musae-rlgvtq) + var(--musae-jdzqnm) * 4 + var(--musae-jdzqnm))}
184
- .musae-1lziwak:not(#\#):not(#\#):not(#\#){margin-inline-start:0}
183
+ .musae-1tt3wx9:not(#\#):not(#\#):not(#\#){margin-inline-start:0px}
185
184
  .musae-1fns2s7:not(#\#):not(#\#):not(#\#){margin-inline-start:calc(-100% - var(--musae-rlgvtq) - var(--musae-jdzqnm) * 4 - var(--musae-jdzqnm))}
186
185
  .musae-5bta6d:not(#\#):not(#\#):not(#\#){margin-inline-start:calc(100% + var(--musae-rlgvtq) + var(--musae-jdzqnm) * 4 + var(--musae-jdzqnm))}
187
186
  .musae-1tmxnmp:not(#\#):not(#\#):not(#\#){margin-inline-start:var(--musae-68a8pz)}
@@ -221,9 +220,11 @@ html[dir='rtl'] .musae-1yc453h:not(#\#):not(#\#):not(#\#){text-align:right}
221
220
  .musae-9tu13d:not(#\#):not(#\#):not(#\#){transform:rotate(-90deg)}
222
221
  .musae-1158fpu:not(#\#):not(#\#):not(#\#){transform:rotate(45deg)}
223
222
  .musae-1v0jg1i:not(#\#):not(#\#):not(#\#){transform:var(--transform,revert)}
223
+ .musae-1g2r6go:not(#\#):not(#\#):not(#\#){transition-duration:.1s}
224
224
  .musae-13dflua:not(#\#):not(#\#):not(#\#){transition-duration:.2s}
225
225
  .musae-1d8287x:not(#\#):not(#\#):not(#\#){transition-duration:.3s}
226
226
  .musae-fagghw:not(#\#):not(#\#):not(#\#){transition-property:all}
227
+ .musae-xy01e9:not(#\#):not(#\#):not(#\#){transition-property:background-color,border,color}
227
228
  .musae-1ve1rmq:not(#\#):not(#\#):not(#\#){transition-property:margin-inline-start,margin-inline-end}
228
229
  .musae-1c9o64o:not(#\#):not(#\#):not(#\#){transition-property:margin-top,transform}
229
230
  .musae-bjh9w0:not(#\#):not(#\#):not(#\#){transition-property:padding-inline-start,padding-inline-end}
@@ -250,7 +251,7 @@ html[dir='rtl'] .musae-1yc453h:not(#\#):not(#\#):not(#\#){text-align:right}
250
251
  .musae-x7gz8e:not(:last-of-type):not(#\#):not(#\#):not(#\#)::after{content:""}
251
252
  .musae-13amitz:hover > span:last-child:not(#\#):not(#\#):not(#\#){display:inline-flex}
252
253
  .musae-1pqvcko:hover > span:first-child:not(#\#):not(#\#):not(#\#){display:none}
253
- .musae-192i3sz:not(:last-of-type):not(#\#):not(#\#):not(#\#)::after{inset-inline-end:0}
254
+ .musae-1sd0t5p:not(:last-of-type):not(#\#):not(#\#):not(#\#)::after{inset-inline-end:0px}
254
255
  .musae-1i5rff9:not(:first-child):not(#\#):not(#\#):not(#\#){margin-inline-start:calc(var(--musae-vk5id6) * -1)}
255
256
  .musae-no41pc:not(:last-of-type):not(#\#):not(#\#):not(#\#)::after{position:absolute}
256
257
  .musae-1kmnipp:not(:last-of-type):not(#\#):not(#\#):not(#\#)::after{transform:translateY(-50%)}
@@ -262,7 +263,7 @@ html[dir='rtl'] .musae-1yc453h:not(#\#):not(#\#):not(#\#){text-align:right}
262
263
  .musae-43481e:not(#\#):not(#\#):not(#\#):not(#\#){border-bottom-color:var(--borderBottomColor,revert)}
263
264
  .musae-1q0q8m5:not(#\#):not(#\#):not(#\#):not(#\#){border-bottom-style:solid}
264
265
  .musae-lntmim:not(#\#):not(#\#):not(#\#):not(#\#){border-bottom-width:var(--musae-1ax7z96)}
265
- .musae-1ey2m1c:not(#\#):not(#\#):not(#\#):not(#\#){bottom:0}
266
+ .musae-1sh2tzk:not(#\#):not(#\#):not(#\#):not(#\#){bottom:0px}
266
267
  .musae-1ii70tt:not(#\#):not(#\#):not(#\#):not(#\#){bottom:var(--musae-15cw4i4)}
267
268
  .musae-8wmlod:not(#\#):not(#\#):not(#\#):not(#\#){bottom:var(--musae-1wblvyz)}
268
269
  .musae-1dr59a3:not(#\#):not(#\#):not(#\#):not(#\#){height:100vh}
@@ -284,14 +285,14 @@ html[dir='rtl'] .musae-1yc453h:not(#\#):not(#\#):not(#\#){text-align:right}
284
285
  .musae-1gfonl1:not(#\#):not(#\#):not(#\#):not(#\#){height:var(--musae-oohzsl)}
285
286
  .musae-lry4nc:not(#\#):not(#\#):not(#\#):not(#\#){height:var(--musae-rlgvtq)}
286
287
  .musae-b4kbli:not(#\#):not(#\#):not(#\#):not(#\#){height:var(--musae-xrqq76)}
287
- .musae-u96u03:not(#\#):not(#\#):not(#\#):not(#\#){left:0}
288
+ .musae-1tjciyl:not(#\#):not(#\#):not(#\#):not(#\#){left:0px}
288
289
  .musae-101gtxs:not(#\#):not(#\#):not(#\#):not(#\#){left:var(--left,revert)}
289
290
  .musae-hq7bbv:not(#\#):not(#\#):not(#\#):not(#\#){margin-bottom:var(--musae-15cw4i4)}
290
291
  .musae-a4cli4:not(#\#):not(#\#):not(#\#):not(#\#){margin-bottom:var(--musae-1tzp6vk)}
291
292
  .musae-rsi211:not(#\#):not(#\#):not(#\#):not(#\#){margin-bottom:var(--musae-qk2ac7)}
292
293
  .musae-1vc729f:not(#\#):not(#\#):not(#\#):not(#\#){margin-right:var(--musae-qk2ac7)}
293
294
  .musae-ncydc0:not(#\#):not(#\#):not(#\#):not(#\#){margin-top:-100%}
294
- .musae-dj266r:not(#\#):not(#\#):not(#\#):not(#\#){margin-top:0}
295
+ .musae-1q12cbh:not(#\#):not(#\#):not(#\#):not(#\#){margin-top:0px}
295
296
  .musae-3yben5:not(#\#):not(#\#):not(#\#):not(#\#){margin-top:var(--musae-1wblvyz)}
296
297
  .musae-1lpmo0s:not(#\#):not(#\#):not(#\#):not(#\#){margin-top:var(--musae-vk5id6)}
297
298
  .musae-edbcy2:not(#\#):not(#\#):not(#\#):not(#\#){max-height:calc(100% - var(--musae-15cw4i4) * 2)}
@@ -322,12 +323,11 @@ html[dir='rtl'] .musae-1yc453h:not(#\#):not(#\#):not(#\#){text-align:right}
322
323
  .musae-522f2k:not(#\#):not(#\#):not(#\#):not(#\#){padding-top:var(--musae-oohzsl)}
323
324
  .musae-1p848mt:not(#\#):not(#\#):not(#\#):not(#\#){padding-top:var(--musae-qk2ac7)}
324
325
  .musae-utp9vd:not(#\#):not(#\#):not(#\#):not(#\#){padding-top:var(--musae-vk5id6)}
325
- .musae-3m8u43:not(#\#):not(#\#):not(#\#):not(#\#){right:0}
326
+ .musae-15gpytn:not(#\#):not(#\#):not(#\#):not(#\#){right:0px}
326
327
  .musae-14l26ut:not(#\#):not(#\#):not(#\#):not(#\#){right:var(--musae-15cw4i4)}
327
328
  .musae-6al1c1:not(#\#):not(#\#):not(#\#):not(#\#){right:var(--musae-oohzsl)}
328
- .musae-13vifvy:not(#\#):not(#\#):not(#\#):not(#\#){top:0}
329
+ .musae-9oc6z4:not(#\#):not(#\#):not(#\#):not(#\#){top:0px}
329
330
  .musae-wa60dl:not(#\#):not(#\#):not(#\#):not(#\#){top:50%}
330
- .musae-1vwp36r:not(#\#):not(#\#):not(#\#):not(#\#){top:calc(var(--musae-1l9c3uf) * -1)}
331
331
  .musae-kwake1:not(#\#):not(#\#):not(#\#):not(#\#){top:calc(var(--musae-xrqq76) + var(--musae-15cw4i4))}
332
332
  .musae-1qtgrog:not(#\#):not(#\#):not(#\#):not(#\#){top:var(--musae-15cw4i4)}
333
333
  .musae-9c655z:not(#\#):not(#\#):not(#\#):not(#\#){top:var(--musae-oohzsl)}
@@ -367,7 +367,6 @@ html[dir='rtl'] .musae-1yc453h:not(#\#):not(#\#):not(#\#){text-align:right}
367
367
  .musae-1lou4sy:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{border-width:var(--musae-1ax7z96)}
368
368
  .musae-15z8w9c:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{border-width:var(--musae-1h5s2h0)}
369
369
  .musae-ilzmfn:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{border-width:var(--musae-1hydgie)}
370
- .musae-w0vqy:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{transition:all .2s}
371
370
  .musae-t448kv:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{transition:all .2s}
372
371
  .musae-1uowca5:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-scrollbar{background-color:transparent}
373
372
  .musae-27d4w3:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{background-color:var(--15iyedw,revert)}
@@ -383,9 +382,9 @@ html[dir='rtl'] .musae-1yc453h:not(#\#):not(#\#):not(#\#){text-align:right}
383
382
  .musae-ilz4u6:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{content:"*"}
384
383
  .musae-hkezso:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{display:block}
385
384
  .musae-1fgarty:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{display:block}
386
- .musae-typ5od:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{inset-inline-end:0}
385
+ .musae-1x8jx26:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{inset-inline-end:0px}
387
386
  .musae-1gkks1t:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{inset-inline-end:50%}
388
- .musae-1682cnc:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{inset-inline-start:0}
387
+ .musae-1kfboi8:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{inset-inline-start:0px}
389
388
  .musae-fbisj7:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{inset-inline-start:50%}
390
389
  .musae-xsadbs:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{inset-inline-start:calc((100% - var(--musae-1ax7z96)) / 2)}
391
390
  .musae-2utku0:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{margin-inline-start:var(--musae-vk5id6)}
@@ -394,8 +393,11 @@ html[dir='rtl'] .musae-1yc453h:not(#\#):not(#\#):not(#\#){text-align:right}
394
393
  .musae-1hmns74:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{position:absolute}
395
394
  .musae-1j6awrg:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{position:absolute}
396
395
  .musae-1db1611:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{transform:translate(100%,-150%) rotate(45deg)}
396
+ .musae-t0fc71:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{transition-duration:.2s}
397
+ .musae-6orayw:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{transition-property:border-color,border-width}
397
398
  .musae-170pinb:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{visibility:visible}
398
399
  .musae-11srvyv:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{visibility:visible}
400
+ .musae-yttlx6:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{will-change:border-color,border-width}
399
401
  .musae-c28cl8:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::view-transition-new(root){z-index:var(--musae-1vh8wei)}
400
402
  .musae-ktw8en:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::view-transition-old(root){z-index:var(--musae-1vh8wei)}
401
403
  .musae-1ly6cpr:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{z-index:var(--musae-1vh8wei)}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "musae",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "musae-ui",
5
5
  "author": "tutu@fantufantu.com",
6
6
  "license": "MIT",
@@ -27,7 +27,7 @@
27
27
  "@floating-ui/dom": "^1.6.5",
28
28
  "@tanstack/react-table": "^8.16.0",
29
29
  "clsx": "^2.1.1",
30
- "dayjs": "^1.11.10",
30
+ "dayjs": "^1.11.11",
31
31
  "deepmerge": "^4.3.1",
32
32
  "framer-motion": "^11.2.10",
33
33
  "react-hook-form": "^7.47.0",
@@ -42,7 +42,7 @@
42
42
  "@rollup/plugin-node-resolve": "^15.2.3",
43
43
  "@rollup/plugin-typescript": "^11.1.6",
44
44
  "@stylexjs/babel-plugin": "^0.6.1",
45
- "@stylexjs/rollup-plugin": "^0.5.1",
45
+ "@stylexjs/rollup-plugin": "^0.6.1",
46
46
  "@stylexjs/stylex": "^0.5.1",
47
47
  "@testing-library/jest-dom": "^6.4.5",
48
48
  "@testing-library/react": "^15.0.7",