From ccf82df032b46294e05a5752f07396efbee82b9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D5=A1=D3=84=D5=A1?= Date: Sat, 30 Nov 2024 22:44:10 +0800 Subject: [PATCH 1/3] chore(docs): revise defaultShowFlagList (#4193) * chore(docs): add Example to defaultShowFlagList * chore(docs): revise defaultShowFlagList --- apps/docs/components/docs/components/helper.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/docs/components/docs/components/helper.ts b/apps/docs/components/docs/components/helper.ts index 451c106139..f9c46f0db2 100644 --- a/apps/docs/components/docs/components/helper.ts +++ b/apps/docs/components/docs/components/helper.ts @@ -15,7 +15,7 @@ const endFlag = ["}", "]"]; const specialStartFlag = ["("]; const specialEndFlag = [")"]; const defaultFoldFlagList = ["cn", "HTMLAttributes"]; -const defaultShowFlagList = ["Component", "forwardRef", "App"]; +const defaultShowFlagList = ["Component", "forwardRef", "App", "Example", "AddForm", "SignupForm"]; /** * Transform tokens from `prism-react-renderer` to wrap them in folder structure From 290182df2670aa176fc44f08a13c3d0a4544ad41 Mon Sep 17 00:00:00 2001 From: Junior Garcia Date: Sat, 30 Nov 2024 18:51:15 -0300 Subject: [PATCH 2/3] feat: documentation improvements (#4195) * feat: documentation improvements * fix: alert api --- apps/docs/components/copy-button.tsx | 12 +- .../docs/components/code-demo/code-demo.tsx | 1 + .../components/code-demo/react-live-demo.tsx | 10 + apps/docs/components/icons/info-circle.tsx | 33 + apps/docs/components/mdx-components.tsx | 102 +++- apps/docs/components/sandpack/copy-button.tsx | 4 +- .../components/sandpack/language-selector.tsx | 2 +- apps/docs/components/static-table.tsx | 73 +++ apps/docs/content/docs/components/alert.mdx | 117 +++- .../content/docs/components/autocomplete.mdx | 439 +++++++++++-- apps/docs/content/docs/components/avatar.mdx | 180 +++++- apps/docs/content/docs/components/badge.mdx | 104 +++- .../content/docs/components/breadcrumbs.mdx | 270 ++++++-- apps/docs/content/docs/components/button.mdx | 239 ++++++-- .../docs/content/docs/components/calendar.mdx | 229 +++++-- apps/docs/content/docs/components/card.mdx | 138 ++++- .../docs/components/checkbox-group.mdx | 166 ++++- .../docs/content/docs/components/checkbox.mdx | 152 ++++- apps/docs/content/docs/components/chip.mdx | 89 ++- .../docs/components/circular-progress.mdx | 104 +++- apps/docs/content/docs/components/code.mdx | 34 +- .../content/docs/components/date-input.mdx | 212 +++++-- .../content/docs/components/date-picker.mdx | 268 ++++++-- .../docs/components/date-range-picker.mdx | 377 ++++++++++-- apps/docs/content/docs/components/divider.mdx | 13 +- apps/docs/content/docs/components/drawer.mdx | 131 +++- .../docs/content/docs/components/dropdown.mdx | 576 +++++++++++++++--- apps/docs/content/docs/components/image.mdx | 133 +++- .../content/docs/components/input-otp.mdx | 194 +++++- apps/docs/content/docs/components/input.mdx | 209 ++++++- apps/docs/content/docs/components/kbd.mdx | 27 +- apps/docs/content/docs/components/link.mdx | 173 +++++- apps/docs/content/docs/components/listbox.mdx | 461 +++++++++++--- apps/docs/content/docs/components/modal.mdx | 152 ++++- apps/docs/content/docs/components/navbar.mdx | 264 ++++++-- .../content/docs/components/pagination.mdx | 159 ++++- apps/docs/content/docs/components/popover.mdx | 245 ++++++-- .../docs/content/docs/components/progress.mdx | 111 +++- .../content/docs/components/radio-group.mdx | 242 ++++++-- .../docs/components/range-calendar.mdx | 216 +++++-- .../content/docs/components/scroll-shadow.mdx | 71 ++- apps/docs/content/docs/components/select.mdx | 306 ++++++++-- .../docs/content/docs/components/skeleton.mdx | 34 +- apps/docs/content/docs/components/slider.mdx | 243 ++++++-- apps/docs/content/docs/components/snippet.mdx | 131 +++- apps/docs/content/docs/components/spacer.mdx | 22 +- apps/docs/content/docs/components/spinner.mdx | 45 +- apps/docs/content/docs/components/switch.mdx | 131 +++- apps/docs/content/docs/components/table.mdx | 471 +++++++++++--- apps/docs/content/docs/components/tabs.mdx | 248 ++++++-- .../docs/content/docs/components/textarea.mdx | 243 ++++++-- .../content/docs/components/time-input.mdx | 237 +++++-- apps/docs/content/docs/components/tooltip.mdx | 226 +++++-- apps/docs/content/docs/components/user.mdx | 41 +- apps/docs/styles/globals.css | 8 +- apps/docs/tailwind.config.js | 4 +- 56 files changed, 7626 insertions(+), 1496 deletions(-) create mode 100644 apps/docs/components/icons/info-circle.tsx create mode 100644 apps/docs/components/static-table.tsx diff --git a/apps/docs/components/copy-button.tsx b/apps/docs/components/copy-button.tsx index 35a652d2eb..72a4b871ff 100644 --- a/apps/docs/components/copy-button.tsx +++ b/apps/docs/components/copy-button.tsx @@ -1,6 +1,7 @@ import {FC} from "react"; import {Button, ButtonProps} from "@nextui-org/react"; import {useClipboard} from "@nextui-org/use-clipboard"; +import {clsx} from "@nextui-org/shared-utils"; import {CheckLinearIcon, CopyLinearIcon} from "@/components/icons"; @@ -8,7 +9,7 @@ export interface CopyButtonProps extends ButtonProps { value?: string; } -export const CopyButton: FC = ({value, ...buttonProps}) => { +export const CopyButton: FC = ({value, className, ...buttonProps}) => { const {copy, copied} = useClipboard(); const handleCopy = () => { @@ -18,19 +19,22 @@ export const CopyButton: FC = ({value, ...buttonProps}) => { return (