@mijn-ui/react-command 0.0.17 → 0.0.19

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 CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  A command palette for quick access to actions and navigation, often used for keyboard shortcuts.
4
4
 
5
- [Documentation](https://mijn-ui.vercel.app/docs/components/command)
5
+ [Documentation](https://mijn-ui.vercel.app/react/docs/components/command)
6
6
 
7
7
  ## Installation
8
8
 
package/dist/index.d.ts CHANGED
@@ -1,10 +1,177 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as tailwind_variants from 'tailwind-variants';
3
+ import * as tailwind_merge from 'tailwind-merge';
4
+ import * as _mijn_ui_react_theme from '@mijn-ui/react-theme';
5
+ import { UnstyledProps, UnstyledComponentWithSlots, CommandSlots } from '@mijn-ui/react-theme';
2
6
  import * as React from 'react';
3
7
  import { DialogProps } from '@mijn-ui/react-dialog';
4
- import { UnstyledComponentWithSlots, CommandSlots, UnstyledProps } from '@mijn-ui/react-theme';
5
8
  import { Command as Command$1 } from 'cmdk';
6
9
 
7
10
  type CommandBaseProps = UnstyledComponentWithSlots<CommandSlots>;
11
+ declare const useCommandStyles: (unstyledOverride?: boolean) => {
12
+ classNames: _mijn_ui_react_theme.SlotsToClasses<"base" | "dialogWrapper" | "dialog" | "list" | "group" | "separator" | "item" | "input" | "empty" | "shortcut"> | undefined;
13
+ isUnstyled: boolean | undefined;
14
+ base: (slotProps?: ({} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
15
+ [x: string]: string | number | undefined;
16
+ [x: number]: string | number | undefined;
17
+ } & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
18
+ [x: string]: string | number | undefined;
19
+ [x: number]: string | number | undefined;
20
+ } & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
21
+ [x: string]: string | number | undefined;
22
+ [x: number]: string | number | undefined;
23
+ } & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
24
+ [x: string]: string | number | undefined;
25
+ [x: number]: string | number | undefined;
26
+ } & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
27
+ [x: string]: string | number | undefined;
28
+ [x: number]: string | number | undefined;
29
+ } & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | undefined) => string | undefined;
30
+ dialogWrapper: (slotProps?: ({} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
31
+ [x: string]: string | number | undefined;
32
+ [x: number]: string | number | undefined;
33
+ } & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
34
+ [x: string]: string | number | undefined;
35
+ [x: number]: string | number | undefined;
36
+ } & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
37
+ [x: string]: string | number | undefined;
38
+ [x: number]: string | number | undefined;
39
+ } & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
40
+ [x: string]: string | number | undefined;
41
+ [x: number]: string | number | undefined;
42
+ } & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
43
+ [x: string]: string | number | undefined;
44
+ [x: number]: string | number | undefined;
45
+ } & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | undefined) => string | undefined;
46
+ dialog: (slotProps?: ({} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
47
+ [x: string]: string | number | undefined;
48
+ [x: number]: string | number | undefined;
49
+ } & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
50
+ [x: string]: string | number | undefined;
51
+ [x: number]: string | number | undefined;
52
+ } & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
53
+ [x: string]: string | number | undefined;
54
+ [x: number]: string | number | undefined;
55
+ } & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
56
+ [x: string]: string | number | undefined;
57
+ [x: number]: string | number | undefined;
58
+ } & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
59
+ [x: string]: string | number | undefined;
60
+ [x: number]: string | number | undefined;
61
+ } & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | undefined) => string | undefined;
62
+ list: (slotProps?: ({} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
63
+ [x: string]: string | number | undefined;
64
+ [x: number]: string | number | undefined;
65
+ } & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
66
+ [x: string]: string | number | undefined;
67
+ [x: number]: string | number | undefined;
68
+ } & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
69
+ [x: string]: string | number | undefined;
70
+ [x: number]: string | number | undefined;
71
+ } & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
72
+ [x: string]: string | number | undefined;
73
+ [x: number]: string | number | undefined;
74
+ } & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
75
+ [x: string]: string | number | undefined;
76
+ [x: number]: string | number | undefined;
77
+ } & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | undefined) => string | undefined;
78
+ group: (slotProps?: ({} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
79
+ [x: string]: string | number | undefined;
80
+ [x: number]: string | number | undefined;
81
+ } & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
82
+ [x: string]: string | number | undefined;
83
+ [x: number]: string | number | undefined;
84
+ } & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
85
+ [x: string]: string | number | undefined;
86
+ [x: number]: string | number | undefined;
87
+ } & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
88
+ [x: string]: string | number | undefined;
89
+ [x: number]: string | number | undefined;
90
+ } & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
91
+ [x: string]: string | number | undefined;
92
+ [x: number]: string | number | undefined;
93
+ } & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | undefined) => string | undefined;
94
+ separator: (slotProps?: ({} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
95
+ [x: string]: string | number | undefined;
96
+ [x: number]: string | number | undefined;
97
+ } & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
98
+ [x: string]: string | number | undefined;
99
+ [x: number]: string | number | undefined;
100
+ } & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
101
+ [x: string]: string | number | undefined;
102
+ [x: number]: string | number | undefined;
103
+ } & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
104
+ [x: string]: string | number | undefined;
105
+ [x: number]: string | number | undefined;
106
+ } & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
107
+ [x: string]: string | number | undefined;
108
+ [x: number]: string | number | undefined;
109
+ } & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | undefined) => string | undefined;
110
+ item: (slotProps?: ({} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
111
+ [x: string]: string | number | undefined;
112
+ [x: number]: string | number | undefined;
113
+ } & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
114
+ [x: string]: string | number | undefined;
115
+ [x: number]: string | number | undefined;
116
+ } & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
117
+ [x: string]: string | number | undefined;
118
+ [x: number]: string | number | undefined;
119
+ } & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
120
+ [x: string]: string | number | undefined;
121
+ [x: number]: string | number | undefined;
122
+ } & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
123
+ [x: string]: string | number | undefined;
124
+ [x: number]: string | number | undefined;
125
+ } & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | undefined) => string | undefined;
126
+ input: (slotProps?: ({} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
127
+ [x: string]: string | number | undefined;
128
+ [x: number]: string | number | undefined;
129
+ } & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
130
+ [x: string]: string | number | undefined;
131
+ [x: number]: string | number | undefined;
132
+ } & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
133
+ [x: string]: string | number | undefined;
134
+ [x: number]: string | number | undefined;
135
+ } & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
136
+ [x: string]: string | number | undefined;
137
+ [x: number]: string | number | undefined;
138
+ } & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
139
+ [x: string]: string | number | undefined;
140
+ [x: number]: string | number | undefined;
141
+ } & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | undefined) => string | undefined;
142
+ empty: (slotProps?: ({} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
143
+ [x: string]: string | number | undefined;
144
+ [x: number]: string | number | undefined;
145
+ } & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
146
+ [x: string]: string | number | undefined;
147
+ [x: number]: string | number | undefined;
148
+ } & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
149
+ [x: string]: string | number | undefined;
150
+ [x: number]: string | number | undefined;
151
+ } & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
152
+ [x: string]: string | number | undefined;
153
+ [x: number]: string | number | undefined;
154
+ } & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
155
+ [x: string]: string | number | undefined;
156
+ [x: number]: string | number | undefined;
157
+ } & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | undefined) => string | undefined;
158
+ shortcut: (slotProps?: ({} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
159
+ [x: string]: string | number | undefined;
160
+ [x: number]: string | number | undefined;
161
+ } & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
162
+ [x: string]: string | number | undefined;
163
+ [x: number]: string | number | undefined;
164
+ } & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
165
+ [x: string]: string | number | undefined;
166
+ [x: number]: string | number | undefined;
167
+ } & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
168
+ [x: string]: string | number | undefined;
169
+ [x: number]: string | number | undefined;
170
+ } & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
171
+ [x: string]: string | number | undefined;
172
+ [x: number]: string | number | undefined;
173
+ } & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | undefined) => string | undefined;
174
+ };
8
175
  type CommandProps = React.ComponentPropsWithRef<typeof Command$1> & CommandBaseProps;
9
176
  declare const Command: ({ className, classNames, unstyled, ...props }: CommandProps) => react_jsx_runtime.JSX.Element;
10
177
  type CommandDialogProps = Omit<DialogProps, "classNames"> & CommandBaseProps & {
@@ -26,4 +193,4 @@ declare const CommandItem: ({ className, unstyled, ...props }: CommandItemProps)
26
193
  type CommandShortcutProps = React.HTMLAttributes<HTMLSpanElement> & UnstyledProps;
27
194
  declare const CommandShortcut: ({ className, unstyled, ...props }: CommandShortcutProps) => react_jsx_runtime.JSX.Element;
28
195
 
29
- export { Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, type CommandProps, CommandSeparator, CommandShortcut };
196
+ export { Command, CommandDialog, type CommandDialogProps, CommandEmpty, type CommandEmptyProps, CommandGroup, type CommandGroupProps, CommandInput, type CommandInputProps, CommandItem, type CommandItemProps, CommandList, type CommandListProps, type CommandProps, CommandSeparator, type CommandSeparatorProps, CommandShortcut, type CommandShortcutProps, useCommandStyles };
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- "use client"
1
+ "use client";
2
2
 
3
3
  // src/command.tsx
4
4
  import { createTVUnstyledSlots } from "@mijn-ui/react-core";
@@ -9,9 +9,8 @@ import {
9
9
  commandStyles
10
10
  } from "@mijn-ui/react-theme";
11
11
  import { createContext } from "@mijn-ui/react-utilities";
12
- import { SearchIcon } from "@mijn-ui/shared-icons";
13
12
  import { Command as CommandPrimitive } from "cmdk";
14
- import { jsx, jsxs } from "react/jsx-runtime";
13
+ import { jsx } from "react/jsx-runtime";
15
14
  var [CommandProvider, useCommandContext] = createContext({
16
15
  name: "CommandContext",
17
16
  strict: true,
@@ -29,14 +28,11 @@ var Command = ({
29
28
  ...props
30
29
  }) => {
31
30
  const styles = commandStyles();
32
- const { command } = createTVUnstyledSlots(
33
- { command: styles.command },
34
- unstyled
35
- );
31
+ const { base } = createTVUnstyledSlots({ base: styles.base }, unstyled);
36
32
  return /* @__PURE__ */ jsx(CommandProvider, { value: { unstyled, styles, classNames }, children: /* @__PURE__ */ jsx(
37
33
  CommandPrimitive,
38
34
  {
39
- className: command({ className: cn(classNames?.command, className) }),
35
+ className: base({ className: cn(classNames?.base, className) }),
40
36
  ...props
41
37
  }
42
38
  ) });
@@ -49,24 +45,24 @@ var CommandDialog = ({
49
45
  ...props
50
46
  }) => {
51
47
  const styles = commandStyles();
52
- const { dialogContent, dialogCommand } = createTVUnstyledSlots(
48
+ const { dialogWrapper, dialog } = createTVUnstyledSlots(
53
49
  {
54
- dialogContent: styles.dialogContent,
55
- dialogCommand: styles.dialogCommand
50
+ dialogWrapper: styles.dialogWrapper,
51
+ dialog: styles.dialog
56
52
  },
57
53
  unstyled
58
54
  );
59
55
  return /* @__PURE__ */ jsx(CommandProvider, { value: { unstyled, styles, classNames }, children: /* @__PURE__ */ jsx(Dialog, { ...props, children: /* @__PURE__ */ jsx(
60
56
  DialogContent,
61
57
  {
62
- className: dialogContent({
63
- className: cn(classNames?.dialogContent)
58
+ className: dialogWrapper({
59
+ className: cn(classNames?.dialogWrapper)
64
60
  }),
65
61
  children: /* @__PURE__ */ jsx(
66
62
  Command,
67
63
  {
68
- className: dialogCommand({
69
- className: cn(classNames?.dialogCommand, className)
64
+ className: dialog({
65
+ className: cn(classNames?.dialog, className)
70
66
  }),
71
67
  children
72
68
  }
@@ -75,33 +71,14 @@ var CommandDialog = ({
75
71
  ) }) });
76
72
  };
77
73
  var CommandInput = ({ className, unstyled, ...props }) => {
78
- const { input, inputIcon, inputWrapper, classNames } = useCommandStyles(unstyled);
79
- return /* @__PURE__ */ jsxs(
80
- "div",
74
+ const { input, classNames } = useCommandStyles(unstyled);
75
+ return /* @__PURE__ */ jsx(
76
+ CommandPrimitive.Input,
81
77
  {
82
- className: inputWrapper({
83
- className: classNames?.inputWrapper
78
+ className: input({
79
+ className: cn(classNames?.input, className)
84
80
  }),
85
- "cmdk-input-wrapper": "",
86
- children: [
87
- /* @__PURE__ */ jsx(
88
- SearchIcon,
89
- {
90
- className: inputIcon({
91
- className: classNames?.inputIcon
92
- })
93
- }
94
- ),
95
- /* @__PURE__ */ jsx(
96
- CommandPrimitive.Input,
97
- {
98
- className: input({
99
- className: cn(classNames?.input, className)
100
- }),
101
- ...props
102
- }
103
- )
104
- ]
81
+ ...props
105
82
  }
106
83
  );
107
84
  };
@@ -194,5 +171,6 @@ export {
194
171
  CommandItem,
195
172
  CommandList,
196
173
  CommandSeparator,
197
- CommandShortcut
174
+ CommandShortcut,
175
+ useCommandStyles
198
176
  };
@@ -1 +1 @@
1
- {"inputs":{"src/command.tsx":{"bytes":8686,"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":"@mijn-ui/react-hooks","kind":"import-statement","external":true},{"path":"@mijn-ui/react-theme","kind":"import-statement","external":true},{"path":"@mijn-ui/react-utilities","kind":"import-statement","external":true},{"path":"@mijn-ui/shared-icons","kind":"import-statement","external":true},{"path":"cmdk","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":"@mijn-ui/react-hooks","kind":"import-statement","external":true},{"path":"@mijn-ui/react-theme","kind":"import-statement","external":true},{"path":"@mijn-ui/react-utilities","kind":"import-statement","external":true},{"path":"@mijn-ui/shared-icons","kind":"import-statement","external":true},{"path":"cmdk","kind":"import-statement","external":true},{"path":"react/jsx-runtime","kind":"import-statement","external":true}],"exports":["Command","CommandDialog","CommandEmpty","CommandGroup","CommandInput","CommandItem","CommandList","CommandSeparator","CommandShortcut"],"entryPoint":"src/index.ts","inputs":{"src/command.tsx":{"bytesInOutput":4764},"src/index.ts":{"bytesInOutput":0}},"bytes":4939}}}
1
+ {"inputs":{"src/command.tsx":{"bytes":8315,"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":"@mijn-ui/react-hooks","kind":"import-statement","external":true},{"path":"@mijn-ui/react-theme","kind":"import-statement","external":true},{"path":"@mijn-ui/react-utilities","kind":"import-statement","external":true},{"path":"cmdk","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":"@mijn-ui/react-hooks","kind":"import-statement","external":true},{"path":"@mijn-ui/react-theme","kind":"import-statement","external":true},{"path":"@mijn-ui/react-utilities","kind":"import-statement","external":true},{"path":"cmdk","kind":"import-statement","external":true},{"path":"react/jsx-runtime","kind":"import-statement","external":true}],"exports":["Command","CommandDialog","CommandEmpty","CommandGroup","CommandInput","CommandItem","CommandList","CommandSeparator","CommandShortcut","useCommandStyles"],"entryPoint":"src/index.ts","inputs":{"src/command.tsx":{"bytesInOutput":4187},"src/index.ts":{"bytesInOutput":0}},"bytes":4397}}}
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.0.17",
4
+ "version": "0.0.19",
5
5
  "homepage": "https://mijn-ui.vercel.app",
6
6
  "license": "MIT",
7
7
  "type": "module",
@@ -26,24 +26,25 @@
26
26
  "@next/eslint-plugin-next": "^15.0.3",
27
27
  "@types/react": "^19.0.0",
28
28
  "@types/react-dom": "^19.0.0",
29
- "@mijn-ui/react-core": "0.0.6",
30
- "@mijn-ui/react-theme": "0.0.11",
29
+ "@mijn-ui/react-core": "0.0.7",
30
+ "@mijn-ui/react-theme": "0.0.12",
31
+ "@mijn-ui/react-input": "0.0.16",
31
32
  "eslint-config-custom": "0.0.1",
32
33
  "tsconfig": "0.0.0",
33
34
  "tsup-config": "0.0.0"
34
35
  },
35
36
  "dependencies": {
36
37
  "cmdk": "^1.0.4",
37
- "@mijn-ui/react-dialog": "0.0.17",
38
+ "@mijn-ui/react-dialog": "0.0.19",
38
39
  "@mijn-ui/shared-icons": "0.0.4",
39
40
  "@mijn-ui/react-utilities": "0.0.9",
40
- "@mijn-ui/react-hooks": "0.0.14"
41
+ "@mijn-ui/react-hooks": "0.0.15"
41
42
  },
42
43
  "peerDependencies": {
43
44
  "react": "^19.0",
44
45
  "react-dom": "^19.0",
45
- "@mijn-ui/react-theme": "^0.0.11",
46
- "@mijn-ui/react-core": "^0.0.6"
46
+ "@mijn-ui/react-theme": "^0.0.12",
47
+ "@mijn-ui/react-core": "^0.0.7"
47
48
  },
48
49
  "publishConfig": {
49
50
  "access": "public"