Skip to content

Commit

Permalink
fix(ariakit): patch popover arrow bug
Browse files Browse the repository at this point in the history
  • Loading branch information
w0ofy committed Jan 27, 2024
1 parent 905c4df commit 07f3f1e
Show file tree
Hide file tree
Showing 51 changed files with 296 additions and 229 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
"source.fixAll.eslint": "explicit"
},
"editor.tabSize": 2,
"eslint.validate": [
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
26 changes: 0 additions & 26 deletions .yarn/patches/@ariakit-react-core-npm-0.3.5-3b7a69924a.patch

This file was deleted.

26 changes: 26 additions & 0 deletions .yarn/patches/@ariakit-react-core-npm-0.4.0-09b9e9aaa6.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
diff --git a/cjs/__chunks/ID5QP4WT.cjs b/cjs/__chunks/ID5QP4WT.cjs
index 5cd4886b760de45bde68278d843930168e841054..64198a8eae1008003be774f9cf4104c53d201b59 100644
--- a/cjs/__chunks/ID5QP4WT.cjs
+++ b/cjs/__chunks/ID5QP4WT.cjs
@@ -237,7 +237,7 @@ var usePopover = _Q67LZMDTcjs.createHook.call(void 0,
fitViewport,
overflowPadding
})
- ];
+ ].filter(Boolean);
const pos = await _dom.computePosition.call(void 0, anchor, popoverElement, {
placement,
strategy: fixed ? "fixed" : "absolute",
diff --git a/esm/__chunks/KMWSQ7OZ.js b/esm/__chunks/KMWSQ7OZ.js
index 36701588d8c1062b5cdcf929a5d89d7c0572e42c..7add8ee37f203847f566a1cd6ed4b8a5bdf59af9 100644
--- a/esm/__chunks/KMWSQ7OZ.js
+++ b/esm/__chunks/KMWSQ7OZ.js
@@ -237,7 +237,7 @@ var usePopover = createHook(
fitViewport,
overflowPadding
})
- ];
+ ].filter(Boolean);
const pos = await computePosition(anchor, popoverElement, {
placement,
strategy: fixed ? "fixed" : "absolute",
23 changes: 12 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,22 +70,22 @@
}
},
"dependencies": {
"@babel/cli": "^7.23.4",
"@babel/core": "^7.23.7",
"@babel/cli": "^7.23.9",
"@babel/core": "^7.23.9",
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/plugin-proposal-object-rest-spread": "^7.20.7",
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"@babel/plugin-transform-runtime": "^7.23.7",
"@babel/preset-env": "^7.23.8",
"@babel/plugin-transform-runtime": "^7.23.9",
"@babel/preset-env": "^7.23.9",
"@babel/preset-react": "^7.23.3",
"@babel/preset-typescript": "^7.23.3",
"@babel/register": "^7.23.7",
"@changesets/changelog-github": "^0.5.0",
"@changesets/cli": "^2.27.1",
"@commitlint/cli": "^18.5.0",
"@commitlint/config-conventional": "^18.5.0",
"@commitlint/cz-commitlint": "^18.5.0",
"@commitlint/prompt-cli": "^18.5.0",
"@commitlint/cli": "^18.6.0",
"@commitlint/config-conventional": "^18.6.0",
"@commitlint/cz-commitlint": "^18.6.0",
"@commitlint/prompt-cli": "^18.6.0",
"@emotion/babel-preset-css-prop": "^11.11.0",
"@emotion/jest": "^11.11.0",
"@manypkg/cli": "^0.21.2",
Expand All @@ -107,7 +107,7 @@
"@testing-library/react-hooks": "^8.0.1",
"@testing-library/user-event": "^14.5.2",
"@types/jest": "^29.5.11",
"@types/node": "^20.11.6",
"@types/node": "^20.11.8",
"@types/react": "^18.2.48",
"@types/react-dom": "^18.2.18",
"@types/react-test-renderer": "^18.0.7",
Expand Down Expand Up @@ -136,7 +136,7 @@
"execa": "^5.1.1",
"fuzzy": "^0.1.3",
"generate-template-files": "^3.2.1",
"husky": "^9.0.1",
"husky": "^9.0.6",
"inquirer": "^8.2.6",
"inquirer-checkbox-plus-prompt": "^1.4.2",
"jest": "^29.7.0",
Expand Down Expand Up @@ -172,7 +172,8 @@
"@types/react-test-renderer": "18.0.7",
"react": "18.2.0",
"react-dom": "18.2.0",
"typescript": "^5.3.3"
"typescript": "^5.3.3",
"@ariakit/[email protected]": "patch:@ariakit/react-core@npm%3A0.4.0#./.yarn/patches/@ariakit-react-core-npm-0.4.0-09b9e9aaa6.patch"
},
"packageManager": "[email protected]"
}
6 changes: 1 addition & 5 deletions packages/components/menu/src/Menu.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import * as React from 'react';

import {
MenuArrowPrimitive,
MenuProviderPrimitive,
type MenuProviderPrimitiveProps,
useMenuStorePrimitive,
Expand Down Expand Up @@ -46,10 +45,7 @@ function Menu({
setOpen,
});
return (
<MenuProviderPrimitive store={store}>
<MenuArrowPrimitive size={0} />
{children}
</MenuProviderPrimitive>
<MenuProviderPrimitive store={store}>{children}</MenuProviderPrimitive>
);
}

Expand Down
2 changes: 1 addition & 1 deletion packages/components/popover/src/Popover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ const Popover: PopoverComponent = forwardRef<HTMLDivElement, PopoverProps>(
data-testid={makeTestId('popover')}
render={(htmlProps) => <StyledPopover {...htmlProps} {...restProps} />}
ref={ref}>
<PopoverArrowPrimitive store={store} size={hideArrow ? 0 : 30} />
{hideArrow ? null : <PopoverArrowPrimitive store={store} />}
{!hideCloseButton && (
<PopoverDismiss
variant="minimal"
Expand Down
6 changes: 1 addition & 5 deletions packages/components/select/src/SelectPopover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ import React from 'react';

import { real } from '@real-system/elements-primitive';
import type { SelectPopoverPrimitiveProps } from '@real-system/select-primitive';
import {
SelectArrowPrimitive,
SelectPopoverPrimitive,
} from '@real-system/select-primitive';
import { SelectPopoverPrimitive } from '@real-system/select-primitive';

import type { OmitSelectPrivateProps } from './types';

Expand Down Expand Up @@ -41,7 +38,6 @@ const SelectPopover = ({
/>
}
{...restProps}>
<SelectArrowPrimitive size={0} />
{children}
</SelectPopoverPrimitive>
);
Expand Down
2 changes: 1 addition & 1 deletion packages/components/tooltip/src/Tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ const Tooltip = forwardRef<HTMLDivElement, TooltipProps>(function Tooltip(
alwaysVisible
gutter={gutter}
{...restProps}>
<TooltipArrowPrimitive size={hideArrow ? 0 : 30} />
{hideArrow ? null : <TooltipArrowPrimitive />}
<Text as="span" color="white">
{label}
</Text>
Expand Down
4 changes: 2 additions & 2 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@
"react-dom": "^18.2.0"
},
"devDependencies": {
"@babel/cli": "^7.23.4",
"@babel/core": "^7.23.7",
"@babel/cli": "^7.23.9",
"@babel/core": "^7.23.9",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"typescript": "^5.3.3"
Expand Down
2 changes: 0 additions & 2 deletions packages/libraries/ariakit-library/src/menu.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
export type {
MenuArrowProps as AriakitMenuArrowProps,
MenuItemCheckboxProps as AriakitMenuItemCheckboxProps,
MenuItemProps as AriakitMenuItemProps,
MenuItemRadioProps as AriakitMenuItemRadioProps,
Expand All @@ -8,7 +7,6 @@ export type {
} from '@ariakit/react/menu';
export {
Menu as AriakitMenu,
MenuArrow as AriakitMenuArrow,
MenuButton as AriakitMenuButton,
MenuGroup as AriakitMenuGroup,
MenuGroupLabel as AriakitMenuGroupLabel,
Expand Down
2 changes: 0 additions & 2 deletions packages/libraries/ariakit-library/src/select.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
export type {
SelectArrowProps as AriakitSelectArrowProps,
SelectGroupLabelProps as AriakitSelectGroupLabelProps,
SelectGroupProps as AriakitSelectGroupProps,
SelectItemProps as AriakitSelectItemProps,
Expand All @@ -10,7 +9,6 @@ export type {
} from '@ariakit/react/select';
export {
Select as AriakitSelect,
SelectArrow as AriakitSelectArrow,
SelectGroup as AriakitSelectGroup,
SelectGroupLabel as AriakitSelectGroupLabel,
SelectItem as AriakitSelectItem,
Expand Down
2 changes: 0 additions & 2 deletions packages/primitives/menu-primitive/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
export type {
AriakitMenuArrowProps as MenuArrowPrimitiveProps,
AriakitMenuItemCheckboxProps as MenuItemCheckboxPrimitiveProps,
AriakitMenuItemProps as MenuItemPrimitiveProps,
AriakitMenuItemRadioProps as MenuItemRadioPrimitiveProps,
AriakitMenuProviderProps as MenuProviderPrimitiveProps,
AriakitMenuSeparatorProps as MenuSeparatorPrimitiveProps,
} from '@real-system/ariakit-library';
export {
AriakitMenuArrow as MenuArrowPrimitive,
AriakitMenuButton as MenuButtonPrimitive,
AriakitMenuGroupLabel as MenuGroupLabelPrimitive,
AriakitMenuGroup as MenuGroupPrimitive,
Expand Down
2 changes: 0 additions & 2 deletions packages/primitives/select-primitive/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
export type {
AriakitPopoverArrowProps as SelectArrowPrimitiveProps,
AriakitSelectGroupLabelProps as SelectGroupLabelPrimitiveProps,
AriakitSelectGroupProps as SelectGroupPrimitiveProps,
AriakitSelectItemProps as SelectItemPrimitiveProps,
Expand All @@ -8,7 +7,6 @@ export type {
AriakitSelectSeparatorProps as SelectSeparatorPrimitiveProps,
} from '@real-system/ariakit-library';
export {
AriakitPopoverArrow as SelectArrowPrimitive,
AriakitSelectGroupLabel as SelectGroupLabelPrimitive,
AriakitSelectGroup as SelectGroupPrimitive,
AriakitSelectItem as SelectItemPrimitive,
Expand Down
Loading

0 comments on commit 07f3f1e

Please sign in to comment.