@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.
Files changed (55) hide show
  1. package/command-palette/command-palette-classes.d.ts +5 -0
  2. package/command-palette/command-palette-classes.js +34 -0
  3. package/command-palette/command-palette-context.d.ts +8 -0
  4. package/command-palette/command-palette-context.js +61 -0
  5. package/command-palette/command-palette-dialog.d.ts +3 -0
  6. package/command-palette/command-palette-dialog.js +112 -0
  7. package/command-palette/command-palette-empty.d.ts +3 -0
  8. package/command-palette/command-palette-empty.js +90 -0
  9. package/command-palette/command-palette-footer.d.ts +4 -0
  10. package/command-palette/command-palette-footer.js +111 -0
  11. package/command-palette/command-palette-group.d.ts +3 -0
  12. package/command-palette/command-palette-group.js +118 -0
  13. package/command-palette/command-palette-input.d.ts +3 -0
  14. package/command-palette/command-palette-input.js +144 -0
  15. package/command-palette/command-palette-item.d.ts +3 -0
  16. package/command-palette/command-palette-item.js +235 -0
  17. package/command-palette/command-palette-list.d.ts +3 -0
  18. package/command-palette/command-palette-list.js +101 -0
  19. package/command-palette/command-palette-loading.d.ts +3 -0
  20. package/command-palette/command-palette-loading.js +89 -0
  21. package/command-palette/command-palette-score.d.ts +1 -0
  22. package/command-palette/command-palette-score.js +47 -0
  23. package/command-palette/command-palette-separator.d.ts +3 -0
  24. package/command-palette/command-palette-separator.js +86 -0
  25. package/command-palette/command-palette-tabs.d.ts +4 -0
  26. package/command-palette/command-palette-tabs.js +146 -0
  27. package/command-palette/command-palette-types.d.ts +121 -0
  28. package/command-palette/command-palette-types.js +2 -0
  29. package/command-palette/command-palette.d.ts +5 -0
  30. package/command-palette/command-palette.js +474 -0
  31. package/command-palette/index.d.ts +27 -0
  32. package/command-palette/index.js +36 -0
  33. package/command-palette/use-command-palette-shortcut.d.ts +6 -0
  34. package/command-palette/use-command-palette-shortcut.js +65 -0
  35. package/esm/command-palette/command-palette-classes.js +30 -0
  36. package/esm/command-palette/command-palette-context.js +22 -0
  37. package/esm/command-palette/command-palette-dialog.js +73 -0
  38. package/esm/command-palette/command-palette-empty.js +51 -0
  39. package/esm/command-palette/command-palette-footer.js +72 -0
  40. package/esm/command-palette/command-palette-group.js +79 -0
  41. package/esm/command-palette/command-palette-input.js +105 -0
  42. package/esm/command-palette/command-palette-item.js +196 -0
  43. package/esm/command-palette/command-palette-list.js +62 -0
  44. package/esm/command-palette/command-palette-loading.js +50 -0
  45. package/esm/command-palette/command-palette-score.js +44 -0
  46. package/esm/command-palette/command-palette-separator.js +47 -0
  47. package/esm/command-palette/command-palette-tabs.js +107 -0
  48. package/esm/command-palette/command-palette-types.js +1 -0
  49. package/esm/command-palette/command-palette.js +435 -0
  50. package/esm/command-palette/index.js +14 -0
  51. package/esm/command-palette/use-command-palette-shortcut.js +29 -0
  52. package/esm/index.js +1 -0
  53. package/index.d.ts +1 -0
  54. package/index.js +1 -0
  55. 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
@@ -18,6 +18,7 @@ export * from './chip';
18
18
  export * from './code';
19
19
  export * from './collapse';
20
20
  export * from './color-text-field';
21
+ export * from './command-palette';
21
22
  export * from './column-layout';
22
23
  export * from './config-block';
23
24
  export * from './content';
package/index.d.ts CHANGED
@@ -18,6 +18,7 @@ export * from './chip';
18
18
  export * from './code';
19
19
  export * from './collapse';
20
20
  export * from './color-text-field';
21
+ export * from './command-palette';
21
22
  export * from './column-layout';
22
23
  export * from './config-block';
23
24
  export * from './content';
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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@auth0/quantum-product",
3
- "version": "2.10.2",
3
+ "version": "2.10.3",
4
4
  "sideEffects": false,
5
5
  "license": "Apache-2.0",
6
6
  "publishConfig": {