@yomologic/react-ui 0.5.6 → 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 +1 -1
package/dist/index.mjs
CHANGED
|
@@ -995,9 +995,9 @@ var Input = React2.forwardRef(
|
|
|
995
995
|
className: cn(
|
|
996
996
|
"w-full px-3 py-2 border rounded-md transition-colors",
|
|
997
997
|
"text-(--color-muted-foreground) placeholder-gray-400",
|
|
998
|
-
"focus:outline-none
|
|
998
|
+
"focus:outline-none",
|
|
999
999
|
"disabled:bg-(--color-muted) disabled:cursor-not-allowed disabled:text-(--color-muted-foreground)",
|
|
1000
|
-
inputError ? "border-error focus:ring-error" : "border-(--color-border)",
|
|
1000
|
+
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)",
|
|
1001
1001
|
leftIcon && "pl-10",
|
|
1002
1002
|
rightIcon && "pr-10",
|
|
1003
1003
|
className
|
|
@@ -1238,9 +1238,9 @@ var Textarea = React3.forwardRef(
|
|
|
1238
1238
|
className: cn(
|
|
1239
1239
|
"w-full px-3 py-2 border rounded-md transition-colors",
|
|
1240
1240
|
"text-(--color-muted-foreground) placeholder-gray-400",
|
|
1241
|
-
"focus:outline-none
|
|
1241
|
+
"focus:outline-none",
|
|
1242
1242
|
"disabled:bg-(--color-muted) disabled:cursor-not-allowed disabled:text-(--color-muted-foreground)",
|
|
1243
|
-
textareaError ? "border-error focus:ring-error" : "border-(--color-border)",
|
|
1243
|
+
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)",
|
|
1244
1244
|
resizeClasses[resize],
|
|
1245
1245
|
autoResize && "overflow-hidden",
|
|
1246
1246
|
!autoResize && "overflow-auto",
|
|
@@ -2083,6 +2083,7 @@ function Select({
|
|
|
2083
2083
|
const form = useForm();
|
|
2084
2084
|
const [isOpen, setIsOpen] = useState7(false);
|
|
2085
2085
|
const dropdownRef = useRef5(null);
|
|
2086
|
+
const triggerRef = useRef5(null);
|
|
2086
2087
|
const [validationError, _setValidationError] = useState7();
|
|
2087
2088
|
const [focusedIndex, setFocusedIndex] = useState7(-1);
|
|
2088
2089
|
const [searchString, setSearchString] = useState7("");
|
|
@@ -2155,6 +2156,7 @@ function Select({
|
|
|
2155
2156
|
onChange?.(optionValue);
|
|
2156
2157
|
}
|
|
2157
2158
|
setIsOpen(false);
|
|
2159
|
+
setTimeout(() => triggerRef.current?.focus(), 0);
|
|
2158
2160
|
};
|
|
2159
2161
|
const handleClear = async (e) => {
|
|
2160
2162
|
e.stopPropagation();
|
|
@@ -2265,6 +2267,7 @@ function Select({
|
|
|
2265
2267
|
/* @__PURE__ */ jsxs9(
|
|
2266
2268
|
"button",
|
|
2267
2269
|
{
|
|
2270
|
+
ref: triggerRef,
|
|
2268
2271
|
type: "button",
|
|
2269
2272
|
onClick: () => !disabled && setIsOpen(!isOpen),
|
|
2270
2273
|
onKeyDown: handleKeyDown,
|
|
@@ -2273,8 +2276,9 @@ function Select({
|
|
|
2273
2276
|
w-full ${sizeStyles[size]} text-left bg-(--color-background) border rounded-(--dropdown-radius)
|
|
2274
2277
|
flex items-center justify-between
|
|
2275
2278
|
transition-all duration-200
|
|
2276
|
-
|
|
2277
|
-
${
|
|
2279
|
+
outline-none
|
|
2280
|
+
${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)"}
|
|
2281
|
+
${disabled ? "bg-(--color-muted) cursor-not-allowed opacity-60" : "hover:border-(--color-primary)"}
|
|
2278
2282
|
${!value ? "text-(--color-placeholder)" : "text-(--color-foreground)"}
|
|
2279
2283
|
`,
|
|
2280
2284
|
children: [
|
|
@@ -2325,6 +2329,8 @@ function Select({
|
|
|
2325
2329
|
className: `
|
|
2326
2330
|
w-full ${optionSizeStyles[size]} text-left
|
|
2327
2331
|
transition-colors duration-150
|
|
2332
|
+
outline-none
|
|
2333
|
+
focus-visible:bg-(--color-muted) focus-visible:text-(--color-foreground)
|
|
2328
2334
|
${!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)"}
|
|
2329
2335
|
`,
|
|
2330
2336
|
role: "option",
|
|
@@ -2342,6 +2348,8 @@ function Select({
|
|
|
2342
2348
|
className: `
|
|
2343
2349
|
w-full ${optionSizeStyles[size]} text-left
|
|
2344
2350
|
transition-colors duration-150
|
|
2351
|
+
outline-none
|
|
2352
|
+
focus-visible:bg-(--color-muted) focus-visible:text-(--color-foreground)
|
|
2345
2353
|
${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)"}
|
|
2346
2354
|
${option.disabled ? "opacity-50 cursor-not-allowed" : ""}
|
|
2347
2355
|
`,
|
|
@@ -2456,7 +2464,8 @@ function NativeSelect({
|
|
|
2456
2464
|
transition-all duration-200
|
|
2457
2465
|
appearance-none
|
|
2458
2466
|
cursor-pointer
|
|
2459
|
-
|
|
2467
|
+
outline-none
|
|
2468
|
+
${displayError ? "border-error focus:border-error active:border-error" : "border-(--color-border) focus:border-(--color-primary) active:border-(--color-primary)"}
|
|
2460
2469
|
${disabled ? "bg-(--color-muted) cursor-not-allowed opacity-60" : "hover:border-(--color-primary)"}
|
|
2461
2470
|
${!value ? "text-(--color-placeholder)" : "text-(--color-foreground)"}
|
|
2462
2471
|
pr-10
|