@lobehub/ui 5.19.3 → 5.20.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.
- 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 +4 -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/package.json +4 -3
|
@@ -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
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
import { staticStylish } from "../../styles/theme/customStylishStatic.mjs";
|
|
2
|
+
import { controlHeight } from "../controlSize.mjs";
|
|
3
|
+
import { createStaticStyles } from "antd-style";
|
|
4
|
+
import { cva } from "class-variance-authority";
|
|
5
|
+
//#region src/base-ui/Input/style.ts
|
|
6
|
+
const styles = createStaticStyles(({ css, cssVar }) => ({
|
|
7
|
+
borderless: css`
|
|
8
|
+
border: 1px solid transparent;
|
|
9
|
+
background: none;
|
|
10
|
+
`,
|
|
11
|
+
filled: css`
|
|
12
|
+
border: 1px solid transparent;
|
|
13
|
+
background: ${cssVar.colorFillTertiary};
|
|
14
|
+
|
|
15
|
+
&:hover:not(:focus-within, [data-disabled]) {
|
|
16
|
+
background: ${cssVar.colorFillSecondary};
|
|
17
|
+
}
|
|
18
|
+
`,
|
|
19
|
+
input: css`
|
|
20
|
+
flex: 1;
|
|
21
|
+
|
|
22
|
+
min-width: 0;
|
|
23
|
+
padding: 0;
|
|
24
|
+
border: none;
|
|
25
|
+
|
|
26
|
+
font: inherit;
|
|
27
|
+
color: inherit;
|
|
28
|
+
|
|
29
|
+
appearance: none;
|
|
30
|
+
background: transparent;
|
|
31
|
+
outline: none;
|
|
32
|
+
|
|
33
|
+
&::placeholder {
|
|
34
|
+
color: ${cssVar.colorTextPlaceholder};
|
|
35
|
+
}
|
|
36
|
+
`,
|
|
37
|
+
invalid: css`
|
|
38
|
+
&:has([data-invalid]) {
|
|
39
|
+
border-color: ${cssVar.colorError};
|
|
40
|
+
|
|
41
|
+
&:focus-within {
|
|
42
|
+
border-color: ${cssVar.colorError};
|
|
43
|
+
box-shadow: 0 0 0 2px ${cssVar.colorErrorBg};
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
`,
|
|
47
|
+
outlined: css`
|
|
48
|
+
border: 1px solid ${cssVar.colorBorderSecondary};
|
|
49
|
+
background: ${cssVar.colorBgContainer};
|
|
50
|
+
|
|
51
|
+
&:hover:not(:focus-within, [data-disabled]) {
|
|
52
|
+
border-color: ${cssVar.colorBorder};
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
&:focus-within {
|
|
56
|
+
border-color: ${cssVar.colorPrimary};
|
|
57
|
+
box-shadow: 0 0 0 2px ${cssVar.colorPrimaryBg};
|
|
58
|
+
}
|
|
59
|
+
`,
|
|
60
|
+
root: css`
|
|
61
|
+
cursor: text;
|
|
62
|
+
|
|
63
|
+
display: inline-flex;
|
|
64
|
+
gap: 8px;
|
|
65
|
+
align-items: center;
|
|
66
|
+
|
|
67
|
+
box-sizing: border-box;
|
|
68
|
+
width: 100%;
|
|
69
|
+
padding-inline: 12px;
|
|
70
|
+
border-radius: ${cssVar.borderRadius};
|
|
71
|
+
|
|
72
|
+
font-size: 14px;
|
|
73
|
+
color: ${cssVar.colorText};
|
|
74
|
+
|
|
75
|
+
transition:
|
|
76
|
+
background 150ms ${cssVar.motionEaseOut},
|
|
77
|
+
border-color 150ms ${cssVar.motionEaseOut},
|
|
78
|
+
box-shadow 150ms ${cssVar.motionEaseOut};
|
|
79
|
+
|
|
80
|
+
&[data-disabled],
|
|
81
|
+
&:has(:disabled) {
|
|
82
|
+
cursor: not-allowed;
|
|
83
|
+
color: ${cssVar.colorTextQuaternary};
|
|
84
|
+
opacity: 0.66;
|
|
85
|
+
}
|
|
86
|
+
`,
|
|
87
|
+
shadow: staticStylish.shadow,
|
|
88
|
+
sizeLarge: css`
|
|
89
|
+
height: ${controlHeight.large}px;
|
|
90
|
+
border-radius: ${cssVar.borderRadiusLG};
|
|
91
|
+
font-size: 16px;
|
|
92
|
+
`,
|
|
93
|
+
sizeMiddle: css`
|
|
94
|
+
height: ${controlHeight.middle}px;
|
|
95
|
+
`,
|
|
96
|
+
sizeSmall: css`
|
|
97
|
+
height: ${controlHeight.small}px;
|
|
98
|
+
padding-inline: 8px;
|
|
99
|
+
border-radius: ${cssVar.borderRadiusSM};
|
|
100
|
+
font-size: 12px;
|
|
101
|
+
`,
|
|
102
|
+
numberControl: css`
|
|
103
|
+
cursor: pointer;
|
|
104
|
+
|
|
105
|
+
display: flex;
|
|
106
|
+
flex: 1;
|
|
107
|
+
align-items: center;
|
|
108
|
+
justify-content: center;
|
|
109
|
+
|
|
110
|
+
margin: 0;
|
|
111
|
+
padding: 0;
|
|
112
|
+
border: none;
|
|
113
|
+
|
|
114
|
+
color: ${cssVar.colorTextTertiary};
|
|
115
|
+
|
|
116
|
+
background: none;
|
|
117
|
+
outline: none;
|
|
118
|
+
|
|
119
|
+
transition: color 150ms ${cssVar.motionEaseOut};
|
|
120
|
+
|
|
121
|
+
&:hover:not(:disabled) {
|
|
122
|
+
color: ${cssVar.colorText};
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
&:disabled {
|
|
126
|
+
cursor: not-allowed;
|
|
127
|
+
opacity: 0.4;
|
|
128
|
+
}
|
|
129
|
+
`,
|
|
130
|
+
numberControls: css`
|
|
131
|
+
display: flex;
|
|
132
|
+
flex: none;
|
|
133
|
+
flex-direction: column;
|
|
134
|
+
align-self: stretch;
|
|
135
|
+
|
|
136
|
+
width: 22px;
|
|
137
|
+
margin-inline-end: -8px;
|
|
138
|
+
border-inline-start: 1px solid ${cssVar.colorBorderSecondary};
|
|
139
|
+
`,
|
|
140
|
+
numberInput: css`
|
|
141
|
+
font-variant-numeric: tabular-nums;
|
|
142
|
+
`,
|
|
143
|
+
otpCell: css`
|
|
144
|
+
flex: none;
|
|
145
|
+
width: ${controlHeight.middle}px;
|
|
146
|
+
padding-inline: 0;
|
|
147
|
+
text-align: center;
|
|
148
|
+
`,
|
|
149
|
+
otpRoot: css`
|
|
150
|
+
display: inline-flex;
|
|
151
|
+
gap: 8px;
|
|
152
|
+
align-items: center;
|
|
153
|
+
`,
|
|
154
|
+
passwordToggle: css`
|
|
155
|
+
cursor: pointer;
|
|
156
|
+
|
|
157
|
+
display: inline-flex;
|
|
158
|
+
align-items: center;
|
|
159
|
+
justify-content: center;
|
|
160
|
+
|
|
161
|
+
margin: 0;
|
|
162
|
+
padding: 0;
|
|
163
|
+
border: none;
|
|
164
|
+
|
|
165
|
+
color: ${cssVar.colorTextTertiary};
|
|
166
|
+
|
|
167
|
+
background: none;
|
|
168
|
+
outline: none;
|
|
169
|
+
|
|
170
|
+
transition: color 150ms ${cssVar.motionEaseOut};
|
|
171
|
+
|
|
172
|
+
&:hover {
|
|
173
|
+
color: ${cssVar.colorText};
|
|
174
|
+
}
|
|
175
|
+
`,
|
|
176
|
+
slot: css`
|
|
177
|
+
display: inline-flex;
|
|
178
|
+
flex: none;
|
|
179
|
+
align-items: center;
|
|
180
|
+
color: ${cssVar.colorTextTertiary};
|
|
181
|
+
`,
|
|
182
|
+
textarea: css`
|
|
183
|
+
height: auto;
|
|
184
|
+
padding-block: 8px;
|
|
185
|
+
|
|
186
|
+
textarea {
|
|
187
|
+
resize: none;
|
|
188
|
+
min-height: calc(1.5em * var(--textarea-min-rows, 2));
|
|
189
|
+
max-height: var(--textarea-max-height, none);
|
|
190
|
+
line-height: 1.5;
|
|
191
|
+
}
|
|
192
|
+
`,
|
|
193
|
+
textareaAutoSize: css`
|
|
194
|
+
textarea {
|
|
195
|
+
field-sizing: content;
|
|
196
|
+
}
|
|
197
|
+
`,
|
|
198
|
+
textareaResize: css`
|
|
199
|
+
textarea {
|
|
200
|
+
resize: vertical;
|
|
201
|
+
}
|
|
202
|
+
`
|
|
203
|
+
}));
|
|
204
|
+
const rootVariants = cva([styles.root, styles.invalid], {
|
|
205
|
+
defaultVariants: {
|
|
206
|
+
shadow: false,
|
|
207
|
+
size: "middle",
|
|
208
|
+
variant: "outlined"
|
|
209
|
+
},
|
|
210
|
+
variants: {
|
|
211
|
+
shadow: {
|
|
212
|
+
false: null,
|
|
213
|
+
true: styles.shadow
|
|
214
|
+
},
|
|
215
|
+
size: {
|
|
216
|
+
large: styles.sizeLarge,
|
|
217
|
+
middle: styles.sizeMiddle,
|
|
218
|
+
small: styles.sizeSmall
|
|
219
|
+
},
|
|
220
|
+
variant: {
|
|
221
|
+
borderless: styles.borderless,
|
|
222
|
+
filled: styles.filled,
|
|
223
|
+
outlined: styles.outlined
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
});
|
|
227
|
+
//#endregion
|
|
228
|
+
export { rootVariants, styles };
|
|
229
|
+
|
|
230
|
+
//# sourceMappingURL=style.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style.mjs","names":["lobeStaticStylish"],"sources":["../../../src/base-ui/Input/style.ts"],"sourcesContent":["import { createStaticStyles } from 'antd-style';\nimport { cva } from 'class-variance-authority';\n\nimport { controlHeight } from '@/base-ui/controlSize';\nimport { lobeStaticStylish } from '@/styles';\n\nexport const styles = createStaticStyles(({ css, cssVar }) => ({\n borderless: css`\n border: 1px solid transparent;\n background: none;\n `,\n filled: css`\n border: 1px solid transparent;\n background: ${cssVar.colorFillTertiary};\n\n &:hover:not(:focus-within, [data-disabled]) {\n background: ${cssVar.colorFillSecondary};\n }\n `,\n input: css`\n flex: 1;\n\n min-width: 0;\n padding: 0;\n border: none;\n\n font: inherit;\n color: inherit;\n\n appearance: none;\n background: transparent;\n outline: none;\n\n &::placeholder {\n color: ${cssVar.colorTextPlaceholder};\n }\n `,\n invalid: css`\n &:has([data-invalid]) {\n border-color: ${cssVar.colorError};\n\n &:focus-within {\n border-color: ${cssVar.colorError};\n box-shadow: 0 0 0 2px ${cssVar.colorErrorBg};\n }\n }\n `,\n outlined: css`\n border: 1px solid ${cssVar.colorBorderSecondary};\n background: ${cssVar.colorBgContainer};\n\n &:hover:not(:focus-within, [data-disabled]) {\n border-color: ${cssVar.colorBorder};\n }\n\n &:focus-within {\n border-color: ${cssVar.colorPrimary};\n box-shadow: 0 0 0 2px ${cssVar.colorPrimaryBg};\n }\n `,\n root: css`\n cursor: text;\n\n display: inline-flex;\n gap: 8px;\n align-items: center;\n\n box-sizing: border-box;\n width: 100%;\n padding-inline: 12px;\n border-radius: ${cssVar.borderRadius};\n\n font-size: 14px;\n color: ${cssVar.colorText};\n\n transition:\n background 150ms ${cssVar.motionEaseOut},\n border-color 150ms ${cssVar.motionEaseOut},\n box-shadow 150ms ${cssVar.motionEaseOut};\n\n &[data-disabled],\n &:has(:disabled) {\n cursor: not-allowed;\n color: ${cssVar.colorTextQuaternary};\n opacity: 0.66;\n }\n `,\n shadow: lobeStaticStylish.shadow,\n sizeLarge: css`\n height: ${controlHeight.large}px;\n border-radius: ${cssVar.borderRadiusLG};\n font-size: 16px;\n `,\n sizeMiddle: css`\n height: ${controlHeight.middle}px;\n `,\n sizeSmall: css`\n height: ${controlHeight.small}px;\n padding-inline: 8px;\n border-radius: ${cssVar.borderRadiusSM};\n font-size: 12px;\n `,\n numberControl: css`\n cursor: pointer;\n\n display: flex;\n flex: 1;\n align-items: center;\n justify-content: center;\n\n margin: 0;\n padding: 0;\n border: none;\n\n color: ${cssVar.colorTextTertiary};\n\n background: none;\n outline: none;\n\n transition: color 150ms ${cssVar.motionEaseOut};\n\n &:hover:not(:disabled) {\n color: ${cssVar.colorText};\n }\n\n &:disabled {\n cursor: not-allowed;\n opacity: 0.4;\n }\n `,\n numberControls: css`\n display: flex;\n flex: none;\n flex-direction: column;\n align-self: stretch;\n\n width: 22px;\n margin-inline-end: -8px;\n border-inline-start: 1px solid ${cssVar.colorBorderSecondary};\n `,\n numberInput: css`\n font-variant-numeric: tabular-nums;\n `,\n otpCell: css`\n flex: none;\n width: ${controlHeight.middle}px;\n padding-inline: 0;\n text-align: center;\n `,\n otpRoot: css`\n display: inline-flex;\n gap: 8px;\n align-items: center;\n `,\n passwordToggle: css`\n cursor: pointer;\n\n display: inline-flex;\n align-items: center;\n justify-content: center;\n\n margin: 0;\n padding: 0;\n border: none;\n\n color: ${cssVar.colorTextTertiary};\n\n background: none;\n outline: none;\n\n transition: color 150ms ${cssVar.motionEaseOut};\n\n &:hover {\n color: ${cssVar.colorText};\n }\n `,\n slot: css`\n display: inline-flex;\n flex: none;\n align-items: center;\n color: ${cssVar.colorTextTertiary};\n `,\n textarea: css`\n height: auto;\n padding-block: 8px;\n\n textarea {\n resize: none;\n min-height: calc(1.5em * var(--textarea-min-rows, 2));\n max-height: var(--textarea-max-height, none);\n line-height: 1.5;\n }\n `,\n textareaAutoSize: css`\n textarea {\n field-sizing: content;\n }\n `,\n textareaResize: css`\n textarea {\n resize: vertical;\n }\n `,\n}));\n\nexport const rootVariants = cva([styles.root, styles.invalid], {\n defaultVariants: {\n shadow: false,\n size: 'middle',\n variant: 'outlined',\n },\n variants: {\n shadow: {\n false: null,\n true: styles.shadow,\n },\n size: {\n large: styles.sizeLarge,\n middle: styles.sizeMiddle,\n small: styles.sizeSmall,\n },\n variant: {\n borderless: styles.borderless,\n filled: styles.filled,\n outlined: styles.outlined,\n },\n },\n});\n"],"mappings":";;;;;AAMA,MAAa,SAAS,oBAAoB,EAAE,KAAK,cAAc;CAC7D,YAAY,GAAG;;;;CAIf,QAAQ,GAAG;;kBAEK,OAAO,kBAAkB;;;oBAGvB,OAAO,mBAAmB;;;CAG5C,OAAO,GAAG;;;;;;;;;;;;;;;eAeG,OAAO,qBAAqB;;;CAGzC,SAAS,GAAG;;sBAEQ,OAAO,WAAW;;;wBAGhB,OAAO,WAAW;gCACV,OAAO,aAAa;;;;CAIlD,UAAU,GAAG;wBACS,OAAO,qBAAqB;kBAClC,OAAO,iBAAiB;;;sBAGpB,OAAO,YAAY;;;;sBAInB,OAAO,aAAa;8BACZ,OAAO,eAAe;;;CAGlD,MAAM,GAAG;;;;;;;;;;qBAUU,OAAO,aAAa;;;aAG5B,OAAO,UAAU;;;yBAGL,OAAO,cAAc;2BACnB,OAAO,cAAc;yBACvB,OAAO,cAAc;;;;;eAK/B,OAAO,oBAAoB;;;;CAIxC,QAAQA,cAAkB;CAC1B,WAAW,GAAG;cACF,cAAc,MAAM;qBACb,OAAO,eAAe;;;CAGzC,YAAY,GAAG;cACH,cAAc,OAAO;;CAEjC,WAAW,GAAG;cACF,cAAc,MAAM;;qBAEb,OAAO,eAAe;;;CAGzC,eAAe,GAAG;;;;;;;;;;;;aAYP,OAAO,kBAAkB;;;;;8BAKR,OAAO,cAAc;;;eAGpC,OAAO,UAAU;;;;;;;;CAQ9B,gBAAgB,GAAG;;;;;;;;qCAQgB,OAAO,qBAAqB;;CAE/D,aAAa,GAAG;;;CAGhB,SAAS,GAAG;;aAED,cAAc,OAAO;;;;CAIhC,SAAS,GAAG;;;;;CAKZ,gBAAgB,GAAG;;;;;;;;;;;aAWR,OAAO,kBAAkB;;;;;8BAKR,OAAO,cAAc;;;eAGpC,OAAO,UAAU;;;CAG9B,MAAM,GAAG;;;;aAIE,OAAO,kBAAkB;;CAEpC,UAAU,GAAG;;;;;;;;;;;CAWb,kBAAkB,GAAG;;;;;CAKrB,gBAAgB,GAAG;;;;;CAKpB,EAAE;AAEH,MAAa,eAAe,IAAI,CAAC,OAAO,MAAM,OAAO,QAAQ,EAAE;CAC7D,iBAAiB;EACf,QAAQ;EACR,MAAM;EACN,SAAS;EACV;CACD,UAAU;EACR,QAAQ;GACN,OAAO;GACP,MAAM,OAAO;GACd;EACD,MAAM;GACJ,OAAO,OAAO;GACd,QAAQ,OAAO;GACf,OAAO,OAAO;GACf;EACD,SAAS;GACP,YAAY,OAAO;GACnB,QAAQ,OAAO;GACf,UAAU,OAAO;GAClB;EACF;CACF,CAAC"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { CSSProperties, ComponentProps, ReactNode, Ref } from "react";
|
|
2
|
+
import { Input } from "@base-ui/react/input";
|
|
3
|
+
import { NumberField } from "@base-ui/react/number-field";
|
|
4
|
+
import { OTPField } from "@base-ui/react/otp-field";
|
|
5
|
+
|
|
6
|
+
//#region src/base-ui/Input/type.d.ts
|
|
7
|
+
type InputVariant = 'filled' | 'outlined' | 'borderless';
|
|
8
|
+
type InputSize = 'small' | 'middle' | 'large';
|
|
9
|
+
interface InputClassNames {
|
|
10
|
+
input?: string;
|
|
11
|
+
prefix?: string;
|
|
12
|
+
suffix?: string;
|
|
13
|
+
}
|
|
14
|
+
interface InputStyles {
|
|
15
|
+
input?: CSSProperties;
|
|
16
|
+
prefix?: CSSProperties;
|
|
17
|
+
suffix?: CSSProperties;
|
|
18
|
+
}
|
|
19
|
+
type BaseInputProps = Omit<ComponentProps<typeof Input>, 'size' | 'prefix' | 'render' | 'className' | 'style'>;
|
|
20
|
+
interface InputProps extends BaseInputProps {
|
|
21
|
+
className?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Custom class names for each part
|
|
24
|
+
*/
|
|
25
|
+
classNames?: InputClassNames;
|
|
26
|
+
/**
|
|
27
|
+
* Prefix node rendered before the input
|
|
28
|
+
*/
|
|
29
|
+
prefix?: ReactNode;
|
|
30
|
+
/**
|
|
31
|
+
* Reference to the input element
|
|
32
|
+
*/
|
|
33
|
+
ref?: Ref<HTMLInputElement>;
|
|
34
|
+
/**
|
|
35
|
+
* Apply lobe shadow style
|
|
36
|
+
*/
|
|
37
|
+
shadow?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Size of the input
|
|
40
|
+
* @default 'middle'
|
|
41
|
+
*/
|
|
42
|
+
size?: InputSize;
|
|
43
|
+
style?: CSSProperties;
|
|
44
|
+
/**
|
|
45
|
+
* Custom styles for each part
|
|
46
|
+
*/
|
|
47
|
+
styles?: InputStyles;
|
|
48
|
+
/**
|
|
49
|
+
* Suffix node rendered after the input
|
|
50
|
+
*/
|
|
51
|
+
suffix?: ReactNode;
|
|
52
|
+
/**
|
|
53
|
+
* Visual variant, defaults to `filled` in dark mode and `outlined` in light mode
|
|
54
|
+
*/
|
|
55
|
+
variant?: InputVariant;
|
|
56
|
+
}
|
|
57
|
+
interface InputPasswordProps extends Omit<InputProps, 'type'> {
|
|
58
|
+
/**
|
|
59
|
+
* Show the eye toggle button
|
|
60
|
+
* @default true
|
|
61
|
+
*/
|
|
62
|
+
visibilityToggle?: boolean;
|
|
63
|
+
}
|
|
64
|
+
type BaseNumberFieldProps = Omit<ComponentProps<typeof NumberField.Root>, 'className' | 'style' | 'render' | 'onValueChange' | 'children'>;
|
|
65
|
+
interface InputNumberProps extends BaseNumberFieldProps {
|
|
66
|
+
/**
|
|
67
|
+
* Change value on wheel scrub
|
|
68
|
+
*/
|
|
69
|
+
changeOnWheel?: boolean;
|
|
70
|
+
className?: string;
|
|
71
|
+
classNames?: Pick<InputClassNames, 'input'>;
|
|
72
|
+
/**
|
|
73
|
+
* Show increment/decrement buttons
|
|
74
|
+
* @default true
|
|
75
|
+
*/
|
|
76
|
+
controls?: boolean;
|
|
77
|
+
onChange?: (value: number | null) => void;
|
|
78
|
+
placeholder?: string;
|
|
79
|
+
ref?: Ref<HTMLInputElement>;
|
|
80
|
+
shadow?: boolean;
|
|
81
|
+
size?: InputSize;
|
|
82
|
+
style?: CSSProperties;
|
|
83
|
+
styles?: Pick<InputStyles, 'input'>;
|
|
84
|
+
variant?: InputVariant;
|
|
85
|
+
}
|
|
86
|
+
type BaseOTPFieldProps = Omit<ComponentProps<typeof OTPField.Root>, 'className' | 'style' | 'render' | 'onValueChange' | 'children' | 'length'>;
|
|
87
|
+
interface InputOTPProps extends BaseOTPFieldProps {
|
|
88
|
+
className?: string;
|
|
89
|
+
classNames?: Pick<InputClassNames, 'input'>;
|
|
90
|
+
/**
|
|
91
|
+
* Number of cells
|
|
92
|
+
* @default 6
|
|
93
|
+
*/
|
|
94
|
+
length?: number;
|
|
95
|
+
onChange?: (value: string) => void;
|
|
96
|
+
shadow?: boolean;
|
|
97
|
+
size?: InputSize;
|
|
98
|
+
style?: CSSProperties;
|
|
99
|
+
styles?: Pick<InputStyles, 'input'>;
|
|
100
|
+
variant?: InputVariant;
|
|
101
|
+
}
|
|
102
|
+
type TextAreaAutoSize = boolean | {
|
|
103
|
+
maxRows?: number;
|
|
104
|
+
minRows?: number;
|
|
105
|
+
};
|
|
106
|
+
interface TextAreaProps extends Omit<ComponentProps<'textarea'>, 'prefix'>, Pick<InputProps, 'shadow' | 'variant'> {
|
|
107
|
+
/**
|
|
108
|
+
* Auto grow with content, optionally bounded by minRows/maxRows
|
|
109
|
+
*/
|
|
110
|
+
autoSize?: TextAreaAutoSize;
|
|
111
|
+
classNames?: Pick<InputClassNames, 'input'>;
|
|
112
|
+
ref?: Ref<HTMLTextAreaElement>;
|
|
113
|
+
/**
|
|
114
|
+
* Allow manual resize
|
|
115
|
+
* @default false
|
|
116
|
+
*/
|
|
117
|
+
resize?: boolean;
|
|
118
|
+
styles?: Pick<InputStyles, 'input'>;
|
|
119
|
+
}
|
|
120
|
+
//#endregion
|
|
121
|
+
export { InputClassNames, InputNumberProps, InputOTPProps, InputPasswordProps, InputProps, InputSize, InputStyles, InputVariant, TextAreaAutoSize, TextAreaProps };
|
|
122
|
+
//# sourceMappingURL=type.d.mts.map
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { staticStylish } from "../../styles/theme/customStylishStatic.mjs";
|
|
2
|
+
import { controlHeight } from "../controlSize.mjs";
|
|
2
3
|
import { createStaticStyles, cx } from "antd-style";
|
|
3
4
|
import { cva } from "class-variance-authority";
|
|
4
5
|
//#region src/base-ui/Select/style.ts
|
|
@@ -251,7 +252,7 @@ const styles = createStaticStyles(({ css, cssVar }) => ({
|
|
|
251
252
|
}
|
|
252
253
|
`,
|
|
253
254
|
triggerLarge: css`
|
|
254
|
-
min-height:
|
|
255
|
+
min-height: ${controlHeight.large}px;
|
|
255
256
|
padding-block: 6px;
|
|
256
257
|
padding-inline: 12px;
|
|
257
258
|
|
|
@@ -259,7 +260,7 @@ const styles = createStaticStyles(({ css, cssVar }) => ({
|
|
|
259
260
|
line-height: 24px;
|
|
260
261
|
`,
|
|
261
262
|
triggerMiddle: css`
|
|
262
|
-
min-height:
|
|
263
|
+
min-height: ${controlHeight.middle}px;
|
|
263
264
|
padding-block: 4px;
|
|
264
265
|
padding-inline: 11px;
|
|
265
266
|
|
|
@@ -267,7 +268,7 @@ const styles = createStaticStyles(({ css, cssVar }) => ({
|
|
|
267
268
|
line-height: 20px;
|
|
268
269
|
`,
|
|
269
270
|
triggerSmall: css`
|
|
270
|
-
min-height:
|
|
271
|
+
min-height: ${controlHeight.small}px;
|
|
271
272
|
padding-block: 0;
|
|
272
273
|
padding-inline: 8px;
|
|
273
274
|
|