@momo-webplatform/mobase 0.0.37 → 0.0.38
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/package.json +1 -1
- package/publish/cjs/components/TextArea/TextArea.js +1 -1
- package/publish/cjs/components/TextInput/TextInput.js +3 -4
- package/publish/cjs/mobase-tw-plugin/plugin.js +1 -0
- package/publish/cjs/mobase-tw-plugin/utilities/custom.js +3 -0
- package/publish/cjs/tsconfig.lib.tsbuildinfo +1 -1
- package/publish/esm/components/TextArea/TextArea.js +1 -1
- package/publish/esm/components/TextInput/TextInput.js +3 -4
- package/publish/esm/mobase-tw-plugin/plugin.js +1 -0
- package/publish/esm/mobase-tw-plugin/utilities/custom.d.ts +3 -0
- package/publish/esm/mobase-tw-plugin/utilities/custom.js +3 -0
- package/publish/esm/mobase-tw-plugin/utilities/index.d.ts +3 -0
- package/publish/esm/tsconfig.lib.tsbuildinfo +1 -1
package/package.json
CHANGED
|
@@ -12,7 +12,7 @@ exports.TextArea = (0, react_1.forwardRef)(({ disabled, isError, message, label,
|
|
|
12
12
|
box-shadow: 0px 0px 0px 1px rgb(var(--mobase-gray-400) / 1) inset;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
.mobase-text-area-box:focus {
|
|
15
|
+
.mobase-text-area-box:focus, .mobase-text-area-box:focus-visible {
|
|
16
16
|
box-shadow: 0px 0px 0px 1px rgb(var(--mobase-pink-500) / 1) inset;
|
|
17
17
|
}
|
|
18
18
|
|
|
@@ -3,8 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.TextInput = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
-
const
|
|
7
|
-
const solid_1 = require("@heroicons/react/24/solid");
|
|
6
|
+
const solid_1 = require("@heroicons/react/16/solid");
|
|
8
7
|
const utils_1 = require("../../helpers/utils");
|
|
9
8
|
exports.TextInput = (0, react_1.forwardRef)(({ disabled, isError, message, label, className, inputClassName, withClearButton, size, onChange, onFocus, onClickClear, value, defaultValue, type = "text", ...restProps }, ref) => {
|
|
10
9
|
const [clearable, setClearable] = (0, react_1.useState)(false);
|
|
@@ -39,12 +38,12 @@ exports.TextInput = (0, react_1.forwardRef)(({ disabled, isError, message, label
|
|
|
39
38
|
(0, react_1.useEffect)(() => {
|
|
40
39
|
handleShowClearButton(defaultValue || value);
|
|
41
40
|
}, [value, defaultValue]);
|
|
42
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: (0, utils_1.cn)(className, isError && "mobase-text-input-error"), ref: rootRef, children: [(0, jsx_runtime_1.jsxs)("div", { className: "relative", children: [label && ((0, jsx_runtime_1.jsx)("span", { className: (0, utils_1.cn)("mobase-text-input-label absolute bg-white -top-2 px-1.5 left-2 text-xs text-gray-500", size === 2 && " -top-2.5 text-sm"), children: label })), (0, jsx_runtime_1.jsx)("input", { disabled: disabled, type: type, ref: ref, className: (0, utils_1.cn)("mobase-text-input-box bg-white w-full transition-all text-sm rounded-md border border-gray-400 placeholder:text-gray-500 p-3 text-gray-900 h-11 focus:border-pink-500 disabled:bg-gray-50 disabled:border-gray-300 disabled:pointer-events-none block", size === 2 && "h-12 text-base", inputClassName), onChange: onChangeFactory, onFocus: onFocusFactory, value: value, defaultValue: defaultValue, ...restProps }), withClearButton && clearable && ((0, jsx_runtime_1.jsx)("button", { "aria-label": "button", type: "button", className: "absolute right-3 top-1/2 -translate-y-1/2 shrink-0 cursor-pointer text-gray-500 duration-200 hover:opacity-70 disabled:pointer-events-none", disabled: disabled, onClick: handleClear, children: (0, jsx_runtime_1.jsx)(
|
|
41
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: (0, utils_1.cn)(className, isError && "mobase-text-input-error"), ref: rootRef, children: [(0, jsx_runtime_1.jsxs)("div", { className: "relative", children: [label && ((0, jsx_runtime_1.jsx)("span", { className: (0, utils_1.cn)("mobase-text-input-label absolute bg-white -top-2 px-1.5 left-2 text-xs text-gray-500", size === 2 && " -top-2.5 text-sm"), children: label })), (0, jsx_runtime_1.jsx)("input", { disabled: disabled, type: type, ref: ref, className: (0, utils_1.cn)("mobase-text-input-box bg-white w-full transition-all text-sm rounded-md border border-gray-400 placeholder:text-gray-500 p-3 text-gray-900 h-11 focus:border-pink-500 disabled:bg-gray-50 disabled:border-gray-300 disabled:pointer-events-none block outline-none", size === 2 && "h-12 text-base", inputClassName), onChange: onChangeFactory, onFocus: onFocusFactory, value: value, defaultValue: defaultValue, ...restProps }), withClearButton && clearable && ((0, jsx_runtime_1.jsx)("button", { "aria-label": "button", type: "button", className: "absolute right-3 top-1/2 -translate-y-1/2 shrink-0 cursor-pointer text-gray-500 duration-200 hover:opacity-70 disabled:pointer-events-none", disabled: disabled, onClick: handleClear, children: (0, jsx_runtime_1.jsx)(solid_1.XCircleIcon, { strokeWidth: 2, width: 20, height: 20 }) }))] }), message && ((0, jsx_runtime_1.jsxs)("div", { className: "mobase-text-input-message flex space-x-1 items-center mt-0.5", children: [isError ? ((0, jsx_runtime_1.jsx)(solid_1.XCircleIcon, { width: 16, height: 16, className: "text-red-500" })) : ((0, jsx_runtime_1.jsx)(solid_1.QuestionMarkCircleIcon, { width: 16, height: 16, className: "text-gray-500" })), (0, jsx_runtime_1.jsx)("span", { className: (0, utils_1.cn)("text-gray-500 ", size === 2 ? "text-sm" : "text-xs"), children: message })] })), (0, jsx_runtime_1.jsx)("style", { children: `
|
|
43
42
|
.mobase-text-input-box:hover {
|
|
44
43
|
box-shadow: 0px 0px 0px 1px rgb(var(--mobase-gray-400) / 1) inset;
|
|
45
44
|
}
|
|
46
45
|
|
|
47
|
-
.mobase-text-input-box:focus {
|
|
46
|
+
.mobase-text-input-box:focus , .mobase-text-input-box:focus-visible {
|
|
48
47
|
box-shadow: 0px 0px 0px 1px rgb(var(--mobase-pink-500) / 1) inset;
|
|
49
48
|
}
|
|
50
49
|
|