nexaas-ui-components 1.0.11 → 1.0.12

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/dist/index.cjs CHANGED
@@ -2280,6 +2280,61 @@ var MaskedInput = ({
2280
2280
  }
2281
2281
  );
2282
2282
  };
2283
+ function InputTest({
2284
+ label,
2285
+ name,
2286
+ control,
2287
+ error,
2288
+ required,
2289
+ placeholder,
2290
+ disabled,
2291
+ defaultValue
2292
+ }) {
2293
+ const fieldValidationMessages = [error == null ? void 0 : error.message];
2294
+ const hasError = fieldValidationMessages.some((item) => item !== void 0);
2295
+ const styles = {
2296
+ input: `text-p-md pl-2 peer shadow-input border rounded-lg outline-none block pb-[10px] h-[46px] w-full disabled:bg-neutral-100 focus-visible:border-1 ${label ? "pt-[22px]" : "pt-[10px]"} ${hasError ? "border-dangerous-500 text-dangerous-500" : "border-neutral-300 focus-visible:border-blue-500"}`,
2297
+ label: "absolute text-label top-[0.80rem] z-10 origin-[0] transform -translate-y-3 scale-75 duration-300 text-sm peer-focus:text-blue-500 peer-focus:scale-75 peer-focus:-translate-y-3 peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 left-2.5 cursor-text"
2298
+ };
2299
+ return /* @__PURE__ */ jsxRuntime.jsx(
2300
+ reactHookForm.Controller,
2301
+ {
2302
+ control,
2303
+ name,
2304
+ defaultValue,
2305
+ render: ({ field }) => {
2306
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
2307
+ /* @__PURE__ */ jsxRuntime.jsx(
2308
+ "input",
2309
+ {
2310
+ ...field,
2311
+ type: "text",
2312
+ id: name,
2313
+ className: clsx7__default.default(styles.input),
2314
+ placeholder: !label && placeholder ? placeholder : " ",
2315
+ disabled
2316
+ }
2317
+ ),
2318
+ /* @__PURE__ */ jsxRuntime.jsxs("label", { className: clsx7__default.default(styles.label), children: [
2319
+ label,
2320
+ required && label && /* @__PURE__ */ jsxRuntime.jsx("strong", { className: "text-dangerous-500", children: "\xA0*" })
2321
+ ] }),
2322
+ fieldValidationMessages.map((message, index) => /* @__PURE__ */ jsxRuntime.jsx(
2323
+ "div",
2324
+ {
2325
+ className: "text-dangerous-500 text-xs mt-1 ml-[2px]",
2326
+ role: "alert",
2327
+ "aria-label": message,
2328
+ children: message
2329
+ },
2330
+ index
2331
+ ))
2332
+ ] });
2333
+ }
2334
+ }
2335
+ );
2336
+ }
2337
+ InputTest.displayName = "InputTest";
2283
2338
  var Modal = ReactModalNamespace__namespace.default || ReactModalNamespace__namespace;
2284
2339
  var alertTypes = {
2285
2340
  success: "text-success-500",
@@ -3747,6 +3802,7 @@ exports.Input = Input;
3747
3802
  exports.InputMoney = InputMoney;
3748
3803
  exports.InputNumber = InputNumber;
3749
3804
  exports.InputPercentage = InputPercentage;
3805
+ exports.InputTest = InputTest;
3750
3806
  exports.Logo = Logo;
3751
3807
  exports.MaskedInput = MaskedInput;
3752
3808
  exports.ModalDialog = ModalDialog;