musae 0.2.5 → 0.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (150) hide show
  1. package/README.md +4 -2
  2. package/dist/components/avatar/avatar.js +1 -1
  3. package/dist/components/breadcrumb/breadcrumb.js +1 -1
  4. package/dist/components/breadcrumb/item.js +1 -1
  5. package/dist/components/button/button.js +14 -16
  6. package/dist/components/calendar/calendar.js +1 -1
  7. package/dist/components/calendar/hooks.js +5 -5
  8. package/dist/components/checkbox/checkbox.d.ts +1 -1
  9. package/dist/components/checkbox/checkbox.js +205 -143
  10. package/dist/components/checkbox/group.d.ts +1 -1
  11. package/dist/components/checkbox/group.js +20 -19
  12. package/dist/components/checkbox/index.d.ts +2 -2
  13. package/dist/components/checkbox/types.d.ts +31 -4
  14. package/dist/components/clock/column.js +1 -1
  15. package/dist/components/collapse/collapse.js +1 -1
  16. package/dist/components/collapse/item.js +15 -9
  17. package/dist/components/date-picker/date-picker.js +1 -1
  18. package/dist/components/dialog/dialog.js +1 -1
  19. package/dist/components/dialog/popup.js +5 -5
  20. package/dist/components/divider/divider.js +1 -1
  21. package/dist/components/drawer/drawer.js +1 -1
  22. package/dist/components/drawer/popup.js +17 -17
  23. package/dist/components/empty/empty.js +1 -1
  24. package/dist/components/floating-action-button/floatable.d.ts +4 -0
  25. package/dist/components/floating-action-button/floatable.js +83 -0
  26. package/dist/components/floating-action-button/floating-action-button.d.ts +4 -0
  27. package/dist/components/floating-action-button/floating-action-button.js +26 -0
  28. package/dist/components/floating-action-button/index.d.ts +2 -0
  29. package/dist/components/floating-action-button/types.d.ts +44 -0
  30. package/dist/components/form/field/error.d.ts +2 -2
  31. package/dist/components/form/field/error.js +36 -22
  32. package/dist/components/form/field/field.js +6 -21
  33. package/dist/components/form/field/layout.js +1 -1
  34. package/dist/components/grid/col.js +1 -1
  35. package/dist/components/grid/row.js +1 -1
  36. package/dist/components/icon/icon.d.ts +1 -1
  37. package/dist/components/icon/icon.js +5 -3
  38. package/dist/components/icon/types.d.ts +6 -1
  39. package/dist/components/image/image.js +3 -2
  40. package/dist/components/image/preview/operations.js +5 -5
  41. package/dist/components/image/preview/preview.js +1 -1
  42. package/dist/components/input/input.d.ts +6 -6
  43. package/dist/components/input/input.js +9 -15
  44. package/dist/components/layout/header.js +2 -2
  45. package/dist/components/layout/layout.js +1 -1
  46. package/dist/components/loading/loading.js +2 -2
  47. package/dist/components/menu/group.js +29 -9
  48. package/dist/components/menu/hooks.js +1 -1
  49. package/dist/components/menu/item.js +1 -1
  50. package/dist/components/menu/menu.js +3 -1
  51. package/dist/components/notification/holder.js +14 -15
  52. package/dist/components/notification/notification.js +3 -3
  53. package/dist/components/otp-input/otp-input.js +1 -1
  54. package/dist/components/pagination/hooks.d.ts +4 -2
  55. package/dist/components/pagination/hooks.js +9 -4
  56. package/dist/components/pagination/item.js +6 -8
  57. package/dist/components/pagination/pagination.d.ts +1 -1
  58. package/dist/components/pagination/pagination.js +37 -9
  59. package/dist/components/pagination/types.d.ts +6 -0
  60. package/dist/components/picker/picker.js +2 -2
  61. package/dist/components/popover/popover.js +1 -1
  62. package/dist/components/popper/dropdown.js +3 -3
  63. package/dist/components/popper/popper.js +1 -1
  64. package/dist/components/portal/portal.js +6 -2
  65. package/dist/components/portal/types.d.ts +6 -0
  66. package/dist/components/progress/circular.js +1 -1
  67. package/dist/components/progress/linear.js +1 -1
  68. package/dist/components/radio/radio.js +1 -1
  69. package/dist/components/rate/rate.js +1 -1
  70. package/dist/components/rate/star.js +3 -3
  71. package/dist/components/ripple/ripple.js +1 -1
  72. package/dist/components/select/hooks.d.ts +1 -1
  73. package/dist/components/select/select.d.ts +1 -1
  74. package/dist/components/select/select.js +5 -5
  75. package/dist/components/select/selector.d.ts +3 -6
  76. package/dist/components/select/selector.js +16 -10
  77. package/dist/components/select/types.d.ts +3 -1
  78. package/dist/components/space/space.js +1 -1
  79. package/dist/components/steps/item.d.ts +1 -1
  80. package/dist/components/steps/item.js +77 -16
  81. package/dist/components/steps/steps.d.ts +1 -1
  82. package/dist/components/steps/steps.js +6 -4
  83. package/dist/components/steps/types.d.ts +15 -0
  84. package/dist/components/switch/switch.d.ts +1 -1
  85. package/dist/components/switch/switch.js +22 -22
  86. package/dist/components/table/body.js +1 -1
  87. package/dist/components/table/header/cell.js +3 -3
  88. package/dist/components/table/header/header.js +2 -2
  89. package/dist/components/tabs/hooks.d.ts +40 -0
  90. package/dist/components/tabs/hooks.js +98 -0
  91. package/dist/components/tabs/navigation.d.ts +4 -0
  92. package/dist/components/tabs/navigation.js +159 -0
  93. package/dist/components/tabs/panels.d.ts +4 -0
  94. package/dist/components/tabs/panels.js +78 -0
  95. package/dist/components/tabs/tab.d.ts +4 -0
  96. package/dist/components/tabs/tab.js +19 -0
  97. package/dist/components/tabs/tabs.d.ts +1 -1
  98. package/dist/components/tabs/tabs.js +24 -94
  99. package/dist/components/tabs/types.d.ts +50 -9
  100. package/dist/components/tag/tag.js +1 -1
  101. package/dist/components/theme/hooks.js +3 -3
  102. package/dist/components/theme/tokens.stylex.d.ts +1 -0
  103. package/dist/components/time-picker/panel.js +1 -1
  104. package/dist/components/time-picker/time-picker.js +1 -1
  105. package/dist/components/timeline/item.d.ts +1 -1
  106. package/dist/components/timeline/item.js +107 -119
  107. package/dist/components/timeline/timeline.d.ts +1 -1
  108. package/dist/components/timeline/timeline.js +8 -4
  109. package/dist/components/timeline/types.d.ts +16 -0
  110. package/dist/components/tour/tour.js +4 -3
  111. package/dist/components/transfer/context.d.ts +6 -0
  112. package/dist/components/transfer/context.js +11 -0
  113. package/dist/components/transfer/hooks.d.ts +19 -0
  114. package/dist/components/transfer/hooks.js +49 -0
  115. package/dist/components/transfer/index.d.ts +2 -0
  116. package/dist/components/transfer/item.d.ts +4 -0
  117. package/dist/components/transfer/item.js +25 -0
  118. package/dist/components/transfer/list.d.ts +4 -0
  119. package/dist/components/transfer/list.js +122 -0
  120. package/dist/components/transfer/transfer.d.ts +4 -0
  121. package/dist/components/transfer/transfer.js +82 -0
  122. package/dist/components/transfer/types.d.ts +83 -0
  123. package/dist/components/tree/context.js +2 -0
  124. package/dist/components/tree/hooks.d.ts +13 -2
  125. package/dist/components/tree/hooks.js +19 -2
  126. package/dist/components/tree/list.js +16 -9
  127. package/dist/components/tree/node.d.ts +1 -1
  128. package/dist/components/tree/node.js +24 -14
  129. package/dist/components/tree/tree.d.ts +1 -1
  130. package/dist/components/tree/tree.js +13 -9
  131. package/dist/components/tree/types.d.ts +18 -23
  132. package/dist/components/waterfall/sequential.js +4 -1
  133. package/dist/components/waterfall/waterfall.js +6 -3
  134. package/dist/hooks/use-class-names.d.ts +27 -1
  135. package/dist/hooks/use-container.d.ts +11 -0
  136. package/dist/hooks/use-container.js +23 -0
  137. package/dist/hooks/use-expandable.d.ts +11 -0
  138. package/dist/hooks/use-expandable.js +37 -0
  139. package/dist/index.d.ts +2 -0
  140. package/dist/index.js +2 -0
  141. package/dist/stylex.css +61 -40
  142. package/dist/utils/class-name.d.ts +96 -16
  143. package/dist/utils/class-name.js +69 -13
  144. package/package.json +21 -11
  145. package/dist/components/tabs/item.d.ts +0 -4
  146. package/dist/components/tabs/item.js +0 -22
  147. package/dist/hooks/use-expand-effect.d.ts +0 -12
  148. package/dist/hooks/use-expand-effect.js +0 -34
  149. /package/dist/node_modules/.pnpm/{@aiszlab_relax@1.2.55_react-dom@18.3.1_react@18.3.1 → @aiszlab_relax@1.2.59_react-dom@18.3.1_react@18.3.1__react@18.3.1}/node_modules/@aiszlab/relax/dist/dom/contains.js +0 -0
  150. /package/dist/node_modules/.pnpm/{@stylexjs_stylex@0.6.1 → @stylexjs_stylex@0.7.5}/node_modules/@stylexjs/stylex/lib/es/stylex.js +0 -0
@@ -1,4 +1,4 @@
1
- import type { Key, ReactNode } from "react";
1
+ import type { ChangeEvent, Key, ReactNode } from "react";
2
2
  import type { ComponentProps } from "../../types/element";
3
3
  /**
4
4
  * @author murukal
@@ -16,7 +16,12 @@ export interface ContextValue {
16
16
  * @description
17
17
  * change handler
18
18
  */
19
- change: (value: Key) => void;
19
+ change: (value: Key, isChecked: boolean) => void;
20
+ /**
21
+ * @description
22
+ * disabled
23
+ */
24
+ disabled: boolean;
20
25
  }
21
26
  /**
22
27
  * @author murukal
@@ -41,6 +46,17 @@ export interface CheckboxGroupProps {
41
46
  * @requires
42
47
  */
43
48
  children: ReactNode;
49
+ /**
50
+ * @description
51
+ * change handler
52
+ */
53
+ onChange?: (value: Key[]) => void;
54
+ /**
55
+ * @description
56
+ * disabled
57
+ * @default false
58
+ */
59
+ disabled?: boolean;
44
60
  }
45
61
  /**
46
62
  * @author murukal
@@ -58,15 +74,26 @@ export interface CheckboxProps extends ComponentProps {
58
74
  /**
59
75
  * @description
60
76
  * value
61
- * @requires
77
+ * @default void 0
62
78
  */
63
- value: Key;
79
+ value?: Key;
64
80
  /**
65
81
  * @description
66
82
  * children
67
83
  * @default void 0
68
84
  */
69
85
  children?: ReactNode;
86
+ /**
87
+ * @description
88
+ * change handler
89
+ * @default void 0
90
+ */
91
+ onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
92
+ /**
93
+ * @description
94
+ * disabled
95
+ */
96
+ disabled?: boolean;
70
97
  }
71
98
  /**
72
99
  * @author murukal
@@ -4,7 +4,7 @@ import Menu from '../menu/menu.js';
4
4
  import { useClassNames } from '../../hooks/use-class-names.js';
5
5
  import { ComponentToken, ClockClassToken } from '../../utils/class-name.js';
6
6
  import { isVoid } from '@aiszlab/relax';
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.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';
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { useClassNames } from '../../hooks/use-class-names.js';
3
3
  import { ComponentToken, CollapseClassToken } from '../../utils/class-name.js';
4
4
  import CollapseItem from './item.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.5/node_modules/@stylexjs/stylex/lib/es/stylex.js';
6
6
  import clsx from 'clsx';
7
7
  import { useActiveKeys } from './hooks.js';
8
8
  import { Context } from './context.js';
@@ -1,12 +1,12 @@
1
1
  import React, { useContext } from 'react';
2
2
  import { useClassNames } from '../../hooks/use-class-names.js';
3
3
  import { ComponentToken, CollapseClassToken } from '../../utils/class-name.js';
4
- import _stylex from '../../node_modules/.pnpm/@stylexjs_stylex@0.6.1/node_modules/@stylexjs/stylex/lib/es/stylex.js';
5
- import { useEvent } from '@aiszlab/relax';
4
+ import _stylex from '../../node_modules/.pnpm/@stylexjs_stylex@0.7.5/node_modules/@stylexjs/stylex/lib/es/stylex.js';
5
+ import { useUpdateEffect, useEvent } from '@aiszlab/relax';
6
6
  import { useAnimate } from 'framer-motion';
7
7
  import clsx from 'clsx';
8
8
  import { Context } from './context.js';
9
- import { useExpandEffect } from '../../hooks/use-expand-effect.js';
9
+ import { useExpandable } from '../../hooks/use-expandable.js';
10
10
  import { useTheme } from '../theme/hooks.js';
11
11
  import { ColorToken } from '../../utils/colors.js';
12
12
  import KeyboardArrowRight from '../icon/icons/hardware/keyboard-arrow-right.js';
@@ -17,7 +17,7 @@ const styles = {
17
17
  borderBottomWidth: "musae-lntmim",
18
18
  borderBottomStyle: "musae-1q0q8m5",
19
19
  borderBottomColor: "musae-43481e",
20
- ":last-of-type_borderBottomWidth": "musae-zm6erk",
20
+ ":last-of-type_borderBottomWidth": "musae-xt7lk8",
21
21
  $$css: true
22
22
  }, {
23
23
  "--borderBottomColor": props.outlineColor != null ? props.outlineColor : "initial"
@@ -98,11 +98,17 @@ const CollapseItem = ({
98
98
  const isExpanded = activeKeys.has(value);
99
99
  const [collapser, animate] = useAnimate();
100
100
  const theme = useTheme();
101
- useExpandEffect({
102
- animate,
103
- expanded: isExpanded,
104
- target: collapser
105
- });
101
+ const {
102
+ expand,
103
+ collapse
104
+ } = useExpandable();
105
+ useUpdateEffect(async () => {
106
+ if (isExpanded) {
107
+ await expand([collapser, animate]);
108
+ return;
109
+ }
110
+ await collapse([collapser, animate]);
111
+ }, [isExpanded]);
106
112
  const styled = {
107
113
  item: _stylex.props(styles.item.default({
108
114
  outlineColor: theme.colors[ColorToken.OutlineVariant]
@@ -4,7 +4,7 @@ import Calendar from '../calendar/calendar.js';
4
4
  import { useValue } from './hooks.js';
5
5
  import { useClassNames } from '../../hooks/use-class-names.js';
6
6
  import { ComponentToken, DatePickerClassToken } from '../../utils/class-name.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.5/node_modules/@stylexjs/stylex/lib/es/stylex.js';
8
8
  import clsx from 'clsx';
9
9
  import { styles } from '../input/input.js';
10
10
 
@@ -12,7 +12,7 @@ const Dialog = ({ open, dismissable = true, ...props }) => {
12
12
  }
13
13
  // eslint-disable-next-line react-hooks/exhaustive-deps
14
14
  }, [open]);
15
- return (React.createElement(Portal, { open: open || _isVisible },
15
+ return (React.createElement(Portal, { open: open || _isVisible, lockable: true },
16
16
  React.createElement(Popup, { ...props, dismissable: true, open: open, onClosed: turnOff })));
17
17
  };
18
18
  var Dialog$1 = Dialog;
@@ -3,13 +3,13 @@ import { useFooter } from './hooks.js';
3
3
  import { useAnimate } from 'framer-motion';
4
4
  import { ComponentToken, DialogClassToken } from '../../utils/class-name.js';
5
5
  import { useClassNames } from '../../hooks/use-class-names.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.5/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';
10
10
  import clsx from 'clsx';
11
11
  import { useDismissable } from '../../hooks/use-dismissable.js';
12
- import { contains } from '../../node_modules/.pnpm/@aiszlab_relax@1.2.55_react-dom@18.3.1_react@18.3.1/node_modules/@aiszlab/relax/dist/dom/contains.js';
12
+ import { contains } from '../../node_modules/.pnpm/@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';
13
13
 
14
14
  const styles = {
15
15
  header: {
@@ -19,8 +19,8 @@ const styles = {
19
19
  },
20
20
  overlay: props => [{
21
21
  position: "musae-10l6tqk",
22
- top: "musae-9oc6z4",
23
- left: "musae-1tjciyl",
22
+ top: "musae-13vifvy",
23
+ left: "musae-u96u03",
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-9oc6z4 musae-1tjciyl musae-n9wirt musae-1dr59a3 musae-47corl musae-1tv1kli musae-78zum5 musae-l56j7k musae-6s0dn4"
140
+ className: "musae-ixxii4 musae-13vifvy musae-u96u03 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]
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { useOffset } from './hooks.js';
3
3
  import { useClassNames } from '../../hooks/use-class-names.js';
4
4
  import { ComponentToken, DividerClassToken } from '../../utils/class-name.js';
5
- import { props } from '../../node_modules/.pnpm/@stylexjs_stylex@0.6.1/node_modules/@stylexjs/stylex/lib/es/stylex.js';
5
+ import { props } from '../../node_modules/.pnpm/@stylexjs_stylex@0.7.5/node_modules/@stylexjs/stylex/lib/es/stylex.js';
6
6
  import { useTheme } from '../theme/hooks.js';
7
7
  import { ColorToken } from '../../utils/colors.js';
8
8
  import { typography } from '../theme/theme.js';
@@ -12,7 +12,7 @@ const Drawer = ({ open, size = 400, dismissable = true, placement = "right", ...
12
12
  }
13
13
  // eslint-disable-next-line react-hooks/exhaustive-deps
14
14
  }, [open]);
15
- return (React.createElement(Portal, { open: open || _isVisible },
15
+ return (React.createElement(Portal, { open: open || _isVisible, lockable: true },
16
16
  React.createElement(Popup, { ...props, onClosed: turnOff, size: size, open: open, dismissable: dismissable, placement: placement })));
17
17
  };
18
18
  var Drawer$1 = Drawer;
@@ -3,18 +3,18 @@ import { useAnimate } from 'framer-motion';
3
3
  import { PLACEMENTS } from './hooks.js';
4
4
  import { ComponentToken, DrawerClassToken } from '../../utils/class-name.js';
5
5
  import { useClassNames } from '../../hooks/use-class-names.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.5/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 clsx from 'clsx';
10
10
  import { typography } from '../theme/theme.js';
11
11
  import { useDismissable } from '../../hooks/use-dismissable.js';
12
- import { contains } from '../../node_modules/.pnpm/@aiszlab_relax@1.2.55_react-dom@18.3.1_react@18.3.1/node_modules/@aiszlab/relax/dist/dom/contains.js';
12
+ import { contains } from '../../node_modules/.pnpm/@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';
13
13
 
14
14
  const styles = {
15
15
  popup: {
16
16
  position: "musae-ixxii4",
17
- inset: "musae-ezip7x",
17
+ inset: "musae-10a8y8t",
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-ezip7x",
32
+ inset: "musae-10a8y8t",
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-15gpytn",
64
+ right: "musae-3m8u43",
65
65
  insetInlineStart: null,
66
66
  insetInlineEnd: null,
67
- top: "musae-9oc6z4",
68
- bottom: "musae-1sh2tzk",
67
+ top: "musae-13vifvy",
68
+ bottom: "musae-1ey2m1c",
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-1tjciyl",
75
+ left: "musae-u96u03",
76
76
  insetInlineStart: null,
77
77
  insetInlineEnd: null,
78
- top: "musae-9oc6z4",
79
- bottom: "musae-1sh2tzk",
78
+ top: "musae-13vifvy",
79
+ bottom: "musae-1ey2m1c",
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-1sh2tzk",
87
- left: "musae-1tjciyl",
86
+ bottom: "musae-1ey2m1c",
87
+ left: "musae-u96u03",
88
88
  insetInlineStart: null,
89
89
  insetInlineEnd: null,
90
- right: "musae-15gpytn",
90
+ right: "musae-3m8u43",
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-9oc6z4",
98
- left: "musae-1tjciyl",
97
+ top: "musae-13vifvy",
98
+ left: "musae-u96u03",
99
99
  insetInlineStart: null,
100
100
  insetInlineEnd: null,
101
- right: "musae-15gpytn",
101
+ right: "musae-3m8u43",
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-ezip7x musae-47corl musae-mn8nw1"
190
+ className: "musae-ixxii4 musae-10a8y8t musae-47corl musae-mn8nw1"
191
191
  },
192
192
  overlay: props(styles.overlay({
193
193
  backgroundColor: theme.colors[ColorToken.SurfaceDim]
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { useClassNames } from '../../hooks/use-class-names.js';
3
3
  import { ComponentToken, EmptyClassToken } from '../../utils/class-name.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.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
 
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import type { FloatableProps, FloatableRef } from "./types";
3
+ declare const Floatable: React.ForwardRefExoticComponent<FloatableProps & React.RefAttributes<FloatableRef>>;
4
+ export default Floatable;
@@ -0,0 +1,83 @@
1
+ import { useIdentity, useRefs } from '@aiszlab/relax';
2
+ import { useDraggable, useDndMonitor } from '@dnd-kit/core';
3
+ import React, { forwardRef, useRef, useState, useImperativeHandle } from 'react';
4
+ import _stylex from '../../node_modules/.pnpm/@stylexjs_stylex@0.7.5/node_modules/@stylexjs/stylex/lib/es/stylex.js';
5
+ import Button from '../button/button.js';
6
+ import Portal from '../portal/portal.js';
7
+ import { useContainer } from '../../hooks/use-container.js';
8
+
9
+ const styles = {
10
+ floatable: props => [{
11
+ position: "musae-10l6tqk",
12
+ transform: "musae-1v0jg1i",
13
+ willChange: "musae-1so62im",
14
+ right: "musae-k6ci0l",
15
+ insetInlineStart: null,
16
+ insetInlineEnd: null,
17
+ bottom: "musae-jnlgov",
18
+ zIndex: "musae-aefx0h",
19
+ $$css: true
20
+ }, {
21
+ "--transform": `translate3d(${props.x}px, ${props.y}px, 0)` != null ? `translate3d(${props.x}px, ${props.y}px, 0)` : "initial"
22
+ }],
23
+ fixed: {
24
+ position: "musae-ixxii4",
25
+ $$css: true
26
+ }
27
+ };
28
+ const Floatable = forwardRef(({
29
+ container,
30
+ children
31
+ }, ref) => {
32
+ const [id] = useIdentity();
33
+ const _ref = useRef(null);
34
+ const {
35
+ attributes,
36
+ listeners,
37
+ setNodeRef,
38
+ transform
39
+ } = useDraggable({
40
+ id
41
+ });
42
+ const floatableRef = useRefs(_ref, setNodeRef);
43
+ const {
44
+ container: _container,
45
+ isDocumentBody
46
+ } = useContainer({
47
+ container
48
+ });
49
+ const [offsetX, setOffsetX] = useState(0);
50
+ const [offsetY, setOffsetY] = useState(0);
51
+ const [clientRect, setClientRect] = useState();
52
+ useDndMonitor({
53
+ onDragEnd: event => {
54
+ setOffsetX(_offsetX => _offsetX + event.delta.x);
55
+ setOffsetY(_offsetY => _offsetY + event.delta.y);
56
+ setClientRect(_ref.current?.getBoundingClientRect());
57
+ }
58
+ });
59
+ useImperativeHandle(ref, () => {
60
+ return {
61
+ getBoundingClientRect: () => {
62
+ return clientRect;
63
+ }
64
+ };
65
+ });
66
+ const styled = _stylex.props(styles.floatable({
67
+ x: offsetX + (transform?.x ?? 0),
68
+ y: offsetY + (transform?.y ?? 0)
69
+ }), isDocumentBody && styles.fixed);
70
+ return React.createElement(Portal, {
71
+ container: _container
72
+ }, React.createElement("div", {
73
+ ref: floatableRef,
74
+ ...listeners,
75
+ ...attributes,
76
+ className: styled.className,
77
+ style: styled.style
78
+ }, React.createElement(Button, {
79
+ shape: "circular"
80
+ }, children)));
81
+ });
82
+
83
+ export { Floatable as default };
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import type { FloatingActionButtonProps } from "./types";
3
+ declare const FloatingActionButton: ({ container, children }: FloatingActionButtonProps) => React.JSX.Element;
4
+ export default FloatingActionButton;
@@ -0,0 +1,26 @@
1
+ import React, { useRef } from 'react';
2
+ import { DndContext } from '@dnd-kit/core';
3
+ import Floatable from './floatable.js';
4
+ import { restrictToParentElement } from '@dnd-kit/modifiers';
5
+ import { useIdentity, useEvent } from '@aiszlab/relax';
6
+ import { useContainer } from '../../hooks/use-container.js';
7
+
8
+ const FloatingActionButton = ({ container, children }) => {
9
+ const [id] = useIdentity();
10
+ const floatableRef = useRef(null);
11
+ const { container: _container } = useContainer({ container });
12
+ const modifier = useEvent((args) => {
13
+ const clientRect = floatableRef.current?.getBoundingClientRect();
14
+ return restrictToParentElement({
15
+ ...args,
16
+ ...(!!clientRect && {
17
+ draggingNodeRect: clientRect,
18
+ }),
19
+ });
20
+ });
21
+ return (React.createElement(DndContext, { id: id, modifiers: [modifier] },
22
+ React.createElement(Floatable, { ref: floatableRef, container: _container }, children)));
23
+ };
24
+ var FloatingActionButton$1 = FloatingActionButton;
25
+
26
+ export { FloatingActionButton$1 as default };
@@ -0,0 +1,2 @@
1
+ import FloatingActionButton from "./floating-action-button";
2
+ export { FloatingActionButton };
@@ -0,0 +1,44 @@
1
+ import type { ReactNode } from "react";
2
+ import type { PortalProps } from "../portal/types";
3
+ /**
4
+ * @description
5
+ * floatable ref
6
+ */
7
+ export type FloatableRef = {
8
+ /**
9
+ * @description
10
+ * get rect
11
+ */
12
+ getBoundingClientRect: () => DOMRect | undefined;
13
+ };
14
+ /**
15
+ * @description
16
+ * props
17
+ */
18
+ export type FloatingActionButtonProps = {
19
+ /**
20
+ * @description
21
+ * container
22
+ */
23
+ container?: PortalProps["container"];
24
+ /**
25
+ * @description
26
+ * children
27
+ */
28
+ children?: ReactNode;
29
+ };
30
+ /**
31
+ * @description
32
+ * floatable props
33
+ */
34
+ export type FloatableProps = {
35
+ /**
36
+ * @link {FloatingActionButtonProps.container}
37
+ */
38
+ container?: FloatingActionButtonProps["container"];
39
+ /**
40
+ * @description
41
+ * children
42
+ */
43
+ children?: ReactNode;
44
+ };
@@ -1,5 +1,5 @@
1
- import { FieldError } from "react-hook-form";
2
- import { ComponentProps } from "../../../types/element";
1
+ import { type FieldError } from "react-hook-form";
2
+ import type { ComponentProps } from "../../../types/element";
3
3
  import React from "react";
4
4
  type Props = ComponentProps & {
5
5
  /**
@@ -2,50 +2,64 @@ import React, { useEffect } from 'react';
2
2
  import { ComponentToken, FormClassToken } from '../../../utils/class-name.js';
3
3
  import clsx from 'clsx';
4
4
  import { useAnimate, usePresence } from 'framer-motion';
5
+ import _stylex from '../../../node_modules/.pnpm/@stylexjs_stylex@0.7.5/node_modules/@stylexjs/stylex/lib/es/stylex.js';
5
6
  import { useClassNames } from '../../../hooks/use-class-names.js';
7
+ import { useTheme } from '../../theme/hooks.js';
8
+ import { ColorToken } from '../../../utils/colors.js';
6
9
 
10
+ const styles = {
11
+ error: props => [{
12
+ paddingInline: "musae-1xkwav8",
13
+ paddingStart: null,
14
+ paddingLeft: null,
15
+ paddingEnd: null,
16
+ paddingRight: null,
17
+ color: "musae-19dipnz",
18
+ height: "musae-qtp20y",
19
+ overflow: "musae-b3r6kr",
20
+ overflowX: null,
21
+ overflowY: null,
22
+ $$css: true
23
+ }, {
24
+ "--color": props.color != null ? props.color : "initial"
25
+ }]
26
+ };
7
27
  const Error = ({
8
28
  error,
9
29
  className,
10
30
  style
11
31
  }) => {
12
32
  const classNames = useClassNames(ComponentToken.Form);
13
- const styled = {
14
- className: "musae-1xkwav8 musae-1p848mt musae-ri8twg"
15
- };
16
33
  const [scope, animate] = useAnimate();
17
34
  const [isPresent, safeToRemove] = usePresence();
35
+ const theme = useTheme();
18
36
  useEffect(() => {
19
37
  if (isPresent) {
20
- const enter = async () => {
21
- await animate(scope.current, {
22
- height: "auto"
23
- }, {
24
- duration: 0.1
25
- });
26
- };
27
- enter();
28
- return;
29
- }
30
- const exit = async () => {
31
- await animate(scope.current, {
32
- height: 0
38
+ animate(scope.current, {
39
+ height: "auto"
33
40
  }, {
34
- duration: 0.1
41
+ duration: 0.2
35
42
  });
43
+ return;
44
+ }
45
+ animate(scope.current, {
46
+ height: 0
47
+ }).then(() => {
36
48
  safeToRemove();
37
- };
38
- exit();
49
+ });
39
50
  // eslint-disable-next-line react-hooks/exhaustive-deps
40
51
  }, [isPresent]);
52
+ const styled = _stylex.props(styles.error({
53
+ color: theme.colors[ColorToken.Error]
54
+ }));
41
55
  return React.createElement("div", {
42
56
  className: clsx(classNames[FormClassToken.FieldError], className, styled.className),
43
57
  style: {
44
- ...style,
45
- ...styled.style
58
+ ...styled.style,
59
+ ...style
46
60
  },
47
61
  ref: scope
48
- }, error?.message);
62
+ }, React.createElement("p", null, error?.message));
49
63
  };
50
64
 
51
65
  export { Error as default };
@@ -2,10 +2,8 @@ import React, { useMemo, isValidElement, cloneElement } from 'react';
2
2
  import { useController } from 'react-hook-form';
3
3
  import { chain, isRefable } from '@aiszlab/relax';
4
4
  import { ComponentToken, FormClassToken } from '../../../utils/class-name.js';
5
- import { props } from '../../../node_modules/.pnpm/@stylexjs_stylex@0.6.1/node_modules/@stylexjs/stylex/lib/es/stylex.js';
5
+ import { props } from '../../../node_modules/.pnpm/@stylexjs_stylex@0.7.5/node_modules/@stylexjs/stylex/lib/es/stylex.js';
6
6
  import clsx from 'clsx';
7
- import { useTheme } from '../../theme/hooks.js';
8
- import { ColorToken } from '../../../utils/colors.js';
9
7
  import Layout from './layout.js';
10
8
  import Error from './error.js';
11
9
  import { AnimatePresence } from 'framer-motion';
@@ -13,18 +11,9 @@ import { typography } from '../../theme/theme.js';
13
11
  import { useClassNames } from '../../../hooks/use-class-names.js';
14
12
 
15
13
  const styles = {
16
- error: props => [{
17
- color: "musae-19dipnz",
18
- overflow: "musae-b3r6kr",
19
- overflowX: null,
20
- overflowY: null,
21
- $$css: true
22
- }, {
23
- "--color": props.color != null ? props.color : "initial"
24
- }],
25
14
  supporting: {
26
15
  minHeight: "musae-1sal0kv",
27
- paddingBottom: "musae-78w2x6",
16
+ paddingBlock: "musae-ovjknk",
28
17
  $$css: true
29
18
  }
30
19
  };
@@ -39,7 +28,6 @@ const Field = ({
39
28
  ...props$1
40
29
  }) => {
41
30
  const classNames = useClassNames(ComponentToken.Form);
42
- const theme = useTheme();
43
31
  const {
44
32
  field: {
45
33
  onBlur,
@@ -82,9 +70,6 @@ const Field = ({
82
70
  });
83
71
  }, [_children, name, value, invalid, ref, onChange, onBlur]);
84
72
  const styled = {
85
- error: props(styles.error({
86
- color: theme.colors[ColorToken.Error]
87
- })),
88
73
  supporting: props(styles.supporting, typography.body.small)
89
74
  };
90
75
  return React.createElement("div", {
@@ -95,10 +80,10 @@ const Field = ({
95
80
  }, React.createElement("div", null, children), React.createElement("div", {
96
81
  className: clsx(classNames[FormClassToken.FieldSupporting], styled.supporting.className),
97
82
  style: styled.supporting.style
98
- }, React.createElement(AnimatePresence, null, invalid && React.createElement(Error, {
99
- error: error,
100
- className: styled.error.className,
101
- style: styled.error.style
83
+ }, React.createElement(AnimatePresence, {
84
+ mode: "wait"
85
+ }, invalid && React.createElement(Error, {
86
+ error: error
102
87
  })))));
103
88
  };
104
89
 
@@ -1,7 +1,7 @@
1
1
  import React, { useContext } from 'react';
2
2
  import Context from '../context.js';
3
3
  import { Grid } from '../../grid/index.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.5/node_modules/@stylexjs/stylex/lib/es/stylex.js';
5
5
  import { typography } from '../../theme/theme.js';
6
6
  import { useTheme } from '../../theme/hooks.js';
7
7
  import { ColorToken } from '../../../utils/colors.js';