Skip to content

Commit

Permalink
Fix lint/imports
Browse files Browse the repository at this point in the history
  • Loading branch information
atomiks committed Apr 11, 2024
1 parent 902bb40 commit cf0f789
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 16 deletions.
4 changes: 2 additions & 2 deletions docs/data/base/components/badge/BadgeVisibility.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Badge as BaseBadge, badgeClasses } from '@base_ui/react/Badge';
// Auxiliary demo components
import { styled, Stack } from '@mui/system';
import { Button, buttonClasses } from '@base_ui/react/Button';
import { Switch as BaseSwitch } from '@base_ui/react/Switch';
import * as BaseSwitch from '@base_ui/react/Switch';
import Divider from '@mui/material/Divider';
// Icons
import AddIcon from '@mui/icons-material/Add';
Expand Down Expand Up @@ -96,7 +96,7 @@ const StyledButton = styled(Button)(
`,
);

const Switch = styled(BaseSwitch)(
const Switch = styled(BaseSwitch.Root)(
({ theme }) => `
width: 32px;
height: 20px;
Expand Down
4 changes: 2 additions & 2 deletions docs/data/base/components/badge/BadgeVisibility.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Badge as BaseBadge, badgeClasses } from '@base_ui/react/Badge';
// Auxiliary demo components
import { styled, Stack } from '@mui/system';
import { Button, buttonClasses } from '@base_ui/react/Button';
import { Switch as BaseSwitch } from '@base_ui/react/Switch';
import * as BaseSwitch from '@base_ui/react/Switch';
import Divider from '@mui/material/Divider';
// Icons
import AddIcon from '@mui/icons-material/Add';
Expand Down Expand Up @@ -96,7 +96,7 @@ const StyledButton = styled(Button)(
`,
);

const Switch = styled(BaseSwitch)(
const Switch = styled(BaseSwitch.Root)(
({ theme }) => `
width: 32px;
height: 20px;
Expand Down
16 changes: 8 additions & 8 deletions docs/src/components/productBaseUI/BaseUICustomization.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import { styled } from '@mui/system';
import { Switch as BaseSwitch } from '@base_ui/react/Switch';
import * as BaseSwitch from '@base_ui/react/Switch';
import { useSwitch, UseSwitchParameters } from '@base_ui/react/useSwitch';
import Box from '@mui/material/Box';
import Grid from '@mui/material/Grid';
Expand All @@ -17,7 +17,7 @@ import HighlightedCode from 'docs/src/modules/components/HighlightedCode';
import MarkdownElement from 'docs/src/components/markdown/MarkdownElement';

const code = `
import { Switch as BaseSwitch } from '@base_ui/react/Switch';
import * as Switch from '@base_ui/react/Switch';
import { useSwitch } from '@base_ui/react/useSwitch';
import { styled } from '@mui/system';
Expand Down Expand Up @@ -100,12 +100,12 @@ function SwitchFromHook(props) {
function App() {
return (
<BaseSwitch
<BaseSwitch.Root
aria-label="Demo switch"
render={(props) => <StyledSwitchRoot {...props} />}
>
<BaseSwitch render={(props) => <StyledSwitchThumb {...props} />} />
</BaseSwitch>
<BaseSwitch.Thumb render={(props) => <StyledSwitchThumb {...props} />} />
</BaseSwitch.Root>
<SwitchFromHook />
)
}
Expand Down Expand Up @@ -262,12 +262,12 @@ export default function BaseUICustomization() {
}),
})}
>
<BaseSwitch
<BaseSwitch.Root
aria-label="Demo switch"
render={(props) => <StyledSwitchRoot {...props} />}
>
<BaseSwitch render={(props) => <StyledSwitchThumb {...props} />} />
</BaseSwitch>
<BaseSwitch.Thumb render={(props) => <StyledSwitchThumb {...props} />} />
</BaseSwitch.Root>
<SwitchFromHook defaultChecked />
</Frame.Demo>
<Frame.Info
Expand Down
7 changes: 4 additions & 3 deletions docs/src/components/productBaseUI/themed-controls/Switch.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import * as React from 'react';
import { Switch as BaseSwitch, SwitchProps } from '@base_ui/react/Switch';
import * as BaseSwitch from '@base_ui/react/Switch';
import type { SwitchRootProps } from '@base_ui/react/Switch';
import { css, styled } from '@mui/system';

const StyledSwitch = styled(BaseSwitch)(css`
const StyledSwitch = styled(BaseSwitch.Root)(css`
font-size: 0;
position: relative;
display: inline-block;
Expand Down Expand Up @@ -57,7 +58,7 @@ const StyledSwitchThumb = styled(BaseSwitch.Thumb)(css`
`);

const Switch = React.forwardRef(function Switch(
props: SwitchProps,
props: SwitchRootProps,
ref: React.ForwardedRef<HTMLButtonElement>,
) {
return (
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-base/src/Checkbox/CheckboxIndicator.test.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as React from 'react';
import { expect } from 'chai';
import { createRenderer } from '@mui/internal-test-utils';
import { describeConformance } from '../../test/describeConformance';
import * as Checkbox from '@base_ui/react/Checkbox';
import { describeConformance } from '../../test/describeConformance';
import { CheckboxContext } from './CheckboxContext';

const testContext = {
Expand Down

0 comments on commit cf0f789

Please sign in to comment.