Skip to content
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

fix(input): input box shifts upwards after adding the errorMessage #2732

Draft
wants to merge 68 commits into
base: canary
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
84e1b40
refactor(input): input ref test (#2613)
wingkwong Mar 31, 2024
bc33d31
fix(radio): isRequired & missing warning message in Form (#2597)
wingkwong Mar 31, 2024
35ea46b
Merge branch 'main' of github.com:nextui-org/nextui into v.2.3.0
jrgarciadev Apr 1, 2024
b5646a4
Calendar component 📅 (#2456)
jrgarciadev Apr 2, 2024
88745d2
Merge branch 'main' of github.com:nextui-org/nextui into v.2.3.0
jrgarciadev Apr 2, 2024
81385f7
chore(root): changeset
jrgarciadev Apr 2, 2024
edd742b
chore(calendar): add topContent and bottomContent props to calendar
jrgarciadev Apr 2, 2024
d28b376
Merge branch 'main' of github.com:nextui-org/nextui into v.2.3.0
jrgarciadev Apr 2, 2024
75c1dd4
chore(root): merge branch 'main' of github.com:nextui-org/nextui into…
jrgarciadev Apr 2, 2024
c8a161d
feat(calendar): add @nextui-org/radio package and update calendar com…
jrgarciadev Apr 2, 2024
73621d6
refactor: assigned type(DateValue) to focusedDate(ControlledFocusedVa…
ShrinidhiUpadhyaya Apr 3, 2024
92bfc77
Range Calendar 📆 (#2634)
jrgarciadev Apr 3, 2024
aeae437
Merge branch 'main' of github.com:nextui-org/nextui into v.2.3.0
jrgarciadev Apr 3, 2024
eea1b92
Date Input 🗓️ (#2641)
jrgarciadev Apr 5, 2024
ec0679d
Merge branch 'main' of github.com:nextui-org/nextui into v.2.3.0
jrgarciadev Apr 5, 2024
e580d08
feat(avatar): support slots in AvatarGroup (#2669)
wingkwong Apr 8, 2024
cfe2297
Date Picker Component 🗓️ (#2652)
jrgarciadev Apr 8, 2024
c69b2e6
Merge branch 'main' of github.com:nextui-org/nextui into v.2.3.0
jrgarciadev Apr 8, 2024
d94ba24
TimeInput Component 🕒 (#2672)
jrgarciadev Apr 10, 2024
e736d4a
chore(react): missing packages added
jrgarciadev Apr 12, 2024
0b72e17
chore(time-input): fix stories names
jrgarciadev Apr 12, 2024
0f7c71e
fix(time-input): time value type
jrgarciadev Apr 12, 2024
e58b0aa
fix: date-picker visibleMonth width does not get widen enough (#2703)
kuri-sun Apr 13, 2024
1d2ec44
DateRangePicker Component 🗓️ (#2682)
jrgarciadev Apr 14, 2024
c0131c4
fix(range-calendar): styles
jrgarciadev Apr 14, 2024
0ab3a49
docs: Calendar & RangeCalendar (#2686)
wingkwong Apr 14, 2024
d07623d
Merge branch 'main' of github.com:nextui-org/nextui into v.2.3.0
jrgarciadev Apr 14, 2024
ade636f
Merge branch 'main' of github.com:nextui-org/nextui into v.2.3.0
jrgarciadev Apr 14, 2024
b6754f2
docs: TimeInput (#2698)
wingkwong Apr 14, 2024
9766085
Merge branch 'main' of github.com:nextui-org/nextui into v.2.3.0
jrgarciadev Apr 14, 2024
11cb50a
Merge branch 'v.2.3.0' of github.com:nextui-org/nextui into v.2.3.0
jrgarciadev Apr 14, 2024
d61b5bd
chore(date-picker): exports updated
jrgarciadev Apr 14, 2024
ceb01b7
docs: DatePicker (#2700)
kuri-sun Apr 14, 2024
59e978d
doc: DateInput (#2711)
kuri-sun Apr 14, 2024
a27f4bc
refactor(theme): units removed, tailwind-variants upgraded (#2713)
jrgarciadev Apr 14, 2024
56da226
Merge branch 'main' of github.com:nextui-org/nextui into v.2.3.0
jrgarciadev Apr 14, 2024
5a4f3dc
fix(theme): units replaced by spacing
jrgarciadev Apr 14, 2024
de9e71b
fix(select): positioning the label if a description is used (#2553)
novsource Apr 14, 2024
aa8f1f9
Merge branch 'main' of github.com:nextui-org/nextui into v.2.3.0
jrgarciadev Apr 14, 2024
3964757
Merge branch 'main' of github.com:nextui-org/nextui into v.2.3.0
jrgarciadev Apr 14, 2024
f8df360
Merge branch 'v.2.3.0' of github.com:nextui-org/nextui into v.2.3.0
jrgarciadev Apr 14, 2024
fa1ad2c
Merge branch 'main' of github.com:nextui-org/nextui into v.2.3.0
jrgarciadev Apr 14, 2024
f724509
Upgrade to new react aria version (#2561)
ryo-manba Apr 14, 2024
0ffe9e5
fix(core): build and date input / time input apis
jrgarciadev Apr 14, 2024
a7cf242
chore(date-picker): omit validation behavior
jrgarciadev Apr 14, 2024
f66d044
chore(docs): add missing props to calendar and range calendar
jrgarciadev Apr 14, 2024
6a811c6
docs: add nextui-cli page (#2714)
winchesHe Apr 15, 2024
bf90f2e
chore(docs): add cli commands to installation docs
jrgarciadev Apr 15, 2024
fb058b1
fix(checkbox): prettier
wingkwong Apr 15, 2024
05f8808
fix(docs): incorrect cli api references link
wingkwong Apr 15, 2024
cc0ecca
doc: DateRangePicker (#2712)
kuri-sun Apr 15, 2024
85ffbd2
fix: only two keyframes currently supported with spring and inertia a…
wingkwong Apr 15, 2024
e181d77
fix: react hook form issue (#2603)
wingkwong Apr 15, 2024
c48e8ca
Merge branch 'main' of github.com:nextui-org/nextui into v.2.3.0
jrgarciadev Apr 15, 2024
9e7b265
feat(components): tabs component add tabPosition prop (#2398)
winchesHe Apr 15, 2024
590f7ca
chore(docs): routes
jrgarciadev Apr 15, 2024
7c1d11f
chore(core): merged with main
jrgarciadev Apr 15, 2024
be6db34
fix: isReadOnly in Autocomplete MDX (#2444)
alphaxek Apr 15, 2024
4a00326
fix(select): only trigger setSelectedKeys when domRef.current.value i…
wingkwong Apr 15, 2024
25120be
chore(docs): blog changes (#2724)
jrgarciadev Apr 15, 2024
340d00f
chore: version changeset added
jrgarciadev Apr 15, 2024
dfb8edd
feat(blog): v2.3.0 almost done
jrgarciadev Apr 16, 2024
96ada02
chore(theme): fix merge conflicts
jrgarciadev Apr 16, 2024
eac8c71
chore(docs): tailwind colors updated, calendar overflow fixed
jrgarciadev Apr 16, 2024
9f135ee
chore(blog): add presets demo
jrgarciadev Apr 16, 2024
7a9d000
fix(calendar): overflow on windows
jrgarciadev Apr 16, 2024
f64b0dc
chore(docs): improve popover placements demo
jrgarciadev Apr 16, 2024
cccdd52
fix(input): input box shifts upwards atfer adding the errorMessage
wingkwong Apr 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
67 changes: 67 additions & 0 deletions .changeset/clean-poems-divide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
---
"@nextui-org/react": minor
"@nextui-org/system": minor
"@nextui-org/system-rsc": minor
"@nextui-org/theme": minor
"@nextui-org/accordion": patch
"@nextui-org/autocomplete": patch
"@nextui-org/avatar": patch
"@nextui-org/badge": patch
"@nextui-org/breadcrumbs": patch
"@nextui-org/button": patch
"@nextui-org/calendar": patch
"@nextui-org/card": patch
"@nextui-org/checkbox": patch
"@nextui-org/chip": patch
"@nextui-org/code": patch
"@nextui-org/date-input": patch
"@nextui-org/date-picker": patch
"@nextui-org/divider": patch
"@nextui-org/dropdown": patch
"@nextui-org/image": patch
"@nextui-org/input": patch
"@nextui-org/kbd": patch
"@nextui-org/link": patch
"@nextui-org/listbox": patch
"@nextui-org/menu": patch
"@nextui-org/modal": patch
"@nextui-org/navbar": patch
"@nextui-org/pagination": patch
"@nextui-org/popover": patch
"@nextui-org/progress": patch
"@nextui-org/radio": patch
"@nextui-org/ripple": patch
"@nextui-org/scroll-shadow": patch
"@nextui-org/select": patch
"@nextui-org/skeleton": patch
"@nextui-org/slider": patch
"@nextui-org/snippet": patch
"@nextui-org/spacer": patch
"@nextui-org/spinner": patch
"@nextui-org/switch": patch
"@nextui-org/table": patch
"@nextui-org/tabs": patch
"@nextui-org/tooltip": patch
"@nextui-org/user": patch
"@nextui-org/use-aria-accordion": patch
"@nextui-org/use-aria-accordion-item": patch
"@nextui-org/use-aria-button": patch
"@nextui-org/use-aria-link": patch
"@nextui-org/use-aria-modal-overlay": patch
"@nextui-org/use-aria-multiselect": patch
"@nextui-org/use-aria-toggle-button": patch
"@nextui-org/use-disclosure": patch
"@nextui-org/use-intersection-observer": patch
"@nextui-org/use-is-mobile": patch
"@nextui-org/use-measure": patch
"@nextui-org/use-pagination": patch
"@nextui-org/aria-utils": patch
"@nextui-org/framer-utils": patch
"@nextui-org/react-rsc-utils": patch
"@nextui-org/react-utils": patch
"@nextui-org/shared-icons": patch
"@nextui-org/shared-utils": patch
"@nextui-org/test-utils": patch
---

v2.3.0
14 changes: 14 additions & 0 deletions .changeset/famous-jobs-wonder.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
"@nextui-org/accordion": patch
"@nextui-org/autocomplete": patch
"@nextui-org/dropdown": patch
"@nextui-org/modal": patch
"@nextui-org/popover": patch
"@nextui-org/ripple": patch
"@nextui-org/select": patch
"@nextui-org/tabs": patch
"@nextui-org/tooltip": patch
"@nextui-org/framer-transitions": patch
---

Fixed the issue where only two keyframes were supported with spring and inertia animations.
5 changes: 5 additions & 0 deletions .changeset/famous-panthers-know.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@nextui-org/tabs": patch
---

Add placement and isVertical prop
86 changes: 86 additions & 0 deletions .changeset/fifty-cups-shout.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
---
"@nextui-org/react": minor
"@nextui-org/accordion": patch
"@nextui-org/autocomplete": patch
"@nextui-org/avatar": patch
"@nextui-org/badge": patch
"@nextui-org/breadcrumbs": patch
"@nextui-org/button": patch
"@nextui-org/calendar": patch
"@nextui-org/card": patch
"@nextui-org/checkbox": patch
"@nextui-org/chip": patch
"@nextui-org/code": patch
"@nextui-org/divider": patch
"@nextui-org/dropdown": patch
"@nextui-org/image": patch
"@nextui-org/input": patch
"@nextui-org/kbd": patch
"@nextui-org/link": patch
"@nextui-org/listbox": patch
"@nextui-org/menu": patch
"@nextui-org/modal": patch
"@nextui-org/navbar": patch
"@nextui-org/pagination": patch
"@nextui-org/popover": patch
"@nextui-org/progress": patch
"@nextui-org/radio": patch
"@nextui-org/ripple": patch
"@nextui-org/scroll-shadow": patch
"@nextui-org/select": patch
"@nextui-org/skeleton": patch
"@nextui-org/slider": patch
"@nextui-org/snippet": patch
"@nextui-org/spacer": patch
"@nextui-org/spinner": patch
"@nextui-org/switch": patch
"@nextui-org/table": patch
"@nextui-org/tabs": patch
"@nextui-org/tooltip": patch
"@nextui-org/user": patch
"@nextui-org/system": patch
"@nextui-org/system-rsc": patch
"@nextui-org/theme": patch
"@nextui-org/use-aria-accordion": patch
"@nextui-org/use-aria-accordion-item": patch
"@nextui-org/use-aria-button": patch
"@nextui-org/use-aria-link": patch
"@nextui-org/use-aria-modal-overlay": patch
"@nextui-org/use-aria-multiselect": patch
"@nextui-org/use-aria-press": patch
"@nextui-org/use-aria-toggle-button": patch
"@nextui-org/use-callback-ref": patch
"@nextui-org/use-clipboard": patch
"@nextui-org/use-data-scroll-overflow": patch
"@nextui-org/use-disclosure": patch
"@nextui-org/use-image": patch
"@nextui-org/use-infinite-scroll": patch
"@nextui-org/use-intersection-observer": patch
"@nextui-org/use-is-mobile": patch
"@nextui-org/use-is-mounted": patch
"@nextui-org/use-measure": patch
"@nextui-org/use-pagination": patch
"@nextui-org/use-real-shape": patch
"@nextui-org/use-ref-state": patch
"@nextui-org/use-resize": patch
"@nextui-org/use-safe-layout-effect": patch
"@nextui-org/use-scroll-position": patch
"@nextui-org/use-ssr": patch
"@nextui-org/use-update-effect": patch
"@nextui-org/aria-utils": patch
"@nextui-org/framer-utils": patch
"@nextui-org/react-rsc-utils": patch
"@nextui-org/react-utils": patch
"@nextui-org/shared-icons": patch
"@nextui-org/shared-utils": patch
"@nextui-org/stories-utils": patch
"@nextui-org/test-utils": patch
---

- Calendar component added
- objectToDeps function applied all across components
- `useMeasure` hook added
- `useIntersectionObserver` hook added
- `framer-transitions` renamed to `framer-utils`
- `ResizablePanel` component added to `framer-utils`
- `test-utils` updated
6 changes: 6 additions & 0 deletions .changeset/forty-ants-promise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@nextui-org/avatar": patch
"@nextui-org/theme": patch
---

Support slots in AvatarGroup
5 changes: 5 additions & 0 deletions .changeset/giant-carrots-reply.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@nextui-org/select": patch
---

Fixed the bug of positioning the label in the `Select` component if the description field was used
5 changes: 5 additions & 0 deletions .changeset/good-birds-nail.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@nextui-org/input": patch
---

Fixes input helperWrapper, description and errorMessage styles (#2730)
8 changes: 8 additions & 0 deletions .changeset/many-ways-laugh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@nextui-org/autocomplete": patch
"@nextui-org/checkbox": patch
"@nextui-org/input": patch
"@nextui-org/select": patch
---

Fixed react-hook-form uncontrolled components (#1969)
5 changes: 5 additions & 0 deletions .changeset/thirty-islands-trade.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@nextui-org/radio": patch
---

Fixed missing required props and validationMessage
7 changes: 6 additions & 1 deletion apps/docs/app/blog/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {format, parseISO} from "date-fns";
import NextLink from "next/link";
import {Balancer} from "react-wrap-balancer";

import {__DEV__, __PREVIEW__} from "@/utils";
import {MDXContent} from "@/components/mdx-content";
import {siteConfig} from "@/config/site";
import {Route} from "@/libs/docs/page";
Expand All @@ -18,6 +19,8 @@ interface BlogPostProps {
};
}

const isDraftVisible = __DEV__ || __PREVIEW__;

async function getBlogPostFromParams({params}: BlogPostProps) {
const slug = params.slug || "";
const post = allBlogPosts.find((post) => post.slugAsParams === slug);
Expand Down Expand Up @@ -78,7 +81,7 @@ export async function generateStaticParams(): Promise<BlogPostProps["params"][]>
export default async function DocPage({params}: BlogPostProps) {
const {post} = await getBlogPostFromParams({params});

if (!post) {
if (!post || (post.draft && !isDraftVisible)) {
notFound();
}

Expand All @@ -96,6 +99,7 @@ export default async function DocPage({params}: BlogPostProps) {
<ChevronRightLinearIcon className="rotate-180 inline-block mr-1" size={15} />
Back to blog
</Link>

<time className="block text-small mb-2 text-default-500" dateTime={post.date}>
{format(parseISO(post.date), "LLLL d, yyyy")}
</time>
Expand All @@ -119,6 +123,7 @@ export default async function DocPage({params}: BlogPostProps) {
</div>
<h1 className="mb-2 font-bold text-4xl">
<Balancer>{post.title}</Balancer>
<strong className="text-default-300">{post?.draft && " (Draft)"}</strong>
</h1>
<MDXContent code={post.body.code} />
</div>
Expand Down
13 changes: 12 additions & 1 deletion apps/docs/app/blog/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,20 @@ import {allBlogPosts} from "contentlayer/generated";
import {compareDesc} from "date-fns";

import {BlogPostList} from "@/components/blog-post";
import {__DEV__, __PREVIEW__} from "@/utils";

const isDraftVisible = __DEV__ || __PREVIEW__;

export default function Blog() {
const posts = allBlogPosts.sort((a, b) => compareDesc(new Date(a.date), new Date(b.date)));
const posts = allBlogPosts
.sort((a, b) => compareDesc(new Date(a.date), new Date(b.date)))
?.filter((post) => {
if (post.draft && !isDraftVisible) {
return false;
}

return true;
});

return (
<div className="w-full lg:px-16 mt-12">
Expand Down
6 changes: 3 additions & 3 deletions apps/docs/app/examples/perf/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,15 @@ const MyInput = extendVariants(Input, {
},
size: {
xs: {
inputWrapper: "h-unit-6 min-h-unit-6 px-1",
inputWrapper: "h-6 min-h-6 px-1",
input: "text-tiny",
},
md: {
inputWrapper: "h-unit-10 min-h-unit-10",
inputWrapper: "h-10 min-h-10",
input: "text-small",
},
xl: {
inputWrapper: "h-unit-14 min-h-unit-14",
inputWrapper: "h-14 min-h-14",
input: "text-medium",
},
},
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/components/blog-post.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const BlogPostCard = (post: BlogPost) => {
</CardBody>
<CardFooter className="flex justify-between items-center">
<time className="block text-small text-default-500" dateTime={post.date}>
{format(parseISO(post.date), "LLLL d, yyyy")}
{format(parseISO(post.date), "LLLL d, yyyy")} {post?.draft && " (Draft)"}
</time>
<Avatar size="sm" src={post.author?.avatar} />
</CardFooter>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import React from "react";
import {LivePreview, LiveProvider, LiveError} from "react-live";
import {clsx} from "@nextui-org/shared-utils";
import * as Components from "@nextui-org/react";
import * as intlDateUtils from "@internationalized/date";
import * as reactAriaI18n from "@react-aria/i18n";

import {BgGridContainer} from "@/components/bg-grid-container";
import {GradientBox, GradientBoxProps} from "@/components/gradient-box";
Expand All @@ -19,6 +21,8 @@ export interface ReactLiveDemoProps {

export const scope = {
...Components,
...intlDateUtils,
...reactAriaI18n,
} as Record<string, unknown>;

export const ReactLiveDemo: React.FC<ReactLiveDemoProps> = ({
Expand Down
44 changes: 35 additions & 9 deletions apps/docs/components/docs/components/codeblock.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, {forwardRef, useEffect} from "react";
import {clsx, dataAttr, getUniqueID} from "@nextui-org/shared-utils";
import BaseHighlight, {Language, PrismTheme, defaultProps} from "prism-react-renderer";
import {debounce} from "lodash";
import {debounce, omit} from "lodash";

import defaultTheme from "@/libs/prism-theme";

Expand All @@ -19,6 +19,17 @@ interface CodeblockProps {

type HighlightStyle = "inserted" | "deleted" | undefined;

const nextuiCliCommand = [
/^init$/,
/^add$/,
/^upgrade$/,
/^remove$/,
/^list$/,
/^env$/,
/^doctor$/,
];

const highlightStyleToken = ["bun", /nextui\s\w+(?=\s?)/, /^nextui$/, "Usage", ...nextuiCliCommand];
const RE = /{([\d,-]+)}/;

const calculateLinesToHighlight = (meta?: string) => {
Expand Down Expand Up @@ -145,8 +156,8 @@ const Codeblock = forwardRef<HTMLPreElement, CodeblockProps>(

return (
<div
{...omit(lineProps, ["key"])}
key={`${i}-${getUniqueID("line-wrapper")}`}
{...lineProps}
className={clsx(
lineProps.className,
removeIndent ? "pr-4" : "px-4",
Expand All @@ -165,13 +176,28 @@ const Codeblock = forwardRef<HTMLPreElement, CodeblockProps>(
{showLines && (
<span className="select-none text-xs mr-6 opacity-30">{i + 1}</span>
)}
{line.map((token, key) => (
<span
key={`${key}-${getUniqueID("line")}`}
{...getTokenProps({token, key})}
className={className}
/>
))}
{line.map((token, key) => {
// Bun has no color style by default in the code block, so hack add in here
const props = getTokenProps({token, key}) || {};

return (
<span
{...omit(props, ["key"])}
key={`${key}-${getUniqueID("line")}`}
className={className}
style={{
...props.style,
...(highlightStyleToken.some((t) => {
const regex = t instanceof RegExp ? t : new RegExp(t);

return regex.test(token.content.trim());
})
? {color: "rgb(var(--code-function))"}
: {}),
}}
/>
);
})}
</div>
);
})}
Expand Down