neko-ui 2.0.1 → 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,7 @@
1
- # Neko UI
2
-
3
- [![version][version-tag]][npm-url]
4
- [![install size][size-tag]][size-url]
5
- [![download][download-tag]][npm-url]
6
-
7
- > 这是一个适用于任何技术栈的 WebComponents UI组件库
8
-
9
- [![neko-ui][install-tag]][npm-url]
10
-
11
- [![docs-ui][docs-tag]][docs-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
13
5
  [docs-url]: https://monako97.github.io/neko-ui
14
6
  [docs-tag]: https://cdn.staticaly.com/gh/monako97/cdn/main/image/202307281701250.svg
15
7
  [npm-url]: https://npmjs.org/package/neko-ui
@@ -19,7 +11,20 @@
19
11
  [size-url]: https://packagephobia.com/result?p=neko-ui@latest
20
12
  [download-tag]: https://img.shields.io/npm/dm/neko-ui.svg?logo=docusign
21
13
 
22
- ## 安装 (npm)
14
+ # Neko UI
15
+
16
+ > 这是一个适用于任何技术栈的 WebComponents UI组件库
17
+
18
+ [![neko-ui][home-tag]][home-url]
19
+ [![docs-ui][docs-tag]][docs-url]
20
+
21
+ [![version][version-tag]][npm-url]
22
+ [![install size][size-tag]][size-url]
23
+ [![download][download-tag]][npm-url]
24
+
25
+ [![neko-ui][install-tag]][npm-url]
26
+
27
+ ## 安装
23
28
 
24
29
  ```shell
25
30
  npm install neko-ui -S
@@ -27,20 +32,23 @@ npm install neko-ui -S
27
32
  yarn add neko-ui -S
28
33
  ```
29
34
 
30
- ### 使用 (npm)
35
+ ### 使用
31
36
 
32
37
  ```html
33
38
  <n-button>按钮</n-button>
34
39
  ```
35
40
 
36
- ## 安装 (umd)
41
+ ## html5 中使用
37
42
 
38
43
  ```html
39
- <script src="https://cdn.staticaly.com/gh/monako97/cdn/main/npm/neko-ui/2.0.1/lib/index.js"></script>
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>
40
50
  ```
41
51
 
42
- ### 使用 (umd)
52
+ ## 感谢
43
53
 
44
- ```html
45
- <n-button>按钮</n-button>
46
- ```
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 {