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

[FLORA-388] Reverse dependencies search bar #476

Merged
merged 2 commits into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pull_request_rules:
conditions:
- label=merge me
- 'check-success=Frontend_tests'
- 'check-success=Backend_tests'
- 'check-success~=.*Backend_tests.*'
# - '#approved-reviews-by>=1'
# merge+squash strategy
- actions:
Expand Down
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
61 changes: 61 additions & 0 deletions assets/css/2-components/5-primary-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 */

.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;
}
}
60 changes: 60 additions & 0 deletions assets/css/2-components/6-secondary-search.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/* 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
Loading