Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
503a15d
feat: add to ignore file generated by npm
allandiegoasilva Oct 25, 2024
b382b54
chore: add primitive radix dialog
allandiegoasilva Oct 25, 2024
bb4c2e9
chore: add primitive radix dialog
allandiegoasilva Oct 25, 2024
ec4588f
feat: add forwarRef for button
allandiegoasilva Oct 26, 2024
5ade92c
chore: add react visually hidden
allandiegoasilva Oct 26, 2024
4063f74
chore: add react visually hidden
allandiegoasilva Oct 26, 2024
4ef8b4d
feat: add dialog style default preview example
allandiegoasilva Oct 26, 2024
cf8846c
feat: add dialog menu item
allandiegoasilva Oct 26, 2024
0551f9a
chore: add tailwindcss animate
allandiegoasilva Oct 26, 2024
23b7f26
feat: add tailwindcss animate plugin
allandiegoasilva Oct 26, 2024
d78bbe3
feat: export Dialog
allandiegoasilva Oct 26, 2024
495bc0d
feat: add simple documentation for dialog
allandiegoasilva Oct 26, 2024
b013eb4
feat: add Dialog component and export for use another context
allandiegoasilva Oct 26, 2024
bbfef43
feat: add DialogBackdrop for transform in partial black when dialog i…
allandiegoasilva Oct 26, 2024
2b45dd3
feat: add DialogContent
allandiegoasilva Oct 26, 2024
a53156c
feat: add DialogDescription
allandiegoasilva Oct 26, 2024
828aa27
feat: add DialogHEader with customizations
allandiegoasilva Oct 26, 2024
c425f31
feat: add and export DialogTrigger
allandiegoasilva Oct 26, 2024
380179f
feat: export all requirements for Dialog
allandiegoasilva Oct 26, 2024
a06a34a
feat: add default dialog example
allandiegoasilva Oct 26, 2024
79b4bd7
feat: add DialogFooter style
allandiegoasilva Oct 26, 2024
f0ddba2
feat: add dialog style with footer for preview
allandiegoasilva Oct 26, 2024
4dc8b10
feat: add dialog style for width variants
allandiegoasilva Oct 26, 2024
141486a
feat: add documentation for tailwindcss animate configuration
allandiegoasilva Oct 26, 2024
a896dd4
feat: implements variant on class for variants
allandiegoasilva Oct 26, 2024
498f53c
feat: remove dialog like default open
allandiegoasilva Oct 26, 2024
2e2f56c
feat: add dialog style with footer
allandiegoasilva Oct 26, 2024
b761c5d
fix: add names for components
allandiegoasilva Oct 26, 2024
4ad4010
feat: add Dialog Style example
allandiegoasilva Oct 26, 2024
129511a
feat: add break lines for each example
allandiegoasilva Oct 26, 2024
b0b0ff1
feat: add to full screen on mobile for dialog
allandiegoasilva Oct 26, 2024
b9758db
feat: add dialog-style-with-form
allandiegoasilva Oct 26, 2024
4248e2d
feat: change date last update
allandiegoasilva Oct 26, 2024
f3e30b0
feat: add dialog with a form for example
allandiegoasilva Oct 26, 2024
b87820e
doc: finish
allandiegoasilva Oct 26, 2024
d804a9a
feat: add Dialog path for copy-paste component
allandiegoasilva Oct 27, 2024
6565c7a
feat: add CopyPaste code
allandiegoasilva Oct 27, 2024
3296c96
feat: add every component for dialog file
allandiegoasilva Oct 27, 2024
f217f2c
!feat: move content file for dialog file
allandiegoasilva Oct 27, 2024
2e8ef7f
!feat: move content file for dialog file
allandiegoasilva Oct 27, 2024
801d473
!feat: move content file for dialog file
allandiegoasilva Oct 27, 2024
01b3055
!feat: move content file for dialog file
allandiegoasilva Oct 27, 2024
16a74d9
!feat: move content file for dialog file
allandiegoasilva Oct 27, 2024
deddfee
!feat: move content file for dialog file
allandiegoasilva Oct 27, 2024
ab5d7ef
!feat: remove components that was deleted
allandiegoasilva Oct 27, 2024
802d364
feat: add new style for call components
allandiegoasilva Oct 27, 2024
a082803
feat: add new style for call components
allandiegoasilva Oct 27, 2024
eaa1bc4
feat: add new style for call components
allandiegoasilva Oct 27, 2024
adf9abb
feat: add new style for call components
allandiegoasilva Oct 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,6 @@ yarn-error.log*
next-env.d.ts

# contentlayer
.contentlayer
.contentlayer

package-lock.json
30 changes: 30 additions & 0 deletions config/components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ export const componentConfig = {
name: "text",
filePath: "packages/ui/Text/Text.tsx",
},
dialog: {
name: "dialog",
filePath: "packages/ui/Dialog/Dialog.tsx",
},
},
examples: {
"accordion-style-default": {
Expand Down Expand Up @@ -122,5 +126,31 @@ export const componentConfig = {
filePath: "preview/components/tab-style-default.tsx",
preview: lazy(() => import("@/preview/components/tab-style-default")),
},
"dialog-style-default": {
name: "dialog-style-default",
filePath: "preview/components/dialog-style-default.tsx",
preview: lazy(() => import("@/preview/components/dialog-style-default")),
},
"dialog-style-with-footer": {
name: "dialog-style-with-footer",
filePath: "preview/components/dialog-style-with-footer.tsx",
preview: lazy(
() => import("@/preview/components/dialog-style-with-footer")
),
},
"dialog-style-width-variant": {
name: "dialog-style-width-variant",
filePath: "preview/components/dialog-style-width-variant.tsx",
preview: lazy(
() => import("@/preview/components/dialog-style-width-variant")
),
},
"dialog-style-with-form": {
name: "dialog-style-with-form",
filePath: "preview/components/dialog-style-with-form.tsx",
preview: lazy(
() => import("@/preview/components/dialog-style-with-form")
),
},
},
};
1 change: 1 addition & 0 deletions config/navigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export const navConfig: INavigationConfig = {
{ title: "Tab", href: `${componentsRoute}/tab` },
{ title: "Textarea", href: `${componentsRoute}/textarea` },
{ title: "Text", href: `${componentsRoute}/text` },
{ title: "Dialog", href: `${componentsRoute}/dialog` },
],
},
{
Expand Down
74 changes: 74 additions & 0 deletions content/docs/components/dialog.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
---
title: Dialog
description: An impactful dialog that ensures your important messages and actions get the attention they deserve! 💬✨
lastUpdated: 26 Oct, 2024
---

<ComponentShowcase name="dialog-style-default" />
<br />
<br />

## Instalation

#### 1. Install dependencies:

```sh
npm install @radix-ui/react-dialog @radix-ui/react-visually-hidden tailwindcss-animate
```

<br />

#### 2. Configure your `tailwind.config.ts` add:

```sh
{
content: [...],
theme: [...],

// add plugin
plugins: [require("tailwindcss-animate")],
}
```

<br />
<br />

#### 3. Copy the code 👇 into your project:

<ComponentSource name="dialog" />

<br />
<br />

## Example

#### Confirm dialog message

<ComponentShowcase name="dialog-style-default" />
<br />
<br />

#### Confirm dialog with footer

<ComponentShowcase name="dialog-style-with-footer" />

<br />
<br />

#### Dialog `size` variants

<ComponentShowcase name="dialog-style-width-variant" />

<br />
<br />

#### Dialog with form

<ComponentShowcase name="dialog-style-with-form" />

<br />
<br />

## Notes

For customize anything on dialog you can change `className` for the component and doas you want.
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
"@headlessui/react": "^2.1.9",
"@radix-ui/react-accordion": "^1.2.1",
"@radix-ui/react-avatar": "^1.1.1",
"@radix-ui/react-dialog": "^1.1.2",
"@radix-ui/react-visually-hidden": "^1.1.0",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
"contentlayer": "^0.3.4",
Expand All @@ -35,6 +37,7 @@
"eslint-config-next": "14.2.7",
"postcss": "^8",
"tailwindcss": "^3.4.1",
"tailwindcss-animate": "^1.0.7",
"typescript": "^5"
}
}
23 changes: 13 additions & 10 deletions packages/ui/Buttons/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,24 @@ export interface IButtonProps
extends ButtonHTMLAttributes<HTMLButtonElement>,
VariantProps<typeof buttonVariants> {}

export function Button({
children,
size = "md",
className = "",
variant = "default",
...props
}: IButtonProps) {
return (
export const Button = React.forwardRef<HTMLButtonElement, IButtonProps>(
(
{
children,
size = "md",
className = "",
variant = "default",
...props
}: IButtonProps,
forwardedRef
) => (
<button
className={cn(buttonVariants({ variant, size }), className)}
{...props}
>
{children}
</button>
);
}
)
);

Button.displayName = "Button";
Loading