{"version":3,"file":"List.mjs","names":["Flexbox"],"sources":["../../src/List/List.tsx"],"sourcesContent":["'use client';\n\nimport { cx } from 'antd-style';\nimport { memo } from 'react';\n\nimport { Flexbox } from '@/Flex';\n\nimport ListItem from './ListItem';\nimport type { ListProps } from './type';\n\nconst List = memo<ListProps>(({ ref, activeKey, classNames, styles, onClick, items, ...rest }) => {\n  return (\n    <Flexbox gap={4} padding={4} {...rest}>\n      {items.map((item) => {\n        const {\n          key,\n          onClick: itemOnClick,\n          className: itemClassName,\n          style: itemStyle,\n          ...itemRest\n        } = item;\n        const { item: customItemClassName, ...restClassName } = classNames || {};\n        const { item: customItemStyle, ...restStyles } = styles || {};\n        return (\n          <ListItem\n            active={item.key === activeKey}\n            className={cx(customItemClassName, itemClassName)}\n            classNames={restClassName}\n            key={key}\n            ref={ref}\n            style={{ ...customItemStyle, ...itemStyle }}\n            styles={restStyles}\n            onClick={(e) => {\n              onClick?.({\n                item,\n                key,\n              });\n              itemOnClick?.(e);\n            }}\n            {...itemRest}\n          />\n        );\n      })}\n    </Flexbox>\n  );\n});\n\nList.displayName = 'List';\n\nexport default List;\n"],"mappings":";;;;;;;AAUA,MAAM,OAAO,MAAiB,EAAE,KAAK,WAAW,YAAY,QAAQ,SAAS,OAAO,GAAG,WAAW;AAChG,QACE,oBAACA,mBAAD;EAAS,KAAK;EAAG,SAAS;EAAG,GAAI;YAC9B,MAAM,KAAK,SAAS;GACnB,MAAM,EACJ,KACA,SAAS,aACT,WAAW,eACX,OAAO,WACP,GAAG,aACD;GACJ,MAAM,EAAE,MAAM,qBAAqB,GAAG,kBAAkB,cAAc,EAAE;GACxE,MAAM,EAAE,MAAM,iBAAiB,GAAG,eAAe,UAAU,EAAE;AAC7D,UACE,oBAAC,UAAD;IACE,QAAQ,KAAK,QAAQ;IACrB,WAAW,GAAG,qBAAqB,cAAc;IACjD,YAAY;IAEP;IACL,OAAO;KAAE,GAAG;KAAiB,GAAG;KAAW;IAC3C,QAAQ;IACR,UAAU,MAAM;AACd,eAAU;MACR;MACA;MACD,CAAC;AACF,mBAAc,EAAE;;IAElB,GAAI;IACJ,EAZK,IAYL;IAEJ;EACM,CAAA;EAEZ;AAEF,KAAK,cAAc"}