-
Notifications
You must be signed in to change notification settings - Fork 3
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
Component/input group #1405
Merged
Merged
Component/input group #1405
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
d658a3a
Add new Input Group component and no wrap to button component
AriannaChau 19ee4d6
Remove margin from stylesheet and add demo styles
AriannaChau 6e6ffad
Change documentation
AriannaChau 20b37be
Add changeset
AriannaChau dd18154
Lint test
AriannaChau 15d87ba
Remove unused line.
AriannaChau 5d7189b
Prevent double borders
AriannaChau a601947
Update src/components/input-group/demo/input-group-demo.twig
AriannaChau 5f5c23d
Update src/components/input-group/input-group.scss
AriannaChau e1388c4
Update src/components/input-group/input-group.scss
AriannaChau 4d4e1bf
Delete unused scss file
AriannaChau 4010743
Merge branch 'component/input-group' of https://github.com/cloudfour/…
AriannaChau 3e21750
Refine scss file
AriannaChau 0f0ce3b
Improve code sample
AriannaChau b6b7b95
Change input group component to an object
AriannaChau 179cc83
Update .changeset/chatty-papayas-juggle.md
AriannaChau d4ab62b
Update src/objects/input-group/demo/input-group-demo.twig
AriannaChau 66271b4
Update src/objects/input-group/demo/input-group-demo.twig
AriannaChau de33088
Update src/objects/input-group/input-group.stories.mdx
AriannaChau 276427f
Update src/objects/input-group/input-group.stories.mdx
AriannaChau 569d272
Update src/objects/input-group/input-group.stories.mdx
AriannaChau 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 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,5 @@ | ||
--- | ||
'@cloudfour/patterns': minor | ||
--- | ||
|
||
Add Input Group object |
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,17 @@ | ||
{% embed '@cloudfour/objects/rhythm/rhythm.twig' %} | ||
{% block content %} | ||
{% embed '@cloudfour/objects/input-group/input-group.twig' %} | ||
{% block content %} | ||
{% include '@cloudfour/components/button/button.twig' only %} | ||
{% include '@cloudfour/components/input/input.twig' only %} | ||
{% endblock %} | ||
{% endembed %} | ||
|
||
{% embed '@cloudfour/objects/input-group/input-group.twig' %} | ||
{% block content %} | ||
{% include '@cloudfour/components/input/input.twig' only %} | ||
{% include '@cloudfour/components/button/button.twig' only %} | ||
{% endblock %} | ||
{% endembed %} | ||
{% endblock %} | ||
{% endembed %} |
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,19 @@ | ||
@use "../../compiled/tokens/scss/size"; | ||
|
||
.o-input-group { | ||
display: flex; | ||
|
||
& > :not(:first-child) { | ||
border-bottom-left-radius: 0; | ||
border-top-left-radius: 0; | ||
} | ||
|
||
& > :not(:last-child) { | ||
border-bottom-right-radius: 0; | ||
border-top-right-radius: 0; | ||
} | ||
|
||
& > * + * { | ||
margin-left: -(size.$edge-medium); | ||
} | ||
} |
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,35 @@ | ||
import { Story, Canvas, Meta } from '@storybook/addon-docs/blocks'; | ||
// The '!!raw-loader!' syntax is a non-standard, Webpack-specific, syntax. | ||
// See: https://github.com/webpack-contrib/raw-loader#examples | ||
// For now, it seems likely Storybook is pretty tied to Webpack, therefore, we are | ||
// okay with the following Webpack-specific raw loader syntax. It's better to leave | ||
// the ESLint rule enabled globally, and only thoughtfully disable as needed (e.g. | ||
// within a Storybook docs page and not within an actual component). | ||
// This can be revisited in the future if Storybook no longer relies on Webpack. | ||
// eslint-disable-next-line @cloudfour/import/no-webpack-loader-syntax | ||
import inputGroupDemoSource from '!!raw-loader!./demo/input-group-demo.twig'; | ||
import inputGroupDemo from './demo/input-group-demo.twig'; | ||
import './input-group.scss'; | ||
|
||
<Meta title="Objects/Input Group" /> | ||
|
||
# Input Group | ||
|
||
The Input Group object accepts controls like [Button](/story/components-button--button-element) and [Input](/story/components-input--text-elements), displaying them adjacent to one another with no whitespace between. This is useful for presenting minimal forms, such as search bars. | ||
|
||
Buttons and inputs can be put in whatever order you choose. | ||
|
||
<Canvas> | ||
<Story | ||
name="Example" | ||
parameters={{ | ||
docs: { | ||
source: { | ||
code: inputGroupDemoSource, | ||
}, | ||
}, | ||
}} | ||
> | ||
{inputGroupDemo} | ||
</Story> | ||
</Canvas> |
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,3 @@ | ||
<div class="o-input-group"> | ||
{% block content %} {% endblock %} | ||
</div> |
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.
👍