Skip to content

Commit

Permalink
更新组件
Browse files Browse the repository at this point in the history
  • Loading branch information
parlay96 committed Aug 18, 2024
1 parent e55fb40 commit f4af82a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 44 deletions.
42 changes: 2 additions & 40 deletions .docs/src/button/basic.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,57 +2,19 @@
* @Date: 2024-08-03 08:17:36
* @Description: Modify here please
*/
import { Button, Checkbox } from "camelia";
import React, { useState } from "react";
import { Button } from "camelia";
import React from "react";

const App: React.FC = () => {
const [checked, setchecked] = useState(false);
const [checkList, setcheckList] = useState<string[]>(["2"]);

const [checkedvalue, setcheckedvalue] = useState<string[]>([]);

const plainOptions = ["Apple", "Pear", "Orange"];

const isIndeterminate = checkedvalue.length > 0 && checkedvalue.length < plainOptions.length;

const checkAll = plainOptions.length === checkedvalue.length;

const handleCheckAllChange = (val: boolean) => {
setcheckedvalue(val ? plainOptions : []);
};

const handleCheckedCitiesChange = (value: any[]) => {
console.log(value);
setcheckedvalue(value);
};

return (
<>
<Checkbox checked={checked} onChange={(v) => setchecked(v)}>
Checkbox
</Checkbox>

{/* <Checkbox.Group
options={[
{ value: "1", label: "Option 1" },
{ value: "2", label: "Option 2" }
]}
value={checkList}
/> */}

<div className="mb-4">
<Button>default</Button>
<Button type="primary">Primary</Button>
<Button type="success">Success</Button>
<Button type="warning">Warning</Button>
<Button type="danger">Danger</Button>
</div>

<Checkbox checked={checkAll} indeterminate={isIndeterminate} onChange={handleCheckAllChange}>
Check all
</Checkbox>
<Checkbox.Group options={plainOptions} onChange={handleCheckedCitiesChange} value={checkedvalue} />

<div className="mb-4">
<Button plain>default</Button>
<Button type="primary" plain>
Expand Down
2 changes: 1 addition & 1 deletion packages/camelia/version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
* "当你在使用 pnpm 处理多包依赖时,如果本地包的版本与远程版本完全匹配,
* 则 pnpm 会默认使用本地包覆盖远程包,无论远程包的版本是更新的还是旧的。"
*/
export const version = "1.1.2";
export const version = "1.1.3";
4 changes: 2 additions & 2 deletions packages/components/checkbox/style/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@
border-left: 0;
border-top: 0;
height: 9px;
inset-inline-start: 21.5%;
inset-inline-start: 22.5%;
position: absolute;
top: 50%;
top: 45%;
transform: rotate(45deg) scaleY(0);
width: 5.7px;
transition: transform 0.15s ease-in 0.05s;
Expand Down
2 changes: 1 addition & 1 deletion record.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

```shell

1. 开发组件规范
1. 开发组件规范(看下已经写了的某些组件,如果组件如何写,导出规范,类型文件定义, 样式如何写; 等等)

2. packages目录下的 所有文件夹 和 文件 都是中划线命名法,不要驼峰

Expand Down

0 comments on commit f4af82a

Please sign in to comment.