onchain-uikit 0.0.3 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/instance.cjs.mjs +366 -0
- package/lib/instance.es.mjs +29301 -0
- package/lib/instance.umd.mjs +366 -0
- package/lib/src/App.d.ts +5 -0
- package/lib/src/components/PlmMosaic/index.d.ts +5 -0
- package/lib/src/index.d.ts +4 -0
- package/lib/src/main.d.ts +0 -0
- package/lib/src/stories/Button.d.ts +14 -0
- package/lib/src/stories/Button.stories.d.ts +23 -0
- package/lib/src/stories/Header.d.ts +11 -0
- package/lib/src/stories/Header.stories.d.ts +18 -0
- package/lib/src/stories/OnChainProvider.d.ts +12 -0
- package/lib/src/stories/Page.d.ts +2 -0
- package/lib/src/stories/Page.stories.d.ts +12 -0
- package/lib/src/stories/PlmMosaic.stories.d.ts +14 -0
- package/lib/src/stories/PlmSelect/PlmSelect.stories.d.ts +21 -0
- package/lib/src/stories/PlmSelect/index.d.ts +20 -0
- package/lib/src/stories/XsButton.d.ts +22 -0
- package/lib/src/stories/XsButton.stories.d.ts +14 -0
- package/lib/src/typings.d.ts +623 -0
- package/lib/src/utils/authority/basicsAuthority.d.ts +22 -0
- package/lib/src/utils/authority/index.d.ts +10 -0
- package/lib/typings.d.ts +130 -0
- package/lib/vite.config.d.ts +2 -0
- package/package.json +25 -5
- package/.storybook/main.ts +0 -16
- package/.storybook/preview.ts +0 -14
- package/dist/index.es.js +0 -634
- package/dist/index.umd.js +0 -30
- package/eslint.config.js +0 -28
- package/index.html +0 -13
- package/public/vite.svg +0 -1
- package/src/App.css +0 -42
- package/src/App.tsx +0 -35
- package/src/assets/react.svg +0 -1
- package/src/index.css +0 -68
- package/src/index.ts +0 -4
- package/src/main.tsx +0 -10
- package/src/stories/Button.stories.ts +0 -53
- package/src/stories/Button.tsx +0 -37
- package/src/stories/Configure.mdx +0 -364
- package/src/stories/Header.stories.ts +0 -33
- package/src/stories/Header.tsx +0 -56
- package/src/stories/Page.stories.ts +0 -32
- package/src/stories/Page.tsx +0 -73
- package/src/stories/XsButton.tsx +0 -7
- package/src/stories/assets/accessibility.png +0 -0
- package/src/stories/assets/accessibility.svg +0 -1
- package/src/stories/assets/addon-library.png +0 -0
- package/src/stories/assets/assets.png +0 -0
- package/src/stories/assets/avif-test-image.avif +0 -0
- package/src/stories/assets/context.png +0 -0
- package/src/stories/assets/discord.svg +0 -1
- package/src/stories/assets/docs.png +0 -0
- package/src/stories/assets/figma-plugin.png +0 -0
- package/src/stories/assets/github.svg +0 -1
- package/src/stories/assets/share.png +0 -0
- package/src/stories/assets/styling.png +0 -0
- package/src/stories/assets/testing.png +0 -0
- package/src/stories/assets/theming.png +0 -0
- package/src/stories/assets/tutorials.svg +0 -1
- package/src/stories/assets/youtube.svg +0 -1
- package/src/stories/button.css +0 -30
- package/src/stories/header.css +0 -32
- package/src/stories/page.css +0 -68
- package/tsconfig.app.json +0 -26
- package/tsconfig.json +0 -7
- package/tsconfig.node.json +0 -94
- package/tsconfig.tsbuildinfo +0 -1
- package/vite.config.ts +0 -33
- /package/{src → lib/src}/vite-env.d.ts +0 -0
- /package/{dist → lib}/vite.svg +0 -0
package/lib/src/App.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
/** vite工程入口,跟storybook无关 */
|
|
3
|
+
export declare function rootContainer(container: any): React.FunctionComponentElement<import('antd/es/config-provider').ConfigProviderProps>;
|
|
4
|
+
declare function App(): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export default App;
|
|
File without changes
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface ButtonProps {
|
|
2
|
+
/** Is this the principal call to action on the page? */
|
|
3
|
+
primary?: boolean;
|
|
4
|
+
/** What background color to use */
|
|
5
|
+
backgroundColor?: string;
|
|
6
|
+
/** How large should the button be? */
|
|
7
|
+
size?: 'small' | 'medium' | 'large';
|
|
8
|
+
/** Button contents */
|
|
9
|
+
label: string;
|
|
10
|
+
/** Optional click handler */
|
|
11
|
+
onClick?: () => void;
|
|
12
|
+
}
|
|
13
|
+
/** Primary UI component for user interaction */
|
|
14
|
+
export declare const Button: ({ primary, size, backgroundColor, label, ...props }: ButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: ({ primary, size, backgroundColor, label, ...props }: import('./Button').ButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
parameters: {
|
|
6
|
+
layout: string;
|
|
7
|
+
};
|
|
8
|
+
tags: string[];
|
|
9
|
+
argTypes: {
|
|
10
|
+
backgroundColor: {
|
|
11
|
+
control: "color";
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
args: {
|
|
15
|
+
onClick: import('@vitest/spy').Mock<(...args: any[]) => any>;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export default meta;
|
|
19
|
+
type Story = StoryObj<typeof meta>;
|
|
20
|
+
export declare const Primary: Story;
|
|
21
|
+
export declare const Secondary: Story;
|
|
22
|
+
export declare const Large: Story;
|
|
23
|
+
export declare const Small: Story;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
type User = {
|
|
2
|
+
name: string;
|
|
3
|
+
};
|
|
4
|
+
export interface HeaderProps {
|
|
5
|
+
user?: User;
|
|
6
|
+
onLogin?: () => void;
|
|
7
|
+
onLogout?: () => void;
|
|
8
|
+
onCreateAccount?: () => void;
|
|
9
|
+
}
|
|
10
|
+
export declare const Header: ({ user, onLogin, onLogout, onCreateAccount }: HeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: ({ user, onLogin, onLogout, onCreateAccount }: import('./Header').HeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
tags: string[];
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: string;
|
|
8
|
+
};
|
|
9
|
+
args: {
|
|
10
|
+
onLogin: import('@vitest/spy').Mock<(...args: any[]) => any>;
|
|
11
|
+
onLogout: import('@vitest/spy').Mock<(...args: any[]) => any>;
|
|
12
|
+
onCreateAccount: import('@vitest/spy').Mock<(...args: any[]) => any>;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export default meta;
|
|
16
|
+
type Story = StoryObj<typeof meta>;
|
|
17
|
+
export declare const LoggedIn: Story;
|
|
18
|
+
export declare const LoggedOut: Story;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Antd Provider
|
|
4
|
+
*/
|
|
5
|
+
export interface OnChainProviderProps {
|
|
6
|
+
/** 设置统一样式前缀 */
|
|
7
|
+
prefixCls?: string;
|
|
8
|
+
/** 内容 */
|
|
9
|
+
children?: React.ReactNode;
|
|
10
|
+
}
|
|
11
|
+
declare const OnChainProvider: ({ prefixCls, ...props }: OnChainProviderProps, ref: any) => React.FunctionComponentElement<import('antd/es/config-provider').ConfigProviderProps>;
|
|
12
|
+
export default OnChainProvider;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: import('react').FC<{}>;
|
|
5
|
+
parameters: {
|
|
6
|
+
layout: string;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
export default meta;
|
|
10
|
+
type Story = StoryObj<typeof meta>;
|
|
11
|
+
export declare const LoggedOut: Story;
|
|
12
|
+
export declare const LoggedIn: Story;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: (props: import('../components/PlmMosaic').PlmMosaicProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
parameters: {
|
|
6
|
+
layout: string;
|
|
7
|
+
};
|
|
8
|
+
tags: string[];
|
|
9
|
+
argTypes: {};
|
|
10
|
+
args: {};
|
|
11
|
+
};
|
|
12
|
+
export default meta;
|
|
13
|
+
type Story = StoryObj<typeof meta>;
|
|
14
|
+
export declare const InLineTrue: Story;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: import('react').ForwardRefExoticComponent<Omit<import('.').PlmSelectProps, "ref"> & import('react').RefAttributes<unknown>>;
|
|
5
|
+
parameters: {
|
|
6
|
+
layout: string;
|
|
7
|
+
};
|
|
8
|
+
tags: string[];
|
|
9
|
+
argTypes: {};
|
|
10
|
+
args: {
|
|
11
|
+
/** 列表值 */
|
|
12
|
+
options: {
|
|
13
|
+
label: string;
|
|
14
|
+
value: string;
|
|
15
|
+
}[];
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export default meta;
|
|
19
|
+
type Story = StoryObj<typeof meta>;
|
|
20
|
+
export declare const Large: Story;
|
|
21
|
+
export declare const Small: Story;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { BaseComponentProps } from '../../typings';
|
|
2
|
+
import { SelectProps } from 'antd';
|
|
3
|
+
export interface PlmSelectProps extends BaseComponentProps, SelectProps<any> {
|
|
4
|
+
pane?: {
|
|
5
|
+
cols?: number;
|
|
6
|
+
item?: BaseComponentProps;
|
|
7
|
+
};
|
|
8
|
+
/** 分页信息 */
|
|
9
|
+
pagination: {
|
|
10
|
+
/**网络请求URL */
|
|
11
|
+
url: string;
|
|
12
|
+
page: number;
|
|
13
|
+
pageSize: number;
|
|
14
|
+
total: number;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export interface PlmSelectForwardRefProps {
|
|
18
|
+
}
|
|
19
|
+
declare const PlmSelect: import('react').ForwardRefExoticComponent<Omit<PlmSelectProps, "ref"> & import('react').RefAttributes<unknown>>;
|
|
20
|
+
export default PlmSelect;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ButtonType } from 'antd/lib/button';
|
|
2
|
+
export interface XsButtonProps {
|
|
3
|
+
/** 按钮文本 */
|
|
4
|
+
label: string;
|
|
5
|
+
/** 按钮类型 */
|
|
6
|
+
btnType?: ButtonType;
|
|
7
|
+
/** 按钮类型2 */
|
|
8
|
+
btnType2?: "default" | "primary" | "ghost" | "dashed" | "link" | "text";
|
|
9
|
+
/** Optional click handler */
|
|
10
|
+
onClick?: () => void;
|
|
11
|
+
/** 自定义对象 */
|
|
12
|
+
custObj?: custObjTemp;
|
|
13
|
+
}
|
|
14
|
+
/** 对象 */
|
|
15
|
+
type custObjTemp = {
|
|
16
|
+
/** 年龄 */
|
|
17
|
+
name?: string;
|
|
18
|
+
/** 姓名 */
|
|
19
|
+
age?: number;
|
|
20
|
+
};
|
|
21
|
+
declare const XsButton: (props: XsButtonProps, ref: any) => import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export default XsButton;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: (props: import('./XsButton').XsButtonProps, ref: any) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
parameters: {
|
|
6
|
+
layout: string;
|
|
7
|
+
};
|
|
8
|
+
tags: string[];
|
|
9
|
+
argTypes: {};
|
|
10
|
+
args: {};
|
|
11
|
+
};
|
|
12
|
+
export default meta;
|
|
13
|
+
type Story = StoryObj<typeof meta>;
|
|
14
|
+
export declare const Init: Story;
|