Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: format code #19

Merged
merged 5 commits into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 25 additions & 12 deletions doc/docs/components/animation/ripple.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,28 @@
```tsx
import { Ripple, Button } from "@qwqui/core";

export default function App() {
const App = () => {
const handleClick = () => {
console.log("click!");
};

return (
<Button>
Button
<Ripple color="#00000050" />
</Button>
);
}
};

export default App;
```

## 自定义颜色

```tsx
import { Ripple } from "@qwqui/core";

export default function App() {
const App = () => {
return (
<div
style={{
Expand All @@ -42,15 +45,17 @@ export default function App() {
<Ripple color="#66ccff" />
</div>
);
}
};

export default App;
```

## 自定义透明度

```tsx
import { Ripple } from "@qwqui/core";

export default function App() {
const App = () => {
return (
<div
style={{
Expand All @@ -69,15 +74,17 @@ export default function App() {
<Ripple color="#66ccff50" endOpacity={1} />
</div>
);
}
};

export default App;
```

## 自定义过度时间

```tsx
import { Ripple } from "@qwqui/core";

export default function App() {
const App = () => {
return (
<div
style={{
Expand All @@ -96,15 +103,17 @@ export default function App() {
<Ripple color="#66ccff" duration={3000} />
</div>
);
}
};

export default App;
```

## 自定义模糊程度

```tsx
import { Ripple } from "@qwqui/core";

export default function App() {
const App = () => {
return (
<div
style={{
Expand All @@ -123,15 +132,17 @@ export default function App() {
<Ripple blur="32px" />
</div>
);
}
};

export default App;
```

## 自定义动画名称

```tsx
import { Ripple } from "@qwqui/core";

export default function App() {
const App = () => {
return (
<div
style={{
Expand All @@ -150,7 +161,9 @@ export default function App() {
<Ripple animation-name="linear" />
</div>
);
}
};

export default App;
```

## Props
Expand Down
10 changes: 6 additions & 4 deletions doc/docs/components/button/ButtonControls.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useState } from "react";
import { Button } from "@qwqui/core";

export default function ButtonControls() {
const ButtonControls = () => {
const [color, setColor] = useState('blue');
const [size, setSize] = useState('md');
const [radius, setRadius] = useState('md');
Expand All @@ -13,7 +13,7 @@ import { Button } from "@qwqui/core";

function Demo() {
return <Button color="${color}" size="${size}"${useCustomRadius ? ` radius="${radius}"` : ''}${strong ? ` strong={${strong}}` : ''}>Button</Button>;
}`.trimStart()
}`.trimStart();

const COLORS = ['gray', 'red', 'pink', 'grape', 'violet', 'indigo',
'blue', 'cyan', 'teal', 'green', 'lime', 'yellow', 'orange'];
Expand Down Expand Up @@ -68,5 +68,7 @@ function Demo() {
{codeStr}
</pre>
</>
)
};
);
};

export default ButtonControls;
11 changes: 5 additions & 6 deletions doc/docs/components/button/button.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default function App() {
<Button size={"lg"}>Button</Button>
<Button size={"xl"}>Button</Button>
</div>
)
);
}
```

Expand All @@ -46,8 +46,7 @@ export default function App() {
<Button color={"orange"}>Orange</Button>
</div>
</div>

)
);
}
```

Expand All @@ -62,7 +61,7 @@ export default function App() {
<Button>Normal</Button>
<Button strong>Strong</Button>
</div>
)
);
}
```

Expand All @@ -77,6 +76,6 @@ export default function App() {
<Button>Enabled</Button>
<Button disabled>Disabled</Button>
</div>
)
);
}
```
```
8 changes: 5 additions & 3 deletions doc/docs/components/center/center.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@
import React from 'react';
import { Center } from '@qwqui/core';

export default function Example() {
const App = () => {
return (
<Center>
<span>Your content here</span>
</Center>
)
);
};

export default App;
```


Expand All @@ -21,4 +23,4 @@ export default function Example() {
| 名称 | 类型 | 介绍 |
|---|---|---|
| children | `React.ReactNode` | 要居中的内容。 |
| inline | `boolen` | 如果为`true`,那么`display`属性则为`inline-flex`,否则`display`属性则为`false` |
| inline | `boolen` | 如果为`true`,那么`display`属性则为`inline-flex`,否则`display`属性则为`false` |
20 changes: 10 additions & 10 deletions packages/components/button/src/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const Button = (props: ButtonProps) => {
}

if (props.size == 'xl') {
return 'xl'
return 'xl';
}
return 'md';
}
Expand Down Expand Up @@ -53,13 +53,13 @@ export const Button = (props: ButtonProps) => {


export interface ButtonProps {
children?: React.ReactNode,
onClick?: () => void,
disabled?: boolean,
variant?: string,
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl',
radius?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'full'
children?: React.ReactNode;
onClick?: () => void;
disabled?: boolean;
variant?: string;
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
radius?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
color?: 'gray' | 'red' | 'pink' | 'grape' | 'violet' | 'indigo'
| 'blue' | 'cyan' | 'teal' | 'green' | 'lime' | 'yellow' | 'orange',
strong?: boolean,
}
| 'blue' | 'cyan' | 'teal' | 'green' | 'lime' | 'yellow' | 'orange';
strong?: boolean;
}