@undp/design-system-react
Version:
React based design system for UNDP
1 lines • 2.6 kB
Source Map (JSON)
{"version":3,"file":"SDGCardButton.cjs","names":[],"sources":["../src/components/ui/sdg-card-button.tsx"],"sourcesContent":["import React from 'react';\n\nimport { cn } from '@/lib/utils';\nimport { H1, H4 } from './typography';\n\nconst SDGCardButton = React.forwardRef<\n HTMLButtonElement,\n React.ButtonHTMLAttributes<HTMLButtonElement> & {\n index: string | number;\n text: string;\n backgroundColor?: string;\n textColor?: string;\n indexClassName?: string;\n textClassName?: string;\n }\n>(\n (\n {\n className,\n indexClassName,\n backgroundColor,\n textClassName,\n textColor,\n index,\n text,\n style,\n ...props\n },\n ref,\n ) => {\n const Comp = 'button';\n return (\n <div className='@container w-full'>\n <Comp\n {...props}\n ref={ref}\n style={{\n ...style,\n backgroundColor: backgroundColor || 'var(--primary)',\n cursor:\n 'url(https://cdn.jsdelivr.net/npm/@undp/design-system-assets/images/arrow-right-white.svg), auto',\n }}\n className={cn(\n 'flex min-h-40 w-full @2xl:flex-row flex-col items-start @2xl:items-center @2xl:gap-9 gap-3 @2xl:px-0 px-6 @2xl:py-0 py-9 hover:brightness-90',\n className,\n )}\n >\n <H1\n marginBottom='none'\n className={cn(\n '@2xl:w-62.5 w-auto @2xl:pl-[6.313rem] pl-0 rtl:pr-[6.313rem] rtl:pl-0',\n indexClassName,\n )}\n style={{ color: textColor || '#fff' }}\n >\n {index}\n </H1>\n <H4\n marginBottom='none'\n className={cn('font-heading uppercase tracking-[.078rem]', textClassName)}\n style={{ color: textColor || '#fff' }}\n >\n {text}\n </H4>\n </Comp>\n </div>\n );\n },\n);\n\nSDGCardButton.displayName = 'SDGCardButton';\n\nexport { SDGCardButton };\n"],"mappings":"2PAKA,IAAM,EAAgB,EAAA,QAAM,YAYxB,CACE,YACA,iBACA,kBACA,gBACA,YACA,QACA,OACA,QACA,GAAG,GAEL,KAIE,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,UAAU,8BACb,EAAA,EAAA,KAAA,CAAC,SAAD,CACE,GAAI,EACC,MACL,MAAO,CACL,GAAG,EACH,gBAAiB,GAAmB,iBACpC,OACE,iGACJ,EACA,UAAW,EAAA,EACT,+IACA,CACF,WAZF,EAcE,EAAA,EAAA,IAAA,CAAC,EAAA,GAAD,CACE,aAAa,OACb,UAAW,EAAA,EACT,wEACA,CACF,EACA,MAAO,CAAE,MAAO,GAAa,MAAO,WAEnC,CACC,CAAA,GACJ,EAAA,EAAA,IAAA,CAAC,EAAA,GAAD,CACE,aAAa,OACb,UAAW,EAAA,EAAG,4CAA6C,CAAa,EACxE,MAAO,CAAE,MAAO,GAAa,MAAO,WAEnC,CACC,CAAA,CACA,GACH,CAAA,CAGX,EAEA,EAAc,YAAc"}