@996-design/996-ui 0.1.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 (110) hide show
  1. package/LICENSE +21 -0
  2. package/NOTICE.md +35 -0
  3. package/README.md +31 -0
  4. package/dist/cjs/index.cjs +4228 -0
  5. package/dist/cjs/index.cjs.map +41 -0
  6. package/dist/cjs/legacy-index.cjs +17297 -0
  7. package/dist/cjs/legacy-index.cjs.map +96 -0
  8. package/dist/cjs/pro/index.cjs +8544 -0
  9. package/dist/cjs/pro/index.cjs.map +35 -0
  10. package/dist/esm/index.js +4063 -0
  11. package/dist/esm/index.js.map +41 -0
  12. package/dist/esm/legacy-index.js +17294 -0
  13. package/dist/esm/legacy-index.js.map +96 -0
  14. package/dist/esm/pro/index.js +8554 -0
  15. package/dist/esm/pro/index.js.map +35 -0
  16. package/dist/styles.css +5816 -0
  17. package/dist/theme.css +601 -0
  18. package/dist/types/ConfigProvider.d.ts +195 -0
  19. package/dist/types/antd-theme.d.ts +12 -0
  20. package/dist/types/components/Alert.d.ts +51 -0
  21. package/dist/types/components/Avatar.d.ts +44 -0
  22. package/dist/types/components/Badge.d.ts +31 -0
  23. package/dist/types/components/Breadcrumb.d.ts +45 -0
  24. package/dist/types/components/Button.d.ts +42 -0
  25. package/dist/types/components/ButtonGroup.d.ts +13 -0
  26. package/dist/types/components/Card.d.ts +55 -0
  27. package/dist/types/components/Carousel.d.ts +70 -0
  28. package/dist/types/components/Checkbox.d.ts +43 -0
  29. package/dist/types/components/Collapse.d.ts +23 -0
  30. package/dist/types/components/ColorPicker.d.ts +143 -0
  31. package/dist/types/components/DataDisplayPrimitives.d.ts +205 -0
  32. package/dist/types/components/DataEntryPrimitives.d.ts +454 -0
  33. package/dist/types/components/Divider.d.ts +24 -0
  34. package/dist/types/components/Drawer.d.ts +68 -0
  35. package/dist/types/components/Dropdown.d.ts +41 -0
  36. package/dist/types/components/Empty.d.ts +14 -0
  37. package/dist/types/components/EmptyState.d.ts +6 -0
  38. package/dist/types/components/FeedbackPrimitives.d.ts +102 -0
  39. package/dist/types/components/Form.d.ts +67 -0
  40. package/dist/types/components/GameCover.d.ts +8 -0
  41. package/dist/types/components/Grid.d.ts +50 -0
  42. package/dist/types/components/Icon.d.ts +13 -0
  43. package/dist/types/components/IconButton.d.ts +14 -0
  44. package/dist/types/components/Input.d.ts +110 -0
  45. package/dist/types/components/InputNumber.d.ts +29 -0
  46. package/dist/types/components/LayoutPrimitives.d.ts +130 -0
  47. package/dist/types/components/List.d.ts +64 -0
  48. package/dist/types/components/Masonry.d.ts +43 -0
  49. package/dist/types/components/MenuList.d.ts +24 -0
  50. package/dist/types/components/Message.d.ts +58 -0
  51. package/dist/types/components/MessageToast.d.ts +27 -0
  52. package/dist/types/components/Modal.d.ts +123 -0
  53. package/dist/types/components/NavigationPrimitives.d.ts +73 -0
  54. package/dist/types/components/OtherPrimitives.d.ts +36 -0
  55. package/dist/types/components/Pagination.d.ts +18 -0
  56. package/dist/types/components/Panel.d.ts +8 -0
  57. package/dist/types/components/Popconfirm.d.ts +18 -0
  58. package/dist/types/components/Popover.d.ts +10 -0
  59. package/dist/types/components/PriceText.d.ts +9 -0
  60. package/dist/types/components/Progress.d.ts +57 -0
  61. package/dist/types/components/ProgressBar.d.ts +8 -0
  62. package/dist/types/components/ProgressButton.d.ts +9 -0
  63. package/dist/types/components/Radio.d.ts +67 -0
  64. package/dist/types/components/Rate.d.ts +17 -0
  65. package/dist/types/components/Result.d.ts +11 -0
  66. package/dist/types/components/SectionHeader.d.ts +11 -0
  67. package/dist/types/components/Segmented.d.ts +41 -0
  68. package/dist/types/components/SegmentedTabs.d.ts +42 -0
  69. package/dist/types/components/SelectInput.d.ts +33 -0
  70. package/dist/types/components/Skeleton.d.ts +54 -0
  71. package/dist/types/components/Slider.d.ts +48 -0
  72. package/dist/types/components/Spin.d.ts +21 -0
  73. package/dist/types/components/Splitter.d.ts +7 -0
  74. package/dist/types/components/StatCard.d.ts +10 -0
  75. package/dist/types/components/Statistic.d.ts +48 -0
  76. package/dist/types/components/StatusItem.d.ts +12 -0
  77. package/dist/types/components/Steps.d.ts +40 -0
  78. package/dist/types/components/Switch.d.ts +41 -0
  79. package/dist/types/components/Table.d.ts +61 -0
  80. package/dist/types/components/Tabs.d.ts +50 -0
  81. package/dist/types/components/Tag.d.ts +52 -0
  82. package/dist/types/components/TagPill.d.ts +7 -0
  83. package/dist/types/components/Tooltip.d.ts +64 -0
  84. package/dist/types/components/Typography.d.ts +374 -0
  85. package/dist/types/components/affix/utils.d.ts +10 -0
  86. package/dist/types/components/feedback/FloatButton.d.ts +51 -0
  87. package/dist/types/components/feedback/Watermark.d.ts +33 -0
  88. package/dist/types/components/feedback/globalHolder.d.ts +17 -0
  89. package/dist/types/components/form/statusContext.d.ts +18 -0
  90. package/dist/types/components/form/statusContext.type-smoke.d.ts +24 -0
  91. package/dist/types/components/splitter/Panel.d.ts +6 -0
  92. package/dist/types/components/splitter/SplitBar.d.ts +32 -0
  93. package/dist/types/components/splitter/interface.d.ts +89 -0
  94. package/dist/types/components/splitter/sizeUtil.d.ts +5 -0
  95. package/dist/types/components/splitter/useItems.d.ts +3 -0
  96. package/dist/types/components/splitter/useResizable.d.ts +9 -0
  97. package/dist/types/components/splitter/useResize.d.ts +9 -0
  98. package/dist/types/components/splitter/useSizes.d.ts +11 -0
  99. package/dist/types/components/table/columnState.d.ts +36 -0
  100. package/dist/types/components/table/pagination.d.ts +34 -0
  101. package/dist/types/components/table/selection.d.ts +23 -0
  102. package/dist/types/components/table/types.d.ts +163 -0
  103. package/dist/types/hooks/useReducedMotion.d.ts +1 -0
  104. package/dist/types/index.d.ts +44 -0
  105. package/dist/types/legacy-index.d.ts +136 -0
  106. package/dist/types/pro/index.d.ts +17 -0
  107. package/dist/types/tokens.d.ts +266 -0
  108. package/dist/types/utils/cn.d.ts +3 -0
  109. package/dist/types/utils/slots.d.ts +5 -0
  110. package/package.json +126 -0
@@ -0,0 +1,102 @@
1
+ import { type NotificationProps as RcNotificationProps, type StackConfig } from "@rc-component/notification";
2
+ import type { CSSProperties, ElementType, HTMLAttributes, Key, ReactElement, ReactNode } from "react";
3
+ import { type ConfigOptions as MessageConfig, type MessageInstance } from "./Message";
4
+ import type { MessageNoticeType } from "./MessageToast";
5
+ import { type HookModalApi } from "./Modal";
6
+ import { FloatButton } from "./feedback/FloatButton";
7
+ import { Watermark } from "./feedback/Watermark";
8
+ export { FloatButton, Watermark };
9
+ export type { FloatButtonBackTopProps, FloatButtonBadgeProps, FloatButtonElement, FloatButtonGroupProps, FloatButtonGroupTrigger, FloatButtonProps, FloatButtonShape, FloatButtonTooltipProps, FloatButtonType, } from "./feedback/FloatButton";
10
+ export type { WatermarkContent, WatermarkFont, WatermarkProps, WatermarkText, } from "./feedback/Watermark";
11
+ export declare const NotificationPlacements: readonly ["top", "topLeft", "topRight", "bottom", "bottomLeft", "bottomRight"];
12
+ export type NotificationPlacement = (typeof NotificationPlacements)[number];
13
+ export type NotificationType = Exclude<MessageNoticeType, "loading">;
14
+ type NotificationSemanticSlot = "list" | "listContent" | "wrapper" | "root" | "title" | "description" | "actions" | "icon" | "section" | "close" | "progress";
15
+ export type NotificationClassNames = Partial<Record<NotificationSemanticSlot, string>>;
16
+ export type NotificationStyles = Partial<Record<NotificationSemanticSlot, CSSProperties>>;
17
+ export type NotificationClosable = RcNotificationProps["closable"];
18
+ type SemanticValue<Value, Props> = Value | ((info: {
19
+ readonly props: Props;
20
+ }) => Value);
21
+ interface NotificationDivProps extends HTMLAttributes<HTMLDivElement> {
22
+ readonly "data-testid"?: string;
23
+ }
24
+ export interface NotificationArgs {
25
+ readonly actions?: ReactNode;
26
+ /** @deprecated Use `actions`. */
27
+ readonly btn?: ReactNode;
28
+ readonly className?: string;
29
+ readonly classNames?: SemanticValue<NotificationClassNames, NotificationArgs>;
30
+ readonly closable?: NotificationClosable;
31
+ readonly closeIcon?: ReactNode;
32
+ readonly description?: ReactNode;
33
+ readonly duration?: number | false;
34
+ readonly icon?: ReactNode;
35
+ readonly key?: Key;
36
+ /** @deprecated Use `title`. */
37
+ readonly message?: ReactNode;
38
+ readonly onClick?: () => void;
39
+ readonly onClose?: () => void;
40
+ readonly pauseOnHover?: boolean;
41
+ readonly placement?: NotificationPlacement;
42
+ readonly props?: NotificationDivProps;
43
+ readonly role?: "alert" | "status";
44
+ readonly showProgress?: boolean;
45
+ readonly style?: CSSProperties;
46
+ readonly styles?: SemanticValue<NotificationStyles, NotificationArgs>;
47
+ readonly title?: ReactNode;
48
+ readonly type?: NotificationType;
49
+ }
50
+ type NotificationStaticFn = (args: NotificationArgs) => void;
51
+ export interface NotificationInstance {
52
+ readonly destroy: (key?: Key) => void;
53
+ readonly error: NotificationStaticFn;
54
+ readonly info: NotificationStaticFn;
55
+ readonly open: NotificationStaticFn;
56
+ readonly success: NotificationStaticFn;
57
+ readonly warning: NotificationStaticFn;
58
+ }
59
+ export interface NotificationConfig {
60
+ readonly bottom?: number;
61
+ readonly classNames?: SemanticValue<NotificationClassNames, NotificationArgs>;
62
+ readonly closable?: NotificationClosable;
63
+ readonly closeIcon?: ReactNode;
64
+ readonly duration?: number | false;
65
+ readonly getContainer?: () => HTMLElement | ShadowRoot;
66
+ readonly maxCount?: number;
67
+ readonly pauseOnHover?: boolean;
68
+ readonly placement?: NotificationPlacement;
69
+ readonly prefixCls?: string;
70
+ readonly props?: NotificationDivProps;
71
+ readonly rtl?: boolean;
72
+ readonly showProgress?: boolean;
73
+ readonly stack?: boolean | StackConfig;
74
+ readonly styles?: SemanticValue<NotificationStyles, NotificationArgs>;
75
+ readonly top?: number;
76
+ }
77
+ export type GlobalConfigProps = NotificationConfig;
78
+ export declare function useNotification(notificationConfig?: NotificationConfig): readonly [NotificationInstance, ReactElement];
79
+ export interface NotificationMethods extends NotificationInstance {
80
+ readonly config: (config: GlobalConfigProps) => void;
81
+ readonly useNotification: typeof useNotification;
82
+ }
83
+ export declare const notification: NotificationMethods;
84
+ export interface AppConfig {
85
+ readonly message?: MessageConfig;
86
+ readonly notification?: NotificationConfig;
87
+ }
88
+ export interface AppProps extends AppConfig {
89
+ readonly children?: ReactNode;
90
+ readonly className?: string;
91
+ readonly component?: ElementType | false;
92
+ readonly rootClassName?: string;
93
+ readonly style?: CSSProperties;
94
+ }
95
+ export interface AppApi {
96
+ readonly message: MessageInstance;
97
+ readonly modal: HookModalApi;
98
+ readonly notification: NotificationInstance;
99
+ }
100
+ export declare const App: import("react").ForwardRefExoticComponent<AppProps & import("react").RefAttributes<HTMLElement>> & {
101
+ useApp(): AppApi;
102
+ };
@@ -0,0 +1,67 @@
1
+ import { FormProvider, useForm as useRcForm, useWatch } from "@rc-component/form";
2
+ import type { FieldProps, FormInstance, FormRef, Meta, NamePath, FormProps as RcFormProps, Store, StoreValue, ValidatorRule } from "@rc-component/form";
3
+ import type { HTMLAttributes, ReactElement, ReactNode, RefAttributes } from "react";
4
+ import { useFormItemStatus } from "./form/statusContext";
5
+ import type { FormItemStatus } from "./form/statusContext";
6
+ export type { FormControlStatus, FormItemStatus, FormItemUseStatusResult, } from "./form/statusContext";
7
+ export interface FormProps<Values = Store> extends RcFormProps<Values> {
8
+ readonly disabled?: boolean;
9
+ readonly layout?: "horizontal" | "vertical" | "inline";
10
+ }
11
+ type FormItemChildren<Values> = ReactNode | ((form: FormInstance<Values>) => ReactNode);
12
+ export interface FormItemProps<Values = Store> extends Omit<HTMLAttributes<HTMLDivElement>, "children" | "onReset">, Omit<FieldProps<Values>, "children"> {
13
+ readonly children?: FormItemChildren<Values>;
14
+ readonly help?: ReactNode;
15
+ readonly htmlFor?: string | null;
16
+ readonly label?: ReactNode;
17
+ readonly noStyle?: boolean;
18
+ readonly required?: boolean;
19
+ readonly status?: FormItemStatus;
20
+ readonly validateStatus?: FormItemStatus;
21
+ }
22
+ export interface ErrorListProps {
23
+ readonly className?: string;
24
+ readonly errors?: readonly ReactNode[];
25
+ readonly fieldId?: string;
26
+ readonly help?: ReactNode;
27
+ readonly helpStatus?: FormItemStatus;
28
+ readonly onVisibleChanged?: (visible: boolean) => void;
29
+ readonly warnings?: readonly ReactNode[];
30
+ }
31
+ export interface FormListFieldData {
32
+ readonly fieldKey: number;
33
+ readonly isListField: boolean;
34
+ readonly key: number;
35
+ readonly name: number;
36
+ }
37
+ export interface FormListOperation {
38
+ readonly add: (defaultValue?: StoreValue, insertIndex?: number) => void;
39
+ readonly move: (from: number, to: number) => void;
40
+ readonly remove: (index: number | number[]) => void;
41
+ }
42
+ export interface FormListProps<Values = Store> {
43
+ readonly children: (fields: FormListFieldData[], operation: FormListOperation, meta: Pick<Meta, "errors" | "warnings">) => ReactNode;
44
+ readonly initialValue?: StoreValue[];
45
+ readonly name: NamePath<Values>;
46
+ readonly rules?: ValidatorRule[];
47
+ readonly validateTrigger?: string | string[] | false;
48
+ }
49
+ declare const FormRoot: <Values = Store>(props: FormProps<Values> & RefAttributes<FormRef<Values>>) => ReactElement;
50
+ declare function useFormInstance<Values = Store>(): FormInstance<Values>;
51
+ export declare function ErrorList({ className, errors, fieldId, help, helpStatus, onVisibleChanged, warnings, }: ErrorListProps): import("react").JSX.Element | null;
52
+ declare function Item<Values = Store>({ children, className, dependencies, getValueFromEvent, getValueProps, help, hidden, htmlFor, initialValue, isList, isListField, label, messageVariables, name, noStyle, normalize, onMetaChange, onReset, preserve, required, rules, shouldUpdate, status, trigger, validateDebounce, validateFirst, validateStatus, validateTrigger, valuePropName, ...itemProps }: FormItemProps<Values>): import("react").JSX.Element;
53
+ type FormItemComponent = typeof Item & {
54
+ readonly useStatus: typeof useFormItemStatus;
55
+ };
56
+ declare const FormItem: FormItemComponent;
57
+ declare function FormList<Values = Store>({ children, ...props }: FormListProps<Values>): import("react").JSX.Element;
58
+ type FormComponent = typeof FormRoot & {
59
+ readonly ErrorList: typeof ErrorList;
60
+ readonly Item: typeof FormItem;
61
+ readonly List: typeof FormList;
62
+ readonly Provider: typeof FormProvider;
63
+ readonly useForm: typeof useRcForm;
64
+ readonly useFormInstance: typeof useFormInstance;
65
+ readonly useWatch: typeof useWatch;
66
+ };
67
+ export declare const Form: FormComponent;
@@ -0,0 +1,8 @@
1
+ interface GameCoverProps {
2
+ readonly alt?: string;
3
+ readonly className?: string;
4
+ readonly fallback: string;
5
+ readonly src?: string;
6
+ }
7
+ export declare function GameCover({ alt, className, fallback, src }: GameCoverProps): import("react").JSX.Element;
8
+ export {};
@@ -0,0 +1,50 @@
1
+ import type { CSSProperties, HTMLAttributes, ReactNode } from "react";
2
+ export type Breakpoint = "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | "xxxl";
3
+ export type ScreenMap = Partial<Record<Breakpoint, boolean>>;
4
+ export type BreakpointValues<T> = Partial<Record<Breakpoint, T>>;
5
+ export declare function useBreakpoint(): ScreenMap;
6
+ export declare function useBreakpointValue<T>(values: BreakpointValues<T>, defaultValue?: T): T | undefined;
7
+ export interface GridProps extends HTMLAttributes<HTMLElement> {
8
+ readonly as?: "div" | "section";
9
+ readonly children?: ReactNode;
10
+ readonly columns?: 2 | 3 | 4;
11
+ readonly gap?: "sm" | "md";
12
+ }
13
+ export type GutterUnit = number | string;
14
+ export type Gutter = GutterUnit | BreakpointValues<GutterUnit> | undefined;
15
+ export type RowAlign = "top" | "middle" | "bottom" | "stretch";
16
+ export type RowJustify = "start" | "end" | "center" | "space-around" | "space-between" | "space-evenly";
17
+ export interface RowProps extends HTMLAttributes<HTMLDivElement> {
18
+ readonly align?: RowAlign | BreakpointValues<RowAlign>;
19
+ readonly gutter?: Gutter | readonly [Gutter, Gutter];
20
+ readonly justify?: RowJustify | BreakpointValues<RowJustify>;
21
+ readonly prefixCls?: string;
22
+ readonly wrap?: boolean;
23
+ }
24
+ export declare const Row: import("react").ForwardRefExoticComponent<RowProps & import("react").RefAttributes<HTMLDivElement>>;
25
+ export type ColSpanType = number | string;
26
+ export type FlexType = NonNullable<CSSProperties["flex"]>;
27
+ export interface ColSize {
28
+ readonly flex?: FlexType;
29
+ readonly offset?: ColSpanType;
30
+ readonly order?: ColSpanType;
31
+ readonly pull?: ColSpanType;
32
+ readonly push?: ColSpanType;
33
+ readonly span?: ColSpanType;
34
+ }
35
+ export interface ColProps extends HTMLAttributes<HTMLDivElement>, Partial<Record<Breakpoint, ColSpanType | ColSize>> {
36
+ readonly flex?: FlexType;
37
+ readonly offset?: ColSpanType;
38
+ readonly order?: ColSpanType;
39
+ readonly prefixCls?: string;
40
+ readonly pull?: ColSpanType;
41
+ readonly push?: ColSpanType;
42
+ readonly span?: ColSpanType;
43
+ }
44
+ export declare const Col: import("react").ForwardRefExoticComponent<ColProps & import("react").RefAttributes<HTMLDivElement>>;
45
+ export declare const Grid: import("react").ForwardRefExoticComponent<GridProps & import("react").RefAttributes<HTMLElement>> & {
46
+ Col: import("react").ForwardRefExoticComponent<ColProps & import("react").RefAttributes<HTMLDivElement>>;
47
+ Row: import("react").ForwardRefExoticComponent<RowProps & import("react").RefAttributes<HTMLDivElement>>;
48
+ useBreakpoint: typeof useBreakpoint;
49
+ useBreakpointValue: typeof useBreakpointValue;
50
+ };
@@ -0,0 +1,13 @@
1
+ import type { SVGAttributes } from "react";
2
+ import type { SlotClassNames, SlotStyles } from "../utils/slots";
3
+ export type IconName = "back" | "bars" | "bell" | "calendar" | "cart" | "check" | "chevron-down" | "chevron-right" | "close" | "copy" | "document" | "download" | "eye" | "flame" | "gamepad" | "gift" | "lock" | "minus" | "plus" | "refresh" | "rocket" | "search" | "shield" | "star" | "tag" | "thumb-up" | "user" | "warning";
4
+ type IconSlot = "root";
5
+ export interface IconProps extends Omit<SVGAttributes<SVGSVGElement>, "children"> {
6
+ readonly classNames?: SlotClassNames<IconSlot>;
7
+ readonly name: IconName;
8
+ readonly size?: 16 | 20 | 22 | 24 | number;
9
+ readonly strokeWidth?: number;
10
+ readonly styles?: SlotStyles<IconSlot>;
11
+ }
12
+ export declare function Icon({ className, classNames, name, size, strokeWidth, style, styles, ...props }: IconProps): import("react").JSX.Element;
13
+ export {};
@@ -0,0 +1,14 @@
1
+ import type { ButtonHTMLAttributes, ReactNode } from "react";
2
+ import type { SlotClassNames, SlotStyles } from "../utils/slots";
3
+ export type IconButtonTone = "default" | "primary" | "ghost" | "selected";
4
+ export type IconButtonSize = "xs" | "sm" | "md";
5
+ type IconButtonSlot = "root" | "content";
6
+ export interface IconButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
7
+ readonly children: ReactNode;
8
+ readonly classNames?: SlotClassNames<IconButtonSlot>;
9
+ readonly styles?: SlotStyles<IconButtonSlot>;
10
+ readonly tone?: IconButtonTone;
11
+ readonly size?: IconButtonSize;
12
+ }
13
+ export declare function IconButton({ children, className, classNames, size, style, styles, tone, type, ...props }: IconButtonProps): import("react").JSX.Element;
14
+ export {};
@@ -0,0 +1,110 @@
1
+ import type { InputProps as RcInputProps, InputRef as RcInputRef, TextAreaProps as RcTextAreaProps, TextAreaRef as RcTextAreaRef } from "@rc-component/input";
2
+ import type { InputFocusOptions } from "@rc-component/util";
3
+ import type { ChangeEvent, FocusEvent, HTMLAttributes, InputHTMLAttributes, KeyboardEvent, MouseEvent, ReactElement, ReactNode, RefAttributes } from "react";
4
+ import type { SlotClassNames, SlotStyles } from "../utils/slots";
5
+ import type { FormControlStatus } from "./form/statusContext";
6
+ export type { InputFocusOptions };
7
+ export type InputRef = RcInputRef;
8
+ export type InputStatus = FormControlStatus;
9
+ export type AntdInputSize = "small" | "medium" | "middle" | "large";
10
+ export type InputSize = AntdInputSize | "sm" | "md" | "lg";
11
+ export type AntdInputVariant = "outlined" | "borderless" | "filled" | "underlined";
12
+ export type InputVariant = AntdInputVariant | "default" | "active";
13
+ export type InputVisualSize = "sm" | "md" | "lg";
14
+ type InputSlot = "group" | "root" | "wrapper" | "input" | "prefix" | "suffix" | "clear" | "count" | "addonBefore" | "addonAfter";
15
+ export interface InputProps extends Omit<RcInputProps, "classNames" | "prefixCls" | "styles"> {
16
+ /** @deprecated Use variant instead. */
17
+ readonly bordered?: boolean;
18
+ readonly classNames?: SlotClassNames<InputSlot>;
19
+ readonly rootClassName?: string;
20
+ readonly size?: InputSize;
21
+ readonly status?: InputStatus;
22
+ readonly styles?: SlotStyles<InputSlot>;
23
+ readonly variant?: InputVariant;
24
+ }
25
+ export declare function normalizeInputSize(size: InputSize | undefined, fallback?: InputVisualSize): InputVisualSize;
26
+ declare const InternalInput: import("react").ForwardRefExoticComponent<InputProps & RefAttributes<RcInputRef>>;
27
+ export interface GroupProps extends HTMLAttributes<HTMLSpanElement> {
28
+ readonly compact?: boolean;
29
+ readonly rootClassName?: string;
30
+ readonly size?: InputSize;
31
+ }
32
+ declare const InputGroup: import("react").ForwardRefExoticComponent<GroupProps & RefAttributes<HTMLSpanElement>>;
33
+ type SearchSlot = InputSlot | "button";
34
+ export interface SearchProps extends Omit<InputProps, "classNames" | "styles" | "type"> {
35
+ readonly classNames?: SlotClassNames<SearchSlot>;
36
+ readonly enterButton?: ReactNode;
37
+ readonly loading?: boolean;
38
+ readonly searchIcon?: ReactNode;
39
+ readonly styles?: SlotStyles<SearchSlot>;
40
+ readonly onSearch?: (value: string, event?: ChangeEvent<HTMLInputElement> | MouseEvent<HTMLElement> | KeyboardEvent<HTMLInputElement>, info?: {
41
+ readonly source?: "clear" | "input";
42
+ }) => void;
43
+ }
44
+ declare const InputSearch: import("react").ForwardRefExoticComponent<SearchProps & RefAttributes<RcInputRef>>;
45
+ export interface PasswordVisibilityToggle {
46
+ readonly tabIndex?: number;
47
+ readonly visible?: boolean;
48
+ readonly onVisibleChange?: (visible: boolean) => void;
49
+ }
50
+ export interface PasswordProps extends InputProps {
51
+ readonly action?: "click" | "hover";
52
+ readonly iconRender?: (visible: boolean) => ReactNode;
53
+ readonly visibilityToggle?: boolean | PasswordVisibilityToggle;
54
+ }
55
+ declare const InputPassword: import("react").ForwardRefExoticComponent<PasswordProps & RefAttributes<RcInputRef>>;
56
+ type TextAreaSlot = "root" | "textarea" | "clear" | "count";
57
+ export interface TextAreaProps extends Omit<RcTextAreaProps, "classNames" | "prefixCls" | "styles" | "suffix"> {
58
+ /** @deprecated Use variant instead. */
59
+ readonly bordered?: boolean;
60
+ readonly classNames?: SlotClassNames<TextAreaSlot>;
61
+ readonly rootClassName?: string;
62
+ readonly size?: InputSize;
63
+ readonly status?: InputStatus;
64
+ readonly styles?: SlotStyles<TextAreaSlot>;
65
+ readonly variant?: InputVariant;
66
+ }
67
+ export interface TextAreaRef {
68
+ readonly nativeElement: HTMLElement | null;
69
+ readonly resizableTextArea?: RcTextAreaRef["resizableTextArea"];
70
+ readonly blur: () => void;
71
+ readonly focus: (options?: InputFocusOptions) => void;
72
+ }
73
+ declare const InputTextArea: import("react").ForwardRefExoticComponent<TextAreaProps & RefAttributes<TextAreaRef>>;
74
+ type OTPSlot = "root" | "input" | "separator";
75
+ export interface OTPProps extends Omit<HTMLAttributes<HTMLDivElement>, "defaultValue" | "onChange" | "onFocus" | "onInput"> {
76
+ readonly autoComplete?: string;
77
+ readonly classNames?: SlotClassNames<OTPSlot>;
78
+ readonly defaultValue?: string;
79
+ readonly disabled?: boolean;
80
+ readonly formatter?: (value: string) => string;
81
+ readonly inputMode?: InputHTMLAttributes<HTMLInputElement>["inputMode"];
82
+ readonly length?: number;
83
+ readonly mask?: boolean | string;
84
+ readonly rootClassName?: string;
85
+ readonly separator?: ReactNode | ((index: number) => ReactNode);
86
+ readonly size?: InputSize;
87
+ readonly status?: InputStatus;
88
+ readonly styles?: SlotStyles<OTPSlot>;
89
+ readonly type?: InputHTMLAttributes<HTMLInputElement>["type"];
90
+ readonly value?: string;
91
+ readonly variant?: InputVariant;
92
+ readonly onChange?: (value: string) => void;
93
+ readonly onFocus?: (event: FocusEvent<HTMLInputElement>) => void;
94
+ readonly onInput?: (value: string[]) => void;
95
+ }
96
+ export interface OTPRef {
97
+ readonly nativeElement: HTMLDivElement;
98
+ readonly blur: () => void;
99
+ readonly focus: () => void;
100
+ }
101
+ declare const InputOTP: import("react").ForwardRefExoticComponent<OTPProps & RefAttributes<OTPRef>>;
102
+ type CompoundedInput = typeof InternalInput & {
103
+ Group: typeof InputGroup;
104
+ OTP: typeof InputOTP;
105
+ Password: typeof InputPassword;
106
+ Search: typeof InputSearch;
107
+ TextArea: typeof InputTextArea;
108
+ };
109
+ export declare const Input: CompoundedInput;
110
+ export type InputComponent = (props: InputProps & RefAttributes<InputRef>) => ReactElement | null;
@@ -0,0 +1,29 @@
1
+ import type { InputNumberProps as RcInputNumberProps, InputNumberRef as RcInputNumberRef, ValueType } from "@rc-component/input-number";
2
+ import type { CSSProperties, ReactElement, ReactNode, RefAttributes } from "react";
3
+ import { type InputSize, type InputStatus, type InputVariant } from "./Input";
4
+ export type InputNumberRef = RcInputNumberRef;
5
+ export type InputNumberValue = ValueType;
6
+ type InputNumberSlot = "group" | "root" | "prefix" | "suffix" | "input" | "actions" | "action" | "addonBefore" | "addonAfter";
7
+ export type InputNumberClassNames = Partial<Record<InputNumberSlot, string>>;
8
+ export type InputNumberStyles = Partial<Record<InputNumberSlot, CSSProperties>>;
9
+ export interface InputNumberControls {
10
+ readonly downIcon?: ReactNode;
11
+ readonly upIcon?: ReactNode;
12
+ }
13
+ export interface InputNumberProps<T extends ValueType = ValueType> extends Omit<RcInputNumberProps<T>, "className" | "classNames" | "controls" | "prefixCls" | "size" | "style" | "styles"> {
14
+ readonly addonAfter?: ReactNode;
15
+ readonly addonBefore?: ReactNode;
16
+ /** @deprecated Use variant instead. */
17
+ readonly bordered?: boolean;
18
+ readonly className?: string;
19
+ readonly classNames?: InputNumberClassNames;
20
+ readonly controls?: boolean | InputNumberControls;
21
+ readonly rootClassName?: string;
22
+ readonly size?: InputSize;
23
+ readonly status?: InputStatus;
24
+ readonly style?: CSSProperties;
25
+ readonly styles?: InputNumberStyles;
26
+ readonly variant?: InputVariant;
27
+ }
28
+ export declare const InputNumber: <T extends ValueType = ValueType>(props: InputNumberProps<T> & RefAttributes<InputNumberRef>) => ReactElement | null;
29
+ export {};
@@ -0,0 +1,130 @@
1
+ import type { CSSProperties, ElementType, HTMLAttributes, ReactNode } from "react";
2
+ import type { DirectionType, Variant } from "../ConfigProvider";
3
+ export type NativeGapSize = "small" | "medium" | "middle" | "large";
4
+ export type LegacyGapSize = "xs" | "sm" | "md" | "lg" | "xl";
5
+ export type GapSize = NativeGapSize | LegacyGapSize | NonNullable<CSSProperties["gap"]>;
6
+ export type Orientation = "horizontal" | "vertical";
7
+ type SemanticConfig<Slot extends string, Value, Props> = Partial<Record<Slot, Value>> | ((info: {
8
+ readonly props: Props;
9
+ }) => Partial<Record<Slot, Value>>);
10
+ export interface FlexProps extends HTMLAttributes<HTMLElement> {
11
+ readonly align?: CSSProperties["alignItems"];
12
+ readonly component?: ElementType;
13
+ readonly flex?: CSSProperties["flex"];
14
+ readonly gap?: GapSize;
15
+ readonly justify?: CSSProperties["justifyContent"];
16
+ readonly orientation?: Orientation;
17
+ readonly prefixCls?: string;
18
+ readonly rootClassName?: string;
19
+ readonly vertical?: boolean;
20
+ readonly wrap?: boolean | CSSProperties["flexWrap"];
21
+ }
22
+ export declare const Flex: import("react").ForwardRefExoticComponent<FlexProps & import("react").RefAttributes<HTMLElement>>;
23
+ export interface SpaceProps extends HTMLAttributes<HTMLDivElement> {
24
+ readonly align?: CSSProperties["alignItems"];
25
+ readonly classNames?: SpaceClassNames;
26
+ readonly direction?: Orientation;
27
+ readonly orientation?: Orientation;
28
+ readonly prefixCls?: string;
29
+ readonly rootClassName?: string;
30
+ readonly separator?: ReactNode;
31
+ readonly size?: GapSize | readonly [GapSize, GapSize];
32
+ readonly split?: ReactNode;
33
+ readonly styles?: SpaceStyles;
34
+ readonly vertical?: boolean;
35
+ readonly wrap?: boolean;
36
+ }
37
+ export type SpaceSemanticSlot = "root" | "item" | "separator";
38
+ export type SpaceClassNames = SemanticConfig<SpaceSemanticSlot, string, SpaceProps>;
39
+ export type SpaceStyles = SemanticConfig<SpaceSemanticSlot, CSSProperties, SpaceProps>;
40
+ export type SpaceCompactSize = NativeGapSize | "sm" | "md" | "lg";
41
+ export interface SpaceCompactItemContextValue {
42
+ readonly compactDirection?: Orientation;
43
+ readonly compactSize?: SpaceCompactSize;
44
+ readonly isFirstItem?: boolean;
45
+ readonly isLastItem?: boolean;
46
+ }
47
+ export declare const SpaceCompactItemContext: import("react").Context<SpaceCompactItemContextValue | null>;
48
+ export declare function useCompactItemContext(prefixCls: string, direction?: DirectionType): {
49
+ compactDirection: Orientation | undefined;
50
+ compactItemClassnames: string;
51
+ compactSize: SpaceCompactSize | undefined;
52
+ };
53
+ export declare function NoCompactStyle({ children }: Readonly<{
54
+ children?: ReactNode;
55
+ }>): import("react").JSX.Element;
56
+ export type SpaceAddonStatus = "" | "error" | "success" | "validating" | "warning";
57
+ export interface SpaceAddonProps extends HTMLAttributes<HTMLDivElement> {
58
+ readonly children: ReactNode;
59
+ readonly disabled?: boolean;
60
+ readonly prefixCls?: string;
61
+ readonly status?: SpaceAddonStatus;
62
+ readonly variant?: Variant;
63
+ }
64
+ export type SpaceCompactCellProps = SpaceAddonProps;
65
+ export declare const SpaceAddon: import("react").ForwardRefExoticComponent<SpaceAddonProps & import("react").RefAttributes<HTMLDivElement>>;
66
+ export interface SpaceCompactProps extends HTMLAttributes<HTMLDivElement> {
67
+ readonly block?: boolean;
68
+ readonly direction?: Orientation;
69
+ readonly orientation?: Orientation;
70
+ readonly prefixCls?: string;
71
+ readonly rootClassName?: string;
72
+ readonly size?: SpaceCompactSize;
73
+ readonly vertical?: boolean;
74
+ }
75
+ export declare const SpaceCompact: import("react").ForwardRefExoticComponent<SpaceCompactProps & import("react").RefAttributes<HTMLDivElement>>;
76
+ export declare const Space: import("react").ForwardRefExoticComponent<SpaceProps & import("react").RefAttributes<HTMLDivElement>> & {
77
+ Addon: import("react").ForwardRefExoticComponent<SpaceAddonProps & import("react").RefAttributes<HTMLDivElement>>;
78
+ Compact: import("react").ForwardRefExoticComponent<SpaceCompactProps & import("react").RefAttributes<HTMLDivElement>>;
79
+ };
80
+ export interface LayoutProps extends HTMLAttributes<HTMLDivElement> {
81
+ readonly hasSider?: boolean;
82
+ readonly prefixCls?: string;
83
+ readonly rootClassName?: string;
84
+ }
85
+ interface BasicLayoutSectionProps extends HTMLAttributes<HTMLElement> {
86
+ readonly prefixCls?: string;
87
+ readonly rootClassName?: string;
88
+ }
89
+ export type LayoutHeaderProps = BasicLayoutSectionProps;
90
+ export type LayoutFooterProps = BasicLayoutSectionProps;
91
+ export type LayoutContentProps = BasicLayoutSectionProps;
92
+ export declare const LayoutHeader: import("react").ForwardRefExoticComponent<BasicLayoutSectionProps & import("react").RefAttributes<HTMLElement>>;
93
+ export declare const LayoutFooter: import("react").ForwardRefExoticComponent<BasicLayoutSectionProps & import("react").RefAttributes<HTMLElement>>;
94
+ export declare const LayoutContent: import("react").ForwardRefExoticComponent<BasicLayoutSectionProps & import("react").RefAttributes<HTMLElement>>;
95
+ export type Breakpoint = "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | "xxxl";
96
+ export type CollapseType = "clickTrigger" | "responsive";
97
+ export type SiderTheme = "light" | "dark";
98
+ export interface SiderContextValue {
99
+ readonly siderCollapsed?: boolean;
100
+ }
101
+ export declare const SiderContext: import("react").Context<SiderContextValue>;
102
+ export interface SiderProps extends HTMLAttributes<HTMLElement> {
103
+ readonly breakpoint?: Breakpoint;
104
+ readonly classNames?: SiderClassNames;
105
+ readonly collapsible?: boolean;
106
+ readonly collapsed?: boolean;
107
+ readonly collapsedWidth?: number | string;
108
+ readonly defaultCollapsed?: boolean;
109
+ readonly onBreakpoint?: (broken: boolean) => void;
110
+ readonly onCollapse?: (collapsed: boolean, type: CollapseType) => void;
111
+ readonly prefixCls?: string;
112
+ readonly reverseArrow?: boolean;
113
+ readonly rootClassName?: string;
114
+ readonly styles?: SiderStyles;
115
+ readonly theme?: SiderTheme;
116
+ readonly trigger?: ReactNode;
117
+ readonly width?: number | string;
118
+ readonly zeroWidthTriggerStyle?: CSSProperties;
119
+ }
120
+ export type SiderSemanticSlot = "root" | "body";
121
+ export type SiderClassNames = SemanticConfig<SiderSemanticSlot, string, SiderProps>;
122
+ export type SiderStyles = SemanticConfig<SiderSemanticSlot, CSSProperties, SiderProps>;
123
+ export declare const Layout: import("react").ForwardRefExoticComponent<LayoutProps & import("react").RefAttributes<HTMLDivElement>> & {
124
+ Content: import("react").ForwardRefExoticComponent<BasicLayoutSectionProps & import("react").RefAttributes<HTMLElement>>;
125
+ Footer: import("react").ForwardRefExoticComponent<BasicLayoutSectionProps & import("react").RefAttributes<HTMLElement>>;
126
+ Header: import("react").ForwardRefExoticComponent<BasicLayoutSectionProps & import("react").RefAttributes<HTMLElement>>;
127
+ Sider: import("react").ForwardRefExoticComponent<SiderProps & import("react").RefAttributes<HTMLElement>>;
128
+ _InternalSiderContext: import("react").Context<SiderContextValue>;
129
+ };
130
+ export {};
@@ -0,0 +1,64 @@
1
+ import type { CSSProperties, HTMLAttributes, Key, ReactElement, ReactNode, RefAttributes } from "react";
2
+ import { type PaginationProps } from "./Pagination";
3
+ import { type SpinProps } from "./Spin";
4
+ export type ListSize = "small" | "default" | "large";
5
+ export type ListItemLayout = "horizontal" | "vertical";
6
+ export type ListBreakpoint = "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | "xxxl";
7
+ export type ListGutter = number | string | Partial<Record<ListBreakpoint, number>> | undefined;
8
+ export interface ListGridType {
9
+ readonly column?: number;
10
+ readonly gutter?: ListGutter | readonly [ListGutter, ListGutter];
11
+ readonly lg?: number;
12
+ readonly md?: number;
13
+ readonly sm?: number;
14
+ readonly xl?: number;
15
+ readonly xs?: number;
16
+ readonly xxl?: number;
17
+ readonly xxxl?: number;
18
+ }
19
+ export type ListPaginationConfig = Omit<PaginationProps, "total"> & {
20
+ readonly align?: "start" | "center" | "end";
21
+ readonly position?: "top" | "bottom" | "both";
22
+ readonly total?: number;
23
+ };
24
+ export interface ListProps<T> extends Omit<HTMLAttributes<HTMLDivElement>, "children"> {
25
+ readonly bordered?: boolean;
26
+ readonly children?: ReactNode;
27
+ readonly dataSource?: readonly T[];
28
+ readonly extra?: ReactNode;
29
+ readonly footer?: ReactNode;
30
+ readonly grid?: ListGridType;
31
+ readonly header?: ReactNode;
32
+ readonly itemLayout?: ListItemLayout;
33
+ readonly loading?: boolean | SpinProps;
34
+ readonly loadMore?: ReactNode;
35
+ readonly locale?: {
36
+ readonly emptyText?: ReactNode;
37
+ };
38
+ readonly pagination?: ListPaginationConfig | false;
39
+ readonly rootClassName?: string;
40
+ readonly rowKey?: ((item: T) => Key) | keyof T;
41
+ readonly size?: ListSize;
42
+ readonly split?: boolean;
43
+ readonly renderItem?: (item: T, index: number) => ReactNode;
44
+ }
45
+ export interface ListItemProps extends HTMLAttributes<HTMLDivElement> {
46
+ readonly actions?: readonly ReactNode[];
47
+ readonly classNames?: Partial<Record<"actions" | "extra", string>>;
48
+ readonly colStyle?: CSSProperties;
49
+ readonly extra?: ReactNode;
50
+ readonly styles?: Partial<Record<"actions" | "extra", CSSProperties>>;
51
+ }
52
+ export interface ListItemMetaProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
53
+ readonly avatar?: ReactNode;
54
+ readonly description?: ReactNode;
55
+ readonly title?: ReactNode;
56
+ }
57
+ declare function ListItemMeta({ avatar, children, className, description, title, ...props }: ListItemMetaProps): import("react").JSX.Element;
58
+ type ListComponent = <T>(props: ListProps<T> & RefAttributes<HTMLDivElement>) => ReactElement;
59
+ export declare const List: ListComponent & {
60
+ Item: import("react").ForwardRefExoticComponent<ListItemProps & RefAttributes<HTMLDivElement>> & {
61
+ Meta: typeof ListItemMeta;
62
+ };
63
+ };
64
+ export {};
@@ -0,0 +1,43 @@
1
+ import type { CSSProperties, Key, ReactNode, RefAttributes } from "react";
2
+ import type { SlotClassNames, SlotStyles } from "../utils/slots";
3
+ export type MasonryBreakpoint = "xs" | "sm" | "md" | "lg" | "xl" | "xxl";
4
+ export type MasonryResponsiveValue<T> = T | Partial<Record<MasonryBreakpoint, T>>;
5
+ export type MasonryGutter = MasonryResponsiveValue<number> | readonly [MasonryResponsiveValue<number>, MasonryResponsiveValue<number>];
6
+ export type MasonryGap = "xs" | "sm" | "md" | "lg" | "xl" | number;
7
+ export interface MasonryItem<T = unknown> {
8
+ readonly children?: ReactNode;
9
+ readonly column?: number;
10
+ readonly data: T;
11
+ readonly height?: number;
12
+ readonly key: Key;
13
+ }
14
+ type MasonrySlot = "root" | "item";
15
+ export interface MasonryProps<T = unknown> {
16
+ readonly children?: ReactNode;
17
+ readonly className?: string;
18
+ readonly classNames?: SlotClassNames<MasonrySlot>;
19
+ readonly columns?: MasonryResponsiveValue<number>;
20
+ readonly fresh?: boolean;
21
+ readonly gap?: MasonryGap;
22
+ readonly gutter?: MasonryGutter;
23
+ readonly itemRender?: (item: MasonryItem<T> & {
24
+ readonly column: number;
25
+ readonly index: number;
26
+ }) => ReactNode;
27
+ readonly items?: readonly MasonryItem<T>[];
28
+ readonly rootClassName?: string;
29
+ readonly style?: CSSProperties;
30
+ readonly styles?: SlotStyles<MasonrySlot>;
31
+ readonly onLayoutChange?: (sortInfo: {
32
+ readonly column: number;
33
+ readonly key: Key;
34
+ }[]) => void;
35
+ }
36
+ export interface MasonryRef {
37
+ readonly nativeElement: HTMLDivElement;
38
+ }
39
+ declare const InternalMasonry: import("react").ForwardRefExoticComponent<MasonryProps<unknown> & RefAttributes<MasonryRef>>;
40
+ export declare const Masonry: (<T = unknown>(props: MasonryProps<T> & RefAttributes<MasonryRef>) => ReturnType<typeof InternalMasonry>) & {
41
+ displayName?: string;
42
+ };
43
+ export {};