import * as React from 'react' import type { StoryFn, Meta } from '@storybook/react-webpack5' import { NavigationBar } from '.' import { ToolbarSectionRight, ToolbarSectionLeft } from '../section' import { SearchInput } from './search-input' import { Knowledgebase, Notification, Overview, Videocamera, } from '@planview/pv-icons' import { shadow, spacingPx, text } from '@planview/pv-utilities' import { LogoProjectPlace } from '../logos' import styled, { keyframes } from 'styled-components' import FloatingWrap from '@planview/pv-uikit/es/__utils/components/floating-wrap' import { ToolbarButtonEmptyInverse } from '../button' export default { title: 'pv-toolbar/NavigationBar/SearchInput', tags: ['autodocs'], component: SearchInput, args: { expanded: undefined, }, argTypes: { expanded: { control: { type: 'radio', }, options: [undefined, true, false], }, }, parameters: { badges: ['intl'], }, } satisfies Meta export const Default: StoryFn = (args) => ( ) const animFrames = keyframes` from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; } ` const SearchPanel = styled.div` ${text.regular}; padding: ${spacingPx.small}; opacity: 0; animation: ${animFrames} 0.3s linear forwards; z-index: 10; width: 230px; height: 150px; background-color: white; ${shadow.regular}; ` export const ProjectPlaceSearchExample: StoryFn = () => { const [panelOpen, setPanelOpen] = React.useState(false) const [search, setSearch] = React.useState('') const inputRef = React.useRef(null) return ( <> } > } withCaret> My Overview } tooltip="Start Zoom meeting" /> } tooltip="Knowledge center" /> } tooltip="Notifications" /> {panelOpen && search.length ? ( {`Search results: ${search}`} ) : null} ) } ProjectPlaceSearchExample.parameters = { controls: { disabled: true, hideNoControlsWarning: true }, } ProjectPlaceSearchExample.storyName = 'ProjectPlace search example'