>(({ defer }) => (
- defer?.reject(new DialogClose())}>
- Dialog
-
-
- A
-
-
-
- B
-
-
-
-
-
-
-
-
-
- ));
-
- someLogic = async () => {
- try {
- const data = await this.inputDialog.open();
-
- alert(JSON.stringify(data, null, 4));
- } catch (error) {
- if (error instanceof DialogClose) console.warn(error.message);
- }
- };
-
- render() {
- return (
- <>
-
-
-
- >
- );
- }
-}
-```
-
-## Development
-
-### Publish
-
-1. update `version` in `package.json` file
-
-2. add Git tag
-
-```shell
-git tag vx.xx.x # such as v2.0.0
-```
-
-3. review tag
-
-```shell
-git tag
-```
-
-4. publish code with tag version
-
-```shell
-git push origin master --tags # push all branches and tags on master
-```
-
-
- TipEdit the Markdown in{' '}
- stories/Introduction.stories.mdx
-
-
-[1]: https://reactjs.org/
-[2]: https://www.typescriptlang.org/
-[3]: https://getbootstrap.com/
-[4]: https://idea2app.github.io/
-[5]: https://mobx.js.org/
-[6]: https://libraries.io/npm/idea-react
-[7]: https://github.com/idea2app/Idea-React/actions/workflows/main.yml
-[8]: https://nodei.co/npm/idea-react/
-[9]: https://idea2app.github.io/React-MobX-Bootstrap-ts/
-[10]: https://github.com/idea2app/React-MobX-Bootstrap-ts/blob/master/src/page/Component.tsx
-[11]: https://next-bootstrap-ts.vercel.app/
-[12]: https://github.com/idea2app/next-bootstrap-ts/blob/main/pages/component.tsx
diff --git a/stories/Loading.stories.ts b/stories/Loading.stories.ts
deleted file mode 100644
index da535da..0000000
--- a/stories/Loading.stories.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-import type { Meta, StoryObj } from '@storybook/react';
-
-import { Loading } from '../source/Loading';
-
-const meta: Meta = {
- title: 'Idea-React/Loading',
- component: Loading,
- tags: ['autodocs']
-};
-
-export default meta;
-
-type Story = StoryObj;
-
-export const Primary: Story = {};
-
-export const CustomChildren: Story = {
- args: {
- children: 'Hi, this is custom content!'
- }
-};
diff --git a/stories/Nameplate.stories.ts b/stories/Nameplate.stories.ts
deleted file mode 100644
index fc122e5..0000000
--- a/stories/Nameplate.stories.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-import type { Meta, StoryObj } from '@storybook/react';
-
-import { Nameplate } from '../source/Nameplate';
-import defaultURL from './assets/default-avatar.png';
-
-// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
-const meta: Meta = {
- title: 'Idea-React/Nameplate',
- component: Nameplate,
- tags: ['autodocs']
-};
-
-export default meta;
-
-type Story = StoryObj;
-
-export const Primary: Story = {
- args: {
- avatar: defaultURL,
- name: 'Alice'
- }
-};
diff --git a/stories/OverlayBox.stories.tsx b/stories/OverlayBox.stories.tsx
deleted file mode 100644
index d55f443..0000000
--- a/stories/OverlayBox.stories.tsx
+++ /dev/null
@@ -1,52 +0,0 @@
-import type { Meta, StoryObj } from '@storybook/react';
-
-import { OverlayBox } from '../source/OverlayBox';
-
-const meta: Meta = {
- title: 'Idea-React/OverlayBox',
- component: OverlayBox,
- tags: ['autodocs']
-};
-
-export default meta;
-
-type Story = StoryObj;
-
-export const Tooltip: Story = {
- render: args => (
-
-
-
- ),
- args: {
- title: 'Tooltip content',
- placement: 'bottom'
- }
-};
-
-export const Popover: Story = {
- render: args => (
-
-
-
- ),
- args: {
- title: 'Popover Title',
- detail: 'This is the content of popover.',
- placement: 'bottom'
- }
-};
-
-export const PopoverClick: Story = {
- render: args => (
-
-
-
- ),
- args: {
- title: 'Popover Title',
- detail: 'This is the content of popover.',
- placement: 'bottom',
- trigger: 'click'
- }
-};
diff --git a/stories/Select.stories.tsx b/stories/Select.stories.tsx
deleted file mode 100644
index 8e7a088..0000000
--- a/stories/Select.stories.tsx
+++ /dev/null
@@ -1,53 +0,0 @@
-import type { Meta, StoryObj } from '@storybook/react';
-import { useState } from 'react';
-
-import { Option, Select } from '../source/Select';
-
-const meta: Meta = {
- title: 'Idea-React/Select',
- component: Select,
- tags: ['autodocs'],
- argTypes: {
- className: { control: 'text' },
- style: { control: 'object' },
- value: { control: 'text' },
- children: { control: 'text' },
- variant: { control: 'text' },
- menuVariant: { control: 'text' }
- }
-};
-
-export default meta;
-
-type Story = StoryObj;
-
-export const Primary: Story = {
- render: ({ value, onChange, ...otherArgs }) => {
- const [selectValue, setValue] = useState(value);
- return (
-
- );
- },
- args: {
- value: '0'
- }
-};
-
-export const Bigger: Story = {
- render: Primary.render,
- args: {
- ...Primary.args,
- className: 'fw-bolder'
- }
-};
diff --git a/stories/SpinnerButton.stories.ts b/stories/SpinnerButton.stories.ts
deleted file mode 100644
index 4b6d485..0000000
--- a/stories/SpinnerButton.stories.ts
+++ /dev/null
@@ -1,49 +0,0 @@
-import type { Meta, StoryObj } from '@storybook/react';
-
-import { SpinnerButton } from '../source/SpinnerButton';
-
-const meta: Meta = {
- title: 'Idea-React/SpinnerButton',
- component: SpinnerButton,
- tags: ['autodocs'],
- argTypes: {
- animation: { control: 'select', options: ['border', 'grow'] },
- disabled: { control: 'boolean' }
- },
- args: {
- animation: 'border'
- }
-};
-
-export default meta;
-
-type Story = StoryObj;
-
-export const Primary: Story = {
- args: {
- children: 'Idea-React',
- onClick: () => console.log('Hello, Idea-React!')
- }
-};
-
-export const Loading: Story = {
- args: {
- ...Primary.args,
- loading: true
- }
-};
-
-export const GrowLoading: Story = {
- args: {
- ...Primary.args,
- animation: 'grow',
- loading: true
- }
-};
-
-export const Disabled: Story = {
- args: {
- ...Primary.args,
- disabled: true
- }
-};
diff --git a/stories/TimeDistance.stories.ts b/stories/TimeDistance.stories.ts
deleted file mode 100644
index dcc4c0c..0000000
--- a/stories/TimeDistance.stories.ts
+++ /dev/null
@@ -1,63 +0,0 @@
-import type { Meta, StoryObj } from '@storybook/react';
-
-import { TimeDistance } from '../source/TimeDistance';
-
-// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
-const meta: Meta = {
- title: 'Idea-React/TimeDistance',
- component: TimeDistance,
- tags: ['autodocs']
-};
-
-export default meta;
-
-type Story = StoryObj;
-
-export const Primary: Story = {
- args: {
- date: '1989-06-04'
- }
-};
-
-export const FutureTime: Story = {
- args: {
- date: '2075-02-19'
- }
-};
-
-export const UnitWords: Story = {
- args: {
- date: '1970-01-01',
- unitWords: {
- ms: '毫秒',
- s: '秒',
- m: '分钟',
- H: '小时',
- D: '天',
- W: '周',
- M: '月',
- Y: '年'
- }
- }
-};
-
-export const BeforeWord: Story = {
- args: {
- date: '1970-01-01',
- beforeWord: ' ago'
- }
-};
-
-export const AfterWord: Story = {
- args: {
- date: '2075-02-19',
- afterWord: ' 后'
- }
-};
-
-export const ClassName: Story = {
- args: {
- date: '2075-02-19',
- className: 'text-danger'
- }
-};
diff --git a/stories/TypeEcho.stories.ts b/stories/TypeEcho.stories.ts
deleted file mode 100644
index 5768d58..0000000
--- a/stories/TypeEcho.stories.ts
+++ /dev/null
@@ -1,40 +0,0 @@
-import type { Meta, StoryObj } from '@storybook/react';
-
-import { TypeEcho } from '../source/TypeEcho';
-
-const meta: Meta = {
- title: 'Idea-React/TypeEcho',
- component: TypeEcho,
- tags: ['autodocs']
-};
-
-export default meta;
-
-type Story = StoryObj;
-
-export const Primary: Story = {
- args: {
- text: 'Welcome to Idea-React!'
- }
-};
-
-export const Slowly: Story = {
- args: {
- ...Primary.args,
- intervals: 500
- }
-};
-
-export const Quickly: Story = {
- args: {
- ...Primary.args,
- intervals: 30
- }
-};
-
-export const WithClass: Story = {
- args: {
- ...Primary.args,
- className: 'text-danger'
- }
-};
diff --git a/stories/assets/default-avatar.png b/stories/assets/default-avatar.png
deleted file mode 100644
index 4d8b9e3..0000000
Binary files a/stories/assets/default-avatar.png and /dev/null differ