-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(website): [playground] update option selector (#6736)
- Loading branch information
Showing
14 changed files
with
137 additions
and
142 deletions.
There are no files selected for viewing
75 changes: 0 additions & 75 deletions
75
packages/website/src/components/OptionsSelector.module.css
This file was deleted.
Oops, something went wrong.
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
4 changes: 0 additions & 4 deletions
4
packages/website/src/components/config/ConfigEditor.module.css
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 |
---|---|---|
@@ -1,7 +1,3 @@ | ||
.search { | ||
border-radius: 0.2rem; | ||
} | ||
|
||
.searchResult, | ||
.searchResultGroup { | ||
align-items: center; | ||
|
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
20 changes: 20 additions & 0 deletions
20
packages/website/src/components/inputs/Dropdown.module.css
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,20 @@ | ||
.dropdown { | ||
line-height: 1; | ||
font-size: 0.8rem; | ||
font-weight: 500; | ||
border-radius: 6px; | ||
font-family: inherit; | ||
width: 50%; | ||
box-shadow: none; | ||
padding: 0.4rem 0.6rem; | ||
appearance: none; | ||
color: var(--ifm-font-color-secondary); | ||
border: 1px solid var(--ifm-color-emphasis-100); | ||
background: var(--ifm-color-emphasis-200); | ||
transition: border 0.3s ease; | ||
} | ||
|
||
.dropdown:focus { | ||
outline: none; | ||
border-color: var(--ifm-color-primary); | ||
} |
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,20 @@ | ||
import React from 'react'; | ||
|
||
import styles from './InputLabel.module.css'; | ||
|
||
export interface InputLabelProps { | ||
readonly name: string; | ||
readonly children: React.ReactNode; | ||
readonly onClick: () => void; | ||
} | ||
|
||
function ActionLabel(props: InputLabelProps): JSX.Element { | ||
return ( | ||
<button onClick={props.onClick} className={styles.optionLabel}> | ||
<span>{props.name}</span> | ||
{props.children} | ||
</button> | ||
); | ||
} | ||
|
||
export default ActionLabel; |
25 changes: 25 additions & 0 deletions
25
packages/website/src/components/layout/InputLabel.module.css
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,25 @@ | ||
.optionLabel { | ||
cursor: pointer; | ||
align-items: center; | ||
display: flex; | ||
flex: 0 0 1.5rem; | ||
flex-direction: row; | ||
font-size: 0.75rem; | ||
margin: 0; | ||
padding: 0.4rem 0.8rem; | ||
transition: background-color var(--ifm-transition-fast) | ||
var(--ifm-transition-timing-default), | ||
color var(--ifm-transition-fast) var(--ifm-transition-timing-default); | ||
color: var(--ifm-font-color-secondary); | ||
justify-content: space-between; | ||
border: none; | ||
background: transparent; | ||
font-family: var(--ifm-font-family-base); | ||
box-sizing: border-box; | ||
line-height: var(--ifm-line-height-base); | ||
} | ||
|
||
.optionLabel:hover { | ||
background-color: var(--ifm-color-emphasis-100); | ||
color: var(--ifm-font-color-primary); | ||
} |
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,19 @@ | ||
import React from 'react'; | ||
|
||
import styles from './InputLabel.module.css'; | ||
|
||
export interface InputLabelProps { | ||
readonly name: string; | ||
readonly children: React.ReactNode; | ||
} | ||
|
||
function InputLabel(props: InputLabelProps): JSX.Element { | ||
return ( | ||
<label className={styles.optionLabel}> | ||
<span>{props.name}</span> | ||
{props.children} | ||
</label> | ||
); | ||
} | ||
|
||
export default InputLabel; |
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,17 @@ | ||
import { useCallback } from 'react'; | ||
|
||
import { useDebouncedToggle } from './useDebouncedToggle'; | ||
|
||
export type useClipboardResult = [copied: boolean, copy: () => void]; | ||
|
||
export function useClipboard(code: () => string): useClipboardResult { | ||
const [copied, setCopied] = useDebouncedToggle(false); | ||
|
||
const copy = useCallback(() => { | ||
void navigator.clipboard.writeText(code()).then(() => { | ||
setCopied(true); | ||
}); | ||
}, [setCopied, code]); | ||
|
||
return [copied, copy]; | ||
} |
Oops, something went wrong.