feat(root): modal, popover and navbar menu issues fixed, navbar styles simplified, docs improved

This commit is contained in:
Junior Garcia 2023-06-15 23:48:25 -03:00
parent 56e8aba53a
commit 5e33f2c816
151 changed files with 1167 additions and 354 deletions

View File

@ -59,9 +59,9 @@ export default function RootLayout({children}: {children: React.ReactNode}) {
<head />
<body className={clsx("min-h-screen bg-background font-sans antialiased", fontSans.variable)}>
<Providers themeProps={{attribute: "class", defaultTheme: "dark"}}>
<div className="relative flex flex-col">
<div className="relative flex flex-col" id="app-container">
<Navbar routes={manifest.routes} />
<main className="container mx-auto max-w-7xl px-6 flex-grow">{children}</main>
<main className="container mx-auto max-w-7xl px-6 pt-16 flex-grow">{children}</main>
<Footer />
</div>
</Providers>

View File

@ -14,7 +14,7 @@ export const BgGridContainer: FC<BgGridContainerProps> = ({
return (
<div
className={clsx(
"relative overflow-y-hidden flex items-center border border-default-400/50 dark:border-default-100/50 px-2 py-4 rounded-lg",
"relative overflow-y-hidden flex items-center border border-default-200 dark:border-default-100 px-2 py-4 rounded-lg",
"overflow-hidden",
// blur effect
// "bg-transparent",

View File

@ -8,8 +8,8 @@ import {
ModalHeader,
Link as NextUILink,
ModalBody,
Skeleton,
ModalFooter,
Skeleton,
} from "@nextui-org/react";
import Link from "next/link";
import {toLower} from "lodash";
@ -65,20 +65,19 @@ export const DemoCodeModal: FC<DemoCodeModalProps> = ({isOpen, code, title, subt
)}
</p>
</ModalHeader>
<ModalBody>
<Skeleton
className="h-[calc(100vh_-_200px)] md:h-[60vh] rounded-xl"
isLoaded={isCodeVisible}
>
<ModalBody className="flex-initial md:pb-6">
{isCodeVisible ? (
<CodeWindow
showCopy
showWindowIcons
className="min-h-[320px] max-h-full md:max-h-[60vh] h-screen"
className="min-h-[320px] !h-[60vh] max-h-full"
language="jsx"
title={fileName}
value={code}
/>
</Skeleton>
) : (
<Skeleton className="h-[60vh] rounded-xl" />
)}
</ModalBody>
<ModalFooter className="md:hidden">
<Button fullWidth onPress={onClose}>

View File

@ -2,7 +2,7 @@
import React, {useCallback, useMemo, useRef} from "react";
import dynamic from "next/dynamic";
import {Skeleton} from "@nextui-org/react";
import {Skeleton, Tab, Tabs} from "@nextui-org/react";
import {motion, useInView} from "framer-motion";
import {useCodeDemo, UseCodeDemoProps} from "./use-code-demo";
@ -28,6 +28,7 @@ interface CodeDemoProps extends UseCodeDemoProps {
showSandpackPreview?: boolean;
initialEditorOpen?: boolean;
enableResize?: boolean;
showTabs?: boolean;
showPreview?: boolean;
showOpenInCodeSandbox?: boolean;
displayMode?: "always" | "visible";
@ -53,7 +54,8 @@ export const CodeDemo: React.FC<CodeDemoProps> = ({
defaultExpanded = false,
previewHeight = "auto",
overflow = "visible",
displayMode = "visible",
displayMode = "always",
showTabs = true,
highlightedLines,
iframeInitialWidth,
iframeSrc,
@ -137,9 +139,29 @@ export const CodeDemo: React.FC<CodeDemoProps> = ({
]);
return (
<div ref={ref} className="flex flex-col gap-4">
{previewContent}
{editorContent}
<div ref={ref} className="flex flex-col gap-2">
{showTabs ? (
<Tabs
disableAnimation
aria-label="Code demo tabs"
classNames={{
panel: "pt-0",
}}
variant="underlined"
>
<Tab key="preview" title="Preview">
{previewContent}
</Tab>
<Tab key="code" title="Code">
{editorContent}
</Tab>
</Tabs>
) : (
<>
{previewContent}
{editorContent}
</>
)}
</div>
);
};

View File

@ -1,5 +1,5 @@
import React, {forwardRef} from "react";
import {clsx} from "@nextui-org/shared-utils";
import {clsx, getUniqueID} from "@nextui-org/shared-utils";
import BaseHighlight, {Language, PrismTheme, defaultProps} from "prism-react-renderer";
import defaultTheme from "@/libs/prism-theme";
@ -81,7 +81,7 @@ const Codeblock = forwardRef<HTMLPreElement, CodeblockProps>(
return (
<div
key={i}
key={`${i}-${getUniqueID("line")}`}
{...lineProps}
className={clsx(
lineProps.className,

View File

@ -161,7 +161,6 @@ export const A11yOtb = () => {
isOpen={isDropdownOpen}
placement="bottom"
portalContainer={ref.current}
shouldBlockScroll={isMobile}
shouldFlip={isMobile}
onOpenChange={(open) => setIsDropdownOpen(open)}
>

View File

@ -10,7 +10,7 @@ export const BgLooper = () => {
return (
<div
className={clsx(
"absolute -top-20 lg:top-10 w-screen h-screen z-0 opacity-0",
"absolute -top-20 lg:top-10 w-screen h-screen z-0 opacity-0 overflow-hidden",
"data-[mounted=true]:opacity-100 transition-opacity",
"bg-left bg-no-repeat bg-[url('/gradients/looper-pattern.svg')]",
"after:content-[''] after:absolute after:top-0 after:left-0 after:w-full after:h-full after:z-[-1]",

View File

@ -1,31 +1,26 @@
"use client";
import dynamic from "next/dynamic";
import {Button, Tooltip} from "@nextui-org/react";
import {
Button,
Tooltip,
Input,
Image,
Card,
CardBody,
CardFooter,
Switch,
Spinner,
Pagination,
} from "@nextui-org/react";
import {MoonFilledIcon, SunFilledIcon} from "@nextui-org/shared-icons";
import {useTheme} from "next-themes";
import NextImage from "next/image";
import {FloatingTabs} from "./floating-tabs";
import {UserTwitterCard} from "@/components/demos/user-twitter-card";
import {useIsMounted} from "@/hooks/use-is-mounted";
import {useMediaQuery} from "@/hooks/use-media-query";
import {NextUILogo} from "@/components/nextui-logo";
const Input = dynamic(() => import("@nextui-org/react").then((mod) => mod.Input));
const Image = dynamic(() => import("@nextui-org/react").then((mod) => mod.Image));
const Card = dynamic(() => import("@nextui-org/react").then((mod) => mod.Card));
const CardBody = dynamic(() => import("@nextui-org/react").then((mod) => mod.CardBody));
const CardFooter = dynamic(() => import("@nextui-org/react").then((mod) => mod.CardFooter));
const Switch = dynamic(() => import("@nextui-org/react").then((mod) => mod.Switch));
const Spinner = dynamic(() => import("@nextui-org/react").then((mod) => mod.Spinner));
const Pagination = dynamic(() => import("@nextui-org/react").then((mod) => mod.Pagination));
const UserTwitterCard = dynamic(() =>
import("../../demos/user-twitter-card").then((mod) => mod.UserTwitterCard),
);
const FloatingTabs = dynamic(() => import("./floating-tabs").then((mod) => mod.FloatingTabs), {
ssr: false,
});
export const FloatingComponents: React.FC<{}> = () => {
const {theme, setTheme} = useTheme();

View File

@ -18,7 +18,6 @@ import {
DropdownItem,
DropdownTrigger,
} from "@nextui-org/react";
import dynamic from "next/dynamic";
import {ChevronDownIcon, LinkIcon} from "@nextui-org/shared-icons";
import {clsx} from "@nextui-org/shared-utils";
import NextLink from "next/link";
@ -30,9 +29,10 @@ import {useEffect} from "react";
import {siteConfig} from "@/config/site";
import {Route} from "@/libs/docs/page";
import {LargeLogo, ThemeSwitch} from "@/components";
import {LargeLogo, SmallLogo, ThemeSwitch} from "@/components";
import {TwitterIcon, GithubIcon, DiscordIcon, HeartFilledIcon} from "@/components/icons";
import {useIsMounted} from "@/hooks/use-is-mounted";
import {DocsSidebar} from "@/components/docs/sidebar";
export interface NavbarProps {
routes: Route[];
@ -41,11 +41,6 @@ export interface NavbarProps {
children?: ReactNode;
}
const DocsSidebar = dynamic(
() => import("@/components/docs/sidebar").then((mod) => mod.DocsSidebar),
{ssr: false},
);
export const Navbar: FC<NavbarProps> = ({children, routes, slug, tag}) => {
const [isMenuOpen, setIsMenuOpen] = useState<boolean | undefined>(false);
@ -90,16 +85,17 @@ export const Navbar: FC<NavbarProps> = ({children, routes, slug, tag}) => {
<NextUINavbar
ref={ref}
className={clsx({
isMenuOpen: "z-[100001]",
"z-[100001]": isMenuOpen,
})}
isMenuOpen={isMenuOpen}
maxWidth="xl"
position="sticky"
position="fixed"
onMenuOpenChange={setIsMenuOpen}
>
<NavbarContent className="basis-1/5 sm:basis-full" justify="start">
<NavbarBrand as="li" className="gap-3 max-w-fit">
<NextLink aria-label="Home" className="flex justify-start items-center gap-3" href="/">
<NextLink aria-label="Home" className="flex justify-start items-center gap-2" href="/">
<SmallLogo className="w-6 h-6 md:hidden" />
<LargeLogo className="h-5 md:h-6" />
</NextLink>
{ref.current ? (
@ -146,7 +142,6 @@ export const Navbar: FC<NavbarProps> = ({children, routes, slug, tag}) => {
color="foreground"
data-active={includes(docsPaths, pathname)}
href="/docs/guide/introduction"
prefetch={false}
>
Docs
</NextLink>
@ -160,7 +155,6 @@ export const Navbar: FC<NavbarProps> = ({children, routes, slug, tag}) => {
color="foreground"
data-active={includes(pathname, "components")}
href="/docs/components/avatar"
prefetch={false}
>
Components
</NextLink>
@ -182,17 +176,23 @@ export const Navbar: FC<NavbarProps> = ({children, routes, slug, tag}) => {
</NavbarContent>
<NavbarContent className="flex w-full gap-3 sm:hidden" justify="end">
<NavbarItem>
<NavbarItem className="flex items-center">
<Link isExternal aria-label="Github" href="https://github.com/nextui-org/nextui">
<GithubIcon className="text-default-600 dark:text-default-500" />
</Link>
</NavbarItem>
<NavbarItem>
<NavbarItem className="flex items-center">
<ThemeSwitch />
</NavbarItem>
<NavbarItem>
<NavbarMenuToggle
aria-label={isMenuOpen ? "Close menu" : "Open menu"}
className="sm:hidden"
/>
</NavbarItem>
</NavbarContent>
<NavbarContent className="basis-1/5 sm:basis-full" justify="end">
<NavbarContent className="hidden sm:flex basis-1/5 sm:basis-full" justify="end">
<NavbarItem className="hidden sm:flex gap-2">
<Link isExternal aria-label="Twitter" href={siteConfig.links.twitter}>
<TwitterIcon className="text-default-600 dark:text-default-500" />
@ -220,17 +220,11 @@ export const Navbar: FC<NavbarProps> = ({children, routes, slug, tag}) => {
Sponsor
</Button>
</NavbarItem>
<NavbarItem>
<NavbarMenuToggle
aria-label={isMenuOpen ? "Close menu" : "Open menu"}
className="sm:hidden"
/>
</NavbarItem>
</NavbarContent>
<NavbarMenu disableAnimation>
<NavbarMenu>
{searchInput}
<DocsSidebar routes={routes} slug={slug} tag={tag} />
<DocsSidebar className="mt-4" routes={routes} slug={slug} tag={tag} />
{children}
</NavbarMenu>
</NextUINavbar>

View File

@ -28,7 +28,7 @@ export default function App() {
return (
<div className="flex flex-wrap md:inline-grid md:grid-cols-3 gap-4">
{placements.map((placement) => (
<Popover key={placement} placement={placement}>
<Popover key={placement} placement={placement} color="primary">
<PopoverTrigger>
<Button variant="flat" color="primary">
{placement.charAt(0).toUpperCase() + placement.slice(1)}

View File

@ -151,7 +151,7 @@ You can customize the `Popover` component by passing custom Tailwind CSS classes
| showArrow | `boolean` | Whether the popover should have an arrow. | `false` |
| shouldFlip | `boolean` | Whether the popover should change its placement and flip when it's about to overflow its boundary area. | `true` |
| triggerScaleOnOpen | `boolean` | Whether the trigger should scale down when the popover is open. | `true` |
| shouldBlockScroll | `boolean` | Whether to block scrolling outside the popover. | `true` |
| shouldBlockScroll | `boolean` | Whether to block scrolling outside the popover. | `false` |
| isKeyboardDismissDisabled | `boolean` | Whether pressing the escape key to close the popover should be disabled. | `false` |
| shouldCloseOnBlur | `boolean` | Whether the popover should close when focus is lost or moves outside it. | `false` |
| motionProps | [MotionProps](#motion-props) | The props to modify the framer motion animation. Use the `variants` API to create your own animation. | |

View File

@ -1,5 +1,20 @@
# @nextui-org/accordion
## 0.0.0-dev-v2-20230616024445
### Patch Changes
- Prevent scroll removed from overlay components as Modal, Navbar and Popover. Navbar styles simplified
- Updated dependencies
- @nextui-org/use-aria-accordion-item@0.0.0-dev-v2-20230616024445
- @nextui-org/framer-transitions@0.0.0-dev-v2-20230616024445
- @nextui-org/shared-icons@0.0.0-dev-v2-20230616024445
- @nextui-org/shared-utils@0.0.0-dev-v2-20230616024445
- @nextui-org/react-utils@0.0.0-dev-v2-20230616024445
- @nextui-org/aria-utils@0.0.0-dev-v2-20230616024445
- @nextui-org/system@0.0.0-dev-v2-20230616024445
- @nextui-org/theme@0.0.0-dev-v2-20230616024445
## 0.0.0-dev-v2-20230615024440
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@nextui-org/accordion",
"version": "0.0.0-dev-v2-20230615024440",
"version": "0.0.0-dev-v2-20230616024445",
"description": "Collapse display a list of high-level options that can expand/collapse to reveal more information.",
"keywords": [
"react",

View File

@ -1,5 +1,17 @@
# @nextui-org/avatar
## 0.0.0-dev-v2-20230616024445
### Patch Changes
- Prevent scroll removed from overlay components as Modal, Navbar and Popover. Navbar styles simplified
- Updated dependencies
- @nextui-org/shared-utils@0.0.0-dev-v2-20230616024445
- @nextui-org/react-utils@0.0.0-dev-v2-20230616024445
- @nextui-org/use-image@0.0.0-dev-v2-20230616024445
- @nextui-org/system@0.0.0-dev-v2-20230616024445
- @nextui-org/theme@0.0.0-dev-v2-20230616024445
## 0.0.0-dev-v2-20230615024440
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@nextui-org/avatar",
"version": "0.0.0-dev-v2-20230615024440",
"version": "0.0.0-dev-v2-20230616024445",
"description": "The Avatar component is used to represent a user, and displays the profile picture, initials or fallback icon.",
"keywords": [
"avatar"

View File

@ -1,5 +1,16 @@
# @nextui-org/badge
## 0.0.0-dev-v2-20230616024445
### Patch Changes
- Prevent scroll removed from overlay components as Modal, Navbar and Popover. Navbar styles simplified
- Updated dependencies
- @nextui-org/shared-utils@0.0.0-dev-v2-20230616024445
- @nextui-org/react-utils@0.0.0-dev-v2-20230616024445
- @nextui-org/system@0.0.0-dev-v2-20230616024445
- @nextui-org/theme@0.0.0-dev-v2-20230616024445
## 0.0.0-dev-v2-20230615024440
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@nextui-org/badge",
"version": "0.0.0-dev-v2-20230615024440",
"version": "0.0.0-dev-v2-20230616024445",
"description": "Badges are used as a small numerical value or status descriptor for UI elements.",
"keywords": [
"badge"

View File

@ -1,5 +1,19 @@
# @nextui-org/button
## 0.0.0-dev-v2-20230616024445
### Patch Changes
- Prevent scroll removed from overlay components as Modal, Navbar and Popover. Navbar styles simplified
- Updated dependencies
- @nextui-org/shared-utils@0.0.0-dev-v2-20230616024445
- @nextui-org/use-aria-button@0.0.0-dev-v2-20230616024445
- @nextui-org/react-utils@0.0.0-dev-v2-20230616024445
- @nextui-org/spinner@0.0.0-dev-v2-20230616024445
- @nextui-org/drip@0.0.0-dev-v2-20230616024445
- @nextui-org/system@0.0.0-dev-v2-20230616024445
- @nextui-org/theme@0.0.0-dev-v2-20230616024445
## 0.0.0-dev-v2-20230615024440
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@nextui-org/button",
"version": "0.0.0-dev-v2-20230615024440",
"version": "0.0.0-dev-v2-20230616024445",
"description": "Buttons allow users to perform actions and choose with a single tap.",
"keywords": [
"button"

View File

@ -1,5 +1,18 @@
# @nextui-org/card
## 0.0.0-dev-v2-20230616024445
### Patch Changes
- Prevent scroll removed from overlay components as Modal, Navbar and Popover. Navbar styles simplified
- Updated dependencies
- @nextui-org/shared-utils@0.0.0-dev-v2-20230616024445
- @nextui-org/use-aria-button@0.0.0-dev-v2-20230616024445
- @nextui-org/react-utils@0.0.0-dev-v2-20230616024445
- @nextui-org/drip@0.0.0-dev-v2-20230616024445
- @nextui-org/system@0.0.0-dev-v2-20230616024445
- @nextui-org/theme@0.0.0-dev-v2-20230616024445
## 0.0.0-dev-v2-20230615024440
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@nextui-org/card",
"version": "0.0.0-dev-v2-20230615024440",
"version": "0.0.0-dev-v2-20230616024445",
"description": "Card is a container for text, photos, and actions in the context of a single subject.",
"keywords": [
"card"

View File

@ -1,5 +1,16 @@
# @nextui-org/checkbox
## 0.0.0-dev-v2-20230616024445
### Patch Changes
- Prevent scroll removed from overlay components as Modal, Navbar and Popover. Navbar styles simplified
- Updated dependencies
- @nextui-org/shared-utils@0.0.0-dev-v2-20230616024445
- @nextui-org/react-utils@0.0.0-dev-v2-20230616024445
- @nextui-org/system@0.0.0-dev-v2-20230616024445
- @nextui-org/theme@0.0.0-dev-v2-20230616024445
## 0.0.0-dev-v2-20230615024440
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@nextui-org/checkbox",
"version": "0.0.0-dev-v2-20230615024440",
"version": "0.0.0-dev-v2-20230616024445",
"description": "Checkboxes allow users to select multiple items from a list of individual items, or to mark one individual item as selected.",
"keywords": [
"checkbox"

View File

@ -1,5 +1,17 @@
# @nextui-org/chip
## 0.0.0-dev-v2-20230616024445
### Patch Changes
- Prevent scroll removed from overlay components as Modal, Navbar and Popover. Navbar styles simplified
- Updated dependencies
- @nextui-org/shared-icons@0.0.0-dev-v2-20230616024445
- @nextui-org/shared-utils@0.0.0-dev-v2-20230616024445
- @nextui-org/react-utils@0.0.0-dev-v2-20230616024445
- @nextui-org/system@0.0.0-dev-v2-20230616024445
- @nextui-org/theme@0.0.0-dev-v2-20230616024445
## 0.0.0-dev-v2-20230615024440
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@nextui-org/chip",
"version": "0.0.0-dev-v2-20230615024440",
"version": "0.0.0-dev-v2-20230616024445",
"description": "Chips help people enter information, make selections, filter content, or trigger actions.",
"keywords": [
"chip"

View File

@ -1,5 +1,16 @@
# @nextui-org/code
## 0.0.0-dev-v2-20230616024445
### Patch Changes
- Prevent scroll removed from overlay components as Modal, Navbar and Popover. Navbar styles simplified
- Updated dependencies
- @nextui-org/shared-utils@0.0.0-dev-v2-20230616024445
- @nextui-org/react-utils@0.0.0-dev-v2-20230616024445
- @nextui-org/system@0.0.0-dev-v2-20230616024445
- @nextui-org/theme@0.0.0-dev-v2-20230616024445
## 0.0.0-dev-v2-20230615024440
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@nextui-org/code",
"version": "0.0.0-dev-v2-20230615024440",
"version": "0.0.0-dev-v2-20230616024445",
"description": "Code is a component used to display inline code.",
"keywords": [
"code"

View File

@ -1,5 +1,16 @@
# @nextui-org/divider
## 0.0.0-dev-v2-20230616024445
### Patch Changes
- Prevent scroll removed from overlay components as Modal, Navbar and Popover. Navbar styles simplified
- Updated dependencies
- @nextui-org/shared-utils@0.0.0-dev-v2-20230616024445
- @nextui-org/react-utils@0.0.0-dev-v2-20230616024445
- @nextui-org/system@0.0.0-dev-v2-20230616024445
- @nextui-org/theme@0.0.0-dev-v2-20230616024445
## 0.0.0-dev-v2-20230615024440
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@nextui-org/divider",
"version": "0.0.0-dev-v2-20230615024440",
"version": "0.0.0-dev-v2-20230616024445",
"description": ". A separator is a visual divider between two groups of content",
"keywords": [
"divider"

View File

@ -1,5 +1,15 @@
# @nextui-org/drip
## 0.0.0-dev-v2-20230616024445
### Patch Changes
- Prevent scroll removed from overlay components as Modal, Navbar and Popover. Navbar styles simplified
- Updated dependencies
- @nextui-org/shared-utils@0.0.0-dev-v2-20230616024445
- @nextui-org/system@0.0.0-dev-v2-20230616024445
- @nextui-org/theme@0.0.0-dev-v2-20230616024445
## 0.0.0-dev-v2-20230615024440
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@nextui-org/drip",
"version": "0.0.0-dev-v2-20230615024440",
"version": "0.0.0-dev-v2-20230616024445",
"description": "A ripple effect for ensuring that the user fells the system is reacting instantaneously",
"keywords": [
"drip"

View File

@ -1,5 +1,19 @@
# @nextui-org/dropdown
## 0.0.0-dev-v2-20230616024445
### Patch Changes
- Prevent scroll removed from overlay components as Modal, Navbar and Popover. Navbar styles simplified
- Updated dependencies
- @nextui-org/shared-utils@0.0.0-dev-v2-20230616024445
- @nextui-org/react-utils@0.0.0-dev-v2-20230616024445
- @nextui-org/aria-utils@0.0.0-dev-v2-20230616024445
- @nextui-org/use-is-mobile@0.0.0-dev-v2-20230616024445
- @nextui-org/popover@0.0.0-dev-v2-20230616024445
- @nextui-org/system@0.0.0-dev-v2-20230616024445
- @nextui-org/theme@0.0.0-dev-v2-20230616024445
## 0.0.0-dev-v2-20230615024440
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@nextui-org/dropdown",
"version": "0.0.0-dev-v2-20230615024440",
"version": "0.0.0-dev-v2-20230616024445",
"description": "A dropdown displays a list of actions or options that a user can choose.",
"keywords": [
"dropdown"

View File

@ -1,5 +1,17 @@
# @nextui-org/image
## 0.0.0-dev-v2-20230616024445
### Patch Changes
- Prevent scroll removed from overlay components as Modal, Navbar and Popover. Navbar styles simplified
- Updated dependencies
- @nextui-org/shared-utils@0.0.0-dev-v2-20230616024445
- @nextui-org/react-utils@0.0.0-dev-v2-20230616024445
- @nextui-org/use-image@0.0.0-dev-v2-20230616024445
- @nextui-org/system@0.0.0-dev-v2-20230616024445
- @nextui-org/theme@0.0.0-dev-v2-20230616024445
## 0.0.0-dev-v2-20230615024440
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@nextui-org/image",
"version": "0.0.0-dev-v2-20230615024440",
"version": "0.0.0-dev-v2-20230616024445",
"description": "A simple image component",
"keywords": [
"image"

View File

@ -1,5 +1,18 @@
# @nextui-org/input
## 0.0.0-dev-v2-20230616024445
### Patch Changes
- Prevent scroll removed from overlay components as Modal, Navbar and Popover. Navbar styles simplified
- Updated dependencies
- @nextui-org/shared-icons@0.0.0-dev-v2-20230616024445
- @nextui-org/shared-utils@0.0.0-dev-v2-20230616024445
- @nextui-org/react-utils@0.0.0-dev-v2-20230616024445
- @nextui-org/use-aria-field@0.0.0-dev-v2-20230616024445
- @nextui-org/system@0.0.0-dev-v2-20230616024445
- @nextui-org/theme@0.0.0-dev-v2-20230616024445
## 0.0.0-dev-v2-20230615024440
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@nextui-org/input",
"version": "0.0.0-dev-v2-20230615024440",
"version": "0.0.0-dev-v2-20230616024445",
"description": "The input component is designed for capturing user input within a text field.",
"keywords": [
"input"

View File

@ -1,5 +1,16 @@
# @nextui-org/kbd
## 0.0.0-dev-v2-20230616024445
### Patch Changes
- Prevent scroll removed from overlay components as Modal, Navbar and Popover. Navbar styles simplified
- Updated dependencies
- @nextui-org/shared-utils@0.0.0-dev-v2-20230616024445
- @nextui-org/react-utils@0.0.0-dev-v2-20230616024445
- @nextui-org/system@0.0.0-dev-v2-20230616024445
- @nextui-org/theme@0.0.0-dev-v2-20230616024445
## 0.0.0-dev-v2-20230615024440
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@nextui-org/kbd",
"version": "0.0.0-dev-v2-20230615024440",
"version": "0.0.0-dev-v2-20230616024445",
"description": "The keyboard key components indicates which key or set of keys used to execute a specificv action",
"keywords": [
"kbd"

View File

@ -1,5 +1,17 @@
# @nextui-org/link
## 0.0.0-dev-v2-20230616024445
### Patch Changes
- Prevent scroll removed from overlay components as Modal, Navbar and Popover. Navbar styles simplified
- Updated dependencies
- @nextui-org/shared-icons@0.0.0-dev-v2-20230616024445
- @nextui-org/shared-utils@0.0.0-dev-v2-20230616024445
- @nextui-org/react-utils@0.0.0-dev-v2-20230616024445
- @nextui-org/system@0.0.0-dev-v2-20230616024445
- @nextui-org/theme@0.0.0-dev-v2-20230616024445
## 0.0.0-dev-v2-20230615024440
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@nextui-org/link",
"version": "0.0.0-dev-v2-20230615024440",
"version": "0.0.0-dev-v2-20230616024445",
"description": "Links allow users to click their way from page to page. This component is styled to resemble a hyperlink and semantically renders an &lt;a&gt;",
"keywords": [
"link"

View File

@ -1,5 +1,20 @@
# @nextui-org/modal
## 0.0.0-dev-v2-20230616024445
### Patch Changes
- Prevent scroll removed from overlay components as Modal, Navbar and Popover. Navbar styles simplified
- Updated dependencies
- @nextui-org/framer-transitions@0.0.0-dev-v2-20230616024445
- @nextui-org/shared-icons@0.0.0-dev-v2-20230616024445
- @nextui-org/shared-utils@0.0.0-dev-v2-20230616024445
- @nextui-org/use-aria-button@0.0.0-dev-v2-20230616024445
- @nextui-org/react-utils@0.0.0-dev-v2-20230616024445
- @nextui-org/use-disclosure@0.0.0-dev-v2-20230616024445
- @nextui-org/system@0.0.0-dev-v2-20230616024445
- @nextui-org/theme@0.0.0-dev-v2-20230616024445
## 0.0.0-dev-v2-20230615024440
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@nextui-org/modal",
"version": "0.0.0-dev-v2-20230615024440",
"version": "0.0.0-dev-v2-20230616024445",
"description": "Displays a dialog with a custom content that requires attention or provides additional information.",
"keywords": [
"modal"
@ -46,13 +46,15 @@
"@nextui-org/shared-utils": "workspace:*",
"@nextui-org/react-utils": "workspace:*",
"@nextui-org/shared-icons": "workspace:*",
"@nextui-org/use-aria-modal-overlay": "workspace:*",
"@react-aria/dialog": "^3.5.2",
"@react-aria/interactions": "^3.15.1",
"@react-aria/overlays": "^3.14.1",
"@react-aria/utils": "^3.17.0",
"@react-stately/overlays": "^3.5.2",
"@react-aria/focus": "^3.12.1",
"@react-types/overlays": "^3.7.2"
"@react-types/overlays": "^3.7.2",
"react-remove-scroll": "^2.5.6"
},
"devDependencies": {
"@nextui-org/input": "workspace:*",

View File

@ -6,6 +6,7 @@ import {forwardRef} from "@nextui-org/system";
import {DismissButton} from "@react-aria/overlays";
import {TRANSITION_VARIANTS} from "@nextui-org/framer-transitions";
import {CloseIcon} from "@nextui-org/shared-icons";
import {RemoveScroll} from "react-remove-scroll";
import {motion} from "framer-motion";
import {useDialog} from "@react-aria/dialog";
import {mergeProps} from "@react-aria/utils";
@ -81,20 +82,22 @@ const ModalContent = forwardRef<ModalContentProps, "section">((props, _) => {
return (
<div tabIndex={-1}>
{backdropContent}
{disableAnimation ? (
<div className={slots.wrapper({class: classNames?.wrapper})}>{content}</div>
) : (
<motion.div
animate="enter"
className={slots.wrapper({class: classNames?.wrapper})}
exit="exit"
initial="exit"
variants={TRANSITION_VARIANTS.scaleInOut}
{...motionProps}
>
{content}
</motion.div>
)}
<RemoveScroll forwardProps>
{disableAnimation ? (
<div className={slots.wrapper({class: classNames?.wrapper})}>{content}</div>
) : (
<motion.div
animate="enter"
className={slots.wrapper({class: classNames?.wrapper})}
exit="exit"
initial="exit"
variants={TRANSITION_VARIANTS.scaleInOut}
{...motionProps}
>
{content}
</motion.div>
)}
</RemoveScroll>
</div>
);
});

View File

@ -1,7 +1,8 @@
import type {ModalVariantProps, SlotsToClasses, ModalSlots} from "@nextui-org/theme";
import type {HTMLMotionProps} from "framer-motion";
import {AriaModalOverlayProps, useModalOverlay} from "@react-aria/overlays";
import {AriaModalOverlayProps} from "@react-aria/overlays";
import {useAriaModalOverlay} from "@nextui-org/use-aria-modal-overlay";
import {
RefObject,
Ref,
@ -134,7 +135,7 @@ export function useModal(originalProps: UseModalProps) {
const {triggerProps} = useOverlayTrigger({type: "dialog"}, state, triggerRef);
const {modalProps, underlayProps} = useModalOverlay(
const {modalProps, underlayProps} = useAriaModalOverlay(
{
isDismissable,
isKeyboardDismissDisabled,

View File

@ -1,5 +1,19 @@
# @nextui-org/navbar
## 0.0.0-dev-v2-20230616024445
### Patch Changes
- Prevent scroll removed from overlay components as Modal, Navbar and Popover. Navbar styles simplified
- Updated dependencies
- @nextui-org/use-aria-toggle-button@0.0.0-dev-v2-20230616024445
- @nextui-org/framer-transitions@0.0.0-dev-v2-20230616024445
- @nextui-org/use-scroll-position@0.0.0-dev-v2-20230616024445
- @nextui-org/shared-utils@0.0.0-dev-v2-20230616024445
- @nextui-org/react-utils@0.0.0-dev-v2-20230616024445
- @nextui-org/system@0.0.0-dev-v2-20230616024445
- @nextui-org/theme@0.0.0-dev-v2-20230616024445
## 0.0.0-dev-v2-20230615024440
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@nextui-org/navbar",
"version": "0.0.0-dev-v2-20230615024440",
"version": "0.0.0-dev-v2-20230616024445",
"description": "A responsive navigation header positioned on top side of your page that includes support for branding, links, navigation, collapse and more.",
"keywords": [
"navbar"
@ -47,10 +47,11 @@
"@nextui-org/use-scroll-position": "workspace:*",
"@react-aria/focus": "^3.12.1",
"@react-aria/interactions": "^3.15.1",
"@react-aria/overlays": "^3.14.1",
"@react-aria/utils": "^3.17.0",
"@react-stately/toggle": "^3.5.2",
"@react-stately/utils": "^3.6.0"
"@react-stately/utils": "^3.6.0",
"@react-aria/overlays": "^3.14.1",
"react-remove-scroll": "^2.5.6"
},
"devDependencies": {
"@nextui-org/avatar": "workspace:*",

View File

@ -1,26 +1,15 @@
import {forwardRef, HTMLNextUIProps} from "@nextui-org/system";
import {useDOMRef} from "@nextui-org/react-utils";
import {clsx, dataAttr} from "@nextui-org/shared-utils";
import {motion, HTMLMotionProps} from "framer-motion";
import {mergeProps} from "@react-aria/utils";
import {menuItemVariants} from "./navbar-menu-transitions";
import {useNavbarContext} from "./navbar-context";
export interface NavbarMenuItemProps extends HTMLNextUIProps<"li"> {
children?: React.ReactNode;
/**
* Whether to disable the animation.
*/
disableAnimation?: boolean;
/**
* The props to modify the framer motion animation. Use the `variants` API to create your own animation.
*/
motionProps?: HTMLMotionProps<"li">;
}
const NavbarMenuItem = forwardRef<NavbarMenuItemProps, "li">((props, ref) => {
const {className, children, disableAnimation, motionProps, ...otherProps} = props;
const {className, children, ...otherProps} = props;
const domRef = useDOMRef(ref);
@ -28,29 +17,15 @@ const NavbarMenuItem = forwardRef<NavbarMenuItemProps, "li">((props, ref) => {
const styles = clsx(classNames?.menuItem, className);
if (disableAnimation) {
return (
<li
ref={domRef}
className={slots.menuItem?.({class: styles})}
data-open={dataAttr(isMenuOpen)}
{...otherProps}
>
{children}
</li>
);
}
return (
<motion.li
<li
ref={domRef}
className={slots.menuItem?.({class: styles})}
data-open={dataAttr(isMenuOpen)}
variants={menuItemVariants}
{...mergeProps(motionProps, otherProps)}
{...otherProps}
>
{children}
</motion.li>
</li>
);
});

View File

@ -1,39 +1,19 @@
import {TRANSITION_EASINGS} from "@nextui-org/framer-transitions";
import {Variants} from "framer-motion";
export const menuVariants: Variants = {
open: {
enter: {
height: "calc(100vh - var(--navbar-height) - 1px)",
transition: {
type: "spring",
bounce: 0,
duration: 0.7,
delayChildren: 0.15,
staggerChildren: 0.05,
duration: 0.4,
ease: TRANSITION_EASINGS.ease,
},
},
closed: {
exit: {
height: 0,
transition: {
type: "spring",
bounce: 0,
duration: 0.3,
},
},
};
export const menuItemVariants: Variants = {
open: {
opacity: 1,
y: 0,
transition: {
type: "spring",
stiffness: 300,
damping: 24,
},
},
closed: {
opacity: 0,
y: 20,
transition: {
duration: 0.2,
ease: TRANSITION_EASINGS.ease,
},
},
};

View File

@ -1,20 +1,23 @@
import {forwardRef, HTMLNextUIProps} from "@nextui-org/system";
import {useDOMRef} from "@nextui-org/react-utils";
import {clsx, dataAttr} from "@nextui-org/shared-utils";
import {HTMLMotionProps, motion} from "framer-motion";
import {usePreventScroll} from "@react-aria/overlays";
import {AnimatePresence, HTMLMotionProps, motion} from "framer-motion";
import {mergeProps} from "@react-aria/utils";
import {ReactElement, useCallback} from "react";
import {RemoveScroll} from "react-remove-scroll";
import {Overlay} from "@react-aria/overlays";
import {menuVariants} from "./navbar-menu-transitions";
import {useNavbarContext} from "./navbar-context";
export interface NavbarMenuProps extends HTMLNextUIProps<"ul"> {
children?: React.ReactNode;
/**
* Whether to disable the animation.
* @default false
* The container element in which the navbar menu overlay portal will be placed.
* @default document.body
*/
disableAnimation?: boolean;
portalContainer?: Element;
/**
* The props to modify the framer motion animation. Use the `variants` API to create your own animation.
*/
@ -22,45 +25,67 @@ export interface NavbarMenuProps extends HTMLNextUIProps<"ul"> {
}
const NavbarMenu = forwardRef<NavbarMenuProps, "ul">((props, ref) => {
const {className, children, disableAnimation = false, motionProps, ...otherProps} = props;
const {className, children, portalContainer, motionProps, style, ...otherProps} = props;
const domRef = useDOMRef(ref);
const {slots, isMenuOpen, classNames} = useNavbarContext();
const {slots, isMenuOpen, height, disableAnimation, classNames} = useNavbarContext();
const styles = clsx(classNames?.menu, className);
usePreventScroll({
isDisabled: !isMenuOpen,
});
const MenuWrapper = useCallback(
({children}: {children: ReactElement}) => {
return (
<RemoveScroll forwardProps enabled={isMenuOpen}>
{children}
</RemoveScroll>
);
},
[isMenuOpen],
);
if (disableAnimation) {
return (
const contents = disableAnimation ? (
<MenuWrapper>
<ul
ref={domRef}
className={slots.menu?.({class: styles})}
data-open={dataAttr(isMenuOpen)}
style={{
// @ts-expect-error
"--navbar-height": height,
}}
{...otherProps}
>
{children}
</ul>
);
}
return (
<motion.ul
ref={domRef}
layoutScroll
animate={isMenuOpen ? "open" : "closed"}
className={slots.menu?.({class: styles})}
data-open={dataAttr(isMenuOpen)}
initial={false}
variants={menuVariants}
{...mergeProps(motionProps, otherProps)}
>
{children}
</motion.ul>
</MenuWrapper>
) : (
<AnimatePresence initial={false}>
{isMenuOpen ? (
<MenuWrapper>
<motion.ul
ref={domRef}
layoutScroll
animate="enter"
className={slots.menu?.({class: styles})}
data-open={dataAttr(isMenuOpen)}
exit="exit"
initial="exit"
style={{
// @ts-expect-error
"--navbar-height": height,
...style,
}}
variants={menuVariants}
{...mergeProps(motionProps, otherProps)}
>
{children}
</motion.ul>
</MenuWrapper>
) : null}
</AnimatePresence>
);
return <Overlay portalContainer={portalContainer}>{contents}</Overlay>;
});
NavbarMenu.displayName = "NextUI.NavbarMenu";

View File

@ -1,7 +1,7 @@
import {TRANSITION_EASINGS} from "@nextui-org/framer-transitions";
import {Variants} from "framer-motion";
export const variants: Variants = {
export const hideOnScrollVariants: Variants = {
visible: {
y: 0,
transition: {

View File

@ -3,7 +3,7 @@ import {pickChildren} from "@nextui-org/react-utils";
import {motion} from "framer-motion";
import {mergeProps} from "@react-aria/utils";
import {variants} from "./navbar-transitions";
import {hideOnScrollVariants} from "./navbar-transitions";
import {UseNavbarProps, useNavbar} from "./use-navbar";
import {NavbarProvider} from "./navbar-context";
import NavbarMenu from "./navbar-menu";
@ -34,7 +34,7 @@ const Navbar = forwardRef<NavbarProps, "div">((props, ref) => {
<motion.nav
animate={context.isHidden ? "hidden" : "visible"}
initial={false}
variants={variants}
variants={hideOnScrollVariants}
{...mergeProps(context.getBaseProps(), context.motionProps)}
>
{content}

View File

@ -63,7 +63,6 @@ export interface UseNavbarProps extends HTMLNextUIProps<"nav", NavbarVariantProp
* it only works if `disableScrollHandler` is set to `false` or `shouldHideOnScroll` is set to `true`.
*/
onScrollPositionChange?: (scrollPosition: number) => void;
/**
* Classname or List of classes to change the classNames of the element.
* if `className` is passed, it will be added to the base slot.
@ -193,14 +192,16 @@ export function useNavbar(originalProps: UseNavbarProps) {
return {
Component,
motionProps,
isHidden,
slots,
domRef,
classNames,
height,
isHidden,
disableAnimation: originalProps.disableAnimation ?? false,
shouldHideOnScroll,
isMenuOpen,
classNames,
setIsMenuOpen,
motionProps,
getBaseProps,
getWrapperProps,
};

View File

@ -36,7 +36,7 @@ export default {
position: {
control: {
type: "select",
options: ["static", "sticky", "floating"],
options: ["static", "fixed"],
},
},
maxWidth: {
@ -79,7 +79,7 @@ const App = React.forwardRef(({children}: any, ref: any) => {
return (
<div
ref={ref}
className="max-w-[90%] sm:max-w-[80%] max-h-[90vh] overflow-x-hidden overflow-y-scroll shadow-md relative border border-default"
className="max-w-[90%] pt-16 sm:max-w-[80%] max-h-[90vh] overflow-x-hidden overflow-y-scroll shadow-md relative border border-default"
>
{children}
<div className="max-w-5xl flex flex-col gap-4 px-10 mt-8">
@ -157,7 +157,7 @@ const WithMenuTemplate: ComponentStory<typeof Navbar> = (args: NavbarProps) => {
return (
<App ref={parentRef}>
<Navbar parentRef={parentRef} position="sticky" onMenuOpenChange={setIsMenuOpen} {...args}>
<Navbar parentRef={parentRef} position="fixed" onMenuOpenChange={setIsMenuOpen} {...args}>
<NavbarContent>
<NavbarMenuToggle
aria-label={isMenuOpen ? "Close menu" : "Open menu"}
@ -535,22 +535,16 @@ Static.args = {
position: "static",
};
export const Sticky = Template.bind({});
Sticky.args = {
export const Fixed = Template.bind({});
Fixed.args = {
...defaultProps,
position: "sticky",
};
export const Floating = Template.bind({});
Floating.args = {
...defaultProps,
position: "floating",
position: "fixed",
};
export const HideOnScroll = Template.bind({});
HideOnScroll.args = {
...defaultProps,
position: "sticky",
position: "fixed",
shouldHideOnScroll: true,
};

View File

@ -1,5 +1,18 @@
# @nextui-org/pagination
## 0.0.0-dev-v2-20230616024445
### Patch Changes
- Prevent scroll removed from overlay components as Modal, Navbar and Popover. Navbar styles simplified
- Updated dependencies
- @nextui-org/shared-icons@0.0.0-dev-v2-20230616024445
- @nextui-org/shared-utils@0.0.0-dev-v2-20230616024445
- @nextui-org/react-utils@0.0.0-dev-v2-20230616024445
- @nextui-org/use-pagination@0.0.0-dev-v2-20230616024445
- @nextui-org/system@0.0.0-dev-v2-20230616024445
- @nextui-org/theme@0.0.0-dev-v2-20230616024445
## 0.0.0-dev-v2-20230615024440
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@nextui-org/pagination",
"version": "0.0.0-dev-v2-20230615024440",
"version": "0.0.0-dev-v2-20230616024445",
"description": "The Pagination component allows you to display active page and navigate between multiple pages.",
"keywords": [
"pagination"

View File

@ -1,5 +1,20 @@
# @nextui-org/popover
## 0.0.0-dev-v2-20230616024445
### Patch Changes
- Prevent scroll removed from overlay components as Modal, Navbar and Popover. Navbar styles simplified
- Updated dependencies
- @nextui-org/framer-transitions@0.0.0-dev-v2-20230616024445
- @nextui-org/shared-utils@0.0.0-dev-v2-20230616024445
- @nextui-org/use-aria-button@0.0.0-dev-v2-20230616024445
- @nextui-org/react-utils@0.0.0-dev-v2-20230616024445
- @nextui-org/aria-utils@0.0.0-dev-v2-20230616024445
- @nextui-org/button@0.0.0-dev-v2-20230616024445
- @nextui-org/system@0.0.0-dev-v2-20230616024445
- @nextui-org/theme@0.0.0-dev-v2-20230616024445
## 0.0.0-dev-v2-20230615024440
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@nextui-org/popover",
"version": "0.0.0-dev-v2-20230615024440",
"version": "0.0.0-dev-v2-20230616024445",
"description": "A popover is an overlay element positioned relative to a trigger.",
"keywords": [
"popover"
@ -53,7 +53,8 @@
"@react-stately/overlays": "^3.5.2",
"@react-aria/focus": "^3.12.1",
"@react-types/overlays": "^3.7.2",
"@react-types/button": "^3.7.3"
"@react-types/button": "^3.7.3",
"react-remove-scroll": "^2.5.6"
},
"devDependencies": {
"@nextui-org/input": "workspace:*",

View File

@ -9,6 +9,7 @@ import {motion} from "framer-motion";
import {getTransformOrigins} from "@nextui-org/aria-utils";
import {useDialog} from "@react-aria/dialog";
import {mergeProps} from "@react-aria/utils";
import {RemoveScroll} from "react-remove-scroll";
import {usePopoverContext} from "./popover-context";
@ -26,6 +27,7 @@ const PopoverContent = forwardRef<PopoverContentProps, "section">((props, _) =>
motionProps,
backdrop,
disableAnimation,
shouldBlockScroll,
getPopoverProps,
getArrowProps,
getDialogProps,
@ -83,22 +85,24 @@ const PopoverContent = forwardRef<PopoverContentProps, "section">((props, _) =>
return (
<div {...getPopoverProps()}>
{backdropContent}
{disableAnimation ? (
content
) : (
<motion.div
animate="enter"
exit="exit"
initial="exit"
style={{
...getTransformOrigins(placement === "center" ? "top" : placement),
}}
variants={TRANSITION_VARIANTS.scaleSpring}
{...motionProps}
>
{content}
</motion.div>
)}
<RemoveScroll forwardProps enabled={shouldBlockScroll}>
{disableAnimation ? (
content
) : (
<motion.div
animate="enter"
exit="exit"
initial="exit"
style={{
...getTransformOrigins(placement === "center" ? "top" : placement),
}}
variants={TRANSITION_VARIANTS.scaleSpring}
{...motionProps}
>
{content}
</motion.div>
)}
</RemoveScroll>
</div>
);
});

View File

@ -1,11 +1,5 @@
import {RefObject, useLayoutEffect} from "react";
import {
AriaPopoverProps,
useOverlay,
PopoverAria,
usePreventScroll,
useOverlayPosition,
} from "@react-aria/overlays";
import {AriaPopoverProps, useOverlay, PopoverAria, useOverlayPosition} from "@react-aria/overlays";
import {OverlayPlacement, toReactAriaPlacement, ariaHideOutside} from "@nextui-org/aria-utils";
import {OverlayTriggerState} from "@react-stately/overlays";
import {mergeProps} from "@react-aria/utils";
@ -86,10 +80,6 @@ export function useReactAriaPopover(
onClose: () => {},
});
usePreventScroll({
isDisabled: isNonModal,
});
useLayoutEffect(() => {
if (state.isOpen && !isNonModal && popoverRef.current) {
return ariaHideOutside([popoverRef.current]);

View File

@ -4,7 +4,7 @@ import type {RefObject, Ref} from "react";
import {OverlayTriggerState, useOverlayTriggerState} from "@react-stately/overlays";
import {useFocusRing} from "@react-aria/focus";
import {useOverlayTrigger, usePreventScroll} from "@react-aria/overlays";
import {useOverlayTrigger} from "@react-aria/overlays";
import {OverlayTriggerProps} from "@react-types/overlays";
import {HTMLNextUIProps, mapPropsVariants, PropGetter} from "@nextui-org/system";
import {getArrowPlacement, getShouldUseAxisPlacement} from "@nextui-org/aria-utils";
@ -89,7 +89,7 @@ export function usePopover(originalProps: UsePopoverProps) {
onOpenChange,
shouldFlip = true,
containerPadding = 12,
shouldBlockScroll = true,
shouldBlockScroll = false,
portalContainer,
placement: placementProp = "top",
triggerType = "dialog",
@ -133,10 +133,6 @@ export function usePopover(originalProps: UsePopoverProps) {
const state = stateProp || innerState;
usePreventScroll({
isDisabled: !state.isOpen || !shouldBlockScroll,
});
const {popoverProps, underlayProps, arrowProps, placement: ariaPlacement} = useReactAriaPopover(
{
triggerRef,
@ -233,6 +229,7 @@ export function usePopover(originalProps: UsePopoverProps) {
isOpen: state.isOpen,
onClose: state.close,
disableAnimation,
shouldBlockScroll,
backdrop: originalProps.backdrop ?? "transparent",
motionProps,
focusProps,

View File

@ -1,5 +1,18 @@
# @nextui-org/progress
## 0.0.0-dev-v2-20230616024445
### Patch Changes
- Prevent scroll removed from overlay components as Modal, Navbar and Popover. Navbar styles simplified
- Updated dependencies
- @nextui-org/shared-utils@0.0.0-dev-v2-20230616024445
- @nextui-org/react-utils@0.0.0-dev-v2-20230616024445
- @nextui-org/use-aria-label@0.0.0-dev-v2-20230616024445
- @nextui-org/use-is-mounted@0.0.0-dev-v2-20230616024445
- @nextui-org/system@0.0.0-dev-v2-20230616024445
- @nextui-org/theme@0.0.0-dev-v2-20230616024445
## 0.0.0-dev-v2-20230615024440
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@nextui-org/progress",
"version": "0.0.0-dev-v2-20230615024440",
"version": "0.0.0-dev-v2-20230616024445",
"description": "Progress bars show either determinate or indeterminate progress of an operation over time.",
"keywords": [
"progress"

View File

@ -1,5 +1,16 @@
# @nextui-org/radio
## 0.0.0-dev-v2-20230616024445
### Patch Changes
- Prevent scroll removed from overlay components as Modal, Navbar and Popover. Navbar styles simplified
- Updated dependencies
- @nextui-org/shared-utils@0.0.0-dev-v2-20230616024445
- @nextui-org/react-utils@0.0.0-dev-v2-20230616024445
- @nextui-org/system@0.0.0-dev-v2-20230616024445
- @nextui-org/theme@0.0.0-dev-v2-20230616024445
## 0.0.0-dev-v2-20230615024440
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@nextui-org/radio",
"version": "0.0.0-dev-v2-20230615024440",
"version": "0.0.0-dev-v2-20230616024445",
"description": "Radios allow users to select a single option from a list of mutually exclusive options.",
"keywords": [
"radio"

View File

@ -1,5 +1,16 @@
# @nextui-org/skeleton
## 0.0.0-dev-v2-20230616024445
### Patch Changes
- Prevent scroll removed from overlay components as Modal, Navbar and Popover. Navbar styles simplified
- Updated dependencies
- @nextui-org/shared-utils@0.0.0-dev-v2-20230616024445
- @nextui-org/react-utils@0.0.0-dev-v2-20230616024445
- @nextui-org/system@0.0.0-dev-v2-20230616024445
- @nextui-org/theme@0.0.0-dev-v2-20230616024445
## 0.0.0-dev-v2-20230615024440
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@nextui-org/skeleton",
"version": "0.0.0-dev-v2-20230615024440",
"version": "0.0.0-dev-v2-20230616024445",
"description": "Skeleton is used to display the loading state of some component.",
"keywords": [
"skeleton"

View File

@ -1,5 +1,20 @@
# @nextui-org/snippet
## 0.0.0-dev-v2-20230616024445
### Patch Changes
- Prevent scroll removed from overlay components as Modal, Navbar and Popover. Navbar styles simplified
- Updated dependencies
- @nextui-org/shared-icons@0.0.0-dev-v2-20230616024445
- @nextui-org/shared-utils@0.0.0-dev-v2-20230616024445
- @nextui-org/react-utils@0.0.0-dev-v2-20230616024445
- @nextui-org/use-clipboard@0.0.0-dev-v2-20230616024445
- @nextui-org/tooltip@0.0.0-dev-v2-20230616024445
- @nextui-org/button@0.0.0-dev-v2-20230616024445
- @nextui-org/system@0.0.0-dev-v2-20230616024445
- @nextui-org/theme@0.0.0-dev-v2-20230616024445
## 0.0.0-dev-v2-20230615024440
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@nextui-org/snippet",
"version": "0.0.0-dev-v2-20230615024440",
"version": "0.0.0-dev-v2-20230616024445",
"description": "Display a snippet of copyable code for the command line.",
"keywords": [
"snippet"

View File

@ -1,5 +1,16 @@
# @nextui-org/spacer
## 0.0.0-dev-v2-20230616024445
### Patch Changes
- Prevent scroll removed from overlay components as Modal, Navbar and Popover. Navbar styles simplified
- Updated dependencies
- @nextui-org/shared-utils@0.0.0-dev-v2-20230616024445
- @nextui-org/react-utils@0.0.0-dev-v2-20230616024445
- @nextui-org/system@0.0.0-dev-v2-20230616024445
- @nextui-org/theme@0.0.0-dev-v2-20230616024445
## 0.0.0-dev-v2-20230615024440
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@nextui-org/spacer",
"version": "0.0.0-dev-v2-20230615024440",
"version": "0.0.0-dev-v2-20230616024445",
"description": "A flexible spacer component designed to create consistent spacing and maintain alignment in your layout.",
"keywords": [
"spacer"

View File

@ -1,5 +1,16 @@
# @nextui-org/spinner
## 0.0.0-dev-v2-20230616024445
### Patch Changes
- Prevent scroll removed from overlay components as Modal, Navbar and Popover. Navbar styles simplified
- Updated dependencies
- @nextui-org/shared-utils@0.0.0-dev-v2-20230616024445
- @nextui-org/react-utils@0.0.0-dev-v2-20230616024445
- @nextui-org/system@0.0.0-dev-v2-20230616024445
- @nextui-org/theme@0.0.0-dev-v2-20230616024445
## 0.0.0-dev-v2-20230615024440
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@nextui-org/spinner",
"version": "0.0.0-dev-v2-20230615024440",
"version": "0.0.0-dev-v2-20230616024445",
"description": "Loaders express an unspecified wait time or display the length of a process.",
"keywords": [
"loading",

View File

@ -1,5 +1,16 @@
# @nextui-org/switch
## 0.0.0-dev-v2-20230616024445
### Patch Changes
- Prevent scroll removed from overlay components as Modal, Navbar and Popover. Navbar styles simplified
- Updated dependencies
- @nextui-org/shared-utils@0.0.0-dev-v2-20230616024445
- @nextui-org/react-utils@0.0.0-dev-v2-20230616024445
- @nextui-org/system@0.0.0-dev-v2-20230616024445
- @nextui-org/theme@0.0.0-dev-v2-20230616024445
## 0.0.0-dev-v2-20230615024440
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@nextui-org/switch",
"version": "0.0.0-dev-v2-20230615024440",
"version": "0.0.0-dev-v2-20230616024445",
"description": "A switch is similar to a checkbox, but represents on/off values as opposed to selection.",
"keywords": [
"switch"

View File

@ -1,5 +1,19 @@
# @nextui-org/table
## 0.0.0-dev-v2-20230616024445
### Patch Changes
- Prevent scroll removed from overlay components as Modal, Navbar and Popover. Navbar styles simplified
- Updated dependencies
- @nextui-org/shared-icons@0.0.0-dev-v2-20230616024445
- @nextui-org/shared-utils@0.0.0-dev-v2-20230616024445
- @nextui-org/react-utils@0.0.0-dev-v2-20230616024445
- @nextui-org/checkbox@0.0.0-dev-v2-20230616024445
- @nextui-org/spacer@0.0.0-dev-v2-20230616024445
- @nextui-org/system@0.0.0-dev-v2-20230616024445
- @nextui-org/theme@0.0.0-dev-v2-20230616024445
## 0.0.0-dev-v2-20230615024440
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@nextui-org/table",
"version": "0.0.0-dev-v2-20230615024440",
"version": "0.0.0-dev-v2-20230616024445",
"description": "Tables are used to display tabular data using rows and columns. ",
"keywords": [
"table"

View File

@ -1,5 +1,19 @@
# @nextui-org/tabs
## 0.0.0-dev-v2-20230616024445
### Patch Changes
- Prevent scroll removed from overlay components as Modal, Navbar and Popover. Navbar styles simplified
- Updated dependencies
- @nextui-org/framer-transitions@0.0.0-dev-v2-20230616024445
- @nextui-org/shared-utils@0.0.0-dev-v2-20230616024445
- @nextui-org/react-utils@0.0.0-dev-v2-20230616024445
- @nextui-org/use-is-mounted@0.0.0-dev-v2-20230616024445
- @nextui-org/aria-utils@0.0.0-dev-v2-20230616024445
- @nextui-org/system@0.0.0-dev-v2-20230616024445
- @nextui-org/theme@0.0.0-dev-v2-20230616024445
## 0.0.0-dev-v2-20230615024440
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@nextui-org/tabs",
"version": "0.0.0-dev-v2-20230615024440",
"version": "0.0.0-dev-v2-20230616024445",
"description": "Tabs organize content into multiple sections and allow users to navigate between them.",
"keywords": [
"tabs"

View File

@ -1,5 +1,18 @@
# @nextui-org/tooltip
## 0.0.0-dev-v2-20230616024445
### Patch Changes
- Prevent scroll removed from overlay components as Modal, Navbar and Popover. Navbar styles simplified
- Updated dependencies
- @nextui-org/framer-transitions@0.0.0-dev-v2-20230616024445
- @nextui-org/shared-utils@0.0.0-dev-v2-20230616024445
- @nextui-org/react-utils@0.0.0-dev-v2-20230616024445
- @nextui-org/aria-utils@0.0.0-dev-v2-20230616024445
- @nextui-org/system@0.0.0-dev-v2-20230616024445
- @nextui-org/theme@0.0.0-dev-v2-20230616024445
## 0.0.0-dev-v2-20230615024440
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@nextui-org/tooltip",
"version": "0.0.0-dev-v2-20230615024440",
"version": "0.0.0-dev-v2-20230616024445",
"description": "A React Component for rendering dynamically positioned Tooltips",
"keywords": [
"tooltip"

View File

@ -1,5 +1,17 @@
# @nextui-org/user
## 0.0.0-dev-v2-20230616024445
### Patch Changes
- Prevent scroll removed from overlay components as Modal, Navbar and Popover. Navbar styles simplified
- Updated dependencies
- @nextui-org/shared-utils@0.0.0-dev-v2-20230616024445
- @nextui-org/react-utils@0.0.0-dev-v2-20230616024445
- @nextui-org/avatar@0.0.0-dev-v2-20230616024445
- @nextui-org/system@0.0.0-dev-v2-20230616024445
- @nextui-org/theme@0.0.0-dev-v2-20230616024445
## 0.0.0-dev-v2-20230615024440
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@nextui-org/user",
"version": "0.0.0-dev-v2-20230615024440",
"version": "0.0.0-dev-v2-20230616024445",
"description": "Flexible User Profile Component.",
"keywords": [
"user"

View File

@ -1,5 +1,44 @@
# @nextui-org/react
## 0.0.0-dev-v2-20230616024445
### Patch Changes
- Prevent scroll removed from overlay components as Modal, Navbar and Popover. Navbar styles simplified
- Updated dependencies
- @nextui-org/pagination@0.0.0-dev-v2-20230616024445
- @nextui-org/accordion@0.0.0-dev-v2-20230616024445
- @nextui-org/checkbox@0.0.0-dev-v2-20230616024445
- @nextui-org/dropdown@0.0.0-dev-v2-20230616024445
- @nextui-org/progress@0.0.0-dev-v2-20230616024445
- @nextui-org/skeleton@0.0.0-dev-v2-20230616024445
- @nextui-org/divider@0.0.0-dev-v2-20230616024445
- @nextui-org/popover@0.0.0-dev-v2-20230616024445
- @nextui-org/snippet@0.0.0-dev-v2-20230616024445
- @nextui-org/spinner@0.0.0-dev-v2-20230616024445
- @nextui-org/tooltip@0.0.0-dev-v2-20230616024445
- @nextui-org/avatar@0.0.0-dev-v2-20230616024445
- @nextui-org/button@0.0.0-dev-v2-20230616024445
- @nextui-org/navbar@0.0.0-dev-v2-20230616024445
- @nextui-org/spacer@0.0.0-dev-v2-20230616024445
- @nextui-org/switch@0.0.0-dev-v2-20230616024445
- @nextui-org/badge@0.0.0-dev-v2-20230616024445
- @nextui-org/image@0.0.0-dev-v2-20230616024445
- @nextui-org/input@0.0.0-dev-v2-20230616024445
- @nextui-org/modal@0.0.0-dev-v2-20230616024445
- @nextui-org/radio@0.0.0-dev-v2-20230616024445
- @nextui-org/table@0.0.0-dev-v2-20230616024445
- @nextui-org/card@0.0.0-dev-v2-20230616024445
- @nextui-org/chip@0.0.0-dev-v2-20230616024445
- @nextui-org/code@0.0.0-dev-v2-20230616024445
- @nextui-org/drip@0.0.0-dev-v2-20230616024445
- @nextui-org/link@0.0.0-dev-v2-20230616024445
- @nextui-org/tabs@0.0.0-dev-v2-20230616024445
- @nextui-org/user@0.0.0-dev-v2-20230616024445
- @nextui-org/kbd@0.0.0-dev-v2-20230616024445
- @nextui-org/system@0.0.0-dev-v2-20230616024445
- @nextui-org/theme@0.0.0-dev-v2-20230616024445
## 0.0.0-dev-v2-20230615024440
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@nextui-org/react",
"version": "0.0.0-dev-v2-20230615024440",
"version": "0.0.0-dev-v2-20230616024445",
"description": "🚀 Beautiful and modern React UI library.",
"author": "Junior Garcia <jrgarciadev@gmail.com>",
"homepage": "https://nextui.org",

View File

@ -1,5 +1,11 @@
# @nextui-org/system
## 0.0.0-dev-v2-20230616024445
### Patch Changes
- Prevent scroll removed from overlay components as Modal, Navbar and Popover. Navbar styles simplified
## 0.0.0-dev-v2-20230615024440
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@nextui-org/system",
"version": "0.0.0-dev-v2-20230615024440",
"version": "0.0.0-dev-v2-20230616024445",
"description": "NextUI system primitives",
"keywords": [
"system"

View File

@ -1,5 +1,11 @@
# @nextui-org/theme
## 0.0.0-dev-v2-20230616024445
### Patch Changes
- Prevent scroll removed from overlay components as Modal, Navbar and Popover. Navbar styles simplified
## 0.0.0-dev-v2-20230615024440
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@nextui-org/theme",
"version": "0.0.0-dev-v2-20230615024440",
"version": "0.0.0-dev-v2-20230616024445",
"description": "The default theme for NextUI components",
"keywords": [
"theme",

View File

@ -104,7 +104,7 @@ const modal = tv({
base: "max-w-5xl",
},
full: {
base: "my-0 max-w-full min-h-full !rounded-none",
base: "my-0 max-w-full h-[100dvh] !rounded-none",
},
},
radius: {
@ -153,7 +153,7 @@ const modal = tv({
{
backdrop: ["opaque", "blur"],
class: {
backdrop: "w-full h-full fixed inset-0",
backdrop: "w-screen h-screen fixed inset-0",
},
},
],

View File

@ -48,26 +48,28 @@ import {tv} from "tailwind-variants";
const navbar = tv({
slots: {
base: [
"relative",
"flex",
"z-40",
"w-full",
"h-auto",
"flex",
"items-center",
"justify-center",
"border-b",
"border-divider",
// "data-[menu-open=true]:fixed",
"data-[menu-open=true]:border-none",
],
wrapper: [
"z-40",
"flex",
"px-6",
"w-full",
"flex-row",
"relative",
"flex-nowrap",
"items-center",
"justify-between",
"w-full",
"h-[var(--navbar-height)]",
"px-6",
],
toggle: [
"group",
@ -156,19 +158,15 @@ const navbar = tv({
"data-[active=true]:font-semibold",
],
menu: [
"z-40",
"hidden",
"z-30",
"px-6",
"pt-4",
"absolute",
"pt-2",
"fixed",
"max-w-full",
"top-[calc(var(--navbar-height)_+_1px)]",
"h-[calc(100vh_-_var(--navbar-height)_-_1px)]",
"top-[var(--navbar-height)]",
"inset-x-0",
"bottom-0",
"w-screen",
"bg-background",
"data-[open=true]:flex",
"flex-col",
"gap-3",
"overflow-y-auto",
@ -180,12 +178,8 @@ const navbar = tv({
static: {
base: "static",
},
sticky: {},
floating: {
base: "shadow-none border-b-0",
wrapper: "mt-4 mx-8 shadow-md border border-default-200 dark:border-default-100 rounded-xl",
menu:
"mt-5 mx-8 border border-default-200 dark:border-default-100 rounded-xl max-w-[calc(100%_-_4rem)]",
fixed: {
base: "fixed top-0 inset-x-0",
},
},
maxWidth: {
@ -210,7 +204,7 @@ const navbar = tv({
},
hideOnScroll: {
true: {
base: ["sticky", "top-0", "inset-x-0"],
base: ["fixed", "top-0", "inset-x-0"],
},
},
isBordered: {
@ -219,55 +213,29 @@ const navbar = tv({
isBlurred: {
false: {
base: "bg-background",
menu: "bg-background",
},
true: {
base: [
"backdrop-blur-lg",
"data-[menu-open=true]:backdrop-blur-xl",
"backdrop-saturate-150",
"bg-background/70",
],
menu: ["backdrop-blur-xl", "backdrop-saturate-150", "bg-background/70"],
},
},
disableAnimation: {
true: {
menu: ["hidden", "h-[calc(100dvh_-_var(--navbar-height)_-_1px)]", "data-[open=true]:flex"],
},
true: {},
},
},
defaultVariants: {
maxWidth: "lg",
position: "sticky",
position: "fixed",
isBlurred: true,
},
compoundVariants: [
{
position: ["sticky", "floating"],
class: {
base: "sticky top-0 inset-x-0",
},
},
{
isBlurred: true,
position: ["static", "sticky"],
class: {
base: [
"backdrop-blur",
"backdrop-saturate-150",
"bg-background/80",
"dark:bg-background/50",
"data-[menu-open=true]:bg-background",
],
},
},
{
isBlurred: true,
position: "floating",
class: {
base: "bg-gradient-to-b from-background to-transparent",
wrapper: [
"before:content-['']",
"before:block",
"before:z-[-1]",
"before:absolute",
"before:-top-px",
"before:inset-0",
"before:backdrop-blur",
"before:backdrop-saturate-150",
"before:bg-background/50",
"data-[menu-open=true]:before:bg-background",
],
},
},
],
});
export type NavbarVariantProps = VariantProps<typeof navbar>;

View File

@ -24,7 +24,7 @@ import {colorVariants} from "../utils";
const tabs = tv({
slots: {
base: "inline-flex",
tabList: ["flex", "items-center", "gap-2", "bg-default-100", "p-1", "h-fit"],
tabList: ["flex", "items-center", "gap-2", "bg-content2", "dark:bg-content1", "p-1", "h-fit"],
tab: [
"z-0",
"w-full",
@ -77,15 +77,15 @@ const tabs = tv({
cursor: "inset-0",
},
light: {
tabList: "bg-transparent",
tabList: "bg-transparent dark:bg-transparent",
cursor: "inset-0",
},
underlined: {
tabList: "bg-transparent",
tabList: "bg-transparent dark:bg-transparent",
cursor: "h-[2px] w-[80%] bottom-0 shadow-[0_1px_0px_0_rgba(0,0,0,0.05)]",
},
bordered: {
tabList: "bg-transparent border-1 border-default-200 shadow-sm",
tabList: "bg-transparent dark:bg-transparent border-1 border-default-200 shadow-sm",
cursor: "inset-0",
},
},
@ -211,7 +211,7 @@ const tabs = tv({
variant: ["solid", "bordered", "light"],
color: "default",
class: {
cursor: ["bg-background", "dark:bg-default"],
cursor: ["bg-background", "dark:bg-default", "border border-default-100 dark:border-none"],
tabContent: "group-data-[selected=true]:text-default-foreground",
},
},

View File

@ -51,6 +51,11 @@ export const utilities = {
"transition-timing-function": "ease",
"transition-duration": DEFAULT_TRANSITION_DURATION,
},
".transition-height": {
"transition-property": "height",
"transition-timing-function": "ease",
"transition-duration": DEFAULT_TRANSITION_DURATION,
},
".transition-left": {
"transition-property": "left",
"transition-timing-function": "ease",

View File

@ -1,5 +1,11 @@
# @nextui-org/use-aria-accordion-item
## 0.0.0-dev-v2-20230616024445
### Patch Changes
- Prevent scroll removed from overlay components as Modal, Navbar and Popover. Navbar styles simplified
## 0.0.0-dev-v2-20230615024440
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@nextui-org/use-aria-accordion-item",
"version": "0.0.0-dev-v2-20230615024440",
"version": "0.0.0-dev-v2-20230616024445",
"description": "Internal impl for react aria accordion item",
"keywords": [
"use-aria-accordion-item"

View File

@ -1,5 +1,11 @@
# @nextui-org/use-aria-button
## 0.0.0-dev-v2-20230616024445
### Patch Changes
- Prevent scroll removed from overlay components as Modal, Navbar and Popover. Navbar styles simplified
## 0.0.0-dev-v2-20230615024440
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@nextui-org/use-aria-button",
"version": "0.0.0-dev-v2-20230615024440",
"version": "0.0.0-dev-v2-20230616024445",
"description": "Internal hook to handle button a11y and events, this is based on react-aria button hook but without the onClick warning",
"keywords": [
"use-aria-button"

View File

@ -1,5 +1,14 @@
# @nextui-org/use-aria-field
## 0.0.0-dev-v2-20230616024445
### Patch Changes
- Prevent scroll removed from overlay components as Modal, Navbar and Popover. Navbar styles simplified
- Updated dependencies
- @nextui-org/use-aria-slot-id@0.0.0-dev-v2-20230616024445
- @nextui-org/use-aria-label@0.0.0-dev-v2-20230616024445
## 0.0.0-dev-v2-20230615024440
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@nextui-org/use-aria-field",
"version": "0.0.0-dev-v2-20230615024440",
"version": "0.0.0-dev-v2-20230616024445",
"description": "Based on react-aria useField hook, provides the accessibility implementation for input fields",
"keywords": [
"use-aria-field"

View File

@ -1,5 +1,11 @@
# @nextui-org/use-aria-label
## 0.0.0-dev-v2-20230616024445
### Patch Changes
- Prevent scroll removed from overlay components as Modal, Navbar and Popover. Navbar styles simplified
## 0.0.0-dev-v2-20230615024440
### Patch Changes

Some files were not shown because too many files have changed in this diff Show More