@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,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
+
}) : function(o, v) {
|
|
27
|
+
o["default"] = v;
|
|
28
|
+
});
|
|
29
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
30
|
+
var ownKeys = function(o) {
|
|
31
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
32
|
+
var ar = [];
|
|
33
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
34
|
+
return ar;
|
|
35
|
+
};
|
|
36
|
+
return ownKeys(o);
|
|
37
|
+
};
|
|
38
|
+
return function (mod) {
|
|
39
|
+
if (mod && mod.__esModule) return mod;
|
|
40
|
+
var result = {};
|
|
41
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
42
|
+
__setModuleDefault(result, mod);
|
|
43
|
+
return result;
|
|
44
|
+
};
|
|
45
|
+
})();
|
|
46
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
47
|
+
var t = {};
|
|
48
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
49
|
+
t[p] = s[p];
|
|
50
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
51
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
52
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
53
|
+
t[p[i]] = s[p[i]];
|
|
54
|
+
}
|
|
55
|
+
return t;
|
|
56
|
+
};
|
|
57
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
58
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
59
|
+
};
|
|
60
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
61
|
+
exports.CommandPaletteSeparator = void 0;
|
|
62
|
+
var React = __importStar(require("react"));
|
|
63
|
+
var styled_1 = require("../styled");
|
|
64
|
+
var clsx_1 = __importDefault(require("../utils/clsx"));
|
|
65
|
+
var command_palette_classes_1 = require("./command-palette-classes");
|
|
66
|
+
var command_palette_context_1 = require("./command-palette-context");
|
|
67
|
+
var Root = (0, styled_1.styled)('div', {
|
|
68
|
+
name: command_palette_classes_1.commandPaletteComponentName,
|
|
69
|
+
slot: 'Separator',
|
|
70
|
+
})(function (_a) {
|
|
71
|
+
var theme = _a.theme;
|
|
72
|
+
return ({
|
|
73
|
+
height: 1,
|
|
74
|
+
margin: "".concat(theme.spacing(0), " ").concat(theme.spacing(1.5)),
|
|
75
|
+
backgroundColor: theme.tokens.color_border_default,
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
exports.CommandPaletteSeparator = React.forwardRef(function (props, ref) {
|
|
79
|
+
var _a = props.alwaysRender, alwaysRender = _a === void 0 ? false : _a, className = props.className, separatorProps = __rest(props, ["alwaysRender", "className"]);
|
|
80
|
+
var search = (0, command_palette_context_1.useCommandPaletteState)(function (state) { return state.search; });
|
|
81
|
+
var isSearching = search.length > 0;
|
|
82
|
+
if (!alwaysRender && isSearching)
|
|
83
|
+
return null;
|
|
84
|
+
return (React.createElement(Root, __assign({ ref: ref, role: "separator", className: (0, clsx_1.default)(command_palette_classes_1.commandPaletteClasses.separator, className) }, separatorProps)));
|
|
85
|
+
});
|
|
86
|
+
exports.CommandPaletteSeparator.displayName = 'CommandPaletteSeparator';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { ICommandPaletteTabProps, ICommandPaletteTabsProps } from './command-palette-types';
|
|
3
|
+
export declare const CommandPaletteTabs: React.ForwardRefExoticComponent<ICommandPaletteTabsProps & React.RefAttributes<HTMLDivElement>>;
|
|
4
|
+
export declare const CommandPaletteTab: React.ForwardRefExoticComponent<ICommandPaletteTabProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
+
}) : function(o, v) {
|
|
27
|
+
o["default"] = v;
|
|
28
|
+
});
|
|
29
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
30
|
+
var ownKeys = function(o) {
|
|
31
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
32
|
+
var ar = [];
|
|
33
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
34
|
+
return ar;
|
|
35
|
+
};
|
|
36
|
+
return ownKeys(o);
|
|
37
|
+
};
|
|
38
|
+
return function (mod) {
|
|
39
|
+
if (mod && mod.__esModule) return mod;
|
|
40
|
+
var result = {};
|
|
41
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
42
|
+
__setModuleDefault(result, mod);
|
|
43
|
+
return result;
|
|
44
|
+
};
|
|
45
|
+
})();
|
|
46
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
47
|
+
var t = {};
|
|
48
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
49
|
+
t[p] = s[p];
|
|
50
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
51
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
52
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
53
|
+
t[p[i]] = s[p[i]];
|
|
54
|
+
}
|
|
55
|
+
return t;
|
|
56
|
+
};
|
|
57
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
58
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
59
|
+
};
|
|
60
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
61
|
+
exports.CommandPaletteTab = exports.CommandPaletteTabs = void 0;
|
|
62
|
+
var React = __importStar(require("react"));
|
|
63
|
+
var useForkRef_1 = __importDefault(require("@mui/utils/useForkRef"));
|
|
64
|
+
var styled_1 = require("../styled");
|
|
65
|
+
var clsx_1 = __importDefault(require("../utils/clsx"));
|
|
66
|
+
var command_palette_classes_1 = require("./command-palette-classes");
|
|
67
|
+
var Root = (0, styled_1.styled)('div', {
|
|
68
|
+
name: command_palette_classes_1.commandPaletteComponentName,
|
|
69
|
+
slot: 'Tabs',
|
|
70
|
+
})(function (_a) {
|
|
71
|
+
var theme = _a.theme;
|
|
72
|
+
return ({
|
|
73
|
+
display: 'flex',
|
|
74
|
+
alignItems: 'center',
|
|
75
|
+
gap: theme.spacing(0.5),
|
|
76
|
+
padding: "".concat(theme.spacing(1), " ").concat(theme.spacing(2)),
|
|
77
|
+
overflowX: 'auto',
|
|
78
|
+
scrollbarWidth: 'none',
|
|
79
|
+
'&::-webkit-scrollbar': {
|
|
80
|
+
display: 'none',
|
|
81
|
+
},
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
var TabButton = (0, styled_1.styled)('button', {
|
|
85
|
+
name: command_palette_classes_1.commandPaletteComponentName,
|
|
86
|
+
slot: 'Tab',
|
|
87
|
+
})(function (_a) {
|
|
88
|
+
var theme = _a.theme, ownerState = _a.ownerState;
|
|
89
|
+
return (__assign(__assign(__assign({ display: 'inline-flex', alignItems: 'center', justifyContent: 'center', padding: "".concat(theme.spacing(0.5), " ").concat(theme.spacing(1.5)), borderRadius: theme.spacing(1), border: 'none', cursor: 'pointer', fontSize: theme.typography.caption.fontSize, fontWeight: theme.typography.fontWeightSemibold, fontFamily: theme.typography.caption.fontFamily, lineHeight: theme.typography.caption.lineHeight, whiteSpace: 'nowrap', userSelect: 'none', transition: theme.transitions.create(['background-color', 'color'], {
|
|
90
|
+
duration: theme.transitions.duration.shortest,
|
|
91
|
+
}), color: theme.tokens.color_fg_disabled, backgroundColor: 'transparent' }, (ownerState.active && {
|
|
92
|
+
color: theme.tokens.color_fg_default,
|
|
93
|
+
backgroundColor: theme.tokens.color_bg_state_neutral_subtle,
|
|
94
|
+
})), (!ownerState.active && {
|
|
95
|
+
'&:hover': {
|
|
96
|
+
backgroundColor: theme.tokens.color_bg_interactive_hover,
|
|
97
|
+
},
|
|
98
|
+
})), { '&:focus-visible': {
|
|
99
|
+
outline: 'none',
|
|
100
|
+
backgroundColor: theme.tokens.color_bg_interactive_hover,
|
|
101
|
+
} }));
|
|
102
|
+
});
|
|
103
|
+
exports.CommandPaletteTabs = React.forwardRef(function (props, ref) {
|
|
104
|
+
var children = props.children, className = props.className, tabsProps = __rest(props, ["children", "className"]);
|
|
105
|
+
var tabsRef = React.useRef(null);
|
|
106
|
+
var handleKeyDown = React.useCallback(function (e) {
|
|
107
|
+
var tabs = tabsRef.current;
|
|
108
|
+
if (!tabs)
|
|
109
|
+
return;
|
|
110
|
+
var tabButtons = Array.from(tabs.querySelectorAll('[role="tab"]'));
|
|
111
|
+
var focused = document.activeElement;
|
|
112
|
+
var currentIndex = tabButtons.indexOf(focused);
|
|
113
|
+
if (currentIndex === -1)
|
|
114
|
+
return;
|
|
115
|
+
var nextIndex = null;
|
|
116
|
+
if (e.key === 'ArrowRight') {
|
|
117
|
+
nextIndex = currentIndex < tabButtons.length - 1 ? currentIndex + 1 : 0;
|
|
118
|
+
}
|
|
119
|
+
else if (e.key === 'ArrowLeft') {
|
|
120
|
+
nextIndex = currentIndex > 0 ? currentIndex - 1 : tabButtons.length - 1;
|
|
121
|
+
}
|
|
122
|
+
else if (e.key === 'Home') {
|
|
123
|
+
nextIndex = 0;
|
|
124
|
+
}
|
|
125
|
+
else if (e.key === 'End') {
|
|
126
|
+
nextIndex = tabButtons.length - 1;
|
|
127
|
+
}
|
|
128
|
+
if (nextIndex !== null) {
|
|
129
|
+
e.preventDefault();
|
|
130
|
+
tabButtons[nextIndex].focus();
|
|
131
|
+
tabButtons[nextIndex].click();
|
|
132
|
+
}
|
|
133
|
+
}, []);
|
|
134
|
+
var mergedRef = (0, useForkRef_1.default)(tabsRef, ref);
|
|
135
|
+
return (React.createElement(Root, __assign({ ref: mergedRef, role: "tablist", className: (0, clsx_1.default)(command_palette_classes_1.commandPaletteClasses.tabs, className), onKeyDown: handleKeyDown }, tabsProps), children));
|
|
136
|
+
});
|
|
137
|
+
exports.CommandPaletteTabs.displayName = 'CommandPaletteTabs';
|
|
138
|
+
exports.CommandPaletteTab = React.forwardRef(function (props, ref) {
|
|
139
|
+
var _a = props.active, active = _a === void 0 ? false : _a, onSelect = props.onSelect, children = props.children, className = props.className, onClick = props.onClick, tabProps = __rest(props, ["active", "onSelect", "children", "className", "onClick"]);
|
|
140
|
+
var handleClick = React.useCallback(function (e) {
|
|
141
|
+
onSelect === null || onSelect === void 0 ? void 0 : onSelect();
|
|
142
|
+
onClick === null || onClick === void 0 ? void 0 : onClick(e);
|
|
143
|
+
}, [onSelect, onClick]);
|
|
144
|
+
return (React.createElement(TabButton, __assign({ ref: ref, role: "tab", type: "button", "aria-selected": active, tabIndex: active ? 0 : -1, ownerState: { active: active }, className: (0, clsx_1.default)(command_palette_classes_1.commandPaletteClasses.tab, active && command_palette_classes_1.commandPaletteClasses.tabSelected, className), onClick: handleClick }, tabProps), children));
|
|
145
|
+
});
|
|
146
|
+
exports.CommandPaletteTab.displayName = 'CommandPaletteTab';
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export type CommandPaletteFilterFn = (value: string, search: string, keywords?: string[]) => number;
|
|
3
|
+
export interface ICommandPaletteState {
|
|
4
|
+
search: string;
|
|
5
|
+
selectedValue: string;
|
|
6
|
+
filtered: {
|
|
7
|
+
count: number;
|
|
8
|
+
items: Map<string, number>;
|
|
9
|
+
groups: Map<string, number>;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export interface ICommandPaletteStore {
|
|
13
|
+
subscribe(callback: () => void): () => void;
|
|
14
|
+
snapshot(): ICommandPaletteState;
|
|
15
|
+
setState<K extends keyof ICommandPaletteState>(key: K, value: ICommandPaletteState[K], opts?: boolean): void;
|
|
16
|
+
emit(): void;
|
|
17
|
+
}
|
|
18
|
+
export interface ICommandPaletteContextValue {
|
|
19
|
+
value(id: string, value: string, keywords?: string[]): void;
|
|
20
|
+
item(id: string, groupId?: string): () => void;
|
|
21
|
+
group(id: string): () => void;
|
|
22
|
+
filter: false | CommandPaletteFilterFn;
|
|
23
|
+
label: string;
|
|
24
|
+
listId: string;
|
|
25
|
+
inputId: string;
|
|
26
|
+
listInnerRef: React.RefObject<HTMLDivElement | null>;
|
|
27
|
+
}
|
|
28
|
+
export interface ICommandPaletteProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onSelect'> {
|
|
29
|
+
/** Accessible label for the command palette */
|
|
30
|
+
label?: string;
|
|
31
|
+
/** Controlled search value */
|
|
32
|
+
search?: string;
|
|
33
|
+
/** Callback when search value changes */
|
|
34
|
+
onSearchChange?(search: string): void;
|
|
35
|
+
/** Controlled selected value */
|
|
36
|
+
value?: string;
|
|
37
|
+
/** Callback when selected item changes via keyboard navigation */
|
|
38
|
+
onValueChange?(value: string): void;
|
|
39
|
+
/** Custom filter function. Return score 0 to hide, >0 to show. Set to false to disable filtering. */
|
|
40
|
+
filter?: false | CommandPaletteFilterFn;
|
|
41
|
+
/** Whether built-in filtering is enabled */
|
|
42
|
+
shouldFilter?: boolean;
|
|
43
|
+
/** Whether to loop keyboard navigation */
|
|
44
|
+
loop?: boolean;
|
|
45
|
+
/** Callback when an item is selected via keyboard (Enter) */
|
|
46
|
+
onSelect?(value: string): void;
|
|
47
|
+
children?: React.ReactNode;
|
|
48
|
+
}
|
|
49
|
+
export interface ICommandPaletteInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'value' | 'type'> {
|
|
50
|
+
/** Icon to show before the input */
|
|
51
|
+
icon?: React.ReactNode;
|
|
52
|
+
/** Callback when value changes */
|
|
53
|
+
onValueChange?(search: string): void;
|
|
54
|
+
}
|
|
55
|
+
export interface ICommandPaletteListProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
56
|
+
children?: React.ReactNode;
|
|
57
|
+
}
|
|
58
|
+
export interface ICommandPaletteGroupProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
59
|
+
/** Heading text for the group */
|
|
60
|
+
heading?: React.ReactNode;
|
|
61
|
+
/** Force render even when all items are filtered out */
|
|
62
|
+
forceMount?: boolean;
|
|
63
|
+
/** Unique value for the group used for filtering */
|
|
64
|
+
value?: string;
|
|
65
|
+
children?: React.ReactNode;
|
|
66
|
+
}
|
|
67
|
+
export interface ICommandPaletteItemProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onSelect'> {
|
|
68
|
+
/** Unique value for the item (auto-derived from textContent if not provided) */
|
|
69
|
+
value?: string;
|
|
70
|
+
/** Additional keywords for filtering */
|
|
71
|
+
keywords?: string[];
|
|
72
|
+
/** Whether the item is disabled */
|
|
73
|
+
disabled?: boolean;
|
|
74
|
+
/** Callback when the item is selected */
|
|
75
|
+
onSelect?(value: string): void;
|
|
76
|
+
/** Force render even when filtered out */
|
|
77
|
+
forceMount?: boolean;
|
|
78
|
+
/** Icon to display before the label */
|
|
79
|
+
icon?: React.ReactNode;
|
|
80
|
+
/** Keyboard shortcut to display */
|
|
81
|
+
shortcut?: string | string[];
|
|
82
|
+
children?: React.ReactNode;
|
|
83
|
+
}
|
|
84
|
+
export interface ICommandPaletteTabsProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
85
|
+
children?: React.ReactNode;
|
|
86
|
+
}
|
|
87
|
+
export interface ICommandPaletteTabProps extends React.HTMLAttributes<HTMLButtonElement> {
|
|
88
|
+
/** Whether this tab is currently active */
|
|
89
|
+
active?: boolean;
|
|
90
|
+
/** Callback when tab is clicked */
|
|
91
|
+
onSelect?(): void;
|
|
92
|
+
children?: React.ReactNode;
|
|
93
|
+
}
|
|
94
|
+
export interface ICommandPaletteSeparatorProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
95
|
+
/** Render even when search is active */
|
|
96
|
+
alwaysRender?: boolean;
|
|
97
|
+
}
|
|
98
|
+
export interface ICommandPaletteEmptyProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
99
|
+
children?: React.ReactNode;
|
|
100
|
+
}
|
|
101
|
+
export interface ICommandPaletteLoadingProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
102
|
+
/** Progress percentage (0-100) */
|
|
103
|
+
progress?: number;
|
|
104
|
+
children?: React.ReactNode;
|
|
105
|
+
}
|
|
106
|
+
export interface ICommandPaletteDialogProps extends ICommandPaletteProps {
|
|
107
|
+
/** Whether the dialog is open */
|
|
108
|
+
open?: boolean;
|
|
109
|
+
/** Callback when the dialog should close */
|
|
110
|
+
onOpenChange?(open: boolean): void;
|
|
111
|
+
/** Props to pass to the dialog overlay */
|
|
112
|
+
overlayProps?: React.HTMLAttributes<HTMLDivElement>;
|
|
113
|
+
/** Props to pass to the dialog content wrapper */
|
|
114
|
+
contentProps?: React.HTMLAttributes<HTMLDivElement>;
|
|
115
|
+
}
|
|
116
|
+
export interface ICommandPaletteFooterProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
117
|
+
children?: React.ReactNode;
|
|
118
|
+
}
|
|
119
|
+
export interface ICommandPaletteShortcutKeyProps extends React.HTMLAttributes<HTMLElement> {
|
|
120
|
+
children?: React.ReactNode;
|
|
121
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { ICommandPaletteProps } from './command-palette-types';
|
|
3
|
+
declare const VALUE_ATTR = "data-value";
|
|
4
|
+
export declare const CommandPalette: React.ForwardRefExoticComponent<ICommandPaletteProps & React.RefAttributes<HTMLDivElement>>;
|
|
5
|
+
export { VALUE_ATTR };
|