UNPKG

@lobehub/ui

Version:

Lobe UI is an open-source UI component library for building AIGC web apps

1 lines 1.66 kB
{"version":3,"file":"Select.mjs","names":["Input","AntSelect","Icon"],"sources":["../../src/Select/Select.tsx"],"sourcesContent":["'use client';\n\nimport { Select as AntSelect } from 'antd';\nimport { cx, useThemeMode } from 'antd-style';\nimport { ChevronDownIcon } from 'lucide-react';\nimport { memo } from 'react';\n\nimport Icon from '@/Icon';\n\nimport { variants } from './style';\nimport type { SelectProps } from './type';\n\nconst Input = memo<SelectProps>(\n ({ ref, variant, suffixIconProps, suffixIcon, shadow, className, ...rest }) => {\n const { isDarkMode } = useThemeMode();\n\n return (\n <AntSelect\n className={cx(\n variants({ shadow, variant: variant || (isDarkMode ? 'filled' : 'outlined') }),\n className,\n )}\n ref={ref}\n suffixIcon={\n <Icon\n icon={suffixIcon || ChevronDownIcon}\n size={'small'}\n {...suffixIconProps}\n style={{\n pointerEvents: 'none',\n ...suffixIconProps?.style,\n }}\n />\n }\n variant={variant || (isDarkMode ? 'filled' : 'outlined')}\n {...rest}\n />\n );\n },\n);\n\nInput.displayName = 'Input';\n\nexport default Input;\n"],"mappings":";;;;;;;;;;;AAYA,MAAMA,UAAQ,MACX,EAAE,KAAK,SAAS,iBAAiB,YAAY,QAAQ,WAAW,GAAG,WAAW;CAC7E,MAAM,EAAE,eAAe,cAAc;AAErC,QACE,oBAACC;EACC,WAAW,GACT,SAAS;GAAE;GAAQ,SAAS,YAAY,aAAa,WAAW;GAAa,CAAC,EAC9E,UACD;EACI;EACL,YACE,oBAACC;GACC,MAAM,cAAc;GACpB,MAAM;GACN,GAAI;GACJ,OAAO;IACL,eAAe;IACf,GAAG,iBAAiB;IACrB;IACD;EAEJ,SAAS,YAAY,aAAa,WAAW;EAC7C,GAAI;GACJ;EAGP;AAED,QAAM,cAAc;AAEpB,qBAAeF"}