Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2.2.0 🕹️ #1777

Merged
merged 20 commits into from
Nov 3, 2023
Merged

v2.2.0 🕹️ #1777

merged 20 commits into from
Nov 3, 2023

Conversation

jrgarciadev
Copy link
Member

@jrgarciadev jrgarciadev commented Oct 16, 2023

Closes #172
Closes #886
Closes #888
Closes #1685
Closes #694
Closes #1780
Closes #1737
Closes #1650
Closes #1804
Closes #1822
Closes #760
Closes #1670
Closes #1654
Closes #1534
Closes #1397
Closes #1650
Closes #1691
Closes #1837
Closes #1761

📝 Description

💣 Is this a breaking change (Yes/No): Yes

📝 Additional Information

Breaking Changes

  • Popover API changed to improve the arrow implementation, arrow is now a pseudo-element, which allows the popover to also move the arrow altogether, this change impacts the Popover, Tooltip and Select implementations.

Popover changes:

  <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",
        ],
      }}
    >
      <PopoverTrigger>
        <Button>Open Popover</Button>
      </PopoverTrigger>
      <PopoverContent>
        {(titleProps) => (
          <div className="px-1 py-2">
            <h3 className="text-small font-bold" {...titleProps}>
              Popover Content
            </h3>
            <div className="text-tiny">This is the popover content</div>
          </div>
        )}
      </PopoverContent>
  </Popover>

Tooltip changes:

 <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:

 <Select
      items={users}
      label="Assigned to"
      className="max-w-xs"
      variant="bordered"
      classNames={{
        label: "group-data-[filled=true]:-translate-y-5",
        trigger: "min-h-unit-16",
        listboxWrapper: "max-h-[400px]",
      }}
      listboxProps={{
        itemClasses: {
          base: [
            "rounded-md",
            "text-default-500",
            "transition-opacity",
            "data-[hover=true]:text-foreground",
            "data-[hover=true]:bg-default-100",
            "dark:data-[hover=true]:bg-default-50",
            "data-[selectable=true]:focus:bg-default-50",
            "data-[pressed=true]:opacity-70",
            "data-[focus-visible=true]:ring-default-500",
          ],
        },
      }}
      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
        },
      }}
      renderValue={(items) => {
        return items.map((item) => (
          <div key={item.key} className="flex items-center gap-2">
            <Avatar
              alt={item.data.name}
              className="flex-shrink-0"
              size="sm"
              src={item.data.avatar}
            />
            <div className="flex flex-col">
              <span>{item.data.name}</span>
              <span className="text-default-500 text-tiny">({item.data.email})</span>
            </div>
          </div>
        ));
      }}
    >
      {(user) => (
        <SelectItem key={user.id} textValue={user.name}>
          <div className="flex gap-2 items-center">
            <Avatar alt={user.name} className="flex-shrink-0" size="sm" src={user.avatar} />
            <div className="flex flex-col">
              <span className="text-small">{user.name}</span>
              <span className="text-tiny text-default-400">{user.email}</span>
            </div>
          </div>
        </SelectItem>
      )}
    </Select>
  );
}`;

Dropdown Changes

    <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
      }}
    >

📝 Additional Information

* 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 <[email protected]>

* 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 <[email protected]>

* 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 <[email protected]>
@changeset-bot
Copy link

changeset-bot bot commented Oct 16, 2023

🦋 Changeset detected

Latest commit: ea19a78

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 59 packages
Name Type
@nextui-org/button Patch
@nextui-org/listbox Patch
@nextui-org/tabs Patch
@nextui-org/theme Patch
@nextui-org/use-aria-accordion-item Patch
@nextui-org/use-aria-modal-overlay Patch
@nextui-org/use-aria-toggle-button Patch
@nextui-org/use-aria-multiselect Patch
@nextui-org/react-rsc-utils Patch
@nextui-org/use-aria-accordion Patch
@nextui-org/shared-icons Patch
@nextui-org/pagination Patch
@nextui-org/use-aria-button Patch
@nextui-org/accordion Patch
@nextui-org/use-disclosure Patch
@nextui-org/aria-utils Patch
@nextui-org/checkbox Patch
@nextui-org/dropdown Patch
@nextui-org/progress Patch
@nextui-org/use-aria-link Patch
@nextui-org/divider Patch
@nextui-org/popover Patch
@nextui-org/snippet Patch
@nextui-org/tooltip Patch
@nextui-org/avatar Patch
@nextui-org/navbar Patch
@nextui-org/select Patch
@nextui-org/slider Patch
@nextui-org/switch Patch
@nextui-org/badge Patch
@nextui-org/input Patch
@nextui-org/modal Patch
@nextui-org/radio Patch
@nextui-org/table Patch
@nextui-org/card Patch
@nextui-org/chip Patch
@nextui-org/link Patch
@nextui-org/menu Patch
@nextui-org/user Patch
@nextui-org/kbd Patch
@nextui-org/system Patch
@nextui-org/react Patch
@nextui-org/breadcrumbs Patch
@nextui-org/framer-transitions Patch
@nextui-org/autocomplete Patch
@nextui-org/use-aria-press Patch
@nextui-org/test-utils Patch
@nextui-org/ripple Patch
@nextui-org/system-rsc Patch
@nextui-org/use-data-scroll-overflow Patch
@nextui-org/scroll-shadow Patch
@nextui-org/stories-utils Patch
@nextui-org/skeleton Patch
@nextui-org/spinner Patch
@nextui-org/spacer Patch
@nextui-org/image Patch
@nextui-org/code Patch
@nextui-org/react-utils Patch
@nextui-org/use-real-shape Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@jrgarciadev jrgarciadev added this to the v2.2.0 🕹️ milestone Oct 16, 2023
@vercel
Copy link

vercel bot commented Oct 16, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
nextui-docs-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 3, 2023 0:18am
nextui-storybook-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 3, 2023 0:18am

@jrgarciadev jrgarciadev changed the title feat: Slider Component (#1686) v2.2.0 🕹️ Oct 16, 2023
@jrgarciadev jrgarciadev marked this pull request as ready for review October 16, 2023 18:38
@jrgarciadev jrgarciadev marked this pull request as draft October 16, 2023 18:39
jrgarciadev and others added 4 commits October 16, 2023 18:39
* 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 <[email protected]>

* 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 <[email protected]>

* 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 <[email protected]>
* feat: added RTL support to accordion component

* Create healthy-cobras-crash.md
* 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 component

* feat: added RTL support to button component

* Create orange-bobcats-kneel.md

* Update button.ts
* refactor(root): styles refactor

* chore(tabs): remove needless type extends

* fix(tabs): typecheck
* 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
…1778)

* Set `data-focused` in handle

* Style focused handle on top

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

* chore: add changeset

* fix(button): remove repeating code
* feat(scroll-shadow): logic improved, controlled support added

* feat(scroll-shadow): controlled visibility

* fix(scroll-shadow): visibility tests
@sayem314
Copy link

sayem314 commented Nov 1, 2023

Any ETA for release? Need range slider by next week or must go with 3rd party lib by then.

* 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(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
@toxsick
Copy link

toxsick commented Nov 3, 2023

Hey @jrgarciadev, the new Autocomplete component looks awesome, but is there any chance we can have something like renderValue of the Select to render a custom selected values?

Thanks for the awesome work!

@jrgarciadev
Copy link
Member Author

Hey @jrgarciadev, the new Autocomplete component looks awesome, but is there any chance we can have something like renderValue of the Select to render a custom selected values?

Thanks for the awesome work!

Hey @toxsick thanks!, we plan to add custom render value support later, once we include the multiple selection mode

@jrgarciadev jrgarciadev marked this pull request as ready for review November 3, 2023 13:59
@jrgarciadev jrgarciadev merged commit 7abd689 into main Nov 3, 2023
6 checks passed
@jrgarciadev jrgarciadev deleted the v2.2.0 branch November 3, 2023 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment