-
Notifications
You must be signed in to change notification settings - Fork 0
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
Dropdown Component + some general adjustments #21
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
2d231dc
dump commit for dropdown
nicosammito b0b0d7d
removing build scripts
nicosammito 859cd85
removing unnecessary param for color because border color will always…
nicosammito 23dda89
removing unnecessary param for color because border color will always…
nicosammito 8b3b4de
adding some dropdowns for testing
nicosammito c3cd940
adding item-group and item
nicosammito 20784b4
adding item-group and item
nicosammito d29c9cf
adding item-group and item
nicosammito 568d42c
possible fix to the margin-bottom problem inside the ButtonGroup
nicosammito File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,58 @@ | ||
import commonjs from "@rollup/plugin-commonjs"; | ||
import resolve from "@rollup/plugin-node-resolve"; | ||
import commonjs from "@rollup/plugin-commonjs"; | ||
import typescript from "@rollup/plugin-typescript"; | ||
import dts from "rollup-plugin-dts"; | ||
|
||
import postcss from "rollup-plugin-postcss"; | ||
import visualizer from 'rollup-plugin-visualizer'; | ||
import dts from "rollup-plugin-dts"; | ||
import {getFiles} from "./scripts/buildUtils"; | ||
|
||
const packageJson = require("./package.json"); | ||
const extensions = ['.js', '.ts', '.jsx', '.tsx']; | ||
const excludeExtensions = [ | ||
'test.js', | ||
'test.ts', | ||
'test.jsx', | ||
'test.tsx', | ||
'stories.js', | ||
'stories.ts', | ||
'stories.jsx', | ||
'stories.tsx', | ||
]; | ||
|
||
export default [ | ||
{ | ||
export default [{ | ||
input: "src/index.ts", | ||
output: [ | ||
{ | ||
file: packageJson.main, | ||
format: "cjs", | ||
sourcemap: false, | ||
}, | ||
{ | ||
file: packageJson.module, | ||
format: "esm", | ||
sourcemap: false, | ||
}, | ||
{ | ||
file: packageJson.main, | ||
format: "cjs", | ||
sourcemap: false, | ||
}, | ||
{ | ||
file: packageJson.module, | ||
format: "esm", | ||
sourcemap: false, | ||
}, | ||
], | ||
plugins: [ | ||
resolve(), | ||
commonjs(), | ||
/* for @rollup/plugin-typescript */ | ||
typescript({ | ||
tsconfig: "./tsconfig.json", | ||
exclude: ["**/__stories__", "**/*.stories.tsx"] | ||
}), | ||
postcss(), | ||
resolve(), | ||
commonjs(), | ||
typescript({ | ||
tsconfig: "./tsconfig.json", | ||
declaration: true, | ||
declarationDir: 'dist', | ||
exclude: ["**/__stories__", "**/*.stories.tsx"] | ||
}), | ||
postcss(), | ||
visualizer({ | ||
filename: 'bundle-analysis.html', | ||
open: false, | ||
}), | ||
], | ||
external: ["react", "react-dom"], | ||
}, | ||
{ | ||
}, { | ||
input: "dist/esm/index.d.ts", | ||
output: [{ file: "dist/index.d.ts", format: "esm" }], | ||
output: [{file: "dist/index.d.ts", format: "esm"}], | ||
plugins: [dts()], | ||
external: [/\.(css|less|scss)$/], | ||
}, | ||
]; | ||
}] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
import {Meta} from "@storybook/react"; | ||
import React from "react"; | ||
import Dropdown from "./Dropdown"; | ||
import Button from "../button/Button"; | ||
import {IconAbc, IconMail, IconSearch} from "@tabler/icons-react"; | ||
import ButtonGroup from "../button-group/ButtonGroup"; | ||
import Input from "../input/Input"; | ||
|
||
const meta: Meta = { | ||
title: "Dropdown", | ||
component: Dropdown | ||
} | ||
|
||
export default meta; | ||
|
||
export const Dropdowns = () => { | ||
return <> | ||
<Dropdown position={"bottom"} align={"start"}> | ||
<Dropdown.Trigger> | ||
<Button>Open Dropdown</Button> | ||
</Dropdown.Trigger> | ||
<Dropdown.Menu> | ||
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam | ||
</Dropdown.Menu> | ||
</Dropdown> | ||
|
||
|
||
<Dropdown position={"bottom"} align={"start"}> | ||
<Dropdown.Trigger> | ||
<Button>Open Dropdown</Button> | ||
</Dropdown.Trigger> | ||
<Dropdown.Menu> | ||
<Dropdown.Header> | ||
<Input.Control placeholder={"search..."}> | ||
<Input.Control.Icon><IconSearch/></Input.Control.Icon> | ||
</Input.Control> | ||
</Dropdown.Header> | ||
<Dropdown.Group> | ||
<Dropdown.Group.Item> | ||
Item 1 | ||
</Dropdown.Group.Item> | ||
<Dropdown.Group.Item> | ||
Item 2 | ||
</Dropdown.Group.Item> | ||
</Dropdown.Group> | ||
<Dropdown.Footer> | ||
That's the footer | ||
</Dropdown.Footer> | ||
</Dropdown.Menu> | ||
</Dropdown> | ||
|
||
<ButtonGroup> | ||
{ | ||
["secondary", "secondary", "secondary", "secondary"].map((value, index) => { | ||
// @ts-ignore | ||
return (index % 2 == 0) ? <Button disabled={(index % 2) == 0} variant={value}> | ||
{(index % 2) == 0 ? <Button.Icon><IconAbc/></Button.Icon> : null} | ||
{value} | ||
</Button> : <Dropdown position={"bottom"} align={"start"}> | ||
<Dropdown.Trigger> | ||
<Button disabled={(index % 2) == 0} variant={"secondary"}> | ||
{(index % 2) == 0 ? <Button.Icon><IconAbc/></Button.Icon> : null} | ||
{value} | ||
</Button> | ||
</Dropdown.Trigger> | ||
<Dropdown.Menu> | ||
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam | ||
</Dropdown.Menu> | ||
</Dropdown> | ||
}) | ||
} | ||
</ButtonGroup> | ||
</> | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this intended to be a dependency instead of a dev devependency? Based on the name, I would expect it as dev dependency.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, that's a mistake. Will be changed in a future MR.