-
Notifications
You must be signed in to change notification settings - Fork 0
Input Component #5
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
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
1aa3bb8
theming of storybook
nicosammito 9326747
some first development of input component with labels, descriptions, …
nicosammito 48d3348
outsourced the Icon Component and adjusted the styling to match all i…
nicosammito b0165b0
some design changes
nicosammito b5ba664
changing to hidden because of icon glow
nicosammito 1f16f18
made it inherit, so we need to change only one entry for the radius
nicosammito f26f017
changing text for message
nicosammito 6427596
icon and message are now both optional
nicosammito 21158ac
fixed onFocus and onBlur overwriting when set in the Input.Control co…
nicosammito 0beb90a
created types for inside components and implemented forworded ref for…
nicosammito faee4a5
remove tabler-icons from peer dependencies
nicosammito c3b0acb
added comment to svg component in css for better understanding
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 contains hidden or 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,8 @@ | ||
| // .storybook/manager.js | ||
|
|
||
| import { addons } from '@storybook/manager-api'; | ||
| import theme from './theme'; | ||
|
|
||
| addons.setConfig({ | ||
| theme: theme | ||
| }); |
This file contains hidden or 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 hidden or 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,43 @@ | ||
| // .storybook/YourTheme.js | ||
|
|
||
| import { create } from '@storybook/theming/create'; | ||
|
|
||
| export default create({ | ||
| base: 'dark', | ||
| // Typography | ||
| fontBase: '"Ubuntu", sans-serif', | ||
| fontCode: 'monospace', | ||
|
|
||
| brandTitle: 'Code0 Base UI', | ||
| brandUrl: 'https://code0.tech', | ||
| brandImage: 'https://cdn.discordapp.com/attachments/1173726744130375791/1176472242469740604/Logo.png', | ||
| brandTarget: '_self', | ||
|
|
||
| // UI | ||
| colorPrimary: '#70ffb2', | ||
| colorSecondary: '#70ffb2', | ||
| appBg: '#030014', | ||
| booleanBg: "rgba(255,255,255, .1)", | ||
| appContentBg: '#030014', | ||
| appBorderColor: '#91949A', | ||
| borderBottomColor: '91949A', | ||
| borderLeftColor: '91949A', | ||
| borderRightColor: '91949A', | ||
| borderTopColor: '91949A', | ||
| appBorderRadius: 0, | ||
|
|
||
| // Text colors | ||
| textColor: '#ffffff', | ||
| textInverseColor: '#ffffff', | ||
|
|
||
| // Toolbar default and active colors | ||
| barTextColor: 'rgba(255,255,255, .5)', | ||
| barSelectedColor: 'rgba(255,255,255, .75)', | ||
| barBg: '#030014', | ||
|
|
||
| // Form colors | ||
| inputBg: 'rgba(255,255,255, .1)', | ||
| inputBorder: '#91949A', | ||
| inputTextColor: 'rgba(255,255,255, .5)', | ||
| inputBorderRadius: 2, | ||
| }); | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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,39 @@ | ||
| import React, {useEffect, useRef} from "react"; | ||
| import Input from "./Input"; | ||
| import {IconMail} from "@tabler/icons-react"; | ||
|
|
||
| export default { | ||
| title: "Input", | ||
| component: Input | ||
| }; | ||
|
|
||
| export const Mail = () => <Input> | ||
nicosammito marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| <Input.Label>e-mail</Input.Label> | ||
| <Input.Control placeholder={"name@mail.com"}/> | ||
| <Input.Desc>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam</Input.Desc> | ||
| </Input> | ||
|
|
||
|
|
||
| export const Disabled = () => <Input disabled> | ||
| <Input.Control placeholder={"Your Mail"}> | ||
| <Input.Control.Icon><IconMail/></Input.Control.Icon> | ||
| </Input.Control> | ||
| <Input.Desc>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam</Input.Desc> | ||
| </Input> | ||
|
|
||
| export const NotValid = () => <Input valid={false}> | ||
| <Input.Control placeholder={"Your E-Mail"}> | ||
| <Input.Control.Icon><IconMail/></Input.Control.Icon> | ||
| <Input.Control.Message>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor | ||
| invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.</Input.Control.Message> | ||
| </Input.Control> | ||
| <Input.Desc>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam</Input.Desc> | ||
| </Input> | ||
|
|
||
| export const Valid = () => <Input valid> | ||
| <Input.Control placeholder={"Your E-Mail"}> | ||
| <Input.Control.Message>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor | ||
| invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.</Input.Control.Message> | ||
| </Input.Control> | ||
| <Input.Desc>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam</Input.Desc> | ||
| </Input> | ||
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.
Uh oh!
There was an error while loading. Please reload this page.