Skip to content

Commit

Permalink
v0.0.8
Browse files Browse the repository at this point in the history
  • Loading branch information
drl990114 committed Mar 22, 2024
1 parent d1fd2ab commit 2e743fe
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 18 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zens",
"version": "0.0.7",
"version": "0.0.8",
"description": "MarkFlowy's ui component library.",
"keywords": [],
"homepage": "https://github.com/drl990114/zens#readme",
Expand Down Expand Up @@ -58,7 +58,7 @@
}
},
"dependencies": {
"@ariakit/react": "^0.3.8",
"@ariakit/react": "^0.4.3",
"@babel/runtime": "^7",
"@floating-ui/dom": "^1.0.0",
"classnames": "^2.3.0",
Expand Down
6 changes: 5 additions & 1 deletion src/Button/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,11 @@ const Button: IStyledComponent<'web', ButtonProps> = styled(AkButton).attrs<Butt
}
&[aria-expanded='true'] {
background-color: hsl(204 20% 96%);
background-color: ${(props) =>
darken(
props.btnType === 'primary' ? props.theme.accentColor : props.theme.buttonBgColor,
0.1,
)};
}
&[data-focus-visible] {
Expand Down
19 changes: 19 additions & 0 deletions src/Dialog/demo/basic.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { useState } from 'react';
import { Button, Dialog } from 'zens';

export default () => {
const [open, setOpen] = useState(false);

return (
<div>
<Dialog
title="标题"
open={open}
onClose={() => setOpen(false)}
>
<div>内容</div>
</Dialog>
<Button onClick={() => setOpen(true)}>打开</Button>
</div>
);
};
17 changes: 17 additions & 0 deletions src/Dialog/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
title: Dialog 弹窗
nav:
title: 组件
order: 2
group:
title: 反馈
order: 1
---

# Dialog 弹窗

弹窗。

### 基本用法

<code src="./demo/basic.tsx"></code>
3 changes: 2 additions & 1 deletion src/Menu/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { MenuProps as AkMenuProps } from '@ariakit/react';
import { MenuButton, MenuButtonArrow, MenuItem, MenuProvider, useMenuStore } from '@ariakit/react';
import { MenuWrapper } from './MenuWrapper';
import Button from '../Button';

export { useMenuStore };

Expand Down Expand Up @@ -67,7 +68,7 @@ const Menu = (props: MenuProps) => {

return (
<MenuProvider>
{children ? <MenuButton className={triggerBtnClass}>{children}</MenuButton> : null}
{children ? <MenuButton render={p => <Button {...p} />} className={triggerBtnClass}>{children}</MenuButton> : null}
<MenuWrapper style={style} open={open} {...rest}>
{renderItems(items)}
</MenuWrapper>
Expand Down
28 changes: 14 additions & 14 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -38,26 +38,26 @@
resolved "https://registry.yarnpkg.com/@antfu/utils/-/utils-0.7.7.tgz#26ea493a831b4f3a85475e7157be02fb4eab51fb"
integrity sha512-gFPqTG7otEJ8uP6wrhDv6mqwGWYZKNvAcCq6u9hOj0c+IKCEsY4L1oC9trPq2SaWIzAfHvqfBDxF591JkMf+kg==

"@ariakit/core@0.3.11":
version "0.3.11"
resolved "https://registry.yarnpkg.com/@ariakit/core/-/core-0.3.11.tgz#afb4afe5a7da1f29dae9c3b49cba7724930f05b7"
integrity sha512-+MnOeqnA4FLI/7vqsZLbZQHHN4ofd9kvkNjz44fNi0gqmD+ZbMWiDkFAvZII75dYnxYw5ZPpWjA4waK22VBWig==
"@ariakit/core@0.4.4":
version "0.4.4"
resolved "https://registry.yarnpkg.com/@ariakit/core/-/core-0.4.4.tgz#ae50a452300f6e81607db5d3d814e18f73e1161e"
integrity sha512-ig/P1ymKaQU5MxtXRbeB5rHj87UhiwOViTtbpt2ey6v+NqWPG4+VY1RozT9xWI4dw5i+4Cf3vPd2Wgjv5whP9g==

"@ariakit/react-core@0.3.14":
version "0.3.14"
resolved "https://registry.yarnpkg.com/@ariakit/react-core/-/react-core-0.3.14.tgz#4f1a7cb5cdbbe00673deafe33a515afe5bf994c7"
integrity sha512-16Qj6kDPglpdWtU5roY9q+G66naOjauTY5HvUIaL2aLY0187ATaRrABIKoMMzTtJyhvsud4jFlzivz+/zCQ8yw==
"@ariakit/react-core@0.4.4":
version "0.4.4"
resolved "https://registry.yarnpkg.com/@ariakit/react-core/-/react-core-0.4.4.tgz#24ce7471ea8b8cf9bd9c756f725949c42293f5e9"
integrity sha512-17adQvlRw/996/fmaHfsAiaYh8244BF8AgjZPVsTlxA9oXNunVzaEpmtgZ1XLdq1Tc10cIsZEsWup3vQ/6Ak0A==
dependencies:
"@ariakit/core" "0.3.11"
"@ariakit/core" "0.4.4"
"@floating-ui/dom" "^1.0.0"
use-sync-external-store "^1.2.0"

"@ariakit/react@^0.3.8":
version "0.3.14"
resolved "https://registry.yarnpkg.com/@ariakit/react/-/react-0.3.14.tgz#39ed0331148fb3e7a163cc731f1e8cbdb09abf21"
integrity sha512-h71BPMZ2eW+E2ESbdYxSAEMR1DozYzd5eHE5IOzGd9Egi5u7EZxqmuW4CXVXZ1Y6vbaDMV3SudgPh7iHS/ArFw==
"@ariakit/react@^0.4.3":
version "0.4.4"
resolved "https://registry.yarnpkg.com/@ariakit/react/-/react-0.4.4.tgz#078919e2b470176a7cc4c1bb54c02c140a952dd1"
integrity sha512-pqIPJFsrQrUkX8ogm2TVfudPO4RnRgd6X3y5g0QPXipL3L7RlR6MQptgLAq2FnDGMvTvQPFSlvBoza5YvQG3NQ==
dependencies:
"@ariakit/react-core" "0.3.14"
"@ariakit/react-core" "0.4.4"

"@babel/code-frame@7.12.11":
version "7.12.11"
Expand Down

0 comments on commit 2e743fe

Please sign in to comment.