-
-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into alert-dialog-types
- Loading branch information
Showing
364 changed files
with
3,112 additions
and
2,304 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
/.git | ||
/.yarn | ||
/coverage | ||
/docs/export | ||
/docs/pages/playground/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: Add closing message to issue | ||
|
||
on: | ||
issues: | ||
types: | ||
- closed | ||
|
||
permissions: {} | ||
|
||
jobs: | ||
add-comment: | ||
name: Add closing message | ||
uses: mui/mui-public/.github/workflows/issues_add-closing-message.yml@master | ||
permissions: | ||
contents: read | ||
issues: write |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: New issue triage | ||
on: | ||
issues: | ||
types: | ||
- opened | ||
|
||
permissions: {} | ||
|
||
jobs: | ||
issue_cleanup: | ||
name: Clean issue body | ||
uses: mui/mui-public/.github/workflows/issues_body-cleanup.yml@master | ||
permissions: | ||
contents: read | ||
issues: write |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
'use client'; | ||
|
||
import * as React from 'react'; | ||
import * as ReactDOM from 'react-dom'; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
'use client'; | ||
|
||
import * as React from 'react'; | ||
import * as Collapsible from '@base_ui/react/Collapsible'; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
'use client'; | ||
|
||
import * as React from 'react'; | ||
import * as Collapsible from '@base_ui/react/Collapsible'; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
'use client'; | ||
|
||
import * as React from 'react'; | ||
import * as Collapsible from '@base_ui/react/Collapsible'; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
'use client'; | ||
|
||
import * as React from 'react'; | ||
import * as Menu from '@base_ui/react/Menu'; | ||
|
||
export default function Page() { | ||
const [anchorEl, setAnchor] = React.useState<HTMLDivElement | null>(null); | ||
const handleRef = React.useCallback((element: HTMLDivElement | null) => { | ||
setAnchor(element); | ||
}, []); | ||
|
||
return ( | ||
<div> | ||
<h1>Element passed to anchor</h1> | ||
<Menu.Root animated={false}> | ||
<Menu.Trigger>Trigger</Menu.Trigger> | ||
<Menu.Positioner side="bottom" alignment="start" arrowPadding={0} anchor={anchorEl}> | ||
<Menu.Popup> | ||
<Menu.Item style={{ background: 'lightgray', padding: '5px' }}>One</Menu.Item> | ||
<Menu.Item style={{ background: 'lightgray', padding: '5px' }}>Two</Menu.Item> | ||
</Menu.Popup> | ||
</Menu.Positioner> | ||
</Menu.Root> | ||
<div | ||
data-testid="anchor" | ||
style={{ margin: '100px', background: 'yellowgreen', height: '50px', width: '200px' }} | ||
ref={handleRef} | ||
> | ||
Anchor | ||
</div> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
'use client'; | ||
|
||
import * as React from 'react'; | ||
import * as Menu from '@base_ui/react/Menu'; | ||
|
||
export default function Page() { | ||
const anchor = React.useRef<HTMLDivElement>(null); | ||
|
||
return ( | ||
<div> | ||
<h1>Ref passed to anchor</h1> | ||
<Menu.Root animated={false}> | ||
<Menu.Trigger>Trigger</Menu.Trigger> | ||
<Menu.Positioner side="bottom" alignment="start" arrowPadding={0} anchor={anchor}> | ||
<Menu.Popup> | ||
<Menu.Item style={{ background: 'lightgray', padding: '5px' }}>One</Menu.Item> | ||
<Menu.Item style={{ background: 'lightgray', padding: '5px' }}>Two</Menu.Item> | ||
</Menu.Popup> | ||
</Menu.Positioner> | ||
</Menu.Root> | ||
<div | ||
data-testid="anchor" | ||
style={{ margin: '100px', background: 'yellowgreen', height: '50px', width: '200px' }} | ||
ref={anchor} | ||
> | ||
Anchor | ||
</div> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
'use client'; | ||
import * as React from 'react'; | ||
import { useScrollLock } from '../../../packages/mui-base/src/utils/useScrollLock'; | ||
|
||
export default function ScrollLock() { | ||
const [enabled, setEnabled] = React.useState(false); | ||
const [bodyScrollY, setBodyScrollY] = React.useState(false); | ||
const [longContent, setLongContent] = React.useState(true); | ||
|
||
useScrollLock(enabled); | ||
|
||
React.useEffect(() => { | ||
document.body.style.overflowY = bodyScrollY ? 'scroll' : ''; | ||
}, [bodyScrollY]); | ||
|
||
return ( | ||
<div> | ||
<h1>useScrollLock</h1> | ||
<p>On macOS, enable `Show scroll bars: Always` in `Appearance` Settings.</p> | ||
<div | ||
style={{ | ||
position: 'fixed', | ||
top: 15, | ||
display: 'flex', | ||
gap: 10, | ||
background: 'white', | ||
padding: 20, | ||
}} | ||
> | ||
<div> | ||
<label> | ||
<input | ||
type="checkbox" | ||
checked={enabled} | ||
onChange={(e) => setEnabled(e.target.checked)} | ||
/> | ||
Scroll lock | ||
</label> | ||
</div> | ||
<div> | ||
<label> | ||
<input | ||
type="checkbox" | ||
checked={bodyScrollY} | ||
onChange={(e) => setBodyScrollY(e.target.checked)} | ||
/> | ||
body `overflow` | ||
</label> | ||
</div> | ||
<div> | ||
<label> | ||
<input | ||
type="checkbox" | ||
checked={longContent} | ||
onChange={(e) => setLongContent(e.target.checked)} | ||
/> | ||
Long content | ||
</label> | ||
</div> | ||
</div> | ||
{[...Array(longContent ? 100 : 10)].map((_, i) => ( | ||
<p key={i}>Scroll locking text content</p> | ||
))} | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.