Skip to content

Commit

Permalink
fix(AppLayout): add asChild to dropdown menu trigger
Browse files Browse the repository at this point in the history
  • Loading branch information
zaaakher committed May 21, 2024
1 parent a0b2199 commit f0d61ec
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 4 deletions.
7 changes: 7 additions & 0 deletions apps/docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# hawa-docs

## 0.0.67

### Patch Changes

- Updated dependencies
- @sikka/hawa@0.35.3

## 0.0.66

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hawa-docs",
"version": "0.0.66",
"version": "0.0.67",
"private": true,
"scripts": {
"dev": "next dev -p 3001",
Expand Down
7 changes: 7 additions & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @sikka/hawa

## 0.35.3

### Patch Changes

- Ability to pass `triggerProps` to `DropdownMenu` components
- Make dropdown menu trigger `asChild: true` by default in `AppLayout`

## 0.35.2

### Patch Changes
Expand Down
8 changes: 7 additions & 1 deletion packages/components/elements/dropdownMenu/DropdownMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ interface DropdownMenuProps {
direction?: DirectionType;
className?: ExtendedDropdownMenuContentProps["className"];
triggerClassname?: ExtendedDropdownMenuTriggerProps["className"];
triggerProps?: DropdownMenuPrimitive.DropdownMenuTriggerProps;
sideOffset?: ExtendedDropdownMenuContentProps["sideOffset"];
side?: ExtendedDropdownMenuContentProps["side"];
align?: ExtendedDropdownMenuContentProps["align"];
Expand All @@ -315,6 +316,7 @@ const DropdownMenu: React.FC<DropdownMenuProps> = ({
side,
className,
triggerClassname,
triggerProps,
align,
alignOffset,
onItemSelect,
Expand Down Expand Up @@ -346,7 +348,11 @@ const DropdownMenu: React.FC<DropdownMenuProps> = ({
modal={false}
dir={direction}
>
<DropdownMenuTrigger asChild className={triggerClassname}>
<DropdownMenuTrigger
asChild
className={triggerClassname}
{...triggerProps}
>
{trigger}
</DropdownMenuTrigger>
<DropdownMenuPortal>
Expand Down
1 change: 1 addition & 0 deletions packages/components/layout/appLayout/AppLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ export const AppLayout: React.FunctionComponent<AppLayoutTypes> = ({
direction={direction}
items={props.profileMenuItems || []}
onItemSelect={(e: any) => console.log("selecting item ", e)}
triggerProps={{ asChild: true }}
trigger={
<div
onClick={onAvatarClick}
Expand Down
2 changes: 1 addition & 1 deletion packages/components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sikka/hawa",
"version": "0.35.2",
"version": "0.35.3",
"description": "Modern UI Kit made with Tailwind",
"author": {
"name": "Sikka Software",
Expand Down
7 changes: 7 additions & 0 deletions packages/storybook/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# hawa-storybook

## 0.26.88

### Patch Changes

- Updated dependencies
- @sikka/hawa@0.35.3

## 0.26.87

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/storybook/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hawa-storybook",
"version": "0.26.87",
"version": "0.26.88",
"description": "Modern UI Kit made with Tailwind",
"author": {
"name": "Sikka Software",
Expand Down

0 comments on commit f0d61ec

Please sign in to comment.