@auth0/quantum-product 2.10.2 → 2.10.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/command-palette/command-palette-classes.d.ts +5 -0
- package/command-palette/command-palette-classes.js +34 -0
- package/command-palette/command-palette-context.d.ts +8 -0
- package/command-palette/command-palette-context.js +61 -0
- package/command-palette/command-palette-dialog.d.ts +3 -0
- package/command-palette/command-palette-dialog.js +112 -0
- package/command-palette/command-palette-empty.d.ts +3 -0
- package/command-palette/command-palette-empty.js +90 -0
- package/command-palette/command-palette-footer.d.ts +4 -0
- package/command-palette/command-palette-footer.js +111 -0
- package/command-palette/command-palette-group.d.ts +3 -0
- package/command-palette/command-palette-group.js +118 -0
- package/command-palette/command-palette-input.d.ts +3 -0
- package/command-palette/command-palette-input.js +144 -0
- package/command-palette/command-palette-item.d.ts +3 -0
- package/command-palette/command-palette-item.js +235 -0
- package/command-palette/command-palette-list.d.ts +3 -0
- package/command-palette/command-palette-list.js +101 -0
- package/command-palette/command-palette-loading.d.ts +3 -0
- package/command-palette/command-palette-loading.js +89 -0
- package/command-palette/command-palette-score.d.ts +1 -0
- package/command-palette/command-palette-score.js +47 -0
- package/command-palette/command-palette-separator.d.ts +3 -0
- package/command-palette/command-palette-separator.js +86 -0
- package/command-palette/command-palette-tabs.d.ts +4 -0
- package/command-palette/command-palette-tabs.js +146 -0
- package/command-palette/command-palette-types.d.ts +121 -0
- package/command-palette/command-palette-types.js +2 -0
- package/command-palette/command-palette.d.ts +5 -0
- package/command-palette/command-palette.js +474 -0
- package/command-palette/index.d.ts +27 -0
- package/command-palette/index.js +36 -0
- package/command-palette/use-command-palette-shortcut.d.ts +6 -0
- package/command-palette/use-command-palette-shortcut.js +65 -0
- package/esm/command-palette/command-palette-classes.js +30 -0
- package/esm/command-palette/command-palette-context.js +22 -0
- package/esm/command-palette/command-palette-dialog.js +73 -0
- package/esm/command-palette/command-palette-empty.js +51 -0
- package/esm/command-palette/command-palette-footer.js +72 -0
- package/esm/command-palette/command-palette-group.js +79 -0
- package/esm/command-palette/command-palette-input.js +105 -0
- package/esm/command-palette/command-palette-item.js +196 -0
- package/esm/command-palette/command-palette-list.js +62 -0
- package/esm/command-palette/command-palette-loading.js +50 -0
- package/esm/command-palette/command-palette-score.js +44 -0
- package/esm/command-palette/command-palette-separator.js +47 -0
- package/esm/command-palette/command-palette-tabs.js +107 -0
- package/esm/command-palette/command-palette-types.js +1 -0
- package/esm/command-palette/command-palette.js +435 -0
- package/esm/command-palette/index.js +14 -0
- package/esm/command-palette/use-command-palette-shortcut.js +29 -0
- package/esm/index.js +1 -0
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export { CommandPalette } from './command-palette';
|
|
2
|
+
export { CommandPaletteInput } from './command-palette-input';
|
|
3
|
+
export { CommandPaletteList } from './command-palette-list';
|
|
4
|
+
export { CommandPaletteGroup } from './command-palette-group';
|
|
5
|
+
export { CommandPaletteItem } from './command-palette-item';
|
|
6
|
+
export { CommandPaletteTab, CommandPaletteTabs } from './command-palette-tabs';
|
|
7
|
+
export { CommandPaletteSeparator } from './command-palette-separator';
|
|
8
|
+
export { CommandPaletteEmpty } from './command-palette-empty';
|
|
9
|
+
export { CommandPaletteLoading } from './command-palette-loading';
|
|
10
|
+
export { CommandPaletteDialog } from './command-palette-dialog';
|
|
11
|
+
export { CommandPaletteFooter, CommandPaletteShortcutKey } from './command-palette-footer';
|
|
12
|
+
export { commandPaletteClasses, commandPaletteComponentName } from './command-palette-classes';
|
|
13
|
+
export { useCommandPaletteShortcut } from './use-command-palette-shortcut';
|
|
14
|
+
export { CommandPaletteContext, useCommandPaletteContext, useCommandPaletteState } from './command-palette-context';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export function useCommandPaletteShortcut(setOpen, shortcut) {
|
|
3
|
+
if (shortcut === void 0) { shortcut = { key: 'k', metaKey: true }; }
|
|
4
|
+
var setOpenRef = React.useRef(setOpen);
|
|
5
|
+
setOpenRef.current = setOpen;
|
|
6
|
+
var shortcutRef = React.useRef(shortcut);
|
|
7
|
+
shortcutRef.current = shortcut;
|
|
8
|
+
React.useEffect(function () {
|
|
9
|
+
var handleKeyDown = function (e) {
|
|
10
|
+
var target = e.target;
|
|
11
|
+
if (target.tagName === 'INPUT' ||
|
|
12
|
+
target.tagName === 'TEXTAREA' ||
|
|
13
|
+
target.tagName === 'SELECT' ||
|
|
14
|
+
target.isContentEditable) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
var s = shortcutRef.current;
|
|
18
|
+
var matchesMeta = e.metaKey === !!s.metaKey;
|
|
19
|
+
var matchesCtrl = e.ctrlKey === !!s.ctrlKey;
|
|
20
|
+
var matchesKey = e.key.toLowerCase() === s.key.toLowerCase();
|
|
21
|
+
if (matchesMeta && matchesCtrl && matchesKey) {
|
|
22
|
+
e.preventDefault();
|
|
23
|
+
setOpenRef.current(function (prev) { return !prev; });
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
document.addEventListener('keydown', handleKeyDown);
|
|
27
|
+
return function () { return document.removeEventListener('keydown', handleKeyDown); };
|
|
28
|
+
}, []);
|
|
29
|
+
}
|
package/esm/index.js
CHANGED
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -34,6 +34,7 @@ __exportStar(require("./chip"), exports);
|
|
|
34
34
|
__exportStar(require("./code"), exports);
|
|
35
35
|
__exportStar(require("./collapse"), exports);
|
|
36
36
|
__exportStar(require("./color-text-field"), exports);
|
|
37
|
+
__exportStar(require("./command-palette"), exports);
|
|
37
38
|
__exportStar(require("./column-layout"), exports);
|
|
38
39
|
__exportStar(require("./config-block"), exports);
|
|
39
40
|
__exportStar(require("./content"), exports);
|