@underverse-ui/underverse 1.0.43 → 1.0.45
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/api-reference.json +1 -1
- package/dist/index.cjs +84 -72
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +84 -72
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/api-reference.json
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -1722,6 +1722,7 @@ var Input = (0, import_react3.forwardRef)(
|
|
|
1722
1722
|
type = "text",
|
|
1723
1723
|
value,
|
|
1724
1724
|
maxLength,
|
|
1725
|
+
rightAddon,
|
|
1725
1726
|
...rest
|
|
1726
1727
|
}, ref) => {
|
|
1727
1728
|
const [localError, setLocalError] = (0, import_react3.useState)(error);
|
|
@@ -1811,6 +1812,7 @@ var Input = (0, import_react3.forwardRef)(
|
|
|
1811
1812
|
onClear: _onClear,
|
|
1812
1813
|
hint: _hint,
|
|
1813
1814
|
counter: _counter,
|
|
1815
|
+
rightAddon: _rightAddon,
|
|
1814
1816
|
...restInput
|
|
1815
1817
|
} = rest;
|
|
1816
1818
|
const handleFocus = (e) => {
|
|
@@ -1953,6 +1955,7 @@ var Input = (0, import_react3.forwardRef)(
|
|
|
1953
1955
|
}
|
|
1954
1956
|
)
|
|
1955
1957
|
] }),
|
|
1958
|
+
rightAddon,
|
|
1956
1959
|
variant === "minimal" && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1957
1960
|
"div",
|
|
1958
1961
|
{
|
|
@@ -2098,80 +2101,89 @@ var NumberInput = (0, import_react3.forwardRef)(
|
|
|
2098
2101
|
onChange({ target: { value: newValue.toString() } });
|
|
2099
2102
|
}
|
|
2100
2103
|
};
|
|
2101
|
-
|
|
2104
|
+
const inputSize = props.size || "md";
|
|
2105
|
+
const stepperSizeStyles = {
|
|
2106
|
+
sm: { width: "w-7", icon: { width: 8, height: 5, path: { up: "M4 1L7 4H1L4 1Z", down: "M4 4L1 1H7L4 4Z" } } },
|
|
2107
|
+
md: { width: "w-9", icon: { width: 10, height: 6, path: { up: "M5 1L9 5H1L5 1Z", down: "M5 5L1 1H9L5 5Z" } } },
|
|
2108
|
+
lg: { width: "w-11", icon: { width: 12, height: 7, path: { up: "M6 1L11 6H1L6 1Z", down: "M6 6L1 1H11L6 6Z" } } }
|
|
2109
|
+
};
|
|
2110
|
+
const ss = stepperSizeStyles[inputSize];
|
|
2111
|
+
const stepperAddon = showSteppers ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: cn("absolute right-0 inset-y-0 flex flex-col border-l border-border rounded-r-full overflow-hidden", ss.width), children: [
|
|
2102
2112
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
2103
|
-
|
|
2113
|
+
"button",
|
|
2104
2114
|
{
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
max,
|
|
2109
|
-
step,
|
|
2110
|
-
rightIcon: showSteppers ? void 0 : props.rightIcon,
|
|
2111
|
-
value: displayValue,
|
|
2112
|
-
onChange: (e) => {
|
|
2113
|
-
if (!onChange) return;
|
|
2114
|
-
if (!formatThousands) return onChange(e);
|
|
2115
|
-
const raw = e.target.value;
|
|
2116
|
-
const parsed = parse(raw);
|
|
2117
|
-
if (Number.isNaN(parsed)) {
|
|
2118
|
-
setDisplayValue("");
|
|
2119
|
-
onChange({ target: { value: "" } });
|
|
2120
|
-
} else {
|
|
2121
|
-
const bounded = Math.min(Math.max(parsed, min ?? -Infinity), max ?? Infinity);
|
|
2122
|
-
setDisplayValue(format(bounded));
|
|
2123
|
-
onChange({ target: { value: bounded.toString() } });
|
|
2124
|
-
}
|
|
2125
|
-
},
|
|
2126
|
-
...props,
|
|
2115
|
+
type: "button",
|
|
2116
|
+
onClick: handleIncrement,
|
|
2117
|
+
disabled: max !== void 0 && currentValue >= max,
|
|
2127
2118
|
className: cn(
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
props.className
|
|
2137
|
-
)
|
|
2119
|
+
"flex-1 flex items-center justify-center transition-colors",
|
|
2120
|
+
"hover:bg-accent active:bg-accent/80",
|
|
2121
|
+
"focus:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-inset",
|
|
2122
|
+
"disabled:opacity-40 disabled:cursor-not-allowed disabled:hover:bg-transparent",
|
|
2123
|
+
"text-muted-foreground hover:text-foreground"
|
|
2124
|
+
),
|
|
2125
|
+
"aria-label": "Increase value",
|
|
2126
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("svg", { width: ss.icon.width, height: ss.icon.height, viewBox: `0 0 ${ss.icon.width} ${ss.icon.height}`, fill: "none", className: "shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("path", { d: ss.icon.path.up, fill: "currentColor" }) })
|
|
2138
2127
|
}
|
|
2139
2128
|
),
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
}
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2129
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "h-px bg-border" }),
|
|
2130
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
2131
|
+
"button",
|
|
2132
|
+
{
|
|
2133
|
+
type: "button",
|
|
2134
|
+
onClick: handleDecrement,
|
|
2135
|
+
disabled: min !== void 0 && currentValue <= min,
|
|
2136
|
+
className: cn(
|
|
2137
|
+
"flex-1 flex items-center justify-center transition-colors",
|
|
2138
|
+
"hover:bg-accent active:bg-accent/80",
|
|
2139
|
+
"focus:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-inset",
|
|
2140
|
+
"disabled:opacity-40 disabled:cursor-not-allowed disabled:hover:bg-transparent",
|
|
2141
|
+
"text-muted-foreground hover:text-foreground"
|
|
2142
|
+
),
|
|
2143
|
+
"aria-label": "Decrease value",
|
|
2144
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("svg", { width: ss.icon.width, height: ss.icon.height, viewBox: `0 0 ${ss.icon.width} ${ss.icon.height}`, fill: "none", className: "shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("path", { d: ss.icon.path.down, fill: "currentColor" }) })
|
|
2145
|
+
}
|
|
2146
|
+
)
|
|
2147
|
+
] }) : void 0;
|
|
2148
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
2149
|
+
Input,
|
|
2150
|
+
{
|
|
2151
|
+
ref,
|
|
2152
|
+
type: formatThousands ? "text" : "number",
|
|
2153
|
+
min,
|
|
2154
|
+
max,
|
|
2155
|
+
step,
|
|
2156
|
+
rightIcon: showSteppers ? void 0 : props.rightIcon,
|
|
2157
|
+
rightAddon: stepperAddon,
|
|
2158
|
+
value: displayValue,
|
|
2159
|
+
onChange: (e) => {
|
|
2160
|
+
if (!onChange) return;
|
|
2161
|
+
if (!formatThousands) return onChange(e);
|
|
2162
|
+
const raw = e.target.value;
|
|
2163
|
+
const parsed = parse(raw);
|
|
2164
|
+
if (Number.isNaN(parsed)) {
|
|
2165
|
+
setDisplayValue("");
|
|
2166
|
+
onChange({ target: { value: "" } });
|
|
2167
|
+
} else {
|
|
2168
|
+
const bounded = Math.min(Math.max(parsed, min ?? -Infinity), max ?? Infinity);
|
|
2169
|
+
setDisplayValue(format(bounded));
|
|
2170
|
+
onChange({ target: { value: bounded.toString() } });
|
|
2171
2171
|
}
|
|
2172
|
+
},
|
|
2173
|
+
...props,
|
|
2174
|
+
className: cn(
|
|
2175
|
+
showSteppers && [
|
|
2176
|
+
"pr-12",
|
|
2177
|
+
// Hide native browser steppers
|
|
2178
|
+
"[&::-webkit-outer-spin-button]:appearance-none",
|
|
2179
|
+
"[&::-webkit-inner-spin-button]:appearance-none",
|
|
2180
|
+
"[&::-webkit-inner-spin-button]:m-0",
|
|
2181
|
+
"appearance-none"
|
|
2182
|
+
],
|
|
2183
|
+
props.className
|
|
2172
2184
|
)
|
|
2173
|
-
|
|
2174
|
-
|
|
2185
|
+
}
|
|
2186
|
+
);
|
|
2175
2187
|
}
|
|
2176
2188
|
);
|
|
2177
2189
|
NumberInput.displayName = "NumberInput";
|
|
@@ -3389,10 +3401,10 @@ var import_react_dom = require("react-dom");
|
|
|
3389
3401
|
var import_lucide_react6 = require("lucide-react");
|
|
3390
3402
|
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
3391
3403
|
var sizeStyles3 = {
|
|
3392
|
-
sm: "max-w-
|
|
3393
|
-
md: "max-w-
|
|
3394
|
-
lg: "max-w-
|
|
3395
|
-
xl: "max-w-
|
|
3404
|
+
sm: "max-w-md",
|
|
3405
|
+
md: "max-w-2xl",
|
|
3406
|
+
lg: "max-w-4xl",
|
|
3407
|
+
xl: "max-w-6xl",
|
|
3396
3408
|
full: "max-w-full"
|
|
3397
3409
|
};
|
|
3398
3410
|
var Modal = ({
|
|
@@ -3499,7 +3511,7 @@ var Modal = ({
|
|
|
3499
3511
|
const modalContent = /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
3500
3512
|
"div",
|
|
3501
3513
|
{
|
|
3502
|
-
className: cn("fixed inset-0 z-9999 flex items-center justify-center", overlayClassName),
|
|
3514
|
+
className: cn("fixed inset-0 z-9999 flex items-center justify-center p-4 md:p-6", overlayClassName),
|
|
3503
3515
|
style: { overscrollBehavior: "contain" },
|
|
3504
3516
|
onMouseDown: handleOverlayMouseDown,
|
|
3505
3517
|
onMouseUp: handleOverlayMouseUp,
|