@auth0/quantum-product 2.10.6 → 2.10.7

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 (30) hide show
  1. package/command-palette/command-palette-classes.d.ts +1 -1
  2. package/command-palette/command-palette-classes.js +1 -0
  3. package/command-palette/command-palette-dialog.js +7 -5
  4. package/command-palette/command-palette-empty.js +4 -2
  5. package/command-palette/command-palette-footer.js +8 -5
  6. package/command-palette/command-palette-group.js +13 -10
  7. package/command-palette/command-palette-input.js +10 -7
  8. package/command-palette/command-palette-item.js +8 -6
  9. package/command-palette/command-palette-list.js +5 -3
  10. package/command-palette/command-palette-loading.js +4 -2
  11. package/command-palette/command-palette-separator.js +4 -2
  12. package/command-palette/command-palette-tabs.js +11 -8
  13. package/command-palette/command-palette-types.d.ts +23 -13
  14. package/command-palette/command-palette.js +3 -3
  15. package/esm/command-palette/command-palette-classes.js +1 -0
  16. package/esm/command-palette/command-palette-dialog.js +8 -6
  17. package/esm/command-palette/command-palette-empty.js +5 -3
  18. package/esm/command-palette/command-palette-footer.js +9 -6
  19. package/esm/command-palette/command-palette-group.js +14 -11
  20. package/esm/command-palette/command-palette-input.js +11 -8
  21. package/esm/command-palette/command-palette-item.js +9 -7
  22. package/esm/command-palette/command-palette-list.js +6 -4
  23. package/esm/command-palette/command-palette-loading.js +5 -3
  24. package/esm/command-palette/command-palette-separator.js +5 -3
  25. package/esm/command-palette/command-palette-tabs.js +12 -9
  26. package/esm/command-palette/command-palette.js +3 -3
  27. package/esm/input/input-label/input-label-overrides.js +1 -0
  28. package/input/input-label/input-label-overrides.d.ts +1 -1
  29. package/input/input-label/input-label-overrides.js +1 -0
  30. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  export declare const commandPaletteComponentName: "QuantumCommandPalette";
2
2
  export declare function getCommandPaletteUtilityClass(slot: string): string;
3
- export declare const commandPaletteClasses: Record<"dialog" | "footer" | "input" | "kbd" | "separator" | "tab" | "root" | "loading" | "list" | "item" | "group" | "inputWrapper" | "inputIcon" | "groupHeading" | "groupItems" | "itemSelected" | "itemIcon" | "itemLabel" | "itemShortcut" | "tabs" | "tabSelected" | "empty" | "dialogPaper", string>;
3
+ export declare const commandPaletteClasses: Record<"dialog" | "footer" | "input" | "kbd" | "separator" | "tab" | "root" | "loading" | "list" | "item" | "group" | "inputWrapper" | "inputIcon" | "listInner" | "groupHeading" | "groupItems" | "itemSelected" | "itemIcon" | "itemLabel" | "itemShortcut" | "tabs" | "tabSelected" | "empty" | "dialogPaper", string>;
4
4
  export type CommandPaletteClasses = typeof commandPaletteClasses;
5
5
  export type CommandPaletteClassKey = keyof CommandPaletteClasses;
@@ -13,6 +13,7 @@ exports.commandPaletteClasses = (0, classes_1.generateUtilityClasses)(exports.co
13
13
  'inputWrapper',
14
14
  'inputIcon',
15
15
  'list',
16
+ 'listInner',
16
17
  'group',
17
18
  'groupHeading',
18
19
  'groupItems',
@@ -63,6 +63,7 @@ var React = __importStar(require("react"));
63
63
  var Dialog_1 = __importDefault(require("@mui/material/Dialog"));
64
64
  var useForkRef_1 = __importDefault(require("@mui/utils/useForkRef"));
65
65
  var styled_1 = require("../styled");
66
+ var classes_1 = require("../styles/classes");
66
67
  var clsx_1 = __importDefault(require("../utils/clsx"));
67
68
  var command_palette_1 = require("./command-palette");
68
69
  var command_palette_classes_1 = require("./command-palette-classes");
@@ -84,18 +85,19 @@ var StyledDialog = (0, styled_1.styled)(Dialog_1.default, {
84
85
  overflow: 'hidden',
85
86
  backgroundColor: theme.tokens.color_bg_layer_elevated,
86
87
  border: "1px solid ".concat(theme.tokens.color_border_default),
87
- boxShadow: "0px 33px 80px rgba(0, 0, 0, 0.12),\n 0px 13.7866px 33.4221px rgba(0, 0, 0, 0.086),\n 0px 7.37098px 17.869px rgba(0, 0, 0, 0.07),\n 0px 4.13211px 10.0172px rgba(0, 0, 0, 0.06),\n 0px 2.19453px 5.32008px rgba(0, 0, 0, 0.048),\n 0px 0.913195px 2.21381px rgba(0, 0, 0, 0.034)",
88
+ boxShadow: '0 -1px 0 -1px rgba(0,0,0,0.06), 0 1px 0 -1px rgba(0,0,0,0.06), 0 2px 24px -6px rgba(0,0,0,0.04), 0 4px 48px -12px rgba(0,0,0,0.04), 0 8px 80px -24px rgba(0,0,0,0.04)',
88
89
  },
89
90
  '& .MuiBackdrop-root': {
90
- backgroundColor: 'rgba(0, 0, 0, 0.4)',
91
- backdropFilter: 'blur(4px)',
91
+ backgroundColor: 'rgba(0, 0, 0, 0.04)',
92
+ backdropFilter: 'blur(2px)',
92
93
  },
93
94
  });
94
95
  });
95
96
  exports.CommandPaletteDialog = React.forwardRef(function (props, ref) {
96
- var _a = props.open, open = _a === void 0 ? false : _a, onOpenChange = props.onOpenChange, overlayProps = props.overlayProps, contentProps = props.contentProps, children = props.children, className = props.className, commandPaletteProps = __rest(props, ["open", "onOpenChange", "overlayProps", "contentProps", "children", "className"]);
97
+ var _a = props.open, open = _a === void 0 ? false : _a, onOpenChange = props.onOpenChange, overlayProps = props.overlayProps, contentProps = props.contentProps, analyticsId = props.analyticsId, propClasses = props.classes, children = props.children, className = props.className, sx = props.sx, commandPaletteProps = __rest(props, ["open", "onOpenChange", "overlayProps", "contentProps", "analyticsId", "classes", "children", "className", "sx"]);
97
98
  var paletteRef = React.useRef(null);
98
99
  var handleRef = (0, useForkRef_1.default)(ref, paletteRef);
100
+ var classes = (0, classes_1.useMergedClasses)(command_palette_classes_1.commandPaletteClasses, command_palette_classes_1.getCommandPaletteUtilityClass, propClasses);
99
101
  var handleEntered = React.useCallback(function () {
100
102
  requestAnimationFrame(function () {
101
103
  var _a;
@@ -106,7 +108,7 @@ exports.CommandPaletteDialog = React.forwardRef(function (props, ref) {
106
108
  var handleClose = React.useCallback(function () {
107
109
  onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(false);
108
110
  }, [onOpenChange]);
109
- return (React.createElement(StyledDialog, { open: open, onClose: handleClose, TransitionProps: { onEntered: handleEntered }, className: (0, clsx_1.default)(command_palette_classes_1.commandPaletteClasses.dialog, className), maxWidth: false, BackdropProps: overlayProps, PaperProps: contentProps },
111
+ return (React.createElement(StyledDialog, __assign({ open: open, onClose: handleClose, TransitionProps: { onEntered: handleEntered }, sx: sx, className: (0, clsx_1.default)(classes.dialog, className), maxWidth: false, BackdropProps: overlayProps, PaperProps: __assign(__assign({}, contentProps), { className: (0, clsx_1.default)(command_palette_classes_1.commandPaletteClasses.dialogPaper, classes.dialogPaper, contentProps === null || contentProps === void 0 ? void 0 : contentProps.className) }) }, (analyticsId && { 'data-analytics-id': analyticsId })),
110
112
  React.createElement(command_palette_1.CommandPalette, __assign({ ref: handleRef }, commandPaletteProps), children)));
111
113
  });
112
114
  exports.CommandPaletteDialog.displayName = 'CommandPaletteDialog';
@@ -61,6 +61,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
61
61
  exports.CommandPaletteEmpty = void 0;
62
62
  var React = __importStar(require("react"));
63
63
  var styled_1 = require("../styled");
64
+ var classes_1 = require("../styles/classes");
64
65
  var clsx_1 = __importDefault(require("../utils/clsx"));
65
66
  var command_palette_classes_1 = require("./command-palette-classes");
66
67
  var command_palette_context_1 = require("./command-palette-context");
@@ -80,11 +81,12 @@ var Root = (0, styled_1.styled)('div', {
80
81
  });
81
82
  });
82
83
  exports.CommandPaletteEmpty = React.forwardRef(function (props, ref) {
83
- var _a = props.children, children = _a === void 0 ? 'No results found.' : _a, className = props.className, emptyProps = __rest(props, ["children", "className"]);
84
+ var _a = props.children, children = _a === void 0 ? 'No results found.' : _a, analyticsId = props.analyticsId, propClasses = props.classes, className = props.className, sx = props.sx, emptyProps = __rest(props, ["children", "analyticsId", "classes", "className", "sx"]);
84
85
  var filteredCount = (0, command_palette_context_1.useCommandPaletteState)(function (state) { return state.filtered.count; });
85
86
  var isSearching = (0, command_palette_context_1.useCommandPaletteState)(function (state) { return state.search.length > 0; });
87
+ var classes = (0, classes_1.useMergedClasses)(command_palette_classes_1.commandPaletteClasses, command_palette_classes_1.getCommandPaletteUtilityClass, propClasses);
86
88
  if (!isSearching || filteredCount > 0)
87
89
  return null;
88
- return (React.createElement(Root, __assign({ ref: ref, role: "presentation", className: (0, clsx_1.default)(command_palette_classes_1.commandPaletteClasses.empty, className) }, emptyProps), children));
90
+ return (React.createElement(Root, __assign({ ref: ref, sx: sx, role: "presentation", className: (0, clsx_1.default)(classes.empty, className) }, (analyticsId && { 'data-analytics-id': analyticsId }), emptyProps), children));
89
91
  });
90
92
  exports.CommandPaletteEmpty.displayName = 'CommandPaletteEmpty';
@@ -61,6 +61,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
61
61
  exports.CommandPaletteShortcutKey = exports.CommandPaletteFooter = void 0;
62
62
  var React = __importStar(require("react"));
63
63
  var styled_1 = require("../styled");
64
+ var classes_1 = require("../styles/classes");
64
65
  var clsx_1 = __importDefault(require("../utils/clsx"));
65
66
  var command_palette_classes_1 = require("./command-palette-classes");
66
67
  var Root = (0, styled_1.styled)('div', {
@@ -80,7 +81,7 @@ var Root = (0, styled_1.styled)('div', {
80
81
  });
81
82
  var Kbd = (0, styled_1.styled)('kbd', {
82
83
  name: command_palette_classes_1.commandPaletteComponentName,
83
- slot: 'FooterKbd',
84
+ slot: 'Kbd',
84
85
  })(function (_a) {
85
86
  var theme = _a.theme;
86
87
  return ({
@@ -100,12 +101,14 @@ var Kbd = (0, styled_1.styled)('kbd', {
100
101
  });
101
102
  });
102
103
  exports.CommandPaletteFooter = React.forwardRef(function (props, ref) {
103
- var children = props.children, className = props.className, footerProps = __rest(props, ["children", "className"]);
104
- return (React.createElement(Root, __assign({ ref: ref, className: (0, clsx_1.default)(command_palette_classes_1.commandPaletteClasses.footer, className) }, footerProps), children));
104
+ var children = props.children, analyticsId = props.analyticsId, propClasses = props.classes, className = props.className, sx = props.sx, footerProps = __rest(props, ["children", "analyticsId", "classes", "className", "sx"]);
105
+ var classes = (0, classes_1.useMergedClasses)(command_palette_classes_1.commandPaletteClasses, command_palette_classes_1.getCommandPaletteUtilityClass, propClasses);
106
+ return (React.createElement(Root, __assign({ ref: ref, sx: sx, className: (0, clsx_1.default)(classes.footer, className) }, (analyticsId && { 'data-analytics-id': analyticsId }), footerProps), children));
105
107
  });
106
108
  exports.CommandPaletteFooter.displayName = 'CommandPaletteFooter';
107
109
  exports.CommandPaletteShortcutKey = React.forwardRef(function (props, ref) {
108
- var children = props.children, className = props.className, kbdProps = __rest(props, ["children", "className"]);
109
- return (React.createElement(Kbd, __assign({ ref: ref, className: (0, clsx_1.default)(command_palette_classes_1.commandPaletteClasses.kbd, className) }, kbdProps), children));
110
+ var children = props.children, analyticsId = props.analyticsId, propClasses = props.classes, className = props.className, sx = props.sx, kbdProps = __rest(props, ["children", "analyticsId", "classes", "className", "sx"]);
111
+ var classes = (0, classes_1.useMergedClasses)(command_palette_classes_1.commandPaletteClasses, command_palette_classes_1.getCommandPaletteUtilityClass, propClasses);
112
+ return (React.createElement(Kbd, __assign({ ref: ref, sx: sx, className: (0, clsx_1.default)(classes.kbd, className) }, (analyticsId && { 'data-analytics-id': analyticsId }), kbdProps), children));
110
113
  });
111
114
  exports.CommandPaletteShortcutKey.displayName = 'CommandPaletteShortcutKey';
@@ -61,6 +61,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
61
61
  exports.CommandPaletteGroup = void 0;
62
62
  var React = __importStar(require("react"));
63
63
  var styled_1 = require("../styled");
64
+ var classes_1 = require("../styles/classes");
64
65
  var clsx_1 = __importDefault(require("../utils/clsx"));
65
66
  var use_id_1 = require("../utils/use-id");
66
67
  var command_palette_classes_1 = require("./command-palette-classes");
@@ -97,23 +98,25 @@ var Items = (0, styled_1.styled)('div', {
97
98
  outline: 'none',
98
99
  }); });
99
100
  exports.CommandPaletteGroup = React.forwardRef(function (props, ref) {
100
- var heading = props.heading, _a = props.forceMount, forceMount = _a === void 0 ? false : _a, children = props.children, className = props.className, groupProps = __rest(props, ["heading", "forceMount", "children", "className"]);
101
- var id = (0, use_id_1.useId)() || '';
102
- var headingId = "".concat(id, "-heading");
101
+ var heading = props.heading, _a = props.forceMount, forceMount = _a === void 0 ? false : _a, value = props.value, analyticsId = props.analyticsId, propClasses = props.classes, children = props.children, className = props.className, sx = props.sx, groupProps = __rest(props, ["heading", "forceMount", "value", "analyticsId", "classes", "children", "className", "sx"]);
102
+ var generatedId = (0, use_id_1.useId)() || '';
103
+ var groupId = value || generatedId;
104
+ var headingId = generatedId ? "".concat(generatedId, "-heading") : undefined;
103
105
  var context = (0, command_palette_context_1.useCommandPaletteContext)();
106
+ var classes = (0, classes_1.useMergedClasses)(command_palette_classes_1.commandPaletteClasses, command_palette_classes_1.getCommandPaletteUtilityClass, propClasses);
104
107
  React.useLayoutEffect(function () {
105
- var cleanup = context.group(id);
108
+ var cleanup = context.group(groupId);
106
109
  return cleanup;
107
- }, [context, id]);
110
+ }, [context, groupId]);
108
111
  var filteredState = (0, command_palette_context_1.useCommandPaletteState)(function (state) { return state.filtered; });
109
112
  var search = (0, command_palette_context_1.useCommandPaletteState)(function (state) { return state.search; });
110
- var groupCount = filteredState.groups.get(id);
113
+ var groupCount = filteredState.groups.get(groupId);
111
114
  var isVisible = forceMount || context.filter === false || !search || (groupCount !== undefined && groupCount > 0);
112
115
  if (!isVisible)
113
116
  return null;
114
- return (React.createElement(Root, __assign({ ref: ref, className: (0, clsx_1.default)(command_palette_classes_1.commandPaletteClasses.group, className), role: "presentation" }, groupProps),
115
- heading && (React.createElement(Heading, { id: headingId, className: command_palette_classes_1.commandPaletteClasses.groupHeading, "aria-hidden": true }, heading)),
116
- React.createElement(command_palette_context_1.CommandPaletteGroupContext.Provider, { value: id },
117
- React.createElement(Items, { role: "group", className: command_palette_classes_1.commandPaletteClasses.groupItems, "aria-labelledby": heading ? headingId : undefined }, children))));
117
+ return (React.createElement(Root, __assign({ ref: ref, sx: sx, className: (0, clsx_1.default)(classes.group, className), role: "presentation" }, (analyticsId && { 'data-analytics-id': analyticsId }), groupProps),
118
+ heading && (React.createElement(Heading, { id: headingId, className: classes.groupHeading, "aria-hidden": true }, heading)),
119
+ React.createElement(command_palette_context_1.CommandPaletteGroupContext.Provider, { value: groupId },
120
+ React.createElement(Items, { role: "group", className: classes.groupItems, "aria-labelledby": heading ? headingId : undefined }, children))));
118
121
  });
119
122
  exports.CommandPaletteGroup.displayName = 'CommandPaletteGroup';
@@ -62,6 +62,7 @@ exports.CommandPaletteInput = void 0;
62
62
  var React = __importStar(require("react"));
63
63
  var icon_1 = require("../icon");
64
64
  var styled_1 = require("../styled");
65
+ var classes_1 = require("../styles/classes");
65
66
  var clsx_1 = __importDefault(require("../utils/clsx"));
66
67
  var command_palette_classes_1 = require("./command-palette-classes");
67
68
  var command_palette_context_1 = require("./command-palette-context");
@@ -74,7 +75,7 @@ var Wrapper = (0, styled_1.styled)('div', {
74
75
  display: 'flex',
75
76
  alignItems: 'center',
76
77
  gap: theme.spacing(1.5),
77
- padding: "".concat(theme.spacing(1.5), " ").concat(theme.spacing(2)),
78
+ padding: "".concat(theme.spacing(1.75), " ").concat(theme.spacing(2.5)),
78
79
  });
79
80
  });
80
81
  var IconWrapper = (0, styled_1.styled)('div', {
@@ -105,8 +106,9 @@ var InputElement = (0, styled_1.styled)('input', {
105
106
  outline: 'none',
106
107
  backgroundColor: 'transparent',
107
108
  color: theme.tokens.color_fg_default,
108
- fontSize: theme.typography.body1.fontSize,
109
- lineHeight: theme.typography.body1.lineHeight,
109
+ fontSize: theme.typography.body2.fontSize,
110
+ fontWeight: theme.typography.fontWeightMedium,
111
+ lineHeight: theme.typography.body2.lineHeight,
110
112
  fontFamily: theme.typography.fontFamily,
111
113
  caretColor: theme.tokens.color_fg_brand_primary,
112
114
  '&::placeholder': {
@@ -118,7 +120,8 @@ var InputElement = (0, styled_1.styled)('input', {
118
120
  });
119
121
  });
120
122
  exports.CommandPaletteInput = React.forwardRef(function (props, ref) {
121
- var _a = props.icon, icon = _a === void 0 ? React.createElement(icon_1.SearchIcon, { size: 20 }) : _a, _b = props.placeholder, placeholder = _b === void 0 ? 'Search for commands...' : _b, onValueChange = props.onValueChange, className = props.className, inputProps = __rest(props, ["icon", "placeholder", "onValueChange", "className"]);
123
+ var _a = props.icon, icon = _a === void 0 ? React.createElement(icon_1.SearchIcon, { size: 20 }) : _a, _b = props.placeholder, placeholder = _b === void 0 ? 'Search for commands...' : _b, onValueChange = props.onValueChange, analyticsId = props.analyticsId, propClasses = props.classes, className = props.className, sx = props.sx, inputProps = __rest(props, ["icon", "placeholder", "onValueChange", "analyticsId", "classes", "className", "sx"]);
124
+ var classes = (0, classes_1.useMergedClasses)(command_palette_classes_1.commandPaletteClasses, command_palette_classes_1.getCommandPaletteUtilityClass, propClasses);
122
125
  var context = (0, command_palette_context_1.useCommandPaletteContext)();
123
126
  var store = (0, command_palette_context_1.useCommandPaletteStore)();
124
127
  var search = (0, command_palette_context_1.useCommandPaletteState)(function (state) { return state.search; });
@@ -137,8 +140,8 @@ exports.CommandPaletteInput = React.forwardRef(function (props, ref) {
137
140
  store.setState('search', e.target.value);
138
141
  onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange(e.target.value);
139
142
  }, [store, onValueChange]);
140
- return (React.createElement(Wrapper, { className: (0, clsx_1.default)(command_palette_classes_1.commandPaletteClasses.inputWrapper, className) },
141
- icon && React.createElement(IconWrapper, { className: command_palette_classes_1.commandPaletteClasses.inputIcon }, icon),
142
- React.createElement(InputElement, __assign({ ref: ref, id: context.inputId, className: command_palette_classes_1.commandPaletteClasses.input, type: "text", role: "combobox", "aria-expanded": true, "aria-controls": context.listId, "aria-label": placeholder, "aria-autocomplete": "list", autoComplete: "off", autoCorrect: "off", spellCheck: false, placeholder: placeholder, value: search, onChange: handleChange, onCompositionStart: handleCompositionStart, onCompositionEnd: handleCompositionEnd }, inputProps))));
143
+ return (React.createElement(Wrapper, __assign({ sx: sx, className: (0, clsx_1.default)(classes.inputWrapper, className) }, (analyticsId && { 'data-analytics-id': analyticsId })),
144
+ icon && React.createElement(IconWrapper, { className: classes.inputIcon }, icon),
145
+ React.createElement(InputElement, __assign({ ref: ref, id: context.inputId, className: classes.input, type: "text", role: "combobox", "aria-expanded": true, "aria-controls": context.listId, "aria-label": placeholder, "aria-autocomplete": "list", autoComplete: "off", autoCorrect: "off", spellCheck: false, placeholder: placeholder, value: search, onChange: handleChange, onCompositionStart: handleCompositionStart, onCompositionEnd: handleCompositionEnd }, inputProps))));
143
146
  });
144
147
  exports.CommandPaletteInput.displayName = 'CommandPaletteInput';
@@ -87,6 +87,7 @@ exports.CommandPaletteItem = void 0;
87
87
  var React = __importStar(require("react"));
88
88
  var useForkRef_1 = __importDefault(require("@mui/utils/useForkRef"));
89
89
  var styled_1 = require("../styled");
90
+ var classes_1 = require("../styles/classes");
90
91
  var clsx_1 = __importDefault(require("../utils/clsx"));
91
92
  var use_id_1 = require("../utils/use-id");
92
93
  var command_palette_1 = require("./command-palette");
@@ -97,7 +98,7 @@ var Root = (0, styled_1.styled)('div', {
97
98
  slot: 'Item',
98
99
  })(function (_a) {
99
100
  var theme = _a.theme, ownerState = _a.ownerState;
100
- return (__assign(__assign(__assign(__assign({ display: 'flex', alignItems: 'center', gap: theme.spacing(1.5), padding: "".concat(theme.spacing(1), " ").concat(theme.spacing(1.5)), borderRadius: theme.spacing(1), cursor: 'pointer', userSelect: 'none', fontSize: theme.typography.body2.fontSize, fontWeight: theme.typography.fontWeightMedium, lineHeight: theme.typography.body2.lineHeight, color: theme.tokens.color_fg_default, transition: theme.transitions.create(['background-color', 'color'], {
101
+ return (__assign(__assign(__assign(__assign({ display: 'flex', alignItems: 'center', gap: theme.spacing(1.5), padding: "".concat(theme.spacing(1), " ").concat(theme.spacing(1.5)), borderRadius: theme.spacing(0.75), cursor: 'pointer', userSelect: 'none', fontSize: theme.typography.body2.fontSize, fontWeight: theme.typography.fontWeightMedium, lineHeight: theme.typography.body2.lineHeight, color: theme.tokens.color_fg_default, transition: theme.transitions.create(['background-color', 'color'], {
101
102
  duration: theme.transitions.duration.shortest,
102
103
  }) }, (ownerState.isSelected && {
103
104
  backgroundColor: theme.tokens.color_bg_interactive_hover,
@@ -199,7 +200,7 @@ function useValue(id, ref, deps) {
199
200
  exports.CommandPaletteItem = React.forwardRef(function (props, ref) {
200
201
  var _a;
201
202
  var _b, _c;
202
- var valueProp = props.value, keywords = props.keywords, _d = props.disabled, disabled = _d === void 0 ? false : _d, onSelect = props.onSelect, _e = props.forceMount, forceMount = _e === void 0 ? false : _e, icon = props.icon, shortcut = props.shortcut, children = props.children, className = props.className, itemProps = __rest(props, ["value", "keywords", "disabled", "onSelect", "forceMount", "icon", "shortcut", "children", "className"]);
203
+ var valueProp = props.value, keywords = props.keywords, _d = props.disabled, disabled = _d === void 0 ? false : _d, onSelect = props.onSelect, _e = props.forceMount, forceMount = _e === void 0 ? false : _e, icon = props.icon, shortcut = props.shortcut, analyticsId = props.analyticsId, propClasses = props.classes, children = props.children, className = props.className, sx = props.sx, itemProps = __rest(props, ["value", "keywords", "disabled", "onSelect", "forceMount", "icon", "shortcut", "analyticsId", "classes", "children", "className", "sx"]);
203
204
  var generatedId = (0, use_id_1.useId)();
204
205
  var idRef = React.useRef();
205
206
  if (!idRef.current) {
@@ -211,6 +212,7 @@ exports.CommandPaletteItem = React.forwardRef(function (props, ref) {
211
212
  var context = (0, command_palette_context_1.useCommandPaletteContext)();
212
213
  var store = (0, command_palette_context_1.useCommandPaletteStore)();
213
214
  var groupId = React.useContext(command_palette_context_1.CommandPaletteGroupContext);
215
+ var classes = (0, classes_1.useMergedClasses)(command_palette_classes_1.commandPaletteClasses, command_palette_classes_1.getCommandPaletteUtilityClass, propClasses);
214
216
  var itemValue = useValue(id, itemRef, [valueProp, keywords, children]);
215
217
  var selectedValue = (0, command_palette_context_1.useCommandPaletteState)(function (state) { return state.selectedValue; });
216
218
  var isSelected = selectedValue === itemValue && itemValue !== '';
@@ -235,9 +237,9 @@ exports.CommandPaletteItem = React.forwardRef(function (props, ref) {
235
237
  var shortcutKeys = shortcut ? (Array.isArray(shortcut) ? shortcut : shortcut.split('+')) : null;
236
238
  if (!isVisible)
237
239
  return null;
238
- return (React.createElement(Root, __assign((_a = { ref: mergedRef, ownerState: { isSelected: isSelected, disabled: disabled }, className: (0, clsx_1.default)(command_palette_classes_1.commandPaletteClasses.item, isSelected && command_palette_classes_1.commandPaletteClasses.itemSelected, className), role: "option", "aria-selected": isSelected, "aria-disabled": disabled, "data-disabled": disabled || undefined }, _a[command_palette_1.VALUE_ATTR] = encodeURIComponent(itemValue), _a.onPointerMove = handlePointerMove, _a.onClick = handleClick, _a), itemProps),
239
- icon && React.createElement(ItemIcon, { className: command_palette_classes_1.commandPaletteClasses.itemIcon }, icon),
240
- React.createElement(ItemLabel, { className: command_palette_classes_1.commandPaletteClasses.itemLabel }, children),
241
- shortcutKeys && (React.createElement(ItemShortcut, { className: command_palette_classes_1.commandPaletteClasses.itemShortcut }, shortcutKeys.map(function (key, i) { return (React.createElement(Kbd, { key: i, className: command_palette_classes_1.commandPaletteClasses.kbd }, key)); })))));
240
+ return (React.createElement(Root, __assign((_a = { ref: mergedRef, sx: sx, ownerState: { isSelected: isSelected, disabled: disabled }, className: (0, clsx_1.default)(classes.item, isSelected && classes.itemSelected, className), role: "option", "aria-selected": isSelected, "aria-disabled": disabled, "data-disabled": disabled || undefined }, _a[command_palette_1.VALUE_ATTR] = encodeURIComponent(itemValue), _a.onPointerMove = handlePointerMove, _a.onClick = handleClick, _a), (analyticsId && { 'data-analytics-id': analyticsId }), itemProps),
241
+ icon && React.createElement(ItemIcon, { className: classes.itemIcon }, icon),
242
+ React.createElement(ItemLabel, { className: classes.itemLabel }, children),
243
+ shortcutKeys && (React.createElement(ItemShortcut, { className: classes.itemShortcut }, shortcutKeys.map(function (key, i) { return (React.createElement(Kbd, { key: i, className: classes.kbd }, key)); })))));
242
244
  });
243
245
  exports.CommandPaletteItem.displayName = 'CommandPaletteItem';
@@ -61,6 +61,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
61
61
  exports.CommandPaletteList = void 0;
62
62
  var React = __importStar(require("react"));
63
63
  var styled_1 = require("../styled");
64
+ var classes_1 = require("../styles/classes");
64
65
  var clsx_1 = __importDefault(require("../utils/clsx"));
65
66
  var command_palette_classes_1 = require("./command-palette-classes");
66
67
  var command_palette_context_1 = require("./command-palette-context");
@@ -93,9 +94,10 @@ var Inner = (0, styled_1.styled)('div', {
93
94
  slot: 'ListInner',
94
95
  })(function () { return ({}); });
95
96
  exports.CommandPaletteList = React.forwardRef(function (props, ref) {
96
- var children = props.children, className = props.className, style = props.style, listProps = __rest(props, ["children", "className", "style"]);
97
+ var children = props.children, analyticsId = props.analyticsId, propClasses = props.classes, className = props.className, style = props.style, sx = props.sx, listProps = __rest(props, ["children", "analyticsId", "classes", "className", "style", "sx"]);
97
98
  var context = (0, command_palette_context_1.useCommandPaletteContext)();
98
- return (React.createElement(Root, __assign({ ref: ref, id: context.listId, role: "listbox", "aria-label": "Suggestions", className: (0, clsx_1.default)(command_palette_classes_1.commandPaletteClasses.list, className), style: style }, listProps),
99
- React.createElement(Inner, { ref: context.listInnerRef }, children)));
99
+ var classes = (0, classes_1.useMergedClasses)(command_palette_classes_1.commandPaletteClasses, command_palette_classes_1.getCommandPaletteUtilityClass, propClasses);
100
+ return (React.createElement(Root, __assign({ ref: ref, id: context.listId, role: "listbox", "aria-label": "Suggestions", sx: sx, className: (0, clsx_1.default)(classes.list, className), style: style }, (analyticsId && { 'data-analytics-id': analyticsId }), listProps),
101
+ React.createElement(Inner, { ref: context.listInnerRef, className: classes.listInner }, children)));
100
102
  });
101
103
  exports.CommandPaletteList.displayName = 'CommandPaletteList';
@@ -62,6 +62,7 @@ exports.CommandPaletteLoading = void 0;
62
62
  var React = __importStar(require("react"));
63
63
  var spinner_1 = require("../spinner");
64
64
  var styled_1 = require("../styled");
65
+ var classes_1 = require("../styles/classes");
65
66
  var clsx_1 = __importDefault(require("../utils/clsx"));
66
67
  var command_palette_classes_1 = require("./command-palette-classes");
67
68
  var Root = (0, styled_1.styled)('div', {
@@ -81,8 +82,9 @@ var Root = (0, styled_1.styled)('div', {
81
82
  });
82
83
  });
83
84
  exports.CommandPaletteLoading = React.forwardRef(function (props, ref) {
84
- var _a = props.progress, progress = _a === void 0 ? 0 : _a, _b = props.children, children = _b === void 0 ? 'Loading...' : _b, className = props.className, loadingProps = __rest(props, ["progress", "children", "className"]);
85
- return (React.createElement(Root, __assign({ ref: ref, role: "progressbar", "aria-valuenow": progress, "aria-valuemin": 0, "aria-valuemax": 100, "aria-label": "Loading results", className: (0, clsx_1.default)(command_palette_classes_1.commandPaletteClasses.loading, className) }, loadingProps),
85
+ var _a = props.progress, progress = _a === void 0 ? 0 : _a, _b = props.children, children = _b === void 0 ? 'Loading...' : _b, analyticsId = props.analyticsId, propClasses = props.classes, className = props.className, sx = props.sx, loadingProps = __rest(props, ["progress", "children", "analyticsId", "classes", "className", "sx"]);
86
+ var classes = (0, classes_1.useMergedClasses)(command_palette_classes_1.commandPaletteClasses, command_palette_classes_1.getCommandPaletteUtilityClass, propClasses);
87
+ return (React.createElement(Root, __assign({ ref: ref, sx: sx, role: "progressbar", "aria-valuenow": progress, "aria-valuemin": 0, "aria-valuemax": 100, "aria-label": "Loading results", className: (0, clsx_1.default)(classes.loading, className) }, (analyticsId && { 'data-analytics-id': analyticsId }), loadingProps),
86
88
  React.createElement(spinner_1.Spinner, null),
87
89
  children));
88
90
  });
@@ -61,6 +61,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
61
61
  exports.CommandPaletteSeparator = void 0;
62
62
  var React = __importStar(require("react"));
63
63
  var styled_1 = require("../styled");
64
+ var classes_1 = require("../styles/classes");
64
65
  var clsx_1 = __importDefault(require("../utils/clsx"));
65
66
  var command_palette_classes_1 = require("./command-palette-classes");
66
67
  var command_palette_context_1 = require("./command-palette-context");
@@ -76,11 +77,12 @@ var Root = (0, styled_1.styled)('div', {
76
77
  });
77
78
  });
78
79
  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 _a = props.alwaysRender, alwaysRender = _a === void 0 ? false : _a, analyticsId = props.analyticsId, propClasses = props.classes, className = props.className, sx = props.sx, separatorProps = __rest(props, ["alwaysRender", "analyticsId", "classes", "className", "sx"]);
80
81
  var search = (0, command_palette_context_1.useCommandPaletteState)(function (state) { return state.search; });
81
82
  var isSearching = search.length > 0;
83
+ var classes = (0, classes_1.useMergedClasses)(command_palette_classes_1.commandPaletteClasses, command_palette_classes_1.getCommandPaletteUtilityClass, propClasses);
82
84
  if (!alwaysRender && isSearching)
83
85
  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)));
86
+ return (React.createElement(Root, __assign({ ref: ref, sx: sx, role: "separator", className: (0, clsx_1.default)(classes.separator, className) }, (analyticsId && { 'data-analytics-id': analyticsId }), separatorProps)));
85
87
  });
86
88
  exports.CommandPaletteSeparator.displayName = 'CommandPaletteSeparator';
@@ -62,6 +62,7 @@ exports.CommandPaletteTab = exports.CommandPaletteTabs = void 0;
62
62
  var React = __importStar(require("react"));
63
63
  var useForkRef_1 = __importDefault(require("@mui/utils/useForkRef"));
64
64
  var styled_1 = require("../styled");
65
+ var classes_1 = require("../styles/classes");
65
66
  var clsx_1 = __importDefault(require("../utils/clsx"));
66
67
  var command_palette_classes_1 = require("./command-palette-classes");
67
68
  var Root = (0, styled_1.styled)('div', {
@@ -73,7 +74,7 @@ var Root = (0, styled_1.styled)('div', {
73
74
  display: 'flex',
74
75
  alignItems: 'center',
75
76
  gap: theme.spacing(0.5),
76
- padding: "".concat(theme.spacing(1), " ").concat(theme.spacing(2)),
77
+ padding: "".concat(theme.spacing(1), " ").concat(theme.spacing(1.25)),
77
78
  overflowX: 'auto',
78
79
  scrollbarWidth: 'none',
79
80
  '&::-webkit-scrollbar': {
@@ -86,23 +87,24 @@ var TabButton = (0, styled_1.styled)('button', {
86
87
  slot: 'Tab',
87
88
  })(function (_a) {
88
89
  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
+ return (__assign(__assign(__assign({ display: 'inline-flex', alignItems: 'center', justifyContent: 'center', padding: "".concat(theme.spacing(0.5), " ").concat(theme.spacing(1.25)), borderRadius: theme.spacing(0.75), 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
91
  duration: theme.transitions.duration.shortest,
91
92
  }), color: theme.tokens.color_fg_disabled, backgroundColor: 'transparent' }, (ownerState.active && {
92
93
  color: theme.tokens.color_fg_default,
93
- backgroundColor: theme.tokens.color_bg_state_neutral_subtle,
94
+ backgroundColor: theme.tokens.color_bg_layer_alternate_bold,
94
95
  })), (!ownerState.active && {
95
96
  '&:hover': {
96
97
  backgroundColor: theme.tokens.color_bg_interactive_hover,
97
98
  },
98
99
  })), { '&:focus-visible': {
99
100
  outline: 'none',
100
- backgroundColor: theme.tokens.color_bg_interactive_hover,
101
+ backgroundColor: theme.tokens.color_bg_link_pressed,
101
102
  } }));
102
103
  });
103
104
  exports.CommandPaletteTabs = React.forwardRef(function (props, ref) {
104
- var children = props.children, className = props.className, tabsProps = __rest(props, ["children", "className"]);
105
+ var children = props.children, analyticsId = props.analyticsId, propClasses = props.classes, className = props.className, sx = props.sx, tabsProps = __rest(props, ["children", "analyticsId", "classes", "className", "sx"]);
105
106
  var tabsRef = React.useRef(null);
107
+ var classes = (0, classes_1.useMergedClasses)(command_palette_classes_1.commandPaletteClasses, command_palette_classes_1.getCommandPaletteUtilityClass, propClasses);
106
108
  var handleKeyDown = React.useCallback(function (e) {
107
109
  var tabs = tabsRef.current;
108
110
  if (!tabs)
@@ -132,15 +134,16 @@ exports.CommandPaletteTabs = React.forwardRef(function (props, ref) {
132
134
  }
133
135
  }, []);
134
136
  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));
137
+ return (React.createElement(Root, __assign({ ref: mergedRef, role: "tablist", sx: sx, className: (0, clsx_1.default)(classes.tabs, className), onKeyDown: handleKeyDown }, (analyticsId && { 'data-analytics-id': analyticsId }), tabsProps), children));
136
138
  });
137
139
  exports.CommandPaletteTabs.displayName = 'CommandPaletteTabs';
138
140
  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"]);
141
+ var _a = props.active, active = _a === void 0 ? false : _a, onSelect = props.onSelect, analyticsId = props.analyticsId, propClasses = props.classes, children = props.children, className = props.className, onClick = props.onClick, sx = props.sx, tabProps = __rest(props, ["active", "onSelect", "analyticsId", "classes", "children", "className", "onClick", "sx"]);
142
+ var classes = (0, classes_1.useMergedClasses)(command_palette_classes_1.commandPaletteClasses, command_palette_classes_1.getCommandPaletteUtilityClass, propClasses);
140
143
  var handleClick = React.useCallback(function (e) {
141
144
  onSelect === null || onSelect === void 0 ? void 0 : onSelect();
142
145
  onClick === null || onClick === void 0 ? void 0 : onClick(e);
143
146
  }, [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));
147
+ return (React.createElement(TabButton, __assign({ ref: ref, role: "tab", type: "button", "aria-selected": active, tabIndex: active ? 0 : -1, sx: sx, ownerState: { active: active }, className: (0, clsx_1.default)(classes.tab, active && classes.tabSelected, className), onClick: handleClick }, (analyticsId && { 'data-analytics-id': analyticsId }), tabProps), children));
145
148
  });
146
149
  exports.CommandPaletteTab.displayName = 'CommandPaletteTab';
@@ -1,5 +1,15 @@
1
1
  import * as React from 'react';
2
+ import type { SxProps } from '../styled';
3
+ import type { CommandPaletteClasses } from './command-palette-classes';
2
4
  export type CommandPaletteFilterFn = (value: string, search: string, keywords?: string[]) => number;
5
+ export interface ICommandPaletteCommonProps {
6
+ /** Analytics identifier rendered as `data-analytics-id` */
7
+ analyticsId?: string;
8
+ /** Slot class overrides */
9
+ classes?: Partial<CommandPaletteClasses>;
10
+ /** Style overrides */
11
+ sx?: SxProps;
12
+ }
3
13
  export interface ICommandPaletteState {
4
14
  search: string;
5
15
  selectedValue: string;
@@ -25,7 +35,7 @@ export interface ICommandPaletteContextValue {
25
35
  inputId: string;
26
36
  listInnerRef: React.RefObject<HTMLDivElement | null>;
27
37
  }
28
- export interface ICommandPaletteProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onSelect'> {
38
+ export interface ICommandPaletteProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onSelect'>, ICommandPaletteCommonProps {
29
39
  /** Accessible label for the command palette */
30
40
  label?: string;
31
41
  /** Controlled search value */
@@ -46,25 +56,25 @@ export interface ICommandPaletteProps extends Omit<React.HTMLAttributes<HTMLDivE
46
56
  onSelect?(value: string): void;
47
57
  children?: React.ReactNode;
48
58
  }
49
- export interface ICommandPaletteInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'value' | 'type'> {
59
+ export interface ICommandPaletteInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'value' | 'type'>, ICommandPaletteCommonProps {
50
60
  /** Icon to show before the input */
51
61
  icon?: React.ReactNode;
52
62
  /** Callback when value changes */
53
63
  onValueChange?(search: string): void;
54
64
  }
55
- export interface ICommandPaletteListProps extends React.HTMLAttributes<HTMLDivElement> {
65
+ export interface ICommandPaletteListProps extends React.HTMLAttributes<HTMLDivElement>, ICommandPaletteCommonProps {
56
66
  children?: React.ReactNode;
57
67
  }
58
- export interface ICommandPaletteGroupProps extends React.HTMLAttributes<HTMLDivElement> {
68
+ export interface ICommandPaletteGroupProps extends React.HTMLAttributes<HTMLDivElement>, ICommandPaletteCommonProps {
59
69
  /** Heading text for the group */
60
70
  heading?: React.ReactNode;
61
71
  /** Force render even when all items are filtered out */
62
72
  forceMount?: boolean;
63
- /** Unique value for the group used for filtering */
73
+ /** Stable value used to identify the group in filtering state */
64
74
  value?: string;
65
75
  children?: React.ReactNode;
66
76
  }
67
- export interface ICommandPaletteItemProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onSelect'> {
77
+ export interface ICommandPaletteItemProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onSelect'>, ICommandPaletteCommonProps {
68
78
  /** Unique value for the item (auto-derived from textContent if not provided) */
69
79
  value?: string;
70
80
  /** Additional keywords for filtering */
@@ -81,24 +91,24 @@ export interface ICommandPaletteItemProps extends Omit<React.HTMLAttributes<HTML
81
91
  shortcut?: string | string[];
82
92
  children?: React.ReactNode;
83
93
  }
84
- export interface ICommandPaletteTabsProps extends React.HTMLAttributes<HTMLDivElement> {
94
+ export interface ICommandPaletteTabsProps extends React.HTMLAttributes<HTMLDivElement>, ICommandPaletteCommonProps {
85
95
  children?: React.ReactNode;
86
96
  }
87
- export interface ICommandPaletteTabProps extends React.HTMLAttributes<HTMLButtonElement> {
97
+ export interface ICommandPaletteTabProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, ICommandPaletteCommonProps {
88
98
  /** Whether this tab is currently active */
89
99
  active?: boolean;
90
100
  /** Callback when tab is clicked */
91
101
  onSelect?(): void;
92
102
  children?: React.ReactNode;
93
103
  }
94
- export interface ICommandPaletteSeparatorProps extends React.HTMLAttributes<HTMLDivElement> {
104
+ export interface ICommandPaletteSeparatorProps extends React.HTMLAttributes<HTMLDivElement>, ICommandPaletteCommonProps {
95
105
  /** Render even when search is active */
96
106
  alwaysRender?: boolean;
97
107
  }
98
- export interface ICommandPaletteEmptyProps extends React.HTMLAttributes<HTMLDivElement> {
108
+ export interface ICommandPaletteEmptyProps extends React.HTMLAttributes<HTMLDivElement>, ICommandPaletteCommonProps {
99
109
  children?: React.ReactNode;
100
110
  }
101
- export interface ICommandPaletteLoadingProps extends React.HTMLAttributes<HTMLDivElement> {
111
+ export interface ICommandPaletteLoadingProps extends React.HTMLAttributes<HTMLDivElement>, ICommandPaletteCommonProps {
102
112
  /** Progress percentage (0-100) */
103
113
  progress?: number;
104
114
  children?: React.ReactNode;
@@ -113,9 +123,9 @@ export interface ICommandPaletteDialogProps extends ICommandPaletteProps {
113
123
  /** Props to pass to the dialog content wrapper */
114
124
  contentProps?: React.HTMLAttributes<HTMLDivElement>;
115
125
  }
116
- export interface ICommandPaletteFooterProps extends React.HTMLAttributes<HTMLDivElement> {
126
+ export interface ICommandPaletteFooterProps extends React.HTMLAttributes<HTMLDivElement>, ICommandPaletteCommonProps {
117
127
  children?: React.ReactNode;
118
128
  }
119
- export interface ICommandPaletteShortcutKeyProps extends React.HTMLAttributes<HTMLElement> {
129
+ export interface ICommandPaletteShortcutKeyProps extends React.HTMLAttributes<HTMLElement>, ICommandPaletteCommonProps {
120
130
  children?: React.ReactNode;
121
131
  }
@@ -220,7 +220,7 @@ function useScheduleLayoutEffect() {
220
220
  }
221
221
  exports.CommandPalette = React.forwardRef(function (props, ref) {
222
222
  var _a;
223
- var _b = props.label, label = _b === void 0 ? 'Command palette' : _b, searchProp = props.search, _onSearchChange = props.onSearchChange, valueProp = props.value, _onValueChange = props.onValueChange, filterProp = props.filter, _c = props.shouldFilter, shouldFilter = _c === void 0 ? true : _c, _d = props.loop, loop = _d === void 0 ? false : _d, _onSelect = props.onSelect, children = props.children, className = props.className, rootProps = __rest(props, ["label", "search", "onSearchChange", "value", "onValueChange", "filter", "shouldFilter", "loop", "onSelect", "children", "className"]);
223
+ var _b = props.label, label = _b === void 0 ? 'Command palette' : _b, searchProp = props.search, _onSearchChange = props.onSearchChange, valueProp = props.value, _onValueChange = props.onValueChange, filterProp = props.filter, _c = props.shouldFilter, shouldFilter = _c === void 0 ? true : _c, _d = props.loop, loop = _d === void 0 ? false : _d, _onSelect = props.onSelect, analyticsId = props.analyticsId, propClasses = props.classes, children = props.children, className = props.className, sx = props.sx, rootProps = __rest(props, ["label", "search", "onSearchChange", "value", "onValueChange", "filter", "shouldFilter", "loop", "onSelect", "analyticsId", "classes", "children", "className", "sx"]);
224
224
  var generatedId = (0, use_id_1.useId)();
225
225
  var id = (_a = rootProps.id) !== null && _a !== void 0 ? _a : generatedId;
226
226
  var listId = id ? "".concat(id, "-list") : undefined;
@@ -469,9 +469,9 @@ exports.CommandPalette = React.forwardRef(function (props, ref) {
469
469
  }
470
470
  }
471
471
  }, [loop, store, propsRef]);
472
- var classes = (0, classes_1.useMergedClasses)(command_palette_classes_1.commandPaletteClasses, command_palette_classes_1.getCommandPaletteUtilityClass, undefined);
472
+ var classes = (0, classes_1.useMergedClasses)(command_palette_classes_1.commandPaletteClasses, command_palette_classes_1.getCommandPaletteUtilityClass, propClasses);
473
473
  return (React.createElement(command_palette_context_1.CommandPaletteStoreContext.Provider, { value: store.current },
474
474
  React.createElement(command_palette_context_1.CommandPaletteContext.Provider, { value: context },
475
- React.createElement(Root, __assign({ ref: ref, className: (0, clsx_1.default)(classes.root, className), tabIndex: -1, onKeyDown: handleKeyDown, "aria-label": label }, rootProps), children))));
475
+ React.createElement(Root, __assign({ ref: ref, sx: sx, className: (0, clsx_1.default)(classes.root, className), tabIndex: -1, onKeyDown: handleKeyDown, "aria-label": label }, (analyticsId && { 'data-analytics-id': analyticsId }), rootProps), children))));
476
476
  });
477
477
  exports.CommandPalette.displayName = 'CommandPalette';
@@ -9,6 +9,7 @@ export var commandPaletteClasses = generateUtilityClasses(commandPaletteComponen
9
9
  'inputWrapper',
10
10
  'inputIcon',
11
11
  'list',
12
+ 'listInner',
12
13
  'group',
13
14
  'groupHeading',
14
15
  'groupItems',
@@ -24,9 +24,10 @@ import * as React from 'react';
24
24
  import MuiDialog from '@mui/material/Dialog';
25
25
  import useForkRef from '@mui/utils/useForkRef';
26
26
  import { styled } from '../styled';
27
+ import { useMergedClasses } from '../styles/classes';
27
28
  import clsx from '../utils/clsx';
28
29
  import { CommandPalette } from './command-palette';
29
- import { commandPaletteClasses, commandPaletteComponentName } from './command-palette-classes';
30
+ import { commandPaletteClasses, commandPaletteComponentName, getCommandPaletteUtilityClass, } from './command-palette-classes';
30
31
  var StyledDialog = styled(MuiDialog, {
31
32
  name: commandPaletteComponentName,
32
33
  slot: 'Dialog',
@@ -45,18 +46,19 @@ var StyledDialog = styled(MuiDialog, {
45
46
  overflow: 'hidden',
46
47
  backgroundColor: theme.tokens.color_bg_layer_elevated,
47
48
  border: "1px solid ".concat(theme.tokens.color_border_default),
48
- boxShadow: "0px 33px 80px rgba(0, 0, 0, 0.12),\n 0px 13.7866px 33.4221px rgba(0, 0, 0, 0.086),\n 0px 7.37098px 17.869px rgba(0, 0, 0, 0.07),\n 0px 4.13211px 10.0172px rgba(0, 0, 0, 0.06),\n 0px 2.19453px 5.32008px rgba(0, 0, 0, 0.048),\n 0px 0.913195px 2.21381px rgba(0, 0, 0, 0.034)",
49
+ boxShadow: '0 -1px 0 -1px rgba(0,0,0,0.06), 0 1px 0 -1px rgba(0,0,0,0.06), 0 2px 24px -6px rgba(0,0,0,0.04), 0 4px 48px -12px rgba(0,0,0,0.04), 0 8px 80px -24px rgba(0,0,0,0.04)',
49
50
  },
50
51
  '& .MuiBackdrop-root': {
51
- backgroundColor: 'rgba(0, 0, 0, 0.4)',
52
- backdropFilter: 'blur(4px)',
52
+ backgroundColor: 'rgba(0, 0, 0, 0.04)',
53
+ backdropFilter: 'blur(2px)',
53
54
  },
54
55
  });
55
56
  });
56
57
  export var CommandPaletteDialog = React.forwardRef(function (props, ref) {
57
- var _a = props.open, open = _a === void 0 ? false : _a, onOpenChange = props.onOpenChange, overlayProps = props.overlayProps, contentProps = props.contentProps, children = props.children, className = props.className, commandPaletteProps = __rest(props, ["open", "onOpenChange", "overlayProps", "contentProps", "children", "className"]);
58
+ var _a = props.open, open = _a === void 0 ? false : _a, onOpenChange = props.onOpenChange, overlayProps = props.overlayProps, contentProps = props.contentProps, analyticsId = props.analyticsId, propClasses = props.classes, children = props.children, className = props.className, sx = props.sx, commandPaletteProps = __rest(props, ["open", "onOpenChange", "overlayProps", "contentProps", "analyticsId", "classes", "children", "className", "sx"]);
58
59
  var paletteRef = React.useRef(null);
59
60
  var handleRef = useForkRef(ref, paletteRef);
61
+ var classes = useMergedClasses(commandPaletteClasses, getCommandPaletteUtilityClass, propClasses);
60
62
  var handleEntered = React.useCallback(function () {
61
63
  requestAnimationFrame(function () {
62
64
  var _a;
@@ -67,7 +69,7 @@ export var CommandPaletteDialog = React.forwardRef(function (props, ref) {
67
69
  var handleClose = React.useCallback(function () {
68
70
  onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(false);
69
71
  }, [onOpenChange]);
70
- return (React.createElement(StyledDialog, { open: open, onClose: handleClose, TransitionProps: { onEntered: handleEntered }, className: clsx(commandPaletteClasses.dialog, className), maxWidth: false, BackdropProps: overlayProps, PaperProps: contentProps },
72
+ return (React.createElement(StyledDialog, __assign({ open: open, onClose: handleClose, TransitionProps: { onEntered: handleEntered }, sx: sx, className: clsx(classes.dialog, className), maxWidth: false, BackdropProps: overlayProps, PaperProps: __assign(__assign({}, contentProps), { className: clsx(commandPaletteClasses.dialogPaper, classes.dialogPaper, contentProps === null || contentProps === void 0 ? void 0 : contentProps.className) }) }, (analyticsId && { 'data-analytics-id': analyticsId })),
71
73
  React.createElement(CommandPalette, __assign({ ref: handleRef }, commandPaletteProps), children)));
72
74
  });
73
75
  CommandPaletteDialog.displayName = 'CommandPaletteDialog';
@@ -22,8 +22,9 @@ var __rest = (this && this.__rest) || function (s, e) {
22
22
  };
23
23
  import * as React from 'react';
24
24
  import { styled } from '../styled';
25
+ import { useMergedClasses } from '../styles/classes';
25
26
  import clsx from '../utils/clsx';
26
- import { commandPaletteClasses, commandPaletteComponentName } from './command-palette-classes';
27
+ import { commandPaletteClasses, commandPaletteComponentName, getCommandPaletteUtilityClass, } from './command-palette-classes';
27
28
  import { useCommandPaletteState } from './command-palette-context';
28
29
  var Root = styled('div', {
29
30
  name: commandPaletteComponentName,
@@ -41,11 +42,12 @@ var Root = styled('div', {
41
42
  });
42
43
  });
43
44
  export var CommandPaletteEmpty = React.forwardRef(function (props, ref) {
44
- var _a = props.children, children = _a === void 0 ? 'No results found.' : _a, className = props.className, emptyProps = __rest(props, ["children", "className"]);
45
+ var _a = props.children, children = _a === void 0 ? 'No results found.' : _a, analyticsId = props.analyticsId, propClasses = props.classes, className = props.className, sx = props.sx, emptyProps = __rest(props, ["children", "analyticsId", "classes", "className", "sx"]);
45
46
  var filteredCount = useCommandPaletteState(function (state) { return state.filtered.count; });
46
47
  var isSearching = useCommandPaletteState(function (state) { return state.search.length > 0; });
48
+ var classes = useMergedClasses(commandPaletteClasses, getCommandPaletteUtilityClass, propClasses);
47
49
  if (!isSearching || filteredCount > 0)
48
50
  return null;
49
- return (React.createElement(Root, __assign({ ref: ref, role: "presentation", className: clsx(commandPaletteClasses.empty, className) }, emptyProps), children));
51
+ return (React.createElement(Root, __assign({ ref: ref, sx: sx, role: "presentation", className: clsx(classes.empty, className) }, (analyticsId && { 'data-analytics-id': analyticsId }), emptyProps), children));
50
52
  });
51
53
  CommandPaletteEmpty.displayName = 'CommandPaletteEmpty';
@@ -22,8 +22,9 @@ var __rest = (this && this.__rest) || function (s, e) {
22
22
  };
23
23
  import * as React from 'react';
24
24
  import { styled } from '../styled';
25
+ import { useMergedClasses } from '../styles/classes';
25
26
  import clsx from '../utils/clsx';
26
- import { commandPaletteClasses, commandPaletteComponentName } from './command-palette-classes';
27
+ import { commandPaletteClasses, commandPaletteComponentName, getCommandPaletteUtilityClass, } from './command-palette-classes';
27
28
  var Root = styled('div', {
28
29
  name: commandPaletteComponentName,
29
30
  slot: 'Footer',
@@ -41,7 +42,7 @@ var Root = styled('div', {
41
42
  });
42
43
  var Kbd = styled('kbd', {
43
44
  name: commandPaletteComponentName,
44
- slot: 'FooterKbd',
45
+ slot: 'Kbd',
45
46
  })(function (_a) {
46
47
  var theme = _a.theme;
47
48
  return ({
@@ -61,12 +62,14 @@ var Kbd = styled('kbd', {
61
62
  });
62
63
  });
63
64
  export var CommandPaletteFooter = React.forwardRef(function (props, ref) {
64
- var children = props.children, className = props.className, footerProps = __rest(props, ["children", "className"]);
65
- return (React.createElement(Root, __assign({ ref: ref, className: clsx(commandPaletteClasses.footer, className) }, footerProps), children));
65
+ var children = props.children, analyticsId = props.analyticsId, propClasses = props.classes, className = props.className, sx = props.sx, footerProps = __rest(props, ["children", "analyticsId", "classes", "className", "sx"]);
66
+ var classes = useMergedClasses(commandPaletteClasses, getCommandPaletteUtilityClass, propClasses);
67
+ return (React.createElement(Root, __assign({ ref: ref, sx: sx, className: clsx(classes.footer, className) }, (analyticsId && { 'data-analytics-id': analyticsId }), footerProps), children));
66
68
  });
67
69
  CommandPaletteFooter.displayName = 'CommandPaletteFooter';
68
70
  export var CommandPaletteShortcutKey = React.forwardRef(function (props, ref) {
69
- var children = props.children, className = props.className, kbdProps = __rest(props, ["children", "className"]);
70
- return (React.createElement(Kbd, __assign({ ref: ref, className: clsx(commandPaletteClasses.kbd, className) }, kbdProps), children));
71
+ var children = props.children, analyticsId = props.analyticsId, propClasses = props.classes, className = props.className, sx = props.sx, kbdProps = __rest(props, ["children", "analyticsId", "classes", "className", "sx"]);
72
+ var classes = useMergedClasses(commandPaletteClasses, getCommandPaletteUtilityClass, propClasses);
73
+ return (React.createElement(Kbd, __assign({ ref: ref, sx: sx, className: clsx(classes.kbd, className) }, (analyticsId && { 'data-analytics-id': analyticsId }), kbdProps), children));
71
74
  });
72
75
  CommandPaletteShortcutKey.displayName = 'CommandPaletteShortcutKey';
@@ -22,9 +22,10 @@ var __rest = (this && this.__rest) || function (s, e) {
22
22
  };
23
23
  import * as React from 'react';
24
24
  import { styled } from '../styled';
25
+ import { useMergedClasses } from '../styles/classes';
25
26
  import clsx from '../utils/clsx';
26
27
  import { useId } from '../utils/use-id';
27
- import { commandPaletteClasses, commandPaletteComponentName } from './command-palette-classes';
28
+ import { commandPaletteClasses, commandPaletteComponentName, getCommandPaletteUtilityClass, } from './command-palette-classes';
28
29
  import { CommandPaletteGroupContext, useCommandPaletteContext, useCommandPaletteState, } from './command-palette-context';
29
30
  var Root = styled('div', {
30
31
  name: commandPaletteComponentName,
@@ -58,23 +59,25 @@ var Items = styled('div', {
58
59
  outline: 'none',
59
60
  }); });
60
61
  export var CommandPaletteGroup = React.forwardRef(function (props, ref) {
61
- var heading = props.heading, _a = props.forceMount, forceMount = _a === void 0 ? false : _a, children = props.children, className = props.className, groupProps = __rest(props, ["heading", "forceMount", "children", "className"]);
62
- var id = useId() || '';
63
- var headingId = "".concat(id, "-heading");
62
+ var heading = props.heading, _a = props.forceMount, forceMount = _a === void 0 ? false : _a, value = props.value, analyticsId = props.analyticsId, propClasses = props.classes, children = props.children, className = props.className, sx = props.sx, groupProps = __rest(props, ["heading", "forceMount", "value", "analyticsId", "classes", "children", "className", "sx"]);
63
+ var generatedId = useId() || '';
64
+ var groupId = value || generatedId;
65
+ var headingId = generatedId ? "".concat(generatedId, "-heading") : undefined;
64
66
  var context = useCommandPaletteContext();
67
+ var classes = useMergedClasses(commandPaletteClasses, getCommandPaletteUtilityClass, propClasses);
65
68
  React.useLayoutEffect(function () {
66
- var cleanup = context.group(id);
69
+ var cleanup = context.group(groupId);
67
70
  return cleanup;
68
- }, [context, id]);
71
+ }, [context, groupId]);
69
72
  var filteredState = useCommandPaletteState(function (state) { return state.filtered; });
70
73
  var search = useCommandPaletteState(function (state) { return state.search; });
71
- var groupCount = filteredState.groups.get(id);
74
+ var groupCount = filteredState.groups.get(groupId);
72
75
  var isVisible = forceMount || context.filter === false || !search || (groupCount !== undefined && groupCount > 0);
73
76
  if (!isVisible)
74
77
  return null;
75
- return (React.createElement(Root, __assign({ ref: ref, className: clsx(commandPaletteClasses.group, className), role: "presentation" }, groupProps),
76
- heading && (React.createElement(Heading, { id: headingId, className: commandPaletteClasses.groupHeading, "aria-hidden": true }, heading)),
77
- React.createElement(CommandPaletteGroupContext.Provider, { value: id },
78
- React.createElement(Items, { role: "group", className: commandPaletteClasses.groupItems, "aria-labelledby": heading ? headingId : undefined }, children))));
78
+ return (React.createElement(Root, __assign({ ref: ref, sx: sx, className: clsx(classes.group, className), role: "presentation" }, (analyticsId && { 'data-analytics-id': analyticsId }), groupProps),
79
+ heading && (React.createElement(Heading, { id: headingId, className: classes.groupHeading, "aria-hidden": true }, heading)),
80
+ React.createElement(CommandPaletteGroupContext.Provider, { value: groupId },
81
+ React.createElement(Items, { role: "group", className: classes.groupItems, "aria-labelledby": heading ? headingId : undefined }, children))));
79
82
  });
80
83
  CommandPaletteGroup.displayName = 'CommandPaletteGroup';
@@ -23,8 +23,9 @@ var __rest = (this && this.__rest) || function (s, e) {
23
23
  import * as React from 'react';
24
24
  import { SearchIcon } from '../icon';
25
25
  import { styled } from '../styled';
26
+ import { useMergedClasses } from '../styles/classes';
26
27
  import clsx from '../utils/clsx';
27
- import { commandPaletteClasses, commandPaletteComponentName } from './command-palette-classes';
28
+ import { commandPaletteClasses, commandPaletteComponentName, getCommandPaletteUtilityClass, } from './command-palette-classes';
28
29
  import { useCommandPaletteContext, useCommandPaletteState, useCommandPaletteStore } from './command-palette-context';
29
30
  var Wrapper = styled('div', {
30
31
  name: commandPaletteComponentName,
@@ -35,7 +36,7 @@ var Wrapper = styled('div', {
35
36
  display: 'flex',
36
37
  alignItems: 'center',
37
38
  gap: theme.spacing(1.5),
38
- padding: "".concat(theme.spacing(1.5), " ").concat(theme.spacing(2)),
39
+ padding: "".concat(theme.spacing(1.75), " ").concat(theme.spacing(2.5)),
39
40
  });
40
41
  });
41
42
  var IconWrapper = styled('div', {
@@ -66,8 +67,9 @@ var InputElement = styled('input', {
66
67
  outline: 'none',
67
68
  backgroundColor: 'transparent',
68
69
  color: theme.tokens.color_fg_default,
69
- fontSize: theme.typography.body1.fontSize,
70
- lineHeight: theme.typography.body1.lineHeight,
70
+ fontSize: theme.typography.body2.fontSize,
71
+ fontWeight: theme.typography.fontWeightMedium,
72
+ lineHeight: theme.typography.body2.lineHeight,
71
73
  fontFamily: theme.typography.fontFamily,
72
74
  caretColor: theme.tokens.color_fg_brand_primary,
73
75
  '&::placeholder': {
@@ -79,7 +81,8 @@ var InputElement = styled('input', {
79
81
  });
80
82
  });
81
83
  export var CommandPaletteInput = React.forwardRef(function (props, ref) {
82
- var _a = props.icon, icon = _a === void 0 ? React.createElement(SearchIcon, { size: 20 }) : _a, _b = props.placeholder, placeholder = _b === void 0 ? 'Search for commands...' : _b, onValueChange = props.onValueChange, className = props.className, inputProps = __rest(props, ["icon", "placeholder", "onValueChange", "className"]);
84
+ var _a = props.icon, icon = _a === void 0 ? React.createElement(SearchIcon, { size: 20 }) : _a, _b = props.placeholder, placeholder = _b === void 0 ? 'Search for commands...' : _b, onValueChange = props.onValueChange, analyticsId = props.analyticsId, propClasses = props.classes, className = props.className, sx = props.sx, inputProps = __rest(props, ["icon", "placeholder", "onValueChange", "analyticsId", "classes", "className", "sx"]);
85
+ var classes = useMergedClasses(commandPaletteClasses, getCommandPaletteUtilityClass, propClasses);
83
86
  var context = useCommandPaletteContext();
84
87
  var store = useCommandPaletteStore();
85
88
  var search = useCommandPaletteState(function (state) { return state.search; });
@@ -98,8 +101,8 @@ export var CommandPaletteInput = React.forwardRef(function (props, ref) {
98
101
  store.setState('search', e.target.value);
99
102
  onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange(e.target.value);
100
103
  }, [store, onValueChange]);
101
- return (React.createElement(Wrapper, { className: clsx(commandPaletteClasses.inputWrapper, className) },
102
- icon && React.createElement(IconWrapper, { className: commandPaletteClasses.inputIcon }, icon),
103
- React.createElement(InputElement, __assign({ ref: ref, id: context.inputId, className: commandPaletteClasses.input, type: "text", role: "combobox", "aria-expanded": true, "aria-controls": context.listId, "aria-label": placeholder, "aria-autocomplete": "list", autoComplete: "off", autoCorrect: "off", spellCheck: false, placeholder: placeholder, value: search, onChange: handleChange, onCompositionStart: handleCompositionStart, onCompositionEnd: handleCompositionEnd }, inputProps))));
104
+ return (React.createElement(Wrapper, __assign({ sx: sx, className: clsx(classes.inputWrapper, className) }, (analyticsId && { 'data-analytics-id': analyticsId })),
105
+ icon && React.createElement(IconWrapper, { className: classes.inputIcon }, icon),
106
+ React.createElement(InputElement, __assign({ ref: ref, id: context.inputId, className: classes.input, type: "text", role: "combobox", "aria-expanded": true, "aria-controls": context.listId, "aria-label": placeholder, "aria-autocomplete": "list", autoComplete: "off", autoCorrect: "off", spellCheck: false, placeholder: placeholder, value: search, onChange: handleChange, onCompositionStart: handleCompositionStart, onCompositionEnd: handleCompositionEnd }, inputProps))));
104
107
  });
105
108
  CommandPaletteInput.displayName = 'CommandPaletteInput';
@@ -48,17 +48,18 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
48
48
  import * as React from 'react';
49
49
  import useForkRef from '@mui/utils/useForkRef';
50
50
  import { styled } from '../styled';
51
+ import { useMergedClasses } from '../styles/classes';
51
52
  import clsx from '../utils/clsx';
52
53
  import { useId } from '../utils/use-id';
53
54
  import { VALUE_ATTR } from './command-palette';
54
- import { commandPaletteClasses, commandPaletteComponentName } from './command-palette-classes';
55
+ import { commandPaletteClasses, commandPaletteComponentName, getCommandPaletteUtilityClass, } from './command-palette-classes';
55
56
  import { CommandPaletteGroupContext, useCommandPaletteContext, useCommandPaletteState, useCommandPaletteStore, } from './command-palette-context';
56
57
  var Root = styled('div', {
57
58
  name: commandPaletteComponentName,
58
59
  slot: 'Item',
59
60
  })(function (_a) {
60
61
  var theme = _a.theme, ownerState = _a.ownerState;
61
- return (__assign(__assign(__assign(__assign({ display: 'flex', alignItems: 'center', gap: theme.spacing(1.5), padding: "".concat(theme.spacing(1), " ").concat(theme.spacing(1.5)), borderRadius: theme.spacing(1), cursor: 'pointer', userSelect: 'none', fontSize: theme.typography.body2.fontSize, fontWeight: theme.typography.fontWeightMedium, lineHeight: theme.typography.body2.lineHeight, color: theme.tokens.color_fg_default, transition: theme.transitions.create(['background-color', 'color'], {
62
+ return (__assign(__assign(__assign(__assign({ display: 'flex', alignItems: 'center', gap: theme.spacing(1.5), padding: "".concat(theme.spacing(1), " ").concat(theme.spacing(1.5)), borderRadius: theme.spacing(0.75), cursor: 'pointer', userSelect: 'none', fontSize: theme.typography.body2.fontSize, fontWeight: theme.typography.fontWeightMedium, lineHeight: theme.typography.body2.lineHeight, color: theme.tokens.color_fg_default, transition: theme.transitions.create(['background-color', 'color'], {
62
63
  duration: theme.transitions.duration.shortest,
63
64
  }) }, (ownerState.isSelected && {
64
65
  backgroundColor: theme.tokens.color_bg_interactive_hover,
@@ -160,7 +161,7 @@ function useValue(id, ref, deps) {
160
161
  export var CommandPaletteItem = React.forwardRef(function (props, ref) {
161
162
  var _a;
162
163
  var _b, _c;
163
- var valueProp = props.value, keywords = props.keywords, _d = props.disabled, disabled = _d === void 0 ? false : _d, onSelect = props.onSelect, _e = props.forceMount, forceMount = _e === void 0 ? false : _e, icon = props.icon, shortcut = props.shortcut, children = props.children, className = props.className, itemProps = __rest(props, ["value", "keywords", "disabled", "onSelect", "forceMount", "icon", "shortcut", "children", "className"]);
164
+ var valueProp = props.value, keywords = props.keywords, _d = props.disabled, disabled = _d === void 0 ? false : _d, onSelect = props.onSelect, _e = props.forceMount, forceMount = _e === void 0 ? false : _e, icon = props.icon, shortcut = props.shortcut, analyticsId = props.analyticsId, propClasses = props.classes, children = props.children, className = props.className, sx = props.sx, itemProps = __rest(props, ["value", "keywords", "disabled", "onSelect", "forceMount", "icon", "shortcut", "analyticsId", "classes", "children", "className", "sx"]);
164
165
  var generatedId = useId();
165
166
  var idRef = React.useRef();
166
167
  if (!idRef.current) {
@@ -172,6 +173,7 @@ export var CommandPaletteItem = React.forwardRef(function (props, ref) {
172
173
  var context = useCommandPaletteContext();
173
174
  var store = useCommandPaletteStore();
174
175
  var groupId = React.useContext(CommandPaletteGroupContext);
176
+ var classes = useMergedClasses(commandPaletteClasses, getCommandPaletteUtilityClass, propClasses);
175
177
  var itemValue = useValue(id, itemRef, [valueProp, keywords, children]);
176
178
  var selectedValue = useCommandPaletteState(function (state) { return state.selectedValue; });
177
179
  var isSelected = selectedValue === itemValue && itemValue !== '';
@@ -196,9 +198,9 @@ export var CommandPaletteItem = React.forwardRef(function (props, ref) {
196
198
  var shortcutKeys = shortcut ? (Array.isArray(shortcut) ? shortcut : shortcut.split('+')) : null;
197
199
  if (!isVisible)
198
200
  return null;
199
- return (React.createElement(Root, __assign((_a = { ref: mergedRef, ownerState: { isSelected: isSelected, disabled: disabled }, className: clsx(commandPaletteClasses.item, isSelected && commandPaletteClasses.itemSelected, className), role: "option", "aria-selected": isSelected, "aria-disabled": disabled, "data-disabled": disabled || undefined }, _a[VALUE_ATTR] = encodeURIComponent(itemValue), _a.onPointerMove = handlePointerMove, _a.onClick = handleClick, _a), itemProps),
200
- icon && React.createElement(ItemIcon, { className: commandPaletteClasses.itemIcon }, icon),
201
- React.createElement(ItemLabel, { className: commandPaletteClasses.itemLabel }, children),
202
- shortcutKeys && (React.createElement(ItemShortcut, { className: commandPaletteClasses.itemShortcut }, shortcutKeys.map(function (key, i) { return (React.createElement(Kbd, { key: i, className: commandPaletteClasses.kbd }, key)); })))));
201
+ return (React.createElement(Root, __assign((_a = { ref: mergedRef, sx: sx, ownerState: { isSelected: isSelected, disabled: disabled }, className: clsx(classes.item, isSelected && classes.itemSelected, className), role: "option", "aria-selected": isSelected, "aria-disabled": disabled, "data-disabled": disabled || undefined }, _a[VALUE_ATTR] = encodeURIComponent(itemValue), _a.onPointerMove = handlePointerMove, _a.onClick = handleClick, _a), (analyticsId && { 'data-analytics-id': analyticsId }), itemProps),
202
+ icon && React.createElement(ItemIcon, { className: classes.itemIcon }, icon),
203
+ React.createElement(ItemLabel, { className: classes.itemLabel }, children),
204
+ shortcutKeys && (React.createElement(ItemShortcut, { className: classes.itemShortcut }, shortcutKeys.map(function (key, i) { return (React.createElement(Kbd, { key: i, className: classes.kbd }, key)); })))));
203
205
  });
204
206
  CommandPaletteItem.displayName = 'CommandPaletteItem';
@@ -22,8 +22,9 @@ var __rest = (this && this.__rest) || function (s, e) {
22
22
  };
23
23
  import * as React from 'react';
24
24
  import { styled } from '../styled';
25
+ import { useMergedClasses } from '../styles/classes';
25
26
  import clsx from '../utils/clsx';
26
- import { commandPaletteClasses, commandPaletteComponentName } from './command-palette-classes';
27
+ import { commandPaletteClasses, commandPaletteComponentName, getCommandPaletteUtilityClass, } from './command-palette-classes';
27
28
  import { useCommandPaletteContext } from './command-palette-context';
28
29
  var Root = styled('div', {
29
30
  name: commandPaletteComponentName,
@@ -54,9 +55,10 @@ var Inner = styled('div', {
54
55
  slot: 'ListInner',
55
56
  })(function () { return ({}); });
56
57
  export var CommandPaletteList = React.forwardRef(function (props, ref) {
57
- var children = props.children, className = props.className, style = props.style, listProps = __rest(props, ["children", "className", "style"]);
58
+ var children = props.children, analyticsId = props.analyticsId, propClasses = props.classes, className = props.className, style = props.style, sx = props.sx, listProps = __rest(props, ["children", "analyticsId", "classes", "className", "style", "sx"]);
58
59
  var context = useCommandPaletteContext();
59
- return (React.createElement(Root, __assign({ ref: ref, id: context.listId, role: "listbox", "aria-label": "Suggestions", className: clsx(commandPaletteClasses.list, className), style: style }, listProps),
60
- React.createElement(Inner, { ref: context.listInnerRef }, children)));
60
+ var classes = useMergedClasses(commandPaletteClasses, getCommandPaletteUtilityClass, propClasses);
61
+ return (React.createElement(Root, __assign({ ref: ref, id: context.listId, role: "listbox", "aria-label": "Suggestions", sx: sx, className: clsx(classes.list, className), style: style }, (analyticsId && { 'data-analytics-id': analyticsId }), listProps),
62
+ React.createElement(Inner, { ref: context.listInnerRef, className: classes.listInner }, children)));
61
63
  });
62
64
  CommandPaletteList.displayName = 'CommandPaletteList';
@@ -23,8 +23,9 @@ var __rest = (this && this.__rest) || function (s, e) {
23
23
  import * as React from 'react';
24
24
  import { Spinner } from '../spinner';
25
25
  import { styled } from '../styled';
26
+ import { useMergedClasses } from '../styles/classes';
26
27
  import clsx from '../utils/clsx';
27
- import { commandPaletteClasses, commandPaletteComponentName } from './command-palette-classes';
28
+ import { commandPaletteClasses, commandPaletteComponentName, getCommandPaletteUtilityClass, } from './command-palette-classes';
28
29
  var Root = styled('div', {
29
30
  name: commandPaletteComponentName,
30
31
  slot: 'Loading',
@@ -42,8 +43,9 @@ var Root = styled('div', {
42
43
  });
43
44
  });
44
45
  export var CommandPaletteLoading = React.forwardRef(function (props, ref) {
45
- var _a = props.progress, progress = _a === void 0 ? 0 : _a, _b = props.children, children = _b === void 0 ? 'Loading...' : _b, className = props.className, loadingProps = __rest(props, ["progress", "children", "className"]);
46
- return (React.createElement(Root, __assign({ ref: ref, role: "progressbar", "aria-valuenow": progress, "aria-valuemin": 0, "aria-valuemax": 100, "aria-label": "Loading results", className: clsx(commandPaletteClasses.loading, className) }, loadingProps),
46
+ var _a = props.progress, progress = _a === void 0 ? 0 : _a, _b = props.children, children = _b === void 0 ? 'Loading...' : _b, analyticsId = props.analyticsId, propClasses = props.classes, className = props.className, sx = props.sx, loadingProps = __rest(props, ["progress", "children", "analyticsId", "classes", "className", "sx"]);
47
+ var classes = useMergedClasses(commandPaletteClasses, getCommandPaletteUtilityClass, propClasses);
48
+ return (React.createElement(Root, __assign({ ref: ref, sx: sx, role: "progressbar", "aria-valuenow": progress, "aria-valuemin": 0, "aria-valuemax": 100, "aria-label": "Loading results", className: clsx(classes.loading, className) }, (analyticsId && { 'data-analytics-id': analyticsId }), loadingProps),
47
49
  React.createElement(Spinner, null),
48
50
  children));
49
51
  });
@@ -22,8 +22,9 @@ var __rest = (this && this.__rest) || function (s, e) {
22
22
  };
23
23
  import * as React from 'react';
24
24
  import { styled } from '../styled';
25
+ import { useMergedClasses } from '../styles/classes';
25
26
  import clsx from '../utils/clsx';
26
- import { commandPaletteClasses, commandPaletteComponentName } from './command-palette-classes';
27
+ import { commandPaletteClasses, commandPaletteComponentName, getCommandPaletteUtilityClass, } from './command-palette-classes';
27
28
  import { useCommandPaletteState } from './command-palette-context';
28
29
  var Root = styled('div', {
29
30
  name: commandPaletteComponentName,
@@ -37,11 +38,12 @@ var Root = styled('div', {
37
38
  });
38
39
  });
39
40
  export var CommandPaletteSeparator = React.forwardRef(function (props, ref) {
40
- var _a = props.alwaysRender, alwaysRender = _a === void 0 ? false : _a, className = props.className, separatorProps = __rest(props, ["alwaysRender", "className"]);
41
+ var _a = props.alwaysRender, alwaysRender = _a === void 0 ? false : _a, analyticsId = props.analyticsId, propClasses = props.classes, className = props.className, sx = props.sx, separatorProps = __rest(props, ["alwaysRender", "analyticsId", "classes", "className", "sx"]);
41
42
  var search = useCommandPaletteState(function (state) { return state.search; });
42
43
  var isSearching = search.length > 0;
44
+ var classes = useMergedClasses(commandPaletteClasses, getCommandPaletteUtilityClass, propClasses);
43
45
  if (!alwaysRender && isSearching)
44
46
  return null;
45
- return (React.createElement(Root, __assign({ ref: ref, role: "separator", className: clsx(commandPaletteClasses.separator, className) }, separatorProps)));
47
+ return (React.createElement(Root, __assign({ ref: ref, sx: sx, role: "separator", className: clsx(classes.separator, className) }, (analyticsId && { 'data-analytics-id': analyticsId }), separatorProps)));
46
48
  });
47
49
  CommandPaletteSeparator.displayName = 'CommandPaletteSeparator';
@@ -23,8 +23,9 @@ var __rest = (this && this.__rest) || function (s, e) {
23
23
  import * as React from 'react';
24
24
  import useForkRef from '@mui/utils/useForkRef';
25
25
  import { styled } from '../styled';
26
+ import { useMergedClasses } from '../styles/classes';
26
27
  import clsx from '../utils/clsx';
27
- import { commandPaletteClasses, commandPaletteComponentName } from './command-palette-classes';
28
+ import { commandPaletteClasses, commandPaletteComponentName, getCommandPaletteUtilityClass, } from './command-palette-classes';
28
29
  var Root = styled('div', {
29
30
  name: commandPaletteComponentName,
30
31
  slot: 'Tabs',
@@ -34,7 +35,7 @@ var Root = styled('div', {
34
35
  display: 'flex',
35
36
  alignItems: 'center',
36
37
  gap: theme.spacing(0.5),
37
- padding: "".concat(theme.spacing(1), " ").concat(theme.spacing(2)),
38
+ padding: "".concat(theme.spacing(1), " ").concat(theme.spacing(1.25)),
38
39
  overflowX: 'auto',
39
40
  scrollbarWidth: 'none',
40
41
  '&::-webkit-scrollbar': {
@@ -47,23 +48,24 @@ var TabButton = styled('button', {
47
48
  slot: 'Tab',
48
49
  })(function (_a) {
49
50
  var theme = _a.theme, ownerState = _a.ownerState;
50
- 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'], {
51
+ return (__assign(__assign(__assign({ display: 'inline-flex', alignItems: 'center', justifyContent: 'center', padding: "".concat(theme.spacing(0.5), " ").concat(theme.spacing(1.25)), borderRadius: theme.spacing(0.75), 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'], {
51
52
  duration: theme.transitions.duration.shortest,
52
53
  }), color: theme.tokens.color_fg_disabled, backgroundColor: 'transparent' }, (ownerState.active && {
53
54
  color: theme.tokens.color_fg_default,
54
- backgroundColor: theme.tokens.color_bg_state_neutral_subtle,
55
+ backgroundColor: theme.tokens.color_bg_layer_alternate_bold,
55
56
  })), (!ownerState.active && {
56
57
  '&:hover': {
57
58
  backgroundColor: theme.tokens.color_bg_interactive_hover,
58
59
  },
59
60
  })), { '&:focus-visible': {
60
61
  outline: 'none',
61
- backgroundColor: theme.tokens.color_bg_interactive_hover,
62
+ backgroundColor: theme.tokens.color_bg_link_pressed,
62
63
  } }));
63
64
  });
64
65
  export var CommandPaletteTabs = React.forwardRef(function (props, ref) {
65
- var children = props.children, className = props.className, tabsProps = __rest(props, ["children", "className"]);
66
+ var children = props.children, analyticsId = props.analyticsId, propClasses = props.classes, className = props.className, sx = props.sx, tabsProps = __rest(props, ["children", "analyticsId", "classes", "className", "sx"]);
66
67
  var tabsRef = React.useRef(null);
68
+ var classes = useMergedClasses(commandPaletteClasses, getCommandPaletteUtilityClass, propClasses);
67
69
  var handleKeyDown = React.useCallback(function (e) {
68
70
  var tabs = tabsRef.current;
69
71
  if (!tabs)
@@ -93,15 +95,16 @@ export var CommandPaletteTabs = React.forwardRef(function (props, ref) {
93
95
  }
94
96
  }, []);
95
97
  var mergedRef = useForkRef(tabsRef, ref);
96
- return (React.createElement(Root, __assign({ ref: mergedRef, role: "tablist", className: clsx(commandPaletteClasses.tabs, className), onKeyDown: handleKeyDown }, tabsProps), children));
98
+ return (React.createElement(Root, __assign({ ref: mergedRef, role: "tablist", sx: sx, className: clsx(classes.tabs, className), onKeyDown: handleKeyDown }, (analyticsId && { 'data-analytics-id': analyticsId }), tabsProps), children));
97
99
  });
98
100
  CommandPaletteTabs.displayName = 'CommandPaletteTabs';
99
101
  export var CommandPaletteTab = React.forwardRef(function (props, ref) {
100
- 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"]);
102
+ var _a = props.active, active = _a === void 0 ? false : _a, onSelect = props.onSelect, analyticsId = props.analyticsId, propClasses = props.classes, children = props.children, className = props.className, onClick = props.onClick, sx = props.sx, tabProps = __rest(props, ["active", "onSelect", "analyticsId", "classes", "children", "className", "onClick", "sx"]);
103
+ var classes = useMergedClasses(commandPaletteClasses, getCommandPaletteUtilityClass, propClasses);
101
104
  var handleClick = React.useCallback(function (e) {
102
105
  onSelect === null || onSelect === void 0 ? void 0 : onSelect();
103
106
  onClick === null || onClick === void 0 ? void 0 : onClick(e);
104
107
  }, [onSelect, onClick]);
105
- return (React.createElement(TabButton, __assign({ ref: ref, role: "tab", type: "button", "aria-selected": active, tabIndex: active ? 0 : -1, ownerState: { active: active }, className: clsx(commandPaletteClasses.tab, active && commandPaletteClasses.tabSelected, className), onClick: handleClick }, tabProps), children));
108
+ return (React.createElement(TabButton, __assign({ ref: ref, role: "tab", type: "button", "aria-selected": active, tabIndex: active ? 0 : -1, sx: sx, ownerState: { active: active }, className: clsx(classes.tab, active && classes.tabSelected, className), onClick: handleClick }, (analyticsId && { 'data-analytics-id': analyticsId }), tabProps), children));
106
109
  });
107
110
  CommandPaletteTab.displayName = 'CommandPaletteTab';
@@ -180,7 +180,7 @@ function useScheduleLayoutEffect() {
180
180
  }
181
181
  export var CommandPalette = React.forwardRef(function (props, ref) {
182
182
  var _a;
183
- var _b = props.label, label = _b === void 0 ? 'Command palette' : _b, searchProp = props.search, _onSearchChange = props.onSearchChange, valueProp = props.value, _onValueChange = props.onValueChange, filterProp = props.filter, _c = props.shouldFilter, shouldFilter = _c === void 0 ? true : _c, _d = props.loop, loop = _d === void 0 ? false : _d, _onSelect = props.onSelect, children = props.children, className = props.className, rootProps = __rest(props, ["label", "search", "onSearchChange", "value", "onValueChange", "filter", "shouldFilter", "loop", "onSelect", "children", "className"]);
183
+ var _b = props.label, label = _b === void 0 ? 'Command palette' : _b, searchProp = props.search, _onSearchChange = props.onSearchChange, valueProp = props.value, _onValueChange = props.onValueChange, filterProp = props.filter, _c = props.shouldFilter, shouldFilter = _c === void 0 ? true : _c, _d = props.loop, loop = _d === void 0 ? false : _d, _onSelect = props.onSelect, analyticsId = props.analyticsId, propClasses = props.classes, children = props.children, className = props.className, sx = props.sx, rootProps = __rest(props, ["label", "search", "onSearchChange", "value", "onValueChange", "filter", "shouldFilter", "loop", "onSelect", "analyticsId", "classes", "children", "className", "sx"]);
184
184
  var generatedId = useId();
185
185
  var id = (_a = rootProps.id) !== null && _a !== void 0 ? _a : generatedId;
186
186
  var listId = id ? "".concat(id, "-list") : undefined;
@@ -429,10 +429,10 @@ export var CommandPalette = React.forwardRef(function (props, ref) {
429
429
  }
430
430
  }
431
431
  }, [loop, store, propsRef]);
432
- var classes = useMergedClasses(commandPaletteClasses, getCommandPaletteUtilityClass, undefined);
432
+ var classes = useMergedClasses(commandPaletteClasses, getCommandPaletteUtilityClass, propClasses);
433
433
  return (React.createElement(CommandPaletteStoreContext.Provider, { value: store.current },
434
434
  React.createElement(CommandPaletteContext.Provider, { value: context },
435
- React.createElement(Root, __assign({ ref: ref, className: clsx(classes.root, className), tabIndex: -1, onKeyDown: handleKeyDown, "aria-label": label }, rootProps), children))));
435
+ React.createElement(Root, __assign({ ref: ref, sx: sx, className: clsx(classes.root, className), tabIndex: -1, onKeyDown: handleKeyDown, "aria-label": label }, (analyticsId && { 'data-analytics-id': analyticsId }), rootProps), children))));
436
436
  });
437
437
  CommandPalette.displayName = 'CommandPalette';
438
438
  export { VALUE_ATTR };
@@ -17,6 +17,7 @@ export var createMuiInputLabelOverrides = function (_a) {
17
17
  _b["&.".concat(inputLabelClasses.shrink)] = {
18
18
  transform: 'none',
19
19
  },
20
+ _b.userSelect = 'auto',
20
21
  _b),
21
22
  asterisk: {
22
23
  color: tokens.color_fg_state_neutral,
@@ -1,3 +1,3 @@
1
- import type { InputLabelProps, InputLabelClassKey } from '@mui/material/InputLabel';
1
+ import type { InputLabelClassKey, InputLabelProps } from '@mui/material/InputLabel';
2
2
  import type { ComponentOverrideCreator } from '../../theme/create-component-overrides';
3
3
  export declare const createMuiInputLabelOverrides: ComponentOverrideCreator<InputLabelProps, InputLabelClassKey>;
@@ -20,6 +20,7 @@ var createMuiInputLabelOverrides = function (_a) {
20
20
  _b["&.".concat(InputLabel_1.inputLabelClasses.shrink)] = {
21
21
  transform: 'none',
22
22
  },
23
+ _b.userSelect = 'auto',
23
24
  _b),
24
25
  asterisk: {
25
26
  color: tokens.color_fg_state_neutral,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@auth0/quantum-product",
3
- "version": "2.10.6",
3
+ "version": "2.10.7",
4
4
  "sideEffects": false,
5
5
  "license": "Apache-2.0",
6
6
  "publishConfig": {