Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[popups] actionsRef prop #1236

Merged
merged 33 commits into from
Feb 18, 2025
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
7a73a79
[popups] Require Portal part
atomiks Dec 24, 2024
7b415f1
Fix experiment
atomiks Dec 24, 2024
2d41b5e
Remove conditional returns in backdrops
atomiks Dec 24, 2024
9a0860a
[POC] Unmount ref
atomiks Dec 27, 2024
befe34c
ummountRef -> action
atomiks Jan 7, 2025
5a8731f
Merge branch 'master' into fix/js-anim
atomiks Jan 7, 2025
c5b4936
lockfile
atomiks Jan 7, 2025
49bf54c
Merge branch 'master' into fix/js-anim
atomiks Jan 7, 2025
5016515
Merge branch 'master' into fix/js-anim
atomiks Jan 10, 2025
f098d2c
Update
atomiks Jan 10, 2025
a8db50d
Add action for all popups
atomiks Jan 10, 2025
aa84338
Require manual open check
atomiks Jan 10, 2025
154ee1e
Merge branch 'master' into fix/js-anim
atomiks Jan 20, 2025
4fd1541
Fix warning
atomiks Jan 20, 2025
8dc3265
Tests
atomiks Jan 20, 2025
77987ed
Add nativeEvent for mergeReactProps test
atomiks Jan 20, 2025
3c836fb
Lint
atomiks Jan 20, 2025
0af3006
Polish animation page
atomiks Jan 27, 2025
516d53f
Merge branch 'master' into fix/js-anim
atomiks Jan 27, 2025
f190f91
Merge
atomiks Feb 5, 2025
95a1052
Merge
atomiks Feb 5, 2025
6c818ea
proptypes
atomiks Feb 5, 2025
deb808a
Remove stale file
atomiks Feb 5, 2025
45dd76e
Check for params.action
atomiks Feb 5, 2025
1886b8f
Fix Menu test
atomiks Feb 5, 2025
8fcc4ba
Update packages/react/src/menu/root/MenuRoot.test.tsx
atomiks Feb 5, 2025
8678ac1
Rename to actions ref
atomiks Feb 5, 2025
8ddf7f0
Export Actions type
atomiks Feb 5, 2025
b939a3a
Merge
atomiks Feb 6, 2025
6aee360
pnpm-lock
atomiks Feb 6, 2025
1641f5f
Add missing actionsRef tests
atomiks Feb 6, 2025
e69ca40
Merge branch 'master' into fix/js-anim
atomiks Feb 7, 2025
b7a095f
Merge branch 'master' into fix/js-anim
atomiks Feb 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@
"@types/react-dom": "npm:[email protected]",
"@types/unist": "^3.0.3",
"chai": "^4.5.0",
"framer-motion": "^11.12.0",
"fs-extra": "^11.2.0",
"mdast-util-mdx-jsx": "^3.1.3",
"motion": "^11.15.0",
"prettier": "^3.4.1",
"rimraf": "^5.0.10",
"serve": "^14.2.4",
Expand Down
5 changes: 0 additions & 5 deletions docs/reference/generated/alert-dialog-backdrop.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@
"type": "string | (state) => string",
"description": "CSS class applied to the element, or a function that\nreturns a class based on the component’s state."
},
"keepMounted": {
"type": "boolean",
"default": "false",
"description": "Whether to keep the element in the DOM while the alert dialog is hidden."
},
"render": {
"type": "React.ReactElement | (props, state) => React.ReactElement",
"description": "Allows you to replace the component’s HTML element\nwith a different tag, or compose it with another component.\n\nAccepts a `ReactElement` or a function that returns the element to render."
Expand Down
5 changes: 0 additions & 5 deletions docs/reference/generated/alert-dialog-popup.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@
"type": "string | (state) => string",
"description": "CSS class applied to the element, or a function that\nreturns a class based on the component’s state."
},
"keepMounted": {
"type": "boolean",
"default": "false",
"description": "Whether to keep the element in the DOM while the alert dialog is hidden."
},
"render": {
"type": "React.ReactElement | (props, state) => React.ReactElement",
"description": "Allows you to replace the component’s HTML element\nwith a different tag, or compose it with another component.\n\nAccepts a `ReactElement` or a function that returns the element to render."
Expand Down
17 changes: 17 additions & 0 deletions docs/reference/generated/alert-dialog-portal.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "AlertDialogPortal",
"description": "A portal element that moves the popup to a different part of the DOM.\nBy default, the portal element is appended to `<body>`.",
"props": {
"container": {
"type": "React.Ref | HTMLElement | null",
"description": "A parent element to render the portal element into."
},
"keepMounted": {
"type": "boolean",
"default": "false",
"description": "Whether to keep the portal mounted in the DOM while the popup is hidden."
}
},
"dataAttributes": {},
"cssVariables": {}
}
5 changes: 0 additions & 5 deletions docs/reference/generated/dialog-backdrop.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@
"type": "string | (state) => string",
"description": "CSS class applied to the element, or a function that\nreturns a class based on the component’s state."
},
"keepMounted": {
"type": "boolean",
"default": "false",
"description": "Whether to keep the HTML element in the DOM while the dialog is hidden."
},
"render": {
"type": "React.ReactElement | (props, state) => React.ReactElement",
"description": "Allows you to replace the component’s HTML element\nwith a different tag, or compose it with another component.\n\nAccepts a `ReactElement` or a function that returns the element to render."
Expand Down
5 changes: 0 additions & 5 deletions docs/reference/generated/dialog-popup.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@
"type": "string | (state) => string",
"description": "CSS class applied to the element, or a function that\nreturns a class based on the component’s state."
},
"keepMounted": {
"type": "boolean",
"default": "false",
"description": "Whether to keep the HTML element in the DOM while the dialog is hidden."
},
"render": {
"type": "React.ReactElement | (props, state) => React.ReactElement",
"description": "Allows you to replace the component’s HTML element\nwith a different tag, or compose it with another component.\n\nAccepts a `ReactElement` or a function that returns the element to render."
Expand Down
17 changes: 17 additions & 0 deletions docs/reference/generated/dialog-portal.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "DialogPortal",
"description": "A portal element that moves the popup to a different part of the DOM.\nBy default, the portal element is appended to `<body>`.",
"props": {
"container": {
"type": "React.Ref | HTMLElement | null",
"description": "A parent element to render the portal element into."
},
"keepMounted": {
"type": "boolean",
"default": "false",
"description": "Whether to keep the portal mounted in the DOM while the popup is hidden."
}
},
"dataAttributes": {},
"cssVariables": {}
}
5 changes: 0 additions & 5 deletions docs/reference/generated/menu-backdrop.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@
"type": "string | (state) => string",
"description": "CSS class applied to the element, or a function that\nreturns a class based on the component’s state."
},
"keepMounted": {
"type": "boolean",
"default": "false",
"description": "Whether to keep the HTML element in the DOM while the menu is hidden."
},
"render": {
"type": "React.ReactElement | (props, state) => React.ReactElement",
"description": "Allows you to replace the component’s HTML element\nwith a different tag, or compose it with another component.\n\nAccepts a `ReactElement` or a function that returns the element to render."
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "Portal",
"name": "MenuPortal",
"description": "A portal element that moves the popup to a different part of the DOM.\nBy default, the portal element is appended to `<body>`.",
"props": {
"container": {
"type": "React.Ref | HTMLElement | null",
"description": "A parent element to render the portal into."
"description": "A parent element to render the portal element into."
},
"keepMounted": {
"type": "boolean",
Expand Down
5 changes: 0 additions & 5 deletions docs/reference/generated/menu-positioner.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,6 @@
"type": "string | (state) => string",
"description": "CSS class applied to the element, or a function that\nreturns a class based on the component’s state."
},
"keepMounted": {
"type": "boolean",
"default": "false",
"description": "Whether to keep the HTML element in the DOM while the menu is hidden."
},
"render": {
"type": "React.ReactElement | (props, state) => React.ReactElement",
"description": "Allows you to replace the component’s HTML element\nwith a different tag, or compose it with another component.\n\nAccepts a `ReactElement` or a function that returns the element to render."
Expand Down
5 changes: 0 additions & 5 deletions docs/reference/generated/popover-backdrop.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@
"type": "string | (state) => string",
"description": "CSS class applied to the element, or a function that\nreturns a class based on the component’s state."
},
"keepMounted": {
"type": "boolean",
"default": "false",
"description": "Whether to keep the HTML element in the DOM while the popover is hidden."
},
"render": {
"type": "React.ReactElement | (props, state) => React.ReactElement",
"description": "Allows you to replace the component’s HTML element\nwith a different tag, or compose it with another component.\n\nAccepts a `ReactElement` or a function that returns the element to render."
Expand Down
17 changes: 17 additions & 0 deletions docs/reference/generated/popover-portal.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "PopoverPortal",
"description": "A portal element that moves the popup to a different part of the DOM.\nBy default, the portal element is appended to `<body>`.",
"props": {
"container": {
"type": "React.Ref | HTMLElement | null",
"description": "A parent element to render the portal element into."
},
"keepMounted": {
"type": "boolean",
"default": "false",
"description": "Whether to keep the portal mounted in the DOM while the popup is hidden."
}
},
"dataAttributes": {},
"cssVariables": {}
}
5 changes: 0 additions & 5 deletions docs/reference/generated/popover-positioner.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,6 @@
"type": "string | (state) => string",
"description": "CSS class applied to the element, or a function that\nreturns a class based on the component’s state."
},
"keepMounted": {
"type": "boolean",
"default": "false",
"description": "Whether to keep the HTML element in the DOM while the popover is hidden."
},
"render": {
"type": "React.ReactElement | (props, state) => React.ReactElement",
"description": "Allows you to replace the component’s HTML element\nwith a different tag, or compose it with another component.\n\nAccepts a `ReactElement` or a function that returns the element to render."
Expand Down
4 changes: 4 additions & 0 deletions docs/reference/generated/popover-root.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
"type": "(open, event, reason) => void",
"description": "Event handler called when the popover is opened or closed."
},
"unmountRef": {
"type": "{ current: { unmount: func } }",
"description": "A ref to manually unmount the popover."
},
"openOnHover": {
"type": "boolean",
"default": "false",
Expand Down
5 changes: 0 additions & 5 deletions docs/reference/generated/preview-card-backdrop.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@
"type": "string | (state) => string",
"description": "CSS class applied to the element, or a function that\nreturns a class based on the component’s state."
},
"keepMounted": {
"type": "boolean",
"default": "false",
"description": "Whether to keep the HTML element in the DOM while the preview card is hidden."
},
"render": {
"type": "React.ReactElement | (props, state) => React.ReactElement",
"description": "Allows you to replace the component’s HTML element\nwith a different tag, or compose it with another component.\n\nAccepts a `ReactElement` or a function that returns the element to render."
Expand Down
17 changes: 17 additions & 0 deletions docs/reference/generated/preview-card-portal.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "PreviewCardPortal",
"description": "A portal element that moves the popup to a different part of the DOM.\nBy default, the portal element is appended to `<body>`.",
"props": {
"container": {
"type": "React.Ref | HTMLElement | null",
"description": "A parent element to render the portal element into."
},
"keepMounted": {
"type": "boolean",
"default": "false",
"description": "Whether to keep the portal mounted in the DOM while the popup is hidden."
}
},
"dataAttributes": {},
"cssVariables": {}
}
5 changes: 0 additions & 5 deletions docs/reference/generated/preview-card-positioner.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,6 @@
"type": "string | (state) => string",
"description": "CSS class applied to the element, or a function that\nreturns a class based on the component’s state."
},
"keepMounted": {
"type": "boolean",
"default": "false",
"description": "Whether to keep the HTML element in the DOM while the preview card is hidden."
},
"render": {
"type": "React.ReactElement | (props, state) => React.ReactElement",
"description": "Allows you to replace the component’s HTML element\nwith a different tag, or compose it with another component.\n\nAccepts a `ReactElement` or a function that returns the element to render."
Expand Down
5 changes: 0 additions & 5 deletions docs/reference/generated/select-backdrop.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@
"type": "string | (state) => string",
"description": "CSS class applied to the element, or a function that\nreturns a class based on the component’s state."
},
"keepMounted": {
"type": "boolean",
"default": "false",
"description": "Whether to keep the HTML element in the DOM while the select menu is hidden."
},
"render": {
"type": "React.ReactElement | (props, state) => React.ReactElement",
"description": "Allows you to replace the component’s HTML element\nwith a different tag, or compose it with another component.\n\nAccepts a `ReactElement` or a function that returns the element to render."
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/generated/select-portal.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"props": {
"container": {
"type": "React.Ref | HTMLElement | null",
"description": "A parent element to render the portal into."
"description": "A parent element to render the portal element into."
}
},
"dataAttributes": {},
Expand Down
17 changes: 17 additions & 0 deletions docs/reference/generated/tooltip-portal.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "TooltipPortal",
"description": "A portal element that moves the popup to a different part of the DOM.\nBy default, the portal element is appended to `<body>`.",
"props": {
"container": {
"type": "React.Ref | HTMLElement | null",
"description": "A parent element to render the portal element into."
},
"keepMounted": {
"type": "boolean",
"default": "false",
"description": "Whether to keep the portal mounted in the DOM while the popup is hidden."
}
},
"dataAttributes": {},
"cssVariables": {}
}
5 changes: 0 additions & 5 deletions docs/reference/generated/tooltip-positioner.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,6 @@
"type": "string | (state) => string",
"description": "CSS class applied to the element, or a function that\nreturns a class based on the component’s state."
},
"keepMounted": {
"type": "boolean",
"default": "false",
"description": "Whether to keep the HTML element in the DOM while the tooltip is hidden."
},
"render": {
"type": "React.ReactElement | (props, state) => React.ReactElement",
"description": "Allows you to replace the component’s HTML element\nwith a different tag, or compose it with another component.\n\nAccepts a `ReactElement` or a function that returns the element to render."
Expand Down
1 change: 1 addition & 0 deletions docs/src/app/(private)/experiments/anchor-positioning.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export default function AnchorPositioning() {
arrowPadding,
trackAnchor,
mounted: true,
keepMounted: true,
});

const handleInitialScroll = React.useCallback((node: HTMLDivElement | null) => {
Expand Down
16 changes: 10 additions & 6 deletions docs/src/app/(private)/experiments/anchor-side-animations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,20 @@ export default function AnchorSideAnimations() {
</p>
<Popover.Root>
<Popover.Trigger>transition</Popover.Trigger>
<Popover.Positioner side="top">
<Popover.Popup className={classes.Popup} data-type="transition" />
</Popover.Positioner>
<Popover.Portal>
<Popover.Positioner side="top">
<Popover.Popup className={classes.Popup} data-type="transition" />
</Popover.Positioner>
</Popover.Portal>
</Popover.Root>

<Popover.Root>
<Popover.Trigger>animation</Popover.Trigger>
<Popover.Positioner side="top">
<Popover.Popup className={classes.Popup} data-type="animation" />
</Popover.Positioner>
<Popover.Portal>
<Popover.Positioner side="top">
<Popover.Popup className={classes.Popup} data-type="animation" />
</Popover.Positioner>
</Popover.Portal>
</Popover.Root>
</div>
);
Expand Down
2 changes: 1 addition & 1 deletion docs/src/app/(private)/experiments/collapsible-framer.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client';
import * as React from 'react';
import { Collapsible } from '@base-ui-components/react/collapsible';
import { motion } from 'framer-motion';
import { motion } from 'motion/react';
import c from './collapsible.module.css';

export default function CollapsibleFramer() {
Expand Down
Loading
Loading