-
Notifications
You must be signed in to change notification settings - Fork 131
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
92 changed files
with
3,165 additions
and
445 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
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
48 changes: 48 additions & 0 deletions
48
packages/react/src/components/ui/buttons/google-cast-button.tsx
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,48 @@ | ||
import * as React from 'react'; | ||
|
||
import { composeRefs, createReactComponent, type ReactElementProps } from 'maverick.js/react'; | ||
|
||
import { GoogleCastButtonInstance } from '../../primitives/instances'; | ||
import { Primitive } from '../../primitives/nodes'; | ||
|
||
/* ------------------------------------------------------------------------------------------------- | ||
* GoogleCastButton | ||
* -----------------------------------------------------------------------------------------------*/ | ||
|
||
const GoogleCastButtonBridge = createReactComponent(GoogleCastButtonInstance); | ||
|
||
export interface GoogleCastButtonProps | ||
extends ReactElementProps<GoogleCastButtonInstance, HTMLButtonElement> { | ||
asChild?: boolean; | ||
children?: React.ReactNode; | ||
ref?: React.Ref<HTMLButtonElement>; | ||
} | ||
|
||
/** | ||
* A button for requesting Google Cast. | ||
* | ||
* @see {@link https://developers.google.com/cast/docs/overview} | ||
* @docs {@link https://www.vidstack.io/docs/player/components/buttons/google-cast-button} | ||
* @example | ||
* ```tsx | ||
* <GoogleCastButton> | ||
* <ChromecastIcon /> | ||
* </GoogleCastButton> | ||
* ``` | ||
*/ | ||
const GoogleCastButton = React.forwardRef<HTMLButtonElement, GoogleCastButtonProps>( | ||
({ children, ...props }, forwardRef) => { | ||
return ( | ||
<GoogleCastButtonBridge {...(props as Omit<GoogleCastButtonProps, 'ref'>)}> | ||
{(props) => ( | ||
<Primitive.button {...props} ref={composeRefs(props.ref, forwardRef)}> | ||
{children} | ||
</Primitive.button> | ||
)} | ||
</GoogleCastButtonBridge> | ||
); | ||
}, | ||
); | ||
|
||
GoogleCastButton.displayName = 'GoogleCastButton'; | ||
export { GoogleCastButton }; |
Oops, something went wrong.