Skip to content

Commit

Permalink
Merge pull request #5 from BQXBQX/dev-bqx
Browse files Browse the repository at this point in the history
Dev bqx
  • Loading branch information
BQXBQX authored Jan 29, 2024
2 parents 535a95f + 6a216e3 commit 3d0a465
Show file tree
Hide file tree
Showing 18 changed files with 766 additions and 182 deletions.
43 changes: 35 additions & 8 deletions packages/competition/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,42 @@
import { Checkbox, Dialog, Input, Radio, RadioGroup } from "@sast/oj-ui";
import { Button } from "@sast/oj-ui";
import {
Checkbox,
Dialog,
Input,
Radio,
RadioGroup,
Sheet,
SheetTrigger,
SheetHeader,
// SheetTrigger,
} from "@sast/oj-ui";
import { useState } from "react";

function App() {
const test = (value: boolean) => {
console.log(value);
};
const [visible, setVisible] = useState<boolean>(false);

return (
<>
{/* <Input placeholder="" onChange={test}></Input> */}
<Checkbox onChecked={test}></Checkbox>
{/* <RadioGroup direction="vertical" onChange={test} defaultValue="vuejs" /> */}
{/* <Dialog></Dialog> */}
<div style={{ width: "100vw", height: "100vh" }}>
<Button
onClick={() => {
setVisible(true);
}}
>
show sheet
</Button>
<div style={{ height: "200vh" }}></div>
</div>
<Sheet
visible={visible}
onCancel={() => setVisible(false)}
sheetTitle="Hello World"
sheetFooter={
<>
<Button color="tertiary">取消</Button>
</>
}
></Sheet>
</>
);
}
Expand Down
3 changes: 2 additions & 1 deletion packages/ui/lib/Button/Button.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@
border: 1px solid var(--primary-color);
}
&.tertiary {
background-color: var(--white-color);
background-color: #f6f6f6;
color: var(--primary-color);
font-weight: 600;
}
&.danger {
background-color: var(--danger-color);
Expand Down
4 changes: 2 additions & 2 deletions packages/ui/lib/Calendar/Calendar.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
display: grid;
grid-template-columns: repeat(7, 1fr);
column-gap: 5px;
row-gap: 2px;
padding: 3px 10px;
row-gap: 3px;
padding: 5px 10px;
box-sizing: border-box;
justify-items: center;
.calendarItem {
Expand Down
12 changes: 11 additions & 1 deletion packages/ui/lib/Calendar/Calendar.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ import type { Meta, StoryObj } from '@storybook/react';
import React from 'react';
import { Calendar, type CalendarProps } from './Calendar';

const test = (value: Date) => {
console.log('select date', value);
};

const meta = {
title: 'Components/Calendar',
component: Calendar,
Expand All @@ -17,7 +21,11 @@ export default meta;

type Story = StoryObj<typeof meta>;

const defaultProps: CalendarProps = {};
const defaultProps: CalendarProps = {
onChange: function () {},
selected: new Date(),
defaultSelected: new Date(),
};

export const DefaultCalendar: Story = {
args: {
Expand All @@ -28,5 +36,7 @@ export const DefaultCalendar: Story = {
export const ExampleCalendar: Story = {
args: {
...defaultProps,
onChange: test,
selected: new Date(0),
},
};
Loading

0 comments on commit 3d0a465

Please sign in to comment.