feat: search options (#540)

* feat: search options

* feat: sanitize folder names

* fix: add cursor: pointer to switch

* fix: explicitly make the search bar a text input

* refactor: remove magic number

* refactor: extract Switch component to its own file

* refactor: split AppState into multiple files

* refactor: review comments
This commit is contained in:
Baptiste Grob
2021-04-06 16:48:25 +02:00
committed by GitHub
parent 275c8cbd1f
commit ed69680295
24 changed files with 672 additions and 319 deletions

View File

@@ -53,6 +53,8 @@
height: 28px;
margin-top: 14px;
position: relative;
display: flex;
align-items: center;
.filter-bar {
background-color: var(--sn-stylekit-contrast-background-color);
@@ -82,7 +84,8 @@
position: absolute;
top: 50%;
transform: translateY(-50%);
right: 8px;
right: 32px;
cursor: pointer;
transition: background-color 0.15s linear;

View File

@@ -0,0 +1,59 @@
/* Components and utilities that have yet to be extracted to StyleKit. */
.sn-dropdown {
@extend .absolute;
@extend .bg-default;
@extend .min-w-80;
@extend .duration-150;
@extend .grid;
@extend .gap-2;
@extend .slide-down-animation;
@extend .rounded;
@extend .box-shadow;
z-index: $z-index-dropdown-menu;
&.sn-dropdown-anchor-right {
right: 0;
}
&[data-state="collapsed"] {
display: none;
}
}
/** Lesser specificity will give priority to reach's styles */
[data-reach-custom-checkbox-container].sn-switch {
@extend .duration-150;
@extend .ease-out;
@extend .rounded-full;
@extend .transition-background;
width: 31px;
height: 18px;
@extend .cursor-pointer;
@extend .focus-within\:padded-ring-info;
@extend .focus-within\:outline-none;
}
.sn-switch-handle {
@extend .absolute;
@extend .block;
left: 2px;
width: 14px;
height: 14px;
top: 50%;
@extend .bg-default;
@extend .rounded-full;
@extend .ease-out;
@extend .transition-transform;
@extend .duration-150;
transform: translate(0px, -50%);
&.sn-switch-handle-right {
transform: translate(31px - 18px, -50%);
}
}

View File

@@ -183,9 +183,6 @@ $screen-md-max: ($screen-lg-min - 1) !default;
grid-column-end: 3;
}
.color-neutral {
color: var(--sn-stylekit-neutral-color)
}
.hover\:color-info:hover {
color: var(--sn-stylekit-info-color)
}

View File

@@ -1,3 +1,4 @@
@import "sn-stylekit/dist/stylekit";
@import "main";
@import "ui";
@import "footer";
@@ -11,3 +12,4 @@
@import "ionicons";
@import "reach-sub";
@import "sessions-modal";
@import "sn";