mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 22:23:42 +01:00
Update Storybook controls for shared component stories and add Figma links for preview (#28634)
* Rename ui to shared * Delete unused Switch component * Update stories with Figma links * Update Tag story naming for clarity * Update Toggle button story naming for clarity * Move shared components to the shared folder * Remove file as part of TS migration * Migrate jsx to tsx * Remove file as part of TS migration * Migrate jsx to tsx * Include necessary controls only * Auto SF GitOrigin-RevId: d2458eeffa7a6b67ce522c3ccb6b4f71e5e76d62
This commit is contained in:
@@ -1,27 +0,0 @@
|
||||
import classNames from 'classnames'
|
||||
|
||||
type SwitchProps = {
|
||||
onChange: () => void
|
||||
checked: boolean
|
||||
disabled?: boolean
|
||||
}
|
||||
|
||||
function Switch({ onChange, checked, disabled = false }: SwitchProps) {
|
||||
return (
|
||||
// eslint-disable-next-line jsx-a11y/label-has-associated-control
|
||||
<label className={classNames('switch-input', { disabled })}>
|
||||
<input
|
||||
className="invisible-input"
|
||||
type="checkbox"
|
||||
role="switch"
|
||||
autoComplete="off"
|
||||
onChange={onChange}
|
||||
checked={checked}
|
||||
disabled={disabled}
|
||||
/>
|
||||
<span className="switch" />
|
||||
</label>
|
||||
)
|
||||
}
|
||||
|
||||
export default Switch
|
||||
Reference in New Issue
Block a user