neogestify-ui-components 1.2.16 → 1.2.18
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/components/alerts/index.js +10 -10
- package/dist/components/alerts/index.js.map +1 -1
- package/dist/components/alerts/index.mjs +10 -10
- package/dist/components/alerts/index.mjs.map +1 -1
- package/dist/components/html/index.js +24 -15
- package/dist/components/html/index.js.map +1 -1
- package/dist/components/html/index.mjs +24 -15
- package/dist/components/html/index.mjs.map +1 -1
- package/dist/context/theme/index.js +10 -10
- package/dist/context/theme/index.js.map +1 -1
- package/dist/context/theme/index.mjs +10 -10
- package/dist/context/theme/index.mjs.map +1 -1
- package/dist/index.js +24 -15
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +24 -15
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/html/Button.tsx +10 -10
- package/src/components/html/Input.tsx +20 -7
package/dist/index.js
CHANGED
|
@@ -372,17 +372,17 @@ var Button = ({
|
|
|
372
372
|
}) => {
|
|
373
373
|
const baseClasses = "transition-all duration-200 disabled:opacity-50 disabled:cursor-not-allowed cursor-pointer";
|
|
374
374
|
const variantClasses = {
|
|
375
|
-
primary: "py-2 px-2 border border-indigo-600/20 dark:border-indigo-500/20 text-sm font-medium rounded-md text-white bg-indigo-600 hover:bg-indigo-700 dark:bg-indigo-500 hover:
|
|
376
|
-
secondary: "p-2 text-gray-600 dark:text-gray-400 hover:text-gray-900 hover:
|
|
377
|
-
icon: "p-2 text-gray-600 dark:text-gray-400 hover:text-gray-900 hover:
|
|
378
|
-
danger: "py-2 px-2 border border-red-600/20 dark:border-red-500/20 text-sm font-medium rounded-md text-white bg-red-600 hover:bg-red-700 dark:bg-red-500 hover:
|
|
379
|
-
success: "py-2 px-2 border border-green-600/20 dark:border-green-500/20 text-sm font-medium rounded-md text-white bg-green-600 hover:bg-green-700 dark:bg-green-500 hover:
|
|
380
|
-
outline: "py-2 px-2 border border-gray-300 dark:border-gray-600 text-sm font-medium rounded-md text-gray-700 dark:text-gray-300 bg-transparent hover:bg-gray-100 hover:
|
|
381
|
-
nav: "w-full flex items-center px-4 py-2 text-sm font-medium rounded-md transition-all duration-200 hover:scale-105 text-gray-700 dark:text-gray-300 hover:
|
|
375
|
+
primary: "py-2 px-2 border border-indigo-600/20 dark:border-indigo-500/20 text-sm font-medium rounded-md text-white bg-indigo-600 hover:bg-indigo-700 dark:bg-indigo-500 dark:hover:bg-indigo-600 focus:outline-none focus:ring-2 focus:ring-indigo-500 dark:focus:ring-indigo-400 focus:ring-offset-2 focus:ring-offset-gray-50 dark:focus:ring-offset-gray-900",
|
|
376
|
+
secondary: "p-2 text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white hover:bg-gray-200 dark:hover:bg-gray-800 rounded-md border border-gray-300 dark:border-gray-600 shadow-sm hover:shadow-md focus:outline-none focus:ring-2 focus:ring-indigo-500 dark:focus:ring-indigo-400 focus:ring-offset-2 focus:ring-offset-gray-50 dark:focus:ring-offset-gray-900",
|
|
377
|
+
icon: "p-2 text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white hover:bg-gray-200 dark:hover:bg-gray-800 rounded-full focus:outline-none focus:ring-2 focus:ring-indigo-500 dark:focus:ring-indigo-400 focus:ring-offset-2 focus:ring-offset-gray-50 dark:focus:ring-offset-gray-900",
|
|
378
|
+
danger: "py-2 px-2 border border-red-600/20 dark:border-red-500/20 text-sm font-medium rounded-md text-white bg-red-600 hover:bg-red-700 dark:bg-red-500 dark:hover:bg-red-600 focus:outline-none focus:ring-2 focus:ring-red-500 dark:focus:ring-red-400 focus:ring-offset-2 focus:ring-offset-gray-50 dark:focus:ring-offset-gray-900",
|
|
379
|
+
success: "py-2 px-2 border border-green-600/20 dark:border-green-500/20 text-sm font-medium rounded-md text-white bg-green-600 hover:bg-green-700 dark:bg-green-500 dark:hover:bg-green-600 focus:outline-none focus:ring-2 focus:ring-green-500 dark:focus:ring-green-400 focus:ring-offset-2 focus:ring-offset-gray-50 dark:focus:ring-offset-gray-900",
|
|
380
|
+
outline: "py-2 px-2 border border-gray-300 dark:border-gray-600 text-sm font-medium rounded-md text-gray-700 dark:text-gray-300 bg-transparent hover:bg-gray-100 dark:hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-indigo-500 dark:focus:ring-indigo-400 focus:ring-offset-2 focus:ring-offset-gray-50 dark:focus:ring-offset-gray-900",
|
|
381
|
+
nav: "w-full flex items-center px-4 py-2 text-sm font-medium rounded-md transition-all duration-200 hover:scale-105 text-gray-700 dark:text-gray-300 dark:hover:text-white hover:shadow-lg focus:outline-none focus:ring-2 focus:ring-indigo-500 dark:focus:ring-indigo-400 focus:ring-offset-2 focus:ring-offset-gray-50 dark:focus:ring-offset-gray-900",
|
|
382
382
|
custom: "",
|
|
383
|
-
link: "text-sm text-indigo-600 dark:text-indigo-400 hover:text-indigo-700 hover:
|
|
384
|
-
warning: "py-2 px-2 border border-yellow-600/20 dark:border-yellow-500/20 text-sm font-medium rounded-md text-white bg-yellow-600 hover:bg-yellow-700 dark:bg-yellow-500 hover:
|
|
385
|
-
toggle: "px-2 py-2 rounded-lg font-medium transition-all duration-200 disabled:cursor-not-allowed border-2 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 focus:ring-offset-gray-50 focus:
|
|
383
|
+
link: "text-sm text-indigo-600 dark:text-indigo-400 hover:text-indigo-700 dark:hover:text-indigo-300 transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-indigo-500 dark:focus:ring-indigo-400 focus:ring-offset-2 focus:ring-offset-gray-50 dark:focus:ring-offset-gray-900",
|
|
384
|
+
warning: "py-2 px-2 border border-yellow-600/20 dark:border-yellow-500/20 text-sm font-medium rounded-md text-white bg-yellow-600 hover:bg-yellow-700 dark:bg-yellow-500 dark:hover:bg-yellow-600 focus:outline-none focus:ring-2 focus:ring-yellow-500 dark:focus:ring-yellow-400 focus:ring-offset-2 focus:ring-offset-gray-50 dark:focus:ring-offset-gray-900",
|
|
385
|
+
toggle: "px-2 py-2 rounded-lg font-medium transition-all duration-200 disabled:cursor-not-allowed border-2 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 focus:ring-offset-gray-50 dark:focus:ring-offset-gray-900"
|
|
386
386
|
};
|
|
387
387
|
let classes = `${baseClasses} ${variantClasses[variant]} ${className}`;
|
|
388
388
|
if (variant === "nav" && isActive) {
|
|
@@ -424,15 +424,24 @@ var Input = ({
|
|
|
424
424
|
const baseClasses = "appearance-none relative block w-full px-3 py-2 border placeholder-gray-500 dark:placeholder-gray-400 text-gray-900 dark:text-white bg-white dark:bg-gray-800 rounded-md focus:outline-none focus:ring-2 focus:ring-indigo-500 dark:focus:ring-indigo-400 focus:border-indigo-500 focus:z-10 sm:text-sm disabled:opacity-50 disabled:cursor-not-allowed transition-colors duration-200";
|
|
425
425
|
const errorClasses = error ? "border-red-300 dark:border-red-600 focus:ring-red-500 dark:focus:ring-red-400 focus:border-red-500" : "border-gray-300 dark:border-gray-600";
|
|
426
426
|
const classes = `${baseClasses} ${errorClasses} ${className}`;
|
|
427
|
+
const checkboxBaseClasses = "h-4 w-4 rounded border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800 text-indigo-600 dark:text-indigo-400 focus:outline-none focus:ring-2 focus:ring-indigo-500 dark:focus:ring-indigo-400 focus:ring-offset-2 focus:ring-offset-white dark:focus:ring-offset-gray-900 disabled:opacity-50 disabled:cursor-not-allowed transition-colors duration-200 cursor-pointer";
|
|
428
|
+
const checkboxErrorClasses = error ? "border-red-300 dark:border-red-600 focus:ring-red-500 dark:focus:ring-red-400" : "";
|
|
429
|
+
const checkboxClasses = `${checkboxBaseClasses} ${checkboxErrorClasses}`.trim();
|
|
430
|
+
const fileBaseClasses = "block w-full sm:text-sm text-gray-500 dark:text-gray-400 bg-white dark:bg-gray-800 border rounded-md focus:outline-none focus:ring-2 focus:ring-indigo-500 dark:focus:ring-indigo-400 focus:border-indigo-500 disabled:opacity-50 disabled:cursor-not-allowed transition-colors duration-200 file:mr-4 file:py-2 file:px-4 file:rounded-l-md file:border-0 file:text-sm file:font-medium file:bg-indigo-50 file:text-indigo-700 dark:file:bg-indigo-900/50 dark:file:text-indigo-300 hover:file:bg-indigo-100 dark:hover:file:bg-indigo-800/50 file:transition-colors file:duration-200 file:cursor-pointer";
|
|
431
|
+
const fileErrorClasses = error ? "border-red-300 dark:border-red-600 focus:ring-red-500 dark:focus:ring-red-400" : "border-gray-300 dark:border-gray-600";
|
|
432
|
+
const fileClasses = `${fileBaseClasses} ${fileErrorClasses} ${className}`.trim();
|
|
433
|
+
const hasHidden = Boolean(className && /\bhidden\b/.test(className));
|
|
434
|
+
const wrapperBase = "space-y-1 w-full";
|
|
435
|
+
const wrapperClasses = hasHidden ? `${wrapperBase} hidden` : wrapperBase;
|
|
427
436
|
if (type === "checkbox") {
|
|
428
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className:
|
|
437
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: wrapperClasses, children: [
|
|
429
438
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
430
439
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
431
440
|
"input",
|
|
432
441
|
{
|
|
433
442
|
id: inputId,
|
|
434
443
|
type: "checkbox",
|
|
435
|
-
className:
|
|
444
|
+
className: checkboxClasses,
|
|
436
445
|
...props
|
|
437
446
|
}
|
|
438
447
|
),
|
|
@@ -450,7 +459,7 @@ var Input = ({
|
|
|
450
459
|
] });
|
|
451
460
|
}
|
|
452
461
|
if (type === "file") {
|
|
453
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className:
|
|
462
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: wrapperClasses, children: [
|
|
454
463
|
label && typeof label === "string" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
455
464
|
"label",
|
|
456
465
|
{
|
|
@@ -464,7 +473,7 @@ var Input = ({
|
|
|
464
473
|
{
|
|
465
474
|
id: inputId,
|
|
466
475
|
type: "file",
|
|
467
|
-
className:
|
|
476
|
+
className: fileClasses,
|
|
468
477
|
...props
|
|
469
478
|
}
|
|
470
479
|
),
|
|
@@ -472,7 +481,7 @@ var Input = ({
|
|
|
472
481
|
helperText && !error && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: helperText })
|
|
473
482
|
] });
|
|
474
483
|
}
|
|
475
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className:
|
|
484
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: wrapperClasses, children: [
|
|
476
485
|
label && typeof label === "string" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
477
486
|
"label",
|
|
478
487
|
{
|