tldraw
Version:
A tiny little drawing editor.
8 lines (7 loc) • 3.39 kB
Source Map (JSON)
{
"version": 3,
"sources": ["../../../../../src/lib/ui/components/primitives/TldrawUiDialog.tsx"],
"sourcesContent": ["import classNames from 'classnames'\nimport { Dialog as _Dialog } from 'radix-ui'\nimport { CSSProperties, ReactNode } from 'react'\nimport { useTranslation } from '../../hooks/useTranslation/useTranslation'\nimport { TldrawUiButton } from './Button/TldrawUiButton'\nimport { TldrawUiButtonIcon } from './Button/TldrawUiButtonIcon'\n\n/** @public */\nexport interface TLUiDialogHeaderProps {\n\tclassName?: string\n\tchildren: ReactNode\n}\n\n/** @public @react */\nexport function TldrawUiDialogHeader({ className, children }: TLUiDialogHeaderProps) {\n\treturn <div className={classNames('tlui-dialog__header', className)}>{children}</div>\n}\n\n/** @public */\nexport interface TLUiDialogTitleProps {\n\tclassName?: string\n\tchildren: ReactNode\n\tstyle?: CSSProperties\n}\n\n/** @public @react */\nexport function TldrawUiDialogTitle({ className, children, style }: TLUiDialogTitleProps) {\n\treturn (\n\t\t<_Dialog.Title\n\t\t\tdir=\"ltr\"\n\t\t\tclassName={classNames('tlui-dialog__header__title', className)}\n\t\t\tstyle={style}\n\t\t>\n\t\t\t{children}\n\t\t</_Dialog.Title>\n\t)\n}\n\n/** @public @react */\nexport function TldrawUiDialogCloseButton() {\n\tconst msg = useTranslation()\n\n\treturn (\n\t\t<div className=\"tlui-dialog__header__close\">\n\t\t\t<_Dialog.DialogClose data-testid=\"dialog.close\" dir=\"ltr\" asChild>\n\t\t\t\t<TldrawUiButton\n\t\t\t\t\ttype=\"icon\"\n\t\t\t\t\taria-label={msg('ui.close')}\n\t\t\t\t\tonTouchEnd={(e) => (e.target as HTMLButtonElement).click()}\n\t\t\t\t>\n\t\t\t\t\t<TldrawUiButtonIcon small icon=\"cross-2\" />\n\t\t\t\t</TldrawUiButton>\n\t\t\t</_Dialog.DialogClose>\n\t\t</div>\n\t)\n}\n\n/** @public */\nexport interface TLUiDialogBodyProps {\n\tclassName?: string\n\tchildren: ReactNode\n\tstyle?: CSSProperties\n}\n\n/** @public @react */\nexport function TldrawUiDialogBody({ className, children, style }: TLUiDialogBodyProps) {\n\treturn (\n\t\t<div className={classNames('tlui-dialog__body', className)} style={style} tabIndex={0}>\n\t\t\t{children}\n\t\t</div>\n\t)\n}\n\n/** @public */\nexport interface TLUiDialogFooterProps {\n\tclassName?: string\n\tchildren?: ReactNode\n}\n\n/** @public @react */\nexport function TldrawUiDialogFooter({ className, children }: TLUiDialogFooterProps) {\n\treturn <div className={classNames('tlui-dialog__footer', className)}>{children}</div>\n}\n"],
"mappings": "AAeQ;AAfR,OAAO,gBAAgB;AACvB,SAAS,UAAU,eAAe;AAElC,SAAS,sBAAsB;AAC/B,SAAS,sBAAsB;AAC/B,SAAS,0BAA0B;AAS5B,SAAS,qBAAqB,EAAE,WAAW,SAAS,GAA0B;AACpF,SAAO,oBAAC,SAAI,WAAW,WAAW,uBAAuB,SAAS,GAAI,UAAS;AAChF;AAUO,SAAS,oBAAoB,EAAE,WAAW,UAAU,MAAM,GAAyB;AACzF,SACC;AAAA,IAAC,QAAQ;AAAA,IAAR;AAAA,MACA,KAAI;AAAA,MACJ,WAAW,WAAW,8BAA8B,SAAS;AAAA,MAC7D;AAAA,MAEC;AAAA;AAAA,EACF;AAEF;AAGO,SAAS,4BAA4B;AAC3C,QAAM,MAAM,eAAe;AAE3B,SACC,oBAAC,SAAI,WAAU,8BACd,8BAAC,QAAQ,aAAR,EAAoB,eAAY,gBAAe,KAAI,OAAM,SAAO,MAChE;AAAA,IAAC;AAAA;AAAA,MACA,MAAK;AAAA,MACL,cAAY,IAAI,UAAU;AAAA,MAC1B,YAAY,CAAC,MAAO,EAAE,OAA6B,MAAM;AAAA,MAEzD,8BAAC,sBAAmB,OAAK,MAAC,MAAK,WAAU;AAAA;AAAA,EAC1C,GACD,GACD;AAEF;AAUO,SAAS,mBAAmB,EAAE,WAAW,UAAU,MAAM,GAAwB;AACvF,SACC,oBAAC,SAAI,WAAW,WAAW,qBAAqB,SAAS,GAAG,OAAc,UAAU,GAClF,UACF;AAEF;AASO,SAAS,qBAAqB,EAAE,WAAW,SAAS,GAA0B;AACpF,SAAO,oBAAC,SAAI,WAAW,WAAW,uBAAuB,SAAS,GAAI,UAAS;AAChF;",
"names": []
}