@seed-design/react 0.1.4 → 0.1.5
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/lib/components/ActionSheet/ActionSheet.d.ts +66 -0
- package/lib/components/ActionSheet/ActionSheet.d.ts.map +1 -1
- package/lib/components/ExtendedActionSheet/ExtendedActionSheet.d.ts +72 -0
- package/lib/components/ExtendedActionSheet/ExtendedActionSheet.d.ts.map +1 -1
- package/lib/components/MenuSheet/MenuSheet.cjs +119 -0
- package/lib/components/MenuSheet/MenuSheet.d.ts +42 -0
- package/lib/components/MenuSheet/MenuSheet.d.ts.map +1 -0
- package/lib/components/MenuSheet/MenuSheet.js +85 -0
- package/lib/components/MenuSheet/MenuSheet.namespace.cjs +20 -0
- package/lib/components/MenuSheet/MenuSheet.namespace.d.ts +2 -0
- package/lib/components/MenuSheet/MenuSheet.namespace.d.ts.map +1 -0
- package/lib/components/MenuSheet/MenuSheet.namespace.js +1 -0
- package/lib/components/MenuSheet/index.cjs +22 -0
- package/lib/components/MenuSheet/index.d.ts +3 -0
- package/lib/components/MenuSheet/index.d.ts.map +1 -0
- package/lib/components/MenuSheet/index.js +3 -0
- package/lib/components/index.cjs +15 -0
- package/lib/components/index.d.ts +1 -0
- package/lib/components/index.d.ts.map +1 -1
- package/lib/components/index.js +3 -0
- package/lib/index.cjs +15 -0
- package/lib/index.js +3 -0
- package/package.json +3 -3
- package/src/components/ActionSheet/ActionSheet.tsx +66 -0
- package/src/components/ExtendedActionSheet/ExtendedActionSheet.tsx +72 -0
- package/src/components/MenuSheet/MenuSheet.namespace.ts +26 -0
- package/src/components/MenuSheet/MenuSheet.tsx +172 -0
- package/src/components/MenuSheet/index.ts +28 -0
- package/src/components/index.ts +1 -0
package/lib/index.cjs
CHANGED
|
@@ -50,6 +50,8 @@ const LoadingIndicator = require('./components/LoadingIndicator/LoadingIndicator
|
|
|
50
50
|
const MannerTemp = require('./components/MannerTemp/MannerTemp.cjs');
|
|
51
51
|
const MannerTempEmote = require('./components/MannerTemp/MannerTempEmote.cjs');
|
|
52
52
|
const MannerTempBadge = require('./components/MannerTempBadge/MannerTempBadge.cjs');
|
|
53
|
+
const MenuSheet = require('./components/MenuSheet/MenuSheet.cjs');
|
|
54
|
+
const MenuSheet_namespace = require('./components/MenuSheet/MenuSheet.namespace.cjs');
|
|
53
55
|
const NotificationBadge = require('./components/NotificationBadge/NotificationBadge.cjs');
|
|
54
56
|
const reactPortal = require('@seed-design/react-portal');
|
|
55
57
|
const ProgressCircle = require('./components/ProgressCircle/ProgressCircle.cjs');
|
|
@@ -213,6 +215,19 @@ exports.LoadingIndicator = LoadingIndicator.LoadingIndicator;
|
|
|
213
215
|
exports.MannerTemp = MannerTemp.MannerTemp;
|
|
214
216
|
exports.MannerTempEmote = MannerTempEmote.MannerTempEmote;
|
|
215
217
|
exports.MannerTempBadge = MannerTempBadge.MannerTempBadge;
|
|
218
|
+
exports.MenuSheetBackdrop = MenuSheet.MenuSheetBackdrop;
|
|
219
|
+
exports.MenuSheetCloseButton = MenuSheet.MenuSheetCloseButton;
|
|
220
|
+
exports.MenuSheetContent = MenuSheet.MenuSheetContent;
|
|
221
|
+
exports.MenuSheetFooter = MenuSheet.MenuSheetFooter;
|
|
222
|
+
exports.MenuSheetGroup = MenuSheet.MenuSheetGroup;
|
|
223
|
+
exports.MenuSheetHeader = MenuSheet.MenuSheetHeader;
|
|
224
|
+
exports.MenuSheetItem = MenuSheet.MenuSheetItem;
|
|
225
|
+
exports.MenuSheetList = MenuSheet.MenuSheetList;
|
|
226
|
+
exports.MenuSheetPositioner = MenuSheet.MenuSheetPositioner;
|
|
227
|
+
exports.MenuSheetRoot = MenuSheet.MenuSheetRoot;
|
|
228
|
+
exports.MenuSheetTitle = MenuSheet.MenuSheetTitle;
|
|
229
|
+
exports.MenuSheetTrigger = MenuSheet.MenuSheetTrigger;
|
|
230
|
+
exports.MenuSheet = MenuSheet_namespace;
|
|
216
231
|
exports.NotificationBadge = NotificationBadge.NotificationBadge;
|
|
217
232
|
exports.NotificationBadgePositioner = NotificationBadge.NotificationBadgePositioner;
|
|
218
233
|
Object.defineProperty(exports, "Portal", {
|
package/lib/index.js
CHANGED
|
@@ -59,6 +59,9 @@ export { LoadingIndicator } from './components/LoadingIndicator/LoadingIndicator
|
|
|
59
59
|
export { MannerTemp } from './components/MannerTemp/MannerTemp.js';
|
|
60
60
|
export { MannerTempEmote } from './components/MannerTemp/MannerTempEmote.js';
|
|
61
61
|
export { MannerTempBadge } from './components/MannerTempBadge/MannerTempBadge.js';
|
|
62
|
+
export { MenuSheetBackdrop, MenuSheetCloseButton, MenuSheetContent, MenuSheetFooter, MenuSheetGroup, MenuSheetHeader, MenuSheetItem, MenuSheetList, MenuSheetPositioner, MenuSheetRoot, MenuSheetTitle, MenuSheetTrigger } from './components/MenuSheet/MenuSheet.js';
|
|
63
|
+
import * as MenuSheet_namespace from './components/MenuSheet/MenuSheet.namespace.js';
|
|
64
|
+
export { MenuSheet_namespace as MenuSheet };
|
|
62
65
|
export { NotificationBadge, NotificationBadgePositioner } from './components/NotificationBadge/NotificationBadge.js';
|
|
63
66
|
export { Portal } from '@seed-design/react-portal';
|
|
64
67
|
export { ProgressCircleRange, ProgressCircleRoot, ProgressCircleTrack } from './components/ProgressCircle/ProgressCircle.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seed-design/react",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/daangn/seed-design.git",
|
|
@@ -58,12 +58,12 @@
|
|
|
58
58
|
"clsx": "^2.1.1"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
61
|
-
"@seed-design/css": "0.1.
|
|
61
|
+
"@seed-design/css": "0.1.5",
|
|
62
62
|
"react": ">=18.0.0",
|
|
63
63
|
"react-dom": ">=18.0.0"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
|
-
"@seed-design/css": "0.1.
|
|
66
|
+
"@seed-design/css": "0.1.5",
|
|
67
67
|
"@vitejs/plugin-react": "^4.4.1",
|
|
68
68
|
"ajv": "^8.17.1",
|
|
69
69
|
"globby": "^14.1.0",
|
|
@@ -16,8 +16,14 @@ const withStateProps = createWithStateProps([useDialogContext]);
|
|
|
16
16
|
|
|
17
17
|
////////////////////////////////////////////////////////////////////////////////////
|
|
18
18
|
|
|
19
|
+
/**
|
|
20
|
+
* @deprecated Use `MenuSheet` instead.
|
|
21
|
+
*/
|
|
19
22
|
export interface ActionSheetRootProps extends ActionSheetVariantProps, DialogPrimitive.RootProps {}
|
|
20
23
|
|
|
24
|
+
/**
|
|
25
|
+
* @deprecated Use `MenuSheet` instead.
|
|
26
|
+
*/
|
|
21
27
|
export const ActionSheetRoot = withRootProvider<ActionSheetRootProps>(DialogPrimitive.Root, {
|
|
22
28
|
defaultProps: {
|
|
23
29
|
lazyMount: true,
|
|
@@ -27,14 +33,26 @@ export const ActionSheetRoot = withRootProvider<ActionSheetRootProps>(DialogPrim
|
|
|
27
33
|
|
|
28
34
|
////////////////////////////////////////////////////////////////////////////////////
|
|
29
35
|
|
|
36
|
+
/**
|
|
37
|
+
* @deprecated Use `MenuSheet` instead.
|
|
38
|
+
*/
|
|
30
39
|
export interface ActionSheetTriggerProps extends DialogPrimitive.TriggerProps {}
|
|
31
40
|
|
|
41
|
+
/**
|
|
42
|
+
* @deprecated Use `MenuSheet` instead.
|
|
43
|
+
*/
|
|
32
44
|
export const ActionSheetTrigger = DialogPrimitive.Trigger;
|
|
33
45
|
|
|
34
46
|
////////////////////////////////////////////////////////////////////////////////////
|
|
35
47
|
|
|
48
|
+
/**
|
|
49
|
+
* @deprecated Use `MenuSheet` instead.
|
|
50
|
+
*/
|
|
36
51
|
export interface ActionSheetPositionerProps extends DialogPrimitive.PositionerProps {}
|
|
37
52
|
|
|
53
|
+
/**
|
|
54
|
+
* @deprecated Use `MenuSheet` instead.
|
|
55
|
+
*/
|
|
38
56
|
export const ActionSheetPositioner = withContext<HTMLDivElement, ActionSheetPositionerProps>(
|
|
39
57
|
DialogPrimitive.Positioner,
|
|
40
58
|
"positioner",
|
|
@@ -42,8 +60,14 @@ export const ActionSheetPositioner = withContext<HTMLDivElement, ActionSheetPosi
|
|
|
42
60
|
|
|
43
61
|
////////////////////////////////////////////////////////////////////////////////////
|
|
44
62
|
|
|
63
|
+
/**
|
|
64
|
+
* @deprecated Use `MenuSheet` instead.
|
|
65
|
+
*/
|
|
45
66
|
export interface ActionSheetBackdropProps extends DialogPrimitive.BackdropProps {}
|
|
46
67
|
|
|
68
|
+
/**
|
|
69
|
+
* @deprecated Use `MenuSheet` instead.
|
|
70
|
+
*/
|
|
47
71
|
export const ActionSheetBackdrop = withContext<HTMLDivElement, ActionSheetBackdropProps>(
|
|
48
72
|
DialogPrimitive.Backdrop,
|
|
49
73
|
"backdrop",
|
|
@@ -51,8 +75,14 @@ export const ActionSheetBackdrop = withContext<HTMLDivElement, ActionSheetBackdr
|
|
|
51
75
|
|
|
52
76
|
////////////////////////////////////////////////////////////////////////////////////
|
|
53
77
|
|
|
78
|
+
/**
|
|
79
|
+
* @deprecated Use `MenuSheet` instead.
|
|
80
|
+
*/
|
|
54
81
|
export interface ActionSheetContentProps extends DialogPrimitive.ContentProps {}
|
|
55
82
|
|
|
83
|
+
/**
|
|
84
|
+
* @deprecated Use `MenuSheet` instead.
|
|
85
|
+
*/
|
|
56
86
|
export const ActionSheetContent = withContext<HTMLDivElement, ActionSheetContentProps>(
|
|
57
87
|
DialogPrimitive.Content,
|
|
58
88
|
"content",
|
|
@@ -60,10 +90,16 @@ export const ActionSheetContent = withContext<HTMLDivElement, ActionSheetContent
|
|
|
60
90
|
|
|
61
91
|
////////////////////////////////////////////////////////////////////////////////////
|
|
62
92
|
|
|
93
|
+
/**
|
|
94
|
+
* @deprecated Use `MenuSheet` instead.
|
|
95
|
+
*/
|
|
63
96
|
export interface ActionSheetHeaderProps
|
|
64
97
|
extends PrimitiveProps,
|
|
65
98
|
React.HTMLAttributes<HTMLDivElement> {}
|
|
66
99
|
|
|
100
|
+
/**
|
|
101
|
+
* @deprecated Use `MenuSheet` instead.
|
|
102
|
+
*/
|
|
67
103
|
export const ActionSheetHeader = withContext<HTMLDivElement, ActionSheetHeaderProps>(
|
|
68
104
|
withStateProps(Primitive.div),
|
|
69
105
|
"header",
|
|
@@ -71,8 +107,14 @@ export const ActionSheetHeader = withContext<HTMLDivElement, ActionSheetHeaderPr
|
|
|
71
107
|
|
|
72
108
|
////////////////////////////////////////////////////////////////////////////////////
|
|
73
109
|
|
|
110
|
+
/**
|
|
111
|
+
* @deprecated Use `MenuSheet` instead.
|
|
112
|
+
*/
|
|
74
113
|
export interface ActionSheetTitleProps extends DialogPrimitive.TitleProps {}
|
|
75
114
|
|
|
115
|
+
/**
|
|
116
|
+
* @deprecated Use `MenuSheet` instead.
|
|
117
|
+
*/
|
|
76
118
|
export const ActionSheetTitle = withContext<HTMLHeadingElement, ActionSheetTitleProps>(
|
|
77
119
|
withStateProps(Primitive.h2),
|
|
78
120
|
"title",
|
|
@@ -80,8 +122,14 @@ export const ActionSheetTitle = withContext<HTMLHeadingElement, ActionSheetTitle
|
|
|
80
122
|
|
|
81
123
|
////////////////////////////////////////////////////////////////////////////////////
|
|
82
124
|
|
|
125
|
+
/**
|
|
126
|
+
* @deprecated Use `MenuSheet` instead.
|
|
127
|
+
*/
|
|
83
128
|
export interface ActionSheetDescriptionProps extends DialogPrimitive.DescriptionProps {}
|
|
84
129
|
|
|
130
|
+
/**
|
|
131
|
+
* @deprecated Use `MenuSheet` instead.
|
|
132
|
+
*/
|
|
85
133
|
export const ActionSheetDescription = withContext<
|
|
86
134
|
HTMLParagraphElement,
|
|
87
135
|
ActionSheetDescriptionProps
|
|
@@ -89,8 +137,14 @@ export const ActionSheetDescription = withContext<
|
|
|
89
137
|
|
|
90
138
|
////////////////////////////////////////////////////////////////////////////////////
|
|
91
139
|
|
|
140
|
+
/**
|
|
141
|
+
* @deprecated Use `MenuSheet` instead.
|
|
142
|
+
*/
|
|
92
143
|
export interface ActionSheetListProps extends React.HTMLAttributes<HTMLDivElement> {}
|
|
93
144
|
|
|
145
|
+
/**
|
|
146
|
+
* @deprecated Use `MenuSheet` instead.
|
|
147
|
+
*/
|
|
94
148
|
export const ActionSheetList = withContext<HTMLDivElement, ActionSheetListProps>(
|
|
95
149
|
withStateProps(Primitive.div),
|
|
96
150
|
"list",
|
|
@@ -98,19 +152,31 @@ export const ActionSheetList = withContext<HTMLDivElement, ActionSheetListProps>
|
|
|
98
152
|
|
|
99
153
|
////////////////////////////////////////////////////////////////////////////////////
|
|
100
154
|
|
|
155
|
+
/**
|
|
156
|
+
* @deprecated Use `MenuSheet` instead.
|
|
157
|
+
*/
|
|
101
158
|
export interface ActionSheetItemProps
|
|
102
159
|
extends PrimitiveProps,
|
|
103
160
|
ActionSheetItemVariantProps,
|
|
104
161
|
React.HTMLAttributes<HTMLButtonElement> {}
|
|
105
162
|
|
|
163
|
+
/**
|
|
164
|
+
* @deprecated Use `MenuSheet` instead.
|
|
165
|
+
*/
|
|
106
166
|
export const ActionSheetItem = withItemContext<HTMLButtonElement, ActionSheetItemProps>(
|
|
107
167
|
withStateProps(Primitive.button),
|
|
108
168
|
);
|
|
109
169
|
|
|
110
170
|
////////////////////////////////////////////////////////////////////////////////////
|
|
111
171
|
|
|
172
|
+
/**
|
|
173
|
+
* @deprecated Use `MenuSheet` instead.
|
|
174
|
+
*/
|
|
112
175
|
export interface ActionSheetCloseButtonProps extends DialogPrimitive.CloseButtonProps {}
|
|
113
176
|
|
|
177
|
+
/**
|
|
178
|
+
* @deprecated Use `MenuSheet` instead.
|
|
179
|
+
*/
|
|
114
180
|
export const ActionSheetCloseButton = withContext<HTMLDivElement, ActionSheetCloseButtonProps>(
|
|
115
181
|
DialogPrimitive.CloseButton,
|
|
116
182
|
"closeButton",
|
|
@@ -19,10 +19,16 @@ const withStateProps = createWithStateProps([useDialogContext]);
|
|
|
19
19
|
|
|
20
20
|
////////////////////////////////////////////////////////////////////////////////////
|
|
21
21
|
|
|
22
|
+
/**
|
|
23
|
+
* @deprecated Use `MenuSheet` instead.
|
|
24
|
+
*/
|
|
22
25
|
export interface ExtendedActionSheetRootProps
|
|
23
26
|
extends ExtendedActionSheetVariantProps,
|
|
24
27
|
DialogPrimitive.RootProps {}
|
|
25
28
|
|
|
29
|
+
/**
|
|
30
|
+
* @deprecated Use `MenuSheet` instead.
|
|
31
|
+
*/
|
|
26
32
|
export const ExtendedActionSheetRoot = withRootProvider<ExtendedActionSheetRootProps>(
|
|
27
33
|
DialogPrimitive.Root,
|
|
28
34
|
{
|
|
@@ -35,14 +41,26 @@ export const ExtendedActionSheetRoot = withRootProvider<ExtendedActionSheetRootP
|
|
|
35
41
|
|
|
36
42
|
////////////////////////////////////////////////////////////////////////////////////
|
|
37
43
|
|
|
44
|
+
/**
|
|
45
|
+
* @deprecated Use `MenuSheet` instead.
|
|
46
|
+
*/
|
|
38
47
|
export interface ExtendedActionSheetTriggerProps extends DialogPrimitive.TriggerProps {}
|
|
39
48
|
|
|
49
|
+
/**
|
|
50
|
+
* @deprecated Use `MenuSheet` instead.
|
|
51
|
+
*/
|
|
40
52
|
export const ExtendedActionSheetTrigger = DialogPrimitive.Trigger;
|
|
41
53
|
|
|
42
54
|
////////////////////////////////////////////////////////////////////////////////////
|
|
43
55
|
|
|
56
|
+
/**
|
|
57
|
+
* @deprecated Use `MenuSheet` instead.
|
|
58
|
+
*/
|
|
44
59
|
export interface ExtendedActionSheetPositionerProps extends DialogPrimitive.PositionerProps {}
|
|
45
60
|
|
|
61
|
+
/**
|
|
62
|
+
* @deprecated Use `MenuSheet` instead.
|
|
63
|
+
*/
|
|
46
64
|
export const ExtendedActionSheetPositioner = withContext<
|
|
47
65
|
HTMLDivElement,
|
|
48
66
|
ExtendedActionSheetPositionerProps
|
|
@@ -50,8 +68,14 @@ export const ExtendedActionSheetPositioner = withContext<
|
|
|
50
68
|
|
|
51
69
|
////////////////////////////////////////////////////////////////////////////////////
|
|
52
70
|
|
|
71
|
+
/**
|
|
72
|
+
* @deprecated Use `MenuSheet` instead.
|
|
73
|
+
*/
|
|
53
74
|
export interface ExtendedActionSheetBackdropProps extends DialogPrimitive.BackdropProps {}
|
|
54
75
|
|
|
76
|
+
/**
|
|
77
|
+
* @deprecated Use `MenuSheet` instead.
|
|
78
|
+
*/
|
|
55
79
|
export const ExtendedActionSheetBackdrop = withContext<
|
|
56
80
|
HTMLDivElement,
|
|
57
81
|
ExtendedActionSheetBackdropProps
|
|
@@ -59,8 +83,14 @@ export const ExtendedActionSheetBackdrop = withContext<
|
|
|
59
83
|
|
|
60
84
|
////////////////////////////////////////////////////////////////////////////////////
|
|
61
85
|
|
|
86
|
+
/**
|
|
87
|
+
* @deprecated Use `MenuSheet` instead.
|
|
88
|
+
*/
|
|
62
89
|
export interface ExtendedActionSheetContentProps extends DialogPrimitive.ContentProps {}
|
|
63
90
|
|
|
91
|
+
/**
|
|
92
|
+
* @deprecated Use `MenuSheet` instead.
|
|
93
|
+
*/
|
|
64
94
|
export const ExtendedActionSheetContent = withContext<
|
|
65
95
|
HTMLDivElement,
|
|
66
96
|
ExtendedActionSheetContentProps
|
|
@@ -68,10 +98,16 @@ export const ExtendedActionSheetContent = withContext<
|
|
|
68
98
|
|
|
69
99
|
////////////////////////////////////////////////////////////////////////////////////
|
|
70
100
|
|
|
101
|
+
/**
|
|
102
|
+
* @deprecated Use `MenuSheet` instead.
|
|
103
|
+
*/
|
|
71
104
|
export interface ExtendedActionSheetHeaderProps
|
|
72
105
|
extends PrimitiveProps,
|
|
73
106
|
React.HTMLAttributes<HTMLDivElement> {}
|
|
74
107
|
|
|
108
|
+
/**
|
|
109
|
+
* @deprecated Use `MenuSheet` instead.
|
|
110
|
+
*/
|
|
75
111
|
export const ExtendedActionSheetHeader = withContext<
|
|
76
112
|
HTMLDivElement,
|
|
77
113
|
ExtendedActionSheetHeaderProps
|
|
@@ -79,8 +115,14 @@ export const ExtendedActionSheetHeader = withContext<
|
|
|
79
115
|
|
|
80
116
|
////////////////////////////////////////////////////////////////////////////////////
|
|
81
117
|
|
|
118
|
+
/**
|
|
119
|
+
* @deprecated Use `MenuSheet` instead.
|
|
120
|
+
*/
|
|
82
121
|
export interface ExtendedActionSheetTitleProps extends DialogPrimitive.TitleProps {}
|
|
83
122
|
|
|
123
|
+
/**
|
|
124
|
+
* @deprecated Use `MenuSheet` instead.
|
|
125
|
+
*/
|
|
84
126
|
export const ExtendedActionSheetTitle = withContext<
|
|
85
127
|
HTMLHeadingElement,
|
|
86
128
|
ExtendedActionSheetTitleProps
|
|
@@ -88,10 +130,16 @@ export const ExtendedActionSheetTitle = withContext<
|
|
|
88
130
|
|
|
89
131
|
////////////////////////////////////////////////////////////////////////////////////
|
|
90
132
|
|
|
133
|
+
/**
|
|
134
|
+
* @deprecated Use `MenuSheet` instead.
|
|
135
|
+
*/
|
|
91
136
|
export interface ExtendedActionSheetListProps
|
|
92
137
|
extends PrimitiveProps,
|
|
93
138
|
React.HTMLAttributes<HTMLDivElement> {}
|
|
94
139
|
|
|
140
|
+
/**
|
|
141
|
+
* @deprecated Use `MenuSheet` instead.
|
|
142
|
+
*/
|
|
95
143
|
export const ExtendedActionSheetList = withContext<HTMLDivElement, ExtendedActionSheetListProps>(
|
|
96
144
|
withStateProps(Primitive.div),
|
|
97
145
|
"list",
|
|
@@ -99,8 +147,14 @@ export const ExtendedActionSheetList = withContext<HTMLDivElement, ExtendedActio
|
|
|
99
147
|
|
|
100
148
|
////////////////////////////////////////////////////////////////////////////////////
|
|
101
149
|
|
|
150
|
+
/**
|
|
151
|
+
* @deprecated Use `MenuSheet` instead.
|
|
152
|
+
*/
|
|
102
153
|
export interface ExtendedActionSheetGroupProps extends React.HTMLAttributes<HTMLDivElement> {}
|
|
103
154
|
|
|
155
|
+
/**
|
|
156
|
+
* @deprecated Use `MenuSheet` instead.
|
|
157
|
+
*/
|
|
104
158
|
export const ExtendedActionSheetGroup = withContext<HTMLDivElement, ExtendedActionSheetGroupProps>(
|
|
105
159
|
withStateProps(Primitive.div),
|
|
106
160
|
"group",
|
|
@@ -108,11 +162,17 @@ export const ExtendedActionSheetGroup = withContext<HTMLDivElement, ExtendedActi
|
|
|
108
162
|
|
|
109
163
|
////////////////////////////////////////////////////////////////////////////////////
|
|
110
164
|
|
|
165
|
+
/**
|
|
166
|
+
* @deprecated Use `MenuSheet` instead.
|
|
167
|
+
*/
|
|
111
168
|
export interface ExtendedActionSheetItemProps
|
|
112
169
|
extends PrimitiveProps,
|
|
113
170
|
ExtendedActionSheetItemVariantProps,
|
|
114
171
|
React.HTMLAttributes<HTMLButtonElement> {}
|
|
115
172
|
|
|
173
|
+
/**
|
|
174
|
+
* @deprecated Use `MenuSheet` instead.
|
|
175
|
+
*/
|
|
116
176
|
export const ExtendedActionSheetItem = withItemContext<
|
|
117
177
|
HTMLButtonElement,
|
|
118
178
|
ExtendedActionSheetItemProps
|
|
@@ -120,10 +180,16 @@ export const ExtendedActionSheetItem = withItemContext<
|
|
|
120
180
|
|
|
121
181
|
////////////////////////////////////////////////////////////////////////////////////
|
|
122
182
|
|
|
183
|
+
/**
|
|
184
|
+
* @deprecated Use `MenuSheet` instead.
|
|
185
|
+
*/
|
|
123
186
|
export interface ExtendedActionSheetFooterProps
|
|
124
187
|
extends PrimitiveProps,
|
|
125
188
|
React.HTMLAttributes<HTMLDivElement> {}
|
|
126
189
|
|
|
190
|
+
/**
|
|
191
|
+
* @deprecated Use `MenuSheet` instead.
|
|
192
|
+
*/
|
|
127
193
|
export const ExtendedActionSheetFooter = withContext<
|
|
128
194
|
HTMLDivElement,
|
|
129
195
|
ExtendedActionSheetFooterProps
|
|
@@ -131,8 +197,14 @@ export const ExtendedActionSheetFooter = withContext<
|
|
|
131
197
|
|
|
132
198
|
////////////////////////////////////////////////////////////////////////////////////
|
|
133
199
|
|
|
200
|
+
/**
|
|
201
|
+
* @deprecated Use `MenuSheet` instead.
|
|
202
|
+
*/
|
|
134
203
|
export interface ExtendedActionSheetCloseButtonProps extends DialogPrimitive.CloseButtonProps {}
|
|
135
204
|
|
|
205
|
+
/**
|
|
206
|
+
* @deprecated Use `MenuSheet` instead.
|
|
207
|
+
*/
|
|
136
208
|
export const ExtendedActionSheetCloseButton = withContext<
|
|
137
209
|
HTMLDivElement,
|
|
138
210
|
ExtendedActionSheetCloseButtonProps
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export {
|
|
2
|
+
MenuSheetBackdrop as Backdrop,
|
|
3
|
+
MenuSheetPositioner as Positioner,
|
|
4
|
+
MenuSheetContent as Content,
|
|
5
|
+
MenuSheetFooter as Footer,
|
|
6
|
+
MenuSheetHeader as Header,
|
|
7
|
+
MenuSheetRoot as Root,
|
|
8
|
+
MenuSheetTitle as Title,
|
|
9
|
+
MenuSheetTrigger as Trigger,
|
|
10
|
+
MenuSheetList as List,
|
|
11
|
+
MenuSheetGroup as Group,
|
|
12
|
+
MenuSheetItem as Item,
|
|
13
|
+
MenuSheetCloseButton as CloseButton,
|
|
14
|
+
type MenuSheetBackdropProps as BackdropProps,
|
|
15
|
+
type MenuSheetPositionerProps as PositionerProps,
|
|
16
|
+
type MenuSheetContentProps as ContentProps,
|
|
17
|
+
type MenuSheetFooterProps as FooterProps,
|
|
18
|
+
type MenuSheetHeaderProps as HeaderProps,
|
|
19
|
+
type MenuSheetRootProps as RootProps,
|
|
20
|
+
type MenuSheetTitleProps as TitleProps,
|
|
21
|
+
type MenuSheetTriggerProps as TriggerProps,
|
|
22
|
+
type MenuSheetListProps as ListProps,
|
|
23
|
+
type MenuSheetGroupProps as GroupProps,
|
|
24
|
+
type MenuSheetItemProps as ItemProps,
|
|
25
|
+
type MenuSheetCloseButtonProps as CloseButtonProps,
|
|
26
|
+
} from "./MenuSheet";
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { Dialog as DialogPrimitive, useDialogContext } from "@seed-design/react-dialog";
|
|
2
|
+
import { Primitive, type PrimitiveProps } from "@seed-design/react-primitive";
|
|
3
|
+
import { menuSheet, type MenuSheetVariantProps } from "@seed-design/css/recipes/menu-sheet";
|
|
4
|
+
import {
|
|
5
|
+
menuSheetItem,
|
|
6
|
+
type MenuSheetItemVariantProps,
|
|
7
|
+
} from "@seed-design/css/recipes/menu-sheet-item";
|
|
8
|
+
import * as React from "react";
|
|
9
|
+
import { createRecipeContext } from "../../utils/createRecipeContext";
|
|
10
|
+
import { createSlotRecipeContext } from "../../utils/createSlotRecipeContext";
|
|
11
|
+
import { createWithStateProps } from "../../utils/createWithStateProps";
|
|
12
|
+
|
|
13
|
+
const { withRootProvider, withContext } = createSlotRecipeContext(menuSheet);
|
|
14
|
+
const {
|
|
15
|
+
withContext: withItemContext,
|
|
16
|
+
PropsProvider: ItemPropsProvider,
|
|
17
|
+
useProps: useItemProps,
|
|
18
|
+
} = createRecipeContext(menuSheetItem);
|
|
19
|
+
const withStateProps = createWithStateProps([useDialogContext]);
|
|
20
|
+
|
|
21
|
+
////////////////////////////////////////////////////////////////////////////////////
|
|
22
|
+
|
|
23
|
+
export interface MenuSheetRootProps extends MenuSheetVariantProps, DialogPrimitive.RootProps {}
|
|
24
|
+
|
|
25
|
+
export const MenuSheetRoot = withRootProvider<MenuSheetRootProps>(DialogPrimitive.Root, {
|
|
26
|
+
defaultProps: {
|
|
27
|
+
lazyMount: true,
|
|
28
|
+
unmountOnExit: true,
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
////////////////////////////////////////////////////////////////////////////////////
|
|
33
|
+
|
|
34
|
+
export interface MenuSheetTriggerProps extends DialogPrimitive.TriggerProps {}
|
|
35
|
+
|
|
36
|
+
export const MenuSheetTrigger = DialogPrimitive.Trigger;
|
|
37
|
+
|
|
38
|
+
////////////////////////////////////////////////////////////////////////////////////
|
|
39
|
+
|
|
40
|
+
export interface MenuSheetPositionerProps extends DialogPrimitive.PositionerProps {}
|
|
41
|
+
|
|
42
|
+
export const MenuSheetPositioner = withContext<HTMLDivElement, MenuSheetPositionerProps>(
|
|
43
|
+
DialogPrimitive.Positioner,
|
|
44
|
+
"positioner",
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
////////////////////////////////////////////////////////////////////////////////////
|
|
48
|
+
|
|
49
|
+
export interface MenuSheetBackdropProps extends DialogPrimitive.BackdropProps {}
|
|
50
|
+
|
|
51
|
+
export const MenuSheetBackdrop = withContext<HTMLDivElement, MenuSheetBackdropProps>(
|
|
52
|
+
DialogPrimitive.Backdrop,
|
|
53
|
+
"backdrop",
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
////////////////////////////////////////////////////////////////////////////////////
|
|
57
|
+
|
|
58
|
+
export interface MenuSheetContentProps
|
|
59
|
+
extends DialogPrimitive.ContentProps,
|
|
60
|
+
Pick<MenuSheetItemVariantProps, "labelAlign"> {}
|
|
61
|
+
|
|
62
|
+
const MenuSheetContentBase = withContext<HTMLDivElement, DialogPrimitive.ContentProps>(
|
|
63
|
+
DialogPrimitive.Content,
|
|
64
|
+
"content",
|
|
65
|
+
);
|
|
66
|
+
|
|
67
|
+
export const MenuSheetContent = React.forwardRef<HTMLDivElement, MenuSheetContentProps>(
|
|
68
|
+
({ labelAlign, children, ...props }, ref) => {
|
|
69
|
+
return (
|
|
70
|
+
<ItemPropsProvider value={React.useMemo(() => ({ labelAlign }), [labelAlign])}>
|
|
71
|
+
<MenuSheetContentBase ref={ref} {...props}>
|
|
72
|
+
{children}
|
|
73
|
+
</MenuSheetContentBase>
|
|
74
|
+
</ItemPropsProvider>
|
|
75
|
+
);
|
|
76
|
+
},
|
|
77
|
+
);
|
|
78
|
+
|
|
79
|
+
////////////////////////////////////////////////////////////////////////////////////
|
|
80
|
+
|
|
81
|
+
export interface MenuSheetHeaderProps
|
|
82
|
+
extends PrimitiveProps,
|
|
83
|
+
React.HTMLAttributes<HTMLDivElement> {}
|
|
84
|
+
|
|
85
|
+
export const MenuSheetHeader = withContext<HTMLDivElement, MenuSheetHeaderProps>(
|
|
86
|
+
withStateProps(Primitive.div),
|
|
87
|
+
"header",
|
|
88
|
+
);
|
|
89
|
+
|
|
90
|
+
////////////////////////////////////////////////////////////////////////////////////
|
|
91
|
+
|
|
92
|
+
export interface MenuSheetTitleProps extends DialogPrimitive.TitleProps {}
|
|
93
|
+
|
|
94
|
+
export const MenuSheetTitle = withContext<HTMLHeadingElement, MenuSheetTitleProps>(
|
|
95
|
+
withStateProps(Primitive.h2),
|
|
96
|
+
"title",
|
|
97
|
+
);
|
|
98
|
+
|
|
99
|
+
////////////////////////////////////////////////////////////////////////////////////
|
|
100
|
+
|
|
101
|
+
export interface MenuSheetListProps extends PrimitiveProps, React.HTMLAttributes<HTMLDivElement> {}
|
|
102
|
+
|
|
103
|
+
export const MenuSheetList = withContext<HTMLDivElement, MenuSheetListProps>(
|
|
104
|
+
withStateProps(Primitive.div),
|
|
105
|
+
"list",
|
|
106
|
+
);
|
|
107
|
+
|
|
108
|
+
////////////////////////////////////////////////////////////////////////////////////
|
|
109
|
+
|
|
110
|
+
export interface MenuSheetGroupProps
|
|
111
|
+
extends React.HTMLAttributes<HTMLDivElement>,
|
|
112
|
+
Pick<MenuSheetItemVariantProps, "labelAlign"> {}
|
|
113
|
+
|
|
114
|
+
const MenuSheetGroupBase = withContext<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
|
|
115
|
+
withStateProps(Primitive.div),
|
|
116
|
+
"group",
|
|
117
|
+
);
|
|
118
|
+
|
|
119
|
+
export const MenuSheetGroup = React.forwardRef<HTMLDivElement, MenuSheetGroupProps>(
|
|
120
|
+
({ labelAlign: overriddenLabelAlign, children, ...props }, ref) => {
|
|
121
|
+
const parentProps = useItemProps();
|
|
122
|
+
const labelAlign = overriddenLabelAlign ?? parentProps?.labelAlign;
|
|
123
|
+
|
|
124
|
+
return (
|
|
125
|
+
<ItemPropsProvider value={React.useMemo(() => ({ labelAlign }), [labelAlign])}>
|
|
126
|
+
<MenuSheetGroupBase ref={ref} {...props}>
|
|
127
|
+
{children}
|
|
128
|
+
</MenuSheetGroupBase>
|
|
129
|
+
</ItemPropsProvider>
|
|
130
|
+
);
|
|
131
|
+
},
|
|
132
|
+
);
|
|
133
|
+
|
|
134
|
+
////////////////////////////////////////////////////////////////////////////////////
|
|
135
|
+
|
|
136
|
+
export interface MenuSheetItemProps
|
|
137
|
+
extends PrimitiveProps,
|
|
138
|
+
MenuSheetItemVariantProps,
|
|
139
|
+
React.HTMLAttributes<HTMLButtonElement> {}
|
|
140
|
+
|
|
141
|
+
const MenuSheetItemBase = withItemContext<HTMLButtonElement, MenuSheetItemProps>(
|
|
142
|
+
withStateProps(Primitive.button),
|
|
143
|
+
);
|
|
144
|
+
|
|
145
|
+
export const MenuSheetItem = React.forwardRef<HTMLButtonElement, MenuSheetItemProps>(
|
|
146
|
+
({ labelAlign: overriddenLabelAlign, ...props }, ref) => {
|
|
147
|
+
const parentProps = useItemProps();
|
|
148
|
+
const labelAlign = overriddenLabelAlign ?? parentProps?.labelAlign;
|
|
149
|
+
|
|
150
|
+
return <MenuSheetItemBase ref={ref} labelAlign={labelAlign} {...props} />;
|
|
151
|
+
},
|
|
152
|
+
);
|
|
153
|
+
|
|
154
|
+
////////////////////////////////////////////////////////////////////////////////////
|
|
155
|
+
|
|
156
|
+
export interface MenuSheetFooterProps
|
|
157
|
+
extends PrimitiveProps,
|
|
158
|
+
React.HTMLAttributes<HTMLDivElement> {}
|
|
159
|
+
|
|
160
|
+
export const MenuSheetFooter = withContext<HTMLDivElement, MenuSheetFooterProps>(
|
|
161
|
+
withStateProps(Primitive.div),
|
|
162
|
+
"footer",
|
|
163
|
+
);
|
|
164
|
+
|
|
165
|
+
////////////////////////////////////////////////////////////////////////////////////
|
|
166
|
+
|
|
167
|
+
export interface MenuSheetCloseButtonProps extends DialogPrimitive.CloseButtonProps {}
|
|
168
|
+
|
|
169
|
+
export const MenuSheetCloseButton = withContext<HTMLDivElement, MenuSheetCloseButtonProps>(
|
|
170
|
+
DialogPrimitive.CloseButton,
|
|
171
|
+
"closeButton",
|
|
172
|
+
);
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export {
|
|
2
|
+
MenuSheetBackdrop,
|
|
3
|
+
MenuSheetPositioner,
|
|
4
|
+
MenuSheetContent,
|
|
5
|
+
MenuSheetFooter,
|
|
6
|
+
MenuSheetHeader,
|
|
7
|
+
MenuSheetRoot,
|
|
8
|
+
MenuSheetTitle,
|
|
9
|
+
MenuSheetTrigger,
|
|
10
|
+
MenuSheetList,
|
|
11
|
+
MenuSheetGroup,
|
|
12
|
+
MenuSheetItem,
|
|
13
|
+
MenuSheetCloseButton,
|
|
14
|
+
type MenuSheetBackdropProps,
|
|
15
|
+
type MenuSheetPositionerProps,
|
|
16
|
+
type MenuSheetContentProps,
|
|
17
|
+
type MenuSheetFooterProps,
|
|
18
|
+
type MenuSheetHeaderProps,
|
|
19
|
+
type MenuSheetRootProps,
|
|
20
|
+
type MenuSheetTitleProps,
|
|
21
|
+
type MenuSheetTriggerProps,
|
|
22
|
+
type MenuSheetListProps,
|
|
23
|
+
type MenuSheetGroupProps,
|
|
24
|
+
type MenuSheetItemProps,
|
|
25
|
+
type MenuSheetCloseButtonProps,
|
|
26
|
+
} from "./MenuSheet";
|
|
27
|
+
|
|
28
|
+
export * as MenuSheet from "./MenuSheet.namespace";
|
package/src/components/index.ts
CHANGED
|
@@ -32,6 +32,7 @@ export * from "./LinkContent";
|
|
|
32
32
|
export * from "./LoadingIndicator";
|
|
33
33
|
export * from "./MannerTemp";
|
|
34
34
|
export * from "./MannerTempBadge";
|
|
35
|
+
export * from "./MenuSheet";
|
|
35
36
|
export * from "./NotificationBadge";
|
|
36
37
|
export * from "./Portal";
|
|
37
38
|
export * from "./ProgressCircle";
|