-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
34 additions
and
41 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,45 +1,44 @@ | ||
'use client' | ||
import type { Assign } from '@ark-ui/react' | ||
import { HoverCard } from '@ark-ui/react/hover-card' | ||
import { type HoverCardVariantProps, hoverCard } from 'styled-system/recipes' | ||
import { hoverCard, type HoverCardVariantProps } from 'styled-system/recipes' | ||
import type { ComponentProps, HTMLStyledProps } from 'styled-system/types' | ||
|
||
import { createStyleContext } from '@/lib/create-style-context' | ||
|
||
const { withRootProvider, withContext } = createStyleContext(hoverCard) | ||
|
||
export type RootProviderProps = ComponentProps<typeof RootProvider> | ||
export const RootProvider = withRootProvider< | ||
Assign<HoverCard.RootProviderProps, HoverCardVariantProps> | ||
>(HoverCard.RootProvider) | ||
export const RootProvider = withRootProvider<Assign<HoverCard.RootProviderProps, HoverCardVariantProps>>( | ||
HoverCard.RootProvider, | ||
) | ||
|
||
export type RootProps = ComponentProps<typeof Root> | ||
export const Root = withRootProvider<Assign<HoverCard.RootProps, HoverCardVariantProps>>( | ||
HoverCard.Root, | ||
export const Root = withRootProvider<Assign<HoverCard.RootProps, HoverCardVariantProps>>(HoverCard.Root) | ||
|
||
export const Arrow = withContext<HTMLDivElement, Assign<HTMLStyledProps<'div'>, HoverCard.ArrowBaseProps>>( | ||
HoverCard.Arrow, | ||
'arrow', | ||
) | ||
|
||
export const ArrowTip = withContext<HTMLDivElement, Assign<HTMLStyledProps<'div'>, HoverCard.ArrowTipBaseProps>>( | ||
HoverCard.ArrowTip, | ||
'arrowTip', | ||
) | ||
|
||
export const Arrow = withContext< | ||
HTMLDivElement, | ||
Assign<HTMLStyledProps<'div'>, HoverCard.ArrowBaseProps> | ||
>(HoverCard.Arrow, 'arrow') | ||
|
||
export const ArrowTip = withContext< | ||
HTMLDivElement, | ||
Assign<HTMLStyledProps<'div'>, HoverCard.ArrowTipBaseProps> | ||
>(HoverCard.ArrowTip, 'arrowTip') | ||
|
||
export const Content = withContext< | ||
HTMLDivElement, | ||
Assign<HTMLStyledProps<'div'>, HoverCard.ContentBaseProps> | ||
>(HoverCard.Content, 'content') | ||
|
||
export const Positioner = withContext< | ||
HTMLDivElement, | ||
Assign<HTMLStyledProps<'div'>, HoverCard.PositionerBaseProps> | ||
>(HoverCard.Positioner, 'positioner') | ||
|
||
export const Trigger = withContext< | ||
HTMLButtonElement, | ||
Assign<HTMLStyledProps<'button'>, HoverCard.TriggerBaseProps> | ||
>(HoverCard.Trigger, 'trigger') | ||
export const Content = withContext<HTMLDivElement, Assign<HTMLStyledProps<'div'>, HoverCard.ContentBaseProps>>( | ||
HoverCard.Content, | ||
'content', | ||
) | ||
|
||
export const Positioner = withContext<HTMLDivElement, Assign<HTMLStyledProps<'div'>, HoverCard.PositionerBaseProps>>( | ||
HoverCard.Positioner, | ||
'positioner', | ||
) | ||
|
||
export const Trigger = withContext<HTMLButtonElement, Assign<HTMLStyledProps<'button'>, HoverCard.TriggerBaseProps>>( | ||
HoverCard.Trigger, | ||
'trigger', | ||
) | ||
|
||
export { HoverCardContext as Context } from '@ark-ui/react/hover-card' |
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