Skip to content

Commit

Permalink
fix(select): add button component and update select component
Browse files Browse the repository at this point in the history
  • Loading branch information
jrgarciadev committed Nov 5, 2023
1 parent e7a4711 commit 2399257
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions apps/docs/content/components/select/open-state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export default function App() {
label="Favorite Animal"
placeholder="Select an animal"
defaultSelectedKeys={["cat"]}
onOpenChange={(open) => open !== isOpen && setIsOpen(open)}
className="max-w-xs"
>
{animals.map((animal) => (
Expand Down
1 change: 1 addition & 0 deletions packages/components/select/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
"devDependencies": {
"@nextui-org/theme": "workspace:*",
"@nextui-org/system": "workspace:*",
"@nextui-org/button": "workspace:*",
"@nextui-org/avatar": "workspace:*",
"@nextui-org/input": "workspace:*",
"@nextui-org/chip": "workspace:*",
Expand Down
10 changes: 3 additions & 7 deletions packages/components/select/stories/select.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {select, button} from "@nextui-org/theme";
import {PetBoldIcon, SelectorIcon} from "@nextui-org/shared-icons";
import {Avatar} from "@nextui-org/avatar";
import {Chip} from "@nextui-org/chip";
import {Button} from "@nextui-org/button";
import {Selection} from "@react-types/shared";
import {useInfiniteScroll} from "@nextui-org/use-infinite-scroll";
import {
Expand Down Expand Up @@ -211,17 +212,12 @@ const ControlledOpenTemplate = ({color, variant, ...args}: SelectProps<Animal>)
isOpen={isOpen}
label="Favorite Animal"
variant={variant}
onOpenChange={(open) => open !== isOpen && setIsOpen(open)}
{...args}
>
{items}
</Select>
<button
className={button({className: "max-w-fit"})}
type="button"
onClick={() => setIsOpen(!isOpen)}
>
{isOpen ? "Close" : "Open"}
</button>
<Button onPress={() => setIsOpen(!isOpen)}>{isOpen ? "Close" : "Open"}</Button>
</div>
);
};
Expand Down
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 comments on commit 2399257

@vercel
Copy link

@vercel vercel bot commented on 2399257 Nov 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 2399257 Nov 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.