Skip to content

Commit f7aed34

Browse files
committed
Clean: command menu don't rely on close from dialog comp
1 parent 17d09cb commit f7aed34

File tree

4 files changed

+2
-12
lines changed

4 files changed

+2
-12
lines changed

packages/_site/src/pages/playground/command_menu_group.tsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,6 @@ const page_styles = stylex.create({
3535
gap: "1rem",
3636
},
3737

38-
close_pos: {
39-
top: "0.5rem",
40-
right: "0.5rem",
41-
},
42-
4338
p_tag: {
4439
background: "var(--color-bg-compliment)",
4540
padding: "0.5rem",
@@ -98,7 +93,6 @@ function CommandDialogDemo() {
9893
<CommandDialog
9994
open={open}
10095
onOpenChange={setOpen}
101-
closeExtend={page_styles.close_pos}
10296
>
10397
<CommandMenuPortion />
10498
</CommandDialog>

packages/_site/src/pages/playground/index.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ import CommandMenuGroup from "./command_menu_group";
3939
import LozengeGroup from "./lozenge_group";
4040
import CodeBlockGroup from "./code_block_group";
4141
import VisuallyHiddenGroup from "./visually_hidden_group";
42-
import { useEffect } from "react";
4342

4443
const page_styles = stylex.create({
4544
base: {

packages/command_menu/lib/index.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import { Command as CommandPrimitive } from "cmdk";
99
import { Dialog, DialogContent, DialogTitle } from "@controlkit/dialog";
1010

1111
type ExtendProps = { extend?: stylex.StyleXStyles };
12-
type CloseExtendProps = { closeExtend?: stylex.StyleXStyles };
1312

1413
const styles = stylex.create({
1514
command: {
@@ -140,16 +139,14 @@ interface CommandDialogProps extends DialogProps {}
140139
const CommandDialog = ({
141140
children,
142141
extend,
143-
closeExtend,
144142
...props
145-
}: CommandDialogProps & ExtendProps & CloseExtendProps) => {
143+
}: CommandDialogProps & ExtendProps) => {
146144
return (
147145
<Dialog {...props}>
148146
<DialogTitle extend={styles.dialog_title}>Command Menu Palette</DialogTitle>
149147

150148
<DialogContent
151149
{...stylex.props(styles.dialog_content)}
152-
closeExtend={closeExtend}
153150
>
154151
<Command {...stylex.props(extend)}>{children}</Command>
155152
</DialogContent>

packages/command_menu/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@controlkit/command-menu",
3-
"version": "0.1.0",
3+
"version": "0.2.0",
44
"type": "module",
55
"module": "dist/index.js",
66
"types": "dist/lib/index.d.ts",

0 commit comments

Comments
 (0)