UNPKG

@transkripid/flowbite-react

Version:

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

1 lines 3.77 kB
{"version":3,"file":"List.mjs","sources":["../../../src/components/List/List.tsx"],"sourcesContent":["import type { ComponentProps, FC, PropsWithChildren } from 'react';\nimport { twMerge } from 'tailwind-merge';\nimport type { FlowbiteStateColors } from '../..';\nimport { mergeDeep } from '../../helpers/merge-deep';\nimport { getTheme } from '../../theme-store';\nimport type { DeepPartial } from '../../types';\nimport { ListItem } from './ListItem';\n\nexport interface FlowbiteListTheme {\n root: FlowbiteListRootTheme;\n}\n\nexport interface FlowbiteListRootTheme {\n base: string;\n ordered: {\n on: string;\n off: string;\n };\n horizontal: string;\n unstyled: string;\n nested: string;\n}\n\nexport interface ListColors extends FlowbiteStateColors {\n [key: string]: string;\n default: string;\n}\n\nexport interface ListProps extends PropsWithChildren<ComponentProps<'ul'> & ComponentProps<'ol'>> {\n theme?: DeepPartial<FlowbiteListTheme>;\n ordered?: boolean;\n unstyled?: boolean;\n nested?: boolean;\n horizontal?: boolean;\n}\n\nconst ListComponent: FC<ListProps> = ({\n children,\n className,\n unstyled,\n nested,\n ordered,\n horizontal,\n theme: customTheme = {},\n ...props\n}) => {\n const theme = mergeDeep(getTheme().list, customTheme);\n const Component = ordered ? 'ol' : 'ul';\n\n return (\n <Component\n className={twMerge(\n theme.root.base,\n theme.root.ordered[ordered ? 'on' : 'off'],\n unstyled && theme.root.unstyled,\n nested && theme.root.nested,\n horizontal && theme.root.horizontal,\n className,\n )}\n {...props}\n >\n {children}\n </Component>\n );\n};\n\nListComponent.displayName = 'List';\nListItem.displayName = 'List.Item';\n\nexport const List = Object.assign(ListComponent, { Item: ListItem });\n"],"names":["ListComponent","t0","$","_c","children","className","horizontal","nested","ordered","props","t1","unstyled","theme","t2","undefined","customTheme","T0","t3","mergeDeep","getTheme","list","Component","twMerge","root","base","t4","displayName","ListItem","List","Object","assign","Item"],"mappings":";;;;;;AAoCA,MAAMA,IAA+BC,CAAA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