Skip to content

Commit

Permalink
feat(lsc): reorganization
Browse files Browse the repository at this point in the history
  • Loading branch information
johnbchron committed Dec 10, 2024
1 parent 5d33b32 commit 37bbc24
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 13 deletions.
4 changes: 3 additions & 1 deletion crates/lsc/src/button.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
//! Button component and supporting types.
use enum_iterator::Sequence;
use leptos::{either::Either, prelude::*};
use serde::{Deserialize, Serialize};

use crate::NamedColor;
use crate::colors::NamedColor;

/// The color of an `lsc` [`Button`].
#[derive(
Expand Down
2 changes: 2 additions & 0 deletions crates/lsc/src/colors.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! Named colors, inherited from Radix.
use enum_iterator::Sequence;
use serde::{Deserialize, Serialize};

Expand Down
9 changes: 3 additions & 6 deletions crates/lsc/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
//! Leptos Styled Components
mod button;
mod colors;
pub mod button;
pub mod colors;
pub mod icons;
mod link;

/// Re-export of the `radix_leptos_icons` crate.
pub use self::{button::*, colors::*, link::*};
pub mod link;
4 changes: 3 additions & 1 deletion crates/lsc/src/link.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
//! Link component and supporting types.
use enum_iterator::Sequence;
use leptos::prelude::*;
use serde::{Deserialize, Serialize};

use crate::NamedColor;
use crate::colors::NamedColor;

/// The size of an `lsc` [`Link`].
#[derive(
Expand Down
2 changes: 1 addition & 1 deletion crates/site-app/src/components/header.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use leptos::prelude::*;
use lsc::*;
use lsc::{button::*, link::*};

use crate::AuthStatus;

Expand Down
4 changes: 2 additions & 2 deletions crates/site-app/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ pub fn App() -> impl IntoView {
<Router>
<Routes fallback=|| "Page not found.".into_view()>
<Route path=path!("/") view=HomePage/>
<Route path=path!("/component-testing/link") view=lsc::LinkMatrixTestPage/>
<Route path=path!("/component-testing/button") view=lsc::ButtonMatrixTestPage/>
<Route path=path!("/component-testing/link") view=lsc::link::LinkMatrixTestPage/>
<Route path=path!("/component-testing/button") view=lsc::button::ButtonMatrixTestPage/>
</Routes>
</Router>
</PageContainer>
Expand Down
4 changes: 2 additions & 2 deletions crates/site-app/src/pages/home_page.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use leptos::prelude::*;
use lsc::*;
use lsc::{button::*, icons::*};

use crate::components::Section;

Expand All @@ -21,7 +21,7 @@ pub fn HomePage() -> impl IntoView {
<div class="h-8" />
<Button href="/sign-up" color=ButtonColor::Primary size={ButtonSize::Large} {..} class=("mx-8", move || true)>
"Get started"
<icons::ArrowRightIcon {..} class="size-5" />
<ArrowRightIcon {..} class="size-5" />
</Button>
</div>
</Section>
Expand Down

0 comments on commit 37bbc24

Please sign in to comment.