@moi952/decky-ui-kit 0.5.0 → 0.6.1
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/ActionButton.d.ts +2 -0
- package/dist/ActionButton.js +35 -25
- package/dist/AnchoredDropdown.d.ts +3 -0
- package/dist/AnchoredDropdown.js +50 -18
- package/dist/InfoTable.js +1 -1
- package/dist/InlineConfirm.js +5 -0
- package/dist/MediaRow.d.ts +3 -0
- package/dist/MediaRow.js +3 -3
- package/package.json +1 -1
package/dist/ActionButton.d.ts
CHANGED
|
@@ -7,8 +7,10 @@ export interface ActionButtonProps {
|
|
|
7
7
|
onClick: () => void;
|
|
8
8
|
size?: ComponentSize;
|
|
9
9
|
variant?: "normal" | "bordered" | "danger" | "primary";
|
|
10
|
+
pressed?: boolean;
|
|
10
11
|
width?: string | number;
|
|
11
12
|
disabled?: boolean;
|
|
13
|
+
preferredFocus?: boolean;
|
|
12
14
|
onSecondaryButton?: (evt: GamepadEvt) => void;
|
|
13
15
|
onSecondaryActionDescription?: React.ReactNode;
|
|
14
16
|
onOptionsButton?: (evt: GamepadEvt) => void;
|
package/dist/ActionButton.js
CHANGED
|
@@ -1,55 +1,53 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { DialogButton } from "@decky/ui";
|
|
3
3
|
import { ACCENT_DANGER, ACCENT_INFO, SIZE_STYLE } from "./internal/theme";
|
|
4
|
-
// Padding only — vertical rhythm (fontSize/minHeight) comes from the
|
|
5
|
-
// shared SIZE_STYLE table instead, the same one FieldTextInput and
|
|
6
|
-
// AnchoredDropdown's own trigger use, so all three actually line up
|
|
7
|
-
// instead of each deriving a close-but-not-guaranteed height from their
|
|
8
|
-
// own padding+font independently.
|
|
9
4
|
const PADDING_V = { small: 4, medium: 6, large: 8 };
|
|
10
5
|
const PADDING_H = { small: 8, medium: 12, large: 16 };
|
|
11
6
|
const SOLID_VARIANT_COLOR = {
|
|
12
7
|
danger: ACCENT_DANGER,
|
|
13
8
|
primary: ACCENT_INFO,
|
|
14
9
|
};
|
|
15
|
-
//
|
|
16
|
-
//
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
10
|
+
// Resting-state color only — pressed's own focus/hover is the same
|
|
11
|
+
// plain white every other button uses (see below).
|
|
12
|
+
const PRESSED_COLOR = {
|
|
13
|
+
normal: "#4a4f57",
|
|
14
|
+
bordered: "#4a4f57",
|
|
15
|
+
primary: "#2f6db8",
|
|
16
|
+
danger: "#a83333",
|
|
17
|
+
};
|
|
18
|
+
export const ActionButton = ({ children, onClick, size = "small", variant = "normal", pressed, width, disabled, preferredFocus, onSecondaryButton, onSecondaryActionDescription, onOptionsButton, onOptionsActionDescription, onMenuButton, onMenuActionDescription, onOKButton, onOKActionDescription, }) => {
|
|
19
|
+
const isPressed = pressed === true;
|
|
21
20
|
const { fontSize, minHeight } = SIZE_STYLE[size];
|
|
22
21
|
const style = {
|
|
23
22
|
padding: `${PADDING_V[size]}px ${PADDING_H[size]}px`,
|
|
24
23
|
fontSize,
|
|
25
24
|
minHeight,
|
|
26
|
-
//
|
|
27
|
-
//
|
|
28
|
-
//
|
|
29
|
-
// box-model space "bordered" uses for its own real one, so all
|
|
30
|
-
// three add up to the exact same height instead of "bordered" alone
|
|
31
|
-
// needing 2px more room than the others at the same size. "normal"
|
|
32
|
-
// stays fully untouched, per its own documented promise above — no
|
|
33
|
-
// override at all, not even an invisible one.
|
|
34
|
-
...(variant !== "normal" ? { border: "1px solid transparent" } : {}),
|
|
25
|
+
// No border, ever — a box-shadow (below) draws the visible ring
|
|
26
|
+
// instead, since a border would resize the button whenever it
|
|
27
|
+
// appears (no fixed width here, buttons size to their content).
|
|
35
28
|
};
|
|
36
|
-
const cls = variant !== "normal" ? `dck-action-btn-${variant}` :
|
|
29
|
+
const cls = [variant !== "normal" ? `dck-action-btn-${variant}` : null, isPressed ? `dck-action-btn-pressed-${variant}` : null]
|
|
30
|
+
.filter(Boolean)
|
|
31
|
+
.join(" ") || undefined;
|
|
32
|
+
// Compound selector so the pressed rule reliably outranks the plain
|
|
33
|
+
// variant rule regardless of style-tag mount order.
|
|
34
|
+
const pressedVariantCls = variant !== "normal" ? `.dck-action-btn-${variant}` : "";
|
|
37
35
|
return (_jsxs(_Fragment, { children: [variant === "bordered" && (_jsx("style", { children: `
|
|
38
36
|
.dck-action-btn-bordered {
|
|
39
37
|
background: rgba(255, 255, 255, 0.08) !important;
|
|
40
|
-
|
|
38
|
+
box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18) !important;
|
|
41
39
|
}
|
|
42
40
|
.dck-action-btn-bordered:focus,
|
|
43
41
|
.dck-action-btn-bordered:hover {
|
|
44
42
|
background: #dcdedf !important;
|
|
45
43
|
color: #000 !important;
|
|
46
|
-
|
|
44
|
+
box-shadow: inset 0 0 0 1px #dcdedf !important;
|
|
47
45
|
}
|
|
48
46
|
.dck-action-btn-bordered:disabled,
|
|
49
47
|
.dck-action-btn-bordered[disabled] {
|
|
50
48
|
opacity: 1 !important;
|
|
51
49
|
background: #2a2e35 !important;
|
|
52
|
-
|
|
50
|
+
box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15) !important;
|
|
53
51
|
color: #6b7076 !important;
|
|
54
52
|
}
|
|
55
53
|
` })), (variant === "danger" || variant === "primary") && (_jsx("style", { children: `
|
|
@@ -62,6 +60,18 @@ export const ActionButton = ({ children, onClick, size = "small", variant = "nor
|
|
|
62
60
|
background-color: #fff !important;
|
|
63
61
|
color: ${SOLID_VARIANT_COLOR[variant]} !important;
|
|
64
62
|
}
|
|
63
|
+
` })), isPressed && (_jsx("style", { children: `
|
|
64
|
+
.dck-action-btn-pressed-${variant}${pressedVariantCls ? `, ${pressedVariantCls}.dck-action-btn-pressed-${variant}` : ""} {
|
|
65
|
+
background-color: ${PRESSED_COLOR[variant]} !important;
|
|
66
|
+
color: #fff !important;
|
|
67
|
+
}
|
|
68
|
+
.dck-action-btn-pressed-${variant}:focus,
|
|
69
|
+
.dck-action-btn-pressed-${variant}:hover${pressedVariantCls ? `,
|
|
70
|
+
${pressedVariantCls}.dck-action-btn-pressed-${variant}:focus,
|
|
71
|
+
${pressedVariantCls}.dck-action-btn-pressed-${variant}:hover` : ""} {
|
|
72
|
+
background-color: #fff !important;
|
|
73
|
+
color: #111 !important;
|
|
74
|
+
}
|
|
65
75
|
` })), _jsx(DialogButton, { className: cls, style: {
|
|
66
76
|
...style,
|
|
67
77
|
// Without this, sizing is content-box by default (the
|
|
@@ -73,5 +83,5 @@ export const ActionButton = ({ children, onClick, size = "small", variant = "nor
|
|
|
73
83
|
justifyContent: "center",
|
|
74
84
|
width: width ?? "fit-content",
|
|
75
85
|
minWidth: "unset",
|
|
76
|
-
}, onClick: onClick, disabled: disabled, onSecondaryButton: onSecondaryButton, onSecondaryActionDescription: onSecondaryActionDescription, onOptionsButton: onOptionsButton, onOptionsActionDescription: onOptionsActionDescription, onMenuButton: onMenuButton, onMenuActionDescription: onMenuActionDescription, onOKButton: onOKButton, onOKActionDescription: onOKActionDescription, children: children })] }));
|
|
86
|
+
}, onClick: onClick, disabled: disabled, preferredFocus: preferredFocus, onSecondaryButton: onSecondaryButton, onSecondaryActionDescription: onSecondaryActionDescription, onOptionsButton: onOptionsButton, onOptionsActionDescription: onOptionsActionDescription, onMenuButton: onMenuButton, onMenuActionDescription: onMenuActionDescription, onOKButton: onOKButton, onOKActionDescription: onOKActionDescription, children: children })] }));
|
|
77
87
|
};
|
|
@@ -9,6 +9,7 @@ export interface AnchoredDropdownProps {
|
|
|
9
9
|
selectedValue: string;
|
|
10
10
|
onChange: (value: string) => void;
|
|
11
11
|
label?: React.ReactNode;
|
|
12
|
+
labelFontSize?: number;
|
|
12
13
|
variant?: "row" | "boxed";
|
|
13
14
|
focusStyle?: "fill" | "outline";
|
|
14
15
|
size?: ComponentSize;
|
|
@@ -27,6 +28,8 @@ export interface AnchoredDropdownProps {
|
|
|
27
28
|
maxVisibleOptions?: number;
|
|
28
29
|
highlightOnFocus?: boolean;
|
|
29
30
|
bottomSeparator?: boolean;
|
|
31
|
+
valueFontSize?: number;
|
|
32
|
+
renderOptionLabel?: (option: DropdownOption) => React.ReactNode;
|
|
30
33
|
}
|
|
31
34
|
export declare const AnchoredDropdown: React.FC<AnchoredDropdownProps>;
|
|
32
35
|
export {};
|
package/dist/AnchoredDropdown.js
CHANGED
|
@@ -37,7 +37,7 @@ const toggleCsv = (csv, value, options) => {
|
|
|
37
37
|
.join(",");
|
|
38
38
|
};
|
|
39
39
|
// Native Steam popups reset the panel on close — this is an inline overlay instead.
|
|
40
|
-
export const AnchoredDropdown = ({ options, selectedValue, onChange, label, variant = "boxed", focusStyle = "fill", size = "medium", bgColor = DEFAULT_BG, textColor = DEFAULT_TEXT, borderColor = DEFAULT_BORDER, blurBackground = true, multiple = false, selectedValuesLayout = "inline", selectedCountLabel, onSecondaryButton, onSecondaryActionDescription, onOptionsButton, onOptionsActionDescription, maxDisplayLines = 1, maxVisibleOptions, highlightOnFocus = true, bottomSeparator = true, }) => {
|
|
40
|
+
export const AnchoredDropdown = ({ options, selectedValue, onChange, label, labelFontSize, variant = "boxed", focusStyle = "fill", size = "medium", bgColor = DEFAULT_BG, textColor = DEFAULT_TEXT, borderColor = DEFAULT_BORDER, blurBackground = true, multiple = false, selectedValuesLayout = "inline", selectedCountLabel, onSecondaryButton, onSecondaryActionDescription, onOptionsButton, onOptionsActionDescription, maxDisplayLines = 1, maxVisibleOptions, highlightOnFocus = true, bottomSeparator = true, valueFontSize, renderOptionLabel, }) => {
|
|
41
41
|
// Scoped per instance so sibling dropdowns don't share class names.
|
|
42
42
|
const [uid] = useState(() => `dck-anchored-dd${uidCounter++}`);
|
|
43
43
|
const [expanded, setExpanded] = useState(false);
|
|
@@ -46,6 +46,7 @@ export const AnchoredDropdown = ({ options, selectedValue, onChange, label, vari
|
|
|
46
46
|
const wrapperRef = useRef(null);
|
|
47
47
|
const triggerRef = useRef(null);
|
|
48
48
|
const [openUp, setOpenUp] = useState(false);
|
|
49
|
+
const [listMaxHeight, setListMaxHeight] = useState(220);
|
|
49
50
|
// Mirrors the trigger's real computed radius instead of a guessed CSS var.
|
|
50
51
|
const [listRadius, setListRadius] = useState(FALLBACK_RADIUS);
|
|
51
52
|
// CSS-only truncation proved unreliable through Field's layout — measure instead.
|
|
@@ -137,19 +138,48 @@ export const AnchoredDropdown = ({ options, selectedValue, onChange, label, vari
|
|
|
137
138
|
// Padding + line-height + the option's 2px border.
|
|
138
139
|
const rowHeight = OPTION_ROW_HEIGHT[size];
|
|
139
140
|
// 0 means "show every option, no scroll cap".
|
|
140
|
-
const
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
141
|
+
const requestedHeight = maxVisibleOptions === 0 ? Infinity : maxVisibleOptions ? maxVisibleOptions * (rowHeight + 2) : 220;
|
|
142
|
+
useLayoutEffect(() => {
|
|
143
|
+
if (!expanded || !wrapperRef.current)
|
|
144
|
+
return;
|
|
145
|
+
const wrapper = wrapperRef.current;
|
|
146
|
+
const view = wrapper.ownerDocument.defaultView;
|
|
147
|
+
if (!view)
|
|
148
|
+
return;
|
|
149
|
+
const measure = () => {
|
|
150
|
+
const r = wrapper.getBoundingClientRect();
|
|
151
|
+
const scale = (wrapper.offsetHeight ? r.height / wrapper.offsetHeight : 1) || 1;
|
|
152
|
+
let top = 8;
|
|
153
|
+
let bottom = view.innerHeight - 8;
|
|
154
|
+
for (let p = wrapper.parentElement; p; p = p.parentElement) {
|
|
155
|
+
if (p === wrapper.ownerDocument.body || p === wrapper.ownerDocument.documentElement)
|
|
156
|
+
continue;
|
|
157
|
+
if (/^(auto|scroll|hidden|clip)$/.test(view.getComputedStyle(p).overflowY)) {
|
|
158
|
+
const b = p.getBoundingClientRect();
|
|
159
|
+
top = Math.max(top, b.top + 8);
|
|
160
|
+
bottom = Math.min(bottom, b.bottom - 8);
|
|
161
|
+
}
|
|
149
162
|
}
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
163
|
+
const below = Math.max(0, (bottom - r.bottom) / scale - 2);
|
|
164
|
+
const above = Math.max(0, (r.top - top) / scale - 2);
|
|
165
|
+
const visible = maxVisibleOptions ?? 0;
|
|
166
|
+
const rows = visible > 0 ? itemRefs.current.slice(0, visible).filter(Boolean) : [];
|
|
167
|
+
const wanted = rows.length
|
|
168
|
+
? rows.reduce((sum, row) => sum + (row?.offsetHeight ?? 0), 0) + (rows.length - 1) * 2 + 2
|
|
169
|
+
: requestedHeight;
|
|
170
|
+
const up = below < wanted && above > below;
|
|
171
|
+
setOpenUp(up);
|
|
172
|
+
setListMaxHeight(Math.min(wanted, up ? above : below));
|
|
173
|
+
};
|
|
174
|
+
measure();
|
|
175
|
+
view.addEventListener("resize", measure);
|
|
176
|
+
view.addEventListener("scroll", measure, true);
|
|
177
|
+
return () => {
|
|
178
|
+
view.removeEventListener("resize", measure);
|
|
179
|
+
view.removeEventListener("scroll", measure, true);
|
|
180
|
+
};
|
|
181
|
+
}, [expanded, requestedHeight, options.length]);
|
|
182
|
+
const toggle = () => setExpanded((prev) => !prev);
|
|
153
183
|
const optionCls = `${uid}-option`;
|
|
154
184
|
const selectedCls = `${uid}-selected`;
|
|
155
185
|
const triggerCls = `${uid}-trigger`;
|
|
@@ -159,7 +189,8 @@ export const AnchoredDropdown = ({ options, selectedValue, onChange, label, vari
|
|
|
159
189
|
const optionPadding = OPTION_PADDING[size];
|
|
160
190
|
const optionFontSize = OPTION_FONT_SIZE[size];
|
|
161
191
|
const triggerPadding = `${TRIGGER_PADDING_V[size]}px ${TRIGGER_PADDING_H[size]}px`;
|
|
162
|
-
const { fontSize:
|
|
192
|
+
const { fontSize: sizeFontSize, minHeight: triggerMinHeight } = SIZE_STYLE[size];
|
|
193
|
+
const triggerFontSize = valueFontSize ?? sizeFontSize;
|
|
163
194
|
return (_jsxs("div", { ref: wrapperRef, className: wrapperCls, style: { position: "relative", width: "100%", maxWidth: "100%", boxSizing: "border-box" }, children: [_jsx("style", { children: `
|
|
164
195
|
.${optionCls} {
|
|
165
196
|
box-sizing: border-box !important;
|
|
@@ -185,7 +216,7 @@ export const AnchoredDropdown = ({ options, selectedValue, onChange, label, vari
|
|
|
185
216
|
align-items: center !important;
|
|
186
217
|
gap: 8px !important;
|
|
187
218
|
padding: ${triggerPadding} !important;
|
|
188
|
-
font-size: ${triggerFontSize} !important;
|
|
219
|
+
font-size: ${triggerFontSize}px !important;
|
|
189
220
|
min-height: ${triggerMinHeight}px !important;
|
|
190
221
|
background: ${bgColor} !important;
|
|
191
222
|
border: 1px solid ${borderColor} !important;
|
|
@@ -248,9 +279,10 @@ export const AnchoredDropdown = ({ options, selectedValue, onChange, label, vari
|
|
|
248
279
|
}
|
|
249
280
|
`}
|
|
250
281
|
` }), (() => {
|
|
282
|
+
const styledLabel = label && labelFontSize !== undefined ? (_jsx("span", { style: { fontSize: labelFontSize }, children: label })) : (label);
|
|
251
283
|
const countNode = multiple && selectedCountLabel && selectedValues.length > 0 ? (_jsx("div", { className: countCls, children: selectedCountLabel(selectedValues.length) })) : null;
|
|
252
284
|
if (variant === "boxed") {
|
|
253
|
-
return (_jsx(Field, { focusable: true, label:
|
|
285
|
+
return (_jsx(Field, { focusable: true, label: styledLabel,
|
|
254
286
|
// Field's own default isn't "label sits above the
|
|
255
287
|
// control" — explicit here so a caller-supplied label
|
|
256
288
|
// renders on top, the same convention FieldTextInput's own
|
|
@@ -259,7 +291,7 @@ export const AnchoredDropdown = ({ options, selectedValue, onChange, label, vari
|
|
|
259
291
|
triggerRef.current = el;
|
|
260
292
|
}, children: [_jsx("span", { className: triggerLabelCls, style: labelMaxWidth !== undefined ? { maxWidth: labelMaxWidth } : undefined, children: displayLabel }), _jsx(FaChevronDown, { size: 12, style: { flexShrink: 0 } })] })] }) }));
|
|
261
293
|
}
|
|
262
|
-
return (_jsx(Field, { focusable: true, highlightOnFocus: highlightOnFocus, bottomSeparator: bottomSeparator ? "standard" : "none", onActivate: toggle, onClick: toggle, onSecondaryButton: onSecondaryButton, onSecondaryActionDescription: onSecondaryButton ? onSecondaryActionDescription : undefined, onOptionsButton: onOptionsButton, onOptionsActionDescription: onOptionsButton ? onOptionsActionDescription : undefined, label: label || countNode ? (_jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 2, width: "100%" }, children: [
|
|
294
|
+
return (_jsx(Field, { focusable: true, highlightOnFocus: highlightOnFocus, bottomSeparator: bottomSeparator ? "standard" : "none", onActivate: toggle, onClick: toggle, onSecondaryButton: onSecondaryButton, onSecondaryActionDescription: onSecondaryButton ? onSecondaryActionDescription : undefined, onOptionsButton: onOptionsButton, onOptionsActionDescription: onOptionsButton ? onOptionsActionDescription : undefined, label: label || countNode ? (_jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 2, width: "100%" }, children: [styledLabel, countNode, displayLabel] })) : (displayLabel), childrenLayout: "inline", ref: (el) => {
|
|
263
295
|
triggerRef.current = el;
|
|
264
296
|
}, children: expanded ? _jsx(FaChevronDown, { size: 12 }) : _jsx(FaChevronRight, { size: 12 }) }));
|
|
265
297
|
})(), expanded && blurBackground && (_jsx("div", { onClick: closeList, style: {
|
|
@@ -298,6 +330,6 @@ export const AnchoredDropdown = ({ options, selectedValue, onChange, label, vari
|
|
|
298
330
|
: opt.value === selectedValue;
|
|
299
331
|
return (_jsxs(DialogButton, { ref: (el) => {
|
|
300
332
|
itemRefs.current[i] = el;
|
|
301
|
-
}, className: `${optionCls}${isSelected ? ` ${selectedCls}` : ""}`, onClick: () => pick(opt.value), children: [_jsx("span", { children: opt.label }), isSelected && _jsx(FaCheck, { size: 10 })] }, opt.value));
|
|
333
|
+
}, className: `${optionCls}${isSelected ? ` ${selectedCls}` : ""}`, onClick: () => pick(opt.value), children: [renderOptionLabel ? (_jsx("span", { style: { flex: 1, minWidth: 0, textAlign: "left" }, children: renderOptionLabel(opt) })) : (_jsx("span", { children: opt.label })), isSelected && _jsx(FaCheck, { size: 10 })] }, opt.value));
|
|
302
334
|
}) }) }))] }));
|
|
303
335
|
};
|
package/dist/InfoTable.js
CHANGED
|
@@ -17,8 +17,8 @@ const InfoTableRowView = ({ icon, label, value, accent, last, labelWidth, labelC
|
|
|
17
17
|
color: accent ?? valueColor,
|
|
18
18
|
marginLeft: "auto",
|
|
19
19
|
textAlign: "right",
|
|
20
|
+
// No wordBreak: break-all — it split ordinary words mid-word.
|
|
20
21
|
overflowWrap: "anywhere",
|
|
21
|
-
wordBreak: "break-all",
|
|
22
22
|
}, children: value })] }));
|
|
23
23
|
// A bordered, rounded key/value table — icon, short label, value
|
|
24
24
|
// right-aligned. Purely presentational: what each row means (an app's
|
package/dist/InlineConfirm.js
CHANGED
|
@@ -33,6 +33,11 @@ export const InlineConfirm = ({ description, onCancel, onConfirm, cancelLabel =
|
|
|
33
33
|
background-color: #fff !important;
|
|
34
34
|
color: #1a1a1a !important;
|
|
35
35
|
}
|
|
36
|
+
.${cancelCls}:focus,
|
|
37
|
+
.${cancelCls}:hover {
|
|
38
|
+
background-color: #b8bcbf !important;
|
|
39
|
+
color: #1a1a1a !important;
|
|
40
|
+
}
|
|
36
41
|
` }), _jsx("span", { style: { fontSize: 11, color: "#aaa" }, children: description }), _jsxs(Focusable, { style: { display: "flex", gap: 8, width: "100%" }, "flow-children": "horizontal", children: [_jsx("div", { style: { flex: 1 }, children: _jsx(DialogButton, { className: cancelCls, onClick: onCancel, style: {
|
|
37
42
|
...buttonStyle,
|
|
38
43
|
width: "100%",
|
package/dist/MediaRow.d.ts
CHANGED
|
@@ -24,5 +24,8 @@ export interface MediaRowProps {
|
|
|
24
24
|
bottomSeparator?: boolean;
|
|
25
25
|
onSecondaryButton?: (evt: GamepadEvent) => void;
|
|
26
26
|
onSecondaryActionDescription?: React.ReactNode;
|
|
27
|
+
onOptionsButton?: (evt: GamepadEvent) => void;
|
|
28
|
+
onOptionsActionDescription?: React.ReactNode;
|
|
29
|
+
onOKActionDescription?: React.ReactNode;
|
|
27
30
|
}
|
|
28
31
|
export declare const MediaRow: React.FC<MediaRowProps>;
|
package/dist/MediaRow.js
CHANGED
|
@@ -40,7 +40,7 @@ export const MediaRow = ({ media, mediaWidth = 32, mediaLayout = "fixed", mediaH
|
|
|
40
40
|
// changed every existing mediaLayout="stretch" caller's look (e.g.
|
|
41
41
|
// decky-proton-launch's own GameRow cover art) the moment they upgraded
|
|
42
42
|
// — this keeps that exact prior look until a caller opts in.
|
|
43
|
-
mediaAlign = mediaLayout === "stretch" ? "top" : "center", title, titleLines = 1, details, onPress, actions, collapsedByDefault = false, color, accentBorderColor, accentBorderWidth = 2, accentBackground, highlightOnFocus = true, borderOnFocus = true, highlightColor = DEFAULT_HIGHLIGHT_COLOR, highlightBackground = DEFAULT_HIGHLIGHT_BACKGROUND, spacing = 0, bottomSeparator = false, onSecondaryButton, onSecondaryActionDescription, }) => {
|
|
43
|
+
mediaAlign = mediaLayout === "stretch" ? "top" : "center", title, titleLines = 1, details, onPress, actions, collapsedByDefault = false, color, accentBorderColor, accentBorderWidth = 2, accentBackground, highlightOnFocus = true, borderOnFocus = true, highlightColor = DEFAULT_HIGHLIGHT_COLOR, highlightBackground = DEFAULT_HIGHLIGHT_BACKGROUND, spacing = 0, bottomSeparator = false, onSecondaryButton, onSecondaryActionDescription, onOptionsButton, onOptionsActionDescription, onOKActionDescription, }) => {
|
|
44
44
|
const { cls, styleTag } = useFocusHighlightClass("dck-media-row", {
|
|
45
45
|
highlightOnFocus,
|
|
46
46
|
borderOnFocus,
|
|
@@ -146,7 +146,7 @@ mediaAlign = mediaLayout === "stretch" ? "top" : "center", title, titleLines = 1
|
|
|
146
146
|
// open" capsule (e.g. a game cover) had before this became a shared
|
|
147
147
|
// component. Only an actions row (below) needs something to wrap.
|
|
148
148
|
if (!hasActions) {
|
|
149
|
-
return (_jsxs(_Fragment, { children: [highlightStyle, _jsxs(DialogButton, { className: cls, onClick: handleClick, onSecondaryButton: onSecondaryButton, onSecondaryActionDescription: onSecondaryActionDescription, style: {
|
|
149
|
+
return (_jsxs(_Fragment, { children: [highlightStyle, _jsxs(DialogButton, { className: cls, onClick: handleClick, onSecondaryButton: onSecondaryButton, onSecondaryActionDescription: onSecondaryActionDescription, onOptionsButton: onOptionsButton, onOptionsActionDescription: onOptionsActionDescription, onOKActionDescription: onOKActionDescription, style: {
|
|
150
150
|
...cardStyle,
|
|
151
151
|
width: "100%",
|
|
152
152
|
boxSizing: "border-box",
|
|
@@ -156,7 +156,7 @@ mediaAlign = mediaLayout === "stretch" ? "top" : "center", title, titleLines = 1
|
|
|
156
156
|
padding: stretch ? 0 : "4px 8px",
|
|
157
157
|
}, children: [mediaBox, textBox] }), bottomSeparator && _jsx(Separator, { marginTop: 1 })] }));
|
|
158
158
|
}
|
|
159
|
-
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: cls, style: { width: "100%", boxSizing: "border-box", ...cardStyle }, children: [highlightStyle, _jsxs(DialogButton, { onClick: handleClick, onSecondaryButton: onSecondaryButton, onSecondaryActionDescription: onSecondaryActionDescription, style: {
|
|
159
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: cls, style: { width: "100%", boxSizing: "border-box", ...cardStyle }, children: [highlightStyle, _jsxs(DialogButton, { onClick: handleClick, onSecondaryButton: onSecondaryButton, onSecondaryActionDescription: onSecondaryActionDescription, onOptionsButton: onOptionsButton, onOptionsActionDescription: onOptionsActionDescription, onOKActionDescription: onOKActionDescription, style: {
|
|
160
160
|
width: "100%",
|
|
161
161
|
boxSizing: "border-box",
|
|
162
162
|
display: "flex",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moi952/decky-ui-kit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"description": "Reusable UI components for Decky Loader plugins that need popups/dropdowns without triggering the native panel-remount bug",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|