neko-ui 2.0.0 → 2.0.2

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/README.md CHANGED
@@ -1,15 +1,9 @@
1
- # Neko UI
2
-
3
- > UI组件库
4
-
5
- [![version][version-tag]][npm-url]
6
- [![install size][size-tag]][size-url]
7
- [![download][download-tag]][npm-url]
8
-
9
- ## 使用
10
-
11
- [![neko-ui][install-tag]][npm-url]
12
-
1
+ [home-url]: https://monako97.github.io/neko-ui
2
+ [home-tag]: https://cdn.staticaly.com/gh/monako97/cdn/main/image/202307281703208.svg
3
+ [jetbrains-tag]: https://cdn.staticaly.com/gh/monako97/cdn/main/image/202307281758090.svg
4
+ [jetbrains-url]: https://www.jetbrains.com/?from=monako
5
+ [docs-url]: https://monako97.github.io/neko-ui
6
+ [docs-tag]: https://cdn.staticaly.com/gh/monako97/cdn/main/image/202307281701250.svg
13
7
  [npm-url]: https://npmjs.org/package/neko-ui
14
8
  [install-tag]: https://nodei.co/npm/neko-ui.png
15
9
  [version-tag]: https://img.shields.io/npm/v/neko-ui/latest.svg?logo=npm
@@ -17,40 +11,44 @@
17
11
  [size-url]: https://packagephobia.com/result?p=neko-ui@latest
18
12
  [download-tag]: https://img.shields.io/npm/dm/neko-ui.svg?logo=docusign
19
13
 
20
- > 这是一个适用于任何技术栈的 WebComponents 组件库
14
+ # Neko UI
21
15
 
22
- ## 安装依赖
16
+ > 这是一个适用于任何技术栈的 WebComponents UI组件库
23
17
 
24
- ```shell
25
- npm install
26
- # or
27
- yarn install
28
- ```
18
+ [![neko-ui][home-tag]][home-url]
19
+ [![docs-ui][docs-tag]][docs-url]
29
20
 
30
- ## 启动项目
21
+ [![version][version-tag]][npm-url]
22
+ [![install size][size-tag]][size-url]
23
+ [![download][download-tag]][npm-url]
31
24
 
32
- ```shell
33
- npm start
34
- # or
35
- yarn start
36
- ```
25
+ [![neko-ui][install-tag]][npm-url]
37
26
 
38
- ## 打包项目
27
+ ## 安装
39
28
 
40
29
  ```shell
41
- npm run build
30
+ npm install neko-ui -S
42
31
  # or
43
- yarn build
32
+ yarn add neko-ui -S
44
33
  ```
45
34
 
46
- ## 打包项目`使用自定义配置`
35
+ ### 使用
47
36
 
48
- > 在打包其它有特殊配置的bundle时, 可以通过命令行参数来加载额外的配置文件;
37
+ ```html
38
+ <n-button>按钮</n-button>
39
+ ```
49
40
 
50
- 例如: 使用 **config/index.ts** 与 **config/prod.ts** 合并后的配置进行编译.
41
+ ## html5 中使用
51
42
 
52
- ```shell
53
- npm run build --config=prod
54
- # or
55
- yarn build config=prod
43
+ ```html
44
+ <!-- 引入 CDN 资源 -->
45
+ <script src="https://cdn.jsdelivr.net/npm/neko-ui@2.0.1/lib/index.js"></script>
46
+ <!-- 使用 -->
47
+ <body>
48
+ <n-button>按钮</n-button>
49
+ </body>
56
50
  ```
51
+
52
+ ## 感谢
53
+
54
+ [![jetbrains][jetbrains-tag]][jetbrains-url]
@@ -1,6 +1,6 @@
1
1
  import { type JSX } from 'solid-js';
2
2
  import '../popover';
3
- import type { BasicConfig, CustomElement } from '..';
3
+ import type { BasicConfig } from '..';
4
4
  import type { AvatarProps } from '../avatar';
5
5
  export interface AvatarGroupProps extends Omit<JSX.ButtonHTMLAttributes<HTMLDivElement>, 'onChange' | 'ref'> {
6
6
  /** 头像数据 */
@@ -1,5 +1,5 @@
1
1
  import { type JSX } from 'solid-js';
2
- import type { BasicConfig, CustomElement } from '../index';
2
+ import type { BasicConfig } from '../index';
3
3
  export interface AvatarProps extends Omit<JSX.ButtonHTMLAttributes<HTMLDivElement>, 'onChange' | 'ref' | 'children'> {
4
4
  /** 头像 */
5
5
  src?: string;
@@ -1,5 +1,4 @@
1
1
  import { type JSX } from 'solid-js';
2
- import type { CustomElement } from '..';
3
2
  export interface BackTopProps extends Omit<JSX.ButtonHTMLAttributes<HTMLDivElement>, 'onChange'> {
4
3
  /** 设置需要监听其滚动事件的元素
5
4
  * @default window
@@ -1,5 +1,4 @@
1
1
  import type { JSXElement } from 'solid-js';
2
- import type { ICustomElement } from 'component-register';
3
2
  export interface BasicConfig {
4
3
  /** 组件状态
5
4
  * @default 'normal'
@@ -71,20 +70,3 @@ export declare enum FieldName {
71
70
  /** 后缀图标 */
72
71
  suffix = "suffix"
73
72
  }
74
- type IEvent<T> = (e: CustomEvent<T>) => void;
75
- type ICustomEvent<T, K extends keyof T> = T extends {
76
- [key in K]?: (v: infer V) => void;
77
- } ? IEvent<V> : T extends {
78
- [key in K]?: (...args: infer Args) => void;
79
- } ? IEvent<Args> : never;
80
- type IOmit<T, Keys extends keyof T> = Omit<T, Keys> & {
81
- [K in Keys]?: ICustomEvent<T, K>;
82
- };
83
- export type CustomElement<T extends Partial<ICustomElement> = ICustomElement> = IOmit<T, 'onChange' | 'onOpenChange' | 'onErrorRecorder' | 'onStopRecorder' | 'onStartRecorder' | 'onRecorderDataAvailable' | 'onErrorCapture' | 'onStopCapture' | 'onStartCapture' | 'onSaveRecorder'> & {
84
- ref?: CustomElement<T> | {
85
- current: CustomElement<T> | null;
86
- };
87
- shadowRoot?: ShadowRoot | Element | null;
88
- offsetWidth?: number;
89
- };
90
- export {};
@@ -1,5 +1,5 @@
1
1
  import { type JSX } from 'solid-js';
2
- import type { BasicConfig, CustomElement } from '../index';
2
+ import type { BasicConfig } from '../index';
3
3
  export interface ButtonProps extends Omit<JSX.ButtonHTMLAttributes<HTMLButtonElement>, 'type' | 'ref'> {
4
4
  /** 自定义类名 */
5
5
  class?: string;
@@ -1,5 +1,4 @@
1
1
  import { type JSX } from 'solid-js';
2
- import type { CustomElement } from '../index';
3
2
  declare interface MediaRecorderDataAvailableEvent extends Event {
4
3
  /** MediaRecorderDataAvailableEvent */
5
4
  data: any;
@@ -1,5 +1,4 @@
1
1
  import { type JSXElement } from 'solid-js';
2
- import type { CustomElement } from '../index';
3
2
  export interface CarouselProps {
4
3
  /** 自定义类名 */
5
4
  class?: string;
@@ -1,4 +1,4 @@
1
- import { type BaseOption, type BasicConfig, type CustomElement } from '../basic-config';
1
+ import { type BaseOption, type BasicConfig } from '../basic-config';
2
2
  /** 通用API
3
3
  * @since 1.0.0
4
4
  */
@@ -1,5 +1,4 @@
1
1
  import { type JSX } from 'solid-js';
2
- import type { CustomElement } from '..';
3
2
  export interface CodeProps extends Omit<JSX.HTMLAttributes<HTMLDivElement>, 'onChange'> {
4
3
  /** 自定义类名 */
5
4
  class?: string;
@@ -2,7 +2,6 @@ import { type JSX } from 'solid-js';
2
2
  import '../dropdown';
3
3
  import '../input';
4
4
  import '../input-number';
5
- import type { CustomElement } from '../index';
6
5
  export interface ColorPaletteProps extends Omit<JSX.HTMLAttributes<HTMLDivElement>, 'onChange'> {
7
6
  /** 自定义类名 */
8
7
  class?: string;
@@ -1,5 +1,5 @@
1
1
  import { type ColorPaletteProps } from '../color-palette';
2
- import type { BasicConfig, CustomElement, PopoverProps } from '../index';
2
+ import type { BasicConfig, PopoverProps } from '../index';
3
3
  /** 颜色选择器
4
4
  * @since 2.0.0
5
5
  */
@@ -1,5 +1,4 @@
1
1
  import { type JSX } from 'solid-js';
2
- import type { CustomElement } from '../index';
3
2
  export interface CronProps extends Omit<JSX.HTMLAttributes<HTMLDivElement>, 'onChange'> {
4
3
  /** 隐藏域 */
5
4
  exclude?: string[];
@@ -1,2 +1,3 @@
1
1
  export declare const selectPortalCss: string;
2
2
  export declare const selectCss: string;
3
+ export declare const numCss: string;
@@ -1,4 +1,4 @@
1
- import type { CustomElement, MenuMultipleProps, MenuProps, PopoverProps } from '..';
1
+ import type { MenuMultipleProps, MenuProps, PopoverProps } from '..';
2
2
  export interface BaseDropdownProps extends Omit<PopoverProps, 'content'> {
3
3
  /** 打开内容气泡 */
4
4
  open?: boolean | null;
@@ -1,5 +1,4 @@
1
1
  import { type JSX } from 'solid-js';
2
- import type { CustomElement } from '..';
3
2
  export interface EmptyProps extends JSX.HTMLAttributes<HTMLDivElement> {
4
3
  /** 自定义样式表 */
5
4
  css?: string;
@@ -1,5 +1,4 @@
1
1
  import { type JSX } from 'solid-js';
2
- import type { CustomElement } from '..';
3
2
  export type HighlightTextJson = {
4
3
  highlight?: boolean;
5
4
  text: string;
@@ -1,4 +1,3 @@
1
- import type { CustomElement } from '..';
2
1
  export interface ImgProps {
3
2
  /** 图片地址 */
4
3
  src?: string;
package/lib/index.d.ts CHANGED
@@ -32,13 +32,9 @@ export { default as Tag, type TagProps, type TagElement } from './tag';
32
32
  export { default as Menu, type MenuProps, type MenuMultipleProps, type MenuElement, type MenuMultipleElement, type MenuOption, } from './menu';
33
33
  export { default as Cron, type CronProps, type CronElement } from './cron';
34
34
  export { theme, setTheme, generateTheme, baseStyle, toneColor, type ThemeOption, ColorScheme, } from './theme';
35
- export { FieldName, Size, Status, type BasicConfig, type BaseOption, type CustomElement, } from './basic-config';
35
+ export { FieldName, Size, Status, type BasicConfig, type BaseOption } from './basic-config';
36
36
  export { default as fromSchema } from './from-schema';
37
- import type { ICustomElement } from 'component-register';
38
37
  import type { AvatarElement, AvatarGroupElement, BackTopElement, ButtonElement, CaptureScreenElement, CarouselElement, CheckboxBoolElement, CheckboxGroupElement, CodeElement, ColorPaletteElement, ColorPickerElement, CronElement, DropdownElement, DropdownMultipleElement, EmptyElement, HighlightTextElement, ImgElement, InputElement, InputNumberElement, MdElement, MenuElement, MenuMultipleElement, PopoverElement, RadioElement, SegmentedElement, SelectElement, SelectMultipleElement, SkeletonElement, SpinElement, SwitchElement, TabsElement, TagElement, TreeElement, TreeMultipleElement, TreeMultipleSchemaElement, TreeMultipleStringElement, TreeSchemaElement, TreeStringElement, TypographyElement } from 'neko-ui';
39
- export interface ComponentOptions<T> {
40
- element: T & ICustomElement;
41
- }
42
38
  interface CustomElementTags {
43
39
  'n-avatar': AvatarElement;
44
40
  'n-avatar-group': AvatarGroupElement;
@@ -81,7 +77,7 @@ declare module 'solid-js' {
81
77
  }
82
78
  declare global {
83
79
  export namespace JSX {
84
- interface IntrinsicElements extends CustomElementTags, CustomElementTags {
80
+ interface IntrinsicElements extends CustomElementTags {
85
81
  }
86
82
  }
87
83
  interface HTMLElementTagNameMap extends CustomElementTags {