UNPKG

@transkripid/flowbite-react

Version:

Official React components built for Flowbite and Tailwind CSS - Transkrip.id fork

1 lines 2.81 kB
{"version":3,"file":"HelperText.mjs","sources":["../../../src/components/HelperText/HelperText.tsx"],"sourcesContent":["import type { ComponentProps, FC } from 'react';\nimport { twMerge } from 'tailwind-merge';\nimport { mergeDeep } from '../../helpers/merge-deep';\nimport { getTheme } from '../../theme-store';\nimport type { DeepPartial } from '../../types';\nimport type { FlowbiteColors } from '../Flowbite';\n\nexport interface FlowbiteHelperTextTheme {\n root: FlowbiteHelperTextRootTheme;\n}\n\nexport interface FlowbiteHelperTextRootTheme {\n base: string;\n colors: HelperColors;\n}\n\nexport interface HelperColors extends Pick<FlowbiteColors, 'gray' | 'info' | 'failure' | 'warning' | 'success'> {\n [key: string]: string;\n}\n\nexport interface HelperTextProps extends Omit<ComponentProps<'p'>, 'color'> {\n color?: keyof HelperColors;\n theme?: DeepPartial<FlowbiteHelperTextTheme>;\n value?: string;\n}\n\nexport const HelperText: FC<HelperTextProps> = ({\n children,\n className,\n color = 'default',\n theme: customTheme = {},\n value,\n ...props\n}) => {\n const theme = mergeDeep(getTheme().helperText, customTheme);\n\n return (\n <p className={twMerge(theme.root.base, theme.root.colors[color], className)} {...props}>\n {value ?? children ?? ''}\n </p>\n );\n};\n\nHelperText.displayName = 'HelperText';\n"],"names":["HelperText","t0","$","_c","children","className","props","t1","t2","value","color","theme","undefined","t3","customTheme","t4","mergeDeep","getTheme","helperText","twMerge","root","base","colors","t5","t6","displayName"],"mappings":";;;;;AA0BO,MAAMA,IAAkCC,CAAAA,MAAA;AAAAC,QAAAA,IAAAC,EAAA,EAAA;AAAAC,MAAAA,GAAAC,GAAAC,GAAAC,GAAAC,GAAAC;AAAAP,EAAAA,SAAAD,KAAC;AAAA,IAAAG,UAAAA;AAAAA,IAAAC,WAAAA;AAAAA,IAAAK,OAAAH;AAAAA,IAAAI,OAAAH;AAAAA,IAAAC,OAAAA;AAAAA,IAAA,GAAAH;AAAAA,E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