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.
- package/README.md +4 -2
- package/dist/components/avatar/avatar.js +1 -1
- package/dist/components/breadcrumb/breadcrumb.js +1 -1
- package/dist/components/breadcrumb/item.js +1 -1
- package/dist/components/button/button.js +14 -16
- package/dist/components/calendar/calendar.js +1 -1
- package/dist/components/calendar/hooks.js +5 -5
- package/dist/components/checkbox/checkbox.d.ts +1 -1
- package/dist/components/checkbox/checkbox.js +205 -143
- package/dist/components/checkbox/group.d.ts +1 -1
- package/dist/components/checkbox/group.js +20 -19
- package/dist/components/checkbox/index.d.ts +2 -2
- package/dist/components/checkbox/types.d.ts +31 -4
- package/dist/components/clock/column.js +1 -1
- package/dist/components/collapse/collapse.js +1 -1
- package/dist/components/collapse/item.js +15 -9
- package/dist/components/date-picker/date-picker.js +1 -1
- package/dist/components/dialog/dialog.js +1 -1
- package/dist/components/dialog/popup.js +5 -5
- package/dist/components/divider/divider.js +1 -1
- package/dist/components/drawer/drawer.js +1 -1
- package/dist/components/drawer/popup.js +17 -17
- package/dist/components/empty/empty.js +1 -1
- package/dist/components/floating-action-button/floatable.d.ts +4 -0
- package/dist/components/floating-action-button/floatable.js +83 -0
- package/dist/components/floating-action-button/floating-action-button.d.ts +4 -0
- package/dist/components/floating-action-button/floating-action-button.js +26 -0
- package/dist/components/floating-action-button/index.d.ts +2 -0
- package/dist/components/floating-action-button/types.d.ts +44 -0
- package/dist/components/form/field/error.d.ts +2 -2
- package/dist/components/form/field/error.js +36 -22
- package/dist/components/form/field/field.js +6 -21
- package/dist/components/form/field/layout.js +1 -1
- package/dist/components/grid/col.js +1 -1
- package/dist/components/grid/row.js +1 -1
- package/dist/components/icon/icon.d.ts +1 -1
- package/dist/components/icon/icon.js +5 -3
- package/dist/components/icon/types.d.ts +6 -1
- package/dist/components/image/image.js +3 -2
- package/dist/components/image/preview/operations.js +5 -5
- package/dist/components/image/preview/preview.js +1 -1
- package/dist/components/input/input.d.ts +6 -6
- package/dist/components/input/input.js +9 -15
- package/dist/components/layout/header.js +2 -2
- package/dist/components/layout/layout.js +1 -1
- package/dist/components/loading/loading.js +2 -2
- package/dist/components/menu/group.js +29 -9
- package/dist/components/menu/hooks.js +1 -1
- package/dist/components/menu/item.js +1 -1
- package/dist/components/menu/menu.js +3 -1
- package/dist/components/notification/holder.js +14 -15
- package/dist/components/notification/notification.js +3 -3
- package/dist/components/otp-input/otp-input.js +1 -1
- package/dist/components/pagination/hooks.d.ts +4 -2
- package/dist/components/pagination/hooks.js +9 -4
- package/dist/components/pagination/item.js +6 -8
- package/dist/components/pagination/pagination.d.ts +1 -1
- package/dist/components/pagination/pagination.js +37 -9
- package/dist/components/pagination/types.d.ts +6 -0
- package/dist/components/picker/picker.js +2 -2
- package/dist/components/popover/popover.js +1 -1
- package/dist/components/popper/dropdown.js +3 -3
- package/dist/components/popper/popper.js +1 -1
- package/dist/components/portal/portal.js +6 -2
- package/dist/components/portal/types.d.ts +6 -0
- package/dist/components/progress/circular.js +1 -1
- package/dist/components/progress/linear.js +1 -1
- package/dist/components/radio/radio.js +1 -1
- package/dist/components/rate/rate.js +1 -1
- package/dist/components/rate/star.js +3 -3
- package/dist/components/ripple/ripple.js +1 -1
- package/dist/components/select/hooks.d.ts +1 -1
- package/dist/components/select/select.d.ts +1 -1
- package/dist/components/select/select.js +5 -5
- package/dist/components/select/selector.d.ts +3 -6
- package/dist/components/select/selector.js +16 -10
- package/dist/components/select/types.d.ts +3 -1
- package/dist/components/space/space.js +1 -1
- package/dist/components/steps/item.d.ts +1 -1
- package/dist/components/steps/item.js +77 -16
- package/dist/components/steps/steps.d.ts +1 -1
- package/dist/components/steps/steps.js +6 -4
- package/dist/components/steps/types.d.ts +15 -0
- package/dist/components/switch/switch.d.ts +1 -1
- package/dist/components/switch/switch.js +22 -22
- package/dist/components/table/body.js +1 -1
- package/dist/components/table/header/cell.js +3 -3
- package/dist/components/table/header/header.js +2 -2
- package/dist/components/tabs/hooks.d.ts +40 -0
- package/dist/components/tabs/hooks.js +98 -0
- package/dist/components/tabs/navigation.d.ts +4 -0
- package/dist/components/tabs/navigation.js +159 -0
- package/dist/components/tabs/panels.d.ts +4 -0
- package/dist/components/tabs/panels.js +78 -0
- package/dist/components/tabs/tab.d.ts +4 -0
- package/dist/components/tabs/tab.js +19 -0
- package/dist/components/tabs/tabs.d.ts +1 -1
- package/dist/components/tabs/tabs.js +24 -94
- package/dist/components/tabs/types.d.ts +50 -9
- package/dist/components/tag/tag.js +1 -1
- package/dist/components/theme/hooks.js +3 -3
- package/dist/components/theme/tokens.stylex.d.ts +1 -0
- package/dist/components/time-picker/panel.js +1 -1
- package/dist/components/time-picker/time-picker.js +1 -1
- package/dist/components/timeline/item.d.ts +1 -1
- package/dist/components/timeline/item.js +107 -119
- package/dist/components/timeline/timeline.d.ts +1 -1
- package/dist/components/timeline/timeline.js +8 -4
- package/dist/components/timeline/types.d.ts +16 -0
- package/dist/components/tour/tour.js +4 -3
- package/dist/components/transfer/context.d.ts +6 -0
- package/dist/components/transfer/context.js +11 -0
- package/dist/components/transfer/hooks.d.ts +19 -0
- package/dist/components/transfer/hooks.js +49 -0
- package/dist/components/transfer/index.d.ts +2 -0
- package/dist/components/transfer/item.d.ts +4 -0
- package/dist/components/transfer/item.js +25 -0
- package/dist/components/transfer/list.d.ts +4 -0
- package/dist/components/transfer/list.js +122 -0
- package/dist/components/transfer/transfer.d.ts +4 -0
- package/dist/components/transfer/transfer.js +82 -0
- package/dist/components/transfer/types.d.ts +83 -0
- package/dist/components/tree/context.js +2 -0
- package/dist/components/tree/hooks.d.ts +13 -2
- package/dist/components/tree/hooks.js +19 -2
- package/dist/components/tree/list.js +16 -9
- package/dist/components/tree/node.d.ts +1 -1
- package/dist/components/tree/node.js +24 -14
- package/dist/components/tree/tree.d.ts +1 -1
- package/dist/components/tree/tree.js +13 -9
- package/dist/components/tree/types.d.ts +18 -23
- package/dist/components/waterfall/sequential.js +4 -1
- package/dist/components/waterfall/waterfall.js +6 -3
- package/dist/hooks/use-class-names.d.ts +27 -1
- package/dist/hooks/use-container.d.ts +11 -0
- package/dist/hooks/use-container.js +23 -0
- package/dist/hooks/use-expandable.d.ts +11 -0
- package/dist/hooks/use-expandable.js +37 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/stylex.css +61 -40
- package/dist/utils/class-name.d.ts +96 -16
- package/dist/utils/class-name.js +69 -13
- package/package.json +21 -11
- package/dist/components/tabs/item.d.ts +0 -4
- package/dist/components/tabs/item.js +0 -22
- package/dist/hooks/use-expand-effect.d.ts +0 -12
- package/dist/hooks/use-expand-effect.js +0 -34
- /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
- /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
|
-
* @
|
|
77
|
+
* @default void 0
|
|
62
78
|
*/
|
|
63
|
-
value
|
|
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.
|
|
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.
|
|
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.
|
|
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 {
|
|
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-
|
|
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
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
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.
|
|
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
|
+
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.
|
|
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-
|
|
23
|
-
left: "musae-
|
|
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-
|
|
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.
|
|
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
|
+
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.
|
|
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-
|
|
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-
|
|
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-
|
|
64
|
+
right: "musae-3m8u43",
|
|
65
65
|
insetInlineStart: null,
|
|
66
66
|
insetInlineEnd: null,
|
|
67
|
-
top: "musae-
|
|
68
|
-
bottom: "musae-
|
|
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-
|
|
75
|
+
left: "musae-u96u03",
|
|
76
76
|
insetInlineStart: null,
|
|
77
77
|
insetInlineEnd: null,
|
|
78
|
-
top: "musae-
|
|
79
|
-
bottom: "musae-
|
|
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-
|
|
87
|
-
left: "musae-
|
|
86
|
+
bottom: "musae-1ey2m1c",
|
|
87
|
+
left: "musae-u96u03",
|
|
88
88
|
insetInlineStart: null,
|
|
89
89
|
insetInlineEnd: null,
|
|
90
|
-
right: "musae-
|
|
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-
|
|
98
|
-
left: "musae-
|
|
97
|
+
top: "musae-13vifvy",
|
|
98
|
+
left: "musae-u96u03",
|
|
99
99
|
insetInlineStart: null,
|
|
100
100
|
insetInlineEnd: null,
|
|
101
|
-
right: "musae-
|
|
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-
|
|
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.
|
|
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,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,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,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
|
-
|
|
21
|
-
|
|
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.
|
|
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
|
-
...
|
|
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.
|
|
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
|
-
|
|
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,
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
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.
|
|
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';
|