repo
stringlengths
7
64
file_url
stringlengths
81
338
file_path
stringlengths
5
257
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:25:31
2026-01-05 01:50:38
truncated
bool
2 classes
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/checkbox/__tests__/group.test.tsx
components/checkbox/__tests__/group.test.tsx
import React, { useState } from 'react'; import mountTest from '../../../tests/shared/mountTest'; import rtlTest from '../../../tests/shared/rtlTest'; import { fireEvent, render } from '../../../tests/utils'; import Collapse from '../../collapse'; import Input from '../../input'; import Table from '../../table'; impor...
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/checkbox/__tests__/type.test.tsx
components/checkbox/__tests__/type.test.tsx
import * as React from 'react'; import Checkbox from '..'; import type { CheckboxRef } from '..'; import Input from '../../input'; describe('Checkbox.typescript', () => { it('Checkbox', () => { const ref = React.createRef<CheckboxRef>(); const checkbox = <Checkbox value ref={ref} />; expect(checkbox).t...
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/checkbox/__tests__/image.test.ts
components/checkbox/__tests__/image.test.ts
import { imageDemoTest } from '../../../tests/shared/imageTest'; describe('Checkbox image', () => { imageDemoTest('checkbox'); });
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/checkbox/__tests__/demo-extend.test.ts
components/checkbox/__tests__/demo-extend.test.ts
import { extendTest } from '../../../tests/shared/demoTest'; extendTest('checkbox');
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/checkbox/__tests__/demo.test.tsx
components/checkbox/__tests__/demo.test.tsx
import * as React from 'react'; import demoTest, { rootPropsTest } from '../../../tests/shared/demoTest'; demoTest('checkbox'); rootPropsTest( 'checkbox', (Checkbox, props) => <Checkbox.Group {...props} value={[]} options={['Bamboo']} />, { name: 'Checkbox.Group', }, );
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/checkbox/__tests__/checkbox.test.tsx
components/checkbox/__tests__/checkbox.test.tsx
import React from 'react'; import Checkbox from '..'; import { resetWarned } from '../../_util/warning'; import focusTest from '../../../tests/shared/focusTest'; import mountTest from '../../../tests/shared/mountTest'; import rtlTest from '../../../tests/shared/rtlTest'; import { act, fireEvent, render } from '../../....
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/checkbox/__tests__/semantic.test.tsx
components/checkbox/__tests__/semantic.test.tsx
import React from 'react'; import Checkbox from '..'; import type { CheckboxProps } from '..'; import { render } from '../../../tests/utils'; describe('Checkbox.Semantic', () => { it('should support custom styles', () => { const customClassNames = { root: 'custom-root', icon: 'custom-icon', la...
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/checkbox/demo/group.tsx
components/checkbox/demo/group.tsx
import React from 'react'; import { Checkbox } from 'antd'; import type { CheckboxOptionType, GetProp } from 'antd'; const onChange: GetProp<typeof Checkbox.Group, 'onChange'> = (checkedValues) => { console.log('checked = ', checkedValues); }; const plainOptions = ['Apple', 'Pear', 'Orange']; const options: Checkb...
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/checkbox/demo/_semantic.tsx
components/checkbox/demo/_semantic.tsx
import React from 'react'; import { Checkbox } from 'antd'; import SemanticPreview from '../../../.dumi/theme/common/SemanticPreview'; import useLocale from '../../../.dumi/hooks/useLocale'; const locales = { cn: { root: '根元素,包含行内 flex 布局、基线对齐、光标样式、重置样式等复选框容器的基础样式', icon: '选中框元素,包含尺寸、方向、背景色、边框、圆角、过渡动画,以及选中状...
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/checkbox/demo/layout.tsx
components/checkbox/demo/layout.tsx
import React from 'react'; import { Checkbox, Col, Row } from 'antd'; import type { GetProp } from 'antd'; const onChange: GetProp<typeof Checkbox.Group, 'onChange'> = (checkedValues) => { console.log('checked = ', checkedValues); }; const App: React.FC = () => ( <Checkbox.Group style={{ width: '100%' }} onChange...
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/checkbox/demo/disabled.tsx
components/checkbox/demo/disabled.tsx
import React from 'react'; import { Checkbox } from 'antd'; const App: React.FC = () => ( <> <Checkbox defaultChecked={false} disabled /> <br /> <Checkbox indeterminate disabled /> <br /> <Checkbox defaultChecked disabled /> </> ); export default App;
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/checkbox/demo/check-all.tsx
components/checkbox/demo/check-all.tsx
import React, { useState } from 'react'; import { Checkbox, Divider } from 'antd'; import type { CheckboxProps } from 'antd'; const CheckboxGroup = Checkbox.Group; const plainOptions = ['Apple', 'Pear', 'Orange']; const defaultCheckedList = ['Apple', 'Orange']; const App: React.FC = () => { const [checkedList, set...
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/checkbox/demo/debug-disable-popover.tsx
components/checkbox/demo/debug-disable-popover.tsx
import React from 'react'; import { Checkbox, Popover } from 'antd'; const App: React.FC = () => ( <div style={{ padding: 56 }}> <Popover content="xxxx" trigger="hover"> <Checkbox disabled checked /> </Popover> </div> ); export default App;
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/checkbox/demo/custom-line-width.tsx
components/checkbox/demo/custom-line-width.tsx
import React from 'react'; import { Checkbox, ConfigProvider } from 'antd'; const App: React.FC = () => ( <> <ConfigProvider theme={{ components: { Checkbox: { lineWidth: 6, }, }, }} > <Checkbox checked /> <Checkbox /> </ConfigProvid...
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/checkbox/demo/controller.tsx
components/checkbox/demo/controller.tsx
import React, { useState } from 'react'; import { Button, Checkbox } from 'antd'; import type { CheckboxProps } from 'antd'; const App: React.FC = () => { const [checked, setChecked] = useState(true); const [disabled, setDisabled] = useState(false); const toggleChecked = () => { setChecked(!checked); }; ...
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/checkbox/demo/basic.tsx
components/checkbox/demo/basic.tsx
import React from 'react'; import { Checkbox } from 'antd'; import type { CheckboxProps } from 'antd'; const onChange: CheckboxProps['onChange'] = (e) => { console.log(`checked = ${e.target.checked}`); }; const App: React.FC = () => <Checkbox onChange={onChange}>Checkbox</Checkbox>; export default App;
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/checkbox/demo/debug-line.tsx
components/checkbox/demo/debug-line.tsx
import React from 'react'; import { Checkbox, ConfigProvider, Radio, Space } from 'antd'; const sharedStyle: React.CSSProperties = { border: '1px solid red', marginBottom: 16, }; const App: React.FC = () => ( <div> <Space style={sharedStyle} align="center"> <Checkbox value="light" /> <div>Bamboo...
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/checkbox/demo/style-class.tsx
components/checkbox/demo/style-class.tsx
import React from 'react'; import { Checkbox, Flex } from 'antd'; import type { CheckboxProps } from 'antd'; import { createStyles } from 'antd-style'; const useStyles = createStyles(({ token, css }) => ({ root: css` border-radius: ${token.borderRadius}; width: 300px; `, fnRoot: css` border-radius: $...
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/switch/index.tsx
components/switch/index.tsx
import * as React from 'react'; import LoadingOutlined from '@ant-design/icons/LoadingOutlined'; import RcSwitch from '@rc-component/switch'; import type { SwitchChangeEventHandler, SwitchClickEventHandler } from '@rc-component/switch'; import { useControlledState } from '@rc-component/util'; import { clsx } from 'clsx...
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/switch/style/index.ts
components/switch/style/index.ts
import type { CSSObject } from '@ant-design/cssinjs'; import { unit } from '@ant-design/cssinjs'; import { FastColor } from '@ant-design/fast-color'; import { genFocusStyle, resetComponent } from '../../style'; import type { FullToken, GenerateStyle, GetDefaultToken } from '../../theme/internal'; import { genStyleHook...
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/switch/__tests__/a11y.test.ts
components/switch/__tests__/a11y.test.ts
import accessibilityDemoTest from '../../../tests/shared/accessibilityTest'; accessibilityDemoTest('switch', { disabledRules: ['button-name'], });
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/switch/__tests__/index.test.tsx
components/switch/__tests__/index.test.tsx
import React from 'react'; import Switch from '..'; import focusTest from '../../../tests/shared/focusTest'; import mountTest from '../../../tests/shared/mountTest'; import rtlTest from '../../../tests/shared/rtlTest'; import { act, fireEvent, render } from '../../../tests/utils'; jest.mock('@rc-component/util/lib/Do...
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/switch/__tests__/image.test.ts
components/switch/__tests__/image.test.ts
import { imageDemoTest } from '../../../tests/shared/imageTest'; describe('Switch image', () => { imageDemoTest('switch', { skip: ['loading.tsx'] }); });
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/switch/__tests__/wave.test.tsx
components/switch/__tests__/wave.test.tsx
import React from 'react'; import Switch from '..'; import { fireEvent, render, waitFakeTimer } from '../../../tests/utils'; describe('click wave effect', () => { async function click(container: HTMLElement) { fireEvent.click(container.querySelector('.ant-switch')!); container.querySelector('.ant-switch')!....
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/switch/__tests__/demo.test.ts
components/switch/__tests__/demo.test.ts
import demoTest from '../../../tests/shared/demoTest'; demoTest('switch', { skip: ['component-token.tsx'], });
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/switch/__tests__/demo-extend.test.ts
components/switch/__tests__/demo-extend.test.ts
import { extendTest } from '../../../tests/shared/demoTest'; extendTest('switch', { skip: ['component-token.tsx'], });
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/switch/__tests__/semantic.test.tsx
components/switch/__tests__/semantic.test.tsx
import React from 'react'; import { render } from '@testing-library/react'; import { Flex, Space, Switch } from 'antd'; import type { SwitchProps } from 'antd'; import { createStyles } from 'antd-style'; const useStyle = createStyles(({ css }) => ({ root: css` border-color: red; `, content: css` color: b...
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/switch/demo/text.tsx
components/switch/demo/text.tsx
import React from 'react'; import { CheckOutlined, CloseOutlined } from '@ant-design/icons'; import { Space, Switch } from 'antd'; const App: React.FC = () => ( <Space vertical> <Switch checkedChildren="开启" unCheckedChildren="关闭" defaultChecked /> <Switch checkedChildren="1" unCheckedChildren="0" /> <Swi...
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/switch/demo/_semantic.tsx
components/switch/demo/_semantic.tsx
import React from 'react'; import { Switch } from 'antd'; import SemanticPreview from '../../../.dumi/theme/common/SemanticPreview'; import useLocale from '../../../.dumi/hooks/useLocale'; const locales = { cn: { root: '根元素,包含最小宽度、高度、行高、垂直对齐、背景色、边框、圆角、光标样式、过渡动画、用户选择等开关容器的基础样式', content: '内容元素,包含块级显示、溢...
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/switch/demo/disabled.tsx
components/switch/demo/disabled.tsx
import React, { useState } from 'react'; import { Button, Space, Switch } from 'antd'; const App: React.FC = () => { const [disabled, setDisabled] = useState(true); const toggle = () => { setDisabled(!disabled); }; return ( <Space vertical> <Switch disabled={disabled} defaultChecked /> <B...
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/switch/demo/component-token.tsx
components/switch/demo/component-token.tsx
import React from 'react'; import { ConfigProvider, Space, Switch } from 'antd'; const App: React.FC = () => ( <ConfigProvider theme={{ components: { Switch: { trackHeight: 14, trackMinWidth: 32, // opacityLoading: 0.1, colorPrimary: 'rgb(25, 118, 210, 0.5)',...
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/switch/demo/basic.tsx
components/switch/demo/basic.tsx
import React from 'react'; import { Switch } from 'antd'; const onChange = (checked: boolean) => { console.log(`switch to ${checked}`); }; const App: React.FC = () => <Switch defaultChecked onChange={onChange} />; export default App;
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/switch/demo/size.tsx
components/switch/demo/size.tsx
import React from 'react'; import { Switch } from 'antd'; const App: React.FC = () => ( <> <Switch defaultChecked /> <br /> <Switch size="small" defaultChecked /> </> ); export default App;
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/switch/demo/loading.tsx
components/switch/demo/loading.tsx
import React from 'react'; import { Switch } from 'antd'; const App: React.FC = () => ( <> <Switch loading defaultChecked /> <br /> <Switch size="small" loading /> </> ); export default App;
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/switch/demo/style-class.tsx
components/switch/demo/style-class.tsx
import React from 'react'; import { Flex, Switch } from 'antd'; import type { SwitchProps } from 'antd'; import { createStyles } from 'antd-style'; const useStyle = createStyles(({ token }) => ({ root: { width: 40, backgroundColor: token.colorPrimary, }, })); const stylesObject: SwitchProps['styles'] = { ...
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/list/Item.tsx
components/list/Item.tsx
import type { CSSProperties, HTMLAttributes, ReactNode } from 'react'; import React, { useContext } from 'react'; import { toArray } from '@rc-component/util'; import { clsx } from 'clsx'; import type { SemanticClassNames, SemanticStyles } from '../_util/hooks'; import { cloneElement } from '../_util/reactNode'; impor...
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/list/index.tsx
components/list/index.tsx
import * as React from 'react'; import { clsx } from 'clsx'; import extendsObject from '../_util/extendsObject'; import { responsiveArray } from '../_util/responsiveObserver'; import { devUseWarning } from '../_util/warning'; import { ConfigContext } from '../config-provider'; import { useComponentConfig } from '../co...
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/list/context.ts
components/list/context.ts
import React from 'react'; import type { ListGridType } from '.'; export interface ListConsumerProps { grid?: ListGridType; itemLayout?: string; } export const ListContext = React.createContext<ListConsumerProps>({}); export const ListConsumer = ListContext.Consumer;
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/list/style/index.ts
components/list/style/index.ts
import type { CSSProperties } from 'react'; import { unit } from '@ant-design/cssinjs'; import type { CSSObject } from '@ant-design/cssinjs'; import { resetComponent } from '../../style'; import type { FullToken, GenerateStyle, GetDefaultToken } from '../../theme/internal'; import { genStyleHooks, mergeToken } from '....
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/list/__tests__/empty.test.tsx
components/list/__tests__/empty.test.tsx
import React from 'react'; import List from '..'; import { render } from '../../../tests/utils'; describe('List', () => { it('renders empty list', () => { const { container } = render(<List dataSource={[]} renderItem={() => <List.Item />} />); expect(container.firstChild).toMatchSnapshot(); }); });
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/list/__tests__/a11y.test.ts
components/list/__tests__/a11y.test.ts
import accessibilityDemoTest from '../../../tests/shared/accessibilityTest'; accessibilityDemoTest('list', { // waiting for fix skip: ['infinite-load.tsx'], // we can set alt for img in list demo disabledRules: ['image-alt'], });
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/list/__tests__/index.test.tsx
components/list/__tests__/index.test.tsx
import React from 'react'; import type { ListProps } from '..'; import List from '..'; import mountTest from '../../../tests/shared/mountTest'; import rtlTest from '../../../tests/shared/rtlTest'; import { render } from '../../../tests/utils'; import ConfigProvider from '../../config-provider'; describe('List', () =>...
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/list/__tests__/image.test.ts
components/list/__tests__/image.test.ts
import { imageDemoTest } from '../../../tests/shared/imageTest'; describe('List image', () => { imageDemoTest('list', { skip: ['loadmore.tsx'] }); });
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/list/__tests__/Item.test.tsx
components/list/__tests__/Item.test.tsx
import React, { useEffect } from 'react'; import List from '..'; import type { GetRef } from '../../_util/type'; import { pureRender, render } from '../../../tests/utils'; import ConfigProvider from '../../config-provider'; describe('List Item Layout', () => { const data = [ { key: 1, href: 'https:/...
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/list/__tests__/pagination.test.tsx
components/list/__tests__/pagination.test.tsx
import React from 'react'; import type { ListProps } from '..'; import List from '..'; import { noop } from '../../_util/warning'; import { fireEvent, render } from '../../../tests/utils'; interface DataSourceItem { name: string; key: React.Key; } describe('List.pagination', () => { const data: ListProps<DataS...
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/list/__tests__/demo.test.ts
components/list/__tests__/demo.test.ts
import demoTest from '../../../tests/shared/demoTest'; demoTest('list', { skip: ['virtual-list.tsx'] });
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/list/__tests__/demo-extend.test.ts
components/list/__tests__/demo-extend.test.ts
import { extendTest } from '../../../tests/shared/demoTest'; extendTest('list', { skip: [ 'virtual-list.tsx', 'grid-drag-sorting.tsx', 'grid-drag-sorting-handler.tsx', 'drag-sorting.tsx', 'drag-sorting-handler.tsx', ], });
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/list/__tests__/loading.test.tsx
components/list/__tests__/loading.test.tsx
import React from 'react'; import { LoadingOutlined } from '@ant-design/icons'; import List from '..'; import { render } from '../../../tests/utils'; describe('List', () => { it('renders empty loading', () => { const loading = { spinning: true }; const { container: wrapper } = render( <List loading={l...
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/list/demo/_semantic.tsx
components/list/demo/_semantic.tsx
import React from 'react'; import { LikeOutlined, MessageOutlined, StarOutlined } from '@ant-design/icons'; import { Avatar, List, Space } from 'antd'; import useLocale from '../../../.dumi/hooks/useLocale'; import SemanticPreview from '../../../.dumi/theme/common/SemanticPreview'; const locales = { cn: { extra...
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/list/demo/infinite-load.tsx
components/list/demo/infinite-load.tsx
import React, { useEffect, useState } from 'react'; import { Avatar, Divider, List, Skeleton } from 'antd'; import InfiniteScroll from 'react-infinite-scroll-component'; interface DataType { gender?: string; name?: string; email?: string; avatar?: string; id?: string; } const App: React.FC = () => { const...
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/list/demo/grid.tsx
components/list/demo/grid.tsx
import React from 'react'; import { Card, List } from 'antd'; const data = [ { title: 'Title 1', }, { title: 'Title 2', }, { title: 'Title 3', }, { title: 'Title 4', }, ]; const App: React.FC = () => ( <List grid={{ gutter: 16, column: 4 }} dataSource={data} renderItem={(...
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/list/demo/virtual-list.tsx
components/list/demo/virtual-list.tsx
import React, { useEffect, useState } from 'react'; import { Avatar, List, message } from 'antd'; import VirtualList from '@rc-component/virtual-list'; interface UserItem { email: string; gender: string; name: string; avatar: string; } const CONTAINER_HEIGHT = 400; const PAGE_SIZE = 20; const App: React.FC =...
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/list/demo/grid-test.tsx
components/list/demo/grid-test.tsx
import React from 'react'; import { Card, List } from 'antd'; const data = [ { title: 'Title 1', }, { title: 'Title 2', }, { title: 'Title 3', }, { title: 'Title 4', }, { title: 'Title 5', }, { title: 'Title 6', }, ]; const ListItem = () => ( <List.Item> <Card tit...
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/list/demo/component-token.tsx
components/list/demo/component-token.tsx
import React from 'react'; import { Avatar, ConfigProvider, Divider, List, Typography } from 'antd'; const data = [ 'Racing car sprays burning fuel into crowd.', 'Japanese princess to wed commoner.', 'Australian walks 100km after outback crash.', 'Man charged over missing wedding girl.', 'Los Angeles battles...
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/list/demo/grid-drag-sorting.tsx
components/list/demo/grid-drag-sorting.tsx
import React, { useState } from 'react'; import type { DragEndEvent } from '@dnd-kit/core'; import { DndContext, PointerSensor, useSensor, useSensors } from '@dnd-kit/core'; import { arrayMove, SortableContext, useSortable } from '@dnd-kit/sortable'; import { CSS } from '@dnd-kit/utilities'; import { Card, List } from ...
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/list/demo/basic.tsx
components/list/demo/basic.tsx
import React from 'react'; import { Avatar, List } from 'antd'; const data = [ { title: 'Ant Design Title 1', }, { title: 'Ant Design Title 2', }, { title: 'Ant Design Title 3', }, { title: 'Ant Design Title 4', }, ]; const App: React.FC = () => ( <List itemLayout="horizontal" ...
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/list/demo/grid-drag-sorting-handler.tsx
components/list/demo/grid-drag-sorting-handler.tsx
import React, { createContext, useContext, useMemo, useState } from 'react'; import { HolderOutlined } from '@ant-design/icons'; import type { DragEndEvent, DraggableAttributes } from '@dnd-kit/core'; import { DndContext } from '@dnd-kit/core'; import type { SyntheticListenerMap } from '@dnd-kit/core/dist/hooks/utiliti...
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/list/demo/pagination.tsx
components/list/demo/pagination.tsx
import React, { useState } from 'react'; import { Avatar, List, Radio, Space } from 'antd'; type PaginationPosition = 'top' | 'bottom' | 'both'; type PaginationAlign = 'start' | 'center' | 'end'; const data = [ { title: 'Ant Design Title 1', }, { title: 'Ant Design Title 2', }, { title: 'Ant De...
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/list/demo/responsive.tsx
components/list/demo/responsive.tsx
import React from 'react'; import { Card, List } from 'antd'; const data = [ { title: 'Title 1', }, { title: 'Title 2', }, { title: 'Title 3', }, { title: 'Title 4', }, { title: 'Title 5', }, { title: 'Title 6', }, ]; const App: React.FC = () => ( <List grid={{ ...
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/list/demo/drag-sorting.tsx
components/list/demo/drag-sorting.tsx
import React, { useState } from 'react'; import type { DragEndEvent } from '@dnd-kit/core'; import { DndContext, PointerSensor, useSensor, useSensors } from '@dnd-kit/core'; import { restrictToVerticalAxis } from '@dnd-kit/modifiers'; import { arrayMove, SortableContext, useSortable, verticalListSortingStrategy...
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/list/demo/simple.tsx
components/list/demo/simple.tsx
import React from 'react'; import { Divider, List, Typography } from 'antd'; const data = [ 'Racing car sprays burning fuel into crowd.', 'Japanese princess to wed commoner.', 'Australian walks 100km after outback crash.', 'Man charged over missing wedding girl.', 'Los Angeles battles huge wildfires.', ]; c...
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/list/demo/vertical.tsx
components/list/demo/vertical.tsx
import React from 'react'; import { LikeOutlined, MessageOutlined, StarOutlined } from '@ant-design/icons'; import { Avatar, List, Space } from 'antd'; const data = Array.from({ length: 23 }).map((_, i) => ({ href: 'https://ant.design', title: `ant design part ${i}`, avatar: `https://api.dicebear.com/7.x/miniavs...
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/list/demo/drag-sorting-handler.tsx
components/list/demo/drag-sorting-handler.tsx
import React, { createContext, useContext, useMemo, useState } from 'react'; import { HolderOutlined } from '@ant-design/icons'; import type { DragEndEvent, DraggableAttributes } from '@dnd-kit/core'; import { DndContext } from '@dnd-kit/core'; import type { SyntheticListenerMap } from '@dnd-kit/core/dist/hooks/utiliti...
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/list/demo/loadmore.tsx
components/list/demo/loadmore.tsx
import React, { useEffect, useState } from 'react'; import { Avatar, Button, List, Skeleton } from 'antd'; interface DataType { gender?: string; name?: string; email?: string; avatar?: string; loading: boolean; } const PAGE_SIZE = 3; const App: React.FC = () => { const [initLoading, setInitLoading] = use...
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/mentions/index.tsx
components/mentions/index.tsx
import * as React from 'react'; import RcMentions from '@rc-component/mentions'; import type { DataDrivenOptionProps as MentionsOptionProps, MentionsProps as RcMentionsProps, MentionsRef as RcMentionsRef, } from '@rc-component/mentions/lib/Mentions'; import { composeRef } from '@rc-component/util/lib/ref'; import...
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/mentions/style/index.ts
components/mentions/style/index.ts
import { unit } from '@ant-design/cssinjs'; import { genBasicInputStyle, genPlaceholderStyle, initComponentToken, initInputToken, } from '../../input/style'; import type { SharedComponentToken, SharedInputToken } from '../../input/style/token'; import { genBorderlessStyle, genDisabledStyle, genFilledStyl...
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/mentions/__tests__/a11y.test.ts
components/mentions/__tests__/a11y.test.ts
import accessibilityDemoTest from '../../../tests/shared/accessibilityTest'; accessibilityDemoTest('mentions', { disabledRules: ['label'] });
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/mentions/__tests__/index.test.tsx
components/mentions/__tests__/index.test.tsx
import React from 'react'; import { ConfigProvider, Form } from 'antd'; import Mentions, { Option } from '..'; import focusTest from '../../../tests/shared/focusTest'; import mountTest from '../../../tests/shared/mountTest'; import rtlTest from '../../../tests/shared/rtlTest'; import { act, fireEvent, render } from '....
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/mentions/__tests__/image.test.ts
components/mentions/__tests__/image.test.ts
import { imageDemoTest } from '../../../tests/shared/imageTest'; describe('Mentions image', () => { imageDemoTest('mentions'); });
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/mentions/__tests__/demo-extend.test.ts
components/mentions/__tests__/demo-extend.test.ts
import { extendTest } from '../../../tests/shared/demoTest'; extendTest('mentions', { skip: ['autoSize.tsx'], });
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/mentions/__tests__/demo.test.tsx
components/mentions/__tests__/demo.test.tsx
import * as React from 'react'; import { UnstableContext } from '@rc-component/mentions'; import demoTest, { rootPropsTest } from '../../../tests/shared/demoTest'; import { fireEvent } from '../../../tests/utils'; demoTest('mentions', { testRootProps: false, }); rootPropsTest( 'mentions', (Mentions, props) => ...
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/mentions/__tests__/semantic.test.tsx
components/mentions/__tests__/semantic.test.tsx
import React from 'react'; import Mentions from '..'; import { render } from '../../../tests/utils'; describe('Mentions.Semantic', () => { it('support classNames and styles as functions', () => { const { container } = render( <Mentions placeholder="@someone" options={[{ value: 'test', labe...
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/mentions/demo/async.tsx
components/mentions/demo/async.tsx
import React, { useCallback, useRef, useState } from 'react'; import { Mentions } from 'antd'; import debounce from 'lodash/debounce'; const App: React.FC = () => { const [loading, setLoading] = useState(false); const [users, setUsers] = useState<{ login: string; avatar_url: string }[]>([]); const ref = useRef<s...
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/mentions/demo/form.tsx
components/mentions/demo/form.tsx
import React from 'react'; import { Button, Form, Mentions, Space } from 'antd'; const { getMentions } = Mentions; const formItemLayout = { labelCol: { span: 6 }, wrapperCol: { span: 16 }, }; const App: React.FC = () => { const [form] = Form.useForm(); const onReset = () => { form.resetFields(); }; ...
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/mentions/demo/readonly.tsx
components/mentions/demo/readonly.tsx
import React from 'react'; import { Mentions } from 'antd'; const options = ['afc163', 'zombiej', 'yesmeck'].map((value) => ({ value, key: value, label: value, })); const App: React.FC = () => ( <> <div style={{ marginBottom: 10 }}> <Mentions style={{ width: '100%' }} placeholder="th...
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/mentions/demo/_semantic.tsx
components/mentions/demo/_semantic.tsx
import React from 'react'; import { UnstableContext } from '@rc-component/mentions'; import type { UnstableContextProps } from '@rc-component/mentions/lib/context'; import type { MentionProps } from 'antd'; import { Mentions } from 'antd'; import useLocale from '../../../.dumi/hooks/useLocale'; import SemanticPreview ...
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/mentions/demo/autoSize.tsx
components/mentions/demo/autoSize.tsx
import React from 'react'; import { Mentions } from 'antd'; const App: React.FC = () => ( <Mentions autoSize style={{ width: '100%' }} options={[ { value: 'afc163', label: 'afc163', }, { value: 'zombieJ', label: 'zombieJ', }, { value: ...
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/mentions/demo/render-panel.tsx
components/mentions/demo/render-panel.tsx
import React from 'react'; import { Mentions } from 'antd'; const { _InternalPanelDoNotUseOrYouWillBeFired: InternalMentions } = Mentions; const options = [ { value: 'afc163', label: 'afc163', }, { value: 'zombieJ', label: 'zombieJ', }, ]; const App: React.FC = () => ( <InternalMentions sty...
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/mentions/demo/variant.tsx
components/mentions/demo/variant.tsx
import React from 'react'; import { Flex, Mentions } from 'antd'; const App: React.FC = () => ( <Flex vertical gap={12}> <Mentions placeholder="Outlined" /> <Mentions placeholder="Filled" variant="filled" /> <Mentions placeholder="Borderless" variant="borderless" /> <Mentions placeholder="Underlined"...
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/mentions/demo/autosize-textarea-debug.tsx
components/mentions/demo/autosize-textarea-debug.tsx
import React from 'react'; import { Flex, Mentions } from 'antd'; import type { GetProp, MentionProps } from 'antd'; type MentionsOptionProps = GetProp<MentionProps, 'options'>[number]; const onChange = (value: string) => { console.log('Change:', value); }; const onSelect = (option: MentionsOptionProps) => { con...
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/mentions/demo/status.tsx
components/mentions/demo/status.tsx
import React from 'react'; import { Mentions, Space } from 'antd'; import type { GetProp, MentionProps } from 'antd'; type MentionsOptionProps = GetProp<MentionProps, 'options'>[number]; const onChange = (value: string) => { console.log('Change:', value); }; const onSelect = (option: MentionsOptionProps) => { co...
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/mentions/demo/prefix.tsx
components/mentions/demo/prefix.tsx
import React, { useState } from 'react'; import { Mentions } from 'antd'; import type { MentionsProps } from 'antd'; const MOCK_DATA = { '@': ['afc163', 'zombiej', 'yesmeck'], '#': ['1.0', '2.0', '3.0'], }; type PrefixType = keyof typeof MOCK_DATA; const App: React.FC = () => { const [prefix, setPrefix] = useS...
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/mentions/demo/component-token.tsx
components/mentions/demo/component-token.tsx
import React from 'react'; import { ConfigProvider, Mentions } from 'antd'; const { _InternalPanelDoNotUseOrYouWillBeFired: InternalMentions } = Mentions; const options = [ { value: 'afc163', label: 'afc163', }, { value: 'zombieJ', label: 'zombieJ', }, ]; const App: React.FC = () => ( <Conf...
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/mentions/demo/placement.tsx
components/mentions/demo/placement.tsx
import React from 'react'; import { Mentions } from 'antd'; const App: React.FC = () => ( <Mentions style={{ width: '100%' }} placement="top" options={[ { value: 'afc163', label: 'afc163', }, { value: 'zombieJ', label: 'zombieJ', }, { ...
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/mentions/demo/basic.tsx
components/mentions/demo/basic.tsx
import React from 'react'; import { Mentions } from 'antd'; import type { GetProp, MentionProps } from 'antd'; type MentionsOptionProps = GetProp<MentionProps, 'options'>[number]; const onChange = (value: string) => { console.log('Change:', value); }; const onSelect = (option: MentionsOptionProps) => { console.l...
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/mentions/demo/size.tsx
components/mentions/demo/size.tsx
import React from 'react'; import { Flex, Mentions } from 'antd'; const App: React.FC = () => ( <Flex vertical gap="middle"> <Mentions size="large" placeholder="large size" /> <Mentions placeholder="default size" /> <Mentions size="small" placeholder="small size" /> </Flex> ); export default App;
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/mentions/demo/allowClear.tsx
components/mentions/demo/allowClear.tsx
import React, { useState } from 'react'; import { CloseSquareFilled } from '@ant-design/icons'; import { Mentions } from 'antd'; const App: React.FC = () => { const [value, setValue] = useState('hello world'); return ( <> <Mentions value={value} onChange={setValue} allowClear /> <br /> <br />...
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/mentions/demo/style-class.tsx
components/mentions/demo/style-class.tsx
import React from 'react'; import { Flex, Mentions } from 'antd'; import type { MentionsProps } from 'antd'; import { createStyles } from 'antd-style'; const useStyles = createStyles(({ token }) => ({ root: { border: `1px solid ${token.colorPrimary}`, borderRadius: 8, width: 300, }, })); const options...
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/notification/util.ts
components/notification/util.ts
import type * as React from 'react'; import type { CSSMotionProps } from '@rc-component/motion'; import type { NotificationConfig as CPNotificationConfig } from '../config-provider/context'; import type { NotificationConfig, NotificationPlacement } from './interface'; export function getPlacementStyle(placement: Noti...
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/notification/useNotification.tsx
components/notification/useNotification.tsx
import React, { useContext, useMemo } from 'react'; import type { FC, PropsWithChildren } from 'react'; import { NotificationProvider, useNotification as useRcNotification, } from '@rc-component/notification'; import type { NotificationAPI, NotificationConfig as RcNotificationConfig, } from '@rc-component/notif...
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/notification/interface.ts
components/notification/interface.ts
import type * as React from 'react'; import type { ClosableType, SemanticClassNamesType, SemanticStylesType } from '../_util/hooks'; interface DivProps extends React.HTMLProps<HTMLDivElement> { 'data-testid'?: string; } export const NotificationPlacements = [ 'top', 'topLeft', 'topRight', 'bottom', 'bott...
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/notification/index.tsx
components/notification/index.tsx
import React, { useContext } from 'react'; import { render } from '@rc-component/util/lib/React/render'; import { AppConfigContext } from '../app/context'; import ConfigProvider, { ConfigContext, globalConfig, warnContext } from '../config-provider'; import type { ArgsProps, GlobalConfigProps, NotificationInstance } f...
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/notification/PurePanel.tsx
components/notification/PurePanel.tsx
import * as React from 'react'; import CheckCircleFilled from '@ant-design/icons/CheckCircleFilled'; import CloseCircleFilled from '@ant-design/icons/CloseCircleFilled'; import CloseOutlined from '@ant-design/icons/CloseOutlined'; import ExclamationCircleFilled from '@ant-design/icons/ExclamationCircleFilled'; import I...
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/notification/style/placement.ts
components/notification/style/placement.ts
import type { CSSObject } from '@ant-design/cssinjs'; import { Keyframes } from '@ant-design/cssinjs'; import type { NotificationToken } from '.'; import type { GenerateStyle } from '../../theme/internal'; const genNotificationPlacementStyle: GenerateStyle<NotificationToken, CSSObject> = (token) => { const { compon...
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/notification/style/pure-panel.ts
components/notification/style/pure-panel.ts
import { unit } from '@ant-design/cssinjs'; import { genNoticeStyle, prepareComponentToken, prepareNotificationToken } from '.'; import { genSubStyleComponent } from '../../theme/internal'; export default genSubStyleComponent( ['Notification', 'PurePanel'], (token) => { const noticeCls = `${token.componentCls...
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/notification/style/index.ts
components/notification/style/index.ts
import type { CSSObject } from '@ant-design/cssinjs'; import { Keyframes, unit } from '@ant-design/cssinjs'; import { CONTAINER_MAX_OFFSET } from '../../_util/hooks'; import { genFocusStyle, resetComponent } from '../../style'; import type { AliasToken, FullToken, GenerateStyle, GenStyleFn } from '../../theme/internal...
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/notification/style/stack.ts
components/notification/style/stack.ts
import type { CSSObject } from '@ant-design/cssinjs'; import type { NotificationToken } from '.'; import type { GenerateStyle } from '../../theme/internal'; import type { NotificationPlacement } from '../interface'; import { NotificationPlacements } from '../interface'; const placementAlignProperty: Record<Notificati...
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/notification/__tests__/placement.test.tsx
components/notification/__tests__/placement.test.tsx
import notification, { actWrapper } from '..'; import { act, fireEvent } from '../../../tests/utils'; import type { ArgsProps, GlobalConfigProps } from '../interface'; import { awaitPromise, triggerMotionEnd } from './util'; // TODO: Remove this. Mock for React 19 jest.mock('react-dom', () => { const realReactDOM = ...
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/notification/__tests__/a11y.test.ts
components/notification/__tests__/a11y.test.ts
import accessibilityDemoTest from '../../../tests/shared/accessibilityTest'; accessibilityDemoTest('notification', { disabledRules: ['button-name', 'label'] });
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false
ant-design/ant-design
https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/components/notification/__tests__/index.test.tsx
components/notification/__tests__/index.test.tsx
import React from 'react'; import { SmileOutlined, UserOutlined } from '@ant-design/icons'; import notification, { actWrapper } from '..'; import { act, fireEvent, render } from '../../../tests/utils'; import ConfigProvider, { defaultPrefixCls } from '../../config-provider'; import { awaitPromise, triggerMotionEnd } f...
typescript
MIT
283b2822e0c371d083a1eaf51cfb1120c5cc4ffe
2026-01-04T15:25:31.760576Z
false