@dbcdk/react-components 0.0.75 → 0.0.76
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.
|
@@ -140,7 +140,16 @@ const MenuCheckItem = React.forwardRef(({ label, checked, active, disabled, inte
|
|
|
140
140
|
});
|
|
141
141
|
MenuCheckItem.displayName = 'Menu.CheckItem';
|
|
142
142
|
const MenuRadioItem = React.forwardRef(({ name, value, checked, disabled, label, onValueChange, className, ...liProps }, ref) => {
|
|
143
|
-
return (_jsx("li", { ref: ref, role: "none", className: [styles.row, className].filter(Boolean).join(' '), ...liProps, children: _jsx("div", { className: styles.interactiveChild,
|
|
143
|
+
return (_jsx("li", { ref: ref, role: "none", className: [styles.row, className].filter(Boolean).join(' '), ...liProps, children: _jsx("div", { className: styles.interactiveChild, onClick: event => {
|
|
144
|
+
var _a;
|
|
145
|
+
if (disabled)
|
|
146
|
+
return;
|
|
147
|
+
const target = event.target;
|
|
148
|
+
// Let native label/input clicks handle themselves to avoid double-firing
|
|
149
|
+
if ((_a = target.closest('label')) !== null && _a !== void 0 ? _a : target.closest('input'))
|
|
150
|
+
return;
|
|
151
|
+
onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange(value);
|
|
152
|
+
}, children: _jsx(RadioButton, { noContainer: true, name: name, value: value, checked: checked, disabled: disabled, label: label, onChange: (v, _e) => onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange(v) }) }) }));
|
|
144
153
|
});
|
|
145
154
|
MenuRadioItem.displayName = 'Menu.RadioItem';
|
|
146
155
|
const MenuSeparator = React.forwardRef(({ className, ...props }, ref) => (_jsx("li", { ref: ref, role: "separator", className: [styles.separator, className].filter(Boolean).join(' '), ...props })));
|
|
@@ -70,11 +70,6 @@
|
|
|
70
70
|
cursor: pointer;
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
/* NEW: let Checkbox/Radio consume full width so the hover area feels right */
|
|
74
|
-
.row > .interactiveChild > * {
|
|
75
|
-
inline-size: 100%;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
73
|
/* NEW: add consistent gap between control and label inside Checkbox/Radio
|
|
79
74
|
Both components use a root element with className={styles.container}.
|
|
80
75
|
Because they're CSS modules, we must target it with :global(.container). */
|
|
@@ -171,6 +166,9 @@
|
|
|
171
166
|
.interactiveChild svg {
|
|
172
167
|
inline-size: var(--icon-size-sm);
|
|
173
168
|
block-size: var(--icon-size-sm);
|
|
169
|
+
/* Vertically center the icon against the first text line when parent is flex-start */
|
|
170
|
+
margin-block: calc((var(--line-height-normal) * var(--font-size-sm) - var(--icon-size-sm)) / 2);
|
|
171
|
+
flex-shrink: 0;
|
|
174
172
|
}
|
|
175
173
|
|
|
176
174
|
/* Visual separator row (used by <Menu.Separator />) */
|
|
@@ -38,15 +38,15 @@
|
|
|
38
38
|
|
|
39
39
|
.content {
|
|
40
40
|
position: fixed;
|
|
41
|
-
border: 1px solid var(--color-border-
|
|
41
|
+
border: 1px solid var(--color-border-subtle);
|
|
42
42
|
background-color: var(--color-bg-surface);
|
|
43
|
-
border-radius: var(--border-radius-
|
|
43
|
+
border-radius: var(--border-radius-lg);
|
|
44
44
|
padding: 0;
|
|
45
45
|
z-index: var(--z-popover);
|
|
46
46
|
overflow: auto;
|
|
47
47
|
box-shadow:
|
|
48
|
-
0 0 0 1px
|
|
49
|
-
var(--shadow-
|
|
48
|
+
0 0 0 1px rgba(0, 0, 0, 0.01),
|
|
49
|
+
var(--shadow-sm);
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
.content[hidden] {
|