@syscore/ui-library 2.0.0-beta-publish-workflow-beta.20 → 2.0.0-beta-publish-workflow-beta.22
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.
|
@@ -111,6 +111,7 @@ const Dropdown = React.forwardRef<HTMLDivElement, DropdownProps>(
|
|
|
111
111
|
const inputId = id ?? listId;
|
|
112
112
|
const rootRef = React.useRef<HTMLDivElement>(null);
|
|
113
113
|
const inputRef = React.useRef<HTMLInputElement>(null);
|
|
114
|
+
const listRef = React.useRef<HTMLUListElement>(null);
|
|
114
115
|
|
|
115
116
|
const [uncontrolledOpen, setUncontrolledOpen] = React.useState(defaultOpen);
|
|
116
117
|
const [uncontrolledValue, setUncontrolledValue] = React.useState(
|
|
@@ -163,6 +164,17 @@ const Dropdown = React.forwardRef<HTMLDivElement, DropdownProps>(
|
|
|
163
164
|
setHighlighted(query ? 0 : -1);
|
|
164
165
|
}, [query, isOpen]);
|
|
165
166
|
|
|
167
|
+
// Arrow-key nav moves `highlighted` but renders nothing new — for a long
|
|
168
|
+
// list (e.g. ~150 countries/languages) the highlighted row can end up
|
|
169
|
+
// scrolled out of view with nothing visibly tracking the keyboard focus.
|
|
170
|
+
React.useEffect(() => {
|
|
171
|
+
if (!isOpen || highlighted < 0) return;
|
|
172
|
+
const item = listRef.current?.children[highlighted] as
|
|
173
|
+
| HTMLElement
|
|
174
|
+
| undefined;
|
|
175
|
+
item?.scrollIntoView({ block: "nearest" });
|
|
176
|
+
}, [highlighted, isOpen]);
|
|
177
|
+
|
|
166
178
|
React.useEffect(() => {
|
|
167
179
|
const onPointerDown = (event: PointerEvent) => {
|
|
168
180
|
if (!rootRef.current?.contains(event.target as Node)) {
|
|
@@ -382,6 +394,7 @@ const Dropdown = React.forwardRef<HTMLDivElement, DropdownProps>(
|
|
|
382
394
|
|
|
383
395
|
{isOpen && !error ? (
|
|
384
396
|
<ul
|
|
397
|
+
ref={listRef}
|
|
385
398
|
id={listId}
|
|
386
399
|
role="listbox"
|
|
387
400
|
className={cn("dropdown-menu", isRich && "dropdown-menu--rich")}
|
|
@@ -3,13 +3,19 @@ import * as ProgressPrimitive from "@radix-ui/react-progress";
|
|
|
3
3
|
|
|
4
4
|
import { cn } from "@/lib/utils";
|
|
5
5
|
|
|
6
|
+
interface ProgressProps
|
|
7
|
+
extends React.ComponentPropsWithoutRef<typeof ProgressPrimitive.Root> {
|
|
8
|
+
/** "default" (16px, the original size) or "small" (4px — inline/compact contexts, e.g. next to an upload trigger). */
|
|
9
|
+
size?: "default" | "small";
|
|
10
|
+
}
|
|
11
|
+
|
|
6
12
|
const Progress = React.forwardRef<
|
|
7
13
|
React.ElementRef<typeof ProgressPrimitive.Root>,
|
|
8
|
-
|
|
9
|
-
>(({ className, value, ...props }, ref) => (
|
|
14
|
+
ProgressProps
|
|
15
|
+
>(({ className, value, size = "default", ...props }, ref) => (
|
|
10
16
|
<ProgressPrimitive.Root
|
|
11
17
|
ref={ref}
|
|
12
|
-
className={cn("progress", className)}
|
|
18
|
+
className={cn("progress", size === "small" && "progress--small", className)}
|
|
13
19
|
{...props}
|
|
14
20
|
>
|
|
15
21
|
<ProgressPrimitive.Indicator
|
package/client/global.css
CHANGED
|
@@ -4718,6 +4718,10 @@ body {
|
|
|
4718
4718
|
transition: transform 0.15s ease-in-out;
|
|
4719
4719
|
}
|
|
4720
4720
|
|
|
4721
|
+
.progress--small {
|
|
4722
|
+
height: 0.25rem;
|
|
4723
|
+
}
|
|
4724
|
+
|
|
4721
4725
|
/* Slider Styles */
|
|
4722
4726
|
.slider {
|
|
4723
4727
|
position: relative;
|
|
@@ -6122,6 +6126,11 @@ body {
|
|
|
6122
6126
|
position: relative;
|
|
6123
6127
|
z-index: 50;
|
|
6124
6128
|
max-height: 24rem;
|
|
6129
|
+
/* Radix (position="popper") exposes the trigger's measured width as this
|
|
6130
|
+
var but never applies it itself — without binding to it, the popup
|
|
6131
|
+
shrinks to its longest option's natural width instead of matching the
|
|
6132
|
+
field above it (reported: dropdown narrower than its own input). */
|
|
6133
|
+
width: var(--radix-select-trigger-width);
|
|
6125
6134
|
min-width: 8rem;
|
|
6126
6135
|
overflow: hidden;
|
|
6127
6136
|
border: 1px solid var(--color-cyan-300, #39c9ea);
|
|
@@ -6164,7 +6173,44 @@ body {
|
|
|
6164
6173
|
}
|
|
6165
6174
|
|
|
6166
6175
|
.select-viewport {
|
|
6167
|
-
/*
|
|
6176
|
+
/* Thin, always-visible scrollbar: the default native scrollbar nearly
|
|
6177
|
+
disappears against the dark .select-content background (team feedback
|
|
6178
|
+
2026-10-29), leaving no indication that more options exist below. */
|
|
6179
|
+
scrollbar-width: thin;
|
|
6180
|
+
scrollbar-color: var(--color-gray-400, #9397a1) transparent;
|
|
6181
|
+
}
|
|
6182
|
+
|
|
6183
|
+
/* Radix's own SelectViewport renders a <style> tag of its own on every open
|
|
6184
|
+
([data-radix-select-viewport]{scrollbar-width:none} +
|
|
6185
|
+
[data-radix-select-viewport]::-webkit-scrollbar{display:none}) to hide its
|
|
6186
|
+
default scrollbar. That selector has the exact same specificity as the
|
|
6187
|
+
plain `.select-viewport` rules above, so it was winning the cascade tie
|
|
6188
|
+
and silently cancelling the "visible scrollbar" fix — the CSS above has
|
|
6189
|
+
never actually rendered a scrollbar. Re-declaring against the same
|
|
6190
|
+
[data-radix-select-viewport] attribute Radix sets gives these a strictly
|
|
6191
|
+
higher specificity than Radix's injected rule, so ours wins instead. */
|
|
6192
|
+
.select-viewport[data-radix-select-viewport] {
|
|
6193
|
+
scrollbar-width: thin;
|
|
6194
|
+
scrollbar-color: var(--color-gray-400, #9397a1) transparent;
|
|
6195
|
+
}
|
|
6196
|
+
|
|
6197
|
+
.select-viewport::-webkit-scrollbar,
|
|
6198
|
+
.select-viewport[data-radix-select-viewport]::-webkit-scrollbar {
|
|
6199
|
+
width: 8px;
|
|
6200
|
+
display: block;
|
|
6201
|
+
}
|
|
6202
|
+
|
|
6203
|
+
.select-viewport::-webkit-scrollbar-track {
|
|
6204
|
+
background: transparent;
|
|
6205
|
+
}
|
|
6206
|
+
|
|
6207
|
+
.select-viewport::-webkit-scrollbar-thumb {
|
|
6208
|
+
border-radius: 8px;
|
|
6209
|
+
background-color: var(--color-gray-400, #9397a1);
|
|
6210
|
+
}
|
|
6211
|
+
|
|
6212
|
+
.select-viewport::-webkit-scrollbar-thumb:hover {
|
|
6213
|
+
background-color: var(--color-gray-200, #dedfe3);
|
|
6168
6214
|
}
|
|
6169
6215
|
|
|
6170
6216
|
.select-label {
|
|
@@ -65,6 +65,7 @@ const Dropdown = React.forwardRef(
|
|
|
65
65
|
const inputId = id ?? listId;
|
|
66
66
|
const rootRef = React.useRef(null);
|
|
67
67
|
const inputRef = React.useRef(null);
|
|
68
|
+
const listRef = React.useRef(null);
|
|
68
69
|
const [uncontrolledOpen, setUncontrolledOpen] = React.useState(defaultOpen);
|
|
69
70
|
const [uncontrolledValue, setUncontrolledValue] = React.useState(
|
|
70
71
|
defaultValue ?? ""
|
|
@@ -108,6 +109,12 @@ const Dropdown = React.forwardRef(
|
|
|
108
109
|
React.useEffect(() => {
|
|
109
110
|
setHighlighted(query ? 0 : -1);
|
|
110
111
|
}, [query, isOpen]);
|
|
112
|
+
React.useEffect(() => {
|
|
113
|
+
var _a;
|
|
114
|
+
if (!isOpen || highlighted < 0) return;
|
|
115
|
+
const item = (_a = listRef.current) == null ? void 0 : _a.children[highlighted];
|
|
116
|
+
item == null ? void 0 : item.scrollIntoView({ block: "nearest" });
|
|
117
|
+
}, [highlighted, isOpen]);
|
|
111
118
|
React.useEffect(() => {
|
|
112
119
|
const onPointerDown = (event) => {
|
|
113
120
|
var _a;
|
|
@@ -294,6 +301,7 @@ const Dropdown = React.forwardRef(
|
|
|
294
301
|
isOpen && !error ? /* @__PURE__ */ jsx(
|
|
295
302
|
"ul",
|
|
296
303
|
{
|
|
304
|
+
ref: listRef,
|
|
297
305
|
id: listId,
|
|
298
306
|
role: "listbox",
|
|
299
307
|
className: cn("dropdown-menu", isRich && "dropdown-menu--rich"),
|
|
@@ -2,11 +2,11 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import * as ProgressPrimitive from "@radix-ui/react-progress";
|
|
4
4
|
import { cn } from "../../lib/utils.js";
|
|
5
|
-
const Progress = React.forwardRef(({ className, value, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
5
|
+
const Progress = React.forwardRef(({ className, value, size = "default", ...props }, ref) => /* @__PURE__ */ jsx(
|
|
6
6
|
ProgressPrimitive.Root,
|
|
7
7
|
{
|
|
8
8
|
ref,
|
|
9
|
-
className: cn("progress", className),
|
|
9
|
+
className: cn("progress", size === "small" && "progress--small", className),
|
|
10
10
|
...props,
|
|
11
11
|
children: /* @__PURE__ */ jsx(
|
|
12
12
|
ProgressPrimitive.Indicator,
|