-
Notifications
You must be signed in to change notification settings - Fork 8
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
[feat]: Dialog #26
[feat]: Dialog #26
Conversation
Damn! that's some some really good work! thank you 🙏 Can you put the dialog related components in one file const Dialog = ...
const DialogOverlay = ...
const DialogContent = ...
const DialogComponent = Object.assign(Dialog, {
content: DialogContent,
....
}
export {DialogComponent as Dialog} this will let us use the component like 👇 import {
Button,
Dialog
} from "@/packages/ui";
export default function DialogStyleDefault() {
return (
<Dialog>
<Dialog.Trigger asChild>
<Button>Open Dialog</Button>
</Dialog.Trigger>
<Dialog.Content>
...
</Dialog.Content>
</Dialog>
);
} reference: |
by including them in same file you can also showcase the component source in the docs, so users can copy the code form the installation. Ex: ## Installation
...
#### 2 Copy the code 👇 into your project:
<ComponentSource name="dialog" />
|
Updated as requested. Doc updates1 - Was included copy-paste component like was requested. Updates on component1 - All components is moved for Example new mode for call import { Button, Dialog, Text } from "@/packages/ui";
export default function DialogStyleDefault() {
return (
<Dialog>
<Dialog.Trigger asChild>
<Button>Open Dialog</Button>
</Dialog.Trigger>
<Dialog.Content>
<Dialog.Header>
<Text as="h5">Confirm your action?</Text>
</Dialog.Header>
<section className="flex flex-col gap-4 p-4">
<section className="text-xl">
<p>Are you sure you want to delete this item?</p>
<p>This action cannout be undone.</p>
</section>
<section className="flex w-full justify-end">
<Dialog.Trigger asChild>
<Button>Confirm</Button>
</Dialog.Trigger>
</section>
</section>
</Dialog.Content>
</Dialog>
);
} |
Feature: Enhanced Dialog Component Styling with Tailwind CSS and Radix
This pull request add the Dialog component based on Radix UI attributes. This addition will enable consistent and accessible styling of open, closed, and other relevant states.
Dependencies added
Button component changes
Was included
React.forwardFor
toButton.tsx
, it was necessary for trigger dialog with native library button.Usage example: