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

ClayAlert with action button #2765

Closed
dgarciasarai opened this issue Dec 3, 2019 · 10 comments · Fixed by #2827
Closed

ClayAlert with action button #2765

dgarciasarai opened this issue Dec 3, 2019 · 10 comments · Fixed by #2827
Assignees
Labels
3.x comp: clay-components Issues related to Clay components. (e.g ClayCard, ClayLabel...) comp: clay-css Issues related to Clay CSS type: feature request Issues that are open to adding new features

Comments

@dgarciasarai
Copy link
Contributor

dgarciasarai commented Dec 3, 2019

I have an use case to use an Alert with an action in the A/B Testing sidebar when a test has a winner variant. I found this patter in Lexicon https://liferay.design/lexicon/core-components/alerts/ but not in Clay.

Screenshot 2019-12-03 at 09 26 49

What is your question?

Is this supported in ClayAlert?

/cc @drakonux @laugardie

@drakonux
Copy link
Member

drakonux commented Dec 3, 2019

Hi Sarai!

Is this supported in ClayAlert?

At least it should be in Clay v3. Duurii documented it on LEXI-509 cc\ @bryceosterhaus

@matuzalemsteles
Copy link
Member

@pat270 do we need any special markup to reach this result?

@bryceosterhaus
Copy link
Member

bryceosterhaus commented Dec 5, 2019

I was able to create the layout with react components, you may need to add some custom styles for the button color. https://codesandbox.io/s/clay2765-s039q

@edalgrin
Copy link

A few months ago, I created an example using outline-success instead of secondary

The problem was the background and the solutions we found were:

  1. Add the missing CSS code for the single usage of this component
  2. Add a new variation of buttons with the white background
  3. Add a CSS rule for the outlined buttons inside the Alert component

The problem with 1st solution is the duplicated code we need to create to use this variation more than once
The problem with the 2nd solution is that we are adding many lines of code for a component we may be using just once
The problem with the 3rd solution is that we may need to use this variation outside the Alert component for new designs

There is a 4th solution we should explore, changing the default outlined versions of buttons in Atlas and the current usages of these buttons but it doesn't seem an easy task

image

@pat270
Copy link
Member

pat270 commented Dec 10, 2019

@matuzalemsteles I remember from a while ago @victorvalle saying this doesn't need to be handled in Clay CSS. I'm not 100% sure, I can't seem to find anything on it. We can add button variants in alerts if we need. The selector will probably be .alert-success .alert-btn.

@pat270 pat270 added the comp: clay-css Issues related to Clay CSS label Dec 10, 2019
@victorvalle
Copy link

I don't remember what I said :(. For the moment these button variants are only needed in alerts.
A way of doing it is just creating them as button variants and Lexicon will document how we expect people to use them and where to not use them. With this clarification, it should work out well.

@matuzalemsteles
Copy link
Member

Hmm, we will probably need some extra markup to align the button with the text and add extra spacing...

@pat270
Copy link
Member

pat270 commented Dec 11, 2019

@matuzalemsteles that is probably the case.

@pat270 pat270 added type: feature request Issues that are open to adding new features 3.x and removed type: question labels Dec 11, 2019
@drakonux
Copy link
Member

Lima-team is asking for this component in Alerts. Check LEXI-509 Any update on the progress of this ticket?

@pat270 pat270 self-assigned this Dec 24, 2019
@pat270 pat270 added the comp: clay-components Issues related to Clay components. (e.g ClayCard, ClayLabel...) label Dec 26, 2019
pat270 added a commit to pat270/clay that referenced this issue Dec 26, 2019
pat270 added a commit to pat270/clay that referenced this issue Dec 26, 2019
…t-footer`, and `.alert .btn-group-item`

feat(clay-css): Alert adds Sass maps `$alert-btn`, `$alert-btn-group-item`, `$alert-footer`, `$alert-autofit-row`, `$alert-primary-btn`, `$alert-secondary-btn`, `$alert-success-btn`, `$alert-info-btn`, `$alert-warning-btn`, `$alert-danger-btn`, `$alert-light-btn`, `$alert-dark-btn`

fixes liferay#2765
pat270 added a commit to pat270/clay that referenced this issue Dec 26, 2019
pat270 added a commit to pat270/clay that referenced this issue Dec 26, 2019
…t-footer`, and `.alert .btn-group-item`

feat(clay-css): Alert adds Sass maps `$alert-btn`, `$alert-btn-group-item`, `$alert-footer`, `$alert-autofit-row`, `$alert-primary-btn`, `$alert-secondary-btn`, `$alert-success-btn`, `$alert-info-btn`, `$alert-warning-btn`, `$alert-danger-btn`, `$alert-light-btn`, `$alert-dark-btn`

fixes liferay#2765
@pat270
Copy link
Member

pat270 commented Dec 26, 2019

@matuzalemsteles I sent a pr with this pattern. The markup should look something like:

<div class="alert alert-dismissible alert-notification alert-danger" role="alert">
	<div class="autofit-row alert-autofit-row">
		<div class="autofit-col">
			<div class="autofit-section">
				<span class="alert-indicator">
					...
				</span>
			</div>
		</div>
		<div class="autofit-col autofit-col-expand">
			<div class="autofit-section">
				...
				<div class="alert-footer">
					<div class="btn-group">
						<div class="btn-group-item">
							<button class="btn alert-btn" type="button">Refresh</button>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	<button aria-label="Close" class="close" data-dismiss="alert" type="button"></button>
</div>

marcoscv-work pushed a commit that referenced this issue Dec 27, 2019
marcoscv-work pushed a commit that referenced this issue Dec 27, 2019
…t-footer`, and `.alert .btn-group-item`

feat(clay-css): Alert adds Sass maps `$alert-btn`, `$alert-btn-group-item`, `$alert-footer`, `$alert-autofit-row`, `$alert-primary-btn`, `$alert-secondary-btn`, `$alert-success-btn`, `$alert-info-btn`, `$alert-warning-btn`, `$alert-danger-btn`, `$alert-light-btn`, `$alert-dark-btn`

fixes #2765
bryceosterhaus pushed a commit to bryceosterhaus/clay that referenced this issue May 19, 2020
bryceosterhaus pushed a commit to bryceosterhaus/clay that referenced this issue May 19, 2020
…t-footer`, and `.alert .btn-group-item`

feat(clay-css): Alert adds Sass maps `$alert-btn`, `$alert-btn-group-item`, `$alert-footer`, `$alert-autofit-row`, `$alert-primary-btn`, `$alert-secondary-btn`, `$alert-success-btn`, `$alert-info-btn`, `$alert-warning-btn`, `$alert-danger-btn`, `$alert-light-btn`, `$alert-dark-btn`

fixes liferay#2765
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.x comp: clay-components Issues related to Clay components. (e.g ClayCard, ClayLabel...) comp: clay-css Issues related to Clay CSS type: feature request Issues that are open to adding new features
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants