@yomologic/react-ui 0.5.5 → 0.5.7
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.js +16 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +16 -7
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +29 -14
- package/dist/styles.css.map +1 -1
- package/package.json +5 -2
package/dist/index.js
CHANGED
|
@@ -1064,9 +1064,9 @@ var Input = import_react5.default.forwardRef(
|
|
|
1064
1064
|
className: cn(
|
|
1065
1065
|
"w-full px-3 py-2 border rounded-md transition-colors",
|
|
1066
1066
|
"text-(--color-muted-foreground) placeholder-gray-400",
|
|
1067
|
-
"focus:outline-none
|
|
1067
|
+
"focus:outline-none",
|
|
1068
1068
|
"disabled:bg-(--color-muted) disabled:cursor-not-allowed disabled:text-(--color-muted-foreground)",
|
|
1069
|
-
inputError ? "border-error focus:ring-error" : "border-(--color-border)",
|
|
1069
|
+
inputError ? "border-error focus:ring-2 focus:ring-error focus:border-error active:border-error" : "border-(--color-border) focus:ring-2 focus:ring-(--color-primary)/30 focus:border-(--color-primary) active:border-(--color-primary)",
|
|
1070
1070
|
leftIcon && "pl-10",
|
|
1071
1071
|
rightIcon && "pr-10",
|
|
1072
1072
|
className
|
|
@@ -1307,9 +1307,9 @@ var Textarea = import_react6.default.forwardRef(
|
|
|
1307
1307
|
className: cn(
|
|
1308
1308
|
"w-full px-3 py-2 border rounded-md transition-colors",
|
|
1309
1309
|
"text-(--color-muted-foreground) placeholder-gray-400",
|
|
1310
|
-
"focus:outline-none
|
|
1310
|
+
"focus:outline-none",
|
|
1311
1311
|
"disabled:bg-(--color-muted) disabled:cursor-not-allowed disabled:text-(--color-muted-foreground)",
|
|
1312
|
-
textareaError ? "border-error focus:ring-error" : "border-(--color-border)",
|
|
1312
|
+
textareaError ? "border-error focus:ring-2 focus:ring-error focus:border-error active:border-error" : "border-(--color-border) focus:ring-2 focus:ring-(--color-primary)/30 focus:border-(--color-primary) active:border-(--color-primary)",
|
|
1313
1313
|
resizeClasses[resize],
|
|
1314
1314
|
autoResize && "overflow-hidden",
|
|
1315
1315
|
!autoResize && "overflow-auto",
|
|
@@ -2152,6 +2152,7 @@ function Select({
|
|
|
2152
2152
|
const form = useForm();
|
|
2153
2153
|
const [isOpen, setIsOpen] = (0, import_react11.useState)(false);
|
|
2154
2154
|
const dropdownRef = (0, import_react11.useRef)(null);
|
|
2155
|
+
const triggerRef = (0, import_react11.useRef)(null);
|
|
2155
2156
|
const [validationError, _setValidationError] = (0, import_react11.useState)();
|
|
2156
2157
|
const [focusedIndex, setFocusedIndex] = (0, import_react11.useState)(-1);
|
|
2157
2158
|
const [searchString, setSearchString] = (0, import_react11.useState)("");
|
|
@@ -2224,6 +2225,7 @@ function Select({
|
|
|
2224
2225
|
onChange?.(optionValue);
|
|
2225
2226
|
}
|
|
2226
2227
|
setIsOpen(false);
|
|
2228
|
+
setTimeout(() => triggerRef.current?.focus(), 0);
|
|
2227
2229
|
};
|
|
2228
2230
|
const handleClear = async (e) => {
|
|
2229
2231
|
e.stopPropagation();
|
|
@@ -2334,6 +2336,7 @@ function Select({
|
|
|
2334
2336
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
2335
2337
|
"button",
|
|
2336
2338
|
{
|
|
2339
|
+
ref: triggerRef,
|
|
2337
2340
|
type: "button",
|
|
2338
2341
|
onClick: () => !disabled && setIsOpen(!isOpen),
|
|
2339
2342
|
onKeyDown: handleKeyDown,
|
|
@@ -2342,8 +2345,9 @@ function Select({
|
|
|
2342
2345
|
w-full ${sizeStyles[size]} text-left bg-(--color-background) border rounded-(--dropdown-radius)
|
|
2343
2346
|
flex items-center justify-between
|
|
2344
2347
|
transition-all duration-200
|
|
2345
|
-
|
|
2346
|
-
${
|
|
2348
|
+
outline-none
|
|
2349
|
+
${displayError ? "border-error focus:ring-2 focus:ring-error focus:border-error focus-visible:ring-2 focus-visible:ring-error focus-visible:border-error" : "border-(--color-border) focus:ring-2 focus:ring-(--color-primary)/30 focus:border-(--color-primary) focus-visible:ring-2 focus-visible:ring-(--color-primary)/30 focus-visible:border-(--color-primary)"}
|
|
2350
|
+
${disabled ? "bg-(--color-muted) cursor-not-allowed opacity-60" : "hover:border-(--color-primary)"}
|
|
2347
2351
|
${!value ? "text-(--color-placeholder)" : "text-(--color-foreground)"}
|
|
2348
2352
|
`,
|
|
2349
2353
|
children: [
|
|
@@ -2394,6 +2398,8 @@ function Select({
|
|
|
2394
2398
|
className: `
|
|
2395
2399
|
w-full ${optionSizeStyles[size]} text-left
|
|
2396
2400
|
transition-colors duration-150
|
|
2401
|
+
outline-none
|
|
2402
|
+
focus-visible:bg-(--color-muted) focus-visible:text-(--color-foreground)
|
|
2397
2403
|
${!value || value === "" ? "bg-[color-mix(in_srgb,var(--color-primary)_10%,transparent)] text-(--color-primary) font-medium" : "text-(--color-muted-foreground) hover:bg-(--color-muted)"}
|
|
2398
2404
|
`,
|
|
2399
2405
|
role: "option",
|
|
@@ -2411,6 +2417,8 @@ function Select({
|
|
|
2411
2417
|
className: `
|
|
2412
2418
|
w-full ${optionSizeStyles[size]} text-left
|
|
2413
2419
|
transition-colors duration-150
|
|
2420
|
+
outline-none
|
|
2421
|
+
focus-visible:bg-(--color-muted) focus-visible:text-(--color-foreground)
|
|
2414
2422
|
${option.value === value ? "bg-[color-mix(in_srgb,var(--color-primary)_10%,transparent)] text-(--color-primary) font-medium" : index === focusedIndex ? "bg-(--color-muted) text-(--color-foreground)" : "text-(--color-foreground) hover:bg-(--color-muted)"}
|
|
2415
2423
|
${option.disabled ? "opacity-50 cursor-not-allowed" : ""}
|
|
2416
2424
|
`,
|
|
@@ -2525,7 +2533,8 @@ function NativeSelect({
|
|
|
2525
2533
|
transition-all duration-200
|
|
2526
2534
|
appearance-none
|
|
2527
2535
|
cursor-pointer
|
|
2528
|
-
|
|
2536
|
+
outline-none
|
|
2537
|
+
${displayError ? "border-error focus:border-error active:border-error" : "border-(--color-border) focus:border-(--color-primary) active:border-(--color-primary)"}
|
|
2529
2538
|
${disabled ? "bg-(--color-muted) cursor-not-allowed opacity-60" : "hover:border-(--color-primary)"}
|
|
2530
2539
|
${!value ? "text-(--color-placeholder)" : "text-(--color-foreground)"}
|
|
2531
2540
|
pr-10
|