weifuwu 0.36.2 → 0.37.0

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.
Files changed (45) hide show
  1. package/README.md +97 -3
  2. package/dist/client/app.d.ts +4 -7
  3. package/dist/client/i18n.d.ts +27 -0
  4. package/dist/client/index.d.ts +4 -0
  5. package/dist/client/index.js +171 -54
  6. package/dist/client/locale/en_US.d.ts +38 -0
  7. package/dist/client/locale/zh_CN.d.ts +38 -0
  8. package/dist/components/Accordion/Accordion.d.ts +11 -0
  9. package/dist/components/Alert/Alert.d.ts +9 -0
  10. package/dist/components/Avatar/Avatar.d.ts +7 -0
  11. package/dist/components/Badge/Badge.d.ts +8 -0
  12. package/dist/components/Breadcrumb/Breadcrumb.d.ts +9 -0
  13. package/dist/components/Button/Button.d.ts +12 -0
  14. package/dist/components/Card/Card.d.ts +9 -0
  15. package/dist/components/Checkbox/Checkbox.d.ts +8 -0
  16. package/dist/components/Divider/Divider.d.ts +6 -0
  17. package/dist/components/Drawer/Drawer.d.ts +11 -0
  18. package/dist/components/Dropdown/Dropdown.d.ts +14 -0
  19. package/dist/components/EmptyState/EmptyState.d.ts +8 -0
  20. package/dist/components/Field/Field.d.ts +9 -0
  21. package/dist/components/FileUpload/FileUpload.d.ts +13 -0
  22. package/dist/components/Form/Form.d.ts +6 -0
  23. package/dist/components/Input/Input.d.ts +15 -0
  24. package/dist/components/Loading/Loading.d.ts +5 -0
  25. package/dist/components/Modal/Modal.d.ts +9 -0
  26. package/dist/components/PageHeader/PageHeader.d.ts +7 -0
  27. package/dist/components/Pagination/Pagination.d.ts +8 -0
  28. package/dist/components/ProgressBar/ProgressBar.d.ts +8 -0
  29. package/dist/components/RadioGroup/RadioGroup.d.ts +14 -0
  30. package/dist/components/SearchInput/SearchInput.d.ts +8 -0
  31. package/dist/components/Select/Select.d.ts +18 -0
  32. package/dist/components/Slider/Slider.d.ts +10 -0
  33. package/dist/components/StatCard/StatCard.d.ts +9 -0
  34. package/dist/components/Steps/Steps.d.ts +12 -0
  35. package/dist/components/Switch/Switch.d.ts +8 -0
  36. package/dist/components/Table/Table.d.ts +13 -0
  37. package/dist/components/Tabs/Tabs.d.ts +12 -0
  38. package/dist/components/Tag/Tag.d.ts +8 -0
  39. package/dist/components/Textarea/Textarea.d.ts +13 -0
  40. package/dist/components/Toast/Toast.d.ts +12 -0
  41. package/dist/components/Tooltip/Tooltip.d.ts +9 -0
  42. package/dist/components/index.d.ts +75 -0
  43. package/dist/components/index.js +887 -0
  44. package/dist/components/style.css +1779 -0
  45. package/package.json +7 -2
@@ -0,0 +1,11 @@
1
+ import type { Component } from '../../client/vnode.ts';
2
+ export type DrawerPosition = 'left' | 'right';
3
+ export interface DrawerProps {
4
+ open?: boolean;
5
+ title?: string;
6
+ position?: DrawerPosition;
7
+ onClose?: () => void;
8
+ children?: any;
9
+ footer?: any;
10
+ }
11
+ export declare const Drawer: Component<DrawerProps>;
@@ -0,0 +1,14 @@
1
+ import type { Component } from '../../client/vnode.ts';
2
+ export interface DropdownItem {
3
+ label: string;
4
+ value?: string;
5
+ disabled?: boolean;
6
+ variant?: 'default' | 'danger';
7
+ onClick?: () => void;
8
+ }
9
+ export interface DropdownProps {
10
+ trigger: any;
11
+ items?: DropdownItem[];
12
+ open?: boolean;
13
+ }
14
+ export declare const Dropdown: Component<DropdownProps>;
@@ -0,0 +1,8 @@
1
+ import type { Component } from '../../client/vnode.ts';
2
+ export interface EmptyStateProps {
3
+ icon?: string;
4
+ text?: string;
5
+ hint?: string;
6
+ children?: any;
7
+ }
8
+ export declare const EmptyState: Component<EmptyStateProps>;
@@ -0,0 +1,9 @@
1
+ import type { Component } from '../../client/vnode.ts';
2
+ export interface FieldProps {
3
+ label?: string;
4
+ required?: boolean;
5
+ error?: string;
6
+ hint?: string;
7
+ children?: any;
8
+ }
9
+ export declare const Field: Component<FieldProps>;
@@ -0,0 +1,13 @@
1
+ import type { Component } from '../../client/vnode.ts';
2
+ export interface FileUploadProps {
3
+ accept?: string;
4
+ multiple?: boolean;
5
+ maxSize?: number;
6
+ disabled?: boolean;
7
+ error?: string;
8
+ hint?: string;
9
+ value?: File[];
10
+ onChange?: (files: File[]) => void;
11
+ children?: any;
12
+ }
13
+ export declare const FileUpload: Component<FileUploadProps>;
@@ -0,0 +1,6 @@
1
+ import type { Component } from '../../client/vnode.ts';
2
+ export interface FormProps {
3
+ onSubmit?: () => void | Promise<void>;
4
+ children?: any;
5
+ }
6
+ export declare const Form: Component<FormProps>;
@@ -0,0 +1,15 @@
1
+ import type { Component } from '../../client/vnode.ts';
2
+ export interface InputProps {
3
+ label?: string;
4
+ type?: 'text' | 'email' | 'password' | 'number' | 'url';
5
+ value?: string;
6
+ placeholder?: string;
7
+ required?: boolean;
8
+ disabled?: boolean;
9
+ error?: string;
10
+ hint?: string;
11
+ showStepper?: boolean;
12
+ onInput?: (e: Event) => void;
13
+ onChange?: (e: Event) => void;
14
+ }
15
+ export declare const Input: Component<InputProps>;
@@ -0,0 +1,5 @@
1
+ import type { Component } from '../../client/vnode.ts';
2
+ export interface LoadingProps {
3
+ text?: string;
4
+ }
5
+ export declare const Loading: Component<LoadingProps>;
@@ -0,0 +1,9 @@
1
+ import type { Component } from '../../client/vnode.ts';
2
+ export interface ModalProps {
3
+ open?: boolean;
4
+ title?: string;
5
+ onClose?: () => void;
6
+ children?: any;
7
+ footer?: any;
8
+ }
9
+ export declare const Modal: Component<ModalProps>;
@@ -0,0 +1,7 @@
1
+ import type { Component } from '../../client/vnode.ts';
2
+ export interface PageHeaderProps {
3
+ title: string;
4
+ sub?: string;
5
+ children?: any;
6
+ }
7
+ export declare const PageHeader: Component<PageHeaderProps>;
@@ -0,0 +1,8 @@
1
+ import type { Component } from '../../client/vnode.ts';
2
+ export interface PaginationProps {
3
+ total: number;
4
+ page?: number;
5
+ pageSize?: number;
6
+ onChange?: (page: number) => void;
7
+ }
8
+ export declare const Pagination: Component<PaginationProps>;
@@ -0,0 +1,8 @@
1
+ import type { Component } from '../../client/vnode.ts';
2
+ export interface ProgressBarProps {
3
+ value?: number;
4
+ max?: number;
5
+ label?: string;
6
+ showValue?: boolean;
7
+ }
8
+ export declare const ProgressBar: Component<ProgressBarProps>;
@@ -0,0 +1,14 @@
1
+ import type { Component } from '../../client/vnode.ts';
2
+ export interface RadioOption {
3
+ value: string;
4
+ label: string;
5
+ disabled?: boolean;
6
+ }
7
+ export interface RadioGroupProps {
8
+ name?: string;
9
+ value?: string;
10
+ options?: RadioOption[];
11
+ inline?: boolean;
12
+ onChange?: (value: string) => void;
13
+ }
14
+ export declare const RadioGroup: Component<RadioGroupProps>;
@@ -0,0 +1,8 @@
1
+ import type { Component } from '../../client/vnode.ts';
2
+ export interface SearchInputProps {
3
+ value?: string;
4
+ placeholder?: string;
5
+ onInput?: (e: Event) => void;
6
+ onClear?: () => void;
7
+ }
8
+ export declare const SearchInput: Component<SearchInputProps>;
@@ -0,0 +1,18 @@
1
+ import type { Component } from '../../client/vnode.ts';
2
+ export interface SelectOption {
3
+ value: string;
4
+ label: string;
5
+ disabled?: boolean;
6
+ }
7
+ export interface SelectProps {
8
+ label?: string;
9
+ value?: string;
10
+ options?: SelectOption[];
11
+ placeholder?: string;
12
+ required?: boolean;
13
+ disabled?: boolean;
14
+ error?: string;
15
+ onChange?: (e: Event) => void;
16
+ children?: any;
17
+ }
18
+ export declare const Select: Component<SelectProps>;
@@ -0,0 +1,10 @@
1
+ import type { Component } from '../../client/vnode.ts';
2
+ export interface SliderProps {
3
+ label?: string;
4
+ value?: number | string;
5
+ min?: number;
6
+ max?: number;
7
+ step?: number;
8
+ onChange?: (value: number) => void;
9
+ }
10
+ export declare const Slider: Component<SliderProps>;
@@ -0,0 +1,9 @@
1
+ import type { Component } from '../../client/vnode.ts';
2
+ export interface StatCardProps {
3
+ label: string;
4
+ value: string | number;
5
+ trend?: 'up' | 'down';
6
+ trendLabel?: string;
7
+ icon?: string;
8
+ }
9
+ export declare const StatCard: Component<StatCardProps>;
@@ -0,0 +1,12 @@
1
+ import type { Component } from '../../client/vnode.ts';
2
+ export interface StepItem {
3
+ key: string;
4
+ label: string;
5
+ description?: string;
6
+ }
7
+ export interface StepsProps {
8
+ items?: StepItem[];
9
+ active?: string;
10
+ current?: number;
11
+ }
12
+ export declare const Steps: Component<StepsProps>;
@@ -0,0 +1,8 @@
1
+ import type { Component } from '../../client/vnode.ts';
2
+ export interface SwitchProps {
3
+ label?: string;
4
+ checked?: boolean;
5
+ disabled?: boolean;
6
+ onChange?: (checked: boolean) => void;
7
+ }
8
+ export declare const Switch: Component<SwitchProps>;
@@ -0,0 +1,13 @@
1
+ import type { Component } from '../../client/vnode.ts';
2
+ export interface TableColumn {
3
+ key: string;
4
+ label: string;
5
+ width?: number | string;
6
+ render?: (value: any, row: any, index: number) => any;
7
+ }
8
+ export interface TableProps {
9
+ data?: any[];
10
+ columns: TableColumn[];
11
+ onRowClick?: (row: any, index: number) => void;
12
+ }
13
+ export declare const Table: Component<TableProps>;
@@ -0,0 +1,12 @@
1
+ import type { Component } from '../../client/vnode.ts';
2
+ export interface TabItem {
3
+ key: string;
4
+ label: string;
5
+ content?: any;
6
+ }
7
+ export interface TabsProps {
8
+ items?: TabItem[];
9
+ active?: string;
10
+ onChange?: (key: string) => void;
11
+ }
12
+ export declare const Tabs: Component<TabsProps>;
@@ -0,0 +1,8 @@
1
+ import type { Component } from '../../client/vnode.ts';
2
+ export interface TagProps {
3
+ closable?: boolean;
4
+ onClose?: () => void;
5
+ variant?: 'default' | 'primary' | 'success' | 'danger';
6
+ children?: any;
7
+ }
8
+ export declare const Tag: Component<TagProps>;
@@ -0,0 +1,13 @@
1
+ import type { Component } from '../../client/vnode.ts';
2
+ export interface TextareaProps {
3
+ label?: string;
4
+ value?: string;
5
+ placeholder?: string;
6
+ required?: boolean;
7
+ disabled?: boolean;
8
+ error?: string;
9
+ hint?: string;
10
+ rows?: number;
11
+ onInput?: (e: Event) => void;
12
+ }
13
+ export declare const Textarea: Component<TextareaProps>;
@@ -0,0 +1,12 @@
1
+ import type { Component } from '../../client/vnode.ts';
2
+ export type ToastType = 'success' | 'error' | 'info' | 'warning';
3
+ export interface ToastItem {
4
+ id: string;
5
+ type: ToastType;
6
+ message: string;
7
+ }
8
+ export interface ToastProps {
9
+ toasts?: ToastItem[];
10
+ onRemove?: (id: string) => void;
11
+ }
12
+ export declare const Toast: Component<ToastProps>;
@@ -0,0 +1,9 @@
1
+ import type { Component } from '../../client/vnode.ts';
2
+ export type TooltipPosition = 'top' | 'bottom' | 'left' | 'right';
3
+ export interface TooltipProps {
4
+ content: string;
5
+ position?: TooltipPosition;
6
+ children: any;
7
+ disabled?: boolean;
8
+ }
9
+ export declare const Tooltip: Component<TooltipProps>;
@@ -0,0 +1,75 @@
1
+ /**
2
+ * weifuwu/components — HTML 原语
3
+ *
4
+ * 使用方式:
5
+ * import { Button, Input } from 'weifuwu/components'
6
+ * import 'weifuwu/components/style.css'
7
+ */
8
+ export { Button } from './Button/Button.ts';
9
+ export type { ButtonProps } from './Button/Button.ts';
10
+ export { Input } from './Input/Input.ts';
11
+ export type { InputProps } from './Input/Input.ts';
12
+ export { Textarea } from './Textarea/Textarea.ts';
13
+ export type { TextareaProps } from './Textarea/Textarea.ts';
14
+ export { Select } from './Select/Select.ts';
15
+ export type { SelectProps, SelectOption } from './Select/Select.ts';
16
+ export { Checkbox } from './Checkbox/Checkbox.ts';
17
+ export type { CheckboxProps } from './Checkbox/Checkbox.ts';
18
+ export { Switch } from './Switch/Switch.ts';
19
+ export type { SwitchProps } from './Switch/Switch.ts';
20
+ export { RadioGroup } from './RadioGroup/RadioGroup.ts';
21
+ export type { RadioGroupProps, RadioOption } from './RadioGroup/RadioGroup.ts';
22
+ export { Table } from './Table/Table.ts';
23
+ export type { TableProps, TableColumn } from './Table/Table.ts';
24
+ export { Modal } from './Modal/Modal.ts';
25
+ export type { ModalProps } from './Modal/Modal.ts';
26
+ export { Toast } from './Toast/Toast.ts';
27
+ export type { ToastProps, ToastItem, ToastType } from './Toast/Toast.ts';
28
+ export { Alert } from './Alert/Alert.ts';
29
+ export type { AlertProps, AlertVariant } from './Alert/Alert.ts';
30
+ export { Loading } from './Loading/Loading.ts';
31
+ export type { LoadingProps } from './Loading/Loading.ts';
32
+ export { EmptyState } from './EmptyState/EmptyState.ts';
33
+ export type { EmptyStateProps } from './EmptyState/EmptyState.ts';
34
+ export { Tabs } from './Tabs/Tabs.ts';
35
+ export type { TabsProps, TabItem } from './Tabs/Tabs.ts';
36
+ export { Dropdown } from './Dropdown/Dropdown.ts';
37
+ export type { DropdownProps, DropdownItem } from './Dropdown/Dropdown.ts';
38
+ export { Pagination } from './Pagination/Pagination.ts';
39
+ export type { PaginationProps } from './Pagination/Pagination.ts';
40
+ export { Card } from './Card/Card.ts';
41
+ export type { CardProps } from './Card/Card.ts';
42
+ export { Badge } from './Badge/Badge.ts';
43
+ export type { BadgeProps, BadgeVariant } from './Badge/Badge.ts';
44
+ export { Avatar } from './Avatar/Avatar.ts';
45
+ export type { AvatarProps } from './Avatar/Avatar.ts';
46
+ export { Tag } from './Tag/Tag.ts';
47
+ export type { TagProps } from './Tag/Tag.ts';
48
+ export { StatCard } from './StatCard/StatCard.ts';
49
+ export type { StatCardProps } from './StatCard/StatCard.ts';
50
+ export { Steps } from './Steps/Steps.ts';
51
+ export type { StepsProps, StepItem } from './Steps/Steps.ts';
52
+ export { Form } from './Form/Form.ts';
53
+ export type { FormProps } from './Form/Form.ts';
54
+ export { Field } from './Field/Field.ts';
55
+ export type { FieldProps } from './Field/Field.ts';
56
+ export { Slider } from './Slider/Slider.ts';
57
+ export type { SliderProps } from './Slider/Slider.ts';
58
+ export { SearchInput } from './SearchInput/SearchInput.ts';
59
+ export type { SearchInputProps } from './SearchInput/SearchInput.ts';
60
+ export { ProgressBar } from './ProgressBar/ProgressBar.ts';
61
+ export type { ProgressBarProps } from './ProgressBar/ProgressBar.ts';
62
+ export { Accordion } from './Accordion/Accordion.ts';
63
+ export type { AccordionProps, AccordionItem } from './Accordion/Accordion.ts';
64
+ export { PageHeader } from './PageHeader/PageHeader.ts';
65
+ export type { PageHeaderProps } from './PageHeader/PageHeader.ts';
66
+ export { Breadcrumb } from './Breadcrumb/Breadcrumb.ts';
67
+ export type { BreadcrumbProps, BreadcrumbItem } from './Breadcrumb/Breadcrumb.ts';
68
+ export { Divider } from './Divider/Divider.ts';
69
+ export type { DividerProps } from './Divider/Divider.ts';
70
+ export { FileUpload } from './FileUpload/FileUpload.ts';
71
+ export type { FileUploadProps } from './FileUpload/FileUpload.ts';
72
+ export { Tooltip } from './Tooltip/Tooltip.ts';
73
+ export type { TooltipProps, TooltipPosition } from './Tooltip/Tooltip.ts';
74
+ export { Drawer } from './Drawer/Drawer.ts';
75
+ export type { DrawerProps, DrawerPosition } from './Drawer/Drawer.ts';