@momo-webplatform/mobase 0.0.29 → 0.0.31
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/Select/Select.js +3 -3
- package/publish/cjs/components/TextArea/TextArea.js +2 -2
- package/publish/cjs/components/TextInput/TextInput.js +2 -2
- package/publish/cjs/mobase-tw-plugin/animations/index.js +5 -0
- package/publish/cjs/mobase-tw-plugin/plugin.js +0 -9
- package/publish/cjs/tsconfig.lib.tsbuildinfo +1 -1
- package/publish/esm/components/Select/Select.d.ts +1 -1
- package/publish/esm/components/Select/Select.js +3 -3
- package/publish/esm/components/TextArea/TextArea.d.ts +1 -0
- package/publish/esm/components/TextArea/TextArea.js +2 -2
- package/publish/esm/components/TextInput/TextInput.d.ts +1 -0
- package/publish/esm/components/TextInput/TextInput.js +2 -2
- package/publish/esm/mobase-tw-plugin/animations/index.d.ts +9 -0
- package/publish/esm/mobase-tw-plugin/animations/index.js +5 -0
- package/publish/esm/mobase-tw-plugin/plugin.js +0 -9
- package/publish/esm/tsconfig.lib.tsbuildinfo +1 -1
package/package.json
CHANGED
|
@@ -33,13 +33,13 @@ const SelectPrimitive = __importStar(require("@radix-ui/react-select"));
|
|
|
33
33
|
const utils_1 = require("../../helpers/utils");
|
|
34
34
|
const Select = React.forwardRef(({ className, children, label, message, size, isError, disabled, ...props }) => ((0, jsx_runtime_1.jsxs)("div", { className: (0, utils_1.cn)("select-mobase relative", className, disabled ? "disabled" : "", isError
|
|
35
35
|
? "[&>.select-mobase-button]:border-red-500 [&>.select-mobase-button]:ring-red-500 [&>.select-mobase-button]:ring-1"
|
|
36
|
-
: "", size ===
|
|
36
|
+
: "", size === 2
|
|
37
37
|
? "[&>.select-mobase-button]:text-base [&>.select-mobase-button]:h-12"
|
|
38
|
-
: ""), children: [label && ((0, jsx_runtime_1.jsx)("span", { className: (0, utils_1.cn)("mobase-select-label absolute bg-white -top-2 px-1.5 left-2 text-xs text-gray-500 z-[1]", size ===
|
|
38
|
+
: ""), children: [label && ((0, jsx_runtime_1.jsx)("span", { className: (0, utils_1.cn)("mobase-select-label absolute bg-white -top-2 px-1.5 left-2 text-xs text-gray-500 z-[1]", size === 2 && "text-sm -top-2.5", isError && "text-red-500"), children: label })), (0, jsx_runtime_1.jsx)(SelectPrimitive.Root, { disabled: disabled, ...props, children: children }), message && ((0, jsx_runtime_1.jsxs)("div", { className: (0, utils_1.cn)("mobase-select-message flex space-x-1 items-center mt-1 text-gray-500", isError && "text-red-500"), children: [isError ? ((0, jsx_runtime_1.jsx)(solid_2.XCircleIcon, { width: 16, height: 16 })) : ((0, jsx_runtime_1.jsx)(outline_1.QuestionMarkCircleIcon, { width: 16, height: 16 })), (0, jsx_runtime_1.jsx)("span", { className: (0, utils_1.cn)(size === 2 ? "text-sm" : "text-xs"), children: message })] }))] })));
|
|
39
39
|
exports.Select = Select;
|
|
40
40
|
const SelectValue = SelectPrimitive.Value;
|
|
41
41
|
exports.SelectValue = SelectValue;
|
|
42
|
-
const SelectTrigger = React.forwardRef(({ className, children, ...props }, ref) => ((0, jsx_runtime_1.jsxs)(SelectPrimitive.Trigger, { ref: ref, className: (0, utils_1.cn)("select-mobase-button bg-white w-full ring-0 transition-all focus-visible:border-pink-500 focus-visible:ring-offset-0 focus-visible:ring-offset-transparent focus-visible:ring-1 focus-visible:!ring-pink-500 rounded border border-gray-400 data-[placeholder]:text-gray-500 p-3 disabled:bg-gray-50 disabled:border-gray-300
|
|
42
|
+
const SelectTrigger = React.forwardRef(({ className, children, ...props }, ref) => ((0, jsx_runtime_1.jsxs)(SelectPrimitive.Trigger, { ref: ref, className: (0, utils_1.cn)("select-mobase-button bg-white w-full ring-0 transition-all focus-visible:border-pink-500 focus-visible:ring-offset-0 focus-visible:ring-offset-transparent focus-visible:ring-1 focus-visible:!ring-pink-500 rounded-md border border-gray-400 data-[placeholder]:text-gray-500 p-3 disabled:bg-gray-50 disabled:border-gray-300 disabled:pointer-events-none flex items-center justify-between data-[state=open]:border-pink-500 data-[state=open]:ring-1 hover:ring-1 hover:ring-gray-400 data-[state=open]:ring-pink-500 text-gray-900 h-11 ring-inset text-sm", className), ...props, children: [(0, jsx_runtime_1.jsx)("div", { className: "line-clamp-1 text-left", children: children }), (0, jsx_runtime_1.jsx)(SelectPrimitive.Icon, { asChild: true, children: (0, jsx_runtime_1.jsx)(solid_1.ChevronDownIcon, { className: "h-4 w-4 text-gray-700 flex-none" }) })] })));
|
|
43
43
|
exports.SelectTrigger = SelectTrigger;
|
|
44
44
|
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
|
45
45
|
const SelectScrollUpButton = React.forwardRef(({ className, ...props }, ref) => ((0, jsx_runtime_1.jsx)(SelectPrimitive.ScrollUpButton, { ref: ref, className: (0, utils_1.cn)("flex cursor-default items-center justify-center py-1", className), ...props, children: (0, jsx_runtime_1.jsx)(solid_1.ChevronUpIcon, { className: "h-5 w-5" }) })));
|
|
@@ -6,8 +6,8 @@ const react_1 = require("react");
|
|
|
6
6
|
const outline_1 = require("@heroicons/react/24/outline");
|
|
7
7
|
const solid_1 = require("@heroicons/react/24/solid");
|
|
8
8
|
const utils_1 = require("../../helpers/utils");
|
|
9
|
-
exports.TextArea = (0, react_1.forwardRef)(({ disabled, isError, message, label, className, inputClassName, rows = 3, ...restProps }, ref) => {
|
|
10
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: (0, utils_1.cn)("relative", className, isError && "mobase-text-area-error"), children: [label && ((0, jsx_runtime_1.jsx)("span", { className: (0, utils_1.cn)("mobase-text-area-label absolute bg-white -top-2.5 px-1.5 left-2 text-sm",
|
|
9
|
+
exports.TextArea = (0, react_1.forwardRef)(({ disabled, isError, message, label, className, inputClassName, size, rows = 3, ...restProps }, ref) => {
|
|
10
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: (0, utils_1.cn)("relative", className, isError && "mobase-text-area-error"), children: [label && ((0, jsx_runtime_1.jsx)("span", { className: (0, utils_1.cn)("mobase-text-area-label absolute bg-white -top-2.5 px-1.5 left-2 text-sm text-gray-500", size === 2 && " -top-2.5 text-sm"), children: label })), (0, jsx_runtime_1.jsx)("textarea", { disabled: disabled, ref: ref, className: (0, utils_1.cn)("mobase-text-area-box bg-white w-full text-sm transition-all rounded-md border border-gray-400 placeholder:text-gray-500 p-3 text-gray-900 focus:border-pink-500 disabled:bg-gray-50 disabled:border-gray-300 outline-none block", size === 2 && "text-base", inputClassName), rows: rows, ...restProps }), message && ((0, jsx_runtime_1.jsxs)("div", { className: "mobase-text-area-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)(outline_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: `
|
|
11
11
|
.mobase-text-area-box:hover {
|
|
12
12
|
box-shadow: 0px 0px 0px 1px rgb(var(--mobase-gray-400) / 1) inset;
|
|
13
13
|
}
|
|
@@ -6,7 +6,7 @@ const react_1 = require("react");
|
|
|
6
6
|
const outline_1 = require("@heroicons/react/24/outline");
|
|
7
7
|
const solid_1 = require("@heroicons/react/24/solid");
|
|
8
8
|
const utils_1 = require("../../helpers/utils");
|
|
9
|
-
exports.TextInput = (0, react_1.forwardRef)(({ disabled, isError, message, label, className, inputClassName, withClearButton, onChange, onFocus, onClickClear, value, defaultValue, type = "text", ...restProps }, ref) => {
|
|
9
|
+
exports.TextInput = (0, react_1.forwardRef)(({ disabled, isError, message, label, className, inputClassName, withClearButton, size, onChange, onFocus, onClickClear, value, defaultValue, type = "text", ...restProps }, ref) => {
|
|
10
10
|
const [clearable, setClearable] = (0, react_1.useState)(false);
|
|
11
11
|
const rootRef = (0, react_1.useRef)(null);
|
|
12
12
|
const handleShowClearButton = (inputValue) => {
|
|
@@ -39,7 +39,7 @@ exports.TextInput = (0, react_1.forwardRef)(({ disabled, isError, message, label
|
|
|
39
39
|
(0, react_1.useEffect)(() => {
|
|
40
40
|
handleShowClearButton(defaultValue || value);
|
|
41
41
|
}, [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
|
|
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)(outline_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)(outline_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
43
|
.mobase-text-input-box:hover {
|
|
44
44
|
box-shadow: 0px 0px 0px 1px rgb(var(--mobase-gray-400) / 1) inset;
|
|
45
45
|
}
|
|
@@ -6,6 +6,7 @@ exports.animations = {
|
|
|
6
6
|
"accordion-down": "accordion-down 0.2s ease-out",
|
|
7
7
|
"accordion-up": "accordion-up 0.2s ease-out",
|
|
8
8
|
"spin-loading": "spin 1s steps(12, end) infinite",
|
|
9
|
+
"fade-in": "fade-in 250ms cubic-bezier(0.25, 0.46, 0.45, 0.94) both",
|
|
9
10
|
},
|
|
10
11
|
keyframes: {
|
|
11
12
|
"accordion-down": {
|
|
@@ -16,5 +17,9 @@ exports.animations = {
|
|
|
16
17
|
from: { height: "var(--radix-accordion-content-height)" },
|
|
17
18
|
to: { height: "0" },
|
|
18
19
|
},
|
|
20
|
+
"fade-in": {
|
|
21
|
+
"0%": { opacity: "0" },
|
|
22
|
+
"100%": { opacity: "1" },
|
|
23
|
+
},
|
|
19
24
|
},
|
|
20
25
|
};
|
|
@@ -185,15 +185,6 @@ const mobaseTW = () => {
|
|
|
185
185
|
...(0, theme_1.createSpacingUnits)(prefix),
|
|
186
186
|
},
|
|
187
187
|
...animations_1.animations,
|
|
188
|
-
keyframes: {
|
|
189
|
-
'fade-in': {
|
|
190
|
-
'0%': { opacity: "0" },
|
|
191
|
-
'100%': { opacity: "1" },
|
|
192
|
-
},
|
|
193
|
-
},
|
|
194
|
-
animation: {
|
|
195
|
-
'fade-in': 'fade-in 250ms cubic-bezier(0.25, 0.46, 0.45, 0.94) both',
|
|
196
|
-
},
|
|
197
188
|
},
|
|
198
189
|
},
|
|
199
190
|
});
|