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

Update headers for search categories #472

Merged
merged 8 commits into from
Oct 23, 2023
6 changes: 6 additions & 0 deletions .storybook/preview-head.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
<script>
window.global = window;
</script>

<style>
:root {
font-family: sans-serif;
}
</style>
9 changes: 6 additions & 3 deletions src/renderer/src/stories/Search.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { LitElement, html, css } from "lit";
import tippy from "tippy.js";

export class Search extends LitElement {
constructor({ options, showAllWhenEmpty, disabledLabel } = {}) {
constructor({ options, showAllWhenEmpty = true, disabledLabel } = {}) {
super();
this.options = options;
this.showAllWhenEmpty = showAllWhenEmpty;
Expand Down Expand Up @@ -56,7 +56,10 @@ export class Search extends LitElement {

.category {
padding: 10px 25px;
background: #f2f2f2;
background: gainsboro;
border-top: 1px solid gray;
border-bottom: 1px solid gray;
font-size: 90%;
font-weight: bold;
position: sticky;
top: 0;
Expand Down Expand Up @@ -217,7 +220,7 @@ export class Search extends LitElement {
return;
}

return el;
return li;
})
.filter((el) => el);

Expand Down
24 changes: 23 additions & 1 deletion src/renderer/src/stories/Search.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Search } from "./Search";

// More on how to set up stories at: https://storybook.js.org/docs/7.0/web-components/writing-stories/introduction
export default {
title: "Example/Search",
title: "Components/Search",
// tags: ['autodocs'],
};

Expand All @@ -22,3 +22,25 @@ Default.args = {
},
],
};

export const Categories = Template.bind({});
Categories.args = {
disabledLabel: "Interface not supported",
options: [
{
label: "SpikeGLXConverter",
category: "Converter",
keywords: ["extracellular electrophysiology", "voltage", "recording", "neuropixels"],
},
{
label: "SpikeGLXRecording",
category: "Interface",
keywords: ["extracellular electrophysiology", "voltage", "recording", "neuropixels"],
},
{
label: "DeepLabCut",
category: "Interface",
keywords: ["DLC", "tracking", "pose estimation"],
},
],
};
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ export class GuidedStructurePage extends Page {
};

search = new Search({
showAllWhenEmpty: true,
disabledLabel: "Not supported",
});

Expand Down
Loading