Skip to content

Commit

Permalink
[FLORA-388] Reverse depenencies search bar
Browse files Browse the repository at this point in the history
Co-Authored-By: Dylan Thinnes <dylan.thinnes@protonmail.com>
  • Loading branch information
tchoutri and dylan-thinnes committed Oct 31, 2023
1 parent 60132bb commit 2cb7b20
Show file tree
Hide file tree
Showing 19 changed files with 419 additions and 183 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* Add a page on namespaces in the documentation ([#451](https://github.com/flora-pm/flora-server/pull/451))
* Add initial support for hosting package tarballs ([#452](https://github.com/flora-pm/flora-server/pull/452))
* Show depended on components in dependencies page ([#464](https://github.com/flora-pm/flora-server/pull/464))
* Add search bar for reverse dependencies ([#476](https://github.com/flora-pm/flora-server/pull/476))

## 1.0.13 -- 2023-09-17
* Exclude deprecated releases from latest versions and search ([#373](https://github.com/flora-pm/flora-server/pull/373))
Expand Down
62 changes: 62 additions & 0 deletions assets/css/2-components/5-primary-search.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/* stylelint-disable selector-class-pattern */
/* stylelint-disable declaration-block-no-redundant-longhand-properties */

.main-search {
background-color: var(--search-bar-background-color);
border-radius: 0.75rem;
border-width: 2px;
display: flex;
font-size: 1.5rem;
justify-content: center;
line-height: 2rem;
max-width: 28rem;
outline-offset: -2px;
overflow: hidden;
padding: 0.5rem;

.search-bar {
background-color: var(--search-bar-background-color);
color: var(--search-bar-color);
display: block;
margin-left: 0.5rem;
font-size: 1.5rem;
line-height: 2rem;
padding: 0.5rem;
flex-grow: 1;
min-width: 0;
}

.search-bar:hover {
background-color: var(--search-bar-background-hover-color);
}

.search-bar:focus {
background-color: var(--search-bar-background-focus-color);
outline: 2px solid transparent;
outline-offset: 2px;
}
}

.main-search:focus-within {
border-color: var(--search-bar-focus-border-color);
transition-property: box-shadow;
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
transition-duration: 400ms;

/* offset-x | offset-y | blur-radius | spread-radius | color */
box-shadow: 5px 5px 5px 2px var(--search-bar-focus-border-color);
}

.main-search button {
margin-bottom: 1.25rem;
margin-right: 1rem;
margin-top: 1.25rem;

svg {
width: 1.5rem;
height: 1.5rem;
margin-top: auto;
margin-bottom: auto;
}
}

61 changes: 61 additions & 0 deletions assets/css/2-components/6-secondary-search.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/* stylelint-disable selector-class-pattern */
/* stylelint-disable declaration-block-no-redundant-longhand-properties */

.secondary-search {
background-color: var(--search-bar-background-color);
border-radius: 0.75rem;
border-width: 2px;
display: flex;
font-size: 1rem;
justify-content: center;
line-height: 2rem;
max-width: 20rem;
outline-offset: -2px;
overflow: hidden;
padding: 0.3rem;

.search-bar {
background-color: var(--search-bar-background-color);
color: var(--search-bar-color);
display: block;
font-size: 1.5rem;
line-height: 2rem;
padding: 0.5rem;
flex-grow: 1;
min-width: 0;
}

.search-bar:hover {
background-color: var(--search-bar-background-hover-color);
}

.search-bar:focus {
background-color: var(--search-bar-background-focus-color);
outline: transparent solid 2px;
outline-offset: 2px;
}
}

.secondary-search:focus-within {
border-color: var(--search-bar-focus-border-color);
transition-property: box-shadow;
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
transition-duration: 300ms;

/* offset-x | offset-y | blur-radius | spread-radius | color */
box-shadow: 4px 4px 4px 1px var(--search-bar-focus-border-color);
}

.secondary-search button {
margin-bottom: 1.25rem;
margin-right: 1rem;
margin-top: 1.25rem;

svg {
width: 1em;
height: 1em;
margin-top: auto;
margin-bottom: auto;
}
}

59 changes: 0 additions & 59 deletions assets/css/3-screens/4-front-page.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,65 +13,6 @@
text-align: center;
}

.main-search {
background-color: var(--search-bar-background-color);
border-radius: 0.75rem;
border-width: 2px;
display: flex;
font-size: 1.5rem;
justify-content: center;
line-height: 2rem;
max-width: 28rem;
outline-offset: -2px;
overflow: hidden;
padding: 0.5rem;

.search-bar {
background-color: var(--search-bar-background-color);
color: var(--search-bar-color);
display: block;
margin-left: 0.5rem;
font-size: 1.5rem;
line-height: 2rem;
padding: 0.5rem;
flex-grow: 1;
min-width: 0;
}

.search-bar:hover {
background-color: var(--search-bar-background-hover-color);
}

.search-bar:focus {
background-color: var(--search-bar-background-focus-color);
outline: 2px solid transparent;
outline-offset: 2px;
}
}

.main-search:focus-within {
border-color: var(--search-bar-focus-border-color);
transition-property: box-shadow;
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
transition-duration: 400ms;

/* offset-x | offset-y | blur-radius | spread-radius | color */
box-shadow: 5px 5px 5px 2px var(--search-bar-focus-border-color);
}

.main-search button {
margin-bottom: 1.25rem;
margin-right: 1rem;
margin-top: 1.25rem;

svg {
width: 1.5rem;
height: 1.5rem;
margin-top: auto;
margin-bottom: auto;
}
}

section#main-page-buttons {
border-top: 1px solid var(--text-color);
border-color: var(--navbar-background-color);
Expand Down
15 changes: 10 additions & 5 deletions assets/css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
@import "2-components/2-package-component.css";
@import "2-components/3-breadcrumb.css";
@import "2-components/4-license.css";
@import "2-components/5-primary-search.css";
@import "2-components/6-secondary-search.css";

@import "3-screens/1-package/1-package.css";
@import "3-screens/1-package/2-release-changelog.css";
Expand Down Expand Up @@ -75,16 +77,19 @@
}
}

ul.package-list > * {
margin-top: 1rem;
margin-bottom: 1rem;
padding-left: 1rem;
padding-top: 0.25rem;
padding-bottom: 0.25rem;
}

.package-list-item {
list-style: none;

a {
display: block;
margin-top: 1rem;
margin-bottom: 1rem;
padding-left: 1rem;
padding-top: 0.25rem;
padding-bottom: 0.25rem;
font-size: 1.25rem;
line-height: 1.75rem;
}
Expand Down
4 changes: 3 additions & 1 deletion flora.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ common common-extensions
OverloadedStrings
PackageImports
PolyKinds
QuasiQuotes
RecordWildCards
StrictData
TypeFamilies
Expand Down Expand Up @@ -223,10 +222,13 @@ library flora-web
FloraWeb.Components.CategoryCard
FloraWeb.Components.Footer
FloraWeb.Components.Header
FloraWeb.Components.Icons
FloraWeb.Components.MainSearchBar
FloraWeb.Components.Navbar
FloraWeb.Components.PackageListHeader
FloraWeb.Components.PackageListItem
FloraWeb.Components.PaginationNav
FloraWeb.Components.SlimSearchBar
FloraWeb.Components.Utils
FloraWeb.Components.VersionListHeader
FloraWeb.Embedded
Expand Down
Loading

0 comments on commit 2cb7b20

Please sign in to comment.