@magiclabs/ui-components 1.34.12 → 1.34.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/layouts/passport-page.js +1 -1
- package/dist/cjs/components/layouts/passport-page.js.map +1 -1
- package/dist/cjs/components/list-items/token-list-item.js +1 -1
- package/dist/cjs/components/list-items/token-list-item.js.map +1 -1
- package/dist/es/components/layouts/passport-page.js +1 -1
- package/dist/es/components/layouts/passport-page.js.map +1 -1
- package/dist/es/components/list-items/token-list-item.js +1 -1
- package/dist/es/components/list-items/token-list-item.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("react/jsx-runtime");require("../containers/button.js"),require("../containers/card.js"),require("@styled/css");var t=require("@styled/jsx"),v=require("../containers/drawer.js"),V=require("react");require("../utils/client-asset-logo.js");var m=require("@styled/tokens");require("react-qrcode-logo"),require("../utils/secured-by-magic.js");var W=require("../icons/ico-caret-left.js"),w=require("../icons/ico-magic.js"),A=require("../icons/ico-question-circle-fill.js");require("../containers/header.js");var S=require("../containers/menu.js"),I=require("../containers/modal.js");require("../containers/overlay.js"),require("../info/copy-button.js"),require("../info/email-wbr.js"),require("../info/security-otp.js"),require("../info/text-box.js");var L=require("../info/wallet-address.js"),n=require("../primitives/button.js"),j=require("../primitives/popover.js"),f=require("../primitives/text.js"),a=require("create-slots");const C=a.createSlot(({children:r})=>V.Children.map(r,l=>e.jsx(n.default,{expand:!0,...l.props}))),b=a.createSlot(n.default),P=a.createSlot(n.default),y=a.createSlot(({children:r})=>e.jsxs(j.Popover,{textStyle:"subtle",variant:"text",children:[e.jsx(j.Popover.TrailingIcon,{children:e.jsx(A.default,{})}),e.jsx(j.Popover.Content,{children:r})]})),k=a.createSlot(({branding:r,title:l})=>l?e.jsx(f.default,{size:"sm",fontColor:"text.secondary",children:l}):e.jsx(w.default,{color:m.token(r==="light"?"colors.text.primary":"colors.neutral.primary")})),B=a.createSlot(({children:r})=>e.jsx(t.VStack,{w:"full",justify:"center",children:r})),z=a.createSlot(S.Menu),H=a.createSlot(v.Drawer),M=a.createSlot(({children:r})=>e.jsx(t.Center,{pt:3,w:"full",children:r})),D=a.createSlot(({children:r,domain:l,name:o,logoUrl:s})=>e.jsxs(t.HStack,{borderBottomColor:"neutral.primary",borderBottomWidth:"1px",p:3,width:"full",children:[s?e.jsx("img",{src:s,alt:o,width:24,height:24}):e.jsx(w.default,{color:m.token("colors.brand.base"),height:24,width:24}),e.jsx(f.default,{size:"sm",fontWeight:"semibold",children:o}),l&&e.jsx(f.default,{size:"sm",fontColor:"text.tertiary",children:l}),r]})),J=({actionDirection:r="row",address:l,children:o,onBack:s,onCancel:d,...F})=>a.createHost(o,i=>{const c=i.getProps(b),u=i.getProps(P),p=i.getProps(H),x=i.getProps(z),g=i.get(C),q=i.get(y),T=i.get(k),h=r==="row";return e.jsxs(I.Modal,{...F,fullscreen:!0,paddingType:"none",gap:0,children:[e.jsxs(t.VStack,{gap:0,width:"full",children:[e.jsxs(t.HStack,{borderBottomColor:"neutral.primary",borderBottomWidth:"1px",justifyContent:"space-between",p:3,width:"full",children:[s&&e.jsx(n.default,{onPress:s,size:"md",textStyle:"neutral",variant:"text",children:e.jsx(n.default.LeadingIcon,{children:e.jsx(W.default,{})})}),d&&e.jsx(n.default,{onPress:d,label:"Cancel",size:"sm",textStyle:"neutral",variant:"text"}),!(s||d)&&e.jsx(t.Box,{w:6}),T,l||q||x?e.jsxs(t.HStack,{children:[l&&e.jsx(L.default,{address:l}),q,x&&e.jsx(S.Menu,{...x})]}):e.jsx(t.Box,{w:6})]}),i.get(D)]}),e.jsxs(t.VStack,{h:"full",w:"full",justify:"space-between",p:6,children:[i.get(B),e.jsxs(t.VStack,{w:"full",gap:3,children:[(c||u)&&e.jsxs(t.Flex,{direction:h?"row":"column-reverse",gap:h?4:3,width:"full",children:[c&&e.jsx(n.default,{expand:!0,label:"Cancel",variant:"neutral",...c}),u&&e.jsx(n.default,{expand:!0,label:"Confirm",variant:"inverse",...u})]}),g&&e.jsx(t.Flex,{direction:r,gap:h?4:3,width:"full",children:g})
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime");require("../containers/button.js"),require("../containers/card.js"),require("@styled/css");var t=require("@styled/jsx"),v=require("../containers/drawer.js"),V=require("react");require("../utils/client-asset-logo.js");var m=require("@styled/tokens");require("react-qrcode-logo"),require("../utils/secured-by-magic.js");var W=require("../icons/ico-caret-left.js"),w=require("../icons/ico-magic.js"),A=require("../icons/ico-question-circle-fill.js");require("../containers/header.js");var S=require("../containers/menu.js"),I=require("../containers/modal.js");require("../containers/overlay.js"),require("../info/copy-button.js"),require("../info/email-wbr.js"),require("../info/security-otp.js"),require("../info/text-box.js");var L=require("../info/wallet-address.js"),n=require("../primitives/button.js"),j=require("../primitives/popover.js"),f=require("../primitives/text.js"),a=require("create-slots");const C=a.createSlot(({children:r})=>V.Children.map(r,l=>e.jsx(n.default,{expand:!0,...l.props}))),b=a.createSlot(n.default),P=a.createSlot(n.default),y=a.createSlot(({children:r})=>e.jsxs(j.Popover,{textStyle:"subtle",variant:"text",children:[e.jsx(j.Popover.TrailingIcon,{children:e.jsx(A.default,{})}),e.jsx(j.Popover.Content,{children:r})]})),k=a.createSlot(({branding:r,title:l})=>l?e.jsx(f.default,{size:"sm",fontColor:"text.secondary",children:l}):e.jsx(w.default,{color:m.token(r==="light"?"colors.text.primary":"colors.neutral.primary")})),B=a.createSlot(({children:r})=>e.jsx(t.VStack,{w:"full",justify:"center",children:r})),z=a.createSlot(S.Menu),H=a.createSlot(v.Drawer),M=a.createSlot(({children:r})=>e.jsx(t.Center,{pt:3,w:"full",children:r})),D=a.createSlot(({children:r,domain:l,name:o,logoUrl:s})=>e.jsxs(t.HStack,{borderBottomColor:"neutral.primary",borderBottomWidth:"1px",p:3,width:"full",children:[s?e.jsx("img",{src:s,alt:o,width:24,height:24}):e.jsx(w.default,{color:m.token("colors.brand.base"),height:24,width:24}),e.jsx(f.default,{size:"sm",fontWeight:"semibold",children:o}),l&&e.jsx(f.default,{size:"sm",fontColor:"text.tertiary",children:l}),r]})),J=({actionDirection:r="row",address:l,children:o,onBack:s,onCancel:d,...F})=>a.createHost(o,i=>{const c=i.getProps(b),u=i.getProps(P),p=i.getProps(H),x=i.getProps(z),g=i.get(C),q=i.get(y),T=i.get(k),h=r==="row";return e.jsxs(I.Modal,{...F,fullscreen:!0,paddingType:"none",gap:0,children:[e.jsxs(t.VStack,{gap:0,width:"full",children:[e.jsxs(t.HStack,{borderBottomColor:"neutral.primary",borderBottomWidth:"1px",justifyContent:"space-between",p:3,width:"full",children:[s&&e.jsx(n.default,{onPress:s,size:"md",textStyle:"neutral",variant:"text",children:e.jsx(n.default.LeadingIcon,{children:e.jsx(W.default,{})})}),d&&e.jsx(n.default,{onPress:d,label:"Cancel",size:"sm",textStyle:"neutral",variant:"text"}),!(s||d)&&e.jsx(t.Box,{w:6}),T,l||q||x?e.jsxs(t.HStack,{children:[l&&e.jsx(L.default,{address:l}),q,x&&e.jsx(S.Menu,{...x})]}):e.jsx(t.Box,{w:6})]}),i.get(D)]}),e.jsxs(t.VStack,{h:"full",w:"full",justify:"space-between",p:6,children:[i.get(B),e.jsxs(t.VStack,{w:"full",gap:3,children:[i.get(M),(c||u)&&e.jsxs(t.Flex,{direction:h?"row":"column-reverse",gap:h?4:3,width:"full",children:[c&&e.jsx(n.default,{expand:!0,label:"Cancel",variant:"neutral",...c}),u&&e.jsx(n.default,{expand:!0,label:"Confirm",variant:"inverse",...u})]}),g&&e.jsx(t.Flex,{direction:r,gap:h?4:3,width:"full",children:g})]})]}),p&&e.jsx(v.Drawer,{...p})]})}),O=Object.assign(J,{Actions:C,Cancel:b,Confirm:P,Content:B,Menu:z,Drawer:H,Footer:M,Header:D,Info:y,Title:k});exports.PassportPage=O;
|
|
2
2
|
//# sourceMappingURL=passport-page.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"passport-page.js","sources":["../../../../src/components/layouts/passport-page.tsx"],"sourcesContent":["import { Menu } from '@components/containers';\nimport { Drawer } from '@components/containers/drawer';\nimport { Modal } from '@components/containers/modal';\nimport { IcoCaretLeft, IcoMagic, IcoQuestionCircleFill } from '@components/icons';\nimport { WalletAddress } from '@components/info';\nimport Button from '@components/primitives/button';\nimport Popover from '@components/primitives/popover';\nimport Text from '@components/primitives/text';\nimport { Box, Center, Flex, HStack, VStack } from '@styled/jsx';\nimport { token } from '@styled/tokens';\nimport { createHost, createSlot } from 'create-slots';\nimport { Children, PropsWithChildren } from 'react';\n\nexport interface HeaderProps extends PropsWithChildren {\n name: string;\n domain?: string;\n logoUrl?: string;\n}\n\nexport interface TitleProps {\n branding?: 'light' | 'dark';\n title?: string;\n}\n\nexport interface PassportPageProps extends PropsWithChildren {\n address?: string;\n animate?: boolean;\n actionDirection?: 'column' | 'row';\n isOpen?: boolean;\n onAnimated?: () => void;\n onBack?: () => void;\n onClosed?: () => void;\n onCancel?: () => void;\n}\n\nconst Actions = createSlot(({ children }) => Children.map(children, child => <Button expand {...child.props} />));\nconst Cancel = createSlot(Button);\nconst Confirm = createSlot(Button);\nconst Info = createSlot(({ children }) => (\n <Popover textStyle=\"subtle\" variant=\"text\">\n <Popover.TrailingIcon>\n <IcoQuestionCircleFill />\n </Popover.TrailingIcon>\n <Popover.Content>{children}</Popover.Content>\n </Popover>\n));\nconst Title = createSlot(({ branding, title }: TitleProps) => {\n return title ? (\n <Text size=\"sm\" fontColor=\"text.secondary\">\n {title}\n </Text>\n ) : (\n <IcoMagic color={token(branding === 'light' ? 'colors.text.primary' : 'colors.neutral.primary')} />\n );\n});\n\nconst PageContent = createSlot(({ children }) => (\n <VStack w=\"full\" justify=\"center\">\n {children}\n </VStack>\n));\nconst PageMenu = createSlot(Menu);\nconst PageDrawer = createSlot(Drawer);\nconst PageFooter = createSlot(({ children }) => (\n <Center pt={3} w=\"full\">\n {children}\n </Center>\n));\nconst PageHeader = createSlot(({ children, domain, name, logoUrl }: HeaderProps) => (\n <HStack borderBottomColor=\"neutral.primary\" borderBottomWidth=\"1px\" p={3} width=\"full\">\n {logoUrl ? (\n <img src={logoUrl} alt={name} width={24} height={24} />\n ) : (\n <IcoMagic color={token('colors.brand.base')} height={24} width={24} />\n )}\n <Text size=\"sm\" fontWeight=\"semibold\">\n {name}\n </Text>\n {domain && (\n <Text size=\"sm\" fontColor=\"text.tertiary\">\n {domain}\n </Text>\n )}\n {children}\n </HStack>\n));\n\nconst PageHost = ({ actionDirection = 'row', address, children, onBack, onCancel, ...props }: PassportPageProps) => {\n return createHost(children, slots => {\n const cancelProps = slots.getProps(Cancel);\n const confirmProps = slots.getProps(Confirm);\n const drawerProps = slots.getProps(PageDrawer);\n const menuProps = slots.getProps(PageMenu);\n\n const actions = slots.get(Actions);\n const info = slots.get(Info);\n const title = slots.get(Title);\n\n const isRowDirection = actionDirection === 'row';\n\n return (\n <Modal {...props} fullscreen paddingType=\"none\" gap={0}>\n <VStack gap={0} width=\"full\">\n <HStack\n borderBottomColor=\"neutral.primary\"\n borderBottomWidth=\"1px\"\n justifyContent=\"space-between\"\n p={3}\n width=\"full\"\n >\n {onBack && (\n <Button onPress={onBack} size=\"md\" textStyle=\"neutral\" variant=\"text\">\n <Button.LeadingIcon>\n <IcoCaretLeft />\n </Button.LeadingIcon>\n </Button>\n )}\n {onCancel && <Button onPress={onCancel} label=\"Cancel\" size=\"sm\" textStyle=\"neutral\" variant=\"text\" />}\n {!(onBack || onCancel) && <Box w={6} />}\n {title}\n {address || info || menuProps ? (\n <HStack>\n {address && <WalletAddress address={address} />}\n {info}\n {menuProps && <Menu {...menuProps} />}\n </HStack>\n ) : (\n <Box w={6} />\n )}\n </HStack>\n {slots.get(PageHeader)}\n </VStack>\n <VStack h=\"full\" w=\"full\" justify=\"space-between\" p={6}>\n {slots.get(PageContent)}\n <VStack w=\"full\" gap={3}>\n {(cancelProps || confirmProps) && (\n <Flex direction={isRowDirection ? 'row' : 'column-reverse'} gap={isRowDirection ? 4 : 3} width=\"full\">\n {cancelProps && <Button expand label=\"Cancel\" variant=\"neutral\" {...cancelProps} />}\n {confirmProps && <Button expand label=\"Confirm\" variant=\"inverse\" {...confirmProps} />}\n </Flex>\n )}\n {actions && (\n <Flex direction={actionDirection} gap={isRowDirection ? 4 : 3} width=\"full\">\n {actions}\n </Flex>\n )}\n
|
|
1
|
+
{"version":3,"file":"passport-page.js","sources":["../../../../src/components/layouts/passport-page.tsx"],"sourcesContent":["import { Menu } from '@components/containers';\nimport { Drawer } from '@components/containers/drawer';\nimport { Modal } from '@components/containers/modal';\nimport { IcoCaretLeft, IcoMagic, IcoQuestionCircleFill } from '@components/icons';\nimport { WalletAddress } from '@components/info';\nimport Button from '@components/primitives/button';\nimport Popover from '@components/primitives/popover';\nimport Text from '@components/primitives/text';\nimport { Box, Center, Flex, HStack, VStack } from '@styled/jsx';\nimport { token } from '@styled/tokens';\nimport { createHost, createSlot } from 'create-slots';\nimport { Children, PropsWithChildren } from 'react';\n\nexport interface HeaderProps extends PropsWithChildren {\n name: string;\n domain?: string;\n logoUrl?: string;\n}\n\nexport interface TitleProps {\n branding?: 'light' | 'dark';\n title?: string;\n}\n\nexport interface PassportPageProps extends PropsWithChildren {\n address?: string;\n animate?: boolean;\n actionDirection?: 'column' | 'row';\n isOpen?: boolean;\n onAnimated?: () => void;\n onBack?: () => void;\n onClosed?: () => void;\n onCancel?: () => void;\n}\n\nconst Actions = createSlot(({ children }) => Children.map(children, child => <Button expand {...child.props} />));\nconst Cancel = createSlot(Button);\nconst Confirm = createSlot(Button);\nconst Info = createSlot(({ children }) => (\n <Popover textStyle=\"subtle\" variant=\"text\">\n <Popover.TrailingIcon>\n <IcoQuestionCircleFill />\n </Popover.TrailingIcon>\n <Popover.Content>{children}</Popover.Content>\n </Popover>\n));\nconst Title = createSlot(({ branding, title }: TitleProps) => {\n return title ? (\n <Text size=\"sm\" fontColor=\"text.secondary\">\n {title}\n </Text>\n ) : (\n <IcoMagic color={token(branding === 'light' ? 'colors.text.primary' : 'colors.neutral.primary')} />\n );\n});\n\nconst PageContent = createSlot(({ children }) => (\n <VStack w=\"full\" justify=\"center\">\n {children}\n </VStack>\n));\nconst PageMenu = createSlot(Menu);\nconst PageDrawer = createSlot(Drawer);\nconst PageFooter = createSlot(({ children }) => (\n <Center pt={3} w=\"full\">\n {children}\n </Center>\n));\nconst PageHeader = createSlot(({ children, domain, name, logoUrl }: HeaderProps) => (\n <HStack borderBottomColor=\"neutral.primary\" borderBottomWidth=\"1px\" p={3} width=\"full\">\n {logoUrl ? (\n <img src={logoUrl} alt={name} width={24} height={24} />\n ) : (\n <IcoMagic color={token('colors.brand.base')} height={24} width={24} />\n )}\n <Text size=\"sm\" fontWeight=\"semibold\">\n {name}\n </Text>\n {domain && (\n <Text size=\"sm\" fontColor=\"text.tertiary\">\n {domain}\n </Text>\n )}\n {children}\n </HStack>\n));\n\nconst PageHost = ({ actionDirection = 'row', address, children, onBack, onCancel, ...props }: PassportPageProps) => {\n return createHost(children, slots => {\n const cancelProps = slots.getProps(Cancel);\n const confirmProps = slots.getProps(Confirm);\n const drawerProps = slots.getProps(PageDrawer);\n const menuProps = slots.getProps(PageMenu);\n\n const actions = slots.get(Actions);\n const info = slots.get(Info);\n const title = slots.get(Title);\n\n const isRowDirection = actionDirection === 'row';\n\n return (\n <Modal {...props} fullscreen paddingType=\"none\" gap={0}>\n <VStack gap={0} width=\"full\">\n <HStack\n borderBottomColor=\"neutral.primary\"\n borderBottomWidth=\"1px\"\n justifyContent=\"space-between\"\n p={3}\n width=\"full\"\n >\n {onBack && (\n <Button onPress={onBack} size=\"md\" textStyle=\"neutral\" variant=\"text\">\n <Button.LeadingIcon>\n <IcoCaretLeft />\n </Button.LeadingIcon>\n </Button>\n )}\n {onCancel && <Button onPress={onCancel} label=\"Cancel\" size=\"sm\" textStyle=\"neutral\" variant=\"text\" />}\n {!(onBack || onCancel) && <Box w={6} />}\n {title}\n {address || info || menuProps ? (\n <HStack>\n {address && <WalletAddress address={address} />}\n {info}\n {menuProps && <Menu {...menuProps} />}\n </HStack>\n ) : (\n <Box w={6} />\n )}\n </HStack>\n {slots.get(PageHeader)}\n </VStack>\n <VStack h=\"full\" w=\"full\" justify=\"space-between\" p={6}>\n {slots.get(PageContent)}\n <VStack w=\"full\" gap={3}>\n {slots.get(PageFooter)}\n {(cancelProps || confirmProps) && (\n <Flex direction={isRowDirection ? 'row' : 'column-reverse'} gap={isRowDirection ? 4 : 3} width=\"full\">\n {cancelProps && <Button expand label=\"Cancel\" variant=\"neutral\" {...cancelProps} />}\n {confirmProps && <Button expand label=\"Confirm\" variant=\"inverse\" {...confirmProps} />}\n </Flex>\n )}\n {actions && (\n <Flex direction={actionDirection} gap={isRowDirection ? 4 : 3} width=\"full\">\n {actions}\n </Flex>\n )}\n </VStack>\n </VStack>\n {drawerProps && <Drawer {...drawerProps} />}\n </Modal>\n );\n });\n};\n\nexport const PassportPage = Object.assign(PageHost, {\n Actions,\n Cancel,\n Confirm,\n Content: PageContent,\n Menu: PageMenu,\n Drawer: PageDrawer,\n Footer: PageFooter,\n Header: PageHeader,\n Info,\n Title,\n});\n"],"names":["Actions","createSlot","children","Children","child","_jsx","Button","Cancel","Confirm","Info","_jsxs","Popover","IcoQuestionCircleFill","Title","branding","title","Text","IcoMagic","token","PageContent","VStack","PageMenu","Menu","PageDrawer","Drawer","PageFooter","Center","PageHeader","domain","name","logoUrl","HStack","PageHost","actionDirection","address","onBack","onCancel","props","createHost","slots","cancelProps","confirmProps","drawerProps","menuProps","actions","info","isRowDirection","Modal","IcoCaretLeft","Box","WalletAddress","Flex","PassportPage"],"mappings":"w7BAmCA,MAAMA,EAAUC,EAAAA,WAAW,CAAC,CAAE,SAAAC,CAAU,IAAKC,EAAS,SAAA,IAAID,EAAUE,GAASC,EAAAA,IAACC,EAAAA,QAAO,CAAA,OAAW,GAAA,GAAAF,EAAM,KAAS,CAAA,CAAA,CAAC,EAC1GG,EAASN,EAAAA,WAAWK,EAAAA,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,CAAA,GAAKkB,CAAe,CAAA,CAAA,CAAA,CAAA,CAGjD,CAAC,EAGUU,EAAe,OAAO,OAAOpB,EAAU,CAClD,QAAAhC,EACA,OAAAO,EACA,QAAAC,EACA,QAASW,EACT,KAAME,EACN,OAAQE,EACR,OAAQE,EACR,OAAQE,EACR,KAAAlB,EACA,MAAAI,CACD,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("react/jsx-runtime"),f=require("../containers/button.js");require("../containers/card.js");var y=require("@styled/css"),c=require("@styled/jsx");require("@styled/tokens"),require("../primitives/button.js"),require("../primitives/checkbox.js"),require("../primitives/dropdown-selector.js"),require("../primitives/popover.js"),require("../primitives/radio.js"),require("../primitives/segmented-control.js"),require("../primitives/switch.js");var d=require("../primitives/text.js"),u=require("react");require("../utils/client-asset-logo.js"),require("react-qrcode-logo"),require("../utils/secured-by-magic.js");var j=require("../logos/icon-generic-token.js");require("../containers/header.js"),require("../containers/menu.js"),require("../containers/modal.js"),require("../containers/overlay.js");var m=require("create-slots");const
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),f=require("../containers/button.js");require("../containers/card.js");var y=require("@styled/css"),c=require("@styled/jsx");require("@styled/tokens"),require("../primitives/button.js"),require("../primitives/checkbox.js"),require("../primitives/dropdown-selector.js"),require("../primitives/popover.js"),require("../primitives/radio.js"),require("../primitives/segmented-control.js"),require("../primitives/switch.js");var d=require("../primitives/text.js"),u=require("react");require("../utils/client-asset-logo.js"),require("react-qrcode-logo"),require("../utils/secured-by-magic.js");var j=require("../logos/icon-generic-token.js");require("../containers/header.js"),require("../containers/menu.js"),require("../containers/modal.js"),require("../containers/overlay.js");var m=require("create-slots");const g=m.createSlot(({children:t,...r})=>e.jsx(c.Center,{children:u.Children.map(t,i=>u.cloneElement(i,r))})),q=({name:t,fiatBalanceWithSymbol:r,tokenBalanceWithSymbol:i,tokenIcon:n,logoUrl:l,tokenBalanceFirst:s,disabled:o=!1})=>{const a=s||!r;return e.jsxs(c.HStack,{w:"full",justify:"space-between",opacity:o?"0.5":"1",children:[e.jsxs(c.HStack,{gap:4,children:[n?{...n,props:{...n.props,width:40,height:40}}:l?e.jsx("img",{width:40,height:40,src:l,alt:`${t} logo`}):e.jsx(j.default,{width:40,height:40}),e.jsx(d.default,{fontWeight:"medium",styles:{textTransform:"capitalize"},children:t})]}),e.jsxs(c.VStack,{gap:0,alignItems:"flex-end",children:[e.jsx(d.default,{size:"sm",styles:{lineHeight:"1.5rem",textAlign:"right"},children:a?i:r}),e.jsx(d.default,{size:"sm",fontColor:"text.secondary",styles:{lineHeight:"1.5rem",textAlign:"right"},children:a?r:i})]})]})},p=t=>{const{name:r,fiatBalanceWithSymbol:i,tokenBalanceWithSymbol:n,logoUrl:l,onPress:s,tokenBalanceFirst:o,disabled:a}=t,x=u.useRef(null),b=u.useCallback(()=>{s?.()},[s]);return m.createHost(t.children,k=>{const h=k.get(g);return s?e.jsx(f.ButtonContainer,{ref:x,className:y.css({_dark:{bg:"surface.tertiary"},_hover:{bg:"neutral.secondary"},bg:"neutral.quaternary",px:4,py:2,minH:16}),borderRadius:"0.5rem",expand:!0,onPress:a?void 0:b,disabled:a,children:e.jsx(q,{name:r,fiatBalanceWithSymbol:i,tokenBalanceWithSymbol:n,tokenIcon:h,logoUrl:l,tokenBalanceFirst:o,disabled:a})}):e.jsx(q,{name:r,fiatBalanceWithSymbol:i,tokenBalanceWithSymbol:n,tokenIcon:h,logoUrl:l,tokenBalanceFirst:o,disabled:a})})},B=Object.assign(p,{TokenIcon:g});exports.TokenListItem=B;
|
|
2
2
|
//# sourceMappingURL=token-list-item.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token-list-item.js","sources":["../../../../src/components/list-items/token-list-item.tsx"],"sourcesContent":["import { ButtonContainer } from '@components/containers';\nimport { IconGenericToken } from '@components/logos';\nimport { Text } from '@components/primitives';\nimport { css } from '@styled/css';\nimport { Center, HStack, VStack } from '@styled/jsx';\nimport { createHost, createSlot } from 'create-slots';\nimport { Children, cloneElement, FC, PropsWithChildren, useCallback, useRef } from 'react';\nimport { AriaButtonProps } from 'react-aria';\n\nexport interface TokenListItemProps extends AriaButtonProps {\n name: string;\n fiatBalanceWithSymbol?: string;\n tokenBalanceWithSymbol: string;\n logoUrl?: string;\n onPress?: () => void;\n tokenBalanceFirst?: boolean;\n disabled?: boolean;\n}\n\nconst TokenIcon = createSlot(({ children, ...props }) => {\n return (\n <Center>\n {Children.map(children, child => {\n return cloneElement(child, props);\n })}\n </Center>\n );\n});\n\ninterface ListContentProps extends Omit<TokenListItemProps, 'onPress'> {\n tokenIcon?: React.ReactElement;\n}\n\nconst ListContent = ({\n name,\n fiatBalanceWithSymbol,\n tokenBalanceWithSymbol,\n tokenIcon,\n logoUrl,\n tokenBalanceFirst,\n disabled = false,\n}: ListContentProps) => {\n const balanceFirst = tokenBalanceFirst || !fiatBalanceWithSymbol;\n return (\n <HStack w=\"full\" justify=\"space-between\" opacity={disabled ? '0.5' : '1'}>\n <HStack gap={4}>\n {tokenIcon ? (\n {\n ...tokenIcon,\n props: {\n ...tokenIcon.props,\n width: 40,\n height: 40,\n },\n }\n ) : logoUrl ? (\n <img width={40} height={40} src={logoUrl} alt={`${name} logo`} />\n ) : (\n <IconGenericToken width={40} height={40} />\n )}\n <Text fontWeight=\"medium\" styles={{ textTransform: 'capitalize' }}>\n {name}\n </Text>\n </HStack>\n <VStack gap={0} alignItems=\"flex-end\">\n <Text size=\"sm\" styles={{ lineHeight: '1.5rem' }}>\n {balanceFirst ? tokenBalanceWithSymbol : fiatBalanceWithSymbol}\n </Text>\n <Text size=\"sm\" fontColor=\"text.secondary\" styles={{ lineHeight: '1.5rem' }}>\n {balanceFirst ? fiatBalanceWithSymbol : tokenBalanceWithSymbol}\n </Text>\n </VStack>\n </HStack>\n );\n};\n\nconst TokenListItemBase: FC<PropsWithChildren<TokenListItemProps>> = props => {\n const { name, fiatBalanceWithSymbol, tokenBalanceWithSymbol, logoUrl, onPress, tokenBalanceFirst, disabled } = props;\n\n const ref = useRef(null);\n\n const handlePress = useCallback(() => {\n onPress?.();\n }, [onPress]);\n\n return createHost(props.children, slots => {\n const tokenIcon = slots.get(TokenIcon);\n\n if (onPress)\n return (\n <ButtonContainer\n ref={ref}\n className={css({\n _dark: { bg: 'surface.tertiary' },\n _hover: { bg: 'neutral.secondary' },\n bg: 'neutral.quaternary',\n px: 4,\n py: 2,\n minH: 16,\n })}\n borderRadius=\"0.5rem\"\n expand\n onPress={disabled ? undefined : handlePress}\n disabled={disabled}\n >\n <ListContent\n name={name}\n fiatBalanceWithSymbol={fiatBalanceWithSymbol}\n tokenBalanceWithSymbol={tokenBalanceWithSymbol}\n tokenIcon={tokenIcon}\n logoUrl={logoUrl}\n tokenBalanceFirst={tokenBalanceFirst}\n disabled={disabled}\n />\n </ButtonContainer>\n );\n\n return (\n <ListContent\n name={name}\n fiatBalanceWithSymbol={fiatBalanceWithSymbol}\n tokenBalanceWithSymbol={tokenBalanceWithSymbol}\n tokenIcon={tokenIcon}\n logoUrl={logoUrl}\n tokenBalanceFirst={tokenBalanceFirst}\n disabled={disabled}\n />\n );\n });\n};\n\nexport const TokenListItem = Object.assign(TokenListItemBase, { TokenIcon });\n"],"names":["TokenIcon","createSlot","children","props","_jsx","Center","Children","child","cloneElement","ListContent","name","fiatBalanceWithSymbol","tokenBalanceWithSymbol","tokenIcon","logoUrl","tokenBalanceFirst","disabled","balanceFirst","_jsxs","HStack","IconGenericToken","Text","VStack","TokenListItemBase","onPress","ref","useRef","handlePress","useCallback","createHost","slots","ButtonContainer","css","TokenListItem"],"mappings":"m1BAmBA,MAAMA,EAAYC,EAAW,WAAA,CAAC,CAAE,SAAAC,EAAU,GAAGC,CAAO,IAEhDC,EAAAA,IAACC,EAAAA,OAAM,CAAA,SACJC,EAAS,SAAA,IAAIJ,EAAUK,GACfC,eAAaD,EAAOJ,CAAK,CACjC,CACM,CAAA,CAEZ,EAMKM,EAAc,CAAC,CACnB,KAAAC,EACA,sBAAAC,EACA,uBAAAC,EACA,UAAAC,EACA,QAAAC,EACA,kBAAAC,EACA,SAAAC,EAAW,EACM,IAAI,CACrB,MAAMC,EAAeF,GAAqB,CAACJ,EAC3C,OACEO,
|
|
1
|
+
{"version":3,"file":"token-list-item.js","sources":["../../../../src/components/list-items/token-list-item.tsx"],"sourcesContent":["import { ButtonContainer } from '@components/containers';\nimport { IconGenericToken } from '@components/logos';\nimport { Text } from '@components/primitives';\nimport { css } from '@styled/css';\nimport { Center, HStack, VStack } from '@styled/jsx';\nimport { createHost, createSlot } from 'create-slots';\nimport { Children, cloneElement, FC, PropsWithChildren, useCallback, useRef } from 'react';\nimport { AriaButtonProps } from 'react-aria';\n\nexport interface TokenListItemProps extends AriaButtonProps {\n name: string;\n fiatBalanceWithSymbol?: string;\n tokenBalanceWithSymbol: string;\n logoUrl?: string;\n onPress?: () => void;\n tokenBalanceFirst?: boolean;\n disabled?: boolean;\n}\n\nconst TokenIcon = createSlot(({ children, ...props }) => {\n return (\n <Center>\n {Children.map(children, child => {\n return cloneElement(child, props);\n })}\n </Center>\n );\n});\n\ninterface ListContentProps extends Omit<TokenListItemProps, 'onPress'> {\n tokenIcon?: React.ReactElement;\n}\n\nconst ListContent = ({\n name,\n fiatBalanceWithSymbol,\n tokenBalanceWithSymbol,\n tokenIcon,\n logoUrl,\n tokenBalanceFirst,\n disabled = false,\n}: ListContentProps) => {\n const balanceFirst = tokenBalanceFirst || !fiatBalanceWithSymbol;\n return (\n <HStack w=\"full\" justify=\"space-between\" opacity={disabled ? '0.5' : '1'}>\n <HStack gap={4}>\n {tokenIcon ? (\n {\n ...tokenIcon,\n props: {\n ...tokenIcon.props,\n width: 40,\n height: 40,\n },\n }\n ) : logoUrl ? (\n <img width={40} height={40} src={logoUrl} alt={`${name} logo`} />\n ) : (\n <IconGenericToken width={40} height={40} />\n )}\n <Text fontWeight=\"medium\" styles={{ textTransform: 'capitalize' }}>\n {name}\n </Text>\n </HStack>\n <VStack gap={0} alignItems=\"flex-end\">\n <Text size=\"sm\" styles={{ lineHeight: '1.5rem', textAlign: 'right' }}>\n {balanceFirst ? tokenBalanceWithSymbol : fiatBalanceWithSymbol}\n </Text>\n <Text size=\"sm\" fontColor=\"text.secondary\" styles={{ lineHeight: '1.5rem', textAlign: 'right' }}>\n {balanceFirst ? fiatBalanceWithSymbol : tokenBalanceWithSymbol}\n </Text>\n </VStack>\n </HStack>\n );\n};\n\nconst TokenListItemBase: FC<PropsWithChildren<TokenListItemProps>> = props => {\n const { name, fiatBalanceWithSymbol, tokenBalanceWithSymbol, logoUrl, onPress, tokenBalanceFirst, disabled } = props;\n\n const ref = useRef(null);\n\n const handlePress = useCallback(() => {\n onPress?.();\n }, [onPress]);\n\n return createHost(props.children, slots => {\n const tokenIcon = slots.get(TokenIcon);\n\n if (onPress)\n return (\n <ButtonContainer\n ref={ref}\n className={css({\n _dark: { bg: 'surface.tertiary' },\n _hover: { bg: 'neutral.secondary' },\n bg: 'neutral.quaternary',\n px: 4,\n py: 2,\n minH: 16,\n })}\n borderRadius=\"0.5rem\"\n expand\n onPress={disabled ? undefined : handlePress}\n disabled={disabled}\n >\n <ListContent\n name={name}\n fiatBalanceWithSymbol={fiatBalanceWithSymbol}\n tokenBalanceWithSymbol={tokenBalanceWithSymbol}\n tokenIcon={tokenIcon}\n logoUrl={logoUrl}\n tokenBalanceFirst={tokenBalanceFirst}\n disabled={disabled}\n />\n </ButtonContainer>\n );\n\n return (\n <ListContent\n name={name}\n fiatBalanceWithSymbol={fiatBalanceWithSymbol}\n tokenBalanceWithSymbol={tokenBalanceWithSymbol}\n tokenIcon={tokenIcon}\n logoUrl={logoUrl}\n tokenBalanceFirst={tokenBalanceFirst}\n disabled={disabled}\n />\n );\n });\n};\n\nexport const TokenListItem = Object.assign(TokenListItemBase, { TokenIcon });\n"],"names":["TokenIcon","createSlot","children","props","_jsx","Center","Children","child","cloneElement","ListContent","name","fiatBalanceWithSymbol","tokenBalanceWithSymbol","tokenIcon","logoUrl","tokenBalanceFirst","disabled","balanceFirst","_jsxs","HStack","IconGenericToken","Text","VStack","TokenListItemBase","onPress","ref","useRef","handlePress","useCallback","createHost","slots","ButtonContainer","css","TokenListItem"],"mappings":"m1BAmBA,MAAMA,EAAYC,EAAW,WAAA,CAAC,CAAE,SAAAC,EAAU,GAAGC,CAAO,IAEhDC,EAAAA,IAACC,EAAAA,OAAM,CAAA,SACJC,EAAS,SAAA,IAAIJ,EAAUK,GACfC,eAAaD,EAAOJ,CAAK,CACjC,CACM,CAAA,CAEZ,EAMKM,EAAc,CAAC,CACnB,KAAAC,EACA,sBAAAC,EACA,uBAAAC,EACA,UAAAC,EACA,QAAAC,EACA,kBAAAC,EACA,SAAAC,EAAW,EACM,IAAI,CACrB,MAAMC,EAAeF,GAAqB,CAACJ,EAC3C,OACEO,EAACC,KAAAA,EAAAA,OAAM,CAAC,EAAE,OAAO,QAAQ,gBAAgB,QAASH,EAAW,MAAQ,IAAG,SAAA,CACtEE,EAAAA,KAACC,EAAAA,OAAM,CAAC,IAAK,EACV,SAAA,CAAAN,EACC,CACE,GAAGA,EACH,MAAO,CACL,GAAGA,EAAU,MACb,MAAO,GACP,OAAQ,EACT,CACF,EACCC,EACFV,EAAAA,IAAA,MAAA,CAAK,MAAO,GAAI,OAAQ,GAAI,IAAKU,EAAS,IAAK,GAAGJ,CAAI,OAAO,CAAA,EAE7DN,MAACgB,EAAiB,QAAA,CAAA,MAAO,GAAI,OAAQ,EAAE,CAAA,EAEzChB,MAACiB,UAAK,CAAA,WAAW,SAAS,OAAQ,CAAE,cAAe,cAChD,SAAAX,CACI,CAAA,CAAA,CAAA,CAAA,EAETQ,EAAAA,KAACI,SAAM,CAAC,IAAK,EAAG,WAAW,WACzB,SAAA,CAAAlB,EAAAA,IAACiB,EAAAA,QAAK,CAAA,KAAK,KAAK,OAAQ,CAAE,WAAY,SAAU,UAAW,OAAS,EAAA,SACjEJ,EAAeL,EAAyBD,IAE3CP,EAAAA,IAACiB,EA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ers/card.js";import"@styled/css";import{VStack as d,Center as J,HStack as g,Box as y,Flex as P}from"@styled/jsx";import{Drawer as v}from"../containers/drawer.js";import{Children as O}from"react";import"../utils/client-asset-logo.js";import{token as B}from"@styled/tokens";import"react-qrcode-logo";import"../utils/secured-by-magic.js";import U from"../icons/ico-caret-left.js";import j from"../icons/ico-magic.js";import V from"../icons/ico-question-circle-fill.js";import"../containers/header.js";import{Menu as z}from"../containers/menu.js";import{Modal as $}from"../containers/modal.js";import"../containers/overlay.js";import"../info/copy-button.js";import"../info/email-wbr.js";import"../info/security-otp.js";import"../info/text-box.js";import q from"../info/wallet-address.js";import l from"../primitives/button.js";import{Popover as u}from"../primitives/popover.js";import w from"../primitives/text.js";import{createSlot as i,createHost as E}from"create-slots";const S=i(({children:e})=>O.map(e,t=>r(l,{expand:!0,...t.props}))),k=i(l),D=i(l),H=i(({children:e})=>n(u,{textStyle:"subtle",variant:"text",children:[r(u.TrailingIcon,{children:r(V,{})}),r(u.Content,{children:e})]})),M=i(({branding:e,title:t})=>t?r(w,{size:"sm",fontColor:"text.secondary",children:t}):r(j,{color:B(e==="light"?"colors.text.primary":"colors.neutral.primary")})),T=i(({children:e})=>r(d,{w:"full",justify:"center",children:e})),W=i(z),F=i(v),I=i(({children:e})=>r(J,{pt:3,w:"full",children:e})),A=i(({children:e,domain:t,name:a,logoUrl:m})=>n(g,{borderBottomColor:"neutral.primary",borderBottomWidth:"1px",p:3,width:"full",children:[m?r("img",{src:m,alt:a,width:24,height:24}):r(j,{color:B("colors.brand.base"),height:24,width:24}),r(w,{size:"sm",fontWeight:"semibold",children:a}),t&&r(w,{size:"sm",fontColor:"text.tertiary",children:t}),e]})),K=({actionDirection:e="row",address:t,children:a,onBack:m,onCancel:p,...L})=>E(a,o=>{const c=o.getProps(k),s=o.getProps(D),x=o.getProps(F),h=o.getProps(W),C=o.get(S),b=o.get(H),G=o.get(M),f=e==="row";return n($,{...L,fullscreen:!0,paddingType:"none",gap:0,children:[n(d,{gap:0,width:"full",children:[n(g,{borderBottomColor:"neutral.primary",borderBottomWidth:"1px",justifyContent:"space-between",p:3,width:"full",children:[m&&r(l,{onPress:m,size:"md",textStyle:"neutral",variant:"text",children:r(l.LeadingIcon,{children:r(U,{})})}),p&&r(l,{onPress:p,label:"Cancel",size:"sm",textStyle:"neutral",variant:"text"}),!(m||p)&&r(y,{w:6}),G,t||b||h?n(g,{children:[t&&r(q,{address:t}),b,h&&r(z,{...h})]}):r(y,{w:6})]}),o.get(A)]}),n(d,{h:"full",w:"full",justify:"space-between",p:6,children:[o.get(T),n(d,{w:"full",gap:3,children:[(c||s)&&n(P,{direction:f?"row":"column-reverse",gap:f?4:3,width:"full",children:[c&&r(l,{expand:!0,label:"Cancel",variant:"neutral",...c}),s&&r(l,{expand:!0,label:"Confirm",variant:"inverse",...s})]}),C&&r(P,{direction:e,gap:f?4:3,width:"full",children:C})
|
|
1
|
+
import{jsx as r,jsxs as n}from"react/jsx-runtime";import"../containers/button.js";import"../containers/card.js";import"@styled/css";import{VStack as d,Center as J,HStack as g,Box as y,Flex as P}from"@styled/jsx";import{Drawer as v}from"../containers/drawer.js";import{Children as O}from"react";import"../utils/client-asset-logo.js";import{token as B}from"@styled/tokens";import"react-qrcode-logo";import"../utils/secured-by-magic.js";import U from"../icons/ico-caret-left.js";import j from"../icons/ico-magic.js";import V from"../icons/ico-question-circle-fill.js";import"../containers/header.js";import{Menu as z}from"../containers/menu.js";import{Modal as $}from"../containers/modal.js";import"../containers/overlay.js";import"../info/copy-button.js";import"../info/email-wbr.js";import"../info/security-otp.js";import"../info/text-box.js";import q from"../info/wallet-address.js";import l from"../primitives/button.js";import{Popover as u}from"../primitives/popover.js";import w from"../primitives/text.js";import{createSlot as i,createHost as E}from"create-slots";const S=i(({children:e})=>O.map(e,t=>r(l,{expand:!0,...t.props}))),k=i(l),D=i(l),H=i(({children:e})=>n(u,{textStyle:"subtle",variant:"text",children:[r(u.TrailingIcon,{children:r(V,{})}),r(u.Content,{children:e})]})),M=i(({branding:e,title:t})=>t?r(w,{size:"sm",fontColor:"text.secondary",children:t}):r(j,{color:B(e==="light"?"colors.text.primary":"colors.neutral.primary")})),T=i(({children:e})=>r(d,{w:"full",justify:"center",children:e})),W=i(z),F=i(v),I=i(({children:e})=>r(J,{pt:3,w:"full",children:e})),A=i(({children:e,domain:t,name:a,logoUrl:m})=>n(g,{borderBottomColor:"neutral.primary",borderBottomWidth:"1px",p:3,width:"full",children:[m?r("img",{src:m,alt:a,width:24,height:24}):r(j,{color:B("colors.brand.base"),height:24,width:24}),r(w,{size:"sm",fontWeight:"semibold",children:a}),t&&r(w,{size:"sm",fontColor:"text.tertiary",children:t}),e]})),K=({actionDirection:e="row",address:t,children:a,onBack:m,onCancel:p,...L})=>E(a,o=>{const c=o.getProps(k),s=o.getProps(D),x=o.getProps(F),h=o.getProps(W),C=o.get(S),b=o.get(H),G=o.get(M),f=e==="row";return n($,{...L,fullscreen:!0,paddingType:"none",gap:0,children:[n(d,{gap:0,width:"full",children:[n(g,{borderBottomColor:"neutral.primary",borderBottomWidth:"1px",justifyContent:"space-between",p:3,width:"full",children:[m&&r(l,{onPress:m,size:"md",textStyle:"neutral",variant:"text",children:r(l.LeadingIcon,{children:r(U,{})})}),p&&r(l,{onPress:p,label:"Cancel",size:"sm",textStyle:"neutral",variant:"text"}),!(m||p)&&r(y,{w:6}),G,t||b||h?n(g,{children:[t&&r(q,{address:t}),b,h&&r(z,{...h})]}):r(y,{w:6})]}),o.get(A)]}),n(d,{h:"full",w:"full",justify:"space-between",p:6,children:[o.get(T),n(d,{w:"full",gap:3,children:[o.get(I),(c||s)&&n(P,{direction:f?"row":"column-reverse",gap:f?4:3,width:"full",children:[c&&r(l,{expand:!0,label:"Cancel",variant:"neutral",...c}),s&&r(l,{expand:!0,label:"Confirm",variant:"inverse",...s})]}),C&&r(P,{direction:e,gap:f?4:3,width:"full",children:C})]})]}),x&&r(v,{...x})]})}),N=Object.assign(K,{Actions:S,Cancel:k,Confirm:D,Content:T,Menu:W,Drawer:F,Footer:I,Header:A,Info:H,Title:M});export{N as PassportPage};
|
|
2
2
|
//# sourceMappingURL=passport-page.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"passport-page.js","sources":["../../../../src/components/layouts/passport-page.tsx"],"sourcesContent":["import { Menu } from '@components/containers';\nimport { Drawer } from '@components/containers/drawer';\nimport { Modal } from '@components/containers/modal';\nimport { IcoCaretLeft, IcoMagic, IcoQuestionCircleFill } from '@components/icons';\nimport { WalletAddress } from '@components/info';\nimport Button from '@components/primitives/button';\nimport Popover from '@components/primitives/popover';\nimport Text from '@components/primitives/text';\nimport { Box, Center, Flex, HStack, VStack } from '@styled/jsx';\nimport { token } from '@styled/tokens';\nimport { createHost, createSlot } from 'create-slots';\nimport { Children, PropsWithChildren } from 'react';\n\nexport interface HeaderProps extends PropsWithChildren {\n name: string;\n domain?: string;\n logoUrl?: string;\n}\n\nexport interface TitleProps {\n branding?: 'light' | 'dark';\n title?: string;\n}\n\nexport interface PassportPageProps extends PropsWithChildren {\n address?: string;\n animate?: boolean;\n actionDirection?: 'column' | 'row';\n isOpen?: boolean;\n onAnimated?: () => void;\n onBack?: () => void;\n onClosed?: () => void;\n onCancel?: () => void;\n}\n\nconst Actions = createSlot(({ children }) => Children.map(children, child => <Button expand {...child.props} />));\nconst Cancel = createSlot(Button);\nconst Confirm = createSlot(Button);\nconst Info = createSlot(({ children }) => (\n <Popover textStyle=\"subtle\" variant=\"text\">\n <Popover.TrailingIcon>\n <IcoQuestionCircleFill />\n </Popover.TrailingIcon>\n <Popover.Content>{children}</Popover.Content>\n </Popover>\n));\nconst Title = createSlot(({ branding, title }: TitleProps) => {\n return title ? (\n <Text size=\"sm\" fontColor=\"text.secondary\">\n {title}\n </Text>\n ) : (\n <IcoMagic color={token(branding === 'light' ? 'colors.text.primary' : 'colors.neutral.primary')} />\n );\n});\n\nconst PageContent = createSlot(({ children }) => (\n <VStack w=\"full\" justify=\"center\">\n {children}\n </VStack>\n));\nconst PageMenu = createSlot(Menu);\nconst PageDrawer = createSlot(Drawer);\nconst PageFooter = createSlot(({ children }) => (\n <Center pt={3} w=\"full\">\n {children}\n </Center>\n));\nconst PageHeader = createSlot(({ children, domain, name, logoUrl }: HeaderProps) => (\n <HStack borderBottomColor=\"neutral.primary\" borderBottomWidth=\"1px\" p={3} width=\"full\">\n {logoUrl ? (\n <img src={logoUrl} alt={name} width={24} height={24} />\n ) : (\n <IcoMagic color={token('colors.brand.base')} height={24} width={24} />\n )}\n <Text size=\"sm\" fontWeight=\"semibold\">\n {name}\n </Text>\n {domain && (\n <Text size=\"sm\" fontColor=\"text.tertiary\">\n {domain}\n </Text>\n )}\n {children}\n </HStack>\n));\n\nconst PageHost = ({ actionDirection = 'row', address, children, onBack, onCancel, ...props }: PassportPageProps) => {\n return createHost(children, slots => {\n const cancelProps = slots.getProps(Cancel);\n const confirmProps = slots.getProps(Confirm);\n const drawerProps = slots.getProps(PageDrawer);\n const menuProps = slots.getProps(PageMenu);\n\n const actions = slots.get(Actions);\n const info = slots.get(Info);\n const title = slots.get(Title);\n\n const isRowDirection = actionDirection === 'row';\n\n return (\n <Modal {...props} fullscreen paddingType=\"none\" gap={0}>\n <VStack gap={0} width=\"full\">\n <HStack\n borderBottomColor=\"neutral.primary\"\n borderBottomWidth=\"1px\"\n justifyContent=\"space-between\"\n p={3}\n width=\"full\"\n >\n {onBack && (\n <Button onPress={onBack} size=\"md\" textStyle=\"neutral\" variant=\"text\">\n <Button.LeadingIcon>\n <IcoCaretLeft />\n </Button.LeadingIcon>\n </Button>\n )}\n {onCancel && <Button onPress={onCancel} label=\"Cancel\" size=\"sm\" textStyle=\"neutral\" variant=\"text\" />}\n {!(onBack || onCancel) && <Box w={6} />}\n {title}\n {address || info || menuProps ? (\n <HStack>\n {address && <WalletAddress address={address} />}\n {info}\n {menuProps && <Menu {...menuProps} />}\n </HStack>\n ) : (\n <Box w={6} />\n )}\n </HStack>\n {slots.get(PageHeader)}\n </VStack>\n <VStack h=\"full\" w=\"full\" justify=\"space-between\" p={6}>\n {slots.get(PageContent)}\n <VStack w=\"full\" gap={3}>\n {(cancelProps || confirmProps) && (\n <Flex direction={isRowDirection ? 'row' : 'column-reverse'} gap={isRowDirection ? 4 : 3} width=\"full\">\n {cancelProps && <Button expand label=\"Cancel\" variant=\"neutral\" {...cancelProps} />}\n {confirmProps && <Button expand label=\"Confirm\" variant=\"inverse\" {...confirmProps} />}\n </Flex>\n )}\n {actions && (\n <Flex direction={actionDirection} gap={isRowDirection ? 4 : 3} width=\"full\">\n {actions}\n </Flex>\n )}\n
|
|
1
|
+
{"version":3,"file":"passport-page.js","sources":["../../../../src/components/layouts/passport-page.tsx"],"sourcesContent":["import { Menu } from '@components/containers';\nimport { Drawer } from '@components/containers/drawer';\nimport { Modal } from '@components/containers/modal';\nimport { IcoCaretLeft, IcoMagic, IcoQuestionCircleFill } from '@components/icons';\nimport { WalletAddress } from '@components/info';\nimport Button from '@components/primitives/button';\nimport Popover from '@components/primitives/popover';\nimport Text from '@components/primitives/text';\nimport { Box, Center, Flex, HStack, VStack } from '@styled/jsx';\nimport { token } from '@styled/tokens';\nimport { createHost, createSlot } from 'create-slots';\nimport { Children, PropsWithChildren } from 'react';\n\nexport interface HeaderProps extends PropsWithChildren {\n name: string;\n domain?: string;\n logoUrl?: string;\n}\n\nexport interface TitleProps {\n branding?: 'light' | 'dark';\n title?: string;\n}\n\nexport interface PassportPageProps extends PropsWithChildren {\n address?: string;\n animate?: boolean;\n actionDirection?: 'column' | 'row';\n isOpen?: boolean;\n onAnimated?: () => void;\n onBack?: () => void;\n onClosed?: () => void;\n onCancel?: () => void;\n}\n\nconst Actions = createSlot(({ children }) => Children.map(children, child => <Button expand {...child.props} />));\nconst Cancel = createSlot(Button);\nconst Confirm = createSlot(Button);\nconst Info = createSlot(({ children }) => (\n <Popover textStyle=\"subtle\" variant=\"text\">\n <Popover.TrailingIcon>\n <IcoQuestionCircleFill />\n </Popover.TrailingIcon>\n <Popover.Content>{children}</Popover.Content>\n </Popover>\n));\nconst Title = createSlot(({ branding, title }: TitleProps) => {\n return title ? (\n <Text size=\"sm\" fontColor=\"text.secondary\">\n {title}\n </Text>\n ) : (\n <IcoMagic color={token(branding === 'light' ? 'colors.text.primary' : 'colors.neutral.primary')} />\n );\n});\n\nconst PageContent = createSlot(({ children }) => (\n <VStack w=\"full\" justify=\"center\">\n {children}\n </VStack>\n));\nconst PageMenu = createSlot(Menu);\nconst PageDrawer = createSlot(Drawer);\nconst PageFooter = createSlot(({ children }) => (\n <Center pt={3} w=\"full\">\n {children}\n </Center>\n));\nconst PageHeader = createSlot(({ children, domain, name, logoUrl }: HeaderProps) => (\n <HStack borderBottomColor=\"neutral.primary\" borderBottomWidth=\"1px\" p={3} width=\"full\">\n {logoUrl ? (\n <img src={logoUrl} alt={name} width={24} height={24} />\n ) : (\n <IcoMagic color={token('colors.brand.base')} height={24} width={24} />\n )}\n <Text size=\"sm\" fontWeight=\"semibold\">\n {name}\n </Text>\n {domain && (\n <Text size=\"sm\" fontColor=\"text.tertiary\">\n {domain}\n </Text>\n )}\n {children}\n </HStack>\n));\n\nconst PageHost = ({ actionDirection = 'row', address, children, onBack, onCancel, ...props }: PassportPageProps) => {\n return createHost(children, slots => {\n const cancelProps = slots.getProps(Cancel);\n const confirmProps = slots.getProps(Confirm);\n const drawerProps = slots.getProps(PageDrawer);\n const menuProps = slots.getProps(PageMenu);\n\n const actions = slots.get(Actions);\n const info = slots.get(Info);\n const title = slots.get(Title);\n\n const isRowDirection = actionDirection === 'row';\n\n return (\n <Modal {...props} fullscreen paddingType=\"none\" gap={0}>\n <VStack gap={0} width=\"full\">\n <HStack\n borderBottomColor=\"neutral.primary\"\n borderBottomWidth=\"1px\"\n justifyContent=\"space-between\"\n p={3}\n width=\"full\"\n >\n {onBack && (\n <Button onPress={onBack} size=\"md\" textStyle=\"neutral\" variant=\"text\">\n <Button.LeadingIcon>\n <IcoCaretLeft />\n </Button.LeadingIcon>\n </Button>\n )}\n {onCancel && <Button onPress={onCancel} label=\"Cancel\" size=\"sm\" textStyle=\"neutral\" variant=\"text\" />}\n {!(onBack || onCancel) && <Box w={6} />}\n {title}\n {address || info || menuProps ? (\n <HStack>\n {address && <WalletAddress address={address} />}\n {info}\n {menuProps && <Menu {...menuProps} />}\n </HStack>\n ) : (\n <Box w={6} />\n )}\n </HStack>\n {slots.get(PageHeader)}\n </VStack>\n <VStack h=\"full\" w=\"full\" justify=\"space-between\" p={6}>\n {slots.get(PageContent)}\n <VStack w=\"full\" gap={3}>\n {slots.get(PageFooter)}\n {(cancelProps || confirmProps) && (\n <Flex direction={isRowDirection ? 'row' : 'column-reverse'} gap={isRowDirection ? 4 : 3} width=\"full\">\n {cancelProps && <Button expand label=\"Cancel\" variant=\"neutral\" {...cancelProps} />}\n {confirmProps && <Button expand label=\"Confirm\" variant=\"inverse\" {...confirmProps} />}\n </Flex>\n )}\n {actions && (\n <Flex direction={actionDirection} gap={isRowDirection ? 4 : 3} width=\"full\">\n {actions}\n </Flex>\n )}\n </VStack>\n </VStack>\n {drawerProps && <Drawer {...drawerProps} />}\n </Modal>\n );\n });\n};\n\nexport const PassportPage = Object.assign(PageHost, {\n Actions,\n Cancel,\n Confirm,\n Content: PageContent,\n Menu: PageMenu,\n Drawer: PageDrawer,\n Footer: PageFooter,\n Header: PageHeader,\n Info,\n Title,\n});\n"],"names":["Actions","createSlot","children","Children","child","_jsx","Button","Cancel","Confirm","Info","_jsxs","Popover","IcoQuestionCircleFill","Title","branding","title","Text","IcoMagic","token","PageContent","VStack","PageMenu","Menu","PageDrawer","Drawer","PageFooter","Center","PageHeader","domain","name","logoUrl","HStack","PageHost","actionDirection","address","onBack","onCancel","props","createHost","slots","cancelProps","confirmProps","drawerProps","menuProps","actions","info","isRowDirection","Modal","IcoCaretLeft","Box","WalletAddress","Flex","PassportPage"],"mappings":"4iCAmCA,MAAMA,EAAUC,EAAW,CAAC,CAAE,SAAAC,CAAU,IAAKC,EAAS,IAAID,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,EAACqB,EACE,CAAA,SAAA,CAAAG,GAAW7B,EAAC6C,GAAc,QAAShB,CAAW,CAAA,EAC9CW,EACAF,GAAatC,EAACiB,EAAS,CAAA,GAAAqB,GAAa,CAC9B,CAAA,EAETtC,EAAC4C,EAAI,CAAA,EAAG,CAAC,CAAA,CACV,CAAA,CAAA,EAEFV,EAAM,IAAIZ,CAAU,CAAC,CAAA,CAAA,EAExBjB,EAACU,EAAO,CAAA,EAAE,OAAO,EAAE,OAAO,QAAQ,gBAAgB,EAAG,YAClDmB,EAAM,IAAIpB,CAAW,EACtBT,EAACU,EAAM,CAAC,EAAE,OAAO,IAAK,EAAC,SAAA,CACpBmB,EAAM,IAAId,CAAU,GACnBe,GAAeC,IACf/B,EAACyC,EAAI,CAAC,UAAWL,EAAiB,MAAQ,iBAAkB,IAAKA,EAAiB,EAAI,EAAG,MAAM,OAC5F,SAAA,CAAAN,GAAenC,EAACC,EAAO,CAAA,UAAO,MAAM,SAAS,QAAQ,UAAS,GAAKkC,CAAW,CAAA,EAC9EC,GAAgBpC,EAACC,EAAM,CAAC,OAAO,GAAA,MAAM,UAAU,QAAQ,UAAc,GAAAmC,GAAgB,CACjF,CAAA,EAERG,GACCvC,EAAC8C,EAAK,CAAA,UAAWlB,EAAiB,IAAKa,EAAiB,EAAI,EAAG,MAAM,OAAM,SACxEF,CACI,CAAA,CACR,GACM,CACF,CAAA,EACRF,GAAerC,EAACmB,EAAM,CAAA,GAAKkB,CAAe,CAAA,CAAA,CAAA,CAAA,CAGjD,CAAC,EAGUU,EAAe,OAAO,OAAOpB,EAAU,CAClD,QAAAhC,EACA,OAAAO,EACA,QAAAC,EACA,QAASW,EACT,KAAME,EACN,OAAQE,EACR,OAAQE,EACR,OAAQE,EACR,KAAAlB,EACA,MAAAI,CACD,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as t,jsxs as s}from"react/jsx-runtime";import{ButtonContainer as k}from"../containers/button.js";import"../containers/card.js";import{css as u}from"@styled/css";import{Center as B,HStack as d,VStack as S}from"@styled/jsx";import"@styled/tokens";import"../primitives/button.js";import"../primitives/checkbox.js";import"../primitives/dropdown-selector.js";import"../primitives/popover.js";import"../primitives/radio.js";import"../primitives/segmented-control.js";import"../primitives/switch.js";import c from"../primitives/text.js";import{Children as x,cloneElement as W,useRef as I,useCallback as w}from"react";import"../utils/client-asset-logo.js";import"react-qrcode-logo";import"../utils/secured-by-magic.js";import C from"../logos/icon-generic-token.js";import"../containers/header.js";import"../containers/menu.js";import"../containers/modal.js";import"../containers/overlay.js";import{createSlot as F,createHost as H}from"create-slots";const h=F(({children:o,...e})=>t(B,{children:x.map(o,i=>W(i,e))})),g=({name:o,fiatBalanceWithSymbol:e,tokenBalanceWithSymbol:i,tokenIcon:n,logoUrl:l,tokenBalanceFirst:a,disabled:m=!1})=>{const r=a||!e;return s(d,{w:"full",justify:"space-between",opacity:m?"0.5":"1",children:[s(d,{gap:4,children:[n?{...n,props:{...n.props,width:40,height:40}}:l?t("img",{width:40,height:40,src:l,alt:`${o} logo`}):t(C,{width:40,height:40}),t(c,{fontWeight:"medium",styles:{textTransform:"capitalize"},children:o})]}),s(S,{gap:0,alignItems:"flex-end",children:[t(c,{size:"sm",styles:{lineHeight:"1.5rem",textAlign:"right"},children:r?i:e}),t(c,{size:"sm",fontColor:"text.secondary",styles:{lineHeight:"1.5rem",textAlign:"right"},children:r?e:i})]})]})},j=o=>{const{name:e,fiatBalanceWithSymbol:i,tokenBalanceWithSymbol:n,logoUrl:l,onPress:a,tokenBalanceFirst:m,disabled:r}=o,f=I(null),b=w(()=>{a?.()},[a]);return H(o.children,y=>{const p=y.get(h);return a?t(k,{ref:f,className:u({_dark:{bg:"surface.tertiary"},_hover:{bg:"neutral.secondary"},bg:"neutral.quaternary",px:4,py:2,minH:16}),borderRadius:"0.5rem",expand:!0,onPress:r?void 0:b,disabled:r,children:t(g,{name:e,fiatBalanceWithSymbol:i,tokenBalanceWithSymbol:n,tokenIcon:p,logoUrl:l,tokenBalanceFirst:m,disabled:r})}):t(g,{name:e,fiatBalanceWithSymbol:i,tokenBalanceWithSymbol:n,tokenIcon:p,logoUrl:l,tokenBalanceFirst:m,disabled:r})})},U=Object.assign(j,{TokenIcon:h});export{U as TokenListItem};
|
|
2
2
|
//# sourceMappingURL=token-list-item.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token-list-item.js","sources":["../../../../src/components/list-items/token-list-item.tsx"],"sourcesContent":["import { ButtonContainer } from '@components/containers';\nimport { IconGenericToken } from '@components/logos';\nimport { Text } from '@components/primitives';\nimport { css } from '@styled/css';\nimport { Center, HStack, VStack } from '@styled/jsx';\nimport { createHost, createSlot } from 'create-slots';\nimport { Children, cloneElement, FC, PropsWithChildren, useCallback, useRef } from 'react';\nimport { AriaButtonProps } from 'react-aria';\n\nexport interface TokenListItemProps extends AriaButtonProps {\n name: string;\n fiatBalanceWithSymbol?: string;\n tokenBalanceWithSymbol: string;\n logoUrl?: string;\n onPress?: () => void;\n tokenBalanceFirst?: boolean;\n disabled?: boolean;\n}\n\nconst TokenIcon = createSlot(({ children, ...props }) => {\n return (\n <Center>\n {Children.map(children, child => {\n return cloneElement(child, props);\n })}\n </Center>\n );\n});\n\ninterface ListContentProps extends Omit<TokenListItemProps, 'onPress'> {\n tokenIcon?: React.ReactElement;\n}\n\nconst ListContent = ({\n name,\n fiatBalanceWithSymbol,\n tokenBalanceWithSymbol,\n tokenIcon,\n logoUrl,\n tokenBalanceFirst,\n disabled = false,\n}: ListContentProps) => {\n const balanceFirst = tokenBalanceFirst || !fiatBalanceWithSymbol;\n return (\n <HStack w=\"full\" justify=\"space-between\" opacity={disabled ? '0.5' : '1'}>\n <HStack gap={4}>\n {tokenIcon ? (\n {\n ...tokenIcon,\n props: {\n ...tokenIcon.props,\n width: 40,\n height: 40,\n },\n }\n ) : logoUrl ? (\n <img width={40} height={40} src={logoUrl} alt={`${name} logo`} />\n ) : (\n <IconGenericToken width={40} height={40} />\n )}\n <Text fontWeight=\"medium\" styles={{ textTransform: 'capitalize' }}>\n {name}\n </Text>\n </HStack>\n <VStack gap={0} alignItems=\"flex-end\">\n <Text size=\"sm\" styles={{ lineHeight: '1.5rem' }}>\n {balanceFirst ? tokenBalanceWithSymbol : fiatBalanceWithSymbol}\n </Text>\n <Text size=\"sm\" fontColor=\"text.secondary\" styles={{ lineHeight: '1.5rem' }}>\n {balanceFirst ? fiatBalanceWithSymbol : tokenBalanceWithSymbol}\n </Text>\n </VStack>\n </HStack>\n );\n};\n\nconst TokenListItemBase: FC<PropsWithChildren<TokenListItemProps>> = props => {\n const { name, fiatBalanceWithSymbol, tokenBalanceWithSymbol, logoUrl, onPress, tokenBalanceFirst, disabled } = props;\n\n const ref = useRef(null);\n\n const handlePress = useCallback(() => {\n onPress?.();\n }, [onPress]);\n\n return createHost(props.children, slots => {\n const tokenIcon = slots.get(TokenIcon);\n\n if (onPress)\n return (\n <ButtonContainer\n ref={ref}\n className={css({\n _dark: { bg: 'surface.tertiary' },\n _hover: { bg: 'neutral.secondary' },\n bg: 'neutral.quaternary',\n px: 4,\n py: 2,\n minH: 16,\n })}\n borderRadius=\"0.5rem\"\n expand\n onPress={disabled ? undefined : handlePress}\n disabled={disabled}\n >\n <ListContent\n name={name}\n fiatBalanceWithSymbol={fiatBalanceWithSymbol}\n tokenBalanceWithSymbol={tokenBalanceWithSymbol}\n tokenIcon={tokenIcon}\n logoUrl={logoUrl}\n tokenBalanceFirst={tokenBalanceFirst}\n disabled={disabled}\n />\n </ButtonContainer>\n );\n\n return (\n <ListContent\n name={name}\n fiatBalanceWithSymbol={fiatBalanceWithSymbol}\n tokenBalanceWithSymbol={tokenBalanceWithSymbol}\n tokenIcon={tokenIcon}\n logoUrl={logoUrl}\n tokenBalanceFirst={tokenBalanceFirst}\n disabled={disabled}\n />\n );\n });\n};\n\nexport const TokenListItem = Object.assign(TokenListItemBase, { TokenIcon });\n"],"names":["TokenIcon","createSlot","children","props","_jsx","Center","Children","child","cloneElement","ListContent","name","fiatBalanceWithSymbol","tokenBalanceWithSymbol","tokenIcon","logoUrl","tokenBalanceFirst","disabled","balanceFirst","_jsxs","HStack","IconGenericToken","Text","VStack","TokenListItemBase","onPress","ref","useRef","handlePress","useCallback","createHost","slots","ButtonContainer","css","TokenListItem"],"mappings":"w7BAmBA,MAAMA,EAAYC,EAAW,CAAC,CAAE,SAAAC,EAAU,GAAGC,CAAO,IAEhDC,EAACC,EAAM,CAAA,SACJC,EAAS,IAAIJ,EAAUK,GACfC,EAAaD,EAAOJ,CAAK,CACjC,CACM,CAAA,CAEZ,EAMKM,EAAc,CAAC,CACnB,KAAAC,EACA,sBAAAC,EACA,uBAAAC,EACA,UAAAC,EACA,QAAAC,EACA,kBAAAC,EACA,SAAAC,EAAW,EACM,IAAI,CACrB,MAAMC,EAAeF,GAAqB,CAACJ,EAC3C,OACEO,EAACC,EAAM,CAAC,EAAE,OAAO,QAAQ,gBAAgB,QAASH,EAAW,MAAQ,IAAG,SAAA,CACtEE,EAACC,EAAM,CAAC,IAAK,EACV,SAAA,CAAAN,EACC,CACE,GAAGA,EACH,MAAO,CACL,GAAGA,EAAU,MACb,MAAO,GACP,OAAQ,EACT,CACF,EACCC,EACFV,
|
|
1
|
+
{"version":3,"file":"token-list-item.js","sources":["../../../../src/components/list-items/token-list-item.tsx"],"sourcesContent":["import { ButtonContainer } from '@components/containers';\nimport { IconGenericToken } from '@components/logos';\nimport { Text } from '@components/primitives';\nimport { css } from '@styled/css';\nimport { Center, HStack, VStack } from '@styled/jsx';\nimport { createHost, createSlot } from 'create-slots';\nimport { Children, cloneElement, FC, PropsWithChildren, useCallback, useRef } from 'react';\nimport { AriaButtonProps } from 'react-aria';\n\nexport interface TokenListItemProps extends AriaButtonProps {\n name: string;\n fiatBalanceWithSymbol?: string;\n tokenBalanceWithSymbol: string;\n logoUrl?: string;\n onPress?: () => void;\n tokenBalanceFirst?: boolean;\n disabled?: boolean;\n}\n\nconst TokenIcon = createSlot(({ children, ...props }) => {\n return (\n <Center>\n {Children.map(children, child => {\n return cloneElement(child, props);\n })}\n </Center>\n );\n});\n\ninterface ListContentProps extends Omit<TokenListItemProps, 'onPress'> {\n tokenIcon?: React.ReactElement;\n}\n\nconst ListContent = ({\n name,\n fiatBalanceWithSymbol,\n tokenBalanceWithSymbol,\n tokenIcon,\n logoUrl,\n tokenBalanceFirst,\n disabled = false,\n}: ListContentProps) => {\n const balanceFirst = tokenBalanceFirst || !fiatBalanceWithSymbol;\n return (\n <HStack w=\"full\" justify=\"space-between\" opacity={disabled ? '0.5' : '1'}>\n <HStack gap={4}>\n {tokenIcon ? (\n {\n ...tokenIcon,\n props: {\n ...tokenIcon.props,\n width: 40,\n height: 40,\n },\n }\n ) : logoUrl ? (\n <img width={40} height={40} src={logoUrl} alt={`${name} logo`} />\n ) : (\n <IconGenericToken width={40} height={40} />\n )}\n <Text fontWeight=\"medium\" styles={{ textTransform: 'capitalize' }}>\n {name}\n </Text>\n </HStack>\n <VStack gap={0} alignItems=\"flex-end\">\n <Text size=\"sm\" styles={{ lineHeight: '1.5rem', textAlign: 'right' }}>\n {balanceFirst ? tokenBalanceWithSymbol : fiatBalanceWithSymbol}\n </Text>\n <Text size=\"sm\" fontColor=\"text.secondary\" styles={{ lineHeight: '1.5rem', textAlign: 'right' }}>\n {balanceFirst ? fiatBalanceWithSymbol : tokenBalanceWithSymbol}\n </Text>\n </VStack>\n </HStack>\n );\n};\n\nconst TokenListItemBase: FC<PropsWithChildren<TokenListItemProps>> = props => {\n const { name, fiatBalanceWithSymbol, tokenBalanceWithSymbol, logoUrl, onPress, tokenBalanceFirst, disabled } = props;\n\n const ref = useRef(null);\n\n const handlePress = useCallback(() => {\n onPress?.();\n }, [onPress]);\n\n return createHost(props.children, slots => {\n const tokenIcon = slots.get(TokenIcon);\n\n if (onPress)\n return (\n <ButtonContainer\n ref={ref}\n className={css({\n _dark: { bg: 'surface.tertiary' },\n _hover: { bg: 'neutral.secondary' },\n bg: 'neutral.quaternary',\n px: 4,\n py: 2,\n minH: 16,\n })}\n borderRadius=\"0.5rem\"\n expand\n onPress={disabled ? undefined : handlePress}\n disabled={disabled}\n >\n <ListContent\n name={name}\n fiatBalanceWithSymbol={fiatBalanceWithSymbol}\n tokenBalanceWithSymbol={tokenBalanceWithSymbol}\n tokenIcon={tokenIcon}\n logoUrl={logoUrl}\n tokenBalanceFirst={tokenBalanceFirst}\n disabled={disabled}\n />\n </ButtonContainer>\n );\n\n return (\n <ListContent\n name={name}\n fiatBalanceWithSymbol={fiatBalanceWithSymbol}\n tokenBalanceWithSymbol={tokenBalanceWithSymbol}\n tokenIcon={tokenIcon}\n logoUrl={logoUrl}\n tokenBalanceFirst={tokenBalanceFirst}\n disabled={disabled}\n />\n );\n });\n};\n\nexport const TokenListItem = Object.assign(TokenListItemBase, { TokenIcon });\n"],"names":["TokenIcon","createSlot","children","props","_jsx","Center","Children","child","cloneElement","ListContent","name","fiatBalanceWithSymbol","tokenBalanceWithSymbol","tokenIcon","logoUrl","tokenBalanceFirst","disabled","balanceFirst","_jsxs","HStack","IconGenericToken","Text","VStack","TokenListItemBase","onPress","ref","useRef","handlePress","useCallback","createHost","slots","ButtonContainer","css","TokenListItem"],"mappings":"w7BAmBA,MAAMA,EAAYC,EAAW,CAAC,CAAE,SAAAC,EAAU,GAAGC,CAAO,IAEhDC,EAACC,EAAM,CAAA,SACJC,EAAS,IAAIJ,EAAUK,GACfC,EAAaD,EAAOJ,CAAK,CACjC,CACM,CAAA,CAEZ,EAMKM,EAAc,CAAC,CACnB,KAAAC,EACA,sBAAAC,EACA,uBAAAC,EACA,UAAAC,EACA,QAAAC,EACA,kBAAAC,EACA,SAAAC,EAAW,EACM,IAAI,CACrB,MAAMC,EAAeF,GAAqB,CAACJ,EAC3C,OACEO,EAACC,EAAM,CAAC,EAAE,OAAO,QAAQ,gBAAgB,QAASH,EAAW,MAAQ,IAAG,SAAA,CACtEE,EAACC,EAAM,CAAC,IAAK,EAC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