mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
4e1a96b4ef
* add popover component popperjs init popperjs hook init popper arrow styles fix popover story add popover positions constant story testing popover structure popper placement make forwardref fix popover with TS updates modifiers createPortal add useClickAway hook newer popover component build simplifed popperjs with toggle to show/hide toggle popover modal version popover progress 65% add hover functionality hide folder storybook demo add close button props working popover with arrow title prop breaking popover TS conversion TS updates update test add test add arrow test add stories remove unused hook fix docs add popoverheader types fix Fix typo: detetcted-tokens-link -> detected-tokens-link (#18408) Typography to text (#18382) * Typography to text * Update README.md * Update README.md * minor changes in custom file * minor change * Resolved Conflict issues --------- Co-authored-by: Nidhi Kumari <nidhi.kumari@consensys.net> fix: Pass correct optimism chain id to gas estimation (#18478) removes unnecessary images (#18484) Fix firsttimeloaded logic (#18344) * use session storage, instead of chrome.runtime.onStartup and globalThis, for firstTimeLoaded architecture * Ensure account tracker accounts remain defined upon service worker restart * lint fix * Simplify code * Only call browser.storage.session in mv3 * Only call browser.storage.session.set after resetStates in mv3 * fix metamask controller reset states unit tests * fix test * fix test * Actually fix tests * lint fix [FLASK] More Snaps E2E Optimization and Delay Reductions (#18245) * bip32 delay reduction * asserts changed to waitFors in 32/44 * scrollTo change * replaced delay for firefox flake * more reduced delays * more delay reductions and changes * raise paralellism to 4 for snaps tests * additional delay changes * fixed update code * removed comment * removed another comment Fix switch-ethereum-chain handler by passing configuration id to setA… (#18483) * Fix switch-ethereum-chain handler by passing configuration id to setActiveNetwork * fix e2e test * Fix e2e tests * Update test/e2e/tests/switch-custom-network.spec.js Co-authored-by: legobeat <109787230+legobeat@users.noreply.github.com> * Revert "Update test/e2e/tests/switch-custom-network.spec.js" This reverts commit be533ff7f25e1fd42e951d9b817b8438035ae256. --------- Co-authored-by: legobeat <109787230+legobeat@users.noreply.github.com> Bumping notification id's to 18 & 19 (#18460) * Popover header update with TS ButtonIcon * update PopoverHeader types * update using new Text enums * readme fix * direct file import * remove forwardRef and add action argtypes * remove console.logs * add arg types and fix TS on HeaderBase * george nits * popover header snapshot update --------- Co-authored-by: legobeat <109787230+legobeat@users.noreply.github.com> |
||
---|---|---|
.. | ||
__snapshots__ | ||
index.ts | ||
popover-header.stories.tsx | ||
popover-header.test.tsx | ||
popover-header.tsx | ||
popover-header.types.ts | ||
README.mdx |
import { Story, Canvas, ArgsTable } from '@storybook/addon-docs'; import { PopoverHeader } from './popover-header'; # PopoverHeader PopoverHeader is built on top of [HeaderBase](/docs/components-componentlibrary-headerbase--default-story) component with the most common use case of a back button in the startAccessory position, title, and close button in the endAccessory position. <Canvas> <Story id="components-componentlibrary-popoverheader--default-story" /> </Canvas> ## Props The `PopoverHeader` accepts all props below as well as all [Box](/docs/ui-components-ui-box-box-stories-js--default-story#props) component props <ArgsTable of={PopoverHeader} /> ### Children Wrapping string content in the `PopoverHeader` component will be rendered in the center of the header with the default title `Text` component. <Canvas> <Story id="components-componentlibrary-popoverheader--children" /> </Canvas> ```jsx import { PopoverHeader } from '../../component-library'; <PopoverHeader>Title is sentence case no period</PopoverHeader>; ``` ### onBack Use the onClick handler `onBack` prop to render the `ButtonIcon` back button in the startAccessory position. Use the `backButtonProps` prop to pass additional props to the `ButtonIcon` back button. <Canvas> <Story id="components-componentlibrary-popoverheader--on-back" /> </Canvas> ```jsx import { PopoverHeader } from '../../component-library'; <PopoverHeader onBack={() => console.log('Back button click')}> OnBack Demo </PopoverHeader>; ``` ### onClose Use the onClick handler `onClose` prop to render the `ButtonIcon` back button in the endAccessory position. Use the `backButtonProps` prop to pass additional props to the `ButtonIcon` back button. <Canvas> <Story id="components-componentlibrary-popoverheader--on-close" /> </Canvas> ```jsx import { PopoverHeader } from '../../component-library'; <PopoverHeader onClose={() => console.log('Back button click')}> OnClose Demo </PopoverHeader>; ``` ### startAccessory Use the `startAccessory` prop to render a component in the startAccessory position. This will override the default back `ButtonIcon`. <Canvas> <Story id="components-componentlibrary-popoverheader--start-accessory" /> </Canvas> ```jsx import { PopoverHeader, Button, BUTTON_SIZES } from '../../component-library'; <PopoverHeader startAccessory={<Button size={BUTTON_SIZES.SM}>Demo</Button>}> StartAccessory </PopoverHeader>; ``` ### endAccessory Use the `endAccessory` prop to render a component in the endAccessory position. This will override the default close `ButtonIcon`. <Canvas> <Story id="components-componentlibrary-popoverheader--end-accessory" /> </Canvas> ```jsx import { PopoverHeader, Button, BUTTON_SIZES } from '../../component-library'; <PopoverHeader endAccessory={<Button size={BUTTON_SIZES.SM}>Demo</Button>}> EndAccessory </PopoverHeader>; ```