Compare commits

...

323 Commits

Author SHA1 Message Date
github-actions[bot] 9a2cf47a60 ci(changesets): version packages (#2903)
Co-authored-by: Junior Garcia <jrgarciadev@gmail.com>
2024-05-27 12:11:14 -03:00
winches 59fcfa0c3d docs: update cli docs (#3096) 2024-05-27 11:14:28 -03:00
Junior Garcia 578cf5aed3 chore(changese): update @nextui-org/react dependency to minor version 2024-05-27 10:52:15 -03:00
Junior Garcia 384cf117f4 chore(docs): v2.4.0 (#3084)
* chore(docs): v2.4.0

* chore(docs): v2.4.0 blog

* chore(docs): revise typos based on coderabbitai

* chore(docs): adjust navbar

---------

Co-authored-by: WK Wong <wingkwong.code@gmail.com>
2024-05-27 10:02:04 -03:00
Junior Garcia 5194a02d82 Merge branch 'main' of github.com:nextui-org/nextui into canary 2024-05-26 17:13:00 -03:00
աӄա a3bf209171 chore(docs): revise breaking changes content (#3077) 2024-05-26 17:11:42 -03:00
Ryo Matsukawa 31bfaebe2c fix(select): placeholder text display for controlled component (#3081)
* fix: return placeholder when selectedItems is empty

* chore: add test and changeset
2024-05-26 17:07:36 -03:00
Minsu fa26ce02fd fix(hooks): optimize useScrollPosition with useCallback and useRef (#3049)
* fix(hooks): optimize useScrollPosition with useCallback and useRef

* Update .changeset/lucky-cobras-jog.md

* Update packages/hooks/use-scroll-position/src/index.ts

* Update packages/hooks/use-scroll-position/src/index.ts

---------

Co-authored-by: Junior Garcia <jrgarciadev@gmail.com>
2024-05-24 18:29:34 -03:00
Junior Garcia 39bc460353 fix(date-picker): test 2024-05-24 18:01:12 -03:00
chirokas 6bbd234aa2 Fix DatePicker Time Input (#2845)
* fix(date-picker): set `isCalendarHeaderExpanded` to `false` when DatePicker is closed

* fix(date-picker): calendar header controlled state on DatePicker

* chore(date-picker): update test

* chore(date-picker): remove unnecessary `async` in test

* Update packages/components/date-picker/__tests__/date-picker.test.tsx

---------

Co-authored-by: WK Wong <wingkwong.code@gmail.com>
Co-authored-by: Junior Garcia <jrgarciadev@gmail.com>
2024-05-24 17:59:17 -03:00
winches 20ba81948d fix: error peerDep in pkg (#3014)
* fix: error peerDep in pkg

* docs: changeset
2024-05-24 17:45:59 -03:00
Jesus Perdomo Lampignano 07d722de59 Update dependency array on setPage useCallback hook (#3029)
Changes:
Add the onChangeActivePage function to the dependency array of the setPage useCallback hook to ensure it always reflects the latest state.

Impact:
This fix ensures that the pagination component accurately reflects the current state when triggering onChangeActivePage.
2024-05-24 16:24:43 -03:00
Minsu f24a97311a fix(hooks): resolve type error in onKeyDown event handler (#3064)
* fix(hooks): resolve type error in onKeyDown event handler

* chore(changeset): revise changeset

---------

Co-authored-by: WK Wong <wingkwong.code@gmail.com>
2024-05-24 16:23:28 -03:00
Shrinidhi Upadhyaya bf68c91b9a fix(date-picker): corrected inert value for true condition (#3054)
* fix(date-picker): corrected inert value for true condition #3044

* refactor(calendar): add todo comment

* feat(changeset): add changeset

---------

Co-authored-by: shrinidhi.upadhyaya <shrinidhi.upadhyaya@stud.uni-bamberg.de>
Co-authored-by: WK Wong <wingkwong.code@gmail.com>
2024-05-24 16:21:48 -03:00
Eric Abreu 8048dcc0c3 fix(components): Fix 'Tap to click' behavior on macOS with Edge/Chrome for Accordion and Tab (#2725)
* fix(components): fix 'Tap to click' behavior on macOS

* Add change file for accordion, menu, and tabs

* Remove 'fix(components)' from the .changeset file

* fix(components): undo dropdown change now that it's no longer applicable

* fix(components): update changeset file now that we are no longer modifying the dropdown component
2024-05-24 16:20:44 -03:00
աӄա 3b14c21e02 fix: popover-based focus behaviour (#2854)
* fix(autocomplete): autocomplete focus behaviour

* feat(autocomplete): add test case for catching blur cases

* refactor(autocomplete): use isOpen instead

* feat(autocomplete): add "should focus when clicking autocomplete" test case

* feat(autocomplete): add should set the input after selection

* fix(autocomplete): remove shouldUseVirtualFocus

* fix(autocomplete): uncomment blur logic

* refactor(autocomplete): remove state as it is in getPopoverProps

* refactor(autocomplete): remove unnecessary blur

* refactor(select): remove unncessary props

* fix(popover): use domRef instead

* fix(popover): revise isNonModal and isDismissable

* fix(popover): use dialogRef back

* fix(popover): rollback

* fix(autocomplete): onFocus logic

* feat(popover): set disableFocusManagement to overlay

* feat(modal): set disableFocusManagement to overlay

* fix(autocomplete): set disableFocusManagement for autocomplete

* feat(popover): include disableFocusManagement prop

* refactor(autocomplete): revise type in selectorButton

* fix(autocomplete): revise focus logic

* feat(autocomplete): add internal focus state and add shouldCloseOnInteractOutside

* feat(autocomplete): handle selectedItem change

* feat(autocomplete): add clear button test

* feat(changeset): add changeset

* refactor(components): use the original order

* refactor(autocomplete): add more comments

* fix(autocomplete): revise focus behaviours

* refactor(autocomplete): rename to listbox

* chore(popover): remove disableFocusManagement from popover

* chore(autocomplete): remove disableFocusManagement from autocomplete

* chore(changeset): add issue number

* fix(popover): don't set default value to transformOrigin

* fix(autocomplete): revise shouldCloseOnInteractOutside logic

* feat(autocomplete): should close listbox by clicking another autocomplete

* fix(popover): add disableFocusManagement to overlay

* refactor(autocomplete): revise comments and refactor shouldCloseOnInteractOutside

* feat(changeset): add issue number

* fix(autocomplete): merge with selectorButtonProps.onClick

* refactor(autocomplete): remove extra line

* refactor(autocomplete): revise comment

* feat(select): add shouldCloseOnInteractOutside

* feat(dropdown): add shouldCloseOnInteractOutside

* feat(date-picker): add shouldCloseOnInteractOutside

* feat(changeset): add dropdown and date-picker

* fix(popover): revise shouldCloseOnInteractOutside

* feat(date-picker): integrate with ariaShouldCloseOnInteractOutside

* feat(select): integrate with ariaShouldCloseOnInteractOutside

* feat(dropdown): integrate with ariaShouldCloseOnInteractOutside

* feat(popover): integrate with ariaShouldCloseOnInteractOutside

* feat(aria-utils): ariaShouldCloseOnInteractOutside

* chore(deps): update pnpm-lock.yaml

* feat(autocomplete): integrate with ariaShouldCloseOnInteractOutside

* feat(aria-utils): handle setShouldFocus logic

* feat(changeset): add @nextui-org/aria-utils

* chore(autocomplete): put the test into correct group

* feat(select): should close listbox by clicking another select

* feat(dropdown): should close listbox by clicking another dropdown

* feat(popover): should close listbox by clicking another popover

* feat(date-picker): should close listbox by clicking another datepicker

* chore(changeset): add issue numbers and revise changeset message

* refactor(autocomplete): change to useRef instead

* refactor(autocomplete): change to useRef instead

* refactor(aria-utils): revise comments and format code

* chore(changeset): add issue number

* chore: take popoverProps.shouldCloseOnInteractOutside first

* refactor(autocomplete): remove unnecessary logic

* refactor(autocomplete): focus management logic
2024-05-24 16:19:46 -03:00
Ryo Matsukawa 540aa2124b feat: switch default validationBehavior to aria and allow switching via props (#2987)
* chore: add support validationBehavior aria

* chore: add validationBehavior to Provider

* chore: add autocomplete validation test

* chore: add checkbox validation test

* fix(input): require condition

* docs: add description of validationBehavior props

* chore: add support validationBehavior props for date components

* docs(dates): add description of validationBehavior props

* chore: add changeset

* chore: format

* chore: fix test

* fix: select validationBehavior is not support yet

* fix: select validationBehavior not supported yet

* chore(docs): validation behavior prop added to nextui-provider

---------

Co-authored-by: Junior Garcia <jrgarciadev@gmail.com>
2024-05-22 17:50:39 -03:00
winches bc759838cd docs: sync nextui-cli api (#3035)
* docs: sync nextui-cli  api

* docs: update

* chore: update routes.json with new path and set updated flag

---------

Co-authored-by: Junior Garcia <jrgarciadev@gmail.com>
2024-05-22 11:56:02 -03:00
Artem Pitikin 06ecd213cf fix: make VisuallyHidden's element type as span when it's inside phrasing element (#3013)
* fix(checkbox): make VisuallyHidden's element type as span

* feat(changeset): add changeset

* fix(radio): make the VisuallyHidden element type as span

* fix(switch): make the VisuallyHidden element type as span

* fix(select): make the VisuallyHidden element type as span

* feat(changeset): replace changeset

* chore: fix formatting
2024-05-20 21:03:29 +08:00
Poli Sour 0108d06d3b fix(calendar): scrolling is hidden when changing the month (#2949)
* fix(calendar): scrolling is hidden when changing the month

* chore(changeset): correct package name

---------

Co-authored-by: Poli Sour <polisour.work@gmail.com>
Co-authored-by: WK Wong <wingkwong.code@gmail.com>
2024-05-19 16:51:42 -03:00
Ryo Matsukawa a2133009f7 fix(select): onSelectionChange can handle number (#2937)
* fix: onSelectionChange type for dynamic items in Select component

* docs: remove unnecessary properties

* docs: update highlightedLines

* chore: add changeset
2024-05-19 16:49:06 -03:00
Ryo Matsukawa c8f792ccd7 fix(component): update type definition to prevent primitive values as items (#2953)
* fix: update type definition to prevent primitive values as items

* fix: typecheck
2024-05-19 16:42:29 -03:00
աӄա 7df2c71ecc fix(dropdown): focus behaviour on press / enter keydown (#2970)
* fix(dropdown): set focus on the first item

* feat(dropdown): add keyboard interactions tests

* feat(changeset): add changeset

* fix(dropdown): use fireEvent.keyDown instead

* chore(deps): add @nextui-org/test-utils to dropdown

* refactor(dropdown): pass onKeyDown to menu trigger and don't hardcode autoFocus

* chore(dropdown): remove autoFocus

* fix(menu): pass userMenuProps to useTreeState and useAriaMenu and remove from getListProps

* chore(changeset): add menu package
2024-05-19 16:40:28 -03:00
աӄա 1109baea6a fix(core): incorrect tailwind classnames (#3018) 2024-05-19 16:38:24 -03:00
աӄա ca8554ccff feat(date-picker): add missing ref to input wrapper (#3011)
* fix(date-picker): add missing ref to input wrapper

* feat(changeset): add changeset
2024-05-19 10:23:03 -03:00
աӄա 77e85e665c fix(theme): revise input isInvalid styles (#3010)
* fix(theme): revise isInvalid input styles

* feat(changeset): add changeset
2024-05-19 10:20:49 -03:00
աӄա 5329de42d2 fix(slider): calculate the correct value on mark click (#3017)
* fix(slider): calculate the correct value on mark click

* refactor(slider): remove the tests inside describe block

* feat(slider): add tests for thumb move on mark click

* refactor(slider): use val instead of pos
2024-05-19 10:12:57 -03:00
աӄա 9d63259eea fix(table): v2 input/textarea don't allow spaces inside a table (#3020)
* fix(table): set onKeyDownCapture to undefined

* feat(changeset): add changeset
2024-05-19 10:05:51 -03:00
Junior Garcia f5bf12aedf Merge branch 'main' of github.com:nextui-org/nextui into canary 2024-05-18 09:28:00 -03:00
Junior Garcia 8c5ae9fe0b chore(docs): sponsors updated 2024-05-18 09:27:37 -03:00
Junior Garcia b51cd52cd5 Merge branch 'main' of github.com:nextui-org/nextui into canary 2024-05-18 09:16:54 -03:00
Junior Garcia cf912f5f4b chore(docs): ads removed batch 2 2024-05-18 09:16:33 -03:00
Junior Garcia 3312d4e261 Merge branch 'main' of github.com:nextui-org/nextui into canary 2024-05-18 09:12:30 -03:00
Junior Garcia 6a9ef07388 chore(docs): ads card removed 2024-05-18 09:12:02 -03:00
աӄա 8988981c53 fix(skeleton): overflow issue in skeleton (#2986)
* fix(theme): set overflow visible after skeleton loaded

* feat(changeset): add changeset
2024-05-13 10:19:48 -03:00
աӄա ad08010fe5 fix(theme): remove origin-bottom from button (#2990) 2024-05-13 09:56:42 -03:00
Junior Garcia 81eeea5093 Merge branch 'main' of github.com:nextui-org/nextui into canary 2024-05-12 23:29:15 -03:00
Junior Garcia 3b0916d431 Merge branch 'main' of github.com:nextui-org/nextui 2024-05-12 23:28:56 -03:00
Junior Garcia 0f071ec1f1 fix(docs): false warning and cli install command changed to npx one 2024-05-12 23:28:43 -03:00
Junior Garcia 7af584a4ba Merge branch 'main' of github.com:nextui-org/nextui into canary 2024-05-12 23:18:01 -03:00
knownymous 67553d270a Update custom-styles.ts (#2982)
The data attribute as per the documentation of input is data-focus. In this code demo it is portrayed as data-focused which does not work.
2024-05-12 23:17:22 -03:00
Junior Garcia 422770cc6b refactor: add support for disabling the animation globally (#2929)
* refactor: add support for disabling the animation globally

* chore(docs): disableAnimation removed from global provider

* feat(docs): nextui provider api updated, storybook preview adjusted

* chore(theme): button is scalable when disabled, tooltip animation improved
2024-05-12 23:13:54 -03:00
աӄա e34c5e307d feat(tabs): add destroyInactiveTabPanel prop for Tabs component (#2973)
* feat(tabs): add destroyInactiveTabPanel and set default to false

* feat(tabs): integrate with destroyInactiveTabPanel

* feat(theme): hidden inert tab panel

* feat(changeset): add changeset

* chore(changeset): add issue number

* feat(docs): add `destroyInactiveTabPanel` prop to tabs page

* chore(docs): set destroyInactiveTabPanel to true by default

* chore(tabs): set destroyInactiveTabPanel to true by default

* chore(tabs): revise destroyInactiveTabPanel logic

* feat(tabs): add tests for destroyInactiveTabPanel

* chore(tabs): change the default value of destroyInactiveTabPanel to true
2024-05-12 23:00:28 -03:00
աӄա 5f735a9892 fix(theme): add pointer-events-none to skeleton base (#2972) 2024-05-12 22:57:42 -03:00
Shawn Dong 10497f1a97 fix: update accordion item heading tag to be customizable (#2265)
* fix: update accordion item heading tag to be customizable

* Update .changeset/heavy-hairs-join.md

Co-authored-by: Junior Garcia <jrgarciadev@gmail.com>

* Update .changeset/heavy-hairs-join.md

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* chore(accordion): lint

* chore(changeset): add issue number

* feat(docs): add HeadingComponent prop

---------

Co-authored-by: Shawn Dong <shawn.dong@flybuys.com.au>
Co-authored-by: Junior Garcia <jrgarciadev@gmail.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: աɨռɢӄաօռɢ <wingkwong.code@gmail.com>
2024-05-12 22:38:56 -03:00
աӄա 633f9d208b feat(test): react hook form tests & stories (#2931)
* feat(input): add Input with React Hook Form tests

* refactor(input): add missing types

* feat(checkbox): add checkbox with React Hook Form tests

* feat(select): add react-hook-form to dev dep

* feat(select): add react hook form story

* feat(select): react hook form tests

* fix(select): incorrect button reference

* feat(deps): add react-hook-form to dev dep in autocomplete

* feat(autocomplete): react hook form story

* feat(autocomplete): react hook form tests

* fix(autocomplete): rollback wrapper type

* feat(switch): add react hook form tests

* refactor(stories): reorder stories items
2024-05-04 13:18:33 -03:00
աӄա 76f4dd8e76 fix(slider): missing marks when hideThumb is true & revise slider styles (#2883)
* chore(slider): include marks in hideThumb

* fix(slider): revise slider styles

* feat(changeset): add changeset

* feat(slider): add tests with marks and hideThumb
2024-05-04 13:17:04 -03:00
աӄա dc245874ce feat(docs): docs changes (#2868)
* feat(docs): add example how to set locale (#2867)

* docs(guide): add an explanation for the installation guide (#2769)

* docs(guide): add an explanation for the installation guide

* docs(guide): add an explanation for the cli guide

* docs(guide): add support for cli output

* fix: change sort priority - cmdk (#2873)

* docs: remove unsupported props in range calendar and date range picker (#2881)

* chore(calendar): remove showMonthAndYearPickers from range calendar story

* docs(date-range-picker): remove showMonthAndYearPickers info

* docs(range-calendar): remove unsupported props

* docs: refactor typing in form.ts (#2882)

* chore(docs): supplement errorMessage behaviour in input (#2892)

* refactor(docs): revise NextUI Provider structure

* chore(docs): add updated tag

---------

Co-authored-by: Nozomi-Hijikata <116155762+Nozomi-Hijikata@users.noreply.github.com>
Co-authored-by: HaRuki <soccer_haruki15@me.com>
Co-authored-by: Kaben <carnoxen@gmail.com>
2024-05-04 13:09:56 -03:00
Junior Garcia 73d9695994 refactor(root): react aria packages fixed (#2944) 2024-05-04 12:17:21 -03:00
Junior Garcia ec6fd12d7c Merge branch 'main' of github.com:nextui-org/nextui into canary 2024-05-04 10:34:50 -03:00
Junior Garcia cc1d62a0a9 chore(docs): update trackEvent call in hero component 2024-05-04 10:34:21 -03:00
Junior Garcia f28b1e9db6 Merge branch 'canary' of github.com:nextui-org/nextui into canary 2024-05-03 17:43:31 -03:00
Junior Garcia c7bdd0665d Merge branch 'main' of github.com:nextui-org/nextui into canary 2024-05-03 17:43:16 -03:00
Junior Garcia 668d21ac5d chore(docs): fix hero button height on mobile 2024-05-03 17:40:56 -03:00
Junior Garcia 935dff50d1 chore(docs): add command to intialize a NextUI project 2024-05-03 17:40:01 -03:00
աӄա 9acf3eada0 fix(switch): support uncontrolled switch in react-hook-form (#2924)
* feat(switch): add @nextui-org/use-safe-layout-effect

* chore(deps): add @nextui-org/use-safe-layout-effect

* fix(switch): react-hook-form uncontrolled switch component

* fix(switch): react-hook-form uncontrolled switch component

* feat(switch): add rect-hook-form in dev dep

* feat(switch): add WithReactHookFormTemplate
2024-05-03 16:24:29 -03:00
Junior Garcia 3748abe830 Merge branch 'main' of github.com:nextui-org/nextui into canary 2024-05-01 23:23:20 -03:00
Junior Garcia 9b21f22a9a fix(docs): nextui.org added as an image domain 2024-05-01 23:22:56 -03:00
Junior Garcia 72a950ab1b Merge branch 'main' of github.com:nextui-org/nextui into canary 2024-05-01 17:18:59 -03:00
Junior Garcia 480a241005 chore: alert added to avoid confission when installing a component (#2927) 2024-05-01 17:18:50 -03:00
աӄա 91127f88a2 docs(date-picker): change to jsx instead (#2919) 2024-04-30 17:17:24 -03:00
Junior Garcia e3afa4789a Cn utility refactor (#2915)
* refactor(core): cn utility adjusted and moved to the theme package

* chore(root): changeset

* fix(storybook): stories that used cn
2024-04-29 17:34:01 -03:00
աӄա f8b917a208 docs(core): add storybook and canary release info (#2914) 2024-04-29 11:53:21 -03:00
Mohammad Reza Badri 648edad77e fix(input): correct label margin for RTL required inputs (#2781)
* fix(input): correct label margin for RTL required inputs

* fix(theme): add changeset fr theme
2024-04-29 15:22:14 +08:00
Paul Tiedtke 5f5ad7a1dd fix: add missing TableRowProps export (#2866)
* fix: add missing TableRowProps export

* feat(changeset): add changeset for PR2866

* chore(changeset): revise changeset message

---------

Co-authored-by: աɨռɢӄաօռɢ <wingkwong.code@gmail.com>
2024-04-29 15:21:20 +08:00
աӄա 2a2a0692ca fix(date-picker): keep date picker style consistent for different variants (#2908) 2024-04-29 15:20:24 +08:00
Shrinidhi Upadhyaya c83ff382b9 fix(range-calendar): hide only dates outside the month (#2906)
* fix(range-calendar): hide only dates outside the month #2890

* fix(range-calendar): corrected spelling mistake in changeset description

* fix(range-calendar): corrected capitalization in changeset description

* chore(changeset): patch @nextui-org/theme

---------

Co-authored-by: shrinidhi.upadhyaya <shrinidhi.upadhyaya@stud.uni-bamberg.de>
Co-authored-by: աɨռɢӄաօռɢ <wingkwong.code@gmail.com>
2024-04-29 13:16:22 +08:00
Junior Garcia 6aacde2594 chore(storybook): common colors enabled (#2902) 2024-04-28 12:07:52 -03:00
Junior Garcia add893c33f Merge branch 'canary' of github.com:nextui-org/nextui into canary 2024-04-28 12:00:26 -03:00
Junior Garcia aba1716edc chore(root): reat-aria packages updated (#2889) 2024-04-28 11:55:52 -03:00
աӄա f07de03ad1 feat: new gitflow (#2695)
* chore(docs): use develop branch instead of main

* chore(workflows): change to develop

* chore(.changeset): change baseBranch to develop

* feat(workflows): trigger sync-develop-to-main workflow after publish

* feat(workflow): add sync develop to main workflow

* chore(workflows): add back "or Publish to NPM"

* refactor(workflows): rename tag name from dev to canary

* refactor: rename dev to canary

* refactor: reaname develop to canary

* refactor(workflows): change from develop to canary
2024-04-28 11:35:45 -03:00
github-actions[bot] 1a033fe6f8 ci(changesets): version packages (#2825)
Co-authored-by: Junior Garcia <jrgarciadev@gmail.com>
2024-04-24 17:04:22 -03:00
Junior Garcia b8e6b2fe25 Fix/use aria menu peer dep (#2862)
* fix(ripple): z-index adjusted

* fix(ripple): z-index changed

* fix(use-aria-menu): react-dom added as peerDep

* chore(root): update pnpm lock
2024-04-24 16:51:06 -03:00
Junior Garcia 765c04e2a5 fix(ripple): z-index adjusted (#2853)
* fix(ripple): z-index adjusted

* fix(ripple): z-index changed
2024-04-24 16:37:50 -03:00
Junior Garcia e9fef9bd92 fix(calendar): fix #2820 #2857 maximum update depth exceeded on Calendar & RangeCalendar (#2861) 2024-04-24 16:17:40 -03:00
Shrinidhi Upadhyaya 1ba2d029a2 fix(docs): imports missing in DatePicker (#2850)
* fix(docs): imports missing in DatePicker

* fix(docs): imported cn in presets

* fix(docs): missing imports in Preset(TS)

---------

Co-authored-by: shrinidhi.upadhyaya <shrinidhiupadhyaya1195@gmail.com>
2024-04-24 11:03:30 +08:00
HaRuki dd39db2b5c fix: no overflow for the installs commands list (#2851) 2024-04-23 16:52:35 -03:00
Ryo Matsukawa 308b32c0f1 fix(date-picker): filter out non-DOM props to prevent console errors (#2833)
* fix(date-picker): filter out non-DOM props to prevent console errors

* chore: added test to confirm no warning
2024-04-22 15:59:58 -03:00
աӄա 3552353203 fix(input): isClearable & add test cases to input (#2796)
* feat(input): add @nextui-org/use-safe-layout-effect

* fix(input): use useSafeLayoutEffect to handle react-hook-form case

* feat(input): add isClearable test case

* feat(input): add react-hook-form to dev dependencies for storybook

* feat(input): add WithReactHookForm to input storybook

* feat(changeset): fixes isClearable function in input

* chore(changeset): update changeset message

* refactor(input): revise input test
2024-04-22 15:30:26 -03:00
Ryo Matsukawa 1cc5215ce6 fix: missing aria labels in date range picker (#2832)
* fix(date-range-picker): ensure label props are reflected in aria labels

* docs: added missing label to date range picker

* chore: add changesets

* Update .changeset/gentle-pigs-admire.md

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2024-04-22 21:38:22 +08:00
Shrinidhi Upadhyaya 10b0e476bb fix(docs): removed unused imports from DatePicker (#2840)
* fix(docs): imports missing in DateRangePicker

* fix(docs): removed ununused imports in DatePicker

---------

Co-authored-by: shrinidhi.upadhyaya <shrinidhiupadhyaya1195@gmail.com>
2024-04-22 18:31:26 +08:00
HaRuki 94f85e29c6 fix(cmdk): modal - searching with one char shows no results & cmdk esc does not work without recent search results (#2721)
* fix: modal - searching with one char shows no results

* fix: removed the unnecesary dependencies
2024-04-22 13:12:37 +08:00
black197 1dacf52f30 fix(input): keep input component's position in innerWrapper steady (#2072)
* fix(input): make position of `input` steady (#2069)

* chore: changeset

* refactor(input): remove key prop
2024-04-21 20:12:34 +08:00
ynnsuis 25484f8663 fix(slider): fix slider component vertical mark y position focus (#2660)
* fix(components): fix slider component vertical mark y position focus issue

* feat(changeset): fixed slider component vertical mark y position

* chore(changeset): add issue number and revise package

---------

Co-authored-by: աɨռɢӄաօռɢ <wingkwong.code@gmail.com>
2024-04-21 19:09:31 +08:00
CAEB Wallace 6b96ea9c9c fix(progress): turn twMerge true to fix custom styling (#2668)
* fix(progress): turn twMerge true to fix custom styling

* fix(changelog): move changes to patch

* fix: remove stories from changeset

* add Issue number in the changeset

* chore(changeset): remove extra space

* chore(changeset): changeset message

---------

Co-authored-by: Guillaume DE LA RUE <guillaume.de-la-rue@consertotech.pro>
Co-authored-by: աɨռɢӄաօռɢ <wingkwong.code@gmail.com>
2024-04-21 18:46:38 +08:00
kdiffin f00ab630bf Fixed grammatical error in introduction page (#2830) 2024-04-21 17:43:19 +08:00
Paul Tiedtke d532a9da7a fix: missing export of TableRowProps type (#2584)
* fix: missing export of TableRowProps type

* chore(changeset): add changeset

---------

Co-authored-by: աɨռɢӄաօռɢ <wingkwong.code@gmail.com>
2024-04-21 17:40:04 +08:00
Amirhossein Khatabakhsh 31934017a5 fix(radioGroup): add RTL support to the radio group component (#2508)
* fix(radioGroup): add RTL support to the radio group component

* fix(radio): add changeset

* chore(changeset): correct package name and add issue number

---------

Co-authored-by: աɨռɢӄաօռɢ <wingkwong.code@gmail.com>
2024-04-21 17:13:03 +08:00
black197 10f2b8f42b fix(accordion): ctrl+a shortcut inside (#2063)
* fix(accordion): ctrl+a shortcut inside (#2055)

* fix(accordion): ctrl+a shortcut inside (#2055)

* chore(changeset): revise message and change to patch

---------

Co-authored-by: աɨռɢӄաօռɢ <wingkwong.code@gmail.com>
2024-04-21 15:31:20 +08:00
Kenji f0831ad12c docs: fixes typo (#2821) 2024-04-20 18:53:29 -03:00
Shrinidhi Upadhyaya 4cad622460 fix(docs): imports missing in DateRangePicker (#2811)
Co-authored-by: shrinidhi.upadhyaya <shrinidhi.upadhyaya@stud.uni-bamberg.de>
2024-04-19 12:22:51 -03:00
աӄա ebaa1de876 fix(docs): changes related to date components (#2805) 2024-04-19 08:30:31 -03:00
github-actions[bot] 51095b1628 ci(changesets): version packages (#2787) 2024-04-18 19:47:12 -03:00
Art Rosnovsky a2b8421441 chore: fix minor typo in date-input docs (#2790) 2024-04-18 17:02:52 -03:00
Junior Garcia eccc2f2f3d fix(core): export * from not supported on client components (#2789)
* fix(core): export * from not supported on client components

* fix(core): named exports implemented in several packages

* chore(root): changeset description
2024-04-18 16:19:48 -03:00
աӄա 2bc1d1a58b feat(dropdown): test cases (#2786)
* fix(popover): trigger disabled prop warning

* chore(.changeset): fix typo

* feat(dropdown): add @nextui-org/image

* feat(dropdown): add more tests for custom trigger with isDisabled

* feat(dropdown): make sure the menu can be open

---------

Co-authored-by: Junior Garcia <jrgarciadev@gmail.com>
2024-04-18 13:59:58 -03:00
Junior Garcia 183a4a6cfd fix(popover): trigger disabled prop warning (#2784) 2024-04-18 13:22:31 -03:00
github-actions[bot] a644544dfb ci(changesets): version packages (#2776)
Co-authored-by: Junior Garcia <jrgarciadev@gmail.com>
2024-04-18 08:56:43 -03:00
Junior Garcia 9e5dd8ce37 fix(popover): ref not beign passed 2024-04-18 08:48:42 -03:00
chirokas 69f713cb05 fix(checkbox): omit non-react props on checkbox-group (#2772) 2024-04-18 08:20:35 -03:00
github-actions[bot] d820d9397a ci(changesets): version packages (#2767)
Co-authored-by: Junior Garcia <jrgarciadev@gmail.com>
2024-04-17 23:57:49 -03:00
աӄա f89356691c fix(popover): isDisabled prop on a DOM element (#2741)
* fix(popover): isDisabled prop on a DOM element

* refactor(popover): filter non-react props

* fix(dropdown): tests

---------

Co-authored-by: Junior Garcia <jrgarciadev@gmail.com>
2024-04-17 23:50:42 -03:00
Junior Garcia 6b56e43a35 Fix DropdownItem onPress (#2746)
* chore(dropdown): missing events added

* fix(menu): item selection events

* chore(menu): changeset
2024-04-17 23:27:36 -03:00
github-actions[bot] 4ca6e2c1f6 ci(changesets): version packages (#2745)
Co-authored-by: Junior Garcia <jrgarciadev@gmail.com>
2024-04-17 11:03:40 -03:00
Shrinidhi Upadhyaya 2126ea1863 fix(table): add empty content only when table size is 0 #2742 (#2747)
* fix(table): add empty content only when table size is 0 #2742

* fix(table): added changeset

---------

Co-authored-by: shrinidhi.upadhyaya <shrinidhi.upadhyaya@stud.uni-bamberg.de>
2024-04-17 10:56:47 -03:00
աӄա cadbb30cfb fix(checkbox): checkbox controlled state (#2754)
* fix(checkbox): checkbox controlled state

* feat(checkbox): add @nextui-org/use-callback-ref

* chore(deps): pnpm-lock.yaml

* fix(checkbox): handle checkbox group

* fix(checkbox): rely on react aria logic (#2760)

* fix(checkbox): add missing dependency in useCheckbox hook

---------

Co-authored-by: Junior Garcia <jrgarciadev@gmail.com>
2024-04-17 10:43:57 -03:00
Junior Garcia f728c0542c fix(radio): omit non-react props on radio-group (#2761) 2024-04-17 09:47:56 -03:00
Junior Garcia 74eda31288 fix(core): named exports and client directive (#2758)
* fix(core): named exports instead of * from, use client directive added to main pkg

* chore(root): changeset
2024-04-17 09:27:06 -03:00
Junior Garcia 158c2aa004 refactor(calendar): cell tab index fixed, width property added (#2744)
* refactor(calendar): cell tab index fixed, width property added

* chore(date-picker): remove needless omit
2024-04-16 16:39:19 -03:00
Junior Garcia ccd8f730e1 fix(docs): popover placements 2024-04-16 16:30:19 -03:00
github-actions[bot] 098d7884cf ci(changesets): version packages (#2738)
Co-authored-by: Junior Garcia <jrgarciadev@gmail.com>
2024-04-16 13:37:32 -03:00
Junior Garcia 60c61aaf0c fix(modal): inside and outside scroll (#2739) 2024-04-16 13:31:35 -03:00
Junior Garcia fdbfa1f299 fix(date-picker): invalid and disabled props removed (#2737) 2024-04-16 12:37:50 -03:00
Junior Garcia ed1dbbc172 Merge branch 'main' of github.com:nextui-org/nextui 2024-04-16 10:09:31 -03:00
Junior Garcia 9cdc262619 feat(docs): v2.3.0 blog 2024-04-16 10:09:21 -03:00
github-actions[bot] c0d0a57338 ci(changesets): version packages (#2441)
Co-authored-by: Junior Garcia <jrgarciadev@gmail.com>
2024-04-16 09:53:16 -03:00
Junior Garcia 651c8b55af fix(root): release ci 2024-04-16 09:44:57 -03:00
Junior Garcia 3a22505185 fix(root): release ci 2024-04-16 09:38:15 -03:00
Junior Garcia dc0bcf13a5 v2.3.0 [WIP] (#2618)
* refactor(input): input ref test (#2613)

* refactor(input): remove duplicate test

* refactor(input): remove unncessary waitFor

* fix(radio): isRequired & missing warning message in Form (#2597)

* fix(radio): avoid overriding required props

* fix(radio): merge with domRef

* feat(changeset): fixed missing required props and validationMessage

* fix(radio): unnecessary mergeRefs

* Calendar component  📅 (#2456)

* feat(calendar): initial structure

* feat(calendar): calendar structure completed, styles in progress

* chore(calendar): dark colors adjusted

* feat(calendar): styles improved, variants added, animations added with framer motion

* chore(calendar): animation changed, shadow improved

* chore(calendar): disableAnimation support added as well as weekDays format

* feat(calendar): more stories added

* chore(calendar): refactor calendar cell styling

* feat(calendar): create calendar function added to the root provider

* feat(calendar): invalid state and error message added

* feat(calendar): calendar picker added, provider modified

* feat(root): object.values deps replaced by new func, intersection hoook added, types version unified

* feat(calendar): calendar pickers in progress

* feat(calendar): calendar pickers added

* fix(calendar): year label formatting

* chore(calendar): add layout parameter to Calendar stories

* feat(calendar): pickers completed, context added

* feat(calendar): visibleMonths supported, warnings fixed, tests added

* chore(root): changeset

* chore(calendar): add topContent and bottomContent props to calendar

* feat(calendar): add @nextui-org/radio package and update calendar component

* refactor: assigned type(DateValue) to focusedDate(ControlledFocusedVaue) (#2637)

Co-authored-by: shrinidhi.upadhyaya <shrinidhi.upadhyaya@stud.uni-bamberg.de>

* Range Calendar 📆 (#2634)

* feat(calendar): range calendar added, calendar and context adapted

* feat(calendar): range calendar stories added

* chore(calendar): range calendar tests added

* fix(calendar): update calendar styles to adjust to dynamic width

* Date Input 🗓️ (#2641)

* feat(date-picker): date field component initialized

* chore(date-picker): date field renamed to date-input

* feat(date-picker): date input completed

* chore(date-input): commented code removed

* feat(avatar): support slots in AvatarGroup (#2669)

* feat: rename newPost to new (#2665)

* fix(avatar): spread getAvatarGroupCountProps in avatar count

* feat(avatar): support slots in avatarGroup

* feat(avatar): support classNames and add getAvatarGroupCountProps

* feat(docs): add classNames to avatar group

* feat(avatar): add CustomSlots in avatar group

* feat(changeset): support slots in avatar group

---------

Co-authored-by: winches <96854855+winchesHe@users.noreply.github.com>

* Date Picker Component 🗓️ (#2652)

* feat(date-picker): first iteration

* chore(date-picker): update date-picker README.md with improved description

* feat(date-picker): code organized, integration done

* fix(date-picker): min and max value + styles

* fix(date-picker): popover offset adn calendar styles

* feat(date-picker): stories added

* fix(date-picker): calendar width properly handled

* feat(date-picker): styles simplified

* chore(date-picker): almost all test passing

* fix(date-picker): test and styles

* chore(date-picker): calendar popover tests added

* fix(date-picker): props to be passed to the date-input

* TimeInput Component 🕒 (#2672)

* feat(time-input): time input added with some stories, tests and date-picker integration missing

* feat(time-input): tests added, date-picker integration added, missing stories added

* chore(react): missing packages added

* chore(time-input): fix stories names

* fix(time-input): time value type

* fix: date-picker visibleMonth width does not get widen enough (#2703)

* DateRangePicker Component 🗓️ (#2682)

* chore(date-range-picker): in progress

* chore(date-range-picker): in progress

* feat(date-input): components separated into multiple pieces to be able to implement the date range picker

* feat(date-range-picker): first version of it working

* chore(date-picker): hyphen symbol changed

* feat(date-range-picker): stories done

* fix(range-calendar): styles

* docs: Calendar & RangeCalendar (#2686)

* feat(docs): add calendar in routes.json

* feat(docs): refresh search-meta.json

* feat(docs): add calendar examples

* feat(docs): calendar content

* feat(deps): add @internationalized/date

* refactor(docs): remove div wrapper

* feat(docs): add calendar doc

* fix(docs): calendar presets

* fix(docs): preset styles

* chore(docs): remove calendar iframe examples

* refactor(docs): discard iframe in calendar doc

* fix(docs): incorrect DateValue import

* feat(docs): include @internationalized/date in live demo scope

* feat(docs): add presets description

* chore(docs): update search-meta.json

* fix(docs): remove DateValue

* feat(docs): include reactAriaI18n in react live demo scope

* fix(docs): presets import issue

* chore(docs): update search-meta.json

* feat(docs): add api reference for nextui provider

* fix(calendar): ixExpanded  typo

* feat(docs): add missing props & event

* chore(docs): update search-meta.json

* chore(docs): update route keywords

* chore(docs): revise value style add defaultFocusedValue

* chore(docs): remove padding and revise gap

* feat(docs): range calendar

* chore(docs): update search-meta.json

* feat(docs): add reactAriaHook

* fix(docs): incorrect component and add storybook and reactAriaHook

* fix(docs): incorrect import path

* chore(docs): reorder range calendar position in sidebar

* chore(Docs): remove custom styles & implementation

* chore(docs): remove last item from accessibility

* chore(docs): onValueChange -> onChange

* feat(docs): add ts example for range calendar

* chore(docs): remove unwanted content in range calendar

* feat(docs): add ts examples for calendar

* chore(docs): update import path

* chore(docs): update import path

* chore(docs): styles adjusted, routes updated

---------

Co-authored-by: Junior Garcia <jrgarciadev@gmail.com>

* docs: TimeInput (#2698)

* feat(docs): add time input to routes.json

* feat(deps): add @internationalized/date

* feat(docs): add @internationalized/date and @react-aria/i18n to code demo scopes

* feat(docs): time input contetnt

* chore(docs): revise time input examples

* feat(docs): time input content

* chore(time-input): update description

* feat(docs): add ts examples in time-input

* chore(docs): revise TimeValue import

---------

Co-authored-by: Junior Garcia <jrgarciadev@gmail.com>

* chore(date-picker): exports updated

* docs: DatePicker (#2700)

* docs: created the doc for datepicker and its examples

* docs: regenerate search-meta.json

* fix: reverted the unncessary change to Input component

* fix: fixed the component-link for date-picker

* fix: fixed the component-link for date-picker

* fix: added variants section to the doc

* fix: made adjustment to the explanations for the props of DatePicker comp

---------

Co-authored-by: Junior Garcia <jrgarciadev@gmail.com>

* doc: DateInput (#2711)

* docs: created base examples and the document

* chore: created search-meta and follow-up fix for each date-input example cases

* fix: fixed some example components styles

* fix(docs): updated routes.json

* fix(docs): fixed typo in the docs

* fix: fixed the component-link for date-input

* fix: fixed the component-link for date-input

* fix: label-placements example flex style adjustment

* fix: added variants section to the doc

---------

Co-authored-by: HaRuki Kuriwada <haruki.kuriwada@hennge.com>
Co-authored-by: Junior Garcia <jrgarciadev@gmail.com>

* refactor(theme): units removed, tailwind-variants upgraded (#2713)

* fix(theme): units replaced by spacing

* fix(select): positioning the label if a description is used (#2553)

Co-authored-by: Poli Sour <polisour.work@gmail.com>

* Upgrade to new react aria version (#2561)

* chore(root): pkg upgraded

* fix: type error

* fix: build error

* chore: update packages from a~d

* chore: update packages from i~r

* chore: update packages from s~u

* chore: update core, hooks, and utilities packages

* feat: add support radio group validationBehavior props

* fix: validationBehavior default to native

* chore: add validationBehavior props in RadioGroup Stories

* fix: handling of errorMessage

* chore: add support validationBehavior autocomplete

* chore: partial support for validation of select

* chore: add support validationBehavior checkbox

* chore: change validationBehavior default to native

* Merge branch 'v.2.3.0' into feat/upgrade-react-aria

* fix: validation logic

* fix: add default value for autocomplete

* chore: add example using error message function

* chore: fixed error displayed in storybook

* chore: omit validationBehavior from component props

* chore: update docs and storybook on validate

* fix: pnpm-lock version

---------

Co-authored-by: Junior Garcia <jrgarciadev@gmail.com>

* fix(core): build and date input / time input apis

* chore(date-picker): omit validation behavior

* chore(docs): add missing props to calendar and range calendar

* docs: add nextui-cli page (#2714)

* docs: add nextui-cli page

* docs: update search meta

* docs: typo

* docs: typo

* docs: typo

* feat(docs): cli docs done

---------

Co-authored-by: Junior Garcia <jrgarciadev@gmail.com>

* chore(docs): add cli commands to installation docs

* fix(checkbox): prettier

* fix(docs): incorrect cli api references link

* doc: DateRangePicker (#2712)

* chore: created base for date-range-picker doc

* fix: added follow-up story examples to the doc

* fix: fixed bugs happening on the doc

* fix: fixed bugs happening on the doc

* fix(docs): incorrect file path and revise title

* fix: component examples style fixes

* fix: component presets typo fix

* refactor(core): date range picker docs completed, standaline date picker field fixed

---------

Co-authored-by: HaRuki Kuriwada <haruki.kuriwada@hennge.com>
Co-authored-by: աɨռɢӄաօռɢ <wingkwong.code@gmail.com>
Co-authored-by: Junior Garcia <jrgarciadev@gmail.com>

* fix: only two keyframes currently supported with spring and inertia animations (#2596)

* chore(deps): bump framer-motion

* feat(changeset): fixed framer motion issue

* chore(changeset): revise changeset message

* chore(deps): update pnpm-lock.yaml

* fix: react hook form issue (#2603)

* fix(input): pass domRef?.current?.value to controlled state

* fix(input): pass domRef?.current?.value to useTextField instead

* fix(checkbox): handle RHF case

* fix(checkbox): add missing isSelected case

* chore(checkbox): update ref type

* chore(deps): add @nextui-org/use-safe-layout-effect

* chore(deps): update pnpm-lock.yaml

* chore(deps): update pnpm-lock.yaml

* fix(select): handle RHF case

* chore(deps): add @nextui-org/use-safe-layout-effect to select

* fix(autocomplete): handle RHF case

* chore(deps): add @nextui-org/use-safe-layout-effect to autocomplete

* refactor(components): revise comments

* feat(changeset): react-hook-form uncontrolled components

* chore(deps): pnpm-lock.yaml

* fix(input): domRef.current.value has higher precedence

* fix(checkbox): set isChecked based on input ref checked

* feat(components): tabs component add tabPosition prop (#2398)

* feat(components): tabs component add tabPosition prop

* fix: review problem change

* test: add tabs position vertical test

* docs: update changeset

* fix(tabs): optimize return of tabs

* fix(tabs): rename orientation to placement

* fix(tabs): optimize description

* chore(docs): routes

* fix: isReadOnly in Autocomplete MDX (#2444)

* feat(autocomplete): add isReadOnly example

* fix(autocomplete): isReadOnly logic in Autocomplete

* feat(root): add changeset - fixed isReadOnly logic in Autocomplete

* chore(autocomplete component) isReadOnly property demo

isReadOnly property demo in website MDX for autocomplete component.

* Update apps/docs/content/docs/components/autocomplete.mdx

Co-authored-by: Junior Garcia <jrgarciadev@gmail.com>

---------

Co-authored-by: աɨռɢӄաօռɢ <wingkwong.code@gmail.com>
Co-authored-by: Alpha <116849110+alpha-xek@users.noreply.github.com>
Co-authored-by: Junior Garcia <jrgarciadev@gmail.com>

* fix(select): only trigger setSelectedKeys when domRef.current.value is true (#2722)

* chore(docs): blog changes (#2724)

* chore(docs): blog changes

* feat(docs): blog improved

* chore(blog): draft param added

* chore: version changeset added

* feat(blog): v2.3.0 almost done

* chore(docs): tailwind colors updated, calendar overflow fixed

* chore(blog): add presets demo

* fix(calendar): overflow on windows

* chore(docs): improve popover placements demo

* fix(autocomplete): set shouldUseVirtualFocus to false in getListboxProps (#2731)

* chore(blog): add cotributors

* chore(blog): draft

---------

Co-authored-by: աӄա <wingkwong.code@gmail.com>
Co-authored-by: Shrinidhi Upadhyaya <shrinidhiupadhyaya1195@gmail.com>
Co-authored-by: shrinidhi.upadhyaya <shrinidhi.upadhyaya@stud.uni-bamberg.de>
Co-authored-by: winches <96854855+winchesHe@users.noreply.github.com>
Co-authored-by: HaRuki <soccer_haruki15@me.com>
Co-authored-by: HaRuki Kuriwada <haruki.kuriwada@hennge.com>
Co-authored-by: Poli Sour <57824881+novsource@users.noreply.github.com>
Co-authored-by: Poli Sour <polisour.work@gmail.com>
Co-authored-by: Ryo Matsukawa <76232929+ryo-manba@users.noreply.github.com>
Co-authored-by: winches <329487092@qq.com>
Co-authored-by: Alpha Xek <116849110+alphaxek@users.noreply.github.com>
Co-authored-by: Alpha <116849110+alpha-xek@users.noreply.github.com>
2024-04-16 09:25:51 -03:00
Mohammad Reza Badri aab1f19a96 fix(select): add RTL support to the select component (#2042) (#2485) 2024-04-15 21:22:03 -03:00
Mohammad Reza Badri 9873c6fb83 fix: handle RTL direction divider storybook (#2483) (#2484) 2024-04-15 21:21:15 -03:00
black197 af877f7ddb fix(use-autocomplete): overwrite onKeyDown to prevent meaningless error msg (#1909) (#2100) 2024-04-15 11:20:03 -03:00
աӄա 25640e42ff fix(autocomplete): incorrect prop name in getEmptyPopoverProps (#2716)
* fix(autocomplete): incorrect prop name in getEmptyPopoverProps

* chore(changeset): update changeset message
2024-04-15 11:07:56 -03:00
աӄա abf532b548 fix: selectedKeys are not present in the collection warning in async case (#2648)
* fix(hook): add AsyncLoadable & show warning after data is loaded

* fix(hooks): change isLoading default state to true

* refactor(hooks): move the logic to missingKeys

* refactor(changeset): rephrase changeset description
2024-04-14 16:37:27 -03:00
աӄա e458432550 fix(select): disabled select shouldn't get update by keyboard (#2649)
* fix(select): disable all keys for isDisabled case

* fix(select): add "disabled select shouldn't update by keyboard" test case

* refactor(select): remove unnecessary map
2024-04-14 16:35:07 -03:00
աӄա c2ef4c0935 chore(storybook): add missing AsyncFiltering story (#2566)
* feat(autocomplete): add AsyncFilteringTemplate

* chore(autocomplete): move SWCharacter out

* feat(changeset):  add missing AsyncFiltering story in Autocomplete

* chore(changeset): remove changeset since the change only impacts the story
2024-04-14 16:19:39 -03:00
աӄա a1c112431f refactor(autocomplete): remove unnecessary map after getting all collection key (#2654)
* refactor(components): remove unnecessary map

* feat(changeset): remove unnecessary map after getting all collection keys
2024-04-14 16:10:39 -03:00
u3u 4dd2605ac2 fix: remove conflicting transition utilities (#2677)
* fix: remove conflicting transition utilities

see: https://tailwindcss.com/docs/transition-property

* chore: add changeset

* fix: typo

* chore: remove comments
2024-04-14 12:57:17 -03:00
Junior Garcia dab0534095 chore(main): lock file updated 2024-04-14 11:40:32 -03:00
Junior Garcia 12bf410807 chore(docs): tailwindcss upgraded 2024-04-14 11:39:09 -03:00
winches 09504cd702 feat: add peerDep files in components.json and update theme peerDep (#2689) 2024-04-14 11:38:12 -03:00
աӄա 86a78c9b91 fix(autocomplete): empty items with allowCustomValue (#2674)
* feat(autocomplete): add & export getEmptyPopoverProps

* fix(autocomplete): avoid null node in `ariaHideOutside` from `@react-aria/overlays`

* feat(changeset): add changeset
2024-04-14 11:29:53 -03:00
Ryo Matsukawa feab3e6c1d fix: correct links in docs (#2708) 2024-04-14 11:28:21 -03:00
Ryo Matsukawa eb11a7731a fix(modal): input carry over with IMEs in modal forms (#2709)
* fix(modal): prevent IME input carryover in form fields when tabbing

* chore: add changeset

* chore: chain default onKeyDown
2024-04-14 09:51:43 -03:00
աӄա 2829d4afae fix(core): hsl rounding issue (#2702) 2024-04-13 12:30:51 -03:00
winches ebab10804c feat: rename newPost to new (#2665) 2024-04-07 13:03:52 -03:00
Bryson Tang 6da144f459 Update remix.mdx (#2638) 2024-04-04 13:10:48 -03:00
winches 6811ce52c3 feat: add style attribute in components.json (#2632) 2024-04-02 15:13:14 -03:00
աӄա 2e49e08315 fix: lazyMotion forwardRef issue (#2622)
* fix(ripple): lazyMotion forwardRef issue in Ripple

* feat(dropdown): add test case for LazyMotion React.forwardRef issue

* refactor(dropdown): revise the test title

* feat(modal): include console error check in modal test

* feat(popover): add "should not throw error when clicking trigger button" test

* feat(accordion): add test for lazy motion issue

* feat(navbar): add test for lazy motion issue

* feat(tabs): add test for lazy motion issue

* feat(tooltip): add test for lazy motion issue

* refactor(dropdown): remove unnecessary async

* refactor(test): move spy outside and trigger clearAllMocks after each test
2024-04-02 11:01:17 -03:00
աӄա a60c2d7b22 fix(hooks): handle numeric selectedKeys in Select (#2589) 2024-04-02 08:45:09 -03:00
աӄա c5049edfde fix(popover): unexpected props on a DOM element (#2522)
* fix(popover): handle isDisabled logic for elements without isDisabled props

* chore(popover): isDisabled not necessary in restProps

* chore(changset): handle isDisabled logic for elements without isDisabled props

* fix(popover): keep all the props but isDisabled for non nextui button

* refactor(popover): move isDisabled handling to getTriggerProps

* refactor(popover): get the popover trigger styles from theme instead

* feat(theme): add isDisabled styles in popover

* chore(changeset): add patch to @nextui-org/theme

* refactor(popover): avoid re-instantiate popover styles

* fix(popover): apply filterDOMProps in popover trigger

* fix(popover): avoid conflicts with tooltip isDisabled

* chore(core): add isNextUIEl function to check if a component is a NextUI component

* chore(changeset): add system-rsc and revise message

* feat(dropdown): add tests for custom trigger with isDisabled

* fix(dropdown): incorrect User import path

* feat(dropdown): revise User and add mockRestore

* fix(dropdown): revise user import path

---------

Co-authored-by: Junior Garcia <jrgarciadev@gmail.com>
2024-04-01 22:33:26 -03:00
Tsuki 410e30c720 Add bun as package manager eng 581 (#2625)
* feat: add bun social icon

* chore: add bun to package-managers.tsx

* chore: add bun to installation.mdx
2024-04-01 15:29:03 -03:00
Hyden Liu 82a9fd9bc4 chore: fix typo (#2583) 2024-04-01 14:52:40 -03:00
աӄա ef6ea6c1ff fix(checkbox): incorrect onChange typing in Checkbox Group (#2595)
* fix(checkbox): incorrect onChange typing in Checkbox Group

* fix(checkbox): remove onChange from Props instead
2024-04-01 14:50:11 -03:00
Junior Garcia c188e4d628 chore(badge): remove unused import statement in badge.tsx (#2619) 2024-03-31 15:32:21 -03:00
աӄա a597c82a9c fix(image): className in image blurred example (#2540) 2024-03-31 15:17:33 -03:00
աӄա 0359bf3084 fix(skeleton): fixed missing disableAnimation behavior in skeleton (#2538) 2024-03-31 15:17:02 -03:00
աӄա eb51bf2261 fix: incorrect level of m.div (#2616)
* fix(modal): incorrect level of m.div

* fix(popover): incorrect level of m.div

* feat(changeset): fixed incorrect level of m.div

* fix(modal): remove forwardProps in RemoveScroll

* fix(popover): remove forwardProps in RemoveScroll
2024-03-31 12:16:48 -03:00
winches b14067bb94 feat: add component meta data (#2590)
* feat: add component meta data

* feat: add component meta data

* feat: add description and status component data

* fix: review problem
2024-03-31 11:56:28 -03:00
աӄա 8761168d34 fix: lazy motion forward ref issue (#2611)
* fix(modal): lazy motion forward ref issue

* fix(popover): lazy motion forward ref issue

* feat(changeset): fixed lazy motion forwardRef issue
2024-03-30 15:03:54 -03:00
Sagar Joshi cf0d4e471e Update override-styles.mdx (#2588) 2024-03-26 07:37:52 -03:00
HaRuki 2aa476455f fix(docs): some user links in support us section led to 404 pages (#2576) 2024-03-24 18:42:46 -03:00
winches ee7a819147 fix: recycle import error (#2568) 2024-03-22 15:49:33 -03:00
codeesura fb0625470f Sort 'Space' Type Values in Ascending Order (#2545)
Reordered `Space` type values to a logical ascending sequence (0.5, 1, 1.5, etc.) for improved readability and consistency. No functional impact on the code.
2024-03-21 13:06:43 -03:00
աӄա 2b9f89023a fix: revise shouldCloseOnInteractOutside for FreeSoloPopover (#2536)
* fix(select): set undefined to shouldCloseOnInteractOutside in select

* fix(select): set false to shouldCloseOnInteractOutside in autocomplete

* fix(popover): take shouldCloseOnInteractOutside from props

* chore(changeset):  revise shouldCloseOnInteractOutside for FreeSoloPopover

* feat(select): add test cases to select

* feat(select): assert that the select is open after click

* feat(autocomplete): add test cases to autocomplete

* feat(select): assert that the select is open after click
2024-03-21 13:04:59 -03:00
Denish Navadiya 26a3a7d2c6 chore(badge): Remove unnecessary type (#2541)
* chore(badge): Remove unnecessary type

I suggest removing the `children` type from BadgeProps, as the already extended UseBadgeProps has a `children` prop.

* Create three-tools-whisper.md

* Update three-tools-whisper.md
2024-03-21 13:02:36 -03:00
աӄա 888d861841 fix(select): isFilled & hasValue logic for state.selectedItems (#2556)
* fix(select): isFilled logic for state.selectedItems

* fix(select): handle hasValue case and return boolean type

* chore(changeset): include hasValue case as well
2024-03-21 12:54:40 -03:00
Orion Railean 0973cd9bff docs(snippet): fix grammatical error (#2557) 2024-03-21 12:53:03 -03:00
Junior Garcia e67b3af223 chore(root): remove beano subproject 2024-03-15 22:58:28 -03:00
Mohammad Reza Badri 52dafd08f1 fix(input): resolve RTL support (#2315) (#2316)
* fix(input): resolve RTL support (#2315)

* fix: add changeset

* fix: add changeset for rtl input

* fix: convert changeset rtl input to ptach
2024-03-15 22:52:35 -03:00
Frozen FIsh ceeb52363d feat(docs): Integrate kapaai (#2428)
* test(docs): test kapa.ai script

* feat(docs): add script-providers.tsx

* refactor(docs): update layout.tsx

* chore(docs): update script-providers.tsx

* refactor(docs): update layout.tsx
2024-03-15 22:48:34 -03:00
Mohammad Reza Badri 0d9ea4925b fix(kbd): add RTL support to the kbd component (#2481) (#2482) 2024-03-15 22:46:09 -03:00
Alpha Xek ea48ac2d08 feat(table spinner): Fixed Spinner without emptyContent prop in Table (#2500)
* feat(table spinner): spinner without emptyContent

Fixed Spinner loading on top of columns in case of emptyContent prop not passed.

* Update .changeset/nice-rockets-watch.md

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* fix(table spinner): changeset fix

* fix(table spinner): changeset description fix

---------

Co-authored-by: Alpha <116849110+alpha-xek@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2024-03-15 22:43:59 -03:00
Alpha Xek b0ee8e3fc2 fix(disabled table rows): fixed cursor for disabled rows in Table (#2502)
* fix(disabled table rows): fixed cursor for disabled rows

Fixed cursor for disabled rows in Table rows .

* fix(disabled table rows): changeset fix

---------

Co-authored-by: Alpha <116849110+alpha-xek@users.noreply.github.com>
2024-03-15 22:40:17 -03:00
Mohammad Reza Badri 5d84634c0a fix: add RTL support to the avatar group component (#2498) 2024-03-15 22:39:44 -03:00
HaRuki 9496ab57c5 fix(docs): listbox with description (#2513) 2024-03-15 22:37:50 -03:00
Alpha Xek 5ea479f6c4 fix(table striped): isStriped prop fix for multiple computed values in td (#2509)
* fix(table striped): multiple computed values in `td`

Fixed `Table` rendering the contents of the cell beneath the stripe for the multiple computed values

* fix(table striped): multiple computed values in `td`

* fix(table striped): changeset fix

* fix(table striped): changeset description enhancement

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

---------

Co-authored-by: Alpha <116849110+alpha-xek@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2024-03-15 09:20:36 -03:00
աӄա cda881799c fix(docs): remove non-existing triggerType props in Tooltip (#2520) 2024-03-15 09:14:37 -03:00
աӄա 707a61de4c fix(navbar): lazy motion forwardRef issue (#2527) 2024-03-15 09:01:13 -03:00
Bruno Kraychete da Costa 5a8768a4b2 fix(table): hide empty content if isLoading is true (#2470) (#2491)
Avoid displaying loadingContent and emptyContent at the same time.
Note that there's an existing issue with loadingContent where if
emptyContent is not provided, it will render loadingContent on top of
the columns (instead of inside the table). This change doesn't fix that,
but rather make isLoading play nice with a provided emptyContent. A
separate fix is still needed for when emptyContent is not provided, which
may affect this change later.
2024-03-10 10:53:02 -03:00
Junior Garcia a25292215a chore(root): add coderabbit setup (#2495) 2024-03-10 10:51:32 -03:00
աӄա a05aef0acb fix(components): popover closing issue in autocomplete with open modal (#2494)
* fix(components): set shouldCloseOnInteractOutside to false for FreeSoloPopover

* feat(changeset): fixed popover closing issue in autocomplete with open modal
2024-03-10 10:37:55 -03:00
Dominik K 2894aecca1 Remove unused framer motion features (#2464)
* fix: remove unused framer motion features

* fix: add changeset

* fix: non working tabs animation

* fix: remove unchanged changeset

* fix: move to patch
2024-03-08 11:43:14 -03:00
Mohammad Reza Badri a702bb869d Add RTL support to the switch component (#2468)
* fix: add RTL support to the switch component

* fix: convert changeset rtl switch to ptach
2024-03-08 11:32:55 -03:00
Mohammad Reza Badri 0443ec1c87 fix: add RTL support to the modal component (#2472) 2024-03-08 11:30:16 -03:00
աӄա 7263daca08 fix(autocomplete): support isReadOnly for dynamic collections in Autocomplete (#2458) 2024-03-08 11:22:45 -03:00
Mohammad Reza Badri e4b3c7d1a1 fix: issue on RTL support checkbox component (#2466)
* fix: issue on RTL support checkbox component

* fix: delete extra file

* fix: adjust the changeset for rtl checkbox

* fix: convert changeset rtl checkbox to ptach
2024-03-08 11:16:18 -03:00
Mohammad Reza Badri a686262009 fix: add RTL support to the modal component (#2469) 2024-03-07 20:53:47 -03:00
ImFirstPlace f373400102 Fix capital city of Australia (#2431) 2024-03-07 10:09:46 -03:00
Ryo Matsukawa 2c3be59dfb fix(accordion): remove dividers from hidden accordion items (#2219)
* fix: remove dividers from hidden accordion items

* Create slimy-panthers-swim.md
2024-03-07 10:07:58 -03:00
Junior Garcia 798e84e729 Revert "feat(calendar): initial structure"
This reverts commit 139b28437b.
2024-03-05 23:33:22 -03:00
Junior Garcia 139b28437b feat(calendar): initial structure 2024-03-05 23:30:37 -03:00
Alpha Xek f2205642f4 chore(pnpmlock script): rimraf for windows support (#2454) 2024-03-05 19:56:42 -03:00
black197 0a10de8d08 Fix(tooltip): allow non-ReactElement children (#2079)
* fix(tooltip): accept non-ReactElement as children

* chore: changeset
2024-03-05 16:33:10 -03:00
աӄա bae544d198 fix: isReadOnly in Autocomplete (#2429)
* feat(autocomplete): add isReadOnly example

* fix(autocomplete): isReadOnly logic in Autocomplete

* feat(root): add changeset - fixed isReadOnly logic in Autocomplete

* chore(stories): set isClearable to false

* fix(autocomplete): revise isClearable logic
2024-03-05 16:15:20 -03:00
Junior Garcia feafb36fcc Fix/dropdown disabled state (#2452)
* fix(popover): dropdown behavior on disabled state and update popover trigger props

* chore(dropdown): add DisabledTrigger story to dropdown.stories.tsx
2024-03-05 16:14:19 -03:00
աӄա 65f48135d6 fix(stories): link anchor typo (#2447) 2024-03-05 09:53:04 -03:00
Alpha Xek 1d32bf8f1e rimraf to support in windows (#2443)
replace `rm` with rimraf while deleting node_modules during `pnpm clean` to support in both Windows and Linux.
2024-03-05 09:52:40 -03:00
աӄա 0a9982d3ef fix(dropdown): getMenuTriggerProps mergeProps (#2450)
* fix(dropdown): getMenuTriggerProps mergeProps

* feat(changeset): fixed getMenuTriggerProps mergeProps

* refactor(dropdown): use isDisabled directly

* chore(changeset): correct issue number
2024-03-05 08:58:01 -03:00
աӄա f864dc3974 fix(utils): include enterKeyHint in dom-props (#2437) 2024-03-04 13:12:26 -03:00
github-actions[bot] 3a0f2c5610 ci(changesets): version packages (#2029)
Co-authored-by: Junior Garcia <jrgarciadev@gmail.com>
2024-03-03 20:54:23 -03:00
Junior Garcia a030680e6a chore(root): fix changeset versions 2024-03-03 20:38:38 -03:00
HaRuki e12f3faa81 fix(components): autocomplete, tabIndex is not passed on input (#2375)
* fix(components): autocomplete, tabIndex is not passed on input

* fix(components): autocomplete, tabIndex is not passed on input

* Update metal-gorillas-dress.md
2024-03-03 20:37:11 -03:00
HaRuki 2dc5adb6e0 docs(components): accordion controlled example shows errors (#2339)
* docs(components): accordion controlled example shows errors

* docs(components): accordion controlled example shows errors

* docs(components): accordion controlled example shows errors
2024-03-03 20:36:55 -03:00
HaRuki f63b20c59d fix(components): accordion component throws "validateDOMNesting" erro… (#2169)
* fix(components): accordion component throws "validateDOMNesting" error on the storybook

* fix(components): accordion component throws "validateDOMNesting" error on the storybook

* fix(components): accordion component throws "validateDOMNesting" error on the storybook

* fix(components): accordion component throws "validateDOMNesting" error on the storybook

* fix(docs): accordion component throws "validateDOMNesting" error on the storybook
2024-03-03 20:36:05 -03:00
kght6123 0df5099a62 docs(components): fixed Custom Implementation sample for button component missing onClear type (#2256) 2024-03-03 18:36:41 -03:00
Robin cdc4981508 docs(autocomplete): fix missing defaultItems property (#2185) 2024-03-03 18:34:05 -03:00
Kinfe Michael Tariku acee3c2fda fix: dup // fix on a link for edit this page on github (#2237) 2024-03-03 18:28:41 -03:00
Ryo Matsukawa fa72bb45cc fix: update dev script to only run pnpm sb (#2218) 2024-03-03 18:26:58 -03:00
Aruelius.L 265c121d65 fix: Invalid command (#2201) 2024-03-03 18:26:09 -03:00
nitipat.rstw d6b42f757a fix: added missing ChipProps import (#2205) 2024-03-03 18:16:08 -03:00
Frozen FIsh d8b0ef528b fix: won't display warning in when placeholder (#2346) (#2377)
* fix: won't display warning in when placeholder (#2346)

* chore: update use-multiselect-list-state.ts

* chore: add change log
2024-03-03 18:09:21 -03:00
Frozen FIsh e83595e06f fix(chip): avoid chip malformed (#2350) (#2379)
* fix(chip): add min width avoid chip malformed(#2350)

* chore: add change log

* fix(chip): fix isOneChar compound variants avoid chip malformed(#2350)

* chore: update change log
2024-03-03 17:53:47 -03:00
HaRuki 141887d38c fix(theme): chip with dot variant is not properly padded when having a 1-char text (#2387) 2024-03-03 17:45:55 -03:00
u3u a235e324b9 feat: add updatePositionDeps prop to popover component (#2390) 2024-03-03 17:44:30 -03:00
HaRuki 9b27da544e fix(components): isdisabled does not disable dropdown (#2435) 2024-03-03 17:30:27 -03:00
Junior Garcia 5528ccd042 Fix/sidebar and pro banner space (#2438)
* feat(utils): add featurebase utils

* feat(config): add changelog, feedback and roadmap routes

* feat(app): add featurebase script

* feat(docs): add NEXT_PUBLIC_FB_FEEDBACK_URL

* feat(featurebase): add featurebase components

* feat(components): add featurebase components to navbar

* feat(components): add featurebase components to sidebar

* chore(config): remove changelog and feedback at this moment

* fix(components): fb-roadmap-link styles

* chore(components): hide feedback and changelog at this moment

* feat(docs): add NEXT_PUBLIC_FB_FEEDBACK_ORG

* feat(featurebase): add trackEvent & revise props

* fix(sidebar): remove opacity classes from TreeItem component

* fix(docs): pro banner margin

---------

Co-authored-by: աɨռɢӄաօռɢ <wingkwong.code@gmail.com>
2024-03-03 16:32:29 -03:00
աӄա 4957f56e86 feat: featurebase integration (#2425)
* feat(utils): add featurebase utils

* feat(config): add changelog, feedback and roadmap routes

* feat(app): add featurebase script

* feat(docs): add NEXT_PUBLIC_FB_FEEDBACK_URL

* feat(featurebase): add featurebase components

* feat(components): add featurebase components to navbar

* feat(components): add featurebase components to sidebar

* chore(config): remove changelog and feedback at this moment

* fix(components): fb-roadmap-link styles

* chore(components): hide feedback and changelog at this moment

* feat(docs): add NEXT_PUBLIC_FB_FEEDBACK_ORG

* feat(featurebase): add trackEvent & revise props
2024-03-03 16:20:40 -03:00
Mark Wilson fa27bccb37 fix: #2382 typo in modal transition CSS variable access (#2426) 2024-03-01 18:46:05 -03:00
HaRuki 0cc8c79c53 docs(components): type error on tab components (#2416) 2024-02-29 11:44:29 -03:00
աӄա 5be104f72d fix(hooks): incorrect attribute names in clearOverflow (#2050)
* fix(hooks): incorrect attribute names in clearOverflow

* feat(root): add changeset for "incorrect attribute names in clearOverflow"
2024-02-27 11:33:26 -03:00
աӄա dc289fb59b fix(docs): keep navbar layout consistent (#2412) 2024-02-27 11:32:46 -03:00
աӄա 0ce10269c2 fix(components): incorrect strokeWidth (#2410)
* fix(components): incorrect strokeWidth

* feat(changeset): incorrect strokeWidth in circular progress
2024-02-27 11:31:38 -03:00
աӄա cd3b80974c fix: sematic typos (#2408)
* fix(docs): sematic -> semantic

* fix(stories): sematic -> semantic
2024-02-27 11:30:55 -03:00
աӄա dc91ab8bc9 fix(docs): accordion itemClasses (#2406) 2024-02-27 11:30:33 -03:00
աӄա dec7d411b5 fix: pagination RTL (#2393)
* fix(components): handle RTL in onNext and onPrevious in use-pagination.ts

* fix(components): invert forward icon for RTL

* fix(hooks): invert pagination logic for RTL

* chore(root): add changeset for pagination RTL change

* fix(hooks): add isRTL to hook dependency

* fix(components): add isRTL to hook dependency

* fix(components): incorrect isDisabled logic

* refactor(hooks): remove isRTL dependency from paginationRange

* chore(deps): add @react-aria/i18n
2024-02-27 11:29:54 -03:00
աӄա 37bed2368e fix(components): rtl styles in toggle (#2392)
* fix(components): rtl styles in toggle

* chore(root): add changeset for switcher rtl issue
2024-02-27 11:28:41 -03:00
Frozen FIsh 755a835fa7 fix(docs): update introduction.mdx replace p tag to div to avoid p tag nested p tag (#2388) (#2389) 2024-02-26 22:20:33 -03:00
Shibani Dcosta 6f27b048d0 Fixed Typo (#2400) 2024-02-23 09:08:07 -05:00
Mohit Chandel dc9362f959 Fix: Added few missing imports (#2401) 2024-02-23 07:24:55 -05:00
Prakash Choudhary e6f36281cb fix(components): number input label #2268 fixed (#2274)
* fix(components): number input label #2268 fixed

* fix(component): comments resolved

* fix(component): format with prettier

---------

Co-authored-by: Prakash Choudhary <prakashchoudhary@Prakashs-iMac.local>
2024-02-21 23:12:44 -05:00
Ryo Matsukawa f75174d07e docs(modal): update documentation to include dismiss properties (#2217) 2024-02-21 23:12:24 -05:00
lalalazero ac0e564b34 fix(docs): development setup in CONTRIBUTEING.md (#1673) 2024-02-21 23:06:46 -05:00
աӄա 60e453d265 fix(docs): typos (#2373) 2024-02-18 01:57:41 -03:00
Anthony Whitford 6e5ba692db Added note for installing React. (#2369) 2024-02-17 15:12:33 -03:00
աӄա e4ba43b4e3 fix(components): input label overlapping issue (#2371)
* fix(components): input label overlapping issue

* chore(root): add changeset for input overlapping issue
2024-02-17 15:10:12 -03:00
Mehmet Akifhan ILGAZ 995b37e2eb Update spinner.mdx (#2355)
Fix labelColor description
2024-02-14 17:15:06 -03:00
Frozen FIsh 3be8c621a1 chore: typo (#2353) 2024-02-14 17:14:40 -03:00
Ali Idrizi 0b5cde7bc4 fix(spinner): pass classNames.label to slot (#2325) 2024-02-12 21:37:57 -03:00
HaRuki a4cab30df3 docs(components): tooltip delays inverted (#2338) 2024-02-12 21:13:51 -03:00
HaRuki 9ff61b5d54 docs(components): table component link for storybook does not work (#2342) 2024-02-12 21:08:40 -03:00
HaRuki 7a3015c497 docs(components): tabs component link for storybook does not work (#2344) 2024-02-12 21:08:15 -03:00
Frozen FIsh 2106d987f2 fix: plop template error (#2333)
* chore: replace wrong script

* fix: plop templates
2024-02-11 10:34:09 -03:00
Frozen FIsh 2934a90d41 chore(storybook): improve preview.tsx (#2332) 2024-02-11 10:26:40 -03:00
HaRuki 39714775c7 docs(components): radioGroup component link for Storybook does not work (#2335) 2024-02-11 10:19:27 -03:00
Junior Garcia 07372eaa65 Merge branch 'main' of github.com:nextui-org/nextui 2024-02-11 09:33:54 -03:00
Junior Garcia dedd42c288 fix(docs): remove pro banner on examples routes 2024-02-11 09:33:37 -03:00
kght6123 f28e93d940 docs(components): #2236 [FIX] - Duplicate table disableAnimation prop description (#2246) 2024-02-08 10:25:43 -03:00
Stephan Schuto 0ad6e033f8 fix(docs): autocomplete typo (#2252) 2024-02-08 10:23:41 -03:00
navedqb fb0707087c fix missing imports in navbar (#2281) 2024-02-08 10:21:09 -03:00
André Vital d953a22b99 docs(modal): update documentation's default backdrop value (#2285) 2024-02-08 10:20:27 -03:00
Simon He 077c19506f docs: typo (#2294) 2024-02-08 10:19:40 -03:00
Simon He 6ca97c0bd6 docs(checkboxGroup): add attribute label (#2295) 2024-02-08 10:18:16 -03:00
Alexander Densley 5c8f21a106 docs: dix typo in table docs (#2319) 2024-02-08 10:14:11 -03:00
Junior Garcia decf11d270 fix(banner): z-index fixed 2024-02-07 23:07:48 -03:00
Junior Garcia fff248a30b chore(docs): update pro banner link href URLs 2024-02-04 21:54:37 -03:00
Junior Garcia 4996d9fb36 chore(docs): codeblock event removed, text sizes increased 2024-02-03 15:26:34 -03:00
Junior Garcia a5d7fcff0e chore(docs): pro banner text improved 2024-02-03 15:18:01 -03:00
Junior Garcia e8f5699fe2 fix(docs): pro banner on mobile 2024-02-02 21:09:55 -03:00
Junior Garcia a343e8e2ce Chore/add pro banner (#2309)
* chore(docs): add nextui pro banner

* chore(docs): add analytics

* fix(docs): banner
2024-02-02 17:26:57 -03:00
Junior Garcia a95e06acf2 Chore/add pro banner (#2308)
* chore(docs): add nextui pro banner

* chore(docs): add analytics
2024-02-02 17:15:04 -03:00
Junior Garcia 22f2665b00 chore(docs): add SponsorItem component and update sponsors list 2024-01-05 18:38:17 -03:00
Junior Garcia 921746f284 chore(docs): env var added to enable/disable va tracking events 2023-12-26 17:14:29 -03:00
Robin 132efbcb6d docs(modal): fix radius property (#2156) 2023-12-23 12:41:31 -03:00
Friedemann Sommer bea1e1fde8 components/tooltip replace "useLayoutEffect" with "useSafeLayoutEffect" (#2021) 2023-12-23 12:40:19 -03:00
Robin 95ffa64d41 docs(accordion): fix typo (#2133) 2023-12-16 12:36:00 -03:00
Junior Garcia e551226ff2 Refactor/add sponsors section (#2132)
* chore(docs): sponsor structure added

* feat(docs): top sponsors section added
2023-12-13 16:25:04 -03:00
Pranshu Gupta f3d0d6dded Update demo-code-modal.tsx (#2088) 2023-12-04 09:48:42 -03:00
աӄա 1c77b33e82 fix: broken contributing md links (#2048)
* chore(root): rename to CONTRIBUTING.md

* fix(core): broken CONTRIBUTING.md link

* fix(root): broken CONTRIBUTING.md link

* fix(docs): broken CONTRIBUTING.md link
2023-11-28 10:29:56 -03:00
Luther Tchofo Safo 0d7a19693b Update introduction.mdx (3) (#2046)
Typos. (Actually stinking to "PRs" instead of "PR's". The grammatical format present in examples such as L's and W's is expected because it's only one letter, but does not seem to apply to multiple letters combined.
2023-11-27 11:17:29 -03:00
Junior Garcia 01aedcf09b fix(popover): isDismissable prop passed to aria popover hook (#2032) 2023-11-24 09:46:51 -03:00
Junior Garcia 436ba1cd84 fix(input): clearable feature (#2031) 2023-11-24 09:35:49 -03:00
Junior Garcia 0ba165f0fd fix(input): label placement outside when label is missing (#2028) 2023-11-24 09:20:39 -03:00
Siddhesh Thadeshwar 088af8b6df Fix Autocomplete & Select docs with correct reference to disableSelectorIconRotation (#1990) 2023-11-19 20:09:38 -03:00
Junior Garcia 6951e262e5 fix(scroll-shadow): typo in scroll-shadow.stories.tsx (#1982) 2023-11-15 09:52:01 -03:00
nanwy 51c54f118f fix(docs): wrong tooltip classNames type (#1960)
In version 2.2.0, the classNames prop for tooltips is not of type Record<"base"|"arrow", string>, it should be of type Record<"base"|"content", string>.
2023-11-15 09:42:07 -03:00
Simon He 11fc733b36 docs(listbox): fix ListboxSection Props typo (#1962) 2023-11-15 09:41:40 -03:00
Junior Garcia a8dc5b429a chore(docs): nextui inc added to the footer 2023-11-12 11:24:21 -03:00
github-actions[bot] 12cebcfdac ci(changesets): version packages (#1940)
Co-authored-by: Junior Garcia <jrgarciadev@gmail.com>
2023-11-10 10:09:54 -03:00
Junior Garcia 0fb2160899 Merge branch 'main' of github.com:nextui-org/nextui 2023-11-10 10:09:26 -03:00
Junior Garcia 09380c5b06 chore(docs): textarea without autoszie example added 2023-11-10 10:09:08 -03:00
Junior Garcia 0f5cce5d62 fix(progress): tv function refactored (#1951) 2023-11-10 10:00:25 -03:00
Junior Garcia 64c89bc57d fix(tabs): selected key prop duplicated type removed (#1947) 2023-11-10 09:16:00 -03:00
Junior Garcia 467383b8a2 fix(switch): element type (#1949) 2023-11-10 09:06:49 -03:00
Junior Garcia aab1dbf77c Fix/autocomplete ref (#1948)
* fix(tabs): selected key prop duplicated type removed

* fix(autocomplete): reference aims to input

* chore(autocomplete): changeset
2023-11-10 09:03:49 -03:00
Junior Garcia 36775dceee fix(navbar): style prop (#1946) 2023-11-10 08:23:15 -03:00
Pradyumna Banakar 8628ba04a7 docs(breadcrumb): fix typo (#1943) 2023-11-10 07:16:00 -03:00
Junior Garcia a978687b07 fix(system): add "size" prop to HTMLNextUIProps (#1936) 2023-11-09 13:57:20 -03:00
github-actions[bot] 57cafa06d0 ci(changesets): version packages (#1929)
Co-authored-by: Junior Garcia <jrgarciadev@gmail.com>
2023-11-08 12:28:39 -03:00
Junior Garcia d2bd008ba3 chore(textarea): refactor Textarea component props and add (#1928)
hasHelper prop
2023-11-08 12:16:41 -03:00
github-actions[bot] 2f87b8d644 ci(changesets): version packages (#1924)
Co-authored-by: Junior Garcia <jrgarciadev@gmail.com>
2023-11-08 11:29:59 -03:00
Junior Garcia 6ecdc278ab fix(system): extend variants fuction adapted (#1927) 2023-11-08 11:15:10 -03:00
Junior Garcia 9189b3fbf2 fix(textarea): styles issues and start/end content props added (#1923)
* fix(textarea): styles issues and start/end content props added

* chore(textarea): multiple rows prop renamed
2023-11-08 10:33:00 -03:00
github-actions[bot] 1149345cae ci(changesets): version packages (#1916)
Co-authored-by: Junior Garcia <jrgarciadev@gmail.com>
2023-11-07 10:35:29 -03:00
Junior Garcia 135cc21e6f fix(menu): add hideSelectedIcon prop to menu and listbox (#1915)
sections
2023-11-07 10:16:02 -03:00
Junior Garcia 7f6218b978 fix(select): multiline styles (#1914) 2023-11-07 10:06:35 -03:00
github-actions[bot] 0eb9f1e3fe ci(changesets): version packages (#1903)
Co-authored-by: Junior Garcia <jrgarciadev@gmail.com>
2023-11-06 17:12:38 -03:00
Junior Garcia 11ef4365da refactor(theme): update input and select component styles (#1905) 2023-11-06 17:00:38 -03:00
Junior Garcia 85a820eeff fix(autocomplete): endContent prop (#1902) 2023-11-06 16:25:00 -03:00
Junior Garcia 6a6d426b10 fix(input): label position and styles (#1901)
* fix(input): label position and styles

* fix(textarea): invalid state
2023-11-06 15:45:05 -03:00
github-actions[bot] a3cbb5997b ci(changesets): version packages (#1878)
Co-authored-by: Junior Garcia <jrgarciadev@gmail.com>
2023-11-06 08:39:24 -03:00
Junior Garcia a5cc42bf80 refactor(docs): routing and add folder routes (#1892)
* refactor(docs): routing and add folder routes

* chore(docs): permanent redirect enabled
2023-11-06 08:22:03 -03:00
Junior Garcia e728a8967b fix(theme): update input and select styling and add data attribute for (#1891)
value
2023-11-06 08:20:02 -03:00
Junior Garcia acba2cf8f5 Fix/input select helper position (#1884)
* fix(input): fix input and select component styles

* chore(root): changeset
2023-11-05 20:00:48 -03:00
Junior Garcia 049db57bb2 fix(docs): fix typo in routing guide link 2023-11-05 18:47:49 -03:00
Dawson 5296d9b84d Typo fix (#1882) 2023-11-05 18:45:24 -03:00
Simon He 1619a35cf9 docs(pagination): fix dotsJump type 2023-11-05 12:20:47 -03:00
Simon He 8106629dab docs(radio-group): fix typo 2023-11-05 12:19:44 -03:00
Junior Garcia d55f52cc35 Merge pull request #1877 from nextui-org/fix/changeset-peer-deps-config 2023-11-05 10:57:39 -03:00
Junior Garcia 78198c32be Merge branch 'main' of github.com:nextui-org/nextui into fix/changeset-peer-deps-config 2023-11-05 10:44:00 -03:00
Junior Garcia 71807e8831 chore(theme): changeset 2023-11-05 10:43:37 -03:00
Junior Garcia 9af6174dcf refactor(theme): refactor theme plugin to improve performance and
readability
2023-11-05 10:43:37 -03:00
Junior Garcia 1a129db6fe chore: merge branch main 2023-11-05 10:30:55 -03:00
Junior Garcia 44ed1056e7 chore(root): changeset added 2023-11-05 10:24:48 -03:00
Junior Garcia db0e26a003 ci(changesets): version packages 2023-11-05 10:02:18 -03:00
Junior Garcia 38af48faf5 fix(core): update peer dependencies for several packages 2023-11-05 09:53:57 -03:00
Junior Garcia 5b60840751 chore(root): main conflicts merge fixed 2023-11-05 09:28:58 -03:00
Junior Garcia 4c56839db0 fix(root): changeset message 2023-11-05 09:27:56 -03:00
Junior Garcia ef61a3fe09 Revert "fix(root): peer dependecies update only when out of range"
This reverts commit bc4927c901.
2023-11-05 09:25:52 -03:00
Junior Garcia bc4927c901 fix(root): peer dependecies update only when out of range 2023-11-05 09:23:28 -03:00
Junior Garcia 4191feab2a fix(docs): update hoverOpacity in layout theme 2023-11-05 09:03:39 -03:00
Junior Garcia fe8647bd1d fix(docs): router import added to the routing next.js app docs 2023-11-05 08:59:16 -03:00
Junior Garcia 23992572ea fix(select): add button component and update select component 2023-11-05 08:52:33 -03:00
Junior Garcia e7a4711d9b ci(changesets): version packages 2023-11-04 16:44:59 -03:00
Junior Garcia e84158db62 chore: changeset 2023-11-04 16:38:57 -03:00
Junior Garcia f59e8f6bac fix(select): without label and input helperWrapper relative 2023-11-04 16:38:57 -03:00
Junior Garcia 73dfb7fc93 feat(docs): add package manager selection and usehooks-ts
dependency
2023-11-04 10:17:00 -03:00
Junior Garcia df9f6f5f58 ci(changesets): version packages 2023-11-03 19:38:47 -03:00
Junior Garcia 1fd5049f5a fix(select): multiline label (#1865) 2023-11-03 19:28:23 -03:00
Junior Garcia a386e1cadd chore(blog): card body padding change added 2023-11-03 17:08:03 -03:00
Junior Garcia 3172a803e3 feat(docs): blog post announcement added to mobile resolutions 2023-11-03 16:55:43 -03:00
Junior Garcia dfc8bdc7af chore(docs): v2.2.0 post date fixed, search meta updated 2023-11-03 16:48:25 -03:00
Junior Garcia 67ce4beb28 Feat/v2 blog (#1858)
* feat: Slider Component (#1686)

* feat(slider): initial structure

* chore(slider): readme improved

* fix: fixed border color of slider track

* docs: added range story

* feat: added rtl support to slider

* feat: improved value label formatting

* feat: refactor styling and add colors support to slider

* chore: improved thumb color

* docs: improved slider stories

* chore(slider): default color changed by foreground

* Update packages/core/theme/src/components/slider.ts

Co-authored-by: Jakob Guddas <github@jguddas.de>

* feat: added fillOffset prop

* Update packages/components/slider/src/use-slider.ts

* fix(slider): animation

* Update packages/components/slider/src/use-slider.ts

* Update packages/core/theme/src/components/slider.ts

* feat: slider steps

* refactor: renamed variables

* feat: improved slider step styling

* fix: hide infinite steps

* fix: fixed step transparency issue

* fix: fixed thumb focus issue

* Update packages/components/slider/src/use-slider.ts

Co-authored-by: Junior Garcia <jrgarciadev@gmail.com>

* feat(slider): vertical orientation added, start & end content, bug fixes

* chore(slider): tests added

* fix(docs): scrollbar added to the sidebar (#1743)

* feat(slider): marks added

* chore(slider): example ts-doc changed

* feat(slider): vertical marks support

* feat(core): slider tooltip support added, popover modified (#1746)

* Feat/slider custom styles (#1751)

* feat(slider): custom styles story added

* fix(slider): custom styles on different sizes

* Fix/slider tooltip android position (#1753)

* feat(slider): custom styles story added

* fix(slider): tooltip update position dependecies added

* fix(popover): arrow placements improved

* feat(slider): docs started, custom thumb and custom output stories added

* feat(slider): render function added to custom render the slider parts

* feat(slider): docs in progress, new properties and examples added

* fix(slider): some issues fixed, output renamed to value, documentation improved

* feat(slider): docs done

* chore: changeset

---------

Co-authored-by: Jakob Guddas <github@jguddas.de>

* Client side routing (#1764)

* feat(slider): initial structure

* chore(slider): readme improved

* fix: fixed border color of slider track

* docs: added range story

* feat: added rtl support to slider

* feat: improved value label formatting

* feat: refactor styling and add colors support to slider

* chore: improved thumb color

* docs: improved slider stories

* chore(slider): default color changed by foreground

* Update packages/core/theme/src/components/slider.ts

Co-authored-by: Jakob Guddas <github@jguddas.de>

* feat: added fillOffset prop

* Update packages/components/slider/src/use-slider.ts

* fix(slider): animation

* Update packages/components/slider/src/use-slider.ts

* Update packages/core/theme/src/components/slider.ts

* feat: slider steps

* refactor: renamed variables

* feat: improved slider step styling

* fix: hide infinite steps

* fix: fixed step transparency issue

* fix: fixed thumb focus issue

* Update packages/components/slider/src/use-slider.ts

Co-authored-by: Junior Garcia <jrgarciadev@gmail.com>

* feat(slider): vertical orientation added, start & end content, bug fixes

* chore(slider): tests added

* feat(slider): marks added

* chore(slider): example ts-doc changed

* feat(slider): vertical marks support

* feat(core): slider tooltip support added, popover modified (#1746)

* Feat/slider custom styles (#1751)

* feat(slider): custom styles story added

* fix(slider): custom styles on different sizes

* Fix/slider tooltip android position (#1753)

* feat(slider): custom styles story added

* fix(slider): tooltip update position dependecies added

* fix(popover): arrow placements improved

* feat(slider): docs started, custom thumb and custom output stories added

* feat(slider): render function added to custom render the slider parts

* feat(slider): docs in progress, new properties and examples added

* fix(slider): some issues fixed, output renamed to value, documentation improved

* feat(slider): docs done

* chore: changeset

* chore: react aria packages upgraded

* feat(system): router provider added

* feat: client side routing support added to items components

* chore(docs): routing docs started

* chore: changeset

* feat(docs): client side routing documented

* feat(pagination): client router support added to pagination

* fix(link): csr added

---------

Co-authored-by: Jakob Guddas <github@jguddas.de>

* feat: added RTL support to accordion component (#1725)

* feat: added RTL support to accordion component

* Create healthy-cobras-crash.md

* feat: added RTL support to avatar and avatar group component (#1727)

* feat: added RTL support to avatar and avatar group components

* Create tender-penguins-love.md

* Update tender-penguins-love.md

* feat: added RTL support to button group component (#1726)

* feat: added RTL support to button component

* feat: added RTL support to button component

* Create orange-bobcats-kneel.md

* Update button.ts

* refactor(root): styles refactor (#1688)

* refactor(root): styles refactor

* chore(tabs): remove needless type extends

* fix(tabs): typecheck

* Breadcrumbs component (#1794)

* feat(components): breadcrumbs initial structure

* feat(breadcrumbs): tests and examples added

* feat(docs): breadcrumbs documentation done

* feat(docs): breadcrumbs docs done

* chore(breadcrumbs): readme changed

* fix(slider): Place last dragged slider handle over the other handle (#1778)

* Set `data-focused` in handle

* Style focused handle on top

* Add tests

* fix(core): tests and build

* fix(button): show only spinner if button isLoading & isIconOnly (#1800)

* fix(button): show only spinner if button isLoading & isIconOnly

* chore: add changeset

* fix(button): remove repeating code

* Fix blur/opaque Popover (#1812)

* fix(popover): double underlay click

* chore: use ref instead of a state

* Feat/controlled scroll shadow (#1819)

* feat(scroll-shadow): logic improved, controlled support added

* feat(scroll-shadow): controlled visibility

* fix(scroll-shadow): visibility tests

* Autocomplete component (Single Selection) (#1797)

* feat(autocomplete): initial structure

* feat(core): use press custom hook implemented, autocomplete improved, input and select animations fixed

* chore(button): add console.log on press

* feat(core): select & input label position, autocomplete improvements, listbox and menu empty state

* chore: tailwind-variants upgraded

* chore: autocomplete stories in progress

* fix: input and select label placement

* fix(autocomplete): popover trigger

* chore(root): react-aria pkgs and framer-motion upgraded

* fix(input,select): outside label scale removed

* feat(autocomplete): more stories and use cases supported

* fix(core): custom items support on collection-based comps, menu generic items support added

* chore(core): tailwind-variants upgraded, custom tv function adapted

* chore(docs): select on-change controlled e.g. changed, sandpack theme fixed

* chore(autocomplete): docs started, tests added

* chore: in progress

* feat(menu): top and end content added, autocomplete docs improved

* feat(docs): autocomplete documentation almost done

* fix(input): outside styles

* feat(docs): autocomplete async filtering added

* chore(docs): autocomplete highlighted lines added

* feat(docs): autocomplete a11y and slots added

* feat(docs): autocomplete a11y and slots added

* feat(docs): autocomplete docs done

* fix(root): peer dependencies (#1848)

* Fix/small issues (#1851)

* fix(input): visible outline

* fix(button): button group radius prop

* chore(navbar): menu item active status added

* fix(docs): pagination missing keys custom items

* fix(core): extendVariants support added to collection-based components

* fix(theme): card body padding

* chore(theme): transition added to menu/listbox items

* fix(input): textarea styles fixed, new prop added

* chore(input): textarea height animated

* feat(button): hover opacity added

* chore(textarea): hide scroll when the limit hasn't been reached

* chore(docs): updated badge added to textarea

* feat(docs): blog v2.2.0 image and entry added

* fix(avatar): ring primary color

* chore(docs): tabs added again, autocomplete iframes removed

* chore: v2 blog post

---------

Co-authored-by: Jakob Guddas <github@jguddas.de>
Co-authored-by: Maurici Abad Gutierrez <hello@mauriciabad.com>
Co-authored-by: Ivan Kucher <dev.kucher@gmail.com>
2023-11-03 12:35:36 -03:00
853 changed files with 44878 additions and 11207 deletions
+4 -1
View File
@@ -8,8 +8,11 @@
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"baseBranch": "canary",
"updateInternalDependencies": "patch",
"___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": {
"onlyUpdatePeerDependentsWhenOutOfRange": true
},
"ignore": [
"@nextui-org/docs",
"@nextui-org/storybook"
+22
View File
@@ -0,0 +1,22 @@
language: "en"
early_access: false
reviews:
high_level_summary: true
poem: false
review_status: true
collapse_walkthrough: false
auto_review:
enabled: true
ignore_title_keywords:
- "WIP"
- "DO NOT MERGE"
- 'ci(changesets)'
drafts: false
base_branches:
- "main"
- "canary"
- "fix/.*"
- "chore/.*"
- "feat/.*"
chat:
auto_reply: true
+1 -1
View File
@@ -3,7 +3,7 @@ const conventional = require("@commitlint/config-conventional");
module.exports = {
extends: ["@commitlint/config-conventional"],
plugins: ["commitlint-plugin-function-rules"],
helpUrl: "https://github.com/nextui-org/nextui/blob/main/CONTRIBUTING.MD#commit-convention",
helpUrl: "https://github.com/nextui-org/nextui/blob/main/CONTRIBUTING.md#commit-convention",
rules: {
...conventional.rules,
"type-enum": [
+1 -1
View File
@@ -3,7 +3,7 @@ name: QA
on:
pull_request:
branches:
- main
- canary
jobs:
build:
+14 -5
View File
@@ -6,7 +6,7 @@ on:
- ".changeset/**"
- "packages/**"
branches:
- main
- canary
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
@@ -41,12 +41,21 @@ jobs:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create @dev release
- name: Sync files from canary to main branch if a publish happens
if: steps.changesets.outputs.published == 'true'
run: |
curl -X POST \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
https://api.github.com/repos/owner/repo/dispatches \
-d '{"event_type":"sync-canary-to-main"}'
- name: Create canary release
if: steps.changesets.outputs.published != 'true'
run: |
git checkout main
pnpm version:dev
pnpm release:dev
git checkout canary
pnpm version:canary
pnpm release:canary
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1,43 @@
name: Sync Canary to Main
on:
# triggered manually in Github
workflow_dispatch:
# triggered by the type "sync-canary-to-main" (e.g. from release action after publishing)
repository_dispatch:
types: [sync-canary-to-main]
jobs:
create_pull_request:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0 # Ensure all history is fetched
- name: Create Pull Request
uses: repo-sync/pull-request@v2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
source_branch: "canary"
destination_branch: "main"
pr_title: "Auto-sync Canary to Main"
pr_body: |
## Automated: Sync from Canary to Main
This Pull Request is automatically generated to sync the changes from the Canary branch to the Main branch. Below are the included updates:
### Triggered by a Direct Push to Canary:
- Please check the recent commits on the Canary branch directly as this sync may include multiple changes.
### Triggered by a Pull Request Merge:
- Merged Pull Request: [PR#${{ github.event.pull_request.number }}](${{ github.event.pull_request.html_url }}) - ${{ github.event.pull_request.title }}
- PR Description: ${{ github.event.pull_request.body }}
- Merged by: ${{ github.event.pull_request.merged_by.login }}
### Action Required:
- Please review the changes carefully.
- Approve and merge the Pull Request if everything is in order.
Thank you for maintaining the Main branch updated and clean.
+1 -1
View File
@@ -2,6 +2,6 @@
"typescript.tsdk": "node_modules/typescript/lib",
"editor.formatOnSave": false,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
"source.fixAll.eslint": "explicit"
}
}
+32 -18
View File
@@ -57,7 +57,7 @@ https://www.conventionalcommits.org/ or check out the
## Pull Request Guidelines
- The `main` branch is basically a snapshot of the latest stable version. All development must be done in dedicated branches.
- The `main` branch is basically a snapshot of the latest production version. All development must be done in dedicated branches and will be merged to `canary` branch.
- Make sure that Github Actions are green
- It is good to have multiple small commits while working on the PR. We'll let GitHub squash it automatically before the merge.
- If you add a new feature:
@@ -73,14 +73,14 @@ https://www.conventionalcommits.org/ or check out the
1. Fork of the nextui repository and clone your fork
2. Create a new branch out of the `main` branch. We follow the convention
2. Create a new branch out of the `canary` branch. We follow the convention
`[type/scope]`. For example `fix/dropdown-hook` or `docs/menu-typo`. `type`
can be either `docs`, `fix`, `feat`, `build`, or any other conventional
commit type. `scope` is just a short id that describes the scope of work.
3. Make and commit your changes following the
[commit convention](https://github.com/nextui-org/nextui/blob/main/CONTRIBUTING.md#commit-convention).
As you develop, you can run `pnpm build --filter=<module>` and
As you canary, you can run `pnpm build --filter=<module>` and
`pnpm test packages/<module>/<pkg>` e.g. `pnpm build --filter=avatar & pnpm test packages/components/avatar` to make sure everything works as expected.
> To know more about the `--filter` option, please check the turborepo [docs](https://turborepo.org/docs/core-concepts/filtering).
@@ -118,12 +118,13 @@ We use [Turbo Repo](https://turborepo.org/) for the project management.
```bash
## Start the dev babel server of NextUI core components
pnpm dev:nextui
pnpm dev
## optional
pnpm dev:docs ## this will start the documentation next.js server and it will automatically detect the changes in the components.
pnpm start:sb ## this will start the storybook server for a faster development and testing.
pnpm sb ## this will start the storybook server for a faster development and testing.
pnpm dev:docs ## this will start the documentation next.js server and it will automatically detect the changes in the components.
```
- If you will be working just on the documentation source code / mdx, you can use the following commands to build
@@ -131,7 +132,7 @@ pnpm start:sb ## this will start the storybook server for a faster development a
```bash
## Build NextUI source components
pnpm build:nextui
pnpm build
## Start the next.js documentation dev server
pnpm dev:docs
@@ -141,10 +142,6 @@ pnpm dev:docs
```bash
pnpm sb
#or
pnpm start:sb
```
Remember that these commands must be executed in the root folder of the project.
@@ -166,29 +163,46 @@ git checkout -b fix/something
All commits that fix bugs or add features need a test.
You can run the nest command for component specific tests.
```
```bash
# Test current code
pnpm test:update # or npm run test:update
pnpm test
# or
npm run test
```
```bash
# Test isolated component code
pnpm test:update src/button # or npm run test:update src/button
pnpm test button
# or
npm run test button
```
5. Be sure the package builds.
```
```bash
# Build current code
pnpm build # or npm run build
pnpm build
# or
npm run build
```
> Note: ensure your version of Node is 16 or higher to run scripts
6. Send your pull request:
- Send your pull request to the `main` branch
- Send your pull request to the `canary` branch
- Your pull request will be reviewed by the maintainers and the maintainers will decide if it is accepted or not
- Once the pull request is accepted, the maintainers will merge it to the `main` branch
- Once the pull request is accepted, the maintainers will merge it to the `canary` branch
## Visual Changes
+5 -1
View File
@@ -12,4 +12,8 @@ IS_PREVIEW=true/false
ANALYZE_BUNDLE=true/false
# Vercel preview env (is used for taking the docs directly from the project files)
NEXT_PUBLIC_PREVIEW=true/false
NEXT_PUBLIC_PREVIEW=true/false
## Featurebase
NEXT_PUBLIC_FB_FEEDBACK_ORG=
NEXT_PUBLIC_FB_FEEDBACK_URL=
+1 -1
View File
@@ -202,7 +202,7 @@
"email": null,
"twitter": null,
"github": "https://github.com/HighError",
"website": "https://higherror.github.io/"
"website": null
},
{
"MemberId": 409558,
+6 -1
View File
@@ -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";
@@ -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);
@@ -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();
}
@@ -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>
@@ -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>
+12 -1
View File
@@ -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">
+1 -1
View File
@@ -83,7 +83,7 @@ export default async function DocPage({params}: DocPageProps) {
if (!doc) {
notFound();
}
const editUrl = `${GITHUB_URL}/${REPO_NAME}/edit/${TAG}/${CONTENT_PATH}${currentRoute?.path}`;
const editUrl = `${GITHUB_URL}/${REPO_NAME}/edit/${TAG}${CONTENT_PATH}${currentRoute?.path}`;
return (
<>
@@ -44,12 +44,12 @@ export default function Page() {
];
return (
<Navbar isBordered onMenuOpenChange={setIsMenuOpen}>
<NavbarContent className="sm:hidden" justify="start">
<NavbarMenuToggle aria-label={isMenuOpen ? "Close menu" : "Open menu"} />
</NavbarContent>
<NavbarContent className="sm:hidden pr-3" justify="center">
<Navbar onMenuOpenChange={setIsMenuOpen}>
<NavbarContent>
<NavbarMenuToggle
aria-label={isMenuOpen ? "Close menu" : "Open menu"}
className="sm:hidden"
/>
<NavbarBrand>
<AcmeLogo />
<p className="font-bold text-inherit">ACME</p>
@@ -57,17 +57,13 @@ export default function Page() {
</NavbarContent>
<NavbarContent className="hidden sm:flex gap-4" justify="center">
<NavbarBrand>
<AcmeLogo />
<p className="font-bold text-inherit">ACME</p>
</NavbarBrand>
<NavbarItem>
<Link color="foreground" href="#">
Features
</Link>
</NavbarItem>
<NavbarItem isActive>
<Link aria-current="page" color="warning" href="#">
<Link aria-current="page" href="#">
Customers
</Link>
</NavbarItem>
@@ -77,25 +73,23 @@ export default function Page() {
</Link>
</NavbarItem>
</NavbarContent>
<NavbarContent justify="end">
<NavbarItem className="hidden lg:flex">
<Link href="#">Login</Link>
</NavbarItem>
<NavbarItem>
<Button as={Link} color="warning" href="#" variant="flat">
<Button as={Link} color="primary" href="#" variant="flat">
Sign Up
</Button>
</NavbarItem>
</NavbarContent>
<NavbarMenu>
{menuItems.map((item, index) => (
<NavbarMenuItem key={`${item}-${index}`}>
<Link
className="w-full"
color={
index === 2 ? "warning" : index === menuItems.length - 1 ? "danger" : "foreground"
index === 2 ? "primary" : index === menuItems.length - 1 ? "danger" : "foreground"
}
href="#"
size="lg"
@@ -28,6 +28,8 @@ const AcmeLogo = () => (
);
export default function Page() {
const [isMenuOpen, setIsMenuOpen] = React.useState<boolean | undefined>(false);
const menuItems = [
"Profile",
"Dashboard",
@@ -42,12 +44,12 @@ export default function Page() {
];
return (
<Navbar disableAnimation isBordered>
<NavbarContent className="sm:hidden" justify="start">
<NavbarMenuToggle />
</NavbarContent>
<NavbarContent className="sm:hidden pr-3" justify="center">
<Navbar disableAnimation onMenuOpenChange={setIsMenuOpen}>
<NavbarContent>
<NavbarMenuToggle
aria-label={isMenuOpen ? "Close menu" : "Open menu"}
className="sm:hidden"
/>
<NavbarBrand>
<AcmeLogo />
<p className="font-bold text-inherit">ACME</p>
@@ -55,17 +57,13 @@ export default function Page() {
</NavbarContent>
<NavbarContent className="hidden sm:flex gap-4" justify="center">
<NavbarBrand>
<AcmeLogo />
<p className="font-bold text-inherit">ACME</p>
</NavbarBrand>
<NavbarItem>
<Link color="foreground" href="#">
Features
</Link>
</NavbarItem>
<NavbarItem isActive>
<Link aria-current="page" color="warning" href="#">
<Link aria-current="page" href="#">
Customers
</Link>
</NavbarItem>
@@ -75,25 +73,23 @@ export default function Page() {
</Link>
</NavbarItem>
</NavbarContent>
<NavbarContent justify="end">
<NavbarItem className="hidden lg:flex">
<Link href="#">Login</Link>
</NavbarItem>
<NavbarItem>
<Button as={Link} color="warning" href="#" variant="flat">
<Button as={Link} color="primary" href="#" variant="flat">
Sign Up
</Button>
</NavbarItem>
</NavbarContent>
<NavbarMenu>
{menuItems.map((item, index) => (
<NavbarMenuItem key={`${item}-${index}`}>
<Link
className="w-full"
color={
index === 2 ? "warning" : index === menuItems.length - 1 ? "danger" : "foreground"
index === 2 ? "primary" : index === menuItems.length - 1 ? "danger" : "foreground"
}
href="#"
size="lg"
+7 -5
View File
@@ -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",
},
},
@@ -182,7 +182,9 @@ const MyButton2 = extendVariants(Button, {
xl: "px-12 py-6 text-xl",
},
},
defaultVariants: {},
defaultVariants: {
color: "foreground",
},
});
const usersData = [
@@ -544,7 +546,7 @@ export default function NextUIPerf() {
<Button>Click Me!</Button>
<MyButton2 color="foreground">Press Me!</MyButton2>
<MyButton2 color="primary">Press Me!</MyButton2>
<Pagination
showControls
+4 -3
View File
@@ -2,7 +2,6 @@ import "@/styles/globals.css";
import "@/styles/sandpack.css";
import {Metadata} from "next";
import {clsx} from "@nextui-org/shared-utils";
import {Analytics} from "@vercel/analytics/react";
import {Providers} from "./providers";
@@ -12,7 +11,8 @@ import {siteConfig} from "@/config/site";
import {fontSans} from "@/config/fonts";
import {Navbar} from "@/components/navbar";
import {Footer} from "@/components/footer";
import {__PROD__} from "@/utils";
import {ProBanner} from "@/components/pro-banner";
import {ScriptProviders} from "@/components/scripts/script-providers";
export const metadata: Metadata = {
title: {
@@ -70,13 +70,14 @@ export default function RootLayout({children}: {children: React.ReactNode}) {
<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" id="app-container">
<ProBanner />
<Navbar mobileRoutes={manifest.mobileRoutes} routes={manifest.routes} />
{children}
<Footer />
</div>
<Cmdk />
</Providers>
{__PROD__ && <Analytics />}
<ScriptProviders />
</body>
</html>
);
+2
View File
@@ -12,6 +12,7 @@ import {Community} from "@/components/marketing/community";
import {Support} from "@/components/marketing/support";
import landingContent from "@/content/landing";
import {getAllSponsors} from "@/utils/get-all-sponsors";
import {Sponsors} from "@/components/marketing/sponsors";
async function getData() {
try {
@@ -33,6 +34,7 @@ export default async function Home() {
<section className="flex flex-col items-center justify-center">
<Hero />
<FeaturesGrid features={landingContent.topFeatures} />
<Sponsors />
<CustomThemes />
<A11yOtb />
<DarkMode />
+1 -1
View File
@@ -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>
+24 -4
View File
@@ -154,6 +154,16 @@ export const Cmdk: FC<{}> = () => {
}
};
const prioritizeFirstLevelItems = (a: SearchResultItem, b: SearchResultItem) => {
if (a.type === "lvl1") {
return -1;
} else if (b.type === "lvl1") {
return 1;
}
return 0;
};
const results = useMemo<SearchResultItem[]>(
function getResults() {
if (query.length < 2) return [];
@@ -165,12 +175,22 @@ export const Cmdk: FC<{}> = () => {
if (words.length === 1) {
return matchSorter(data, query, {
keys: MATCH_KEYS,
sorter: (matches) => {
matches.sort((a, b) => prioritizeFirstLevelItems(a.item, b.item));
return matches;
},
}).slice(0, MAX_RESULTS);
}
const matchesForEachWord = words.map((word) =>
matchSorter(data, word, {
keys: MATCH_KEYS,
sorter: (matches) => {
matches.sort((a, b) => prioritizeFirstLevelItems(a.item, b.item));
return matches;
},
}),
);
@@ -410,8 +430,8 @@ export const Cmdk: FC<{}> = () => {
</Kbd>
</div>
<Command.List ref={listRef} className={slots.list()} role="listbox">
{query.length > 0 && (
<Command.Empty>
<Command.Empty>
{query.length > 0 && (
<div className={slots.emptyWrapper()}>
<div>
<p>No results for &quot;{query}&quot;</p>
@@ -424,8 +444,8 @@ export const Cmdk: FC<{}> = () => {
)}
</div>
</div>
</Command.Empty>
)}
)}
</Command.Empty>
{isEmpty(query) &&
(isEmpty(recentSearches) ? (
+1 -1
View File
@@ -57,7 +57,7 @@ export const DemoCodeModal: FC<DemoCodeModalProps> = ({isOpen, code, title, subt
<>
This is an example of how to use the {lowerTitle} component, for more information
please visit the&nbsp;
<NextUILink as={Link} href={`/docs/${lowerTitle}`}>
<NextUILink as={Link} href={`/docs/components/${lowerTitle}`}>
{lowerTitle}
</NextUILink>
&nbsp;docs.
@@ -9,7 +9,6 @@ import {useCodeDemo, UseCodeDemoProps} from "./use-code-demo";
import WindowResizer, {WindowResizerProps} from "./window-resizer";
import {GradientBoxProps} from "@/components/gradient-box";
import {trackEvent} from "@/utils/va";
const DynamicReactLiveDemo = dynamic(
() => import("./react-live-demo").then((m) => m.ReactLiveDemo),
@@ -180,14 +179,6 @@ export const CodeDemo: React.FC<CodeDemoProps> = ({
panel: "pt-0",
}}
variant="underlined"
onSelectionChange={(tabKey) => {
trackEvent("CodeDemo - Selection", {
name: tabKey as string,
action: "tabChange",
category: "docs",
data: tabKey ?? "",
});
}}
>
<Tab key="preview" title="Preview">
{previewContent}
@@ -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";
@@ -19,6 +21,8 @@ export interface ReactLiveDemoProps {
export const scope = {
...Components,
...intlDateUtils,
...reactAriaI18n,
} as Record<string, unknown>;
export const ReactLiveDemo: React.FC<ReactLiveDemoProps> = ({
@@ -1,23 +1,35 @@
import React, {forwardRef, useEffect} from "react";
import {clsx, getUniqueID} from "@nextui-org/shared-utils";
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";
import {trackEvent} from "@/utils/va";
interface CodeblockProps {
language: Language;
codeString: string;
metastring?: string;
theme?: PrismTheme;
children?: React.ReactNode;
showLines?: boolean;
removeIndent?: boolean;
hideScrollBar?: boolean;
className?: string;
children?: (props: any) => React.ReactNode;
}
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) => {
@@ -64,6 +76,32 @@ const Codeblock = forwardRef<HTMLPreElement, CodeblockProps>(
const lastSelectionText = React.useRef<string | null>(null);
const isDiff = language.includes("diff");
const codeLang = isDiff ? (language.split("-")[1] as Language) : language;
let highlightStyle: HighlightStyle[] = [];
if (isDiff) {
let code: string[] = [];
highlightStyle = codeString.split?.("\n").map((line) => {
if (line.startsWith("+")) {
code.push(line.substr(1));
return "inserted";
}
if (line.startsWith("-")) {
code.push(line.substr(1));
return "deleted";
}
code.push(line);
});
codeString = code.join("\n");
}
useEffect(() => {
const handleSelectionChange = () => {
if (!window.getSelection) return;
@@ -84,12 +122,6 @@ const Codeblock = forwardRef<HTMLPreElement, CodeblockProps>(
return;
lastSelectionText.current = selectionText;
trackEvent("Codeblock - Selection", {
action: "selectText",
category: "docs",
data: selectionText,
});
};
const debouncedHandleSelectionChange = debounce(handleSelectionChange, 1000);
@@ -105,7 +137,7 @@ const Codeblock = forwardRef<HTMLPreElement, CodeblockProps>(
<BaseHighlight
{...defaultProps}
code={codeString}
language={language}
language={codeLang}
theme={theme}
{...props}
>
@@ -124,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",
@@ -138,17 +170,36 @@ const Codeblock = forwardRef<HTMLPreElement, CodeblockProps>(
shouldHighlightLine(i),
},
)}
data-deleted={dataAttr(highlightStyle?.[i] === "deleted")}
data-inserted={dataAttr(highlightStyle?.[i] === "inserted")}
>
{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 content = token.content.trim();
const regex = t instanceof RegExp ? t : new RegExp(t);
return regex.test(content);
})
? {color: "rgb(var(--code-function))"}
: {}),
}}
/>
);
})}
</div>
);
})}
@@ -8,6 +8,8 @@ import {trackEvent} from "@/utils/va";
export interface ComponentLinksProps {
component: string;
npm?: string;
source?: string;
styles?: string;
storybook?: string;
rscCompatible?: boolean;
@@ -60,6 +62,8 @@ const ButtonLink = ({
export const ComponentLinks = ({
component,
npm,
source,
storybook,
styles,
rscCompatible,
@@ -80,10 +84,10 @@ export const ComponentLinks = ({
Storybook
</ButtonLink>
<ButtonLink
href={`https://www.npmjs.com/package/@nextui-org/${component}`}
href={`https://www.npmjs.com/package/@nextui-org/${npm || component}`}
startContent={<NpmIcon className="text-2xl text-[#E53E3E]" />}
>
{`@nextui-org/${component}`}
{`@nextui-org/${npm || component}`}
</ButtonLink>
{reactAriaHook && (
<ButtonLink
@@ -113,7 +117,10 @@ export const ComponentLinks = ({
</ButtonLink>
)}
<ButtonLink href={`${COMPONENT_PATH}/${component}`} startContent={<GithubIcon size={20} />}>
<ButtonLink
href={`${COMPONENT_PATH}/${source || component}`}
startContent={<GithubIcon size={20} />}
>
Source
</ButtonLink>
<ButtonLink
@@ -2,22 +2,20 @@ import {Tabs, Tab, Snippet} from "@nextui-org/react";
import Codeblock from "./codeblock";
import {trackEvent} from "@/utils/va";
type PackageManager = {
key: string;
name: string;
};
const importTabs: PackageManager[] = [
{
key: "main",
name: "Main",
},
{
key: "individual",
name: "Individual",
},
{
key: "main",
name: "Global",
},
];
export interface ImportTabsProps {
@@ -34,14 +32,6 @@ export const ImportTabs = ({commands}: ImportTabsProps) => {
tabList: "relative h-10",
}}
variant="underlined"
onSelectionChange={(tabKey) => {
trackEvent("ImportTabs - Selection", {
name: tabKey as string,
action: "tabChange",
category: "docs",
data: commands[tabKey] ?? "",
});
}}
>
{importTabs.map(({key, name}) => {
if (!commands[key]) return null;
@@ -57,14 +47,6 @@ export const ImportTabs = ({commands}: ImportTabsProps) => {
pre: "font-light text-base",
copyButton: "text-lg text-default-400",
}}
onCopy={() => {
trackEvent("ImportTabs - Copy", {
name,
action: "copyInstallScript",
category: "docs",
data: commands[name] ?? "",
});
}}
>
<Codeblock
hideScrollBar
@@ -1,18 +1,25 @@
import {Tabs, Tab, Snippet} from "@nextui-org/react";
import {Tabs, Tab, Snippet, Code} from "@nextui-org/react";
import {Key, useState} from "react";
import Codeblock from "./codeblock";
import {Blockquote} from "./blockquote";
import {YarnIcon, NpmSmallIcon, PnpmIcon} from "@/components/icons";
import {trackEvent} from "@/utils/va";
import {YarnIcon, NpmSmallIcon, PnpmIcon, BunIcon, CLIBoldIcon} from "@/components/icons";
type PackageManagerName = "npm" | "yarn" | "pnpm";
type PackageManagerName = "cli" | "npm" | "yarn" | "pnpm" | "bun";
type PackageManager = {
icon: JSX.Element;
name: PackageManagerName;
label?: string;
};
const packageManagers: PackageManager[] = [
{
name: "cli",
label: "CLI",
icon: <CLIBoldIcon className="text-lg text-default-600 dark:text-default-400" />,
},
{
name: "npm",
icon: <NpmSmallIcon className="text-[#E53E3E]" />,
@@ -25,66 +32,76 @@ const packageManagers: PackageManager[] = [
name: "pnpm",
icon: <PnpmIcon className="text-[#F69220]" />,
},
{
name: "bun",
icon: <BunIcon className="text-lg text-[#FBF0DF]" />,
},
];
export interface PackageManagersProps {
commands: Partial<Record<PackageManagerName, React.Key>>;
showGlobalInstallWarning?: boolean;
}
export const PackageManagers = ({commands}: PackageManagersProps) => {
return (
<Tabs
aria-label="NextUI installation commands"
classNames={{
base: "group mt-4",
tabList: "h-10",
}}
variant="underlined"
onSelectionChange={(tabKey) => {
trackEvent("PackageManagers - Selection", {
name: tabKey as string,
action: "tabChange",
category: "docs",
data: commands[tabKey as unknown as PackageManagerName] ?? "",
});
}}
>
{packageManagers.map(({name, icon}) => {
if (!commands[name]) return null;
export const PackageManagers = ({
commands,
showGlobalInstallWarning = false,
}: PackageManagersProps) => {
const [selectedManager, setSelectedManager] = useState<PackageManagerName>(
commands.cli ? "cli" : "npm",
);
return (
<Tab
key={name}
title={
<div className="flex items-center space-x-2">
{icon}
<span>{name}</span>
</div>
}
>
<Snippet
disableTooltip
fullWidth
hideSymbol
classNames={{
base: "bg-code-background text-code-foreground",
pre: "font-light text-base",
copyButton: "text-lg text-zinc-500 mr-2",
}}
onCopy={() => {
trackEvent("PackageManagers - Copy", {
name,
action: "copyScript",
category: "docs",
data: commands[name] ?? "",
});
}}
const handleSelectionChange = (tabKey: Key) => {
setSelectedManager(tabKey as PackageManagerName);
};
return (
<>
<Tabs
aria-label="NextUI installation commands"
classNames={{
base: "group mt-4 min-w-[300px] w-full overflow-x-auto",
tabList: "h-10",
}}
selectedKey={selectedManager}
variant="underlined"
onSelectionChange={handleSelectionChange}
>
{packageManagers.map(({name, label, icon}) => {
if (!commands[name]) return null;
return (
<Tab
key={name}
title={
<div className="flex items-center space-x-2">
{icon}
<span>{label || name}</span>
</div>
}
>
<Codeblock removeIndent codeString={commands[name] as string} language="bash" />
</Snippet>
</Tab>
);
})}
</Tabs>
<Snippet
disableTooltip
fullWidth
hideSymbol
classNames={{
base: "bg-code-background text-code-foreground",
pre: "font-light text-base",
copyButton: "text-lg text-zinc-500 mr-2",
}}
>
<Codeblock removeIndent codeString={commands[name] as string} language="bash" />
</Snippet>
</Tab>
);
})}
</Tabs>
{showGlobalInstallWarning && (
<Blockquote className="my-2">
No need to install this package if <Code>@nextui-org/react</Code> is already installed
globally.
</Blockquote>
)}
</>
);
};
@@ -20,7 +20,7 @@ type SwatchColors = {
type SwatchSetProps = {
colors: SwatchColors[];
isSematic?: boolean;
isSemantic?: boolean;
};
const scaleIndexMap: Record<number, string> = {
@@ -90,7 +90,7 @@ const Swatch = ({color, scale}: {color: string; scale?: string}) => {
);
};
const SematicSwatch = ({
const SemanticSwatch = ({
color,
className,
textClassName,
@@ -139,15 +139,15 @@ const SematicSwatch = ({
);
};
const SwatchSet = ({colors, isSematic = false}: SwatchSetProps) => (
const SwatchSet = ({colors, isSemantic = false}: SwatchSetProps) => (
<div className="flex flex-row flex-wrap items-center justify-center">
{colors.map(({title, items}) => (
<div key={title} className="flex flex-col items-start w-full h-full">
<h2 className="text-xl font-bold text-foreground">{title}</h2>
<div className="flex flex-row flex-wrap items-center justify-start w-full h-full px-4 py-1">
{items.map((c, index) =>
isSematic ? (
<SematicSwatch
isSemantic ? (
<SemanticSwatch
key={`${c.color}-${index}`}
className={c.className}
color={c.color}
@@ -218,7 +218,7 @@ export const CommonColors = () => {
export const SemanticColors = () => {
return (
<SwatchSet
isSematic
isSemantic
colors={[
{
title: "Layout",
+118 -63
View File
@@ -1,6 +1,6 @@
"use client";
import {FC} from "react";
import {FC, useEffect, useState} from "react";
import {ChevronIcon} from "@nextui-org/shared-icons";
import {CollectionBase, Expandable, MultipleSelection, Node, ItemProps} from "@react-types/shared";
import {BaseItem} from "@nextui-org/aria-utils";
@@ -28,6 +28,11 @@ import {getRoutePaths} from "./utils";
import {Route} from "@/libs/docs/page";
import {TreeKeyboardDelegate} from "@/utils/tree-keyboard-delegate";
import {trackEvent} from "@/utils/va";
import {FbFeedbackButton} from "@/components/featurebase/fb-feedback-button";
import {FbChangelogButton} from "@/components/featurebase/fb-changelog-button";
import {FbRoadmapLink} from "@/components/featurebase/fb-roadmap-link";
import {openFeedbackWidget} from "@/utils/featurebase";
import emitter from "@/libs/emitter";
export interface Props<T> extends Omit<ItemProps<T>, "title">, Route {
slug?: string;
@@ -85,6 +90,18 @@ function TreeItem<T>(props: TreeItemProps<T>) {
const Component = hasChildNodes ? "ul" : "li";
const cn = clsx(
"w-full",
"font-normal",
"before:mr-4",
"before:content-['']",
"before:block",
"before:bg-default-300",
"before:w-1",
"before:h-1",
"before:rounded-full",
);
const {pressProps} = usePress({
onPress: () => {
if (hasChildNodes) {
@@ -103,6 +120,79 @@ function TreeItem<T>(props: TreeItemProps<T>) {
const {focusProps, isFocused, isFocusVisible} = useFocusRing();
const renderFeaturebaseComponent = (key: string) => {
if (key === "roadmap")
return <FbRoadmapLink className={cn} innerClassName="opacity-80 dark:opacity-60" />;
if (key === "changelog")
return (
<NextUILink as={Link} className={cn} color="foreground" href="#">
<FbChangelogButton />
</NextUILink>
);
return (
<NextUILink as={Link} className={cn} color="foreground" href="#" onClick={openFeedbackWidget}>
<FbFeedbackButton />
</NextUILink>
);
};
const renderComponent = () => {
if (hasChildNodes) {
return (
<span className="flex items-center gap-3">
<span>{rendered}</span>
<ChevronIcon
className={clsx("transition-transform", {
"-rotate-90": isExpanded,
})}
/>
</span>
);
}
if (typeof key === "string" && ["changelog", "feedback", "roadmap"].includes(key)) {
return renderFeaturebaseComponent(key);
}
return (
<NextUILink as={Link} className={clsx(cn)} color="foreground" href={paths.pathname}>
<span
className={clsx(
isSelected
? "text-primary font-medium dark:text-foreground"
: "opacity-80 dark:opacity-60",
{
"pointer-events-none": item.props?.comingSoon,
},
)}
>
{rendered}
</span>
{isUpdated && (
<Chip
className="ml-1 py-1 text-tiny text-default-400 bg-default-100/50"
color="default"
size="sm"
variant="flat"
>
Updated
</Chip>
)}
{isNew && (
<Chip className="ml-1 py-1 text-tiny" color="primary" size="sm" variant="flat">
New
</Chip>
)}
{item.props?.comingSoon && (
<Chip className="ml-1 py-1 text-tiny" color="default" size="sm" variant="flat">
Coming soon
</Chip>
)}
</NextUILink>
);
};
return (
<Component
{...focusProps}
@@ -122,66 +212,7 @@ function TreeItem<T>(props: TreeItemProps<T>) {
>
<div className="flex items-center gap-3 cursor-pointer" {...pressProps}>
<Spacer x={spaceLeft} />
{hasChildNodes ? (
<span className="flex items-center gap-3">
<span>{rendered}</span>
<ChevronIcon
className={clsx("transition-transform", {
"-rotate-90": isExpanded,
})}
/>
</span>
) : (
<NextUILink
as={Link}
className={clsx(
"w-full",
"font-normal",
"before:mr-4",
"before:content-['']",
"before:block",
"before:bg-default-300",
"before:w-1",
"before:h-1",
"before:rounded-full",
)}
color="foreground"
href={paths.pathname}
>
<span
className={clsx(
isSelected
? "text-primary font-medium dark:text-foreground"
: "opacity-80 dark:opacity-60",
{
"pointer-events-none": item.props?.comingSoon,
},
)}
>
{rendered}
</span>
{isUpdated && (
<Chip
className="ml-1 py-1 text-tiny text-default-400 bg-default-100/50"
color="default"
size="sm"
variant="flat"
>
Updated
</Chip>
)}
{isNew && (
<Chip className="ml-1 py-1 text-tiny" color="primary" size="sm" variant="flat">
New
</Chip>
)}
{item.props?.comingSoon && (
<Chip className="ml-1 py-1 text-tiny" color="default" size="sm" variant="flat">
Coming soon
</Chip>
)}
</NextUILink>
)}
{renderComponent()}
{/* Workaround to avoid scrollbar overlapping */}
<Spacer x={4} />
</div>
@@ -252,6 +283,8 @@ export interface DocsSidebarProps {
}
export const DocsSidebar: FC<DocsSidebarProps> = ({routes, slug, tag, className}) => {
const [isProBannerVisible, setIsProBannerVisible] = useState(true);
const expandedKeys = routes?.reduce((keys, route) => {
if (route.defaultOpen) {
keys.push(route.key as string);
@@ -260,8 +293,18 @@ export const DocsSidebar: FC<DocsSidebarProps> = ({routes, slug, tag, className}
return keys;
}, [] as string[]);
return (
<div className={clsx("lg:fixed lg:top-20 mt-2 z-0 lg:h-[calc(100vh-121px)]", className)}>
useEffect(() => {
emitter.on("proBannerVisibilityChange", (value) => {
setIsProBannerVisible(value === "visible");
});
return () => {
emitter.off("proBannerVisibilityChange");
};
}, []);
const treeContent = useMemo(() => {
return (
<Tree defaultExpandedKeys={expandedKeys} items={routes || []}>
{(route) => (
<Item
@@ -275,6 +318,18 @@ export const DocsSidebar: FC<DocsSidebarProps> = ({routes, slug, tag, className}
</Item>
)}
</Tree>
);
}, [routes]);
return (
<div
className={clsx(
"lg:fixed mt-2 z-0 lg:h-[calc(100vh-121px)]",
isProBannerVisible ? "lg:top-32" : "lg:top-20",
className,
)}
>
{treeContent}
</div>
);
};
+18 -2
View File
@@ -1,6 +1,6 @@
"use client";
import {FC, useRef, useEffect} from "react";
import {FC, useRef, useEffect, useState} from "react";
import {clsx} from "@nextui-org/shared-utils";
import {Divider, Spacer} from "@nextui-org/react";
import {ChevronCircleTopLinearIcon} from "@nextui-org/shared-icons";
@@ -9,6 +9,7 @@ import scrollIntoView from "scroll-into-view-if-needed";
import {Heading} from "@/libs/docs/utils";
import {useScrollSpy} from "@/hooks/use-scroll-spy";
import {useScrollPosition} from "@/hooks/use-scroll-position";
import emitter from "@/libs/emitter";
export interface DocsTocProps {
headings: Heading[];
@@ -22,6 +23,8 @@ const paddingLeftByLevel: Record<number, string> = {
};
export const DocsToc: FC<DocsTocProps> = ({headings}) => {
const [isProBannerVisible, setIsProBannerVisible] = useState(true);
const tocRef = useRef<HTMLDivElement>(null);
const scrollPosition = useScrollPosition(tocRef);
@@ -51,10 +54,23 @@ export const DocsToc: FC<DocsTocProps> = ({headings}) => {
}
}, [activeId, activeIndex]);
useEffect(() => {
emitter.on("proBannerVisibilityChange", (value) => {
setIsProBannerVisible(value === "visible");
});
return () => {
emitter.off("proBannerVisibilityChange");
};
}, []);
return (
<div
ref={tocRef}
className="fixed w-full max-w-[12rem] flex flex-col gap-4 text-left top-20 pb-20 h-[calc(100vh-121px)] scrollbar-hide overflow-y-scroll"
className={clsx(
"fixed w-full max-w-[12rem] flex flex-col gap-4 text-left pb-28 h-[calc(100vh-121px)] scrollbar-hide overflow-y-scroll",
isProBannerVisible ? "top-32" : "top-20",
)}
style={{
WebkitMaskImage: `linear-gradient(to top, transparent 0%, #000 100px, #000 ${
scrollPosition > 30 ? "90%" : "100%"
@@ -0,0 +1,46 @@
"use client";
import {useEffect} from "react";
import {trackEvent} from "@/utils/va";
type Props = {
className?: string;
};
// ref: https://developers.featurebase.app/install/changelog-widget/install
export const FbChangelogButton = ({className}: Props) => {
useEffect(() => {
const win = window as any;
if (typeof win.Featurebase !== "function") {
win.Featurebase = function () {
// eslint-disable-next-line prefer-rest-params
(win.Featurebase.q = win.Featurebase.q || []).push(arguments);
};
}
win.Featurebase("initialize_changelog_widget", {
organization: process.env.NEXT_PUBLIC_FB_FEEDBACK_ORG,
theme: "dark",
usersName: "",
fullscreenPopup: true,
alwaysShow: true,
});
}, []);
const fbButtonOnClick = () => {
(window as any).Featurebase("manually_open_changelog_popup");
trackEvent("Featurebase - Changelog", {
name: "featurebase-changelog",
action: "press",
category: "featurebase",
});
};
return (
<button className={className} onClick={fbButtonOnClick}>
Changelog <span id="fb-update-badge" />
</button>
);
};
@@ -0,0 +1,42 @@
"use client";
import {useEffect} from "react";
import {trackEvent} from "@/utils/va";
type Props = {
className?: string;
};
// ref: https://developers.featurebase.app/install/feedback-widget/setup
export const FbFeedbackButton = ({className}: Props) => {
useEffect(() => {
const win = window as any;
if (typeof win.Featurebase !== "function") {
win.Featurebase = function () {
// eslint-disable-next-line prefer-rest-params
(win.Featurebase.q = win.Featurebase.q || []).push(arguments);
};
}
win.Featurebase("initialize_feedback_widget", {
organization: process.env.NEXT_PUBLIC_FB_FEEDBACK_ORG,
theme: "dark",
email: "",
});
}, []);
const fbButtonOnClick = () => {
trackEvent("Featurebase - Feedback", {
name: "featurebase-feedback",
action: "press",
category: "featurebase",
});
};
return (
<button data-featurebase-feedback className={className} onClick={fbButtonOnClick}>
Feedback
</button>
);
};
@@ -0,0 +1,42 @@
"use client";
import NextLink from "next/link";
import arrowRightUpIcon from "@iconify/icons-solar/arrow-right-up-linear";
import {Icon} from "@iconify/react/dist/offline";
import {clsx} from "@nextui-org/shared-utils";
import {trackEvent} from "@/utils/va";
type Props = {
className?: string;
innerClassName?: string;
};
export const FbRoadmapLink = ({className, innerClassName}: Props) => {
const fbLinkOnClick = () => {
trackEvent("Featurebase - Roadmap", {
name: "featurebase-roadmap",
action: "press",
category: "featurebase",
});
};
return (
<NextLink
className={clsx("inline-flex items-center", className)}
color="foreground"
href={`${process.env.NEXT_PUBLIC_FB_FEEDBACK_URL}/roadmap`}
target="_blank"
onClick={fbLinkOnClick}
>
<div className={clsx("relative", innerClassName)}>
Roadmap
<Icon
className="absolute right-[-10px] top-0 outline-none transition-transform group-data-[hover=true]:translate-y-0.5 [&>path]:stroke-[2.5px]"
icon={arrowRightUpIcon}
width={10}
/>
</div>
</NextLink>
);
};
+2 -8
View File
@@ -3,9 +3,8 @@
import dynamic from "next/dynamic";
import {usePathname} from "next/navigation";
import {siteConfig} from "@/config/site";
import {getCurrentYear} from "@/utils/time";
const Link = dynamic(() => import("@nextui-org/react").then((mod) => mod.Link));
const VercelCallout = dynamic(() => import("./vercel-callout").then((mod) => mod.VercelCallout));
export const Footer = () => {
@@ -18,12 +17,7 @@ export const Footer = () => {
return (
<footer className="container mx-auto max-w-7xl pb-12 px-12">
<div className="flex flex-col justify-center items-center gap-1">
<p className="text-sm text-default-400">
Created&nbsp;by&nbsp;
<Link isExternal className="text-sm" href={siteConfig.links.portfolio}>
Junior Garcia
</Link>
</p>
<p className="text-sm text-default-400">© {getCurrentYear()} NextUI Inc.</p>
<VercelCallout />
</div>
</footer>
+22
View File
@@ -0,0 +1,22 @@
import {IconSvgProps} from "@/types";
export const CLIBoldIcon = ({...props}: IconSvgProps) => (
<svg
aria-hidden="true"
fill="none"
focusable="false"
height="1em"
role="presentation"
viewBox="0 0 24 24"
width="1em"
xmlns="http://www.w3.org/2000/svg"
{...props}
>
<path
clipRule="evenodd"
d="M3.464 3.464C2 4.93 2 7.286 2 12c0 4.714 0 7.071 1.464 8.535C4.93 22 7.286 22 12 22c4.714 0 7.071 0 8.535-1.465C22 19.072 22 16.714 22 12s0-7.071-1.465-8.536C19.072 2 16.714 2 12 2S4.929 2 3.464 3.464m2.96 6.056a.75.75 0 0 1 1.056-.096l.277.23c.605.504 1.12.933 1.476 1.328c.379.42.674.901.674 1.518s-.295 1.099-.674 1.518c-.356.395-.871.824-1.476 1.328l-.277.23a.75.75 0 1 1-.96-1.152l.234-.195c.659-.55 1.09-.91 1.366-1.216c.262-.29.287-.427.287-.513c0-.086-.025-.222-.287-.513c-.277-.306-.707-.667-1.366-1.216l-.234-.195a.75.75 0 0 1-.096-1.056M17.75 15a.75.75 0 0 1-.75.75h-5a.75.75 0 0 1 0-1.5h5a.75.75 0 0 1 .75.75"
fill="currentColor"
fillRule="evenodd"
/>
</svg>
);
+1
View File
@@ -16,3 +16,4 @@ export * from "./hash";
export * from "./more-square";
export * from "./play";
export * from "./pause";
export * from "./cli";
+23
View File
@@ -0,0 +1,23 @@
import {IconSvgProps} from "@/types";
export const CLILinearIcon = ({...props}: IconSvgProps) => (
<svg
aria-hidden="true"
fill="none"
focusable="false"
height="1em"
role="presentation"
viewBox="0 0 24 24"
width="1em"
xmlns="http://www.w3.org/2000/svg"
{...props}
>
<g fill="none" stroke="currentColor" strokeWidth="1.5">
<path d="M2 12c0-4.714 0-7.071 1.464-8.536C4.93 2 7.286 2 12 2c4.714 0 7.071 0 8.535 1.464C22 4.93 22 7.286 22 12c0 4.714 0 7.071-1.465 8.535C19.072 22 16.714 22 12 22s-7.071 0-8.536-1.465C2 19.072 2 16.714 2 12Z" />
<path
d="M17 15h-5m-5-5l.234.195c1.282 1.068 1.923 1.602 1.923 2.305c0 .703-.64 1.237-1.923 2.305L7 15"
strokeLinecap="round"
/>
</g>
</svg>
);
@@ -20,3 +20,4 @@ export * from "./chevron-right";
export * from "./search";
export * from "./simple-grid";
export * from "./rotate-left";
export * from "./cli";
+39
View File
@@ -223,6 +223,44 @@ const AstroIcon: React.FC<IconSvgProps> = ({width = "1em", height = "1em", ...pr
);
};
const BunIcon: React.FC<IconSvgProps> = ({width = "1em", height = "1em", ...props}) => {
return (
<svg aria-hidden="true" height={height} viewBox="0 0 32 32" width={width} {...props}>
<path
d="M29 17c0 5.65-5.82 10.23-13 10.23S3 22.61 3 17c0-3.5 2.24-6.6 5.66-8.44S14.21 4.81 16 4.81s3.32 1.54 7.34 3.71C26.76 10.36 29 13.46 29 17"
fill="#fbf0df"
/>
<path
d="M16 27.65c7.32 0 13.46-4.65 13.46-10.65c0-3.72-2.37-7-5.89-8.85c-1.39-.75-2.46-1.41-3.37-2l-1.13-.69A6.14 6.14 0 0 0 16 4.35a6.88 6.88 0 0 0-3.3 1.23c-.42.24-.86.51-1.32.8c-.87.54-1.83 1.13-3 1.73C4.91 10 2.54 13.24 2.54 17c0 6 6.14 10.65 13.46 10.65Z"
fill="none"
stroke="#000"
/>
<ellipse cx="21.65" cy="18.62" fill="#febbd0" rx="2.17" ry="1.28" />
<ellipse cx="10.41" cy="18.62" fill="#febbd0" rx="2.17" ry="1.28" />
<path
d="M11.43 18.11a2 2 0 1 0-2-2.05a2.05 2.05 0 0 0 2 2.05m9.2 0a2 2 0 1 0-2-2.05a2 2 0 0 0 2 2.05"
fillRule="evenodd"
/>
<path
d="M10.79 16.19a.77.77 0 1 0-.76-.77a.76.76 0 0 0 .76.77m9.2 0a.77.77 0 1 0 0-1.53a.77.77 0 0 0 0 1.53"
fill="#fff"
fillRule="evenodd"
/>
<path
d="M18.62 19.67a3.3 3.3 0 0 1-1.09 1.75a2.48 2.48 0 0 1-1.5.69a2.53 2.53 0 0 1-1.5-.69a3.28 3.28 0 0 1-1.08-1.75a.26.26 0 0 1 .29-.3h4.58a.27.27 0 0 1 .3.3Z"
fill="#b71422"
stroke="#000"
strokeWidth=".75"
/>
<path
d="M14.93 5.75a6.09 6.09 0 0 1-2.09 4.62c-.1.09 0 .27.11.22c1.25-.49 2.94-1.94 2.23-4.88c-.03-.15-.25-.11-.25.04m.85 0a6 6 0 0 1 .57 5c0 .13.12.24.21.13c.83-1 1.54-3.11-.59-5.31c-.1-.11-.27.04-.19.17Zm1-.06a6.09 6.09 0 0 1 2.53 4.38c0 .14.21.17.24 0c.34-1.3.15-3.51-2.66-4.66c-.12-.02-.21.18-.09.27ZM9.94 9.55a6.27 6.27 0 0 0 3.89-3.33c.07-.13.28-.08.25.07c-.64 3-2.79 3.59-4.13 3.51c-.14-.01-.14-.21-.01-.25"
fill="#ccbea7"
fillRule="evenodd"
/>
</svg>
);
};
const NewNextJSIcon: React.FC<IconSvgProps> = ({width = "1em", height = "1em", ...props}) => {
return (
<svg aria-hidden="true" fill="none" focusable="false" height={height} width={width} {...props}>
@@ -452,4 +490,5 @@ export {
CodeSandboxIcon,
JavascriptIcon,
TypescriptIcon,
BunIcon,
};
File diff suppressed because one or more lines are too long
@@ -14,7 +14,6 @@ import {PaletteIcon, MagicIcon, GamingConsoleIcon, StarIcon} from "@/components/
import {NextUILogo, CodeWindow} from "@/components";
import landingContent from "@/content/landing";
import {useIsMobile} from "@/hooks/use-media-query";
import {trackEvent} from "@/utils/va";
const themesTabs = (isMobile: boolean) => [
{
@@ -88,12 +87,6 @@ const CustomThemesExample = ({
const onSelectionChange = (value: React.Key) => {
onChangeTheme(value as Theme);
trackEvent("CustomThemes - Selection", {
action: "change_theme",
category: "landing-page",
data: value,
});
};
return (
+44 -5
View File
@@ -1,14 +1,14 @@
"use client";
import NextLink from "next/link";
import {Button, Link} from "@nextui-org/react";
import {Button, Link, Chip, Snippet} from "@nextui-org/react";
import {ArrowRightIcon} from "@nextui-org/shared-icons";
import dynamic from "next/dynamic";
import {FloatingComponents} from "./floating-components";
import {title, subtitle} from "@/components/primitives";
import {GithubIcon} from "@/components/icons";
import {title, subtitle} from "@/components/primitives";
import {trackEvent} from "@/utils/va";
const BgLooper = dynamic(() => import("./bg-looper").then((mod) => mod.BgLooper), {
@@ -16,9 +16,33 @@ const BgLooper = dynamic(() => import("./bg-looper").then((mod) => mod.BgLooper)
});
export const Hero = () => {
const handlePressAnnouncement = (name: string, url: string) => {
trackEvent("NavbarItem", {
name,
action: "press",
category: "home - gero",
data: url,
});
};
return (
<section className="flex relative overflow-hidden lg:overflow-visible w-full flex-nowrap justify-between items-center h-[calc(100vh_-_64px)] 2xl:h-[calc(84vh_-_64px)]">
<div className="flex relative z-20 flex-col gap-6 w-full lg:w-1/2 xl:mt-10">
<div className="w-full flex justify-center md:hidden">
<Chip
as={NextLink}
className="bg-default-100/50 hover:bg-default-100 border-default-200/80 dark:border-default-100/80 transition-colors cursor-pointer"
color="default"
href="/blog/v2.3.0"
variant="dot"
onClick={() => handlePressAnnouncement("New version v2.4.0", "/blog/v2.4.0")}
>
New version v2.4.0&nbsp;
<span aria-label="emoji" role="img">
🚀
</span>
</Chip>
</div>
<div className="text-center leading-8 md:leading-10 md:text-left">
<div className="inline-block">
<h1 className={title()}>Make&nbsp;</h1>
@@ -32,7 +56,7 @@ export const Hero = () => {
<div className="flex flex-col md:flex-row items-center gap-4">
<Button
as={NextLink}
className="w-full md:w-auto"
className="w-full md:h-11 md:w-auto"
color="primary"
endContent={
<ArrowRightIcon
@@ -54,12 +78,27 @@ export const Hero = () => {
>
Get Started
</Button>
<Snippet
className="w-full rounded-full hidden md:flex sm:w-auto"
copyButtonProps={{
radius: "full",
}}
onCopy={() => {
trackEvent("Hero - Copy Install Command", {
name: "Copy",
action: "click",
category: "landing-page",
data: "npx nextui-cli@latest init",
});
}}
>
npx nextui-cli@latest init
</Snippet>
<Button
fullWidth
isExternal
as={Link}
className="w-full md:w-auto"
className="w-full md:hidden"
href="https://github.com/nextui-org/nextui"
radius="full"
size="lg"
@@ -0,0 +1,30 @@
"use client";
import {Link} from "@nextui-org/react";
import {trackEvent} from "@/utils/va";
export type Sponsor = {
name: string;
href: string;
logo: React.ReactNode;
};
export const SponsorItem = ({name, href, logo}: Sponsor) => {
return (
<Link
isExternal
className="flex flex-col items-center justify-center"
href={href}
onClick={() => {
trackEvent("Hero - Sponsors", {
name,
action: "click",
category: "hero",
});
}}
>
{logo}
</Link>
);
};
@@ -0,0 +1,46 @@
import {Button, Link} from "@nextui-org/react";
import {sectionWrapper} from "@/components/primitives";
import {Story2DesignLogo} from "@/components/icons/sponsors";
import {HeartFilledIcon} from "@/components/icons";
import {VercelIcon} from "@/components/icons/social";
import {siteConfig} from "@/config/site";
import {Sponsor, SponsorItem} from "@/components/marketing/sponsor-item";
const sponsors: Sponsor[] = [
{
name: "Vercel",
href: "https://www.vercel.com?utm_source=nextui&utm_marketing=oss",
logo: <VercelIcon className="text-black dark:text-white" height={24} />,
},
{
name: "story.to.design",
href: "https://story.to.design?utm_source=nextui&utm_marketing=partnership",
logo: <Story2DesignLogo className="pt-1" />,
},
];
export const Sponsors = () => {
return (
<section className={sectionWrapper({class: "text-center mt-24 lg:mt-32"})}>
<h3 className="text-large text-default-500">Supported and backed by</h3>
<div className="w-full flex flex-wrap gap-x-5 gap-y-3 justify-center items-center">
{sponsors.map((sponsor) => (
<SponsorItem key={sponsor.name} {...sponsor} />
))}
<Button
isExternal
as={Link}
className="group text-sm border-dashed font-normal text-default-600 data-[hover=true]:bg-default-100/50"
href={siteConfig.links.sponsor}
startContent={
<HeartFilledIcon className="text-danger group-data-[hover=true]:animate-heartbeat" />
}
variant="bordered"
>
Your Company
</Button>
</div>
</section>
);
};
+2 -3
View File
@@ -11,7 +11,7 @@ import {CarbonAd} from "@/components/ads/carbon-ad";
import * as DocsComponents from "@/components/docs/components";
import * as BlogComponents from "@/components/blog/components";
import {Codeblock} from "@/components/docs/components";
import {VirtualAnchor, virtualAnchorEncode} from "@/components";
import {VirtualAnchor, virtualAnchorEncode} from "@/components/virtual-anchor";
import {trackEvent} from "@/utils/va";
const Table: React.FC<{children?: React.ReactNode}> = ({children}) => {
@@ -105,7 +105,7 @@ const List: React.FC<{children?: React.ReactNode}> = ({children}) => {
const InlineCode = ({children}: {children?: React.ReactNode}) => {
return (
<Components.Code className="font-normal bg-transparent px-0 py-0 text-code-mdx">
<Components.Code className="font-normal text-default-700 bg-default-200/50 dark:bg-default-100/60 px-2 py-0.5">
{children}
</Components.Code>
);
@@ -149,7 +149,6 @@ const Code = ({
trackEvent("MDXComponents - Copy", {
category: "docs",
action: "copyCode",
data: codeString,
});
}}
>
+41 -12
View File
@@ -34,16 +34,11 @@ import {currentVersion} from "@/utils/version";
import {siteConfig} from "@/config/site";
import {Route} from "@/libs/docs/page";
import {LargeLogo, SmallLogo, ThemeSwitch} from "@/components";
import {
TwitterIcon,
GithubIcon,
DiscordIcon,
HeartFilledIcon,
SearchLinearIcon,
} from "@/components/icons";
import {TwitterIcon, GithubIcon, DiscordIcon, SearchLinearIcon} from "@/components/icons";
import {useIsMounted} from "@/hooks/use-is-mounted";
import {DocsSidebar} from "@/components/docs/sidebar";
import {useCmdkStore} from "@/components/cmdk";
import {FbRoadmapLink} from "@/components/featurebase/fb-roadmap-link";
import {trackEvent} from "@/utils/va";
export interface NavbarProps {
@@ -242,12 +237,26 @@ export const Navbar: FC<NavbarProps> = ({children, routes, mobileRoutes = [], sl
Figma
</NextLink>
</NavbarItem>
{/* hide feedback and changelog at this moment */}
{/* <NavbarItem>
<NextLink className={navLinkClasses} color="foreground" href="#">
<FbChangelogButton key="changelog" userName="" />
</NextLink>
</NavbarItem>
<NavbarItem>
<NextLink className={navLinkClasses} color="foreground" href="#">
<FbFeedbackButton key="feedback" userEmail="" />
</NextLink>
</NavbarItem> */}
<NavbarItem>
<FbRoadmapLink className={navLinkClasses} />
</NavbarItem>
{/* <NavbarItem>
<Chip
as={NextLink}
className="hover:bg-default-100 border-default-200/80 dark:border-default-100/80 transition-colors cursor-pointer"
color="secondary"
href="/blog/v2.1.0"
href="/blog/v2.2.0"
variant="dot"
onClick={() => handlePressNavbarItem("Introducing v2.2.0", "/blog/v2.2.0")}
>
@@ -256,7 +265,7 @@ export const Navbar: FC<NavbarProps> = ({children, routes, mobileRoutes = [], sl
🚀
</span>
</Chip>
</NavbarItem>
</NavbarItem> */}
</ul>
</NavbarContent>
@@ -298,6 +307,21 @@ export const Navbar: FC<NavbarProps> = ({children, routes, mobileRoutes = [], sl
</NavbarContent>
<NavbarContent className="hidden sm:flex basis-1/5 sm:basis-full" justify="end">
<NavbarItem className="hidden sm:flex">
<Chip
as={NextLink}
className="bg-default-100/50 hover:bg-default-100 border-default-200/80 dark:border-default-100/80 transition-colors cursor-pointer"
color="default"
href="/blog/v2.4.0"
variant="dot"
onClick={() => handlePressNavbarItem("New version v2.4.0", "/blog/v2.4.0")}
>
New version v2.4.0&nbsp;
<span aria-label="emoji" role="img">
🚀
</span>
</Chip>
</NavbarItem>
<NavbarItem className="hidden sm:flex">
<Link
isExternal
@@ -329,7 +353,7 @@ export const Navbar: FC<NavbarProps> = ({children, routes, mobileRoutes = [], sl
<ThemeSwitch />
</NavbarItem>
<NavbarItem className="hidden lg:flex">{searchButton}</NavbarItem>
<NavbarItem className="hidden md:flex">
{/* <NavbarItem className="hidden md:flex">
<Button
isExternal
as={Link}
@@ -343,7 +367,7 @@ export const Navbar: FC<NavbarProps> = ({children, routes, mobileRoutes = [], sl
>
Sponsor
</Button>
</NavbarItem>
</NavbarItem> */}
<NavbarMenuToggle
aria-label={isMenuOpen ? "Close menu" : "Open menu"}
className="hidden sm:flex lg:hidden ml-4"
@@ -351,7 +375,12 @@ export const Navbar: FC<NavbarProps> = ({children, routes, mobileRoutes = [], sl
</NavbarContent>
<NavbarMenu>
<DocsSidebar className="mt-4" routes={[...mobileRoutes, ...routes]} slug={slug} tag={tag} />
<DocsSidebar
className="mt-4 pt-8"
routes={[...mobileRoutes, ...routes]}
slug={slug}
tag={tag}
/>
{children}
</NavbarMenu>
</NextUINavbar>
+1
View File
@@ -20,6 +20,7 @@ export const title = tv({
sm: "text-3xl lg:text-4xl",
md: "text-[2.5rem] lg:text-5xl",
lg: "text-4xl lg:text-6xl",
xl: "text-5xl md:text-6xl lg:text-7xl",
},
fullWidth: {
true: "w-full block",
+115
View File
@@ -0,0 +1,115 @@
"use client";
import {Icon} from "@iconify/react/dist/offline";
import arrowRightIcon from "@iconify/icons-solar/arrow-right-linear";
import {usePathname} from "next/navigation";
import {useEffect} from "react";
import {trackEvent} from "@/utils/va";
import emitter from "@/libs/emitter";
const hideOnPaths = ["examples"];
export const ProBanner = () => {
const handleClick = () => {
trackEvent("NextUI Pro Banner", {
action: "click",
category: "landing-page",
});
};
const pathname = usePathname();
const shouldBeVisible = !hideOnPaths.some((path) => pathname.includes(path));
useEffect(() => {
if (!shouldBeVisible) return;
// listen to scroll event, dispatch an event when scroll is at the top < 48 px
const handleScroll = () => {
if (window.scrollY < 48) {
emitter.emit("proBannerVisibilityChange", "visible");
} else {
emitter.emit("proBannerVisibilityChange", "hidden");
}
};
window.addEventListener("scroll", handleScroll);
return () => {
window.removeEventListener("scroll", handleScroll);
};
}, [shouldBeVisible]);
if (!shouldBeVisible) return null;
return (
<div className="relative z-50 isolate flex items-center gap-x-6 overflow-hidden bg-background border-b-1 border-divider px-6 py-2 sm:px-3.5 sm:before:flex-1">
<div
aria-hidden="true"
className="absolute left-[max(-7rem,calc(50%-52rem))] top-1/2 -z-10 -translate-y-1/2 transform-gpu blur-2xl"
>
<div
className="aspect-[577/310] w-[36.0625rem] bg-gradient-to-r from-[#ff80b5] to-[#9089fc] dark:from-[#F54180] dark:to-[#338EF7] opacity-20 dark:opacity-10"
style={{
clipPath:
"polygon(74.8% 41.9%, 97.2% 73.2%, 100% 34.9%, 92.5% 0.4%, 87.5% 0%, 75% 28.6%, 58.5% 54.6%, 50.1% 56.8%, 46.9% 44%, 48.3% 17.4%, 24.7% 53.9%, 0% 27.9%, 11.9% 74.2%, 24.9% 54.1%, 68.6% 100%, 74.8% 41.9%)",
}}
/>
</div>
<div
aria-hidden="true"
className="absolute left-[max(45rem,calc(50%+8rem))] top-1/2 -z-10 -translate-y-1/2 transform-gpu blur-2xl"
>
<div
className="aspect-[577/310] w-[36.0625rem] bg-gradient-to-r from-[#ff80b5] to-[#9089fc] dark:from-[#F54180] dark:to-[#338EF7] opacity-30 dark:opacity-20"
style={{
clipPath:
"polygon(74.8% 41.9%, 97.2% 73.2%, 100% 34.9%, 92.5% 0.4%, 87.5% 0%, 75% 28.6%, 58.5% 54.6%, 50.1% 56.8%, 46.9% 44%, 48.3% 17.4%, 24.7% 53.9%, 0% 27.9%, 11.9% 74.2%, 24.9% 54.1%, 68.6% 100%, 74.8% 41.9%)",
}}
/>
</div>
<div className="flex w-full items-center justify-between md:justify-center gap-x-3">
<a
className="text-small flex items-end sm:text-[0.93rem] text-foreground hover:opacity-80 transition-opacity"
href="https://nextui.pro?utm_source=nextui.org&utm_medium=top-banner"
rel="noopener noreferrer"
target="_blank"
onClick={handleClick}
>
<span aria-label="rocket" className="hidden md:block" role="img">
🚀
</span>
<span
className="inline-flex md:ml-1 animate-text-gradient font-medium bg-clip-text text-transparent bg-[linear-gradient(90deg,#D6009A_0%,#8a56cc_50%,#D6009A_100%)] dark:bg-[linear-gradient(90deg,#FFEBF9_0%,#8a56cc_50%,#FFEBF9_100%)]"
style={{
fontSize: "inherit",
backgroundSize: "200%",
backgroundClip: "text",
WebkitBackgroundClip: "text",
color: "transparent",
}}
>
Ship faster with beautiful components
</span>
</a>
<a
className="flex group min-w-[120px] items-center font-semibold text-foreground shadow-sm gap-1.5 relative overflow-hidden rounded-full p-[1px] focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary"
href="https://nextui.pro?utm_source=nextui.org&utm_medium=top-banner"
rel="noopener noreferrer"
onClick={handleClick}
>
<span className="absolute inset-[-1000%] animate-[spin_3s_linear_infinite] bg-[conic-gradient(from_90deg_at_50%_50%,#F54180_0%,#338EF7_50%,#F54180_100%)]" />
<div className="inline-flex h-full w-full cursor-pointer items-center justify-center rounded-full bg-background group-hover:bg-background/70 transition-background px-3 py-1 text-sm font-medium text-foreground backdrop-blur-3xl">
NextUI Pro
<Icon
aria-hidden="true"
className="outline-none transition-transform group-hover:translate-x-0.5 [&>path]:stroke-[2px]"
icon={arrowRightIcon}
width={16}
/>
</div>
</a>
</div>
</div>
);
};
@@ -5,7 +5,6 @@ import {capitalize, last} from "lodash";
import {BugIcon} from "@/components/icons";
import {ISSUE_REPORT_URL} from "@/libs/github/constants";
import {trackEvent} from "@/utils/va";
export const BugReportButton = () => {
const pathname = usePathname();
@@ -13,13 +12,6 @@ export const BugReportButton = () => {
const componentTitle = capitalize(last(pathname?.split("/")));
const handlePress = () => {
trackEvent("BugReportButton - Sandpack", {
name: "sandpack - bug report",
action: "press",
category: "docs",
data: `${ISSUE_REPORT_URL}${componentTitle}`,
});
window.open(`${ISSUE_REPORT_URL}${componentTitle}`, "_blank");
};
@@ -10,7 +10,6 @@ import {Language} from "prism-react-renderer";
import {HighlightedLines} from "./types";
import {Decorators} from "./types";
import {trackEvent} from "@/utils/va";
import {Codeblock} from "@/components/docs/components";
export interface CodeViewerProps {
@@ -84,13 +83,6 @@ export const SandpackCodeViewer = React.forwardRef<any, CodeViewerProps>(
const handleExpand = () => {
const nextIsExpanded = !isExpanded;
trackEvent("CodeViewer - Expand", {
name: activeFile,
action: "expand",
category: "docs",
data: nextIsExpanded ? "expanded" : "collapsed",
});
setIsExpanded(nextIsExpanded);
if (containerRef && containerRef?.current !== null) {
const container = containerRef?.current;
@@ -1,14 +1,10 @@
import React from "react";
import {UnstyledOpenInCodeSandboxButton} from "@codesandbox/sandpack-react";
import {Tooltip, Button} from "@nextui-org/react";
import {useSandpack} from "@codesandbox/sandpack-react";
import {CodeSandboxIcon} from "@/components/icons";
import {trackEvent} from "@/utils/va";
export const CodeSandboxButton = () => {
const {sandpack} = useSandpack();
return (
<Tooltip
className="text-xs px-2"
@@ -17,20 +13,7 @@ export const CodeSandboxButton = () => {
placement="top"
radius="md"
>
<Button
isIconOnly
as="span"
size="sm"
title="Open in CodeSandbox"
variant="light"
onPress={() => {
trackEvent("CodeSandboxButton - Sandpack", {
action: "press",
category: "docs",
data: sandpack.files[sandpack.activeFile],
});
}}
>
<Button isIconOnly as="span" size="sm" title="Open in CodeSandbox" variant="light">
<UnstyledOpenInCodeSandboxButton
style={{
width: "100%",
@@ -3,7 +3,6 @@ import {useSandpack} from "@codesandbox/sandpack-react";
import {Tooltip, Button} from "@nextui-org/react";
import {useClipboard} from "@nextui-org/use-clipboard";
import {trackEvent} from "@/utils/va";
import {CopyLinearIcon} from "@/components/icons";
export const CopyButton = () => {
@@ -15,13 +14,6 @@ export const CopyButton = () => {
const code = sandpack.files[sandpack.activeFile].code;
copy(code);
trackEvent("CopyButton - Sandpack", {
name: "sandpack - copy code",
action: "press",
category: "docs",
data: sandpack.activeFile,
});
};
return (
@@ -3,7 +3,6 @@ import {Tabs, Tab} from "@nextui-org/react";
import {SandpackPredefinedTemplate} from "@codesandbox/sandpack-react";
import {TypescriptIcon, JavascriptIcon} from "@/components/icons";
import {trackEvent} from "@/utils/va";
interface Props {
template: SandpackPredefinedTemplate;
@@ -21,12 +20,6 @@ export const LanguageSelector: React.FC<LanguageSelectorProps> = ({template, onC
setSelectedTemplate(newTemplate);
setTimeout(() => {
trackEvent("LanguageSelector - Selection", {
name: "template",
action: "tabChange",
category: "docs",
data: newTemplate ?? "",
});
onChange?.(newTemplate);
}, 250);
}, [template, onChange]);
@@ -1,13 +1,12 @@
import {useMemo} from "react";
import {SandpackFiles, SandpackPredefinedTemplate} from "@codesandbox/sandpack-react";
import {useTheme} from "next-themes";
import {useLocalStorage} from "usehooks-ts";
import {HighlightedLines} from "./types";
import {getHighlightedLines, getFileName} from "./utils";
import {stylesConfig, postcssConfig, tailwindConfig, getHtmlFile, rootFile} from "./entries";
import {useLocalStorage} from "@/hooks/use-local-storage";
export interface UseSandpackProps {
files?: SandpackFiles;
typescriptStrict?: boolean;
@@ -71,7 +70,7 @@ export const useSandpack = ({
}, {});
let dependencies = {
"framer-motion": "10.12.16",
"framer-motion": "11.0.22",
"@nextui-org/react": "latest",
};
@@ -140,7 +139,7 @@ export const useSandpack = ({
// const dependencies = useMemo(() => {
// let deps = {
// "framer-motion": "10.12.16",
// "framer-motion": "11.0.22",
// };
// if (hasComponents) {
@@ -0,0 +1,29 @@
import * as React from "react";
import {Analytics} from "@vercel/analytics/react";
import Script from "next/script";
import {__PROD__} from "@/utils";
export function ScriptProviders() {
return (
<>
<Script
id="featurebase-sdk"
src="https://do.featurebase.app/js/sdk.js"
strategy={"beforeInteractive"}
/>
<Script
defer
data-modal-disclaimer="This is a custom LLM for NextUI with access to all developer docs (nextui.org/docs) and GitHub Issues and PRs (github.com/nextui-org/nextui)."
data-modal-example-questions="How do I install for Next.js?,How do I customize primary color?"
data-project-color="#000000"
data-project-logo="https://avatars.githubusercontent.com/u/86160567?s=280&v=4"
data-project-name="NextUI"
data-website-id="e733a73f-980e-4f7d-9e8b-91867453f899"
src="https://widget.kapa.ai/kapa-widget.bundle.js"
strategy="afterInteractive"
/>
{__PROD__ && <Analytics />}
</>
);
}
+101 -29
View File
@@ -18,6 +18,13 @@
"keywords": "getting started, installation, start, nextui",
"path": "/docs/guide/installation.mdx"
},
{
"key": "cli",
"title": "CLI",
"keywords": "cli, command line interface",
"path": "/docs/guide/cli.mdx",
"newPost": true
},
{
"key": "design-principles",
"title": "Design Principles",
@@ -28,8 +35,7 @@
"key": "routing",
"title": "Routing",
"keywords": "client side routing, routing, browser routing, nextui, next.js router, react router, remix router",
"path": "/docs/guide/routing.mdx",
"newPost": true
"path": "/docs/guide/routing.mdx"
},
{
"key": "upgrade-to-v2",
@@ -85,7 +91,8 @@
{
"key": "layout",
"title": "Layout",
"path": "/docs/customization/layout.mdx"
"path": "/docs/customization/layout.mdx",
"updated": true
},
{
"key": "colors",
@@ -141,14 +148,14 @@
"key": "autocomplete",
"title": "Autocomplete",
"keywords": "autocomplete, auto suggest, search, typeahead",
"path": "/docs/components/autocomplete.mdx",
"newPost": true
"path": "/docs/components/autocomplete.mdx"
},
{
"key": "badge",
"title": "Badge",
"keywords": "badge, markers, status indication, count display",
"path": "/docs/components/badge.mdx"
"path": "/docs/components/badge.mdx",
"updated": true
},
{
"key": "button",
@@ -160,8 +167,7 @@
"key": "breadcrumbs",
"title": "Breadcrumbs",
"keywords": "breadcrumbs, navigation, path, trail, location",
"path": "/docs/components/breadcrumbs.mdx",
"newPost": true
"path": "/docs/components/breadcrumbs.mdx"
},
{
"key": "card",
@@ -187,6 +193,32 @@
"keywords": "chip, tag, label, small actionable entity",
"path": "/docs/components/chip.mdx"
},
{
"key": "code",
"title": "Code",
"keywords": "code, code snippet, inline code, coding",
"path": "/docs/components/code.mdx"
},
{
"key": "input",
"title": "Input",
"keywords": "input, text box, form field, data entry",
"path": "/docs/components/input.mdx"
},
{
"key": "date-input",
"title": "Date Input",
"keywords": "date-input, time, input, timezone",
"path": "/docs/components/date-input.mdx",
"newPost": true
},
{
"key": "time-input",
"title": "Time Input",
"keywords": "timeinput, time, input, timezone",
"path": "/docs/components/time-input.mdx",
"newPost": true
},
{
"key": "circular-progress",
"title": "Circular Progress",
@@ -194,10 +226,32 @@
"path": "/docs/components/circular-progress.mdx"
},
{
"key": "code",
"title": "Code",
"keywords": "code, code snippet, inline code, coding",
"path": "/docs/components/code.mdx"
"key": "calendar",
"title": "Calendar",
"keywords": "calendar, date picker, month picker, year picker",
"path": "/docs/components/calendar.mdx",
"newPost": true
},
{
"key": "range-calendar",
"title": "Range Calendar",
"keywords": "range calendar, date picker, month picker, year picker",
"path": "/docs/components/range-calendar.mdx",
"newPost": true
},
{
"key": "date-picker",
"title": "Date Picker",
"keywords": "date-picker, time, input, timezone",
"path": "/docs/components/date-picker.mdx",
"newPost": true
},
{
"key": "date-range-picker",
"title": "Date Range Picker",
"keywords": "date-range-picker, date-picker, time, input, timezone",
"path": "/docs/components/date-range-picker.mdx",
"newPost": true
},
{
"key": "divider",
@@ -209,8 +263,7 @@
"key": "dropdown",
"title": "Dropdown",
"keywords": "dropdown, menu, selection, option list",
"path": "/docs/components/dropdown.mdx",
"updated": true
"path": "/docs/components/dropdown.mdx"
},
{
"key": "image",
@@ -218,12 +271,6 @@
"keywords": "image, media, picture, photo, graphic display",
"path": "/docs/components/image.mdx"
},
{
"key": "input",
"title": "Input",
"keywords": "input, text box, form field, data entry",
"path": "/docs/components/input.mdx"
},
{
"key": "kbd",
"title": "Kbd",
@@ -234,15 +281,13 @@
"key": "link",
"title": "Link",
"keywords": "link, navigation, href, web page connection",
"path": "/docs/components/link.mdx",
"updated": true
"path": "/docs/components/link.mdx"
},
{
"key": "listbox",
"title": "Listbox",
"keywords": "listbox, selection, option list, multiple choice",
"path": "/docs/components/listbox.mdx",
"updated": true
"path": "/docs/components/listbox.mdx"
},
{
"key": "modal",
@@ -290,7 +335,8 @@
"key": "skeleton",
"title": "Skeleton",
"keywords": "skeleton, loading state, placeholder, content preview",
"path": "/docs/components/skeleton.mdx"
"path": "/docs/components/skeleton.mdx",
"updated": true
},
{
"key": "snippet",
@@ -326,8 +372,7 @@
"key": "slider",
"title": "Slider",
"keywords": "slider, range input, value selector, sliding control",
"path": "/docs/components/slider.mdx",
"newPost": true
"path": "/docs/components/slider.mdx"
},
{
"key": "table",
@@ -346,8 +391,7 @@
"key": "textarea",
"title": "Textarea",
"keywords": "textarea, multi-line text input, large text field, form control",
"path": "/docs/components/textarea.mdx",
"updated": true
"path": "/docs/components/textarea.mdx"
},
{
"key": "tooltip",
@@ -362,6 +406,28 @@
"path": "/docs/components/user.mdx"
}
]
},
{
"key": "api-references",
"title": "API References",
"defaultOpen": true,
"keywords": "api references, nextui, api",
"routes": [
{
"key": "cli-api",
"title": "NextUI CLI",
"keywords": "api references, nextui, api, cli",
"path": "/docs/api-references/cli-api.mdx",
"updated": true
},
{
"key": "nextui-provider",
"title": "NextUI Provider",
"keywords": "api references, nextui, api, nextui provider",
"path": "/docs/api-references/nextui-provider.mdx",
"updated": true
}
]
}
],
"mobileRoutes": [
@@ -394,6 +460,12 @@
"title": "Figma",
"keywords": "figma, nextui, design, ui kit",
"path": "/figma"
},
{
"key": "roadmap",
"title": "Roadmap",
"keywords": "roadmap, nextui",
"path": "#"
}
]
}
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -322,4 +322,4 @@ Whether it's a feature request, bug report, or a project to showcase, please get
## Contributing
PR's on NextUI are always welcome, please see our [contribution guidelines](https://github.com/nextui-org/nextui/blob/main/CONTRIBUTING.MD) to learn how you can contribute to this project.
PR's on NextUI are always welcome, please see our [contribution guidelines](https://github.com/nextui-org/nextui/blob/main/CONTRIBUTING.md) to learn how you can contribute to this project.
+1 -1
View File
@@ -164,4 +164,4 @@ Whether it's a feature request, bug report, or a project to showcase, please get
## Contributing
PR's on NextUI are always welcome, please see our [contribution guidelines](https://github.com/nextui-org/nextui/blob/main/CONTRIBUTING.MD) to learn how you can contribute to this project.
PR's on NextUI are always welcome, please see our [contribution guidelines](https://github.com/nextui-org/nextui/blob/main/CONTRIBUTING.md) to learn how you can contribute to this project.
+364 -88
View File
@@ -1,6 +1,6 @@
---
title: "Introducing v2.2.0 🚀"
description: "NextUI v2.2.0 is here with Client side router support, 3 new components including the Autocomplete, and more."
description: "NextUI v2.2.0 is here! Dive into client-side router support, discover 3 new components including the Autocomplete, and more."
date: "2023-11-03"
image: "/blog/v2.2.0.jpg"
tags: ["nextui", "autocomplete", "breadcrumbs", "client side router", "slider"]
@@ -11,143 +11,419 @@ author:
avatar: "/avatars/junior-garcia.jpeg"
---
import {selectContent} from "@/content/components/select";
import {listboxContent} from "@/content/components/listbox";
import {scrollShadowContent} from "@/content/components/scroll-shadow";
import {autocompleteContent} from "@/content/components/autocomplete";
import {sliderContent} from "@/content/components/slider";
import {breadcrumbsContent} from "@/content/components/breadcrumbs";
<img
src="/blog/v2.1.0.jpg"
src="/blog/v2.2.0_2x.jpg"
width={700}
height={350}
alt="NextUI v2"
alt="NextUI v2.2.0"
className="w-full border border-transparent dark:border-default-200/50 object-fit rounded-xl shadow-lg"
/>
We are thrilled to announce the latest update to NextUI, version **2.1.0**! This release introduces some game-changing
additions that many of you have eagerly been waiting for.
We are excited to announce the latest update to NextUI, version **2.2.0**! This release introduces 3 new components,
support for client-side routing, and more.
First on the list is the highly-anticipated **Select** component. Fully customizable and beautifully designed, supports both single and
multi-select modes and is accessible out of the box.
## What's New in v2.2.0?
But that's not all. We're also rolling out two more incredible components **Listbox** and **ScrollShadow**. The new
**Listbox** allows you to make list manipulations more efficient and visually appealing. Meanwhile, the
**ScrollShadow** component adds an elegant shadow effect to scrollable areas, enhancing the UI aesthetics while
also improving usability.
- [Client Side Routing](#client-side-routing) - Allows you to seamlessly incorporate client-side routers.
- [Autocomplete](/docs/components/autocomplete) - Combines a text input with a listbox, allowing users to filter a list of options.
- [Slider](/docs/components/slider) - Allows users to make selections from a range of values.
- [Breadcrumbs](/docs/components/breadcrumbs) - Displays a hierarchy of links to the current page or resource in an application.
- [Other Changes](#other-changes) - Includes styling improvements, accessibility and usability enhancements.
## Select
<Spacer y={4} />
Creating a select component that is both accessible and customizable is a challenging task. We've spent a lot of time
## Client Side Routing
By default, links perform native browser navigation when they are interacted with. However, many apps and
frameworks use client side routers to avoid a full page reload when navigating between pages.
NextUI now natively supports client-side routing in components such as [Link](/docs/components/link), [Tabs](/docs/components/tabs),
[Breadcrumbs](/docs/components/breadcrumbs), [Listbox](/docs/components/listbox), [Dropdown](/docs/components/dropdown) and many others offering
the flexibility to be rendered as HTML links, allowing you to seamlessly incorporate client-side routers. See the [Routing](/docs/guide/routing) guide to
learn how it set it up in your app.
The `NextUIProvider` component configures all NextUI components within it to navigate using the
client side router you provide.
> **Note**: Client side routing is based on [React Aria Routing](https://react-spectrum.adobe.com/react-aria/routing.html).
### Next.js Example
- App Router
Go to your `app/providers.tsx` or `app/providers.jsx` (create it if it doesn't exist) and add the
`useRouter` hook from `next/navigation`, it returns a router object that can be used to perform navigation.
```tsx
// app/providers.tsx
"use client";
import {NextUIProvider} from "@nextui-org/react";
export function Providers({children}: {children: React.ReactNode}) {
const router = useRouter();
return <NextUIProvider navigate={router.push}>{children}</NextUIProvider>;
}
```
- Pages Router
Go to pages`/_app.js` or `pages/_app.tsx` (create it if it doesn't exist) and add the`useRouter` hook
from `next/router`, it returns a router object that can be used to perform navigation.
```tsx
// pages/_app.tsx
import type {AppProps} from "next/app";
import {useRouter} from "next/router";
import {NextUIProvider} from "@nextui-org/react";
function MyApp({Component, pageProps}: AppProps) {
const router = useRouter();
return (
<NextUIProvider navigate={router.push}>
<Component {...pageProps} />
</NextUIProvider>
);
}
export default MyApp;
```
- Usage
Now that you have set up the `NextUIProvider` in your app, you can use the `href` prop in the `Tabs`,
`Listbox` and `Dropdown` items to navigate between pages.
The [Link](/docs/components/link) component will also use the `navigate` function from the
`NextUIProvider` to navigate between pages.
```jsx
import {
Tabs,
Tab,
Listbox,
ListboxItem,
Dropdown,
DropdownTrigger,
DropdownMenu,
DropdownItem,
Button,
Link,
} from "@nextui-org/react";
function App() {
return (
<>
<Tabs aria-label="Navigation">
<Tab key="home" href="/home">
Home
</Tab>
<Tab key="about" href="/about">
About
</Tab>
</Tabs>
<Listbox aria-label="Navigation">
<ListboxItem key="home" href="/home">
Home
</ListboxItem>
<ListboxItem key="about" href="/about">
About
</ListboxItem>
</Listbox>
<Dropdown>
<DropdownTrigger>
<Button>Open</Button>
</DropdownTrigger>
<DropdownMenu aria-label="Navigation">
<DropdownItem key="home" href="/home">
Home
</DropdownItem>
<DropdownItem key="about" href="/about">
About
</DropdownItem>
</DropdownMenu>
</Dropdown>
<Link href="/home">Home</Link>
<Link href="/about">About</Link>
</>
);
}
```
<Spacer y={4} />
## Autocomplete
Creating an autocomplete component that is both accessible and customizable is a challenging task. We've spent a lot of time
researching and testing different approaches to come up with a solution that works for everyone. The result is a
component that is easy to use, fully accessible, and highly customizable.
The new **Select** component includes:
The new **Autocomplete** component includes:
- Support for selecting a single option.
- Support for selecting multiple options.
- Support for disabled options.
- Support for sections.
- Labeling support for accessibility.
- Exposed to assistive technology as a button with a listbox popup using ARIA (combined with [Listbox](/docs/components/listbox)).
- Support for groups of items in sections.
- Support for filtering a list of options by typing.
- Support for controlled and uncontrolled options, selection and input value.
- Support for custom filter functions.
- Async loading and infinite scrolling support.
- Required and invalid states exposed to assistive technology via ARIA.
- Support for description and error message help text linked to the input via ARIA.
- Support for mouse, touch, and keyboard interactions.
- Tab stop focus management.
- Asynchronous options loading.
- Keyboard support for opening the listbox using the arrow keys, including automatically focusing the first or last item accordingly.
- Typeahead to allow selecting options by typing text, even without opening the listbox.
- Browser autofill integration via a hidden native `<select>` element.
- Support for mobile form navigation via software keyboard.
- Mobile screen reader listbox dismissal support.
- And much more...
### Single Select
We recommend to read this [Blog post](https://react-spectrum.adobe.com/blog/building-a-combobox.html) from [react-aria](https://react-spectrum.adobe.com/react-aria) team to learn more
about the Autocomplete component.
The single select component is used to select a single option from a list of options. It is a combination of a button
and a listbox. The button displays the currently selected option and the listbox displays the available options.
### Usage
<CodeDemo title="Usage" files={selectContent.usage} />
<CodeDemo title="Usage" files={autocompleteContent.usage} />
### Multiple Select
### Custom Items
The multiple select component can be used to select multiple options from a list of options.
You only need to pass the `selectionMode="multiple"` prop to the `Select` component.
<CodeDemo title="Multiple Selection" files={selectContent.multiple} />
### Multiple Variants
The select component comes with multiple variants.
<CodeDemo title="Variants" files={selectContent.variants} />
### Chips Support
The select component is flexible and allows you to render any component as an option and as a selected option.
<CodeDemo title="Multiple Selection with Chips" files={selectContent.multipleWithChips} />
You can customize the autocomplete items by modifying the `AutocompleteItem` children.
<CodeDemo title="Custom Items" files={autocompleteContent.customItems} />
### Customizable
The select component is highly customizable, you can customize the selected option, the options, the listbox,
the popover and the scrollable area.
The autocomplete component is highly customizable, you can customize the popover, listbox and
input components.
<CodeDemo title="Custom Styles" files={selectContent.customStyles} />
<CodeDemo title="Custom Styles" files={autocompleteContent.customStyles} />
Go to the [Autocomplete](/docs/components/autocomplete) component page to learn more about it.
Go to the [Select](/docs/components/select) component page to learn more about sizes, colors, and more.
<Spacer y={4} />
## Slider
## Listbox
The listbox component allows you to make list manipulations more efficient and visually appealing.
The new **Listbox** component includes:
- Support for single, multiple, or no selection.
- Exposed to assistive technology as a `listbox` using ARIA.
- Support for disabled items.
- Support for sections.
- Labeling support for accessibility.
- Support for mouse, touch, and keyboard interactions.
- Tab stop focus management.
- Keyboard navigation support including arrow keys, home/end, page up/down, select all, and clear.
- Automatic scrolling support during keyboard navigation.
- Typeahead to allow focusing options by typing text.
The **Slider** component allows users to make selections from a range of values. It is a great way to allow users to
select a value from a fixed range, such as volume or temperature, or to select a value from a range that changes
frequently, such as stock prices or budgets.
### Usage
<CodeDemo title="Usage" files={listboxContent.usage} />
<CodeDemo title="Usage" files={sliderContent.usage} />
### Custom Styles
### Range Support
The Listbox components offers multiple customization options.
If you pass an array of values to the `value` prop or to the `defaultValue` prop, the slider will become a range slider.
<CodeDemo title="Custom Styles" files={listboxContent.customStyles} />
<CodeDemo title="Range Slider" files={sliderContent.range} />
> **Note**: In the above example, we've utilized the [Boxicons](https://boxicons.com/) icons collection.
### With Tooltip
Go to the [Listbox](/docs/components/listbox) component page to learn more about it.
The slider component also supports a tooltip to display the current value.
<CodeDemo title="With Tooltip" files={sliderContent.tooltip} />
## ScrollShadow
### Slider steps
The ScrollShadow component gives a nice shadow effect to scrollable areas. These shadows are handled by using
the CSS `mask-image` property, which makes the shadows adapt to the background color.
You can use the `showSteps` prop to display small dots on each step.
<CodeDemo title="With Visible Steps" files={sliderContent.visibleSteps} />
### Slider Custom Styles
You can customize the `Slider` component by passing custom Tailwind CSS classes to the component slots.
<CodeDemo title="Custom Styles" files={sliderContent.customStyles} />
Go to the [Slider](/docs/components/slider) component page to learn more about it.
<Spacer y={4} />
## Breadcrumbs
The **Breadcrumbs** is an essential component for navigating hierarchical content. It displays a hierarchy of links to the
current page or resource in an application.
### Usage
<CodeDemo title="Usage" files={scrollShadowContent.usage} />
<CodeDemo title="Usage" files={breadcrumbsContent.usage} />
You can hide the scrollbars, customize the shadows size, change the orientation, and more.
### Breadcrumbs as menu
Go to the [ScrollShadow](/docs/components/scroll-shadow) component page to learn more about it.
It is possible to use the `Breadcrumbs` component as a horizontal menu. This is useful when you want to display a list
of possible navigations and let the user choose one of them.
<CodeDemo title="Menu Type" files={breadcrumbsContent.menuType} />
<Spacer y={6}/>
### Start & End Content support
You can add any element to the start or end of the breadcrumbs by using the `startContent` and `endContent` props. The
above example uses the `startContent` prop to add icons to the start of the breadcrumbs.
<CodeDemo title="Start & End Content" files={breadcrumbsContent.startEndContent} />
### Collapsing Items support
The `Breadcrumbs` component supports collapsing items, it is useful when you have a lot of items and you want to
collapse them into a dropdown menu.
<CodeDemo title="Customizing the Ellipsis Item" files={breadcrumbsContent.customizingEllipsis} />
### Applying custom styles
You can customize the `Breadcrumbs` component by passing custom Tailwind CSS classes to the component slots.
<CodeDemo title="Custom Styles" files={breadcrumbsContent.customStyles} />
<Spacer y={4} />
Go to the [Breadcrumbs](/docs/components/breadcrumbs) component page to learn more about it.
## Other Changes
- Styling Improvements:
- Transitioned spacing units from pixels (px) to rem units to optimize mobile component sizing.
- Introduced a new `shouldSelectOnPressUp` property for `Tabs/Tab` with a default value of true, allowing tab selection on press-up instead of press-down.
- Updated Chip component's font size to text-tiny for the sm size variant.
- Enhanced the Button component to display only the spinner during loading when it contains an icon.
- Accessibility and Usability Enhancements:
- Resolved Popover component's open state issues for blur/opaque backdrops.
- Enhanced the ScrollShadow API, introducing visibility and onVisibilityChange properties to manage shadow visibility.
- Added `emptyContent`, `topContent`, and `bottomContent` properties to Listbox/Menu/Dropdown for customized content rendering.
- Introduced baseRef to the Input component, allowing control over the parent element's reference.
- Upgraded tailwind-variants to version `0.1.18`, incorporating slot props control.
- Right-to-Left (RTL) Support:
- Implemented RTL support for Accordion,
- Implemented RTL support for Accordion Avatar & AvatarGroup components,
- Implemented RTL support for ButtonGroup.
- Custom Implementations and Fixes:
- Implemented a custom `usePress` hook to address the corner press issue, with a corresponding pull request and issue submitted to the react-aria project.
- Applied the custom `usePress` across all NextUI interactive components for consistent behavior.
- Improved animations and positioning for Input & Select labels.
- Upgraded `react-aria` packages and `framer-motion` for enhanced performance.
- Enhanced TypeScript support for generic items in Menu and DropdownMenu.
- Streamlined package dependencies to exclude globally or individually installed packages, reducing bundle sizes.
- Visual and Interactive Tweaks:
- Removed the outline on Input focus-visible for a cleaner aesthetic.
- Fixed the radius property issue in `ButtonGroup`.
- Introduced the `isActive` prop for `NavbarMenuItem` for active state management.
- Corrected the Pagination custom-items example by adding the key prop.
- Enabled Collection Items support within the `extendVariants` function.
- Added transitions to menu/listbox items for smoother interaction.
- Added a `disableAutosize` property to `Textarea` to control auto-resizing.
- Resolved styling issues in Textarea and animated height adjustments for a fluid user experience.
- Included a `hoverOpacity` key in the themes object within the plugin for customized hover effects.
- Implemented a hover effect for the Button component to enhance user interaction feedback.
- The padding of the CardBody has been updated from `p-5` to `p-3` for consistency with the padding of other Card elements.
<Spacer y={4} />
## Breaking Changes
Unfortunately, we had to make some small styles breaking changes in this release to improve the [Popover](/docs/components/popover) arrow
dynamic positioning. Instead of having a specific slot for the popover arrow, we now use the `before` pseudo element, this allows the
popover to also move the arrow altogether.
This change impacts the Popover, Dropdown, Tooltip and Select implementations.
Popover changes:
```diff-jsx
<Popover
showArrow
backdrop="opaque"
placement="right"
classNames={{
- base: "py-3 px-4 border border-default-200 bg-gradient-to-br from-white to-default-300 dark:from-default-100 dark:to-default-50",
- arrow: "bg-default-200",
+ base: [
+ // the "before" pseudo element is now the popover' arrow
+ "before:bg-default-200"
+ ],
+ content: [ // now we need to use the "content" slot to actually modify the popover' content styles
+ "py-3 px-4 border border-default-200",
+ "bg-gradient-to-br from-white to-default-300",
+ "dark:from-default-100 dark:to-default-50",
],
}}
>
...
</Popover>
```
Tooltip changes:
```diff-jsx
<Tooltip
showArrow
placement="right"
content="I am a tooltip"
classNames={{
- base: "py-2 px-4 shadow-xl text-black bg-gradient-to-br from-white to-neutral-400",
- arrow: "bg-neutral-400 dark:bg-white",
+ base: [
+ // the "before" pseudo element is now the popover' arrow
+ "before:bg-neutral-400 dark:before:bg-white",
+ ],
+ content: [ // now we need to use the "content" slot to actually modify the popover' content styles
+ "py-2 px-4 shadow-xl",
+ "text-black bg-gradient-to-br from-white to-neutral-400",
+ ],
}}
>
<Button variant="flat">Hover me</Button>
</Tooltip>
```
Select changes:
```diff-jsx
<Select
items={users}
label="Assigned to"
className="max-w-xs"
variant="bordered"
popoverProps={{
classNames: {
- base: "p-0 border-small border-divider bg-background",
- arrow: "bg-default-200",
+ base: "before:bg-default-200", // the before pseudo element controls the popover's arrow
+ content: "p-0 border-small border-divider bg-background", // now instead of the "base" slot we use the "content" slot
},
}}
>
...
</Select>
);
}`;
```
Dropdown Changes
```diff-jsx
<Dropdown
showArrow
classNames={{
- base: "py-1 px-1 border border-default-200 bg-gradient-to-br from-white to-default-200 dark:from-default-50 dark:to-black",
- arrow: "bg-default-200",
+ content: "py-1 px-1 border border-default-200 bg-gradient-to-br from-white to-default-200 dark:from-default-50 dark:to-black", // now instead of the "base" slot we use the "content"
+ base: "before:bg-default-200", // the before pseudo element controls the popover's arrow
}}
>
...
</Dropdown>
```
<Spacer y={6} />
We hope you enjoy these new components and the new features. We're excited to see what you build with them!
@@ -164,4 +440,4 @@ Whether it's a feature request, bug report, or a project to showcase, please get
## Contributing
PR's on NextUI are always welcome, please see our [contribution guidelines](https://github.com/nextui-org/nextui/blob/main/CONTRIBUTING.MD) to learn how you can contribute to this project.
PR's on NextUI are always welcome, please see our [contribution guidelines](https://github.com/nextui-org/nextui/blob/main/CONTRIBUTING.md) to learn how you can contribute to this project.
+428
View File
@@ -0,0 +1,428 @@
---
title: "Introducing v2.3.0 🎉"
description: "NextUI v2.3.0 is here! includes six new components, NextUI CLI, bug fixes, React Aria, and a TailwindCSS upgrade, among other enhancements."
date: "2024-04-16"
image: "/blog/v2.3.0.jpg"
tags: ["nextui", "cli", "date picker", "time input", "date input", "calendar"]
author:
name: "Junior Garcia"
username: "@jrgarciadev"
link: "https://twitter.com/jrgarciadev"
avatar: "/avatars/junior-garcia.jpeg"
---
import {dateInputContent} from "@/content/components/date-input";
import {timeInputContent} from "@/content/components/time-input";
import {calendarContent} from "@/content/components/calendar";
import {rangeCalendarContent} from "@/content/components/range-calendar";
import {datePickerContent} from "@/content/components/date-picker";
import {dateRangePickerContent} from "@/content/components/date-range-picker";
<img
src="/blog/v2.3.0_2x.jpg"
width={700}
height={350}
alt="NextUI v2.3.0"
className="w-full border border-transparent dark:border-default-200/50 object-fit rounded-xl shadow-lg"
/>
We are excited to announce the latest update to NextUI, version **2.3.0**! This release introduces 6 new components,
our new CLI, and several enhancements and bug fixes.
## What's New in v2.3.0?
- [NextUI CLI](/docs/guide/cli) - A command-line interface for creating and managing NextUI projects.
- [DateInput](/docs/components/date-input) - Allows users to enter and edit date and time values using a keyboard.
- [TimeInput](/docs/components/time-input) - Allows users to enter and edit time values using a keyboard.
- [Calendar](/docs/components/calendar) - Displays a calendar for selecting dates and times.
- [RangeCalendar](/docs/components/range-calendar) - Displays a calendar for selecting date ranges.
- [DatePicker](/docs/components/date-picker) - Allows users to select a date from a calendar.
- [DateRangePicker](/docs/components/date-range-picker) - Allows users to select a date range from a calendar.
- [Other Changes](#other-changes) - Includes styling improvements, accessibility and usability enhancements.
<Spacer y={4} />
Requirements:
- [Tailwind CSS 3.4](https://tailwindcss.com/) or later
Upgrade today by running one of the following commands:
<Spacer y={4} />
<PackageManagers
commands={{
cli: "nextui upgrade",
npm: "npx nextui-cli@latest upgrade",
}}
/>
<Spacer y={4} />
## NextUI CLI
We are thrilled to introduce the [NextUI CLI](https://github.com/nextui-org/nextui-cli), a command-line interface, It offers a comprehensive suite
of commands to initialize, manage, and improve your NextUI projects. It enables you to `add`, `remove`, or
`upgrade` individual components, assess the health of your project, and more.
### Installation
To install the CLI globally, execute one of the following commands in your terminal:
<PackageManagers
commands={{
npm: "npm install nextui-cli -g",
yarn: "yarn add nextui-cli -g",
pnpm: "pnpm add nextui-cli -g",
bun: "bun add nextui-cli -g",
}}
/>
Alternatively, you can use the CLI without a global installation by employing `npx`:
```bash
npx nextui-cli@latest
```
### Usage
Once the CLI is installed, run the following command to display available commands:
```bash
nextui
```
NextUI CLI can help you create new projects, add components, upgrade components, remove components, detect issues in
you setup, know your environment, and more.
<Spacer y={4} />
To initialize a new project, you can simply run:
```bash
nextui init my-nextui-app
```
<Spacer y={4} />
You will be prompted to configure your project:
```codeBlock bash
? Select a template - Use arrow-keys. Return to submit.
App
A Next.js 13 with app directory template pre-configured with NextUI (v2) and Tailwind CSS.
Pages
A Next.js 13 with pages directory template pre-configured with NextUI (v2) and Tailwind CSS.
```
Select the template you want to use and the CLI will create a new project for you.
> We're working on adding more templates to the CLI, so stay tuned for updates!
<Spacer y={4} />
If you already have a NextUI project, you can add components to it using the `add` command:
```bash
nextui add date-input
```
It will automatically detect the required dependencies, modify your `tailwind.config.(js|ts)` file,
detect whether using `pnpm` if so, add the required configuration to your `.npmrc` file and add the component to your project.
If instead of installing a single component you want to install multiple components, you can do so by separating them with a space:
```bash
nextui add date-input time-input calendar
```
You can alternatively install the `main` package which includes all the components by passing the `--all` flag:
```bash
nextui add --all
```
<Spacer y={4} />
> The CLI is currentl in `Alpha` stage, we're working on adding more features and improvements. If you find any issues or have any suggestions, please let us know by [opening an issue](https://github.com/nextui-org/nextui-cli/issues/new).
To learn more about the CLI and its commands, please refer to the [CLI documentation](/docs/guide/cli) and the [CLI API reference](/docs/api-references/cli-api).
## New Components
Since the beginning of NextUI, devs have been asking for date and time input components. After
months of iteration and development, we are excited to introduce the following new components:
### DateInput
DateInput is a component that allows users to enter and edit date and time values using a keyboard.
Each part of a date value is displayed in an individually editable segment.
<CodeDemo title="Usage" files={dateInputContent.usage} />
Go to the [DateInput documentation](/docs/components/date-input) to learn more about the component.
### TimeInput
The `TimeInput` component consists of a label, and a group of segments representing each unit of a time (e.g. hours, minutes, and seconds). Each segment is individually focusable and editable by the user, by typing or using the arrow keys to increment and decrement the value. This approach allows values to be formatted and parsed correctly regardless of the locale or time format, and offers an easy and error-free way to edit times using the keyboard.
<CodeDemo title="Usage" files={timeInputContent.usage} />
Go to the [TimeInput documentation](/docs/components/time-input) to learn more about the component.
### Calendar
A Calendar consists of a grouping element containing one or more date grids (e.g. months), and a previous and next button for navigating between date ranges. Each calendar grid consists of cells containing button elements that can be pressed and navigated to using the arrow keys to select a date.
<CodeDemo title="Usage" files={calendarContent.usage} />
The calendar also supports selecting years and months for rapid selection.
<CodeDemo title="With Month And Year Picker" files={calendarContent.withMonthAndYearPicker} />
Go to the [Calendar documentation](/docs/components/calendar) to learn more about the component.
### RangeCalendar
A Range calendar consists of a grouping element containing one or more date grids (e.g. months), and a previous and next button for navigating through time. Each calendar grid consists of cells containing button elements that can be pressed and navigated to using the arrow keys to select a date range. Once a start date is selected, the user can navigate to another date using the keyboard or by hovering over it, and clicking it or pressing the Enter key commits the selected date range.
<CodeDemo title="Usage" files={rangeCalendarContent.usage} />
Go to the [RangeCalendar documentation](/docs/components/range-calendar) to learn more about the component.
### DatePicker
A Date Picker combines a DateInput and a Calendar popover to allow users to enter or select a date and time value.
<CodeDemo title="Usage" files={datePickerContent.usage} />
Go to the [DatePicker documentation](/docs/components/date-picker) to learn more about the component.
### DateRangePicker
Date Range Picker combines two DateInputs and a RangeCalendar popover to allow users to enter or select a date and time range.
<CodeDemo title="Usage" files={dateRangePickerContent.usage} />
Go to the [DateRangePicker documentation](/docs/components/date-range-picker) to learn more about the component.
### Calendar Presets
`Calendar` and `RangeCalendar` components support adding custom content at the top and bottom of the calendar, this is useful for adding presets or
custom actions to the calendar.
Here's an example of how to add presets to the `Calendar` component:
<CodeDemo title="Calendar Presets" files={calendarContent.presets} />
### Internationalization
These new components have built-in internationalization, time zones and granularity support, they supports selecting dates
in many calendar systems used around the world, including `Gregorian`, `Hebrew`, `Indian`, `Islamic`, `Buddhist`, and more.
Dates are automatically displayed in the appropriate calendar system for the user's locale this is possible thanks to [@internationalized/date](https://react-spectrum.adobe.com/internationalized/date/) package, which
includes functions for parsing strings in multiple formats into `ZonedDateTime` objects.
Here's and example using the `Indian` calendar system:
<CodeDemo title="International Calendar" files={datePickerContent.internationalCalendar} />
Alternatively you can set the `locale` globally by using the `NextUIProvider` component:
```jsx
// Next.js App Router example
"use client";
import {NextUIProvider} from "@nextui-org/react";
export interface ProvidersProps {
children: React.ReactNode;
}
export function Providers({children}: ProvidersProps) {
const router = useRouter();
return <NextUIProvider locale="hi-IN-u-ca-indian">{children}</NextUIProvider>;
}
```
If no `locale` is provided, it will extract the locale from the browser.
### NextUI Provider
The `NextUIProvider` component was updated to include the `createCalendar` function, which allows you to create a calendar instance with the specified locale and time zone,
and the `defaultDates` object which allows you to set global minimum and maximum dates for the components.
```jsx
// Next.js App Router example
"use client";
import {NextUIProvider, SupportedCalendars} from "@nextui-org/react";
import {CalendarDate, GregorianCalendar} from "@internationalized/date";
export interface ProvidersProps {
children: React.ReactNode;
}
function createCalendar(identifier: SupportedCalendars) {
switch (identifier) {
case "gregory":
return new GregorianCalendar();
default:
throw new Error(`Unsupported calendar ${identifier}`);
}
}
export function Providers({children}: ProvidersProps) {
const router = useRouter();
return (
<NextUIProvider
locale="hi-IN-u-ca-indian"
defaultDates={{
minDate: new CalendarDate(1900, 1, 1),
maxDate: new CalendarDate(2099, 12, 31),
}}
createCalendar={createCalendar}
>
{children}
</NextUIProvider>
);
}
```
<Spacer y={4} />
## Breaking Changes
### Removal of the `units` creation
To improve performance and reduce bundle size, we have removed the `units` creation from the
`nextui` plugin. [TailwindCSS v3.4](https://tailwindcss.com/blog/tailwindcss-v3-4) added support for `min-h-*` and `min-w-*` classes, so it is no longer needed.
How to upgrade:
1. Upgrade TailwindCSS to version 3.4 or later (if you haven't already). You can do this by running:
```bash
npm install tailwindcss@latest
```
2. Remove the `spacingUnit` configuration from your `tailwind.config.(js|ts)` file (if you have it):
```diff-js
plugins: [
nextui({
layout: {
- spacingUnit: 4,
},
}),
],
```
3. Find all `-unit` classes in your project and replace them with a `-` separator. For example, replace `p-unit-4` with `p-4`.
```diff-jsx
import {Button} from "@nextui-org/react";
export const MyButton = () => {
return (
- <Button className="px-unit-2 py-unit-1 min-w-unit-48">
+ <Button className="px-2 py-1 min-w-48">
My Button
</Button>
);
};
```
### Separation for `errorMessage` and `isInvalid`
We are currently working on supporting multiple types of validation, including native HTML constraint validation, custom validation, and real-time validation.
Due to this reason, the requirements for displaying error messages have become more varied, and it is necessary to handle validation conditions separately from the `errorMessage`.
How to upgrade:
1. To display `errorMessage`, `isInvalid` must be set to `true`.
```diff-jsx
<Input
type="email"
label="Email"
variant="bordered"
defaultValue="junior2nextui.org"
+ isInvalid={true}
errorMessage="Please enter a valid email"
className="max-w-xs"
/>
```
That's it! Your project should now be using the latest version of TailwindCSS and NextUI.
<Spacer y={4} />
## Other Changes
**Bug Fixes**:
- Fixed an HSL color rounding issue in the theme settings to ensure accurate color representation. [PR](https://github.com/nextui-org/nextui/pull/2702) - [@wingkwong](https://github.com/wingkwong)
- Removed conflicting transition definitions affecting CSS classes. [PR](https://github.com/nextui-org/nextui/pull/2677) - [@u3u](https://github.com/u3u)
- Patched the "@nextui-org/autocomplete" package to fix an issue where empty items with `allowCustomValue` would not render properly due to a null node problem. [PR](https://github.com/nextui-org/nextui/pull/2674) - [@wingkwong](https://github.com/wingkwong)
- Implemented a fix in modal components to prevent carryover of IME (Input Method Editor) input when switching fields using the Tab key. [PR](https://github.com/nextui-org/nextui/pull/2709) - [@ryo-manba](https://github.com/ryo-manba)
- Enhanced accessibility by handling Tab key press event in the `ModalContent` component. [PR](https://github.com/nextui-org/nextui/pull/2709) - [@ryo-manba](https://github.com/ryo-manba)
- Fixed an issue where disabled select components could still be changed using blur and keyboard shortcuts. [PR](https://github.com/nextui-org/nextui/pull/2649) - [@wingkwong](https://github.com/wingkwong)
- Patched issues in "@nextui-org/use-aria-multiselect" and "@nextui-org/stories-utils" packages to fix a warning about `SELECT defaultSelectedKeys`. [PR](https://github.com/nextui-org/nextui/pull/2648) - [@wingkwong](https://github.com/wingkwong)
- Fixed an issue with incorrect `onChange` typing in Checkbox Group, ensuring it now correctly handles an array of strings as values. [PR](https://github.com/nextui-org/nextui/pull/2595) - [@wingkwong](https://github.com/wingkwong)
- Fixed the `label` placement issue in `Select` component if a `description` prop is used [PR](https://github.com/nextui-org/nextui/pull/2553) - [@novsource](https://github.com/novsource)
- Fixed the `originalProps` spread issue in the `Dropdown` component. [PR](https://github.com/nextui-org/nextui/pull/2450) - [@wingkwong](https://github.com/wingkwong)
**Improvements**
- Framer Motion was updated to the latest version, improving performance and reducing bundle size. [Docs](https://www.framer.com/motion/guide-reduce-bundle-size/) [PR](https://github.com/nextui-org/nextui/pull/2464) - [@mezotv](https://github.com/mezotv)
- `LazyMotion` was added to all components that use Framer Motion, improving performance by only loading the required motion components.
- We removed the custom `units` creation from the `nextui` plugin, it is no longer needed with TailwindCSS v3.4 and above. [PR](https://github.com/nextui-org/nextui/pull/2713) - [@jrgarciadev](https://github.com/jrgarciadev)
- Updated `framer-motion` package across various components and utilities to version `11.0.22` for enhanced performance and consistency. [PR](https://github.com/nextui-org/nextui/pull/2596) - [@wingkwong](https://github.com/wingkwong)
- Ensured compatibility with `react@18.2.0` and `react-dom@18.2.0` across the board. [PR](https://github.com/nextui-org/nextui/pull/2596) - [@wingkwong](https://github.com/wingkwong)
- Introduced patches for NextUI components to improve animations, including support for keyframes with spring and inertia animations. [PR](https://github.com/nextui-org/nextui/pull/2596) - [@wingkwong](https://github.com/wingkwong)
- Improved handling of numeric keys in the multi-select component to ensure consistent behavior. [PR](https://github.com/nextui-org/nextui/pull/2589) - [@wingkwong](https://github.com/wingkwong)
- Updated the version of react-aria to include the latest changes as detailed in the [2024-02-13 release](https://react-spectrum.adobe.com/releases/2024-02-13.html). [PR](https://github.com/nextui-org/nextui/pull/2561) - [@ryo-manba](https://github.com/ryo-manba)
- Added support for custom class names in the `AvatarGroup` component, enhancing flexibility in styling. [PR](https://github.com/nextui-org/nextui/pull/2669) - [@wingkwong](https://github.com/wingkwong)
- Introduced a `count` slot to the `AvatarGroup` for more customized rendering. [PR](https://github.com/nextui-org/nextui/pull/2669) - [@wingkwong](https://github.com/wingkwong)
- Improved the `AvatarGroup` component's count rendering logic for better performance and flexibility. [PR](https://github.com/nextui-org/nextui/pull/2669) - [@wingkwong](https://github.com/wingkwong)
- Add RTL support to the kbd component. [PR](https://github.com/nextui-org/nextui/pull/2482) - [@mrbadri](https://github.com/mrbadri)
- Add RTL support to the Select component. [PR](https://github.com/nextui-org/nextui/pull/2485) - [@mrbadri](https://github.com/mrbadri)
- Add RTL support to the avatar group componen. [PR](https://github.com/nextui-org/nextui/pull/2498) - [@mrbadri](https://github.com/mrbadri)
- Add RTL support to the Table component. [PR](https://github.com/nextui-org/nextui/pull/2472) - [@mrbadri](https://github.com/mrbadri)
**Documentation**:
- Updated documentation to reflect the new features and changes in the `AvatarGroup` component.
- Added support for the "bun" package manager across documentation and components. [PR](https://github.com/nextui-org/nextui/pull/2625) - [@sudongyuer](https://github.com/sudongyuer)
- [Kapa.ai](https://www.kapa.ai/) widget was added to the documentation to provide AI support for users. [PR](https://github.com/nextui-org/nextui/pull/2428) - [@wingkwong](https://github.com/sudongyuer)
- Layout docs updated to remove the `units` configuration from the `tailwind.config.(js|ts)` file.
Special thanks to NextUI Team members [@kuri-sun](https://github.com/kuri-sun), [@ryo-manba](https://github.com/ryo-manba),
[@sudongyuer](https://github.com/sudongyuer), [@winchesHe](https://github.com/winchesHe), [@wingkwong](https://github.com/wingkwong),
[@tianenpang](https://github.com/tianenpang), [@smultar](https://github.com/smultar) and contributors for their contributions to this release.
For a full list of changes, please refer to the [release notes](https://github.com/nextui-org/nextui/releases/tag/%40nextui-org%2Freact%402.3.0).
<Spacer y={6} />
We hope you enjoy these new components and the new features. We're excited to see what you build with them!
Thanks for reading and happy coding! 🚀
---
## Community
We're excited to see the community adopt NextUI, raise issues, and provide feedback.
Whether it's a feature request, bug report, or a project to showcase, please get involved!
<Community />
## Contributing
PR's on NextUI are always welcome, please see our [contribution guidelines](https://github.com/nextui-org/nextui/blob/main/CONTRIBUTING.md) to learn how you can contribute to this project.
+333
View File
@@ -0,0 +1,333 @@
---
title: "Introducing v2.4.0"
description: "NextUI v2.4.0 is here! includes tons of bug fixes, the possibility to globally disable the animations and improvements."
date: "2024-05-27"
image: "/blog/v2.4.0.jpg"
tags: ["nextui", "v2.4.0", "release", "bug fixes", "improvements", "animations"]
author:
name: "WK Wong"
username: "@wingkwong"
link: "https://github.com/wingkwong"
avatar: "https://avatars.githubusercontent.com/u/35857179?v=4"
---
<img
src="/blog/v2.4.0_2x.jpg"
width={700}
height={350}
alt="NextUI v2.4.0"
className="w-full border border-transparent dark:border-default-200/50 object-fit rounded-xl shadow-lg"
/>
We are excited to announce the latest update to NextUI, version **2.4.0**! This release introduces 60+ bug fixes, dependencies upgrades, improvements in API and CLI and more.
## What's New in v2.4.0?
- [Disable Animations Globally](#disable-animations-globally) - Allows users to disable animation globally via NextUIProvider
- [API Improvements](#api-improvements) - Includes several props like `disableRipple`, `skipFramerMotionAnimations` and `validationBehavior`
- [CLI Improvements](#cli-improvements) - Includes new command options and optimizes performance
- [React Aria Packages Upgrades](#react-aria-packages-upgrades) - Upgrades and fixes the exact versions of React Aria
- [Other Changes](#other-changes) - Includes styling improvements, accessibility, usability enhancements and over 60 bug fixes across different component packages
<Spacer y={4} />
Upgrade today by running one of the following commands:
<Spacer y={4} />
<PackageManagers
commands={{
cli: "nextui upgrade",
npm: "npx nextui-cli@latest upgrade",
}}
/>
<Spacer y={4} />
## Disable Animations Globally
NextUI components are animated by default and can be disabled by setting the prop `disableAnimation` individually. Since v2.4.0, you can globally disable the animation by setting `disableAnimation` to `NextUIProvider`.
```tsx
"use client";
import {type ReactNode} from "react";
import {NextUIProvider} from "@nextui-org/react";
export function AppProvider(props: AppProviderProps) {
const {children, className} = props;
return (
<NextUIProvider className={className} disableAnimation>
{children}
</NextUIProvider>
);
}
interface AppProviderProps {
children: ReactNode;
className?: string;
}
```
<Spacer y={4} />
## API Improvements
### disableRipple
By default, there is a ripple effect on press in Button and Card component and can be disabled by setting the prop `disableRipple` individually. Since v2.4.0, it can be disabled globally by setting `disableRipple` to `NextUIProvider`.
```tsx
"use client";
import {type ReactNode} from "react";
import {NextUIProvider} from "@nextui-org/react";
export function AppProvider(props: AppProviderProps) {
const {children, className} = props;
return (
<NextUIProvider className={className} disableRipple>
{children}
</NextUIProvider>
);
}
interface AppProviderProps {
children: ReactNode;
className?: string;
}
```
### skipFramerMotionAnimations
We can control whether `framer-motion` animations are skipped within the application. This property is automatically enabled (`true`) when the `disableAnimation` prop is set to `true`, effectively skipping all `framer-motion` animations. To retain `framer-motion` animations while using the `disableAnimation` prop for other purposes, set this to `false`. However, note that animations in NextUI Components are still omitted if the `disableAnimation` prop is `true`.
```tsx
"use client";
import {type ReactNode} from "react";
import {NextUIProvider} from "@nextui-org/react";
export function AppProvider(props: AppProviderProps) {
const {children, className} = props;
return (
<NextUIProvider className={className} skipFramerMotionAnimations>
{children}
</NextUIProvider>
);
}
interface AppProviderProps {
children: ReactNode;
className?: string;
}
```
### validationBehavior
We can set `validationBehavior` to either `native` or `aria` to control whether to use native HTML form validation to prevent form submission when the value is missing or invalid, or mark the field as required or invalid via ARIA. If it is not specified, `aria` will be used by default.
```tsx
"use client";
import {type ReactNode} from "react";
import {NextUIProvider} from "@nextui-org/react";
export function AppProvider(props: AppProviderProps) {
const {children, className} = props;
return (
<NextUIProvider className={className} validationBehavior="native">
{children}
</NextUIProvider>
);
}
interface AppProviderProps {
children: ReactNode;
className?: string;
}
```
<Spacer y={4} />
## CLI Improvements
### Refactor Init Flow View
We've refactored the init flow view to provide a better user experience.
The latest flow view output:
```bash
┌ Create a new project
◇ Select a template (Enter to select)
│ ● App (A Next.js 14 with app directory template pre-configured with NextUI (v2) and Tailwind CSS.)
│ ○ Pages (A Next.js 14 with pages directory template pre-configured with NextUI (v2) and Tailwind CSS.)
│ ○ Vite (A Vite template pre-configured with NextUI (v2) and Tailwind CSS.)
◇ New project name (Enter to skip with default name)
│ my-nextui-app
◇ Select a package manager (Enter to select)
│ ● npm
│ ○ yarn
│ ○ pnpm
│ ○ bun
◇ Template created successfully!
◇ Next steps ───────╮
│ │
│ cd my-nextui-app │
│ npm install │
│ │
├────────────────────╯
└ 🚀 Get started with npm run dev
```
### Add Vite Template
We've introduced a new Vite template pre-configured with NextUI v2 and TailwindCSS. The following command is to initialize a new Vite project named `my-vite-app`.
```bash
nextui init my-vite-app -t vite
```
### Package Manager Flag
We've introduced a new flag `-p` (or `--package`) to init command to allow users to choose the package manager to use for the new project. By default, `npm` is used. For example, the following command will initialize a new NextUI project with the app template named my-nextui-app using pnpm package manager.
```bash
nextui init my-nextui-app -t app -p pnpm
```
### no-cache Flag
We've introduced a new flag `--no-cache` to allow users to disable the cache. By default, the data will be cached for 30 mins after the first request. It is useful when the data is cached, and you wish to upgrade to the new version just released after the first request. In this way, you can run the following command
```bash
nextui --no-cache upgrade
```
### Upgrade Version Output
You can now run the upgrade command and see the summary version of the package you are upgrading to.
![image](https://github.com/nextui-org/nextui-cli/assets/96854855/2a5945dd-5187-4e20-81b8-4136e9791dde)
### Upgrade And Remove Select View Optimization
The disabled option(s) will be displayed in the bottom of the list.
![image](https://github.com/nextui-org/nextui-cli/assets/96854855/c7ddf9e4-3054-4bf1-b8e3-dc2f6226091a)
### Doctor Command add peerDependencies check
The `doctor` command now checks for peerDependencies and displays the incorrect peerDependencies, relation: [nextui-org/nextui#2954](https://github.com/nextui-org/nextui/issues/2954).
<Spacer y={4} />
## React Aria Packages Upgrades
We've upgraded and fixed React Aria packages dependencies across our components. This update focuses on enhancing accessibility, ensuring better compatibility with the latest versions of React Aria, and resolving previously reported bugs.
<Spacer y={4} />
## Breaking Changes
### Export improved `cn` utility
> If you are using it from `@nextui-org/react`, no changes are required.
The new `cn` utility exported from the `@nextui-org/theme` package includes `tailwind-merge` to avoid conflicts between tailwindcss classes overrides and includes the config for NextUI custom classes.
If you are using the `cn` utility from the `@nextui-org/system`,
```diff-tsx
-import {cn} from "@nextui-org/system"
```
or `@nextui-org/system-rsc` package,
```diff-tsx
-import {cn} from "@nextui-org/system-rsc"
```
you need to update the import as follows:
```diff-tsx
+ import {cn} from "@nextui-org/theme"
```
<Spacer y={4} />
## Other Changes
**Bug Fixes**:
- Fixed popover-based focus behaviours. [PR](https://github.com/nextui-org/nextui/pull/2889) - [@wingkwong](https://github.com/wingkwong)
- Fixed missing ref to input wrapper. [PR](https://github.com/nextui-org/nextui/pull/3008) - [@wingkwong](https://github.com/wingkwong)
- Fixed react-hook-form uncontrolled switch component. [PR](https://github.com/nextui-org/nextui/pull/3008) - [@wingkwong](https://github.com/wingkwong)
- Fixed focus on the first item when pressing Space / Enter key on dropdown menu open. [PR](https://github.com/nextui-org/nextui/pull/2970) - [@wingkwong](https://github.com/wingkwong)
- Fixed inputting spaces in textarea inside a Table row. [PR](https://github.com/nextui-org/nextui/pull/3020) - [@wingkwong](https://github.com/wingkwong)
- Fixed incorrect tailwind classnames. [PR](https://github.com/nextui-org/nextui/pull/3018) - [@wingkwong](https://github.com/wingkwong)
- Fixed onSelectionChange can handle number [PR](https://github.com/nextui-org/nextui/pull/2937) - [@ryo-manba](https://github.com/ryo-manba)
- Fixed update type definition to prevent primitive values as items [PR](https://github.com/nextui-org/nextui/pull/2938) - [@ryo-manba](https://github.com/ryo-manba)
- Fixed display placeholder text when unselected for controlled. [PR](https://github.com/nextui-org/nextui/pull/3081) - [@ryo-manba](https://github.com/ryo-manba)
- Fixed the inert attribute in `CalendarMonth` and `CalendarPicker`. [PR](https://github.com/nextui-org/nextui/pull/3054) - [@ShrinidhiUpadhyaya](https://github.com/ShrinidhiUpadhyaya)
- Fixed hiding of unavailable dates in RangeCalendar. [PR](https://github.com/nextui-org/nextui/pull/3054) - [@ShrinidhiUpadhyaya](https://github.com/ShrinidhiUpadhyaya)
- Fixed calendar header controlled state on DatePicker. [PR](https://github.com/nextui-org/nextui/pull/2845) - [@chirokas](https://github.com/chirokas)
- Fixed 'Tap to click' behavior on macOS for Accordion and Tab. [PR](https://github.com/nextui-org/nextui/pull/2725) - [@ericfabreu](https://github.com/ericfabreu)
- Fixed incorrect margin on labels for RTL required inputs. [PR](https://github.com/nextui-org/nextui/pull/2781) - [@mrbadri](https://github.com/mrbadri)
- Fixed a type error in the onKeyDown event handler for the menu component. [PR](https://github.com/nextui-org/nextui/pull/3064) - [@Gaic4o](https://github.com/Gaic4o)
**Improvements**
- Added `destroyInactiveTabPanel` prop for Tabs component. [PR](https://github.com/nextui-org/nextui/pull/2973) - [@wingkwong](https://github.com/wingkwong)
- Added pointer-events-none to skeleton base. [PR](https://github.com/nextui-org/nextui/pull/2972) - [@wingkwong](https://github.com/wingkwong)
- Revised isInvalid input styles. [PR](https://github.com/nextui-org/nextui/pull/3010) - [@wingkwong](https://github.com/wingkwong)
- Revised slider styles. [PR](https://github.com/nextui-org/nextui/pull/2883) - [@wingkwong](https://github.com/wingkwong)
- Removed unnecessary origin-bottom in button. [PR](https://github.com/nextui-org/nextui/pull/2990) - [@wingkwong](https://github.com/wingkwong)
- Set overflow visible after skeleton loaded. [PR](https://github.com/nextui-org/nextui/pull/2986) - [@wingkwong](https://github.com/wingkwong)
- Kept date picker style consistent for different variants. [PR](https://github.com/nextui-org/nextui/pull/2901) - [@wingkwong](https://github.com/wingkwong)
- Calculated the correct value on mark click. [PR](https://github.com/nextui-org/nextui/pull/3017) - [@wingkwong](https://github.com/wingkwong)
- Removed scrolling display during month change animation. [PR](https://github.com/nextui-org/nextui/pull/2949) - [@novsource](https://github.com/novsource)
- Added the correct peerDep version [PR](https://github.com/nextui-org/nextui/pull/3014) - [@winchesHe](https://github.com/winchesHe)
- Added missing export of TableRowProps type. [PR](https://github.com/nextui-org/nextui/pull/2866) - [@sapkra](https://github.com/sapkra)
- Changed validationBehavior from native to aria by default, with the option to change via props. [PR](https://github.com/nextui-org/nextui/pull/2987) - [@ryo-manba](https://github.com/ryo-manba)
- Made the VisuallyHidden elementType as span when the default parent element accepts only phrasing elements. [PR](https://github.com/nextui-org/nextui/pull/3013) - [@kosmotema](https://github.com/kosmotema)
- Refactored the useScrollPosition hook to improve performance and stability by using useCallback for the handler function and useRef for throttleTimeout. [PR](https://github.com/nextui-org/nextui/pull/3049) - [@Gaic4o](https://github.com/Gaic4o)
**Documentation**:
- Updated documentation to reflect the new features and changes in the components, API references, and CLI.
Special thanks to NextUI Team members [@kuri-sun](https://github.com/kuri-sun), [@ryo-manba](https://github.com/ryo-manba),
[@sudongyuer](https://github.com/sudongyuer), [@winchesHe](https://github.com/winchesHe), [@wingkwong](https://github.com/wingkwong),
[@tianenpang](https://github.com/tianenpang), [@smultar](https://github.com/smultar) and contributors for their contributions to this release.
For a full list of changes, please refer to the [release notes](https://github.com/nextui-org/nextui/releases/tag/%40nextui-org%2Freact%402.4.0).
<Spacer y={6} />
Thanks for reading and happy coding! 🚀
---
## Community
We're excited to see the community adopt NextUI, raise issues, and provide feedback.
Whether it's a feature request, bug report, or a project to showcase, please get involved!
<Community />
## Contributing
PR's on NextUI are always welcome, please see our [contribution guidelines](https://github.com/nextui-org/nextui/blob/main/CONTRIBUTING.md) to learn how you can contribute to this project.
@@ -24,10 +24,41 @@ export default function App() {
);
}`;
const AppTs = `import type {Selection} from "@nextui-org/react";
import {Accordion, AccordionItem} from "@nextui-org/react";
export default function App() {
const [selectedKeys, setSelectedKeys] = React.useState<Selection>(new Set(["1"]));
const defaultContent =
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.";
return (
<Accordion
selectedKeys={selectedKeys}
onSelectionChange={setSelectedKeys}
>
<AccordionItem key="1" aria-label="Accordion 1" title="Accordion 1">
{defaultContent}
</AccordionItem>
<AccordionItem key="2" aria-label="Accordion 2" title="Accordion 2">
{defaultContent}
</AccordionItem>
<AccordionItem key="3" aria-label="Accordion 3" title="Accordion 3">
{defaultContent}
</AccordionItem>
</Accordion>
);
}`;
const react = {
"/App.jsx": App,
};
const reactTs = {
"/App.tsx": AppTs,
};
export default {
...react,
...reactTs,
};
@@ -214,7 +214,7 @@ export default function App() {
startContent={<MonitorMobileIcon className="text-primary" />}
subtitle={
<p className="flex">
2 issues to <p className="text-primary ml-1">fix now</p>
2 issues to <span className="text-primary ml-1">fix now</span>
</p>
}
title="Connected devices"
@@ -249,7 +249,7 @@ export default function App() {
title={
<p className="flex gap-1 items-center">
Card expired
<p className="text-default-400 text-small">*4812</p>
<span className="text-default-400 text-small">*4812</span>
</p>
}
>
@@ -51,7 +51,7 @@ export default function App() {
}
subtitle={
<p className="flex">
2 issues to<p className="text-primary ml-1">fix now</p>
2 issues to<span className="text-primary ml-1">fix now</span>
</p>
}
title="Zoey Lang"
@@ -37,6 +37,7 @@ export default function App() {
<Autocomplete
label="Favorite Animal"
variant="bordered"
defaultItems={animals}
placeholder="Search an animal"
className="max-w-xs"
selectedKey={value}
@@ -24,6 +24,7 @@ import asyncLoadingItems from "./async-loading-items";
import sections from "./sections";
import customSectionsStyle from "./custom-sections-style";
import customStyles from "./custom-styles";
import readOnly from "./read-only";
export const autocompleteContent = {
usage,
@@ -52,4 +53,5 @@ export const autocompleteContent = {
sections,
customSectionsStyle,
customStyles,
readOnly,
};
@@ -0,0 +1,54 @@
const data = `export const animals = [
{label: "Cat", value: "cat", description: "The second most popular pet in the world"},
{label: "Dog", value: "dog", description: "The most popular pet in the world"},
{label: "Elephant", value: "elephant", description: "The largest land animal"},
{label: "Lion", value: "lion", description: "The king of the jungle"},
{label: "Tiger", value: "tiger", description: "The largest cat species"},
{label: "Giraffe", value: "giraffe", description: "The tallest land animal"},
{
label: "Dolphin",
value: "dolphin",
description: "A widely distributed and diverse group of aquatic mammals",
},
{label: "Penguin", value: "penguin", description: "A group of aquatic flightless birds"},
{label: "Zebra", value: "zebra", description: "A several species of African equids"},
{
label: "Shark",
value: "shark",
description: "A group of elasmobranch fish characterized by a cartilaginous skeleton",
},
{
label: "Whale",
value: "whale",
description: "Diverse group of fully aquatic placental marine mammals",
},
{label: "Otter", value: "otter", description: "A carnivorous mammal in the subfamily Lutrinae"},
{label: "Crocodile", value: "crocodile", description: "A large semiaquatic reptile"},
];`;
const App = `import {Autocomplete, AutocompleteItem} from "@nextui-org/react";
import {animals} from "./data";
export default function App() {
return (
<Autocomplete
isReadOnly
label="Favorite Animal"
defaultItems={animals}
placeholder="Search an animal"
defaultSelectedKey="cat"
className="max-w-xs"
>
{(item) => <AutocompleteItem key={item.value}>{item.label}</AutocompleteItem>}
</Autocomplete>
);
}`;
const react = {
"/App.jsx": App,
"/data.js": data,
};
export default {
...react,
};
@@ -12,7 +12,7 @@ export default function App() {
<DropdownTrigger>
<Button
isIconOnly
className="min-w-unit-6 w-unit-6 h-unit-6"
className="min-w-6 w-6 h-6"
size="sm"
variant="flat"
>
@@ -20,7 +20,7 @@ const MyButton = forwardRef((props, ref) => {
...props,
});
const {ripples} = getRippleProps();
const {ripples, onClear} = getRippleProps();
return (
<button ref={domRef} {...getButtonProps()}>
@@ -29,7 +29,7 @@ const MyButton = forwardRef((props, ref) => {
{children}
{isLoading && spinnerPlacement === "end" && spinner}
{endContent}
{!disableRipple && <Ripple ripples={ripples} />}
{!disableRipple && <Ripple ripples={ripples} onClear={onClear} />}
</button>
);
});
@@ -0,0 +1,43 @@
const App = `import {Calendar} from "@nextui-org/react";
import {today, getLocalTimeZone} from "@internationalized/date";
export default function App() {
let defaultDate = today(getLocalTimeZone());
let [focusedDate, setFocusedDate] = React.useState(defaultDate);
return (
<Calendar
aria-label="Date (Controlled Focused Value)"
focusedValue={focusedDate}
value={defaultDate}
onFocusChange={setFocusedDate}
/>
);
}`;
const AppTs = `import {Calendar} from "@nextui-org/react";
import type {DateValue} from "@react-types/calendar";
import {today, getLocalTimeZone} from "@internationalized/date";
export default function App() {
let defaultDate = today(getLocalTimeZone());
let [focusedDate, setFocusedDate] = React.useState<DateValue>(defaultDate);
return (
<Calendar
aria-label="Date (Controlled Focused Value)"
focusedValue={focusedDate}
value={defaultDate}
onFocusChange={setFocusedDate}
/>
);
}`;
const react = {
"/App.jsx": App,
"/App.tsx": AppTs,
};
export default {
...react,
};
@@ -0,0 +1,39 @@
const App = `import {Calendar} from "@nextui-org/react";
import {parseDate} from "@internationalized/date";
export default function App() {
let [value, setValue] = React.useState(parseDate("2024-03-07"));
return (
<Calendar
aria-label="Date (Controlled)"
value={value}
onChange={setValue}
/>
);
}`;
const AppTs = `import {Calendar} from "@nextui-org/react";
import type {DateValue} from "@react-types/calendar";
import {parseDate} from "@internationalized/date";
export default function App() {
let [value, setValue] = React.useState<DateValue>(parseDate("2024-03-07"));
return (
<Calendar
aria-label="Date (Controlled)"
value={value}
onChange={setValue}
/>
);
}`;
const react = {
"/App.jsx": App,
"/App.tsx": AppTs,
};
export default {
...react,
};
@@ -0,0 +1,15 @@
const App = `import {Calendar} from "@nextui-org/react";
export default function App() {
return (
<Calendar aria-label="Date (Disabled)" isDisabled />
);
}`;
const react = {
"/App.jsx": App,
};
export default {
...react,
};
@@ -0,0 +1,31 @@
import usage from "./usage";
import disabled from "./disabled";
import readonly from "./read-only";
import controlled from "./controlled";
import minDateValue from "./min-date-value";
import maxDateValue from "./max-date-value";
import unavailableDates from "./unavailable-dates";
import controlledFocusedValue from "./controlled-focused-value";
import invalidDate from "./invalid-date";
import withMonthAndYearPicker from "./with-month-and-year-picker";
import internationalCalendars from "./international-calendars";
import visibleMonths from "./visible-months";
import pageBehaviour from "./page-behaviour";
import presets from "./presets";
export const calendarContent = {
usage,
disabled,
readonly,
controlled,
minDateValue,
maxDateValue,
unavailableDates,
controlledFocusedValue,
invalidDate,
withMonthAndYearPicker,
internationalCalendars,
visibleMonths,
pageBehaviour,
presets,
};
@@ -0,0 +1,18 @@
const App = `import {Calendar} from "@nextui-org/react";
import {I18nProvider} from "@react-aria/i18n";
export default function App() {
return (
<I18nProvider locale="zh-CN-u-ca-chinese">
<Calendar aria-label="Date (International Calendar)" />
</I18nProvider>
);
}`;
const react = {
"/App.jsx": App,
};
export default {
...react,
};
@@ -0,0 +1,51 @@
const App = `import {Calendar} from "@nextui-org/react";
import {today, getLocalTimeZone, isWeekend} from "@internationalized/date";
import {useLocale} from "@react-aria/i18n";
export default function App() {
let [date, setDate] = React.useState(today(getLocalTimeZone()));
let {locale} = useLocale();
let isInvalid = isWeekend(date, locale);
return (
<Calendar
aria-label="Date (Invalid on weekends)"
errorMessage={isInvalid ? "We are closed on weekends" : undefined}
isInvalid={isInvalid}
value={date}
onChange={setDate}
/>
);
}`;
const AppTs = `import {Calendar} from "@nextui-org/react";
import type {DateValue} from "@react-types/calendar";
import {today, getLocalTimeZone, isWeekend} from "@internationalized/date";
import {useLocale} from "@react-aria/i18n";
export default function App() {
let [date, setDate] = React.useState<DateValue>(today(getLocalTimeZone()));
let {locale} = useLocale();
let isInvalid = isWeekend(date, locale);
return (
<Calendar
aria-label="Date (Invalid on weekends)"
errorMessage={isInvalid ? "We are closed on weekends" : undefined}
isInvalid={isInvalid}
value={date}
onChange={setDate}
/>
);
}`;
const react = {
"/App.jsx": App,
"/App.tsx": AppTs,
};
export default {
...react,
};
@@ -0,0 +1,20 @@
const App = `import {Calendar} from "@nextui-org/react";
import {today, getLocalTimeZone} from "@internationalized/date";
export default function App() {
return (
<Calendar
aria-label="Date (Max Date Value)"
defaultValue={today(getLocalTimeZone())}
maxValue={today(getLocalTimeZone())}
/>
);
}`;
const react = {
"/App.jsx": App,
};
export default {
...react,
};
@@ -0,0 +1,20 @@
const App = `import {Calendar} from "@nextui-org/react";
import {today, getLocalTimeZone} from "@internationalized/date";
export default function App() {
return (
<Calendar
aria-label="Date (Min Date Value)"
defaultValue={today(getLocalTimeZone())}
minValue={today(getLocalTimeZone())}
/>
);
}`;
const react = {
"/App.jsx": App,
};
export default {
...react,
};
@@ -0,0 +1,18 @@
const App = `import {Calendar} from "@nextui-org/react";
export default function App() {
return (
<Calendar
aria-label="Date (Page Behaviour)"
pageBehavior="single"
/>
);
}`;
const react = {
"/App.jsx": App,
};
export default {
...react,
};
@@ -0,0 +1,185 @@
const App = `import {Calendar, Radio, RadioGroup, Button, ButtonGroup, cn} from "@nextui-org/react";
import {today, getLocalTimeZone, startOfWeek, startOfMonth} from "@internationalized/date";
import {useLocale} from "@react-aria/i18n";
export default function App() {
let defaultDate = today(getLocalTimeZone());
let [value, setValue] = React.useState(defaultDate);
let {locale} = useLocale();
let now = today(getLocalTimeZone());
let nextWeek = startOfWeek(now.add({weeks: 1}), locale);
let nextMonth = startOfMonth(now.add({months: 1}));
const CustomRadio = (props) => {
const {children, ...otherProps} = props;
return (
<Radio
{...otherProps}
classNames={{
base: cn(
"flex-none m-0 h-8 bg-content1 hover:bg-content2 items-center justify-between",
"cursor-pointer rounded-full border-2 border-default-200/60",
"data-[selected=true]:border-primary",
),
label: "text-tiny text-default-500",
labelWrapper: "px-1 m-0",
wrapper: "hidden",
}}
>
{children}
</Radio>
);
};
return (
<div className="flex flex-col gap-4">
<Calendar
aria-label="Date (Presets)"
bottomContent={
<RadioGroup
aria-label="Date precision"
classNames={{
base: "w-full pb-2",
wrapper: "-my-2.5 py-2.5 px-3 gap-1 flex-nowrap max-w-[280px] overflow-x-scroll",
}}
defaultValue="exact_dates"
orientation="horizontal"
>
<CustomRadio value="exact_dates">Exact dates</CustomRadio>
<CustomRadio value="1_day">1 day</CustomRadio>
<CustomRadio value="2_days">2 days</CustomRadio>
<CustomRadio value="3_days">3 days</CustomRadio>
<CustomRadio value="7_days">7 days</CustomRadio>
<CustomRadio value="14_days">14 days</CustomRadio>
</RadioGroup>
}
classNames={{
content: "w-full",
}}
focusedValue={value}
nextButtonProps={{
variant: "bordered",
}}
prevButtonProps={{
variant: "bordered",
}}
topContent={
<ButtonGroup
fullWidth
className="px-3 pb-2 pt-3 bg-content1 [&>button]:text-default-500 [&>button]:border-default-200/60"
radius="full"
size="sm"
variant="bordered"
>
<Button onPress={() => setValue(now)}>Today</Button>
<Button onPress={() => setValue(nextWeek)}>Next week</Button>
<Button onPress={() => setValue(nextMonth)}>Next month</Button>
</ButtonGroup>
}
value={value}
onChange={setValue}
onFocusChange={setValue}
/>
</div>
);
}`;
const AppTs = `import {Calendar, Radio, RadioGroup, Button, ButtonGroup, cn} from "@nextui-org/react";
import type {DateValue} from "@react-types/calendar";
import {today, getLocalTimeZone, startOfWeek, startOfMonth} from "@internationalized/date";
import {useLocale} from "@react-aria/i18n";
export default function App() {
let defaultDate = today(getLocalTimeZone());
let [value, setValue] = React.useState<DateValue>(defaultDate);
let {locale} = useLocale();
let now = today(getLocalTimeZone());
let nextWeek = startOfWeek(now.add({weeks: 1}), locale);
let nextMonth = startOfMonth(now.add({months: 1}));
const CustomRadio = (props) => {
const {children, ...otherProps} = props;
return (
<Radio
{...otherProps}
classNames={{
base: cn(
"flex-none m-0 h-8 bg-content1 hover:bg-content2 items-center justify-between",
"cursor-pointer rounded-full border-2 border-default-200/60",
"data-[selected=true]:border-primary",
),
label: "text-tiny text-default-500",
labelWrapper: "px-1 m-0",
wrapper: "hidden",
}}
>
{children}
</Radio>
);
};
return (
<div className="flex flex-col gap-4">
<Calendar
aria-label="Date (Presets)"
bottomContent={
<RadioGroup
aria-label="Date precision"
classNames={{
base: "w-full pb-2",
wrapper: "-my-2.5 py-2.5 px-3 gap-1 flex-nowrap max-w-[280px] overflow-scroll",
}}
defaultValue="exact_dates"
orientation="horizontal"
>
<CustomRadio value="exact_dates">Exact dates</CustomRadio>
<CustomRadio value="1_day">1 day</CustomRadio>
<CustomRadio value="2_days">2 days</CustomRadio>
<CustomRadio value="3_days">3 days</CustomRadio>
<CustomRadio value="7_days">7 days</CustomRadio>
<CustomRadio value="14_days">14 days</CustomRadio>
</RadioGroup>
}
classNames={{
content: "w-full",
}}
focusedValue={value}
nextButtonProps={{
variant: "bordered",
}}
prevButtonProps={{
variant: "bordered",
}}
topContent={
<ButtonGroup
fullWidth
className="px-3 pb-2 pt-3 bg-content1 [&>button]:text-default-500 [&>button]:border-default-200/60"
radius="full"
size="sm"
variant="bordered"
>
<Button onPress={() => setValue(now)}>Today</Button>
<Button onPress={() => setValue(nextWeek)}>Next week</Button>
<Button onPress={() => setValue(nextMonth)}>Next month</Button>
</ButtonGroup>
}
value={value}
onChange={setValue}
onFocusChange={setValue}
/>
</div>
);
}`;
const react = {
"/App.jsx": App,
"/App.tsx": AppTs,
};
export default {
...react,
};
@@ -0,0 +1,20 @@
const App = `import {Calendar} from "@nextui-org/react";
import {today, getLocalTimeZone} from "@internationalized/date";
export default function App() {
return (
<Calendar
aria-label="Date (Read Only)"
value={today(getLocalTimeZone())}
isReadOnly
/>
);
}`;
const react = {
"/App.jsx": App,
};
export default {
...react,
};
@@ -0,0 +1,37 @@
const App = `import {Calendar} from "@nextui-org/react";
import {today, getLocalTimeZone, isWeekend} from "@internationalized/date";
import {useLocale} from "@react-aria/i18n";
export default function App() {
let now = today(getLocalTimeZone());
let disabledRanges = [
[now, now.add({days: 5})],
[now.add({days: 14}), now.add({days: 16})],
[now.add({days: 23}), now.add({days: 24})],
];
let {locale} = useLocale();
let isDateUnavailable = (date) =>
isWeekend(date, locale) ||
disabledRanges.some(
(interval) => date.compare(interval[0]) >= 0 && date.compare(interval[1]) <= 0,
);
return (
<Calendar
aria-label="Date (Unavailable)"
isDateUnavailable={isDateUnavailable}
/>
);
}`;
const react = {
"/App.jsx": App,
};
export default {
...react,
};
@@ -0,0 +1,19 @@
const App = `import {Calendar} from "@nextui-org/react";
import {parseDate} from '@internationalized/date';
export default function App() {
return (
<div className="flex gap-x-4">
<Calendar aria-label="Date (No Selection)" />
<Calendar aria-label="Date (Uncontrolled)" defaultValue={parseDate("2020-02-03")} />
</div>
);
}`;
const react = {
"/App.jsx": App,
};
export default {
...react,
};
@@ -0,0 +1,18 @@
const App = `import {Calendar} from "@nextui-org/react";
export default function App() {
return (
<Calendar
aria-label="Date (Visible Month)"
visibleMonths={3}
/>
);
}`;
const react = {
"/App.jsx": App,
};
export default {
...react,
};
@@ -0,0 +1,18 @@
const App = `import {Calendar} from "@nextui-org/react";
export default function App() {
return (
<Calendar
aria-label="Date (Show Month and Year Picker)"
showMonthAndYearPickers
/>
);
}`;
const react = {
"/App.jsx": App,
};
export default {
...react,
};
@@ -11,7 +11,7 @@ export default function App() {
alt="Woman listing to music"
className="object-cover"
height={200}
src="/images/hero-card.jpeg"
src="https://nextui.org/images/hero-card.jpeg"
width={200}
/>
<CardFooter className="justify-between before:bg-white/10 border-white/20 border-1 overflow-hidden py-1 absolute before:rounded-xl rounded-large bottom-1 w-[calc(100%_-_8px)] shadow-small ml-1 z-10">
+1 -1
View File
@@ -165,7 +165,7 @@ export default function App() {
className="object-cover"
height={200}
shadow="md"
src="/images/album-cover.png"
src="https://nextui.org/images/album-cover.png"
width="100%"
/>
</div>
@@ -7,7 +7,7 @@ export default function App() {
<Card className="max-w-[340px]">
<CardHeader className="justify-between">
<div className="flex gap-5">
<Avatar isBordered radius="full" size="md" src="/avatars/avatar-1.png" />
<Avatar isBordered radius="full" size="md" src="https://nextui.org/avatars/avatar-1.png" />
<div className="flex flex-col gap-1 items-start justify-center">
<h4 className="text-small font-semibold leading-none text-default-600">Zoey Lang</h4>
<h5 className="text-small tracking-tight text-default-400">@zoeylang</h5>
@@ -12,7 +12,7 @@ export default function App() {
removeWrapper
alt="Card background"
className="z-0 w-full h-full object-cover"
src="/images/card-example-4.jpeg"
src="https://nextui.org/images/card-example-4.jpeg"
/>
</Card>
<Card className="col-span-12 sm:col-span-4 h-[300px]">
@@ -24,7 +24,7 @@ export default function App() {
removeWrapper
alt="Card background"
className="z-0 w-full h-full object-cover"
src="/images/card-example-3.jpeg"
src="https://nextui.org/images/card-example-3.jpeg"
/>
</Card>
<Card className="col-span-12 sm:col-span-4 h-[300px]">
@@ -36,7 +36,7 @@ export default function App() {
removeWrapper
alt="Card background"
className="z-0 w-full h-full object-cover"
src="/images/card-example-2.jpeg"
src="https://nextui.org/images/card-example-2.jpeg"
/>
</Card>
<Card isFooterBlurred className="w-full h-[300px] col-span-12 sm:col-span-5">
@@ -48,7 +48,7 @@ export default function App() {
removeWrapper
alt="Card example background"
className="z-0 w-full h-full scale-125 -translate-y-6 object-cover"
src="/images/card-example-6.jpeg"
src="https://nextui.org/images/card-example-6.jpeg"
/>
<CardFooter className="absolute bg-white/30 bottom-0 border-t-1 border-zinc-100/50 z-10 justify-between">
<div>
@@ -69,14 +69,14 @@ export default function App() {
removeWrapper
alt="Relaxing app background"
className="z-0 w-full h-full object-cover"
src="/images/card-example-5.jpeg"
src="https://nextui.org/images/card-example-5.jpeg"
/>
<CardFooter className="absolute bg-black/40 bottom-0 z-10 border-t-1 border-default-600 dark:border-default-100">
<div className="flex flex-grow gap-2 items-center">
<Image
alt="Breathing app icon"
className="rounded-full w-10 h-11 bg-black"
src="/images/breathing-app-icon.jpeg"
src="https://nextui.org/images/breathing-app-icon.jpeg"
/>
<div className="flex flex-col">
<p className="text-tiny text-white/60">Breathing App</p>
+1 -1
View File
@@ -12,7 +12,7 @@ export default function App() {
<Image
alt="Card background"
className="object-cover rounded-xl"
src="/images/hero-card-complete.jpeg"
src="https://nextui.org/images/hero-card-complete.jpeg"
width={270}
/>
</CardBody>
@@ -0,0 +1,50 @@
const App = `import {DateInput} from "@nextui-org/react";
import {parseDate, getLocalTimeZone} from "@internationalized/date";
import {useDateFormatter} from "@react-aria/i18n";
export default function App() {
const [value, setValue] = React.useState(parseDate("2024-04-04"));
let formatter = useDateFormatter({dateStyle: "full"});
return (
<div className="w-full flex flex-row gap-2">
<div className="w-full flex flex-col gap-y-2">
<DateInput label="Date (controlled)" value={value} onChange={setValue} />
<p className="text-default-500 text-sm">
Selected date: {value ? formatter.format(value.toDate(getLocalTimeZone())) : "--"}
</p>
</div>
</div>
);
}`;
const AppTs = `import {DateInput} from "@nextui-org/react";
import {DateValue, parseDate, getLocalTimeZone} from "@internationalized/date";
import {useDateFormatter} from "@react-aria/i18n";
export default function App() {
const [value, setValue] = React.useState<DateValue>(parseDate("2024-04-04"));
let formatter = useDateFormatter({dateStyle: "full"});
return (
<div className="w-full flex flex-row gap-2">
<div className="w-full flex flex-col gap-y-2">
<DateInput label="Date (controlled)" value={value} onChange={setValue} />
<p className="text-default-500 text-sm">
Selected date: {value ? formatter.format(value.toDate(getLocalTimeZone())) : "--"}
</p>
</div>
</div>
);
}`;
const react = {
"/App.jsx": App,
"/App.tsx": AppTs,
};
export default {
...react,
};
@@ -0,0 +1,22 @@
const App = `import {DateInput} from "@nextui-org/react";
import {CalendarDate} from "@internationalized/date";
export default function App() {
return (
<div className="flex w-full flex-wrap md:flex-nowrap gap-4">
<DateInput
label={"Birth date"}
placeholderValue={new CalendarDate(1995, 11, 6)}
description={"This is my birth date."}
/>
</div>
);
}`;
const react = {
"/App.jsx": App,
};
export default {
...react,
};
@@ -0,0 +1,23 @@
const App = `import {DateInput} from "@nextui-org/react";
import {CalendarDate, parseDate} from "@internationalized/date";
export default function App() {
return (
<div className="flex w-full flex-wrap md:flex-nowrap gap-4">
<DateInput
label={"Birth date"}
isDisabled
defaultValue={parseDate("2024-04-04")}
placeholderValue={new CalendarDate(1995, 11, 6)}
/>
</div>
);
}`;
const react = {
"/App.jsx": App,
};
export default {
...react,
};
@@ -0,0 +1,26 @@
const App = `import {DateInput} from "@nextui-org/react";
import {CalendarDate, parseDate} from "@internationalized/date";
export default function App() {
return (
<div className="flex w-full flex-wrap md:flex-nowrap gap-4">
<DateInput
label={"Birth date"}
defaultValue={parseDate("2024-04-04")}
placeholderValue={new CalendarDate(1995, 11, 6)}
description={"Thiis is my birth date."}
isInvalid
errorMessage="Please enter a valid date."
className="max-w-xs"
/>
</div>
);
}`;
const react = {
"/App.jsx": App,
};
export default {
...react,
};
@@ -0,0 +1,60 @@
const App = `import {DateInput} from "@nextui-org/react";
import {now, parseAbsoluteToLocal} from "@internationalized/date";
import {useDateFormatter} from "@react-aria/i18n";
export default function App() {
let [date, setDate] = React.useState(parseAbsoluteToLocal("2021-04-07T18:45:22Z"));
return (
<div className="w-full max-w-xl flex flex-col items-start gap-4">
<DateInput
granularity="second"
label="Date and time"
value={date}
onChange={setDate}
/>
<DateInput granularity="day" label="Date" value={date} onChange={setDate} />
<DateInput granularity="second" label="Event date" />
<DateInput
granularity="second"
label="Event date"
placeholderValue={now("America/New_York")}
/>
</div>
);
}`;
const AppTs = `import {DateInput} from "@nextui-org/react";
import {DateValue, now, parseAbsoluteToLocal} from "@internationalized/date";
import {useDateFormatter} from "@react-aria/i18n";
export default function App() {
let [date, setDate] = React.useState<DateValue>(parseAbsoluteToLocal("2021-04-07T18:45:22Z"));
return (
<div className="w-full max-w-xl flex flex-col items-start gap-4">
<DateInput
granularity="second"
label="Date and time"
value={date}
onChange={setDate}
/>
<DateInput granularity="day" label="Date" value={date} onChange={setDate} />
<DateInput granularity="second" label="Event date" />
<DateInput
granularity="second"
label="Event date"
placeholderValue={now("America/New_York")}
/>
</div>
);
}`;
const react = {
"/App.jsx": App,
"/App.tsx": AppTs,
};
export default {
...react,
};
@@ -0,0 +1,22 @@
const App = `import {DateInput} from "@nextui-org/react";
import {parseZonedDateTime} from "@internationalized/date";
export default function App() {
return (
<div className="w-full max-w-xl flex flex-row gap-4">
<DateInput
label="Appointment time"
hideTimeZone
defaultValue={parseZonedDateTime("2022-11-07T00:45[America/Los_Angeles]")}
/>
</div>
);
}`;
const react = {
"/App.jsx": App,
};
export default {
...react,
};
@@ -0,0 +1,23 @@
const App = `import {DateInput} from "@nextui-org/react";
import {parseZonedDateTime} from "@internationalized/date";
export default function App() {
return (
<div className="w-full max-w-xl flex flex-row gap-4">
<DateInput
label="Appointment time"
hourCycle={24}
defaultValue={parseZonedDateTime("2022-11-07T00:45[America/Los_Angeles]")}
granularity={"minute"}
/>
</div>
);
}`;
const react = {
"/App.jsx": App,
};
export default {
...react,
};
@@ -0,0 +1,35 @@
import usage from "./usage";
import disabled from "./disabled";
import readOnly from "./readonly";
import required from "./required";
import variants from "./variants";
import labelPlacements from "./label-placements";
import description from "./description";
import startEndContent from "./start-end-content";
import errorMessage from "./error-message";
import controlled from "./controlled";
import timeZones from "./time-zones";
import granularity from "./granularity";
import minAndMaxDate from "./min-and-max-date";
import internationalCalendar from "./international-calendar";
import hideTimeZone from "./hide-timezone";
import hourlyCycle from "./hourly-cycle";
export const dateInputContent = {
usage,
disabled,
readOnly,
required,
variants,
labelPlacements,
description,
startEndContent,
errorMessage,
controlled,
timeZones,
granularity,
minAndMaxDate,
internationalCalendar,
hideTimeZone,
hourlyCycle,
};
@@ -0,0 +1,40 @@
const App = `import {DateInput} from "@nextui-org/react";
import {now, parseAbsoluteToLocal} from "@internationalized/date";
import {I18nProvider} from "@react-aria/i18n";
export default function App() {
const [date, setDate] = React.useState(parseAbsoluteToLocal("2021-04-07T18:45:22Z"));
return (
<div className="flex flex-col gap-4">
<I18nProvider locale="hi-IN-u-ca-indian">
<DateInput label="Appointment date" value={date} onChange={setDate} />
</I18nProvider>
</div>
);
}`;
const AppTs = `import {DateInput} from "@nextui-org/react";
import {DateValue, now, parseAbsoluteToLocal} from "@internationalized/date";
import {I18nProvider} from "@react-aria/i18n";
export default function App() {
const [date, setDate] = React.useState<DateValue>(parseAbsoluteToLocal("2021-04-07T18:45:22Z"));
return (
<div className="flex flex-col gap-4">
<I18nProvider locale="hi-IN-u-ca-indian">
<DateInput label="Appointment date" value={date} onChange={setDate} />
</I18nProvider>
</div>
);
}`;
const react = {
"/App.jsx": App,
"/App.tsx": AppTs,
};
export default {
...react,
};
@@ -0,0 +1,31 @@
const App = `import {DateInput} from "@nextui-org/react";
import {CalendarDate} from "@internationalized/date";
export default function App() {
const placements = [
"inside",
"outside",
"outside-left",
];
return (
<div className="w-full flex flex-col max-w-sm gap-4">
{placements.map((placement) => (
<DateInput
label="Birth date"
placeholderValue={new CalendarDate(1995, 11, 6)}
description={placement}
labelPlacement={placement}
/>
))}
</div>
);
}`;
const react = {
"/App.jsx": App,
};
export default {
...react,
};

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