{"version":3,"file":"List.cjs","sources":["../../../../src/components/list/List.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport React, { type FC } from \"react\";\nimport type { ListProps } from \"./types.js\";\n\ntype ValidLists = \"unordered\" | \"ordered\";\n\nfunction makeListComponent(listType: ValidLists): FC<ListProps> {\n    const BaseList: FC<ListProps> = ({ children, className, ...rest }) => {\n        const C = listType === \"ordered\" ? \"ol\" : \"ul\";\n\n        return (\n            <C\n                className={clsx(\"jkl-list\", className, {\n                    \"jkl-list--ordered\": listType === \"ordered\",\n                })}\n                data-testid=\"jkl-list\"\n                {...rest}\n            >\n                {children}\n            </C>\n        );\n    };\n    return BaseList;\n}\n\nexport const UnorderedList = makeListComponent(\"unordered\");\nUnorderedList.displayName = \"UnorderedList\";\nexport const OrderedList = makeListComponent(\"ordered\");\nOrderedList.displayName = \"OrderedList\";\nexport const List = UnorderedList;\nList.displayName = \"List\";\n"],"names":["makeListComponent","listType","children","className","rest","C","jsx","clsx","UnorderedList","displayName","OrderedList","List"],"mappings":"6JAMA,SAASA,EAAkBC,GAgBvB,MAfgC,EAAGC,SAAAA,EAAUC,UAAAA,KAAcC,MACvD,MAAMC,EAAiB,YAAbJ,EAAyB,KAAO,KAE1C,OACIK,EAAAA,IAACD,EAAA,CACGF,UAAWI,EAAAA,KAAK,WAAYJ,EAAW,CACnC,oBAAkC,YAAbF,IAEzB,cAAY,cACRG,EAEHF,SAAAA,IAKjB,kBAEO,MAAMM,EAAgBR,EAAkB,aAC/CQ,EAAcC,YAAc,gBACrB,MAAMC,EAAcV,EAAkB,WAC7CU,EAAYD,YAAc,cACnB,MAAME,EAAOH,EACpBG,EAAKF,YAAc"}