-
Notifications
You must be signed in to change notification settings - Fork 219
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feature/auto-hide-tab-bar
- Loading branch information
Showing
41 changed files
with
699 additions
and
250 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,5 +58,5 @@ func shellCmdInner() string { | |
} | ||
} | ||
// none found | ||
return "bin/bash\n" | ||
return "/bin/bash\n" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
.search-container { | ||
display: flex; | ||
flex-direction: row; | ||
background-color: var(--modal-bg-color); | ||
border: 1px solid var(--accent-color); | ||
border-radius: var(--modal-border-radius); | ||
box-shadow: var(--modal-box-shadow); | ||
color: var(--main-text-color); | ||
padding: 5px 5px 5px 10px; | ||
gap: 5px; | ||
width: 50%; | ||
max-width: 300px; | ||
min-width: 200px; | ||
|
||
input { | ||
flex: 1 1 auto; | ||
border: none; | ||
font-size: 14px; | ||
height: 100%; | ||
padding: 0; | ||
border-radius: 0; | ||
} | ||
|
||
.search-results { | ||
font-size: 12px; | ||
margin: auto 0; | ||
color: var(--secondary-text-color); | ||
|
||
&.hidden { | ||
display: none; | ||
} | ||
} | ||
|
||
.right-buttons { | ||
display: flex; | ||
gap: 5px; | ||
padding-left: 5px; | ||
border-left: 1px solid var(--modal-border-color); | ||
button { | ||
font-size: 12px; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
// Copyright 2024, Command Line Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
import type { Meta, StoryObj } from "@storybook/react"; | ||
import { useSetAtom } from "jotai"; | ||
import { useEffect } from "react"; | ||
import { Popover } from "./popover"; | ||
import { Search, useSearch } from "./search"; | ||
|
||
const meta: Meta<typeof Search> = { | ||
title: "Elements/Search", | ||
component: Search, | ||
args: {}, | ||
}; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof Popover>; | ||
|
||
export const DefaultSearch: Story = { | ||
render: (args) => { | ||
const props = useSearch(); | ||
const setIsOpen = useSetAtom(props.isOpenAtom); | ||
useEffect(() => { | ||
setIsOpen(true); | ||
}, []); | ||
return ( | ||
<div | ||
className="viewbox" | ||
ref={props.anchorRef as React.RefObject<HTMLDivElement>} | ||
style={{ | ||
border: "2px solid black", | ||
width: "100%", | ||
height: "200px", | ||
background: "var(--main-bg-color)", | ||
}} | ||
> | ||
<Search {...args} {...props} /> | ||
</div> | ||
); | ||
}, | ||
args: {}, | ||
}; | ||
|
||
export const Results10: Story = { | ||
render: (args) => { | ||
const props = useSearch(); | ||
const setIsOpen = useSetAtom(props.isOpenAtom); | ||
const setNumResults = useSetAtom(props.numResultsAtom); | ||
useEffect(() => { | ||
setIsOpen(true); | ||
setNumResults(10); | ||
}, []); | ||
return ( | ||
<div | ||
className="viewbox" | ||
ref={props.anchorRef as React.RefObject<HTMLDivElement>} | ||
style={{ | ||
border: "2px solid black", | ||
width: "100%", | ||
height: "200px", | ||
background: "var(--main-bg-color)", | ||
}} | ||
> | ||
<Search {...args} {...props} /> | ||
</div> | ||
); | ||
}, | ||
args: {}, | ||
}; | ||
|
||
export const InputAndResults10: Story = { | ||
render: (args) => { | ||
const props = useSearch(); | ||
const setIsOpen = useSetAtom(props.isOpenAtom); | ||
const setNumResults = useSetAtom(props.numResultsAtom); | ||
const setSearch = useSetAtom(props.searchAtom); | ||
useEffect(() => { | ||
setIsOpen(true); | ||
setNumResults(10); | ||
setSearch("search term"); | ||
}, []); | ||
return ( | ||
<div | ||
className="viewbox" | ||
ref={props.anchorRef as React.RefObject<HTMLDivElement>} | ||
style={{ | ||
border: "2px solid black", | ||
width: "100%", | ||
height: "200px", | ||
background: "var(--main-bg-color)", | ||
}} | ||
> | ||
<Search {...args} {...props} /> | ||
</div> | ||
); | ||
}, | ||
args: {}, | ||
}; | ||
|
||
export const LongInputAndResults10: Story = { | ||
render: (args) => { | ||
const props = useSearch(); | ||
const setIsOpen = useSetAtom(props.isOpenAtom); | ||
const setNumResults = useSetAtom(props.numResultsAtom); | ||
const setSearch = useSetAtom(props.searchAtom); | ||
useEffect(() => { | ||
setIsOpen(true); | ||
setNumResults(10); | ||
setSearch("search term ".repeat(10).trimEnd()); | ||
}, []); | ||
return ( | ||
<div | ||
className="viewbox" | ||
ref={props.anchorRef as React.RefObject<HTMLDivElement>} | ||
style={{ | ||
border: "2px solid black", | ||
width: "100%", | ||
height: "200px", | ||
background: "var(--main-bg-color)", | ||
}} | ||
> | ||
<Search {...args} {...props} /> | ||
</div> | ||
); | ||
}, | ||
args: {}, | ||
}; |
Oops, something went wrong.