musae 0.2.5 → 0.2.6

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 (95) 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 +2 -1
  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 +6 -4
  10. package/dist/components/checkbox/index.d.ts +1 -1
  11. package/dist/components/checkbox/types.d.ts +9 -3
  12. package/dist/components/clock/column.js +1 -1
  13. package/dist/components/collapse/collapse.js +1 -1
  14. package/dist/components/collapse/item.js +2 -2
  15. package/dist/components/date-picker/date-picker.js +1 -1
  16. package/dist/components/dialog/popup.js +5 -5
  17. package/dist/components/divider/divider.js +1 -1
  18. package/dist/components/drawer/popup.js +17 -17
  19. package/dist/components/empty/empty.js +1 -1
  20. package/dist/components/form/field/field.js +1 -1
  21. package/dist/components/form/field/layout.js +1 -1
  22. package/dist/components/grid/col.js +1 -1
  23. package/dist/components/grid/row.js +1 -1
  24. package/dist/components/icon/icon.js +1 -1
  25. package/dist/components/image/image.js +3 -2
  26. package/dist/components/image/preview/operations.js +4 -4
  27. package/dist/components/image/preview/preview.js +1 -1
  28. package/dist/components/input/input.js +1 -1
  29. package/dist/components/layout/header.js +2 -2
  30. package/dist/components/layout/layout.js +1 -1
  31. package/dist/components/loading/loading.js +2 -2
  32. package/dist/components/menu/group.js +16 -2
  33. package/dist/components/menu/hooks.js +1 -1
  34. package/dist/components/menu/item.js +1 -1
  35. package/dist/components/menu/menu.js +3 -1
  36. package/dist/components/notification/holder.js +13 -13
  37. package/dist/components/notification/notification.js +3 -3
  38. package/dist/components/picker/picker.js +1 -1
  39. package/dist/components/popover/popover.js +1 -1
  40. package/dist/components/popper/dropdown.js +3 -3
  41. package/dist/components/progress/circular.js +1 -1
  42. package/dist/components/progress/linear.js +1 -1
  43. package/dist/components/radio/radio.js +1 -1
  44. package/dist/components/rate/rate.js +1 -1
  45. package/dist/components/rate/star.js +3 -3
  46. package/dist/components/ripple/ripple.js +1 -1
  47. package/dist/components/select/selector.js +1 -1
  48. package/dist/components/space/space.js +1 -1
  49. package/dist/components/steps/item.js +48 -2
  50. package/dist/components/steps/steps.js +1 -1
  51. package/dist/components/switch/switch.d.ts +1 -1
  52. package/dist/components/switch/switch.js +22 -22
  53. package/dist/components/table/body.js +1 -1
  54. package/dist/components/table/header/cell.js +3 -3
  55. package/dist/components/table/header/header.js +2 -2
  56. package/dist/components/tabs/hooks.d.ts +40 -0
  57. package/dist/components/tabs/hooks.js +98 -0
  58. package/dist/components/tabs/navigation.d.ts +4 -0
  59. package/dist/components/tabs/navigation.js +159 -0
  60. package/dist/components/tabs/panels.d.ts +4 -0
  61. package/dist/components/tabs/panels.js +78 -0
  62. package/dist/components/tabs/tab.d.ts +4 -0
  63. package/dist/components/tabs/tab.js +19 -0
  64. package/dist/components/tabs/tabs.d.ts +1 -1
  65. package/dist/components/tabs/tabs.js +24 -94
  66. package/dist/components/tabs/types.d.ts +50 -9
  67. package/dist/components/tag/tag.js +1 -1
  68. package/dist/components/theme/hooks.js +3 -3
  69. package/dist/components/time-picker/panel.js +1 -1
  70. package/dist/components/time-picker/time-picker.js +1 -1
  71. package/dist/components/timeline/item.d.ts +1 -1
  72. package/dist/components/timeline/item.js +87 -115
  73. package/dist/components/timeline/timeline.js +5 -3
  74. package/dist/components/timeline/types.d.ts +6 -0
  75. package/dist/components/tour/tour.js +2 -2
  76. package/dist/components/tree/context.js +2 -0
  77. package/dist/components/tree/hooks.d.ts +13 -2
  78. package/dist/components/tree/hooks.js +19 -2
  79. package/dist/components/tree/list.js +3 -3
  80. package/dist/components/tree/node.d.ts +1 -1
  81. package/dist/components/tree/node.js +24 -14
  82. package/dist/components/tree/tree.d.ts +1 -1
  83. package/dist/components/tree/tree.js +13 -9
  84. package/dist/components/tree/types.d.ts +18 -23
  85. package/dist/components/waterfall/sequential.js +4 -1
  86. package/dist/components/waterfall/waterfall.js +6 -3
  87. package/dist/hooks/use-class-names.d.ts +10 -0
  88. package/dist/stylex.css +41 -25
  89. package/dist/utils/class-name.d.ts +38 -7
  90. package/dist/utils/class-name.js +30 -8
  91. package/package.json +10 -8
  92. package/dist/components/tabs/item.d.ts +0 -4
  93. package/dist/components/tabs/item.js +0 -22
  94. /package/dist/node_modules/.pnpm/{@aiszlab_relax@1.2.55_react-dom@18.3.1_react@18.3.1 → @aiszlab_relax@1.2.56_react-dom@18.3.1_react@18.3.1}/node_modules/@aiszlab/relax/dist/dom/contains.js +0 -0
  95. /package/dist/node_modules/.pnpm/{@stylexjs_stylex@0.6.1 → @stylexjs_stylex@0.7.4}/node_modules/@stylexjs/stylex/lib/es/stylex.js +0 -0
@@ -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.4/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.4/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
@@ -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.4/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,
@@ -4,7 +4,7 @@ import { useBoolean, chain, useFocus } from '@aiszlab/relax';
4
4
  import { useEvents } from './hooks.js';
5
5
  import { ComponentToken, PickerClassToken } from '../../utils/class-name.js';
6
6
  import { useClassNames } from '../../hooks/use-class-names.js';
7
- import { props } from '../../node_modules/.pnpm/@stylexjs_stylex@0.6.1/node_modules/@stylexjs/stylex/lib/es/stylex.js';
7
+ import { props } from '../../node_modules/.pnpm/@stylexjs_stylex@0.7.4/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';
@@ -1,7 +1,7 @@
1
1
  import { useBoolean, toArray, useRefs, useEvent, useHover, chain, useFocus } from '@aiszlab/relax';
2
2
  import React, { useRef, useMemo, cloneElement } from 'react';
3
3
  import Popper from '../popper/popper.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.4/node_modules/@stylexjs/stylex/lib/es/stylex.js';
5
5
  import { typography } from '../theme/theme.js';
6
6
  import { useClassNames } from '../../hooks/use-class-names.js';
7
7
  import { ComponentToken, PopoverClassToken } from '../../utils/class-name.js';
@@ -1,7 +1,7 @@
1
1
  import React, { useRef, useMemo, useEffect } from 'react';
2
2
  import { ComponentToken, PopperClassToken } from '../../utils/class-name.js';
3
3
  import { useClassNames } from '../../hooks/use-class-names.js';
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.4/node_modules/@stylexjs/stylex/lib/es/stylex.js';
5
5
  import clsx from 'clsx';
6
6
  import { isFunction } from '@aiszlab/relax';
7
7
  import { autoUpdate, computePosition, flip, offset, arrow } from '@floating-ui/dom';
@@ -16,8 +16,8 @@ const styles = {
16
16
  zIndex: "musae-1axsr4t",
17
17
  position: "musae-10l6tqk",
18
18
  backgroundColor: "musae-q1mx2j",
19
- top: "musae-9oc6z4",
20
- insetInlineStart: "musae-1at4hj2",
19
+ top: "musae-13vifvy",
20
+ insetInlineStart: "musae-1o0tod",
21
21
  left: null,
22
22
  right: null,
23
23
  boxShadow: "musae-ezd0au",
@@ -1,5 +1,5 @@
1
1
  import React 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.4/node_modules/@stylexjs/stylex/lib/es/stylex.js';
3
3
  import { useTheme } from '../theme/hooks.js';
4
4
  import { ColorToken } from '../../utils/colors.js';
5
5
  import { sizes } from '../theme/tokens.stylex.js';
@@ -1,5 +1,5 @@
1
1
  import React 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.4/node_modules/@stylexjs/stylex/lib/es/stylex.js';
3
3
  import { useClassNames } from '../../hooks/use-class-names.js';
4
4
  import { ComponentToken, ProgressClassToken } from '../../utils/class-name.js';
5
5
  import clsx from 'clsx';
@@ -3,7 +3,7 @@ import Context from './context.js';
3
3
  import { useControlledState } from '@aiszlab/relax';
4
4
  import { useClassNames } from '../../hooks/use-class-names.js';
5
5
  import { ComponentToken, RadioClassToken } from '../../utils/class-name.js';
6
- import { props } from '../../node_modules/.pnpm/@stylexjs_stylex@0.6.1/node_modules/@stylexjs/stylex/lib/es/stylex.js';
6
+ import { props } from '../../node_modules/.pnpm/@stylexjs_stylex@0.7.4/node_modules/@stylexjs/stylex/lib/es/stylex.js';
7
7
  import { useTheme } from '../theme/hooks.js';
8
8
  import { ColorToken } from '../../utils/colors.js';
9
9
  import { typography } from '../theme/theme.js';
@@ -1,5 +1,5 @@
1
1
  import React 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.4/node_modules/@stylexjs/stylex/lib/es/stylex.js';
3
3
  import { useClassNames } from '../../hooks/use-class-names.js';
4
4
  import { ComponentToken, RateClassToken } from '../../utils/class-name.js';
5
5
  import clsx from 'clsx';
@@ -1,6 +1,6 @@
1
1
  import React, { createElement } from 'react';
2
2
  import { useEvent, useHover } from '@aiszlab/relax';
3
- import _stylex from '../../node_modules/.pnpm/@stylexjs_stylex@0.6.1/node_modules/@stylexjs/stylex/lib/es/stylex.js';
3
+ import _stylex from '../../node_modules/.pnpm/@stylexjs_stylex@0.7.4/node_modules/@stylexjs/stylex/lib/es/stylex.js';
4
4
  import clsx from 'clsx';
5
5
  import { useClassNames } from '../../hooks/use-class-names.js';
6
6
  import { ComponentToken, RateClassToken } from '../../utils/class-name.js';
@@ -36,10 +36,10 @@ const styles = {
36
36
  position: "musae-10l6tqk",
37
37
  width: "musae-1gn8jaj",
38
38
  height: "musae-b27hse",
39
- insetInlineStart: "musae-1at4hj2",
39
+ insetInlineStart: "musae-1o0tod",
40
40
  left: null,
41
41
  right: null,
42
- top: "musae-9oc6z4",
42
+ top: "musae-13vifvy",
43
43
  opacity: "musae-g01cxk",
44
44
  userSelect: "musae-87ps6o",
45
45
  overflow: "musae-b3r6kr",
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { AnimatePresence, motion } from 'framer-motion';
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.4/node_modules/@stylexjs/stylex/lib/es/stylex.js';
4
4
 
5
5
  const styles = {
6
6
  ripple: {
@@ -1,7 +1,7 @@
1
1
  import React, { forwardRef, useRef, useContext, useImperativeHandle } from 'react';
2
2
  import Tag from '../tag/tag.js';
3
3
  import { styles as styles$1 } from '../input/input.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.4/node_modules/@stylexjs/stylex/lib/es/stylex.js';
5
5
  import { Context } from '../picker/context.js';
6
6
  import { useTheme } from '../theme/hooks.js';
7
7
  import { ColorToken } from '../../utils/colors.js';
@@ -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.4/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,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.4/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';
@@ -8,6 +8,7 @@ import { ColorToken } from '../../utils/colors.js';
8
8
  import { useEvent } from '@aiszlab/relax';
9
9
  import { Context } from './context.js';
10
10
  import { typography } from '../theme/theme.js';
11
+ import Done from '../icon/icons/action/done.js';
11
12
 
12
13
  const styles = {
13
14
  step: {
@@ -46,6 +47,18 @@ const styles = {
46
47
  gridColumn: null,
47
48
  gridColumnStart: null,
48
49
  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,
49
62
  $$css: true
50
63
  },
51
64
  vertical: props => [{
@@ -63,6 +76,30 @@ const styles = {
63
76
  $$css: true
64
77
  }, {
65
78
  "--15iyedw": props.color != null ? props.color : "initial"
79
+ }],
80
+ doing: props => [{
81
+ backgroundColor: "musae-q1mx2j",
82
+ color: "musae-19dipnz",
83
+ $$css: true
84
+ }, {
85
+ "--backgroundColor": props.backgroundColor != null ? props.backgroundColor : "initial",
86
+ "--color": props.color != null ? props.color : "initial"
87
+ }],
88
+ done: props => [{
89
+ backgroundColor: "musae-q1mx2j",
90
+ color: "musae-19dipnz",
91
+ $$css: true
92
+ }, {
93
+ "--backgroundColor": props.backgroundColor != null ? props.backgroundColor : "initial",
94
+ "--color": props.color != null ? props.color : "initial"
95
+ }],
96
+ todo: props => [{
97
+ backgroundColor: "musae-q1mx2j",
98
+ color: "musae-19dipnz",
99
+ $$css: true
100
+ }, {
101
+ "--backgroundColor": props.backgroundColor != null ? props.backgroundColor : "initial",
102
+ "--color": props.color != null ? props.color : "initial"
66
103
  }]
67
104
  },
68
105
  title: {
@@ -129,6 +166,15 @@ const Item = ({
129
166
  step: _stylex.props(styles.step.default, isClickable && styles.step.clickable),
130
167
  leading: _stylex.props(styles.leading.default, isVertical && !isMax && styles.leading.vertical({
131
168
  color: theme.colors[ColorToken.Primary]
169
+ }), status === "doing" && styles.leading.doing({
170
+ backgroundColor: theme.colors[ColorToken.Primary],
171
+ color: theme.colors[ColorToken.OnPrimary]
172
+ }), status === "done" && styles.leading.done({
173
+ backgroundColor: theme.colors[ColorToken.PrimaryContainer],
174
+ color: theme.colors[ColorToken.OnPrimaryContainer]
175
+ }), status === "todo" && styles.leading.todo({
176
+ backgroundColor: theme.colors[ColorToken.Secondary],
177
+ color: theme.colors[ColorToken.OnSecondary]
132
178
  })),
133
179
  title: _stylex.props(typography.title.medium, styles.title.default, isHorizontal && !isMax && styles.title.horizontal({
134
180
  color: theme.colors[ColorToken.Primary]
@@ -150,7 +196,7 @@ const Item = ({
150
196
  }, React.createElement("div", {
151
197
  className: clsx(classNames[StepsClassToken.Leading], styled.leading.className),
152
198
  style: styled.leading.style
153
- }, leading), React.createElement("div", {
199
+ }, leading ?? (status === "done" ? React.createElement(Done, null) : value)), React.createElement("div", {
154
200
  className: clsx(classNames[StepsClassToken.Title], styled.title.className),
155
201
  style: styled.title.style
156
202
  }, title), React.createElement("div", {
@@ -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.6.1/node_modules/@stylexjs/stylex/lib/es/stylex.js';
5
+ import _stylex from '../../node_modules/.pnpm/@stylexjs_stylex@0.7.4/node_modules/@stylexjs/stylex/lib/es/stylex.js';
6
6
  import clsx from 'clsx';
7
7
  import { Context } from './context.js';
8
8
 
@@ -1,4 +1,4 @@
1
1
  import React from "react";
2
2
  import type { SwitchProps } from "./types";
3
- declare const Switch: ({ value, style, className, icon, checkedChildren, uncheckedChildren, disabled, }: SwitchProps) => React.JSX.Element;
3
+ declare const Switch: ({ value, style, className, icon, checkedChildren, uncheckedChildren, disabled, onChange, }: SwitchProps) => React.JSX.Element;
4
4
  export default Switch;
@@ -1,6 +1,6 @@
1
- import React, { useCallback } from 'react';
2
- import { useControlledState } from '@aiszlab/relax';
3
- import { props } from '../../node_modules/.pnpm/@stylexjs_stylex@0.6.1/node_modules/@stylexjs/stylex/lib/es/stylex.js';
1
+ import React from 'react';
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';
4
4
  import { useTheme } from '../theme/hooks.js';
5
5
  import { ColorToken } from '../../utils/colors.js';
6
6
  import clsx from 'clsx';
@@ -14,16 +14,13 @@ const styles = {
14
14
  switch: {
15
15
  default: props => [{
16
16
  minWidth: "musae-1049mhy",
17
+ width: "musae-eq5yr9",
17
18
  height: "musae-hfcj97",
18
19
  display: "musae-78zum5",
19
20
  alignItems: "musae-6s0dn4",
20
21
  position: "musae-1n2onr6",
21
- transition: "musae-1ng1d19",
22
- transitionBehavior: null,
23
- transitionDelay: null,
24
- transitionDuration: null,
25
- transitionProperty: null,
26
- transitionTimingFunction: null,
22
+ transitionProperty: "musae-fagghw",
23
+ transitionDuration: "musae-13dflua",
27
24
  borderRadius: "musae-iipnba",
28
25
  borderStartStartRadius: null,
29
26
  borderStartEndRadius: null,
@@ -173,7 +170,7 @@ const styles = {
173
170
  $$css: true
174
171
  },
175
172
  child: {
176
- minHeight: "musae-jk1msx",
173
+ height: "musae-b27hse",
177
174
  display: "musae-78zum5",
178
175
  flexDirection: "musae-1q0g3np",
179
176
  alignItems: "musae-6s0dn4",
@@ -192,20 +189,20 @@ const styles = {
192
189
  $$css: true
193
190
  },
194
191
  checked: {
195
- marginInlineStart: "musae-1tt3wx9",
192
+ marginInlineStart: "musae-1lziwak",
196
193
  marginLeft: null,
197
194
  marginRight: null,
198
- marginInlineEnd: "musae-fbia9g",
195
+ marginInlineEnd: "musae-14z9mp",
199
196
  $$css: true
200
197
  }
201
198
  },
202
199
  trailing: {
203
200
  default: {
204
- marginTop: "musae-ncydc0",
205
- marginInlineEnd: "musae-fbia9g",
201
+ marginTop: "musae-lpx92y",
202
+ marginInlineEnd: "musae-14z9mp",
206
203
  marginLeft: null,
207
204
  marginRight: null,
208
- marginInlineStart: "musae-1tt3wx9",
205
+ marginInlineStart: "musae-1lziwak",
209
206
  $$css: true
210
207
  },
211
208
  checked: {
@@ -224,14 +221,17 @@ const Switch = ({
224
221
  icon = false,
225
222
  checkedChildren,
226
223
  uncheckedChildren,
227
- disabled = false
224
+ disabled = false,
225
+ onChange
228
226
  }) => {
229
227
  const classNames = useClassNames(ComponentToken.Switch);
230
228
  const [isChecked, setIsChecked] = useControlledState(value);
231
229
  const theme = useTheme();
232
- const toggle = useCallback(() => {
233
- setIsChecked(_isChecked => !_isChecked);
234
- }, [setIsChecked]);
230
+ const toggle = useEvent(() => {
231
+ const _isChecked = !isChecked;
232
+ setIsChecked(_isChecked);
233
+ onChange?.(_isChecked);
234
+ });
235
235
  const styled = {
236
236
  switch: props(styles.switch.default({
237
237
  borderColor: theme.colors[ColorToken.Outline],
@@ -284,13 +284,13 @@ const Switch = ({
284
284
  className: clsx(classNames[SwitchClassToken.Slider], styled.slider.className),
285
285
  style: styled.slider.style
286
286
  }, icon && (isChecked ? React.createElement(Check, null) : React.createElement(Close, null))), React.createElement("span", {
287
- className: styled.supporting.className,
287
+ className: clsx(classNames[SwitchClassToken.Supporting], styled.supporting.className),
288
288
  style: styled.supporting.style
289
289
  }, React.createElement("span", {
290
- className: styled.leading.className,
290
+ className: clsx(classNames[SwitchClassToken.Leading], styled.leading.className),
291
291
  style: styled.leading.style
292
292
  }, checkedChildren), React.createElement("span", {
293
- className: styled.trailing.className,
293
+ className: clsx(classNames[SwitchClassToken.Trailing], styled.trailing.className),
294
294
  style: styled.trailing.style
295
295
  }, uncheckedChildren)));
296
296
  };
@@ -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.6.1/node_modules/@stylexjs/stylex/lib/es/stylex.js';
4
+ import { props } from '../../node_modules/.pnpm/@stylexjs_stylex@0.7.4/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.6.1/node_modules/@stylexjs/stylex/lib/es/stylex.js';
3
+ import _stylex from '../../../node_modules/.pnpm/@stylexjs_stylex@0.7.4/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';
@@ -35,8 +35,8 @@ const styles = {
35
35
  },
36
36
  half: {
37
37
  position: "musae-10l6tqk",
38
- top: "musae-9oc6z4",
39
- insetInlineStart: "musae-1at4hj2",
38
+ top: "musae-13vifvy",
39
+ insetInlineStart: "musae-1o0tod",
40
40
  left: null,
41
41
  right: null,
42
42
  height: "musae-1cj5796",
@@ -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.6.1/node_modules/@stylexjs/stylex/lib/es/stylex.js';
4
+ import { props } from '../../../node_modules/.pnpm/@stylexjs_stylex@0.7.4/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';
@@ -52,7 +52,7 @@ const styles = {
52
52
  ":not(:last-of-type)::after_height": "musae-1su0kt9",
53
53
  ":not(:last-of-type)::after_backgroundColor": "musae-9cqmhv",
54
54
  ":not(:last-of-type)::after_transform": "musae-1kmnipp",
55
- ":not(:last-of-type)::after_insetInlineEnd": "musae-1sd0t5p",
55
+ ":not(:last-of-type)::after_insetInlineEnd": "musae-192i3sz",
56
56
  ":not(:last-of-type)::after_left": null,
57
57
  ":not(:last-of-type)::after_right": null,
58
58
  $$css: true
@@ -0,0 +1,40 @@
1
+ import { type Key, type RefObject } from "react";
2
+ import type { TabItem } from "./types";
3
+ /**
4
+ * @description
5
+ * use tab context
6
+ */
7
+ export declare const useTabsContext: () => import("./types").ContextValue;
8
+ /**
9
+ * @description
10
+ * tabs
11
+ */
12
+ export declare const useTabs: ({ activeKey: _activeKey, items, defaultActiveKey, }: {
13
+ activeKey?: Key;
14
+ items: TabItem[];
15
+ defaultActiveKey?: Key;
16
+ }) => {
17
+ activeKey: string | number | bigint | undefined;
18
+ activatedKeys: Set<Key>;
19
+ changeActiveKey: (key: Key) => void;
20
+ };
21
+ /**
22
+ * @description
23
+ * count dom ele size
24
+ */
25
+ export declare const useNavigation: () => {
26
+ navigatorRef: RefObject<HTMLDivElement>;
27
+ tabsRef: RefObject<HTMLDivElement>;
28
+ scroll: (delta: number) => void;
29
+ offset: number;
30
+ isLeadingOverflow: boolean;
31
+ isTrailingOverflow: boolean;
32
+ };
33
+ /**
34
+ * @description
35
+ * use navigator scroll
36
+ */
37
+ export declare const useNavigatorScroll: ({ navigatorRef, scroll, }: {
38
+ navigatorRef: RefObject<HTMLDivElement>;
39
+ scroll: (delta: number) => void;
40
+ }) => void;
@@ -0,0 +1,98 @@
1
+ import { useControlledState, isUndefined, useEvent, clamp } from '@aiszlab/relax';
2
+ import { useState, useContext, useRef, useLayoutEffect, useMemo, useEffect } from 'react';
3
+ import Context from './context.js';
4
+
5
+ /**
6
+ * @description
7
+ * use tab context
8
+ */
9
+ const useTabsContext = () => {
10
+ return useContext(Context) ?? { items: [], activeKey: void 0 };
11
+ };
12
+ /**
13
+ * @description
14
+ * tabs
15
+ */
16
+ const useTabs = ({ activeKey: _activeKey, items, defaultActiveKey, }) => {
17
+ const [activeKey, setActiveKey] = useControlledState(_activeKey, {
18
+ defaultState: defaultActiveKey ?? items.at(0)?.key,
19
+ });
20
+ const [activatedKeys, setActivatedKeys] = useState(() => {
21
+ return new Set(isUndefined(activeKey) ? [] : [activeKey]);
22
+ });
23
+ const changeActiveKey = useEvent((key) => {
24
+ setActiveKey(key);
25
+ setActivatedKeys((prev) => new Set(prev).add(key));
26
+ });
27
+ return {
28
+ activeKey,
29
+ activatedKeys,
30
+ changeActiveKey,
31
+ };
32
+ };
33
+ /**
34
+ * @description
35
+ * count dom ele size
36
+ */
37
+ const useNavigation = () => {
38
+ const navigatorRef = useRef(null);
39
+ const tabsRef = useRef(null);
40
+ const [offset, setOffset] = useState(0);
41
+ // navigator size
42
+ const [navigatorSize, setNavigatorSize] = useState(0);
43
+ // tabs size
44
+ const [tabsSize, setTabsSize] = useState(0);
45
+ useLayoutEffect(() => {
46
+ const _navigatorSize = navigatorRef.current?.getBoundingClientRect().width ?? 0;
47
+ const _tabsSize = tabsRef.current?.getBoundingClientRect().width ?? 0;
48
+ setNavigatorSize(_navigatorSize);
49
+ setTabsSize(_tabsSize);
50
+ }, []);
51
+ const { maxOffset, minOffset } = useMemo(() => {
52
+ return {
53
+ maxOffset: Math.max(0, tabsSize - navigatorSize),
54
+ minOffset: 0,
55
+ };
56
+ }, [navigatorSize, tabsSize]);
57
+ const { isLeadingOverflow, isTrailingOverflow } = useMemo(() => {
58
+ return {
59
+ isLeadingOverflow: offset > minOffset,
60
+ isTrailingOverflow: offset < maxOffset,
61
+ };
62
+ }, [minOffset, maxOffset, offset]);
63
+ const scroll = useEvent((delta) => {
64
+ setOffset((prev) => {
65
+ return clamp(minOffset, maxOffset, prev + delta);
66
+ });
67
+ });
68
+ return {
69
+ navigatorRef,
70
+ tabsRef,
71
+ scroll,
72
+ offset,
73
+ isLeadingOverflow,
74
+ isTrailingOverflow,
75
+ };
76
+ };
77
+ /**
78
+ * @description
79
+ * use navigator scroll
80
+ */
81
+ const useNavigatorScroll = ({ navigatorRef, scroll, }) => {
82
+ // mouse wheel
83
+ const wheel = useEvent((event) => {
84
+ event.stopPropagation();
85
+ const { deltaY } = event;
86
+ scroll(deltaY);
87
+ });
88
+ useEffect(() => {
89
+ const navigator = navigatorRef.current;
90
+ navigator?.addEventListener("wheel", wheel);
91
+ return () => {
92
+ navigator?.removeEventListener("wheel", wheel);
93
+ };
94
+ // eslint-disable-next-line react-hooks/exhaustive-deps
95
+ }, []);
96
+ };
97
+
98
+ export { useNavigation, useNavigatorScroll, useTabs, useTabsContext };
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import { type NavigationProps } from "./types";
3
+ declare const Navigation: ({ onChange }: NavigationProps) => React.JSX.Element;
4
+ export default Navigation;