@mijn-ui/react-command 0.4.2 → 0.4.3

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/dist/index.d.ts CHANGED
@@ -259,8 +259,10 @@ type CommandProps = React.ComponentPropsWithRef<typeof Command$1> & CommandBaseP
259
259
  declare const Command: ({ className, classNames, unstyled, ...props }: CommandProps) => react_jsx_runtime.JSX.Element;
260
260
  type CommandDialogProps = Omit<DialogProps, "classNames"> & CommandBaseProps & {
261
261
  className?: string;
262
+ title?: string;
263
+ description?: string;
262
264
  };
263
- declare const CommandDialog: ({ children, className, classNames, unstyled, ...props }: CommandDialogProps) => react_jsx_runtime.JSX.Element;
265
+ declare const CommandDialog: ({ title, description, children, className, classNames, unstyled, ...props }: CommandDialogProps) => react_jsx_runtime.JSX.Element;
264
266
  type CommandInputProps = React.ComponentPropsWithRef<typeof Command$1.Input> & {
265
267
  unstyled?: boolean;
266
268
  };
package/dist/index.js CHANGED
@@ -7,10 +7,16 @@ import {
7
7
  createTVUnstyledSlots,
8
8
  useTVUnstyled
9
9
  } from "@mijn-ui/react-core";
10
- import { Dialog, DialogContent } from "@mijn-ui/react-dialog";
10
+ import {
11
+ Dialog,
12
+ DialogContent,
13
+ DialogDescription,
14
+ DialogHeader,
15
+ DialogTitle
16
+ } from "@mijn-ui/react-dialog";
11
17
  import { Command as CommandPrimitive } from "cmdk";
12
18
  import { tv } from "tailwind-variants";
13
- import { jsx } from "react/jsx-runtime";
19
+ import { jsx, jsxs } from "react/jsx-runtime";
14
20
  var commandStyles = tv({
15
21
  slots: {
16
22
  base: "border-outline-default bg-bg-default-alt text-fg-default flex size-full flex-col overflow-hidden rounded-md border",
@@ -46,12 +52,15 @@ var Command = ({
46
52
  return /* @__PURE__ */ jsx(CommandProvider, { value: { unstyled, styles, classNames }, children: /* @__PURE__ */ jsx(
47
53
  CommandPrimitive,
48
54
  {
55
+ "data-slot": "command",
49
56
  className: base({ className: cn(classNames?.base, className) }),
50
57
  ...props
51
58
  }
52
59
  ) });
53
60
  };
54
61
  var CommandDialog = ({
62
+ title = "Command Palette",
63
+ description = "Search for a command to run...",
55
64
  children,
56
65
  className,
57
66
  classNames,
@@ -66,29 +75,36 @@ var CommandDialog = ({
66
75
  },
67
76
  unstyled
68
77
  );
69
- return /* @__PURE__ */ jsx(CommandProvider, { value: { unstyled, styles, classNames }, children: /* @__PURE__ */ jsx(Dialog, { ...props, children: /* @__PURE__ */ jsx(
70
- DialogContent,
71
- {
72
- className: dialogWrapper({
73
- className: cn(classNames?.dialogWrapper)
74
- }),
75
- children: /* @__PURE__ */ jsx(
76
- Command,
77
- {
78
- className: dialog({
79
- className: cn(classNames?.dialog, className)
80
- }),
81
- children
82
- }
83
- )
84
- }
85
- ) }) });
78
+ return /* @__PURE__ */ jsx(CommandProvider, { value: { unstyled, styles, classNames }, children: /* @__PURE__ */ jsxs(Dialog, { ...props, children: [
79
+ /* @__PURE__ */ jsxs(DialogHeader, { className: "sr-only", children: [
80
+ /* @__PURE__ */ jsx(DialogTitle, { children: title }),
81
+ /* @__PURE__ */ jsx(DialogDescription, { children: description })
82
+ ] }),
83
+ /* @__PURE__ */ jsx(
84
+ DialogContent,
85
+ {
86
+ className: dialogWrapper({
87
+ className: cn(classNames?.dialogWrapper)
88
+ }),
89
+ children: /* @__PURE__ */ jsx(
90
+ Command,
91
+ {
92
+ className: dialog({
93
+ className: cn(classNames?.dialog, className)
94
+ }),
95
+ children
96
+ }
97
+ )
98
+ }
99
+ )
100
+ ] }) });
86
101
  };
87
102
  var CommandInput = ({ className, unstyled, ...props }) => {
88
103
  const { input, classNames } = useCommandStyles(unstyled);
89
104
  return /* @__PURE__ */ jsx(
90
105
  CommandPrimitive.Input,
91
106
  {
107
+ "data-slot": "command-input",
92
108
  className: input({
93
109
  className: cn(classNames?.input, className)
94
110
  }),
@@ -101,6 +117,7 @@ var CommandList = ({ className, unstyled, ...props }) => {
101
117
  return /* @__PURE__ */ jsx(
102
118
  CommandPrimitive.List,
103
119
  {
120
+ "data-slot": "command-list",
104
121
  className: list({
105
122
  className: cn(classNames?.list, className)
106
123
  }),
@@ -113,6 +130,7 @@ var CommandEmpty = ({ unstyled, className, ...props }) => {
113
130
  return /* @__PURE__ */ jsx(
114
131
  CommandPrimitive.Empty,
115
132
  {
133
+ "data-slot": "command-empty",
116
134
  className: empty({
117
135
  className: cn(classNames?.empty, className)
118
136
  }),
@@ -125,6 +143,7 @@ var CommandGroup = ({ className, unstyled, ...props }) => {
125
143
  return /* @__PURE__ */ jsx(
126
144
  CommandPrimitive.Group,
127
145
  {
146
+ "data-slot": "command-group",
128
147
  className: group({
129
148
  className: cn(classNames?.group, className)
130
149
  }),
@@ -141,6 +160,7 @@ var CommandSeparator = ({
141
160
  return /* @__PURE__ */ jsx(
142
161
  CommandPrimitive.Separator,
143
162
  {
163
+ "data-slot": "command-separator",
144
164
  className: separator({
145
165
  className: cn(classNames?.separator, className)
146
166
  }),
@@ -153,6 +173,7 @@ var CommandItem = ({ className, unstyled, ...props }) => {
153
173
  return /* @__PURE__ */ jsx(
154
174
  CommandPrimitive.Item,
155
175
  {
176
+ "data-slot": "command-item",
156
177
  className: item({
157
178
  className: cn(classNames?.item, className)
158
179
  }),
@@ -169,6 +190,7 @@ var CommandShortcut = ({
169
190
  return /* @__PURE__ */ jsx(
170
191
  "span",
171
192
  {
193
+ "data-slot": "command-shortcut",
172
194
  className: shortcut({
173
195
  className: cn(classNames?.shortcut, className)
174
196
  }),
@@ -1 +1 @@
1
- {"inputs":{"src/command.tsx":{"bytes":9637,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@mijn-ui/react-core","kind":"import-statement","external":true},{"path":"@mijn-ui/react-dialog","kind":"import-statement","external":true},{"path":"cmdk","kind":"import-statement","external":true},{"path":"tailwind-variants","kind":"import-statement","external":true},{"path":"react/jsx-runtime","kind":"import-statement","external":true}],"format":"esm"},"src/index.ts":{"bytes":26,"imports":[{"path":"src/command.tsx","kind":"import-statement","original":"./command"}],"format":"esm"}},"outputs":{"dist/index.js":{"imports":[{"path":"@mijn-ui/react-core","kind":"import-statement","external":true},{"path":"@mijn-ui/react-dialog","kind":"import-statement","external":true},{"path":"cmdk","kind":"import-statement","external":true},{"path":"tailwind-variants","kind":"import-statement","external":true},{"path":"react/jsx-runtime","kind":"import-statement","external":true}],"exports":["Command","CommandDialog","CommandEmpty","CommandGroup","CommandInput","CommandItem","CommandList","CommandSeparator","CommandShortcut","commandStyles","useCommandStyles"],"entryPoint":"src/index.ts","inputs":{"src/command.tsx":{"bytesInOutput":5297},"src/index.ts":{"bytesInOutput":0}},"bytes":5524}}}
1
+ {"inputs":{"src/command.tsx":{"bytes":10257,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@mijn-ui/react-core","kind":"import-statement","external":true},{"path":"@mijn-ui/react-dialog","kind":"import-statement","external":true},{"path":"cmdk","kind":"import-statement","external":true},{"path":"tailwind-variants","kind":"import-statement","external":true},{"path":"react/jsx-runtime","kind":"import-statement","external":true}],"format":"esm"},"src/index.ts":{"bytes":26,"imports":[{"path":"src/command.tsx","kind":"import-statement","original":"./command"}],"format":"esm"}},"outputs":{"dist/index.js":{"imports":[{"path":"@mijn-ui/react-core","kind":"import-statement","external":true},{"path":"@mijn-ui/react-dialog","kind":"import-statement","external":true},{"path":"cmdk","kind":"import-statement","external":true},{"path":"tailwind-variants","kind":"import-statement","external":true},{"path":"react/jsx-runtime","kind":"import-statement","external":true}],"exports":["Command","CommandDialog","CommandEmpty","CommandGroup","CommandInput","CommandItem","CommandList","CommandSeparator","CommandShortcut","commandStyles","useCommandStyles"],"entryPoint":"src/index.ts","inputs":{"src/command.tsx":{"bytesInOutput":5986},"src/index.ts":{"bytesInOutput":0}},"bytes":6213}}}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mijn-ui/react-command",
3
3
  "author": "Htet Aung Lin<htetaunglin.coder@gmail.com>",
4
- "version": "0.4.2",
4
+ "version": "0.4.3",
5
5
  "homepage": "https://mijn-ui.vercel.app",
6
6
  "license": "MIT",
7
7
  "type": "module",
@@ -24,17 +24,17 @@
24
24
  "@types/react": "^19.0.0",
25
25
  "@types/react-dom": "^19.0.0",
26
26
  "lucide-react": "^0.479.0",
27
- "react": "19.0.0",
28
- "react-dom": "19.0.0",
27
+ "react": "19.0.1",
28
+ "react-dom": "19.0.1",
29
29
  "@mijn-ui/react-core": "0.5.0",
30
- "@mijn-ui/react-input": "0.4.1",
30
+ "@mijn-ui/react-input": "0.4.2",
31
31
  "eslint-config-custom": "0.0.1",
32
32
  "tsconfig": "0.0.0",
33
33
  "tsup-config": "0.0.0"
34
34
  },
35
35
  "dependencies": {
36
36
  "cmdk": "^1.0.4",
37
- "@mijn-ui/react-dialog": "0.4.2",
37
+ "@mijn-ui/react-dialog": "0.4.3",
38
38
  "@mijn-ui/shared-icons": "0.1.0"
39
39
  },
40
40
  "peerDependencies": {