@lobehub/ui 5.19.3 → 5.20.1
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/es/Markdown/SyntaxMarkdown/CachedMarkdown.mjs +3 -2
- package/es/Markdown/SyntaxMarkdown/CachedMarkdown.mjs.map +1 -1
- package/es/Markdown/plugins/rehypeStreamAnimated.mjs.map +1 -1
- package/es/ThemeProvider/GlobalStyle/global.mjs +3 -2
- package/es/ThemeProvider/GlobalStyle/global.mjs.map +1 -1
- package/es/ThemeProvider/ThemeProvider.mjs +1 -1
- package/es/ThemeProvider/ThemeProvider.mjs.map +1 -1
- package/es/base-ui/AutoComplete/AutoComplete.d.mts +8 -0
- package/es/base-ui/AutoComplete/AutoComplete.mjs +91 -0
- package/es/base-ui/AutoComplete/AutoComplete.mjs.map +1 -0
- package/es/base-ui/AutoComplete/index.d.mts +3 -0
- package/es/base-ui/AutoComplete/style.d.mts +12 -0
- package/es/base-ui/AutoComplete/style.mjs +76 -0
- package/es/base-ui/AutoComplete/style.mjs.map +1 -0
- package/es/base-ui/AutoComplete/type.d.mts +40 -0
- package/es/base-ui/Button/style.mjs +6 -3
- package/es/base-ui/Button/style.mjs.map +1 -1
- package/es/base-ui/Checkbox/Checkbox.d.mts +8 -0
- package/es/base-ui/Checkbox/Checkbox.mjs +61 -0
- package/es/base-ui/Checkbox/Checkbox.mjs.map +1 -0
- package/es/base-ui/Checkbox/CheckboxGroup.d.mts +8 -0
- package/es/base-ui/Checkbox/CheckboxGroup.mjs +37 -0
- package/es/base-ui/Checkbox/CheckboxGroup.mjs.map +1 -0
- package/es/base-ui/Checkbox/index.d.mts +4 -0
- package/es/base-ui/Checkbox/style.d.mts +9 -0
- package/es/base-ui/Checkbox/style.mjs +70 -0
- package/es/base-ui/Checkbox/style.mjs.map +1 -0
- package/es/base-ui/Checkbox/type.d.mts +51 -0
- package/es/base-ui/Form/Form.mjs +155 -0
- package/es/base-ui/Form/Form.mjs.map +1 -0
- package/es/base-ui/Form/components/FormDivider.d.mts +8 -0
- package/es/base-ui/Form/components/FormDivider.mjs +19 -0
- package/es/base-ui/Form/components/FormDivider.mjs.map +1 -0
- package/es/base-ui/Form/components/FormField.d.mts +8 -0
- package/es/base-ui/Form/components/FormField.mjs +59 -0
- package/es/base-ui/Form/components/FormField.mjs.map +1 -0
- package/es/base-ui/Form/components/FormFlatGroup.d.mts +8 -0
- package/es/base-ui/Form/components/FormFlatGroup.mjs +20 -0
- package/es/base-ui/Form/components/FormFlatGroup.mjs.map +1 -0
- package/es/base-ui/Form/components/FormFooter.d.mts +8 -0
- package/es/base-ui/Form/components/FormFooter.mjs +20 -0
- package/es/base-ui/Form/components/FormFooter.mjs.map +1 -0
- package/es/base-ui/Form/components/FormGroup.d.mts +8 -0
- package/es/base-ui/Form/components/FormGroup.mjs +87 -0
- package/es/base-ui/Form/components/FormGroup.mjs.map +1 -0
- package/es/base-ui/Form/components/FormSubmitFooter.d.mts +8 -0
- package/es/base-ui/Form/components/FormSubmitFooter.mjs +118 -0
- package/es/base-ui/Form/components/FormSubmitFooter.mjs.map +1 -0
- package/es/base-ui/Form/components/FormTitle.d.mts +8 -0
- package/es/base-ui/Form/components/FormTitle.mjs +42 -0
- package/es/base-ui/Form/components/FormTitle.mjs.map +1 -0
- package/es/base-ui/Form/context.d.mts +6 -0
- package/es/base-ui/Form/context.mjs +15 -0
- package/es/base-ui/Form/context.mjs.map +1 -0
- package/es/base-ui/Form/index.d.mts +25 -0
- package/es/base-ui/Form/index.mjs +24 -0
- package/es/base-ui/Form/index.mjs.map +1 -0
- package/es/base-ui/Form/style.mjs +288 -0
- package/es/base-ui/Form/style.mjs.map +1 -0
- package/es/base-ui/Form/type.d.mts +139 -0
- package/es/base-ui/Input/Input.d.mts +8 -0
- package/es/base-ui/Input/Input.mjs +43 -0
- package/es/base-ui/Input/Input.mjs.map +1 -0
- package/es/base-ui/Input/InputNumber.d.mts +8 -0
- package/es/base-ui/Input/InputNumber.mjs +50 -0
- package/es/base-ui/Input/InputNumber.mjs.map +1 -0
- package/es/base-ui/Input/InputOTP.d.mts +8 -0
- package/es/base-ui/Input/InputOTP.mjs +31 -0
- package/es/base-ui/Input/InputOTP.mjs.map +1 -0
- package/es/base-ui/Input/InputPassword.d.mts +8 -0
- package/es/base-ui/Input/InputPassword.mjs +31 -0
- package/es/base-ui/Input/InputPassword.mjs.map +1 -0
- package/es/base-ui/Input/TextArea.d.mts +8 -0
- package/es/base-ui/Input/TextArea.mjs +43 -0
- package/es/base-ui/Input/TextArea.mjs.map +1 -0
- package/es/base-ui/Input/index.d.mts +7 -0
- package/es/base-ui/Input/style.d.mts +33 -0
- package/es/base-ui/Input/style.mjs +230 -0
- package/es/base-ui/Input/style.mjs.map +1 -0
- package/es/base-ui/Input/type.d.mts +122 -0
- package/es/base-ui/Select/style.mjs +4 -3
- package/es/base-ui/Select/style.mjs.map +1 -1
- package/es/base-ui/Slider/Slider.d.mts +8 -0
- package/es/base-ui/Slider/Slider.mjs +34 -0
- package/es/base-ui/Slider/Slider.mjs.map +1 -0
- package/es/base-ui/Slider/SliderWithInput.d.mts +8 -0
- package/es/base-ui/Slider/SliderWithInput.mjs +64 -0
- package/es/base-ui/Slider/SliderWithInput.mjs.map +1 -0
- package/es/base-ui/Slider/index.d.mts +4 -0
- package/es/base-ui/Slider/style.d.mts +11 -0
- package/es/base-ui/Slider/style.mjs +69 -0
- package/es/base-ui/Slider/style.mjs.map +1 -0
- package/es/base-ui/Slider/type.d.mts +47 -0
- package/es/base-ui/controlSize.d.mts +10 -0
- package/es/base-ui/controlSize.mjs +10 -0
- package/es/base-ui/controlSize.mjs.map +1 -0
- package/es/base-ui/index.d.mts +33 -4
- package/es/base-ui/index.mjs +28 -4
- package/es/eslint/index.mjs +25 -15
- package/es/eslint/index.mjs.map +1 -1
- package/es/node_modules/@types/hast/index.d.mts +642 -0
- package/package.json +4 -3
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { FlexboxProps } from "../../Flex/type.mjs";
|
|
2
|
+
import { DivProps } from "../../types/index.mjs";
|
|
3
|
+
import { IconProps } from "../../Icon/type.mjs";
|
|
4
|
+
import { TagProps } from "../../Tag/type.mjs";
|
|
5
|
+
import { ButtonProps } from "../Button/type.mjs";
|
|
6
|
+
import { CSSProperties, ComponentProps, ReactNode, Ref } from "react";
|
|
7
|
+
import { Field } from "@base-ui/react/field";
|
|
8
|
+
import { Form } from "@base-ui/react/form";
|
|
9
|
+
|
|
10
|
+
//#region src/base-ui/Form/type.d.ts
|
|
11
|
+
type FormVariant = 'filled' | 'outlined' | 'borderless';
|
|
12
|
+
type FormLayout = 'horizontal' | 'vertical';
|
|
13
|
+
type ItemsType = 'group' | 'flat';
|
|
14
|
+
type FormValues = Record<string, any>;
|
|
15
|
+
type BaseFormProps = Omit<ComponentProps<typeof Form>, 'render' | 'className' | 'style'>;
|
|
16
|
+
interface FormProps extends BaseFormProps {
|
|
17
|
+
activeKey?: (string | number)[];
|
|
18
|
+
className?: string;
|
|
19
|
+
classNames?: {
|
|
20
|
+
group?: string;
|
|
21
|
+
item?: string;
|
|
22
|
+
};
|
|
23
|
+
collapsible?: boolean;
|
|
24
|
+
defaultActiveKey?: (string | number)[];
|
|
25
|
+
footer?: ReactNode;
|
|
26
|
+
gap?: number | string;
|
|
27
|
+
/**
|
|
28
|
+
* Initial values distributed to fields as `defaultValue` by name.
|
|
29
|
+
* Also the baseline for unsaved-changes detection and native reset.
|
|
30
|
+
*/
|
|
31
|
+
initialValues?: FormValues;
|
|
32
|
+
itemMinWidth?: FormFieldProps['minWidth'];
|
|
33
|
+
items?: FormGroupItemType[] | FormFieldProps[];
|
|
34
|
+
itemsType?: ItemsType;
|
|
35
|
+
layout?: FormLayout;
|
|
36
|
+
onCollapse?: (key: (string | number)[]) => void;
|
|
37
|
+
/**
|
|
38
|
+
* Called with collected field values on submit. Async callbacks drive submit loading state.
|
|
39
|
+
*/
|
|
40
|
+
onFinish?: (values: FormValues, eventDetails: Parameters<NonNullable<BaseFormProps['onFormSubmit']>>[1]) => void | Promise<void>;
|
|
41
|
+
ref?: Ref<HTMLFormElement>;
|
|
42
|
+
style?: CSSProperties;
|
|
43
|
+
styles?: {
|
|
44
|
+
group?: CSSProperties;
|
|
45
|
+
item?: CSSProperties;
|
|
46
|
+
};
|
|
47
|
+
variant?: FormVariant;
|
|
48
|
+
}
|
|
49
|
+
interface FormFieldProps extends Omit<ComponentProps<typeof Field.Root>, 'render' | 'children' | 'className' | 'style'> {
|
|
50
|
+
avatar?: ReactNode;
|
|
51
|
+
children?: ReactNode;
|
|
52
|
+
className?: string;
|
|
53
|
+
desc?: ReactNode;
|
|
54
|
+
divider?: boolean;
|
|
55
|
+
hidden?: boolean;
|
|
56
|
+
label?: ReactNode;
|
|
57
|
+
layout?: FormLayout;
|
|
58
|
+
minWidth?: string | number;
|
|
59
|
+
required?: boolean;
|
|
60
|
+
style?: CSSProperties;
|
|
61
|
+
tag?: string;
|
|
62
|
+
variant?: FormVariant;
|
|
63
|
+
}
|
|
64
|
+
interface FormGroupItemType {
|
|
65
|
+
children: FormFieldProps[] | ReactNode;
|
|
66
|
+
collapsible?: boolean;
|
|
67
|
+
defaultActive?: boolean;
|
|
68
|
+
desc?: ReactNode;
|
|
69
|
+
extra?: ReactNode;
|
|
70
|
+
icon?: IconProps['icon'];
|
|
71
|
+
key?: string;
|
|
72
|
+
title: ReactNode;
|
|
73
|
+
variant?: FormVariant;
|
|
74
|
+
}
|
|
75
|
+
interface FormGroupProps extends Omit<DivProps, 'title'> {
|
|
76
|
+
active?: boolean;
|
|
77
|
+
collapsible?: boolean;
|
|
78
|
+
defaultActive?: boolean;
|
|
79
|
+
desc?: ReactNode;
|
|
80
|
+
extra?: ReactNode;
|
|
81
|
+
icon?: IconProps['icon'];
|
|
82
|
+
keyValue?: string | number;
|
|
83
|
+
onCollapse?: (active: boolean) => void;
|
|
84
|
+
title?: ReactNode;
|
|
85
|
+
variant?: FormVariant;
|
|
86
|
+
}
|
|
87
|
+
interface FormFlatGroupProps extends FlexboxProps {
|
|
88
|
+
variant?: FormVariant;
|
|
89
|
+
}
|
|
90
|
+
interface FormDividerProps extends DivProps {
|
|
91
|
+
visible?: boolean;
|
|
92
|
+
}
|
|
93
|
+
type FormFooterProps = FlexboxProps;
|
|
94
|
+
interface FormSubmitFooterProps extends Omit<FlexboxProps, 'onReset'> {
|
|
95
|
+
buttonProps?: Omit<ButtonProps, 'children'>;
|
|
96
|
+
enableReset?: boolean;
|
|
97
|
+
enableUnsavedWarning?: boolean;
|
|
98
|
+
float?: boolean;
|
|
99
|
+
onReset?: () => void;
|
|
100
|
+
resetButtonProps?: Omit<ButtonProps, 'children'>;
|
|
101
|
+
saveButtonProps?: Omit<ButtonProps, 'children'>;
|
|
102
|
+
texts?: {
|
|
103
|
+
reset?: string;
|
|
104
|
+
submit?: string;
|
|
105
|
+
unSaved?: string;
|
|
106
|
+
unSavedWarning?: string;
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
interface FormTitleProps extends Omit<FlexboxProps, 'title'> {
|
|
110
|
+
avatar?: ReactNode;
|
|
111
|
+
classNames?: {
|
|
112
|
+
content?: string;
|
|
113
|
+
desc?: string;
|
|
114
|
+
tag?: string;
|
|
115
|
+
title?: string;
|
|
116
|
+
};
|
|
117
|
+
desc?: ReactNode;
|
|
118
|
+
styles?: {
|
|
119
|
+
content?: CSSProperties;
|
|
120
|
+
desc?: CSSProperties;
|
|
121
|
+
tag?: CSSProperties;
|
|
122
|
+
title?: CSSProperties;
|
|
123
|
+
};
|
|
124
|
+
tag?: string;
|
|
125
|
+
tagProps?: Omit<TagProps, 'children'>;
|
|
126
|
+
title: ReactNode;
|
|
127
|
+
}
|
|
128
|
+
interface FormContextValue {
|
|
129
|
+
hasUnsavedChanges: boolean;
|
|
130
|
+
initialValues?: FormValues;
|
|
131
|
+
itemMinWidth?: FormFieldProps['minWidth'];
|
|
132
|
+
layout: FormLayout;
|
|
133
|
+
requestReset: () => void;
|
|
134
|
+
submitLoading: boolean;
|
|
135
|
+
variant: FormVariant;
|
|
136
|
+
}
|
|
137
|
+
//#endregion
|
|
138
|
+
export { FormContextValue, FormDividerProps, FormFieldProps, FormFlatGroupProps, FormFooterProps, FormGroupItemType, FormGroupProps, FormLayout, FormProps, FormSubmitFooterProps, FormTitleProps, FormValues, FormVariant, ItemsType };
|
|
139
|
+
//# sourceMappingURL=type.d.mts.map
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { rootVariants, styles } from "./style.mjs";
|
|
3
|
+
import { memo } from "react";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { cx, useThemeMode } from "antd-style";
|
|
6
|
+
import { Input } from "@base-ui/react/input";
|
|
7
|
+
//#region src/base-ui/Input/Input.tsx
|
|
8
|
+
const Input$1 = memo(({ ref, className, classNames, styles: customStyles, style, variant, shadow, size = "middle", prefix, suffix, disabled, ...rest }) => {
|
|
9
|
+
const { isDarkMode } = useThemeMode();
|
|
10
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
11
|
+
className: cx(rootVariants({
|
|
12
|
+
shadow,
|
|
13
|
+
size,
|
|
14
|
+
variant: variant || (isDarkMode ? "filled" : "outlined")
|
|
15
|
+
}), className),
|
|
16
|
+
"data-disabled": disabled ? "" : void 0,
|
|
17
|
+
style,
|
|
18
|
+
children: [
|
|
19
|
+
prefix && /* @__PURE__ */ jsx("span", {
|
|
20
|
+
className: cx(styles.slot, classNames?.prefix),
|
|
21
|
+
style: customStyles?.prefix,
|
|
22
|
+
children: prefix
|
|
23
|
+
}),
|
|
24
|
+
/* @__PURE__ */ jsx(Input, {
|
|
25
|
+
className: cx(styles.input, classNames?.input),
|
|
26
|
+
disabled,
|
|
27
|
+
ref,
|
|
28
|
+
style: customStyles?.input,
|
|
29
|
+
...rest
|
|
30
|
+
}),
|
|
31
|
+
suffix && /* @__PURE__ */ jsx("span", {
|
|
32
|
+
className: cx(styles.slot, classNames?.suffix),
|
|
33
|
+
style: customStyles?.suffix,
|
|
34
|
+
children: suffix
|
|
35
|
+
})
|
|
36
|
+
]
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
Input$1.displayName = "Input";
|
|
40
|
+
//#endregion
|
|
41
|
+
export { Input$1 as default };
|
|
42
|
+
|
|
43
|
+
//# sourceMappingURL=Input.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Input.mjs","names":["Input","BaseInput"],"sources":["../../../src/base-ui/Input/Input.tsx"],"sourcesContent":["'use client';\n\nimport { Input as BaseInput } from '@base-ui/react/input';\nimport { cx, useThemeMode } from 'antd-style';\nimport { memo } from 'react';\n\nimport { rootVariants, styles } from './style';\nimport type { InputProps } from './type';\n\nconst Input = memo<InputProps>(\n ({\n ref,\n className,\n classNames,\n styles: customStyles,\n style,\n variant,\n shadow,\n size = 'middle',\n prefix,\n suffix,\n disabled,\n ...rest\n }) => {\n const { isDarkMode } = useThemeMode();\n const mergedVariant = variant || (isDarkMode ? 'filled' : 'outlined');\n\n return (\n <div\n className={cx(rootVariants({ shadow, size, variant: mergedVariant }), className)}\n data-disabled={disabled ? '' : undefined}\n style={style}\n >\n {prefix && (\n <span className={cx(styles.slot, classNames?.prefix)} style={customStyles?.prefix}>\n {prefix}\n </span>\n )}\n <BaseInput\n className={cx(styles.input, classNames?.input)}\n disabled={disabled}\n ref={ref}\n style={customStyles?.input}\n {...rest}\n />\n {suffix && (\n <span className={cx(styles.slot, classNames?.suffix)} style={customStyles?.suffix}>\n {suffix}\n </span>\n )}\n </div>\n );\n },\n);\n\nInput.displayName = 'Input';\n\nexport default Input;\n"],"mappings":";;;;;;;AASA,MAAMA,UAAQ,MACX,EACC,KACA,WACA,YACA,QAAQ,cACR,OACA,SACA,QACA,OAAO,UACP,QACA,QACA,UACA,GAAG,WACC;CACJ,MAAM,EAAE,eAAe,cAAc;AAGrC,QACE,qBAAC,OAAD;EACE,WAAW,GAAG,aAAa;GAAE;GAAQ;GAAM,SAJzB,YAAY,aAAa,WAAW;GAIa,CAAC,EAAE,UAAU;EAChF,iBAAe,WAAW,KAAK,KAAA;EACxB;YAHT;GAKG,UACC,oBAAC,QAAD;IAAM,WAAW,GAAG,OAAO,MAAM,YAAY,OAAO;IAAE,OAAO,cAAc;cACxE;IACI,CAAA;GAET,oBAACC,OAAD;IACE,WAAW,GAAG,OAAO,OAAO,YAAY,MAAM;IACpC;IACL;IACL,OAAO,cAAc;IACrB,GAAI;IACJ,CAAA;GACD,UACC,oBAAC,QAAD;IAAM,WAAW,GAAG,OAAO,MAAM,YAAY,OAAO;IAAE,OAAO,cAAc;cACxE;IACI,CAAA;GAEL;;EAGX;AAED,QAAM,cAAc"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { InputNumberProps } from "./type.mjs";
|
|
2
|
+
import * as _$react from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/base-ui/Input/InputNumber.d.ts
|
|
5
|
+
declare const InputNumber: _$react.NamedExoticComponent<InputNumberProps>;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { InputNumber };
|
|
8
|
+
//# sourceMappingURL=InputNumber.d.mts.map
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import Icon from "../../Icon/Icon.mjs";
|
|
3
|
+
import { rootVariants, styles } from "./style.mjs";
|
|
4
|
+
import { memo } from "react";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { cx, useThemeMode } from "antd-style";
|
|
7
|
+
import { ChevronDown, ChevronUp } from "lucide-react";
|
|
8
|
+
import { NumberField } from "@base-ui/react/number-field";
|
|
9
|
+
//#region src/base-ui/Input/InputNumber.tsx
|
|
10
|
+
const InputNumber = memo(({ ref, className, classNames, styles: customStyles, style, variant, shadow, size = "middle", controls = true, changeOnWheel, onChange, placeholder, ...rest }) => {
|
|
11
|
+
const { isDarkMode } = useThemeMode();
|
|
12
|
+
const mergedVariant = variant || (isDarkMode ? "filled" : "outlined");
|
|
13
|
+
return /* @__PURE__ */ jsxs(NumberField.Root, {
|
|
14
|
+
allowWheelScrub: changeOnWheel,
|
|
15
|
+
className: cx(rootVariants({
|
|
16
|
+
shadow,
|
|
17
|
+
size,
|
|
18
|
+
variant: mergedVariant
|
|
19
|
+
}), className),
|
|
20
|
+
style,
|
|
21
|
+
onValueChange: onChange,
|
|
22
|
+
...rest,
|
|
23
|
+
children: [/* @__PURE__ */ jsx(NumberField.Input, {
|
|
24
|
+
className: cx(styles.input, styles.numberInput, classNames?.input),
|
|
25
|
+
placeholder,
|
|
26
|
+
ref,
|
|
27
|
+
style: customStyles?.input
|
|
28
|
+
}), controls && /* @__PURE__ */ jsxs("div", {
|
|
29
|
+
className: styles.numberControls,
|
|
30
|
+
children: [/* @__PURE__ */ jsx(NumberField.Increment, {
|
|
31
|
+
className: styles.numberControl,
|
|
32
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
33
|
+
icon: ChevronUp,
|
|
34
|
+
size: 12
|
|
35
|
+
})
|
|
36
|
+
}), /* @__PURE__ */ jsx(NumberField.Decrement, {
|
|
37
|
+
className: styles.numberControl,
|
|
38
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
39
|
+
icon: ChevronDown,
|
|
40
|
+
size: 12
|
|
41
|
+
})
|
|
42
|
+
})]
|
|
43
|
+
})]
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
InputNumber.displayName = "InputNumber";
|
|
47
|
+
//#endregion
|
|
48
|
+
export { InputNumber as default };
|
|
49
|
+
|
|
50
|
+
//# sourceMappingURL=InputNumber.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InputNumber.mjs","names":[],"sources":["../../../src/base-ui/Input/InputNumber.tsx"],"sourcesContent":["'use client';\n\nimport { NumberField } from '@base-ui/react/number-field';\nimport { cx, useThemeMode } from 'antd-style';\nimport { ChevronDown, ChevronUp } from 'lucide-react';\nimport { memo } from 'react';\n\nimport Icon from '@/Icon';\n\nimport { rootVariants, styles } from './style';\nimport type { InputNumberProps } from './type';\n\nconst InputNumber = memo<InputNumberProps>(\n ({\n ref,\n className,\n classNames,\n styles: customStyles,\n style,\n variant,\n shadow,\n size = 'middle',\n controls = true,\n changeOnWheel,\n onChange,\n placeholder,\n ...rest\n }) => {\n const { isDarkMode } = useThemeMode();\n const mergedVariant = variant || (isDarkMode ? 'filled' : 'outlined');\n\n return (\n <NumberField.Root\n allowWheelScrub={changeOnWheel}\n className={cx(rootVariants({ shadow, size, variant: mergedVariant }), className)}\n style={style}\n onValueChange={onChange}\n {...rest}\n >\n <NumberField.Input\n className={cx(styles.input, styles.numberInput, classNames?.input)}\n placeholder={placeholder}\n ref={ref}\n style={customStyles?.input}\n />\n {controls && (\n <div className={styles.numberControls}>\n <NumberField.Increment className={styles.numberControl}>\n <Icon icon={ChevronUp} size={12} />\n </NumberField.Increment>\n <NumberField.Decrement className={styles.numberControl}>\n <Icon icon={ChevronDown} size={12} />\n </NumberField.Decrement>\n </div>\n )}\n </NumberField.Root>\n );\n },\n);\n\nInputNumber.displayName = 'InputNumber';\n\nexport default InputNumber;\n"],"mappings":";;;;;;;;;AAYA,MAAM,cAAc,MACjB,EACC,KACA,WACA,YACA,QAAQ,cACR,OACA,SACA,QACA,OAAO,UACP,WAAW,MACX,eACA,UACA,aACA,GAAG,WACC;CACJ,MAAM,EAAE,eAAe,cAAc;CACrC,MAAM,gBAAgB,YAAY,aAAa,WAAW;AAE1D,QACE,qBAAC,YAAY,MAAb;EACE,iBAAiB;EACjB,WAAW,GAAG,aAAa;GAAE;GAAQ;GAAM,SAAS;GAAe,CAAC,EAAE,UAAU;EACzE;EACP,eAAe;EACf,GAAI;YALN,CAOE,oBAAC,YAAY,OAAb;GACE,WAAW,GAAG,OAAO,OAAO,OAAO,aAAa,YAAY,MAAM;GACrD;GACR;GACL,OAAO,cAAc;GACrB,CAAA,EACD,YACC,qBAAC,OAAD;GAAK,WAAW,OAAO;aAAvB,CACE,oBAAC,YAAY,WAAb;IAAuB,WAAW,OAAO;cACvC,oBAAC,MAAD;KAAM,MAAM;KAAW,MAAM;KAAM,CAAA;IACb,CAAA,EACxB,oBAAC,YAAY,WAAb;IAAuB,WAAW,OAAO;cACvC,oBAAC,MAAD;KAAM,MAAM;KAAa,MAAM;KAAM,CAAA;IACf,CAAA,CACpB;KAES;;EAGxB;AAED,YAAY,cAAc"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { InputOTPProps } from "./type.mjs";
|
|
2
|
+
import * as _$react from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/base-ui/Input/InputOTP.d.ts
|
|
5
|
+
declare const InputOTP: _$react.NamedExoticComponent<InputOTPProps>;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { InputOTP };
|
|
8
|
+
//# sourceMappingURL=InputOTP.d.mts.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { rootVariants, styles } from "./style.mjs";
|
|
3
|
+
import { memo } from "react";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { cx, useThemeMode } from "antd-style";
|
|
6
|
+
import { OTPField } from "@base-ui/react/otp-field";
|
|
7
|
+
//#region src/base-ui/Input/InputOTP.tsx
|
|
8
|
+
const InputOTP = memo(({ className, classNames, styles: customStyles, style, variant, shadow, size = "middle", length = 6, onChange, ...rest }) => {
|
|
9
|
+
const { isDarkMode } = useThemeMode();
|
|
10
|
+
const mergedVariant = variant || (isDarkMode ? "filled" : "outlined");
|
|
11
|
+
return /* @__PURE__ */ jsx(OTPField.Root, {
|
|
12
|
+
className: cx(styles.otpRoot, className),
|
|
13
|
+
length,
|
|
14
|
+
style,
|
|
15
|
+
onValueChange: onChange,
|
|
16
|
+
...rest,
|
|
17
|
+
children: Array.from({ length }, (_, index) => /* @__PURE__ */ jsx(OTPField.Input, {
|
|
18
|
+
style: customStyles?.input,
|
|
19
|
+
className: cx(rootVariants({
|
|
20
|
+
shadow,
|
|
21
|
+
size,
|
|
22
|
+
variant: mergedVariant
|
|
23
|
+
}), styles.otpCell, classNames?.input)
|
|
24
|
+
}, index))
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
InputOTP.displayName = "InputOTP";
|
|
28
|
+
//#endregion
|
|
29
|
+
export { InputOTP as default };
|
|
30
|
+
|
|
31
|
+
//# sourceMappingURL=InputOTP.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InputOTP.mjs","names":[],"sources":["../../../src/base-ui/Input/InputOTP.tsx"],"sourcesContent":["'use client';\n\nimport { OTPField } from '@base-ui/react/otp-field';\nimport { cx, useThemeMode } from 'antd-style';\nimport { memo } from 'react';\n\nimport { rootVariants, styles } from './style';\nimport type { InputOTPProps } from './type';\n\nconst InputOTP = memo<InputOTPProps>(\n ({\n className,\n classNames,\n styles: customStyles,\n style,\n variant,\n shadow,\n size = 'middle',\n length = 6,\n onChange,\n ...rest\n }) => {\n const { isDarkMode } = useThemeMode();\n const mergedVariant = variant || (isDarkMode ? 'filled' : 'outlined');\n\n return (\n <OTPField.Root\n className={cx(styles.otpRoot, className)}\n length={length}\n style={style}\n onValueChange={onChange}\n {...rest}\n >\n {Array.from({ length }, (_, index) => (\n <OTPField.Input\n key={index}\n style={customStyles?.input}\n className={cx(\n rootVariants({ shadow, size, variant: mergedVariant }),\n styles.otpCell,\n classNames?.input,\n )}\n />\n ))}\n </OTPField.Root>\n );\n },\n);\n\nInputOTP.displayName = 'InputOTP';\n\nexport default InputOTP;\n"],"mappings":";;;;;;;AASA,MAAM,WAAW,MACd,EACC,WACA,YACA,QAAQ,cACR,OACA,SACA,QACA,OAAO,UACP,SAAS,GACT,UACA,GAAG,WACC;CACJ,MAAM,EAAE,eAAe,cAAc;CACrC,MAAM,gBAAgB,YAAY,aAAa,WAAW;AAE1D,QACE,oBAAC,SAAS,MAAV;EACE,WAAW,GAAG,OAAO,SAAS,UAAU;EAChC;EACD;EACP,eAAe;EACf,GAAI;YAEH,MAAM,KAAK,EAAE,QAAQ,GAAG,GAAG,UAC1B,oBAAC,SAAS,OAAV;GAEE,OAAO,cAAc;GACrB,WAAW,GACT,aAAa;IAAE;IAAQ;IAAM,SAAS;IAAe,CAAC,EACtD,OAAO,SACP,YAAY,MACb;GACD,EAPK,MAOL,CACF;EACY,CAAA;EAGrB;AAED,SAAS,cAAc"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { InputPasswordProps } from "./type.mjs";
|
|
2
|
+
import * as _$react from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/base-ui/Input/InputPassword.d.ts
|
|
5
|
+
declare const InputPassword: _$react.NamedExoticComponent<InputPasswordProps>;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { InputPassword };
|
|
8
|
+
//# sourceMappingURL=InputPassword.d.mts.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import Icon from "../../Icon/Icon.mjs";
|
|
3
|
+
import { styles } from "./style.mjs";
|
|
4
|
+
import Input from "./Input.mjs";
|
|
5
|
+
import { memo, useState } from "react";
|
|
6
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { Eye, EyeOff } from "lucide-react";
|
|
8
|
+
//#region src/base-ui/Input/InputPassword.tsx
|
|
9
|
+
const InputPassword = memo(({ visibilityToggle = true, suffix, ...rest }) => {
|
|
10
|
+
const [visible, setVisible] = useState(false);
|
|
11
|
+
return /* @__PURE__ */ jsx(Input, {
|
|
12
|
+
type: visible ? "text" : "password",
|
|
13
|
+
suffix: /* @__PURE__ */ jsxs(Fragment$1, { children: [suffix, visibilityToggle && /* @__PURE__ */ jsx("button", {
|
|
14
|
+
"aria-label": visible ? "Hide password" : "Show password",
|
|
15
|
+
className: styles.passwordToggle,
|
|
16
|
+
tabIndex: -1,
|
|
17
|
+
type: "button",
|
|
18
|
+
onClick: () => setVisible((v) => !v),
|
|
19
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
20
|
+
icon: visible ? Eye : EyeOff,
|
|
21
|
+
size: 16
|
|
22
|
+
})
|
|
23
|
+
})] }),
|
|
24
|
+
...rest
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
InputPassword.displayName = "InputPassword";
|
|
28
|
+
//#endregion
|
|
29
|
+
export { InputPassword as default };
|
|
30
|
+
|
|
31
|
+
//# sourceMappingURL=InputPassword.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InputPassword.mjs","names":[],"sources":["../../../src/base-ui/Input/InputPassword.tsx"],"sourcesContent":["'use client';\n\nimport { Eye, EyeOff } from 'lucide-react';\nimport { memo, useState } from 'react';\n\nimport Icon from '@/Icon';\n\nimport Input from './Input';\nimport { styles } from './style';\nimport type { InputPasswordProps } from './type';\n\nconst InputPassword = memo<InputPasswordProps>(({ visibilityToggle = true, suffix, ...rest }) => {\n const [visible, setVisible] = useState(false);\n\n return (\n <Input\n type={visible ? 'text' : 'password'}\n suffix={\n <>\n {suffix}\n {visibilityToggle && (\n <button\n aria-label={visible ? 'Hide password' : 'Show password'}\n className={styles.passwordToggle}\n tabIndex={-1}\n type={'button'}\n onClick={() => setVisible((v) => !v)}\n >\n <Icon icon={visible ? Eye : EyeOff} size={16} />\n </button>\n )}\n </>\n }\n {...rest}\n />\n );\n});\n\nInputPassword.displayName = 'InputPassword';\n\nexport default InputPassword;\n"],"mappings":";;;;;;;;AAWA,MAAM,gBAAgB,MAA0B,EAAE,mBAAmB,MAAM,QAAQ,GAAG,WAAW;CAC/F,MAAM,CAAC,SAAS,cAAc,SAAS,MAAM;AAE7C,QACE,oBAAC,OAAD;EACE,MAAM,UAAU,SAAS;EACzB,QACE,qBAAA,YAAA,EAAA,UAAA,CACG,QACA,oBACC,oBAAC,UAAD;GACE,cAAY,UAAU,kBAAkB;GACxC,WAAW,OAAO;GAClB,UAAU;GACV,MAAM;GACN,eAAe,YAAY,MAAM,CAAC,EAAE;aAEpC,oBAAC,MAAD;IAAM,MAAM,UAAU,MAAM;IAAQ,MAAM;IAAM,CAAA;GACzC,CAAA,CAEV,EAAA,CAAA;EAEL,GAAI;EACJ,CAAA;EAEJ;AAEF,cAAc,cAAc"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { TextAreaProps } from "./type.mjs";
|
|
2
|
+
import * as _$react from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/base-ui/Input/TextArea.d.ts
|
|
5
|
+
declare const TextArea: _$react.NamedExoticComponent<TextAreaProps>;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { TextArea };
|
|
8
|
+
//# sourceMappingURL=TextArea.d.mts.map
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { rootVariants, styles } from "./style.mjs";
|
|
3
|
+
import { memo, useMemo } from "react";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { cx, useThemeMode } from "antd-style";
|
|
6
|
+
import { Field } from "@base-ui/react/field";
|
|
7
|
+
//#region src/base-ui/Input/TextArea.tsx
|
|
8
|
+
const TextArea = memo(({ ref, className, classNames, styles: customStyles, style, variant, shadow, autoSize, resize = false, disabled, ...rest }) => {
|
|
9
|
+
const { isDarkMode } = useThemeMode();
|
|
10
|
+
const mergedVariant = variant || (isDarkMode ? "filled" : "outlined");
|
|
11
|
+
const cssVariables = useMemo(() => {
|
|
12
|
+
if (typeof autoSize !== "object") return {};
|
|
13
|
+
return {
|
|
14
|
+
"--textarea-max-height": autoSize.maxRows ? `calc(1.5em * ${autoSize.maxRows})` : void 0,
|
|
15
|
+
"--textarea-min-rows": autoSize.minRows
|
|
16
|
+
};
|
|
17
|
+
}, [autoSize]);
|
|
18
|
+
return /* @__PURE__ */ jsx("div", {
|
|
19
|
+
"data-disabled": disabled ? "" : void 0,
|
|
20
|
+
style: {
|
|
21
|
+
...cssVariables,
|
|
22
|
+
...style
|
|
23
|
+
},
|
|
24
|
+
className: cx(rootVariants({
|
|
25
|
+
shadow,
|
|
26
|
+
variant: mergedVariant
|
|
27
|
+
}), styles.textarea, autoSize && styles.textareaAutoSize, resize && styles.textareaResize, className),
|
|
28
|
+
children: /* @__PURE__ */ jsx(Field.Control, {
|
|
29
|
+
className: cx(styles.input, classNames?.input),
|
|
30
|
+
disabled,
|
|
31
|
+
render: /* @__PURE__ */ jsx("textarea", {
|
|
32
|
+
ref,
|
|
33
|
+
...rest
|
|
34
|
+
}),
|
|
35
|
+
style: customStyles?.input
|
|
36
|
+
})
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
TextArea.displayName = "TextArea";
|
|
40
|
+
//#endregion
|
|
41
|
+
export { TextArea as default };
|
|
42
|
+
|
|
43
|
+
//# sourceMappingURL=TextArea.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextArea.mjs","names":[],"sources":["../../../src/base-ui/Input/TextArea.tsx"],"sourcesContent":["'use client';\n\nimport { Field } from '@base-ui/react/field';\nimport { cx, useThemeMode } from 'antd-style';\nimport { type CSSProperties, memo, useMemo } from 'react';\n\nimport { rootVariants, styles } from './style';\nimport type { TextAreaProps } from './type';\n\nconst TextArea = memo<TextAreaProps>(\n ({\n ref,\n className,\n classNames,\n styles: customStyles,\n style,\n variant,\n shadow,\n autoSize,\n resize = false,\n disabled,\n ...rest\n }) => {\n const { isDarkMode } = useThemeMode();\n const mergedVariant = variant || (isDarkMode ? 'filled' : 'outlined');\n\n const cssVariables = useMemo<CSSProperties>(() => {\n if (typeof autoSize !== 'object') return {};\n return {\n '--textarea-max-height': autoSize.maxRows ? `calc(1.5em * ${autoSize.maxRows})` : undefined,\n '--textarea-min-rows': autoSize.minRows,\n } as CSSProperties;\n }, [autoSize]);\n\n return (\n <div\n data-disabled={disabled ? '' : undefined}\n style={{ ...cssVariables, ...style }}\n className={cx(\n rootVariants({ shadow, variant: mergedVariant }),\n styles.textarea,\n autoSize && styles.textareaAutoSize,\n resize && styles.textareaResize,\n className,\n )}\n >\n <Field.Control\n className={cx(styles.input, classNames?.input)}\n disabled={disabled}\n render={<textarea ref={ref} {...rest} />}\n style={customStyles?.input}\n />\n </div>\n );\n },\n);\n\nTextArea.displayName = 'TextArea';\n\nexport default TextArea;\n"],"mappings":";;;;;;;AASA,MAAM,WAAW,MACd,EACC,KACA,WACA,YACA,QAAQ,cACR,OACA,SACA,QACA,UACA,SAAS,OACT,UACA,GAAG,WACC;CACJ,MAAM,EAAE,eAAe,cAAc;CACrC,MAAM,gBAAgB,YAAY,aAAa,WAAW;CAE1D,MAAM,eAAe,cAA6B;AAChD,MAAI,OAAO,aAAa,SAAU,QAAO,EAAE;AAC3C,SAAO;GACL,yBAAyB,SAAS,UAAU,gBAAgB,SAAS,QAAQ,KAAK,KAAA;GAClF,uBAAuB,SAAS;GACjC;IACA,CAAC,SAAS,CAAC;AAEd,QACE,oBAAC,OAAD;EACE,iBAAe,WAAW,KAAK,KAAA;EAC/B,OAAO;GAAE,GAAG;GAAc,GAAG;GAAO;EACpC,WAAW,GACT,aAAa;GAAE;GAAQ,SAAS;GAAe,CAAC,EAChD,OAAO,UACP,YAAY,OAAO,kBACnB,UAAU,OAAO,gBACjB,UACD;YAED,oBAAC,MAAM,SAAP;GACE,WAAW,GAAG,OAAO,OAAO,YAAY,MAAM;GACpC;GACV,QAAQ,oBAAC,YAAD;IAAe;IAAK,GAAI;IAAQ,CAAA;GACxC,OAAO,cAAc;GACrB,CAAA;EACE,CAAA;EAGX;AAED,SAAS,cAAc"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { InputClassNames, InputNumberProps, InputOTPProps, InputPasswordProps, InputProps, InputSize, InputStyles, InputVariant, TextAreaAutoSize, TextAreaProps } from "./type.mjs";
|
|
2
|
+
import { Input } from "./Input.mjs";
|
|
3
|
+
import { InputNumber } from "./InputNumber.mjs";
|
|
4
|
+
import { InputOTP } from "./InputOTP.mjs";
|
|
5
|
+
import { InputPassword } from "./InputPassword.mjs";
|
|
6
|
+
import { rootVariants, styles } from "./style.mjs";
|
|
7
|
+
import { TextArea } from "./TextArea.mjs";
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as _$class_variance_authority_types0 from "class-variance-authority/types";
|
|
2
|
+
|
|
3
|
+
//#region src/base-ui/Input/style.d.ts
|
|
4
|
+
declare const styles: {
|
|
5
|
+
borderless: string;
|
|
6
|
+
filled: string;
|
|
7
|
+
input: string;
|
|
8
|
+
invalid: string;
|
|
9
|
+
outlined: string;
|
|
10
|
+
root: string;
|
|
11
|
+
shadow: string;
|
|
12
|
+
sizeLarge: string;
|
|
13
|
+
sizeMiddle: string;
|
|
14
|
+
sizeSmall: string;
|
|
15
|
+
numberControl: string;
|
|
16
|
+
numberControls: string;
|
|
17
|
+
numberInput: string;
|
|
18
|
+
otpCell: string;
|
|
19
|
+
otpRoot: string;
|
|
20
|
+
passwordToggle: string;
|
|
21
|
+
slot: string;
|
|
22
|
+
textarea: string;
|
|
23
|
+
textareaAutoSize: string;
|
|
24
|
+
textareaResize: string;
|
|
25
|
+
};
|
|
26
|
+
declare const rootVariants: (props?: ({
|
|
27
|
+
shadow?: boolean | null | undefined;
|
|
28
|
+
size?: "small" | "large" | "middle" | null | undefined;
|
|
29
|
+
variant?: "filled" | "outlined" | "borderless" | null | undefined;
|
|
30
|
+
} & _$class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
31
|
+
//#endregion
|
|
32
|
+
export { rootVariants, styles };
|
|
33
|
+
//# sourceMappingURL=style.d.mts.map
|