- Notifications
You must be signed in to change notification settings - Fork352
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
onboarding modules#1391
Changes fromall commits
1b610ef5ad0db4de14827675d20a39d9327f3365297b14db0a62a18edf67e9c1d7ea8457089fd47c4b81b2f37a7c1467d5b1557842c5396529c109b6fe6361a6aebfcaefb18cFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| span[data-controller="badges-large-label"] { | ||
| padding: 8px; | ||
| background: #{$gray-500}; | ||
| font-weight: #{$font-weight-medium}; | ||
| border: 1px solid #{$neon-tint-100}; | ||
| &.active { | ||
| background: #{$neon-tint-100}; | ||
| border: 1px solid #{$neon-tint-600}; | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| use crate::components::stimulus::StimulusAction; | ||
| use pgml_components::component; | ||
| use sailfish::TemplateOnce; | ||
| #[derive(Clone, Debug)] | ||
| pub struct LabelCloseOptions { | ||
| pub action: StimulusAction, | ||
| pub url: String, | ||
| } | ||
| #[derive(TemplateOnce, Default)] | ||
| #[template(path = "badges/large/label/template.html")] | ||
| pub struct Label { | ||
| value: String, | ||
| close_options: Option<LabelCloseOptions>, | ||
| active: String, | ||
| } | ||
| impl Label { | ||
| pub fn new(value: &str) -> Label { | ||
| Label { | ||
| value: value.into(), | ||
| close_options: None, | ||
| active: "".into(), | ||
| } | ||
| } | ||
| pub fn close_options(mut self, options: LabelCloseOptions) -> Label { | ||
| self.close_options = Some(options); | ||
| self | ||
| } | ||
| pub fn active(mut self) -> Label { | ||
| self.active = "active".into(); | ||
| self | ||
| } | ||
| } | ||
| component!(Label); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| <% use crate::components::badges::large::label::LabelCloseOptions; %> | ||
| <span data-controller="badges-large-label" class="d-inline-flex gap-2 align-items-center rounded-2 <%= active %>"> | ||
| <span><%= value %></span> | ||
| <% if let Some(LabelCloseOptions { action, url }) = close_options { %> | ||
| <a href="<%= url %>" data-action="<%= action %>" class="d-inline-flex align-items-center"> | ||
| <span class="material-symbols-outlined text-white"> | ||
| close | ||
| </span> | ||
| </a> | ||
| <% } %> | ||
| </span> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| // This file is automatically generated. | ||
| // You shouldn't modify it manually. | ||
| // src/components/badges/large/label | ||
| pub mod label; | ||
| pub use label::Label; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| // This file is automatically generated. | ||
| // You shouldn't modify it manually. | ||
| // src/components/badges/large | ||
| pub mod large; | ||
| // src/components/badges/small | ||
| pub mod small; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| span[data-controller="badges-small-label"] { | ||
| span { | ||
| font-size: 12px; | ||
| font-weight: #{$font-weight-normal}; | ||
| } | ||
| background: #{$gray-800}; | ||
| padding: 4px 8px; | ||
| border-radius: 4px; | ||
| text-transform: uppercase; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| use pgml_components::component; | ||
| use sailfish::TemplateOnce; | ||
| #[derive(TemplateOnce, Default)] | ||
| #[template(path = "badges/small/label/template.html")] | ||
| pub struct Label { | ||
| value: String, | ||
| image_url: String, | ||
| } | ||
| impl Label { | ||
| pub fn check_circle(value: &str) -> Label { | ||
| Label { | ||
| value: value.into(), | ||
| image_url: "/dashboard/static/images/icons/check_circle.svg".to_string(), | ||
| } | ||
| } | ||
| pub fn cancel(value: &str) -> Label { | ||
| Label { | ||
| value: value.into(), | ||
| image_url: "/dashboard/static/images/icons/cancel.svg".to_string(), | ||
| } | ||
| } | ||
| pub fn outbound(value: &str) -> Label { | ||
| Label { | ||
| value: value.into(), | ||
| image_url: "/dashboard/static/images/icons/outbound.svg".to_string(), | ||
| } | ||
| } | ||
| pub fn download_for_offline(value: &str) -> Label { | ||
| Label { | ||
| value: value.into(), | ||
| image_url: "/dashboard/static/images/icons/download_for_offline.svg".to_string(), | ||
| } | ||
| } | ||
| pub fn forward_circle(value: &str) -> Label { | ||
| Label { | ||
| value: value.into(), | ||
| image_url: "/dashboard/static/images/icons/forward_circle.svg".to_string(), | ||
| } | ||
| } | ||
| } | ||
| component!(Label); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| <span data-controller="badges-small-label" class="d-inline-flex gap-2 align-items-center"> | ||
| <img src="<%= image_url %>" alt="icon" aria-hidden="true" width="14" height="15"> | ||
| <span><%= value %></span> | ||
| </span> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| // This file is automatically generated. | ||
| // You shouldn't modify it manually. | ||
| // src/components/badges/small/label | ||
| pub mod label; | ||
| pub use label::Label; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| use pgml_components::{component, Component}; | ||
| use sailfish::TemplateOnce; | ||
| #[derive(TemplateOnce)] | ||
| #[template(path = "cards/rgb/template.html")] | ||
| pub struct Rgb { | ||
| value: Component, | ||
| active: bool, | ||
| link: Option<String>, | ||
| } | ||
| impl Default for Rgb { | ||
| fn default() -> Self { | ||
| Rgb::new("RGB card".into()) | ||
| } | ||
| } | ||
| impl Rgb { | ||
| pub fn new(value: Component) -> Rgb { | ||
| Rgb { | ||
| value, | ||
| active: false, | ||
| link: None, | ||
| } | ||
| } | ||
| pub fn active(mut self) -> Self { | ||
| self.active = true; | ||
| self | ||
| } | ||
| pub fn link(mut self, link: &str) -> Self { | ||
| self.link = Some(link.to_string()); | ||
| self | ||
| } | ||
| } | ||
| component!(Rgb); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| div[data-controller="cards-rgb"] { | ||
Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. | ||
| .card { | ||
| --bs-card-bg: transparent; | ||
| --bs-card-border-color: #{$gray-700}; | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| import { Controller } from "@hotwired/stimulus"; | ||
| export default class extends Controller { | ||
| // Activate this card (add RGB). | ||
| active() { | ||
| this.element | ||
| .querySelector(".card") | ||
| .classList.add("main-gradient-border-card-1"); | ||
| } | ||
| // Deactivate this card (remove RGB). | ||
| inactive() { | ||
| this.element | ||
| .querySelector(".card") | ||
| .classList.remove("main-gradient-border-card-1"); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| <% let active = if active { "main-gradient-border-card-1 active" } else { "" }; %> | ||
| <div data-controller="cards-rgb"> | ||
| <div class="card <%= active %>"> | ||
| <div class="card-body"> | ||
| <%+ value %> | ||
| <% if let Some(link) = link { %> | ||
| <a href="<%= link %>" class="stretched-link"></a> | ||
| <% } %> | ||
| </div> | ||
| </div> | ||
| </div> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| <% if let Some(src) = src { %> | ||
| <turbo-frame src="<%= src %>" id="<%= id %>"> | ||
| </turbo-frame> | ||
| <% } else { %> | ||
| <turbo-frame id="<%= id %>"> | ||
| <%+ content %> | ||
| </turbo-frame> | ||
| <% } %> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| <% for item in items { %> | ||
| <%+ item %> | ||
| <% } %> |
Uh oh!
There was an error while loading.Please reload this page.