{"version":3,"file":"NumberedList.cjs","sources":["../../../../src/beta/components/NumberedList.tsx"],"sourcesContent":["import React from 'react';\nimport classNames from 'classnames';\nimport { PolymorphicComponentProps } from '@entur/utils';\nimport { TypographySpacing } from '../types';\nimport { getSpacingClasses } from '../utils/utils';\n\nimport './text.scss';\n\n/**\n * @beta Experimental component - may have breaking changes in future releases\n */\ntype NumberedListBaseProps = {\n  /** Ekstra klassenavn */\n  className?: string;\n  /** Innholdet */\n  children: React.ReactNode;\n  /** List type (1, A, a, I, i) */\n  type?: '1' | 'A' | 'a' | 'I' | 'i';\n  /** Spacing around the component (same as Text and Heading components) */\n  spacing?: TypographySpacing;\n};\n\nexport type NumberedListProps<C extends React.ElementType> =\n  PolymorphicComponentProps<C, NumberedListBaseProps>;\n\n/**\n * @beta Experimental component - may have breaking changes in future releases\n */\nexport const NumberedList = <C extends React.ElementType = 'ol'>({\n  className,\n  type = '1',\n  spacing,\n  as,\n  children,\n  ...rest\n}: NumberedListProps<C>): JSX.Element => {\n  const ListElement: React.ElementType = as || 'ol';\n\n  return (\n    <ListElement\n      className={classNames(\n        'eds-text--numbered-list',\n        { [`eds-text--numbered-list--type-${type}`]: type },\n        getSpacingClasses(spacing, 'eds-text--numbered-list'),\n        className,\n      )}\n      type={type}\n      {...rest}\n    >\n      {children}\n    </ListElement>\n  );\n};\n"],"names":["jsx","getSpacingClasses"],"mappings":";;;;;;AA4BO,MAAM,eAAe,CAAqC;AAAA,EAC/D;AAAA,EACA,OAAO;AAAA,EACP;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAyC;AACvC,QAAM,cAAiC,MAAM;AAE7C,SACEA,2BAAAA;AAAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAW;AAAA,QACT;AAAA,QACA,EAAE,CAAC,iCAAiC,IAAI,EAAE,GAAG,KAAA;AAAA,QAC7CC,MAAAA,kBAAkB,SAAS,yBAAyB;AAAA,QACpD;AAAA,MAAA;AAAA,MAEF;AAAA,MACC,GAAG;AAAA,MAEH;AAAA,IAAA;AAAA,EAAA;AAGP;;"}