musae 0.2.6 → 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 (127) hide show
  1. package/dist/components/avatar/avatar.js +1 -1
  2. package/dist/components/breadcrumb/breadcrumb.js +1 -1
  3. package/dist/components/breadcrumb/item.js +1 -1
  4. package/dist/components/button/button.js +13 -16
  5. package/dist/components/calendar/calendar.js +1 -1
  6. package/dist/components/calendar/hooks.js +1 -1
  7. package/dist/components/checkbox/checkbox.d.ts +1 -1
  8. package/dist/components/checkbox/checkbox.js +203 -143
  9. package/dist/components/checkbox/group.d.ts +1 -1
  10. package/dist/components/checkbox/group.js +20 -19
  11. package/dist/components/checkbox/index.d.ts +2 -2
  12. package/dist/components/checkbox/types.d.ts +22 -1
  13. package/dist/components/clock/column.js +1 -1
  14. package/dist/components/collapse/collapse.js +1 -1
  15. package/dist/components/collapse/item.js +14 -8
  16. package/dist/components/date-picker/date-picker.js +1 -1
  17. package/dist/components/dialog/dialog.js +1 -1
  18. package/dist/components/dialog/popup.js +2 -2
  19. package/dist/components/divider/divider.js +1 -1
  20. package/dist/components/drawer/drawer.js +1 -1
  21. package/dist/components/drawer/popup.js +2 -2
  22. package/dist/components/empty/empty.js +1 -1
  23. package/dist/components/floating-action-button/floatable.d.ts +4 -0
  24. package/dist/components/floating-action-button/floatable.js +83 -0
  25. package/dist/components/floating-action-button/floating-action-button.d.ts +4 -0
  26. package/dist/components/floating-action-button/floating-action-button.js +26 -0
  27. package/dist/components/floating-action-button/index.d.ts +2 -0
  28. package/dist/components/floating-action-button/types.d.ts +44 -0
  29. package/dist/components/form/field/error.d.ts +2 -2
  30. package/dist/components/form/field/error.js +36 -22
  31. package/dist/components/form/field/field.js +6 -21
  32. package/dist/components/form/field/layout.js +1 -1
  33. package/dist/components/grid/col.js +1 -1
  34. package/dist/components/grid/row.js +1 -1
  35. package/dist/components/icon/icon.d.ts +1 -1
  36. package/dist/components/icon/icon.js +5 -3
  37. package/dist/components/icon/types.d.ts +6 -1
  38. package/dist/components/image/preview/operations.js +2 -2
  39. package/dist/components/image/preview/preview.js +1 -1
  40. package/dist/components/input/input.d.ts +6 -6
  41. package/dist/components/input/input.js +9 -15
  42. package/dist/components/layout/header.js +1 -1
  43. package/dist/components/layout/layout.js +1 -1
  44. package/dist/components/loading/loading.js +1 -1
  45. package/dist/components/menu/group.js +14 -8
  46. package/dist/components/menu/hooks.js +1 -1
  47. package/dist/components/menu/item.js +1 -1
  48. package/dist/components/notification/holder.js +2 -3
  49. package/dist/components/notification/notification.js +1 -1
  50. package/dist/components/otp-input/otp-input.js +1 -1
  51. package/dist/components/pagination/hooks.d.ts +4 -2
  52. package/dist/components/pagination/hooks.js +9 -4
  53. package/dist/components/pagination/item.js +6 -8
  54. package/dist/components/pagination/pagination.d.ts +1 -1
  55. package/dist/components/pagination/pagination.js +37 -9
  56. package/dist/components/pagination/types.d.ts +6 -0
  57. package/dist/components/picker/picker.js +2 -2
  58. package/dist/components/popover/popover.js +1 -1
  59. package/dist/components/popper/dropdown.js +1 -1
  60. package/dist/components/popper/popper.js +1 -1
  61. package/dist/components/portal/portal.js +6 -2
  62. package/dist/components/portal/types.d.ts +6 -0
  63. package/dist/components/progress/circular.js +1 -1
  64. package/dist/components/progress/linear.js +1 -1
  65. package/dist/components/radio/radio.js +1 -1
  66. package/dist/components/rate/rate.js +1 -1
  67. package/dist/components/rate/star.js +1 -1
  68. package/dist/components/ripple/ripple.js +1 -1
  69. package/dist/components/select/hooks.d.ts +1 -1
  70. package/dist/components/select/select.d.ts +1 -1
  71. package/dist/components/select/select.js +5 -5
  72. package/dist/components/select/selector.d.ts +3 -6
  73. package/dist/components/select/selector.js +16 -10
  74. package/dist/components/select/types.d.ts +3 -1
  75. package/dist/components/space/space.js +1 -1
  76. package/dist/components/steps/item.d.ts +1 -1
  77. package/dist/components/steps/item.js +46 -31
  78. package/dist/components/steps/steps.d.ts +1 -1
  79. package/dist/components/steps/steps.js +6 -4
  80. package/dist/components/steps/types.d.ts +15 -0
  81. package/dist/components/switch/switch.js +1 -1
  82. package/dist/components/table/body.js +1 -1
  83. package/dist/components/table/header/cell.js +1 -1
  84. package/dist/components/table/header/header.js +1 -1
  85. package/dist/components/tabs/hooks.js +5 -5
  86. package/dist/components/tabs/navigation.js +1 -1
  87. package/dist/components/tabs/panels.js +1 -1
  88. package/dist/components/tag/tag.js +1 -1
  89. package/dist/components/theme/tokens.stylex.d.ts +1 -0
  90. package/dist/components/time-picker/panel.js +1 -1
  91. package/dist/components/time-picker/time-picker.js +1 -1
  92. package/dist/components/timeline/item.js +30 -14
  93. package/dist/components/timeline/timeline.d.ts +1 -1
  94. package/dist/components/timeline/timeline.js +5 -3
  95. package/dist/components/timeline/types.d.ts +10 -0
  96. package/dist/components/tour/tour.js +3 -2
  97. package/dist/components/transfer/context.d.ts +6 -0
  98. package/dist/components/transfer/context.js +11 -0
  99. package/dist/components/transfer/hooks.d.ts +19 -0
  100. package/dist/components/transfer/hooks.js +49 -0
  101. package/dist/components/transfer/index.d.ts +2 -0
  102. package/dist/components/transfer/item.d.ts +4 -0
  103. package/dist/components/transfer/item.js +25 -0
  104. package/dist/components/transfer/list.d.ts +4 -0
  105. package/dist/components/transfer/list.js +122 -0
  106. package/dist/components/transfer/transfer.d.ts +4 -0
  107. package/dist/components/transfer/transfer.js +82 -0
  108. package/dist/components/transfer/types.d.ts +83 -0
  109. package/dist/components/tree/list.js +14 -7
  110. package/dist/components/tree/node.js +1 -1
  111. package/dist/components/waterfall/sequential.js +1 -1
  112. package/dist/components/waterfall/waterfall.js +1 -1
  113. package/dist/hooks/use-class-names.d.ts +17 -1
  114. package/dist/hooks/use-container.d.ts +11 -0
  115. package/dist/hooks/use-container.js +23 -0
  116. package/dist/hooks/use-expandable.d.ts +11 -0
  117. package/dist/hooks/use-expandable.js +37 -0
  118. package/dist/index.d.ts +2 -0
  119. package/dist/index.js +2 -0
  120. package/dist/stylex.css +20 -15
  121. package/dist/utils/class-name.d.ts +59 -10
  122. package/dist/utils/class-name.js +40 -6
  123. package/package.json +13 -5
  124. package/dist/hooks/use-expand-effect.d.ts +0 -12
  125. package/dist/hooks/use-expand-effect.js +0 -34
  126. /package/dist/node_modules/.pnpm/{@aiszlab_relax@1.2.56_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
  127. /package/dist/node_modules/.pnpm/{@stylexjs_stylex@0.7.4 → @stylexjs_stylex@0.7.5}/node_modules/@stylexjs/stylex/lib/es/stylex.js +0 -0
@@ -6,6 +6,7 @@ import type { RequiredIn } from "@aiszlab/relax/types";
6
6
  export type Mode = "multiple";
7
7
  export type Value = Key | Pick<Option, "value" | "label">;
8
8
  export type ValueOrValues = Value[] | Value;
9
+ type ChangeHandler = ((value: string) => void) | ((value: number) => void) | ((value: bigint) => void) | ((values: Value[]) => void);
9
10
  /**
10
11
  * @author murukal
11
12
  *
@@ -60,7 +61,7 @@ export type SelectProps = ComponentProps & {
60
61
  * on value change, toggle
61
62
  * @default void 0
62
63
  */
63
- onChange?: (value: ValueOrValues) => void;
64
+ onChange?: ChangeHandler;
64
65
  };
65
66
  /**
66
67
  * @description
@@ -121,3 +122,4 @@ export type SelectionsProps = {
121
122
  */
122
123
  selectedKeys: MenuProps["selectedKeys"];
123
124
  };
125
+ export {};
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { props } from '../../node_modules/.pnpm/@stylexjs_stylex@0.7.4/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 { useGutters } from '../../hooks/use-gutters.js';
4
4
  import clsx from 'clsx';
5
5
 
@@ -1,4 +1,4 @@
1
1
  import React from "react";
2
2
  import type { StepItemProps } from "./types";
3
- declare const Item: ({ leading, title, description, value }: StepItemProps) => React.JSX.Element;
3
+ declare const Item: ({ leading, title, description, value, size }: StepItemProps) => React.JSX.Element;
4
4
  export default Item;
@@ -1,8 +1,9 @@
1
1
  import React, { useContext } from 'react';
2
- import _stylex from '../../node_modules/.pnpm/@stylexjs_stylex@0.7.4/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 { useClassNames } from '../../hooks/use-class-names.js';
4
4
  import { ComponentToken, StepsClassToken } from '../../utils/class-name.js';
5
5
  import clsx from 'clsx';
6
+ import { sizes } from '../theme/tokens.stylex.js';
6
7
  import { useTheme } from '../theme/hooks.js';
7
8
  import { ColorToken } from '../../utils/colors.js';
8
9
  import { useEvent } from '@aiszlab/relax';
@@ -18,19 +19,13 @@ const styles = {
18
19
  flexShrink: null,
19
20
  flexBasis: null,
20
21
  display: "musae-rvj5dj",
21
- grid: "musae-1l2suiq",
22
- gridTemplate: null,
23
- gridTemplateAreas: null,
24
- gridTemplateColumns: null,
25
- gridTemplateRows: null,
26
- gridAutoRows: null,
27
- gridAutoColumns: null,
28
- gridAutoFlow: null,
29
22
  alignItems: "musae-6s0dn4",
30
23
  columnGap: "musae-1om1yv4",
31
24
  overflow: "musae-b3r6kr",
32
25
  overflowX: null,
33
26
  overflowY: null,
27
+ gridTemplateAreas: "musae-1tdxyq7",
28
+ gridTemplateColumns: "musae-1pmbctz",
34
29
  $$css: true
35
30
  },
36
31
  clickable: {
@@ -47,35 +42,48 @@ const styles = {
47
42
  gridColumn: null,
48
43
  gridColumnStart: null,
49
44
  gridColumnEnd: null,
50
- display: "musae-78zum5",
51
- justifyContent: "musae-l56j7k",
52
- alignItems: "musae-6s0dn4",
53
- borderRadius: "musae-iipnba",
54
- borderStartStartRadius: null,
55
- borderStartEndRadius: null,
56
- borderEndStartRadius: null,
57
- borderEndEndRadius: null,
58
- borderTopLeftRadius: null,
59
- borderTopRightRadius: null,
60
- borderBottomLeftRadius: null,
61
- borderBottomRightRadius: null,
62
45
  $$css: true
63
46
  },
64
- vertical: props => [{
47
+ tail: props => [{
65
48
  position: "musae-1n2onr6",
66
49
  "::after_content": "musae-1s928wv",
67
50
  "::after_position": "musae-1j6awrg",
68
51
  "::after_height": "musae-p59mhh",
69
52
  "::after_width": "musae-etvar1",
70
53
  "::after_backgroundColor": "musae-27d4w3",
71
- "::after_marginTop": "musae-4ys0c4",
72
54
  "::after_top": "musae-1srwf7z",
73
55
  "::after_insetInlineStart": "musae-xsadbs",
74
56
  "::after_left": null,
75
57
  "::after_right": null,
58
+ "::after_marginTop": "musae-4ys0c4",
76
59
  $$css: true
77
60
  }, {
78
61
  "--15iyedw": props.color != null ? props.color : "initial"
62
+ }]
63
+ },
64
+ sign: {
65
+ default: props => [{
66
+ display: "musae-78zum5",
67
+ justifyContent: "musae-l56j7k",
68
+ alignItems: "musae-6s0dn4",
69
+ borderRadius: "musae-iipnba",
70
+ borderStartStartRadius: null,
71
+ borderStartEndRadius: null,
72
+ borderEndStartRadius: null,
73
+ borderEndEndRadius: null,
74
+ borderTopLeftRadius: null,
75
+ borderTopRightRadius: null,
76
+ borderBottomLeftRadius: null,
77
+ borderBottomRightRadius: null,
78
+ overflow: "musae-b3r6kr",
79
+ overflowX: null,
80
+ overflowY: null,
81
+ width: "musae-17fnjtu",
82
+ height: "musae-1jwls1v",
83
+ $$css: true
84
+ }, {
85
+ "--width": (val => typeof val === "number" ? val + "px" : val != null ? val : "initial")(props.size ?? sizes.xsmall),
86
+ "--height": (val => typeof val === "number" ? val + "px" : val != null ? val : "initial")(props.size ?? sizes.xsmall)
79
87
  }],
80
88
  doing: props => [{
81
89
  backgroundColor: "musae-q1mx2j",
@@ -114,7 +122,7 @@ const styles = {
114
122
  alignItems: "musae-6s0dn4",
115
123
  $$css: true
116
124
  },
117
- horizontal: props => [{
125
+ tail: props => [{
118
126
  position: "musae-1n2onr6",
119
127
  "::after_content": "musae-1s928wv",
120
128
  "::after_position": "musae-1j6awrg",
@@ -147,7 +155,8 @@ const Item = ({
147
155
  leading,
148
156
  title,
149
157
  description,
150
- value
158
+ value,
159
+ size
151
160
  }) => {
152
161
  const classNames = useClassNames(ComponentToken.Steps);
153
162
  const theme = useTheme();
@@ -164,19 +173,22 @@ const Item = ({
164
173
  const isMax = value === max;
165
174
  const styled = {
166
175
  step: _stylex.props(styles.step.default, isClickable && styles.step.clickable),
167
- leading: _stylex.props(styles.leading.default, isVertical && !isMax && styles.leading.vertical({
176
+ leading: _stylex.props(styles.leading.default, isVertical && !isMax && styles.leading.tail({
168
177
  color: theme.colors[ColorToken.Primary]
169
- }), status === "doing" && styles.leading.doing({
178
+ })),
179
+ sign: _stylex.props(styles.sign.default({
180
+ size
181
+ }), status === "doing" && styles.sign.doing({
170
182
  backgroundColor: theme.colors[ColorToken.Primary],
171
183
  color: theme.colors[ColorToken.OnPrimary]
172
- }), status === "done" && styles.leading.done({
184
+ }), status === "done" && styles.sign.done({
173
185
  backgroundColor: theme.colors[ColorToken.PrimaryContainer],
174
186
  color: theme.colors[ColorToken.OnPrimaryContainer]
175
- }), status === "todo" && styles.leading.todo({
187
+ }), status === "todo" && styles.sign.todo({
176
188
  backgroundColor: theme.colors[ColorToken.Secondary],
177
189
  color: theme.colors[ColorToken.OnSecondary]
178
190
  })),
179
- title: _stylex.props(typography.title.medium, styles.title.default, isHorizontal && !isMax && styles.title.horizontal({
191
+ title: _stylex.props(typography.title.medium, styles.title.default, isHorizontal && !isMax && styles.title.tail({
180
192
  color: theme.colors[ColorToken.Primary]
181
193
  })),
182
194
  description: _stylex.props(typography.body.medium, styles.description.default)
@@ -196,7 +208,10 @@ const Item = ({
196
208
  }, React.createElement("div", {
197
209
  className: clsx(classNames[StepsClassToken.Leading], styled.leading.className),
198
210
  style: styled.leading.style
199
- }, leading ?? (status === "done" ? React.createElement(Done, null) : value)), React.createElement("div", {
211
+ }, React.createElement("div", {
212
+ className: clsx(classNames[StepsClassToken.Sign], styled.sign.className),
213
+ style: styled.sign.style
214
+ }, leading ?? (status === "done" ? React.createElement(Done, null) : value))), React.createElement("div", {
200
215
  className: clsx(classNames[StepsClassToken.Title], styled.title.className),
201
216
  style: styled.title.style
202
217
  }, title), React.createElement("div", {
@@ -8,5 +8,5 @@ import type { StepsProps } from "./types";
8
8
  * 1. `Steps` only be controlled
9
9
  * 2. render by `items` prop
10
10
  */
11
- declare const Steps: ({ items, value, className, style, type, onChange }: StepsProps) => React.JSX.Element;
11
+ declare const Steps: ({ items, value, className, style, type, onChange, size }: StepsProps) => React.JSX.Element;
12
12
  export default Steps;
@@ -2,7 +2,7 @@ import React, { useMemo } from 'react';
2
2
  import Item from './item.js';
3
3
  import { useClassNames } from '../../hooks/use-class-names.js';
4
4
  import { ComponentToken, StepsClassToken } from '../../utils/class-name.js';
5
- import _stylex from '../../node_modules/.pnpm/@stylexjs_stylex@0.7.4/node_modules/@stylexjs/stylex/lib/es/stylex.js';
5
+ import _stylex from '../../node_modules/.pnpm/@stylexjs_stylex@0.7.5/node_modules/@stylexjs/stylex/lib/es/stylex.js';
6
6
  import clsx from 'clsx';
7
7
  import { Context } from './context.js';
8
8
 
@@ -38,7 +38,8 @@ const Steps = ({
38
38
  className,
39
39
  style,
40
40
  type = "horizontal",
41
- onChange
41
+ onChange,
42
+ size
42
43
  }) => {
43
44
  const classNames = useClassNames(ComponentToken.Steps);
44
45
  const styled = {
@@ -48,8 +49,9 @@ const Steps = ({
48
49
  type,
49
50
  onChange,
50
51
  max: items.length - 1,
51
- value
52
- }), [type, onChange, items.length, value]);
52
+ value,
53
+ size
54
+ }), [type, onChange, items.length, value, size]);
53
55
  return React.createElement(Context.Provider, {
54
56
  value: contextValue
55
57
  }, React.createElement("ol", {
@@ -54,6 +54,11 @@ export type StepsProps = ComponentProps & {
54
54
  * @default horizontal
55
55
  */
56
56
  type?: Type;
57
+ /**
58
+ * @description
59
+ * size
60
+ */
61
+ size?: number;
57
62
  };
58
63
  /**
59
64
  * @description
@@ -65,6 +70,11 @@ export type StepItemProps = StepItem & {
65
70
  * current item value
66
71
  */
67
72
  value: number;
73
+ /**
74
+ * @description
75
+ * leading size
76
+ */
77
+ size?: number;
68
78
  };
69
79
  /**
70
80
  * @description
@@ -91,5 +101,10 @@ export type ContextValue = {
91
101
  * value
92
102
  */
93
103
  value: number;
104
+ /**
105
+ * @description
106
+ * size
107
+ */
108
+ size?: number;
94
109
  };
95
110
  export {};
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { useControlledState, useEvent } from '@aiszlab/relax';
3
- import { props } from '../../node_modules/.pnpm/@stylexjs_stylex@0.7.4/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 { useTheme } from '../theme/hooks.js';
5
5
  import { ColorToken } from '../../utils/colors.js';
6
6
  import clsx from 'clsx';
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { useTable } from './context.js';
3
3
  import { flexRender } from '@tanstack/react-table';
4
- import { props } from '../../node_modules/.pnpm/@stylexjs_stylex@0.7.4/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 clsx from 'clsx';
6
6
  import { typography } from '../theme/theme.js';
7
7
  import { useTheme } from '../theme/hooks.js';
@@ -1,6 +1,6 @@
1
1
  import React, { useContext, useMemo } from 'react';
2
2
  import { toFunction, useEvent, isUndefined } from '@aiszlab/relax';
3
- import _stylex from '../../../node_modules/.pnpm/@stylexjs_stylex@0.7.4/node_modules/@stylexjs/stylex/lib/es/stylex.js';
3
+ import _stylex from '../../../node_modules/.pnpm/@stylexjs_stylex@0.7.5/node_modules/@stylexjs/stylex/lib/es/stylex.js';
4
4
  import { useTheme } from '../../theme/hooks.js';
5
5
  import { ColorToken } from '../../../utils/colors.js';
6
6
  import Context from '../context.js';
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { useTable } from '../context.js';
3
3
  import { flexRender } from '@tanstack/react-table';
4
- import { props } from '../../../node_modules/.pnpm/@stylexjs_stylex@0.7.4/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 { useTheme } from '../../theme/hooks.js';
6
6
  import clsx from 'clsx';
7
7
  import { ColorToken } from '../../../utils/colors.js';
@@ -62,7 +62,7 @@ const useNavigation = () => {
62
62
  }, [minOffset, maxOffset, offset]);
63
63
  const scroll = useEvent((delta) => {
64
64
  setOffset((prev) => {
65
- return clamp(minOffset, maxOffset, prev + delta);
65
+ return clamp(prev + delta, minOffset, maxOffset);
66
66
  });
67
67
  });
68
68
  return {
@@ -80,16 +80,16 @@ const useNavigation = () => {
80
80
  */
81
81
  const useNavigatorScroll = ({ navigatorRef, scroll, }) => {
82
82
  // mouse wheel
83
- const wheel = useEvent((event) => {
84
- event.stopPropagation();
83
+ const onWheel = useEvent((event) => {
84
+ event.preventDefault();
85
85
  const { deltaY } = event;
86
86
  scroll(deltaY);
87
87
  });
88
88
  useEffect(() => {
89
89
  const navigator = navigatorRef.current;
90
- navigator?.addEventListener("wheel", wheel);
90
+ navigator?.addEventListener("wheel", onWheel);
91
91
  return () => {
92
- navigator?.removeEventListener("wheel", wheel);
92
+ navigator?.removeEventListener("wheel", onWheel);
93
93
  };
94
94
  // eslint-disable-next-line react-hooks/exhaustive-deps
95
95
  }, []);
@@ -1,6 +1,6 @@
1
1
  import clsx from 'clsx';
2
2
  import React, { useRef, useEffect } from 'react';
3
- import _stylex from '../../node_modules/.pnpm/@stylexjs_stylex@0.7.4/node_modules/@stylexjs/stylex/lib/es/stylex.js';
3
+ import _stylex from '../../node_modules/.pnpm/@stylexjs_stylex@0.7.5/node_modules/@stylexjs/stylex/lib/es/stylex.js';
4
4
  import { useClassNames } from '../../hooks/use-class-names.js';
5
5
  import { ComponentToken, TabsClassToken } from '../../utils/class-name.js';
6
6
  import Tab from './tab.js';
@@ -1,5 +1,5 @@
1
1
  import React, { useMemo } from 'react';
2
- import _stylex from '../../node_modules/.pnpm/@stylexjs_stylex@0.7.4/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 { useClassNames } from '../../hooks/use-class-names.js';
4
4
  import { ComponentToken, TabsClassToken } from '../../utils/class-name.js';
5
5
  import clsx from 'clsx';
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import clsx from 'clsx';
3
3
  import { useClassNames } from '../../hooks/use-class-names.js';
4
4
  import { ComponentToken, TagClassToken } from '../../utils/class-name.js';
5
- import { props } from '../../node_modules/.pnpm/@stylexjs_stylex@0.7.4/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 { useTheme } from '../theme/hooks.js';
7
7
  import { typography } from '../theme/theme.js';
8
8
  import { ColorToken } from '../../utils/colors.js';
@@ -77,6 +77,7 @@ export declare const positions: import("@stylexjs/stylex").VarGroup<Readonly<{
77
77
  min: string;
78
78
  header: string;
79
79
  popper: string;
80
+ floatable: string;
80
81
  dialog: string;
81
82
  drawer: string;
82
83
  tour: string;
@@ -4,7 +4,7 @@ import { useClassNames } from '../../hooks/use-class-names.js';
4
4
  import { ComponentToken, TimePickerClassToken } from '../../utils/class-name.js';
5
5
  import Button from '../button/button.js';
6
6
  import dayjs from 'dayjs';
7
- import { props } from '../../node_modules/.pnpm/@stylexjs_stylex@0.7.4/node_modules/@stylexjs/stylex/lib/es/stylex.js';
7
+ import { props } from '../../node_modules/.pnpm/@stylexjs_stylex@0.7.5/node_modules/@stylexjs/stylex/lib/es/stylex.js';
8
8
  import { useTheme } from '../theme/hooks.js';
9
9
  import { ColorToken } from '../../utils/colors.js';
10
10
  import clsx from 'clsx';
@@ -5,7 +5,7 @@ import { useClassNames } from '../../hooks/use-class-names.js';
5
5
  import { ComponentToken, TimePickerClassToken } from '../../utils/class-name.js';
6
6
  import Panel from './panel.js';
7
7
  import { useValue } from './hooks.js';
8
- import { props } from '../../node_modules/.pnpm/@stylexjs_stylex@0.7.4/node_modules/@stylexjs/stylex/lib/es/stylex.js';
8
+ import { props } from '../../node_modules/.pnpm/@stylexjs_stylex@0.7.5/node_modules/@stylexjs/stylex/lib/es/stylex.js';
9
9
  import { useEvent } from '@aiszlab/relax';
10
10
  import { styles } from '../input/input.js';
11
11
 
@@ -1,6 +1,7 @@
1
1
  import React, { useContext, useMemo } from 'react';
2
- import _stylex from '../../node_modules/.pnpm/@stylexjs_stylex@0.7.4/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 { Context } from './context.js';
4
+ import { sizes } from '../theme/tokens.stylex.js';
4
5
  import { useClassNames } from '../../hooks/use-class-names.js';
5
6
  import { ComponentToken, TimelineClassToken } from '../../utils/class-name.js';
6
7
  import clsx from 'clsx';
@@ -48,7 +49,6 @@ const styles = {
48
49
  },
49
50
  leading: {
50
51
  default: {
51
- alignSelf: "musae-qcrz7y",
52
52
  gridArea: "musae-1kxrqrs",
53
53
  gridRow: null,
54
54
  gridRowStart: null,
@@ -56,15 +56,11 @@ const styles = {
56
56
  gridColumn: null,
57
57
  gridColumnStart: null,
58
58
  gridColumnEnd: null,
59
- position: "musae-1n2onr6",
60
- display: "musae-78zum5",
61
- justifyContent: "musae-l56j7k",
62
- alignItems: "musae-6s0dn4",
63
- width: "musae-145rzd9",
64
- height: "musae-lry4nc",
59
+ alignSelf: "musae-qcrz7y",
65
60
  $$css: true
66
61
  },
67
62
  tail: props => [{
63
+ position: "musae-1n2onr6",
68
64
  "::after_content": "musae-1s928wv",
69
65
  "::after_position": "musae-1j6awrg",
70
66
  "::after_height": "musae-p59mhh",
@@ -79,6 +75,19 @@ const styles = {
79
75
  "--15iyedw": props.color != null ? props.color : "initial"
80
76
  }]
81
77
  },
78
+ sign: {
79
+ default: props => [{
80
+ display: "musae-78zum5",
81
+ justifyContent: "musae-l56j7k",
82
+ alignItems: "musae-6s0dn4",
83
+ width: "musae-17fnjtu",
84
+ height: "musae-1jwls1v",
85
+ $$css: true
86
+ }, {
87
+ "--width": (val => typeof val === "number" ? val + "px" : val != null ? val : "initial")(props.size ?? sizes.xsmall),
88
+ "--height": (val => typeof val === "number" ? val + "px" : val != null ? val : "initial")(props.size ?? sizes.xsmall)
89
+ }]
90
+ },
82
91
  dot: {
83
92
  default: props => [{
84
93
  width: "musae-jz7u3w",
@@ -148,7 +157,8 @@ const Item = ({
148
157
  const classNames = useClassNames(ComponentToken.Timeline);
149
158
  const {
150
159
  mode: _mode,
151
- max
160
+ max,
161
+ size
152
162
  } = useContext(Context);
153
163
  const theme = useTheme();
154
164
  const isLabeled = !!label;
@@ -166,6 +176,9 @@ const Item = ({
166
176
  leading: _stylex.props(styles.leading.default, !isMax && styles.leading.tail({
167
177
  color: theme.colors[ColorToken.Primary]
168
178
  })),
179
+ sign: _stylex.props(styles.sign.default({
180
+ size
181
+ })),
169
182
  dot: _stylex.props(styles.dot.default({
170
183
  color: theme.colors[ColorToken.Primary]
171
184
  })),
@@ -175,16 +188,19 @@ const Item = ({
175
188
  className: clsx(classNames[TimelineClassToken.Item], styled.item.className),
176
189
  style: styled.item.style
177
190
  }, isLabeled && React.createElement("div", {
178
- className: styled.label.className,
191
+ className: clsx(classNames[TimelineClassToken.Label], styled.label.className),
179
192
  style: styled.label.style
180
193
  }, label), React.createElement("div", {
181
- className: styled.leading.className,
194
+ className: clsx(classNames[TimelineClassToken.Leading], styled.leading.className),
182
195
  style: styled.leading.style
196
+ }, React.createElement("div", {
197
+ className: clsx(classNames[TimelineClassToken.Sign], styled.sign.className),
198
+ style: styled.sign.style
183
199
  }, dot ?? React.createElement("span", {
184
- className: styled.dot.className,
200
+ className: clsx(classNames[TimelineClassToken.Dot], styled.dot.className),
185
201
  style: styled.dot.style
186
- })), React.createElement("div", {
187
- className: styled.description.className,
202
+ }))), React.createElement("div", {
203
+ className: clsx(classNames[TimelineClassToken.Description], styled.description.className),
188
204
  style: styled.description.style
189
205
  }, description));
190
206
  };
@@ -1,4 +1,4 @@
1
1
  import React from "react";
2
2
  import type { TimelineProps } from "./types";
3
- declare const Timeline: ({ items, mode }: TimelineProps) => React.JSX.Element;
3
+ declare const Timeline: ({ items, mode, size }: TimelineProps) => React.JSX.Element;
4
4
  export default Timeline;
@@ -7,7 +7,8 @@ import clsx from 'clsx';
7
7
 
8
8
  const Timeline = ({
9
9
  items,
10
- mode = "right"
10
+ mode = "right",
11
+ size
11
12
  }) => {
12
13
  const styled = {
13
14
  className: "musae-78zum5 musae-dt5ytf"
@@ -16,8 +17,9 @@ const Timeline = ({
16
17
  const total = items.length;
17
18
  const contextValue = useMemo(() => ({
18
19
  mode,
19
- max: total - 1
20
- }), [mode, total]);
20
+ max: total - 1,
21
+ size
22
+ }), [mode, total, size]);
21
23
  return React.createElement(Context.Provider, {
22
24
  value: contextValue
23
25
  }, React.createElement("ol", {
@@ -41,6 +41,11 @@ export type TimelineProps = {
41
41
  * @default "right"
42
42
  */
43
43
  mode?: Mode;
44
+ /**
45
+ * @description
46
+ * size
47
+ */
48
+ size?: number;
44
49
  };
45
50
  /**
46
51
  * @description
@@ -68,5 +73,10 @@ export type ContextValue = {
68
73
  * max
69
74
  */
70
75
  max: number;
76
+ /**
77
+ * @description
78
+ * size
79
+ */
80
+ size?: number;
71
81
  };
72
82
  export {};
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import Portal from '../portal/portal.js';
3
3
  import Popper from '../popper/popper.js';
4
- import _stylex from '../../node_modules/.pnpm/@stylexjs_stylex@0.7.4/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 Button from '../button/button.js';
6
6
  import { useTheme } from '../theme/hooks.js';
7
7
  import { ColorToken } from '../../utils/colors.js';
@@ -107,7 +107,8 @@ const Tour = ({
107
107
  };
108
108
  return React.createElement(React.Fragment, null, React.createElement(Portal, {
109
109
  open: overlay && open,
110
- destroyable: true
110
+ destroyable: true,
111
+ lockable: true
111
112
  }, React.createElement("div", {
112
113
  className: clsx(classNames[TourClassToken.Overlay], styled.overlay.className),
113
114
  style: styled.overlay.style
@@ -0,0 +1,6 @@
1
+ import { ContextValue } from "./types";
2
+ /**
3
+ * @description
4
+ * transfer context
5
+ */
6
+ export declare const Context: import("react").Context<ContextValue>;
@@ -0,0 +1,11 @@
1
+ import { createContext } from 'react';
2
+
3
+ /**
4
+ * @description
5
+ * transfer context
6
+ */
7
+ const Context = createContext({
8
+ disabled: false,
9
+ });
10
+
11
+ export { Context };
@@ -0,0 +1,19 @@
1
+ import { type Key } from "react";
2
+ import type { TransferOption } from "./types";
3
+ /**
4
+ * @description
5
+ * options
6
+ */
7
+ export declare const useTransfer: (props: {
8
+ options: TransferOption[];
9
+ value?: Key[];
10
+ }) => {
11
+ transferred: Map<Key, TransferOption>;
12
+ untransferred: Map<Key, TransferOption>;
13
+ transfer: () => void;
14
+ untransfer: () => void;
15
+ transferKeys: Key[];
16
+ untransferKeys: Key[];
17
+ setTransferKeys: import("react").Dispatch<import("react").SetStateAction<Key[]>>;
18
+ setUntransferKeys: import("react").Dispatch<import("react").SetStateAction<Key[]>>;
19
+ };
@@ -0,0 +1,49 @@
1
+ import { useState, useMemo, useCallback } from 'react';
2
+ import { useControlledState } from '@aiszlab/relax';
3
+
4
+ /**
5
+ * @description
6
+ * options
7
+ */
8
+ const useTransfer = (props) => {
9
+ const [value, setValue] = useControlledState(props.value);
10
+ const [transferKeys, setTransferKeys] = useState([]);
11
+ const [untransferKeys, setUntransferKeys] = useState([]);
12
+ const options = useMemo(() => {
13
+ return props.options.reduce((prev, item) => prev.set(item.value, item), new Map());
14
+ }, [props.options]);
15
+ const [transferred, untransferred] = useMemo(() => {
16
+ return (value ?? []).reduce(([transferred, untransferred], key) => {
17
+ if (untransferred.has(key)) {
18
+ transferred.set(key, untransferred.get(key));
19
+ untransferred.delete(key);
20
+ }
21
+ return [transferred, untransferred];
22
+ }, [new Map(), new Map(options)]);
23
+ }, [options, value]);
24
+ const transfer = useCallback(() => {
25
+ setValue((prev = []) => [...prev, ...transferKeys]);
26
+ setTransferKeys([]);
27
+ }, [transferKeys]);
28
+ const untransfer = useCallback(() => {
29
+ setValue((prev = []) => {
30
+ return Array.from(untransferKeys.reduce((checkedKeys, unchecked) => {
31
+ checkedKeys.delete(unchecked);
32
+ return checkedKeys;
33
+ }, new Set(prev)));
34
+ });
35
+ setUntransferKeys([]);
36
+ }, [untransferKeys]);
37
+ return {
38
+ transferred,
39
+ untransferred,
40
+ transfer,
41
+ untransfer,
42
+ transferKeys,
43
+ untransferKeys,
44
+ setTransferKeys,
45
+ setUntransferKeys,
46
+ };
47
+ };
48
+
49
+ export { useTransfer };
@@ -0,0 +1,2 @@
1
+ import Transfer from "./transfer";
2
+ export { Transfer };