UNPKG

@postenbring/hedwig-react

Version:

React components for [Hedwig Design System](https://github.com/bring/hedwig-design-system).

1 lines 1.78 kB
{"version":3,"sources":["../src/blockquote/blockquote.tsx"],"sourcesContent":["import { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { forwardRef } from \"react\";\n\nexport interface BlockquoteProps extends React.HTMLAttributes<HTMLQuoteElement> {\n children?: React.ReactNode;\n\n /**\n * The quote style\n *\n * @default \"default\"\n */\n variant?: \"default\" | \"norwegian\";\n\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n *\n * @default false\n */\n asChild?: boolean;\n}\n\n/**\n * @example\n *\n * ```tsx\n * <Blockquote>\n * <p>... but they&rsquo;ll never take our freedom!</p>\n * <footer>William Wallace</footer>\n * </Blockquote>\n * ```\n *\n */\nexport const Blockquote = forwardRef<HTMLQuoteElement, BlockquoteProps>(\n ({ children, asChild, className, variant, ...rest }, ref) => {\n const Component = asChild ? Slot : \"blockquote\";\n return (\n <Component\n ref={ref}\n className={clsx(\n \"hds-blockquote\",\n variant === \"norwegian\" && `hds-blockquote--norwegian`,\n className as undefined,\n )}\n {...rest}\n >\n {children}\n </Component>\n );\n },\n);\nBlockquote.displayName = \"Blockquote\";\n"],"mappings":";;;;;;;AAAA,SAAS,YAAY;AACrB,SAAS,YAAY;AACrB,SAAS,kBAAkB;AAmCrB;AAJC,IAAM,aAAa;AAAA,EACxB,CAAC,IAAoD,QAAQ;AAA5D,iBAAE,YAAU,SAAS,WAAW,QAlCnC,IAkCG,IAA4C,iBAA5C,IAA4C,CAA1C,YAAU,WAAS,aAAW;AAC/B,UAAM,YAAY,UAAU,OAAO;AACnC,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,WAAW;AAAA,UACT;AAAA,UACA,YAAY,eAAe;AAAA,UAC3B;AAAA,QACF;AAAA,SACI,OAPL;AAAA,QASE;AAAA;AAAA,IACH;AAAA,EAEJ;AACF;AACA,WAAW,cAAc;","names":[]}