Skip to content

onboarding modules #1391

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 20 commits into from
Apr 2, 2024
Merged

onboarding modules #1391

merged 20 commits into from
Apr 2, 2024

Conversation

levkk
Copy link
Contributor

@levkk levkk commented Mar 27, 2024

New components

Small table

image

Green heading

image

Blue heading

image

Input with optional icon

image

Dropdown input with search

Dropdown input with backend-powered search.

image

Badges (small)

image

Badges (large)

image

Range input v2

image

Switch v2

image

Radio

image

Select (dropdown) with display/value separation

image

Select supports different values for display in the option and the <input> field. This is useful when display options aren't easily serializable to values the backend can understand.

RGB card

image

Fixes

  • Remove extra padding from the bottom of the dropdown <ul> (now it's 20px top and 20px bottom padding)
  • Add Debug implementation for Component

@levkk levkk marked this pull request as ready for review April 1, 2024 23:02
@levkk levkk requested a review from chillenberger April 1, 2024 23:02
Comment on lines 13 to 15
span.material-symbols-outlined {
color: #{$white};
}
Copy link
Contributor

Choose a reason for hiding this comment

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

You can also just add text-white to the class of this component.

span[data-controller="badges-large-label"] {
padding: 8px;
background: #{$gray-500};
border-radius: 8px;
Copy link
Contributor

Choose a reason for hiding this comment

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

bs-border4-radius or class rounded-2

Copy link
Contributor Author

Choose a reason for hiding this comment

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

--bs-border-radius sets the border radius for Bootstrap components that declare the border-radius: var(--bs-border-radius) in their CSS. This is a new component, so we have to set the border radius with probably rounded-2 as you suggested.

@@ -0,0 +1,6 @@
div[data-controller="cards-rgb"] {
Copy link
Contributor

Choose a reason for hiding this comment

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

I can't tell but If this doesn't have a hover state, it needs one.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right, it doesn't have one. I don't think there is one in the design. I'll flag it for review and follow up with a PR.

@@ -0,0 +1,18 @@
use pgml_components::component;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we just use our text-gradient-blue class and remove this component?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes we can. I think though CSS classes are harder to discover than components. I'm starting to think we should lean on components even more to make our UI more consistent and re-usable. I can see in the future our HTML templates being composed entirely of code like <%+ SomeComponent::new() %>.

@@ -0,0 +1,18 @@
use pgml_components::component;
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as above, can we just just text-gradient-green class here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I should definitely re-use that class here.

export default class extends Controller {
static targets = ["button"];

onClick(e) {
Copy link
Contributor

Choose a reason for hiding this comment

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

div[data-controller="inputs-text-search"] {
.dropdown {
.dropdown-menu {
padding: 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

why not just add p-0 class to html?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because this re-uses the Dropdown component which doesn't support (and shouldn't in my opinion) adding custom classes to an element. This overrides the Dropdown style.

@@ -0,0 +1,19 @@
import { Controller } from "@hotwired/stimulus";

export default class extends Controller {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you want something to limit the query speed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, do we have anything? I think we have underscore and _.debounce?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah I believe it comes from lodash.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah yeah, lodash is the new library replacing underscore. I'm old.

@@ -0,0 +1,160 @@
<% use crate::components::tables::small::*; %>
Copy link
Contributor

Choose a reason for hiding this comment

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

No need to have playground and demo.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah yeah, I was looking for playground and didn't find it. That's weird...

Copy link
Contributor

Choose a reason for hiding this comment

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

Playground was made so long ago it is still hidden in the templates and is not a component. It should probably be refactored into a component. Maybe we move the playground stuff to your demo page an remove playground.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Works for me. It's just a place to make sure components work before using them in our other apps.

@@ -120,6 +120,7 @@ $hp-white: #{$gray-200};
// Background Colors
$bg-white: #F8FAFC;
$bg-black: #0D0D0E;
$bg-black-1: #17181A;
Copy link
Contributor

Choose a reason for hiding this comment

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

We shouldn't need to add any colors. this is gray-800. If we need this variable to it like $bg-black-1: #{$gray-800}; or just use gray-800 in the css you are trying to use this for.

@levkk
Copy link
Contributor Author

levkk commented Apr 2, 2024

Going to probably have to make more changes as I integrate this into our main app. More PRs to follow.

@levkk levkk merged commit b354214 into master Apr 2, 2024
@levkk levkk deleted the levkk-onboarding-v2 branch April 2, 2024 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy