diff --git a/docs/data/base/components/select/UnstyledSelectBasic/tailwind/index.js b/docs/data/base/components/select/UnstyledSelectBasic/tailwind/index.js
index 7a3ccd8c3543f4..39a4f1643d4982 100644
--- a/docs/data/base/components/select/UnstyledSelectBasic/tailwind/index.js
+++ b/docs/data/base/components/select/UnstyledSelectBasic/tailwind/index.js
@@ -50,12 +50,7 @@ export default function UnstyledSelectBasic() {
return (
-
+
@@ -67,9 +62,13 @@ export default function UnstyledSelectBasic() {
const resolveSlotProps = (fn, args) => (typeof fn === 'function' ? fn(args) : fn);
const CustomSelect = React.forwardRef(function CustomSelect(props, ref) {
+ // Replace this with your app logic for determining dark modes
+ const isDarkMode = useIsDarkMode();
+
return (
);
});
@@ -129,149 +130,7 @@ CustomSelect.propTypes = {
*/
slotProps: PropTypes.shape({
listbox: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
- popper: PropTypes.oneOfType([
- PropTypes.func,
- PropTypes.shape({
- anchorEl: PropTypes.oneOfType([
- function (props, propName) {
- if (props[propName] == null) {
- return new Error(
- "Prop '" + propName + "' is required but wasn't specified",
- );
- } else if (
- typeof props[propName] !== 'object' ||
- props[propName].nodeType !== 1
- ) {
- return new Error(
- "Expected prop '" + propName + "' to be of type Element",
- );
- }
- },
- PropTypes.func,
- PropTypes.shape({
- contextElement: function (props, propName) {
- if (props[propName] == null) {
- return null;
- } else if (
- typeof props[propName] !== 'object' ||
- props[propName].nodeType !== 1
- ) {
- return new Error(
- "Expected prop '" + propName + "' to be of type Element",
- );
- }
- },
- getBoundingClientRect: PropTypes.func.isRequired,
- }),
- ]),
- children: PropTypes.oneOfType([
- PropTypes.element,
- PropTypes.func,
- PropTypes.number,
- PropTypes.shape({
- '__@iterator@62': PropTypes.func.isRequired,
- }),
- PropTypes.string,
- PropTypes.bool,
- ]),
- container: PropTypes.oneOfType([
- function (props, propName) {
- if (props[propName] == null) {
- return new Error(
- "Prop '" + propName + "' is required but wasn't specified",
- );
- } else if (
- typeof props[propName] !== 'object' ||
- props[propName].nodeType !== 1
- ) {
- return new Error(
- "Expected prop '" + propName + "' to be of type Element",
- );
- }
- },
- PropTypes.func,
- ]),
- direction: PropTypes.oneOf(['ltr', 'rtl']),
- disablePortal: PropTypes.bool,
- keepMounted: PropTypes.bool,
- modifiers: PropTypes.arrayOf(
- PropTypes.shape({
- data: PropTypes.object,
- effect: PropTypes.func,
- enabled: PropTypes.bool,
- fn: PropTypes.func,
- name: PropTypes.any,
- options: PropTypes.object,
- phase: PropTypes.oneOf([
- 'afterMain',
- 'afterRead',
- 'afterWrite',
- 'beforeMain',
- 'beforeRead',
- 'beforeWrite',
- 'main',
- 'read',
- 'write',
- ]),
- requires: PropTypes.arrayOf(PropTypes.string),
- requiresIfExists: PropTypes.arrayOf(PropTypes.string),
- }),
- ),
- open: PropTypes.bool,
- placement: PropTypes.oneOf([
- 'auto-end',
- 'auto-start',
- 'auto',
- 'bottom-end',
- 'bottom-start',
- 'bottom',
- 'left-end',
- 'left-start',
- 'left',
- 'right-end',
- 'right-start',
- 'right',
- 'top-end',
- 'top-start',
- 'top',
- ]),
- popperOptions: PropTypes.shape({
- modifiers: PropTypes.array,
- onFirstUpdate: PropTypes.func,
- placement: PropTypes.oneOf([
- 'auto-end',
- 'auto-start',
- 'auto',
- 'bottom-end',
- 'bottom-start',
- 'bottom',
- 'left-end',
- 'left-start',
- 'left',
- 'right-end',
- 'right-start',
- 'right',
- 'top-end',
- 'top-start',
- 'top',
- ]),
- strategy: PropTypes.oneOf(['absolute', 'fixed']),
- }),
- popperRef: PropTypes.oneOfType([
- PropTypes.func,
- PropTypes.shape({
- current: PropTypes.object,
- }),
- ]),
- slotProps: PropTypes.shape({
- root: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
- }),
- slots: PropTypes.shape({
- root: PropTypes.elementType,
- }),
- transition: PropTypes.bool,
- }),
- ]),
+ popper: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
root: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
}),
};
diff --git a/docs/data/base/components/select/UnstyledSelectBasic/tailwind/index.tsx b/docs/data/base/components/select/UnstyledSelectBasic/tailwind/index.tsx
index 6b5e1558575ec8..eb731fa3a0d50c 100644
--- a/docs/data/base/components/select/UnstyledSelectBasic/tailwind/index.tsx
+++ b/docs/data/base/components/select/UnstyledSelectBasic/tailwind/index.tsx
@@ -57,12 +57,7 @@ export default function UnstyledSelectBasic() {
return (
-
+
@@ -78,9 +73,13 @@ const CustomSelect = React.forwardRef(function CustomSelect<
TValue extends {},
Multiple extends boolean,
>(props: SelectProps, ref: React.ForwardedRef) {
+ // Replace this with your app logic for determining dark modes
+ const isDarkMode = useIsDarkMode();
+
return (
);
});
diff --git a/docs/data/base/components/select/UnstyledSelectBasic/tailwind/index.tsx.preview b/docs/data/base/components/select/UnstyledSelectBasic/tailwind/index.tsx.preview
index b466956d01a23a..d6695526fea9f9 100644
--- a/docs/data/base/components/select/UnstyledSelectBasic/tailwind/index.tsx.preview
+++ b/docs/data/base/components/select/UnstyledSelectBasic/tailwind/index.tsx.preview
@@ -1,9 +1,4 @@
-
+
diff --git a/docs/data/base/components/select/UnstyledSelectIntroduction/tailwind/index.js b/docs/data/base/components/select/UnstyledSelectIntroduction/tailwind/index.js
index 509bd3560825bd..51a74d90004ba1 100644
--- a/docs/data/base/components/select/UnstyledSelectIntroduction/tailwind/index.js
+++ b/docs/data/base/components/select/UnstyledSelectIntroduction/tailwind/index.js
@@ -6,6 +6,26 @@ import { useTheme } from '@mui/system';
import UnfoldMoreRoundedIcon from '@mui/icons-material/UnfoldMoreRounded';
import clsx from 'clsx';
+function useIsDarkMode() {
+ const theme = useTheme();
+ return theme.palette.mode === 'dark';
+}
+
+export default function UnstyledSelectIntroduction() {
+ // Replace this with your app logic for determining dark modes
+ const isDarkMode = useIsDarkMode();
+
+ return (
+
+
+
+
+
+
+
+ );
+}
+
const getOptionColorClasses = ({ selected, highlighted, disabled }) => {
let classes = '';
if (disabled) {
@@ -55,39 +75,21 @@ Button.propTypes = {
ownerState: PropTypes.object.isRequired,
};
-function useIsDarkMode() {
- const theme = useTheme();
- return theme.palette.mode === 'dark';
-}
+const resolveSlotProps = (fn, args) => (typeof fn === 'function' ? fn(args) : fn);
-export default function UnstyledSelectIntroduction() {
+const CustomSelect = React.forwardRef(function CustomSelect(props, ref) {
// Replace this with your app logic for determining dark modes
const isDarkMode = useIsDarkMode();
- return (
-
-
-
-
-
-
-
- );
-}
-
-const resolveSlotProps = (fn, args) => (typeof fn === 'function' ? fn(args) : fn);
-
-const CustomSelect = React.forwardRef(function CustomSelect(props, ref) {
return (