Skip to content

Commit

Permalink
fix: [DEMO] fix styles
Browse files Browse the repository at this point in the history
  • Loading branch information
akai committed Mar 7, 2022
1 parent 5ce52ed commit b0225e0
Show file tree
Hide file tree
Showing 48 changed files with 20 additions and 66 deletions.
2 changes: 1 addition & 1 deletion demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
<script src="//dev.g.alicdn.com/chatui/icons/0.3.0/index.js" async=""></script>
<script src="//dev.g.alicdn.com/chatui/icons/0.3.1/index.js" async=""></script>
</body>
</html>
2 changes: 1 addition & 1 deletion demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "demo",
"version": "0.1.0",
"scripts": {
"dev": "vite",
"dev": "vite --host",
"build": "tsc && vite build",
"serve": "vite preview"
},
Expand Down
2 changes: 1 addition & 1 deletion demo/src/components/DemoSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';

interface DemoSectionProps {
title: string;
bg?: 'white' | 'light-1' | 'light-2';
bg?: 'white' | 'gray-5';
children: React.ReactNode;
}

Expand Down
1 change: 0 additions & 1 deletion demo/src/demo/Avatar.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react';
import { DemoPage, DemoSection } from '../components';
import { Avatar } from '../../../src';
import '../../../src/styles/index.less';

const img = '//gw.alicdn.com/tfs/TB1U7FBiAT2gK0jSZPcXXcKkpXa-108-108.jpg';

Expand Down
1 change: 0 additions & 1 deletion demo/src/demo/Bubble.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react';
import { DemoPage, DemoSection } from '../components';
import { Bubble } from '../../../src';
import '../../../src/styles/index.less';

export default () => (
<DemoPage>
Expand Down
1 change: 0 additions & 1 deletion demo/src/demo/Button.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react';
import { DemoPage, DemoSection } from '../components';
import { Button, IconButton } from '../../../src';
import '../../../src/styles/index.less';

export default () => (
<DemoPage>
Expand Down
7 changes: 2 additions & 5 deletions demo/src/demo/Card.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react';
import { DemoPage, DemoSection } from '../components';
import { Card, CardMedia, CardTitle, CardText, CardActions, Button } from '../../../src';
import '../../../src/styles/index.less';

export default () => (
<DemoPage>
Expand All @@ -11,10 +10,8 @@ export default () => (
气泡内容详情气泡内容详情气泡内容详情气泡内容详情气泡内容详情气泡内容详情气泡内容详情气泡内容详情气泡内容详情气泡内容详情气泡内容详情气泡内容详情气泡内容详情气泡内容详情气泡内容详情
</CardText>
<CardActions>
<Button size="lg">前去留言</Button>
<Button color="primary" size="lg">
提交评价
</Button>
<Button>前去留言</Button>
<Button color="primary">提交评价</Button>
</CardActions>
</Card>
</DemoSection>
Expand Down
1 change: 0 additions & 1 deletion demo/src/demo/Carousel.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react';
import { DemoPage, DemoSection } from '../components';
import { Carousel, Image } from '../../../src';
import '../../../src/styles/index.less';

const imgs = [
'//gw.alicdn.com/tfs/TB1GRW3voY1gK0jSZFMXXaWcVXa-620-320.jpg',
Expand Down
1 change: 0 additions & 1 deletion demo/src/demo/Chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import Chat, {
ToolbarItemProps,
} from '../../../src';
import OrderSelector from './OrdderSelector';
import '../../../src/styles/index.less';

type MessageWithoutId = Omit<MessageProps, '_id'>;

Expand Down
9 changes: 4 additions & 5 deletions demo/src/demo/Checkbox.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React, { useState } from 'react';
import { DemoPage, DemoSection } from '../components';
import { Checkbox, CheckboxGroup, CheckboxValue } from '../../../src';
import '../../../src/styles/index.less';

const options = [
{ label: 'Apple', value: 'Apple' },
Expand All @@ -25,16 +24,16 @@ export default () => {

return (
<DemoPage>
<DemoSection title="基础用法">
<DemoSection title="基础用法" bg="gray-5">
<Checkbox value="abc" label="ABC" checked={checked} onChange={() => setChecked(!checked)} />
</DemoSection>
<DemoSection title="禁用状态">
<DemoSection title="禁用状态" bg="gray-5">
<Checkbox value="abc" label="ABC" disabled />
</DemoSection>
<DemoSection title="复选框组">
<DemoSection title="复选框组" bg="gray-5">
<CheckboxGroup value={value1} options={options} onChange={handleChange} />
</DemoSection>
<DemoSection title="块级显示">
<DemoSection title="块级显示" bg="gray-5">
<CheckboxGroup value={value2} options={options} onChange={handleChange2} block />
</DemoSection>
</DemoPage>
Expand Down
1 change: 0 additions & 1 deletion demo/src/demo/Divider.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react';
import { DemoPage, DemoSection } from '../components';
import { Divider } from '../../../src';
import '../../../src/styles/index.less';

export default () => (
<DemoPage>
Expand Down
1 change: 0 additions & 1 deletion demo/src/demo/Empty.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react';
import { DemoPage, DemoSection } from '../components';
import { Empty, Button } from '../../../src';
import '../../../src/styles/index.less';

export default () => (
<DemoPage>
Expand Down
1 change: 0 additions & 1 deletion demo/src/demo/ErrorBoundary.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React, { useState } from 'react';
import { DemoPage, DemoSection } from '../components';
import { ErrorBoundary, FallbackProps } from '../../../src';
import '../../../src/styles/index.less';

function BuggyCounter() {
const [counter, setCounter] = useState(0);
Expand Down
1 change: 0 additions & 1 deletion demo/src/demo/FileCard.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react';
import { DemoPage, DemoSection } from '../components';
import { FileCard } from '../../../src';
import '../../../src/styles/index.less';

const file = new File(['foo'], 'foo.txt', {
type: 'text/plain',
Expand Down
1 change: 0 additions & 1 deletion demo/src/demo/Flex.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react';
import { DemoPage, DemoSection } from '../components';
import { Flex, FlexItem } from '../../../src';
import '../../../src/styles/index.less';

function FluidLayout({ n }: { n: number }) {
return (
Expand Down
1 change: 0 additions & 1 deletion demo/src/demo/Form.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React, { useState } from 'react';
import { DemoPage, DemoSection } from '../components';
import { Form, FormItem, FormActions, Input, Button, RadioGroup } from '../../../src';
import '../../../src/styles/index.less';

export default () => {
const [usename, setUsername] = useState('');
Expand Down
1 change: 0 additions & 1 deletion demo/src/demo/Goods.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react';
import { DemoPage, DemoSection } from '../components';
import { Card, Goods } from '../../../src';
import '../../../src/styles/index.less';

export default () => (
<DemoPage>
Expand Down
1 change: 0 additions & 1 deletion demo/src/demo/Icon.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react';
import { DemoPage, DemoSection } from '../components';
import { Icon } from '../../../src';
import '../../../src/styles/index.less';

const symbols = document.getElementById('__CHATUI_ICONS__')?.querySelectorAll('symbol') || [];

Expand Down
1 change: 0 additions & 1 deletion demo/src/demo/Input.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React, { useState } from 'react';
import { DemoPage, DemoSection } from '../components';
import { Input } from '../../../src';
import '../../../src/styles/index.less';

export default () => {
const [value1, setValue1] = useState('');
Expand Down
1 change: 0 additions & 1 deletion demo/src/demo/List.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react';
import { DemoPage, DemoSection } from '../components';
import { Card, List, ListItem } from '../../../src';
import '../../../src/styles/index.less';

export default () => (
<DemoPage>
Expand Down
1 change: 0 additions & 1 deletion demo/src/demo/Loading.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react';
import { DemoPage, DemoSection } from '../components';
import { Loading } from '../../../src';
import '../../../src/styles/index.less';

export default () => (
<DemoPage>
Expand Down
1 change: 0 additions & 1 deletion demo/src/demo/MediaObject.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react';
import { DemoPage, DemoSection } from '../components';
import { MediaObject } from '../../../src';
import '../../../src/styles/index.less';

export default () => (
<DemoPage>
Expand Down
1 change: 0 additions & 1 deletion demo/src/demo/Modal.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React, { useState } from 'react';
import { DemoPage, DemoSection } from '../components';
import { Modal, Card, List, ListItem } from '../../../src';
import '../../../src/styles/index.less';

export default () => {
const [open1, setOpen1] = useState(false);
Expand Down
1 change: 0 additions & 1 deletion demo/src/demo/Navbar.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react';
import { DemoPage, DemoSection } from '../components';
import { Navbar } from '../../../src';
import '../../../src/styles/index.less';

export default () => {
return (
Expand Down
11 changes: 5 additions & 6 deletions demo/src/demo/Notice.tsx
Original file line number Diff line number Diff line change
@@ -1,31 +1,30 @@
import React from 'react';
import { DemoPage, DemoSection } from '../components';
import { Notice } from '../../../src';
import '../../../src/styles/index.less';

export default () => (
<DemoPage>
<DemoSection title="基础用法" bg="light-2">
<DemoSection title="基础用法" bg="gray-5">
<div style={{ position: 'relative', height: '60px' }}>
<Notice content="小蜜公告内容小蜜公告内容小蜜公告内容小蜜公告内容小蜜公告内容小蜜公告内容小蜜公告内容" />
</div>
</DemoSection>
<DemoSection title="没有关闭" bg="light-2">
<DemoSection title="没有关闭" bg="gray-5">
<div style={{ position: 'relative', height: '60px' }}>
<Notice
closable={false}
content="小蜜公告内容小蜜公告内容小蜜公告内容小蜜公告内容小蜜公告内容小蜜公告内容小蜜公告内容"
/>
</div>
</DemoSection>
<DemoSection title="文字" bg="light-2">
<DemoSection title="短文字" bg="gray-5">
<div style={{ position: 'relative', height: '60px' }}>
<Notice content="小蜜公告内容小蜜公告内容" />
</div>
</DemoSection>
<DemoSection title="右按钮" bg="light-2">
<DemoSection title="左按钮" bg="gray-5">
<div style={{ position: 'relative', height: '60px' }}>
<Notice content="小蜜公告内容" rightIcon="chevron-right" />
<Notice content="小蜜公告内容" leftIcon="warning-circle-fill" />
</div>
</DemoSection>
</DemoPage>
Expand Down
1 change: 0 additions & 1 deletion demo/src/demo/OrdderSelector.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, { useState } from 'react';
import { Popup, Card, Goods, Tabs, Tab, Button, Search, Modal } from '../../../src';
import '../../../src/styles/index.less';

export default () => {
const [active, setActive] = useState(true);
Expand Down
1 change: 0 additions & 1 deletion demo/src/demo/Popup.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React, { useState } from 'react';
import { DemoPage, DemoSection } from '../components';
import { Popup, Card, List, ListItem } from '../../../src';
import '../../../src/styles/index.less';

export default () => {
const [open1, setOpen1] = useState(false);
Expand Down
1 change: 0 additions & 1 deletion demo/src/demo/Portal.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React, { useRef } from 'react';
import { DemoPage, DemoSection } from '../components';
import { Portal } from '../../../src';
import '../../../src/styles/index.less';

export default () => {
const containerRef = useRef(null);
Expand Down
1 change: 0 additions & 1 deletion demo/src/demo/Price.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react';
import { DemoPage, DemoSection } from '../components';
import { Price } from '../../../src';
import '../../../src/styles/index.less';

const number = 1234567.89;

Expand Down
1 change: 0 additions & 1 deletion demo/src/demo/Progress.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React, { useState } from 'react';
import { DemoPage, DemoSection } from '../components';
import { Progress, Button } from '../../../src';
import '../../../src/styles/index.less';

export default () => {
const [percentage, setPercentage] = useState(20);
Expand Down
1 change: 0 additions & 1 deletion demo/src/demo/PullToRefresh.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react';
import { DemoPage, DemoSection } from '../components';
import { PullToRefresh } from '../../../src';
import '../../../src/styles/index.less';

export default () => (
<DemoPage>
Expand Down
5 changes: 2 additions & 3 deletions demo/src/demo/Radio.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React, { useState } from 'react';
import { DemoPage, DemoSection } from '../components';
import { Radio, RadioGroup, RadioValue } from '../../../src';
import '../../../src/styles/index.less';

const options = [
{ label: 'Apple', value: 'Apple' },
Expand All @@ -19,12 +18,12 @@ export default () => {

return (
<DemoPage>
<DemoSection title="基础用法">
<DemoSection title="基础用法" bg="gray-5">
<Radio label="备选项A" value="a" />
<Radio label="备选项B" value="b" checked />
<Radio label="备选项C" value="c" disabled />
</DemoSection>
<DemoSection title="单选框组">
<DemoSection title="单选框组" bg="gray-5">
<RadioGroup value={value} options={options} onChange={handleChange} />
</DemoSection>
</DemoPage>
Expand Down
1 change: 0 additions & 1 deletion demo/src/demo/RateActions.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react';
import { DemoPage, DemoSection } from '../components';
import { RateActions, LocaleProvider } from '../../../src';
import '../../../src/styles/index.less';

export default () => (
<DemoPage>
Expand Down
1 change: 0 additions & 1 deletion demo/src/demo/RichText.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react';
import { DemoPage, DemoSection } from '../components';
import { RichText } from '../../../src';
import '../../../src/styles/index.less';

const html = '<div><h1>H1标题</h1><p>这是段落<em>em标签</em><strong>strong标签</strong></p></div>';

Expand Down
1 change: 0 additions & 1 deletion demo/src/demo/ScrollView.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react';
import { DemoPage, DemoSection } from '../components';
import { ScrollView, Button } from '../../../src';
import '../../../src/styles/index.less';

// const list = [{ text: '内容1' }, { text: '内容2' }, { text: '内容3' }];

Expand Down
1 change: 0 additions & 1 deletion demo/src/demo/Search.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react';
import { DemoPage, DemoSection } from '../components';
import { Search } from '../../../src';
import '../../../src/styles/index.less';

export default () => (
<DemoPage>
Expand Down
1 change: 0 additions & 1 deletion demo/src/demo/Select.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React, { useState } from 'react';
import { DemoPage, DemoSection } from '../components';
import { Select } from '../../../src';
import '../../../src/styles/index.less';

export default () => {
const [value1, setValue1] = useState('');
Expand Down
1 change: 0 additions & 1 deletion demo/src/demo/Stepper.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react';
import { DemoPage, DemoSection } from '../components';
import { Stepper, Step } from '../../../src';
import '../../../src/styles/index.less';

export default () => (
<DemoPage>
Expand Down
1 change: 0 additions & 1 deletion demo/src/demo/Tabs.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React, { useState } from 'react';
import { DemoPage, DemoSection } from '../components';
import { Tabs, Tab } from '../../../src';
import '../../../src/styles/index.less';

export default () => {
const [tabIndex, setTabIndex] = useState(0);
Expand Down
1 change: 0 additions & 1 deletion demo/src/demo/Tag.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react';
import { DemoPage, DemoSection } from '../components';
import { Tag } from '../../../src';
import '../../../src/styles/index.less';

export default () => (
<DemoPage>
Expand Down
Loading

0 comments on commit b0225e0

Please sign in to comment.