{"version":3,"file":"Menu.mjs","names":["Menu","AntdMenu"],"sources":["../../src/Menu/Menu.tsx"],"sourcesContent":["'use client';\n\nimport { ConfigProvider, Menu as AntdMenu } from 'antd';\nimport { cx, useTheme } from 'antd-style';\nimport { memo, useMemo } from 'react';\n\nimport { IconProvider } from '@/Icon';\nimport { mapItems } from '@/Menu/utils';\n\nimport { variants } from './style';\nimport { type MenuProps } from './type';\n\nconst Menu = memo<MenuProps>(\n  ({\n    compact,\n    shadow,\n    variant = 'borderless',\n    className,\n    selectable,\n    iconProps,\n    items,\n    ref,\n    ...rest\n  }) => {\n    const theme = useTheme();\n\n    const antdItems = useMemo(() => items.map((item) => mapItems(item)), [items]);\n\n    return (\n      <ConfigProvider\n        theme={{\n          components: {\n            Menu: {\n              controlHeightLG: 36,\n              iconMarginInlineEnd: 8,\n              iconSize: 16,\n              itemActiveBg: theme.isDarkMode ? theme.colorFillQuaternary : theme.colorFillSecondary,\n              itemBorderRadius: theme.borderRadius,\n              itemColor: theme.colorTextSecondary,\n              itemHoverBg: theme.colorFillTertiary,\n              itemMarginBlock: 4,\n              itemMarginInline: 4,\n              itemSelectedBg: theme.colorFillSecondary,\n            },\n          },\n        }}\n      >\n        <IconProvider\n          config={{\n            size: 'small',\n            ...iconProps,\n          }}\n        >\n          <AntdMenu\n            className={cx(variants({ compact, shadow, variant }), className)}\n            inlineIndent={12}\n            items={antdItems}\n            mode=\"vertical\"\n            ref={ref}\n            selectable={selectable}\n            {...rest}\n          />\n        </IconProvider>\n      </ConfigProvider>\n    );\n  },\n);\n\nMenu.displayName = 'Menu';\n\nexport default Menu;\n"],"mappings":";;;;;;;;;AAYA,MAAMA,SAAO,MACV,EACC,SACA,QACA,UAAU,cACV,WACA,YACA,WACA,OACA,KACA,GAAG,WACC;CACJ,MAAM,QAAQ,UAAU;CAExB,MAAM,YAAY,cAAc,MAAM,KAAK,SAAS,SAAS,KAAK,CAAC,EAAE,CAAC,MAAM,CAAC;AAE7E,QACE,oBAAC,gBAAD;EACE,OAAO,EACL,YAAY,EACV,MAAM;GACJ,iBAAiB;GACjB,qBAAqB;GACrB,UAAU;GACV,cAAc,MAAM,aAAa,MAAM,sBAAsB,MAAM;GACnE,kBAAkB,MAAM;GACxB,WAAW,MAAM;GACjB,aAAa,MAAM;GACnB,iBAAiB;GACjB,kBAAkB;GAClB,gBAAgB,MAAM;GACvB,EACF,EACF;YAED,oBAAC,cAAD;GACE,QAAQ;IACN,MAAM;IACN,GAAG;IACJ;aAED,oBAACC,MAAD;IACE,WAAW,GAAG,SAAS;KAAE;KAAS;KAAQ;KAAS,CAAC,EAAE,UAAU;IAChE,cAAc;IACd,OAAO;IACP,MAAK;IACA;IACO;IACZ,GAAI;IACJ,CAAA;GACW,CAAA;EACA,CAAA;EAGtB;AAED,OAAK,cAAc"}