@mrktg-common/internal-ui 1.11.0 → 1.13.0
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/Combobox.js +31 -13
- package/dist/SelectMenu.js +45 -15
- package/dist/activeOption.d.ts +13 -0
- package/dist/activeOption.js +20 -0
- package/dist/components.css +9 -0
- package/package.json +1 -1
- package/tokens/tokens.json +2 -2
package/dist/Combobox.js
CHANGED
|
@@ -7,6 +7,7 @@ import { FixedPortal } from './portal.js';
|
|
|
7
7
|
import { Spinner } from './Spinner.js';
|
|
8
8
|
import { cx } from './cx.js';
|
|
9
9
|
import { devError } from './devWarn.js';
|
|
10
|
+
import { isKeysActive, openingActive, stepActive } from './activeOption.js';
|
|
10
11
|
const GAP = 4;
|
|
11
12
|
const EDGE = 12;
|
|
12
13
|
const defaultEmptyText = (query) => `No options match “${query}”`;
|
|
@@ -18,7 +19,10 @@ export function Combobox({ id, value, onChange, options, groups, loading = false
|
|
|
18
19
|
const [open, setOpen] = useState(false);
|
|
19
20
|
// Кнопка открывает весь список, ввод — отфильтрованный
|
|
20
21
|
const [filtering, setFiltering] = useState(false);
|
|
21
|
-
|
|
22
|
+
// Куда поставила клавиатура и что под мышью; Enter берёт пункт под мышью, иначе пункт клавиатуры
|
|
23
|
+
const [keysIndex, setKeysIndex] = useState(null);
|
|
24
|
+
const [pointerIndex, setPointerIndex] = useState(null);
|
|
25
|
+
const active = pointerIndex ?? keysIndex;
|
|
22
26
|
const [listStyle, setListStyle] = useState({ visibility: 'hidden' });
|
|
23
27
|
const rootRef = useRef(null);
|
|
24
28
|
const inputRef = useRef(null);
|
|
@@ -81,16 +85,21 @@ export function Combobox({ id, value, onChange, options, groups, loading = false
|
|
|
81
85
|
if (!visible)
|
|
82
86
|
return;
|
|
83
87
|
// В jsdom прокрутки нет: тесты потребителей не должны падать на ней
|
|
84
|
-
|
|
88
|
+
if (active !== null)
|
|
89
|
+
document.getElementById(optionId(active))?.scrollIntoView?.({ block: 'nearest' });
|
|
85
90
|
});
|
|
86
|
-
const show = ({ filter }) => {
|
|
91
|
+
const show = ({ filter, byKeys }) => {
|
|
87
92
|
if (failed)
|
|
88
93
|
return;
|
|
89
94
|
if (!open)
|
|
90
95
|
setListStyle({ visibility: 'hidden' });
|
|
91
96
|
setFiltering(filter);
|
|
92
97
|
const current = all.findIndex((option) => option.value === value);
|
|
93
|
-
|
|
98
|
+
if (filter)
|
|
99
|
+
setKeysIndex(0);
|
|
100
|
+
else
|
|
101
|
+
setKeysIndex(byKeys ? openingActive(current) : null);
|
|
102
|
+
setPointerIndex(null);
|
|
94
103
|
setOpen(true);
|
|
95
104
|
};
|
|
96
105
|
const commit = (next) => {
|
|
@@ -108,16 +117,18 @@ export function Combobox({ id, value, onChange, options, groups, loading = false
|
|
|
108
117
|
if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {
|
|
109
118
|
event.preventDefault();
|
|
110
119
|
if (!visible) {
|
|
111
|
-
show({ filter: false });
|
|
120
|
+
show({ filter: false, byKeys: true });
|
|
112
121
|
return;
|
|
113
122
|
}
|
|
114
123
|
if (shown.length === 0)
|
|
115
124
|
return;
|
|
116
|
-
const
|
|
117
|
-
|
|
125
|
+
const checked = shown.findIndex((option) => option.value === value);
|
|
126
|
+
setKeysIndex(stepActive({ active, checked, step: event.key === 'ArrowDown' ? 1 : -1, count: shown.length }));
|
|
127
|
+
setPointerIndex(null);
|
|
118
128
|
}
|
|
119
129
|
else if (event.key === 'Enter') {
|
|
120
|
-
|
|
130
|
+
// Без активного пункта (открыт шевроном, мышь ушла) Enter оставляет текст как есть
|
|
131
|
+
const option = visible && !loading && active !== null ? shown[active] : undefined;
|
|
121
132
|
if (visible)
|
|
122
133
|
event.preventDefault();
|
|
123
134
|
if (option === undefined) {
|
|
@@ -137,11 +148,11 @@ export function Combobox({ id, value, onChange, options, groups, loading = false
|
|
|
137
148
|
setOpen(false);
|
|
138
149
|
}
|
|
139
150
|
};
|
|
140
|
-
const activeOption = visible && !loading && shown[active] !== undefined ? optionId(active) : undefined;
|
|
151
|
+
const activeOption = visible && !loading && active !== null && shown[active] !== undefined ? optionId(active) : undefined;
|
|
141
152
|
return (_jsxs("div", { className: cx('combo', className), ref: rootRef, children: [_jsx("input", { ref: inputRef, id: id, type: "text", className: controlClass({ size, invalid, mono }), role: "combobox", "aria-autocomplete": "list", "aria-expanded": visible, "aria-controls": visible ? listId : undefined, "aria-activedescendant": activeOption, "aria-invalid": invalid || undefined, autoComplete: "off", value: value, placeholder: placeholder, disabled: disabled, onChange: (event) => {
|
|
142
153
|
committed.current = null;
|
|
143
154
|
onChange(event.target.value);
|
|
144
|
-
show({ filter: true });
|
|
155
|
+
show({ filter: true, byKeys: true });
|
|
145
156
|
}, onKeyDown: handleKeyDown, onBlur: () => {
|
|
146
157
|
setOpen(false);
|
|
147
158
|
commit(value);
|
|
@@ -152,12 +163,19 @@ export function Combobox({ id, value, onChange, options, groups, loading = false
|
|
|
152
163
|
if (visible)
|
|
153
164
|
setOpen(false);
|
|
154
165
|
else
|
|
155
|
-
show({ filter: false });
|
|
156
|
-
}, children: _jsx(ChevronDown, { className: "ic", "aria-hidden": true }) })), visible && (_jsx(FixedPortal, { children: _jsx("div", { ref: listRef, className: "pop pop-scroll", style: listStyle, role: "listbox", id: listId, "aria-labelledby": id,
|
|
166
|
+
show({ filter: false, byKeys: false });
|
|
167
|
+
}, children: _jsx(ChevronDown, { className: "ic", "aria-hidden": true }) })), visible && (_jsx(FixedPortal, { children: _jsx("div", { ref: listRef, className: "pop pop-scroll", style: listStyle, role: "listbox", id: listId, "aria-labelledby": id,
|
|
168
|
+
// Уход мыши снимает её пункт: полоса возвращается на пункт клавиатуры, если он есть
|
|
169
|
+
onMouseLeave: () => setPointerIndex(null), children: loading ? (_jsx("div", { className: "menu-empty", role: "status", children: _jsxs("span", { className: "row", style: { justifyContent: 'center' }, children: [_jsx(Spinner, { size: "sm" }), "Loading\u2026"] }) })) : shown.length === 0 ? (_jsxs("div", { className: "menu-empty", children: [_jsx("span", { className: "strong", children: emptyText(query) }), _jsx("span", { className: "hint", children: "You can keep it as typed." })] })) : (shownGroups.map((group, groupIndex) => {
|
|
157
170
|
const rows = group.options.map((option) => {
|
|
158
171
|
const index = shown.indexOf(option);
|
|
159
172
|
const isCurrent = option.value === value;
|
|
160
|
-
return (_jsxs("div", { id: optionId(index), role: "option", "aria-selected": isCurrent, className: cx('menu-item', index
|
|
173
|
+
return (_jsxs("div", { id: optionId(index), role: "option", "aria-selected": isCurrent, className: cx('menu-item', mono && 'mono', isKeysActive(index, keysIndex, pointerIndex) && 'is-active'), onMouseDown: (event) => event.preventDefault(),
|
|
174
|
+
// Только настоящее движение мыши: список, открытый или прокрученный под курсором, пункт не меняет
|
|
175
|
+
onMouseMove: () => {
|
|
176
|
+
if (pointerIndex !== index)
|
|
177
|
+
setPointerIndex(index);
|
|
178
|
+
}, onClick: () => pick(option), children: [_jsx("span", { className: "trunc", children: filtering ? _jsx(Highlight, { text: option.value, query: query }) : option.value }), option.trailing !== undefined && _jsx("span", { className: "trail", children: option.trailing }), isCurrent && _jsx(Check, { className: "ic check", "aria-hidden": true })] }, option.value));
|
|
161
179
|
});
|
|
162
180
|
if (group.label === null)
|
|
163
181
|
return _jsx(Fragment, { children: rows }, `group-${groupIndex}`);
|
package/dist/SelectMenu.js
CHANGED
|
@@ -6,6 +6,7 @@ import { cx } from './cx.js';
|
|
|
6
6
|
import { buttonClass } from './buttonClass.js';
|
|
7
7
|
import { controlClass } from './Field.js';
|
|
8
8
|
import { FixedPortal } from './portal.js';
|
|
9
|
+
import { isKeysActive, openingActive, stepActive } from './activeOption.js';
|
|
9
10
|
const GAP = 4;
|
|
10
11
|
const EDGE = 12;
|
|
11
12
|
/**
|
|
@@ -23,7 +24,10 @@ export function SelectMenu({ id, value, groups, onChange, placeholder, autoFocus
|
|
|
23
24
|
.filter((group) => group.items.length > 0),
|
|
24
25
|
];
|
|
25
26
|
const items = shownGroups.flatMap((group) => group.items);
|
|
26
|
-
|
|
27
|
+
// Куда поставила клавиатура и что под мышью; Enter берёт пункт под мышью, иначе пункт клавиатуры
|
|
28
|
+
const [keysIndex, setKeysIndex] = useState(null);
|
|
29
|
+
const [pointerIndex, setPointerIndex] = useState(null);
|
|
30
|
+
const active = pointerIndex ?? keysIndex;
|
|
27
31
|
const rootRef = useRef(null);
|
|
28
32
|
const buttonRef = useRef(null);
|
|
29
33
|
const menuRef = useRef(null);
|
|
@@ -82,12 +86,15 @@ export function SelectMenu({ id, value, groups, onChange, placeholder, autoFocus
|
|
|
82
86
|
if (!open)
|
|
83
87
|
return;
|
|
84
88
|
// В jsdom прокрутки нет: тесты потребителей не должны падать на ней
|
|
85
|
-
|
|
89
|
+
if (active !== null)
|
|
90
|
+
menuRef.current?.querySelector(`[data-index="${active}"]`)?.scrollIntoView?.({ block: 'nearest' });
|
|
86
91
|
}, [open, active]);
|
|
87
|
-
const openMenu = () => {
|
|
92
|
+
const openMenu = ({ byKeys }) => {
|
|
88
93
|
setMenuStyle({ visibility: 'hidden' });
|
|
89
94
|
setQuery('');
|
|
90
|
-
|
|
95
|
+
const checked = items.findIndex((item) => item.value === value);
|
|
96
|
+
setKeysIndex(byKeys ? openingActive(checked) : null);
|
|
97
|
+
setPointerIndex(null);
|
|
91
98
|
setOpen(true);
|
|
92
99
|
};
|
|
93
100
|
const close = () => {
|
|
@@ -104,7 +111,7 @@ export function SelectMenu({ id, value, groups, onChange, placeholder, autoFocus
|
|
|
104
111
|
if (!open) {
|
|
105
112
|
if (event.target === buttonRef.current && (event.key === 'ArrowDown' || event.key === 'ArrowUp')) {
|
|
106
113
|
event.preventDefault();
|
|
107
|
-
openMenu();
|
|
114
|
+
openMenu({ byKeys: true });
|
|
108
115
|
}
|
|
109
116
|
return;
|
|
110
117
|
}
|
|
@@ -115,13 +122,17 @@ export function SelectMenu({ id, value, groups, onChange, placeholder, autoFocus
|
|
|
115
122
|
}
|
|
116
123
|
else if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {
|
|
117
124
|
event.preventDefault();
|
|
118
|
-
const
|
|
119
|
-
|
|
125
|
+
const checked = items.findIndex((item) => item.value === value);
|
|
126
|
+
setKeysIndex(stepActive({ active, checked, step: event.key === 'ArrowDown' ? 1 : -1, count: items.length }));
|
|
127
|
+
setPointerIndex(null);
|
|
120
128
|
}
|
|
121
129
|
else if (event.key === 'Enter') {
|
|
122
130
|
event.preventDefault();
|
|
123
|
-
|
|
124
|
-
|
|
131
|
+
// Без активного пункта (открыт кликом, мышь ушла) Enter закрывает без изменений
|
|
132
|
+
const item = active === null ? undefined : items[active];
|
|
133
|
+
if (item === undefined)
|
|
134
|
+
close();
|
|
135
|
+
else
|
|
125
136
|
choose(item);
|
|
126
137
|
}
|
|
127
138
|
else if (event.key === 'Tab') {
|
|
@@ -129,22 +140,41 @@ export function SelectMenu({ id, value, groups, onChange, placeholder, autoFocus
|
|
|
129
140
|
}
|
|
130
141
|
else if (search === undefined && event.key.length === 1 && !event.metaKey && !event.ctrlKey && !event.altKey) {
|
|
131
142
|
const letter = event.key.toLowerCase();
|
|
132
|
-
const
|
|
143
|
+
const from = active ?? items.findIndex((item) => item.value === value);
|
|
144
|
+
const order = [...items.slice(from + 1), ...items.slice(0, from + 1)];
|
|
133
145
|
const match = order.find((item) => item.label.toLowerCase().startsWith(letter));
|
|
134
|
-
if (match !== undefined)
|
|
135
|
-
|
|
146
|
+
if (match !== undefined) {
|
|
147
|
+
setKeysIndex(items.indexOf(match));
|
|
148
|
+
setPointerIndex(null);
|
|
149
|
+
}
|
|
136
150
|
}
|
|
137
151
|
};
|
|
152
|
+
const optionId = (index) => `${listId}-option-${index}`;
|
|
153
|
+
// Только когда активный пункт есть: у списка, открытого кликом, его нет
|
|
154
|
+
const activeOption = open && active !== null && items[active] !== undefined ? optionId(active) : undefined;
|
|
155
|
+
// Без поиска триггер — select-only combobox: на кнопке aria-activedescendant дикторы не озвучивают.
|
|
156
|
+
// С поиском combobox — поле поиска, триггер остаётся кнопкой
|
|
157
|
+
const triggerCombobox = search === undefined;
|
|
138
158
|
const triggerClass = filter === undefined
|
|
139
159
|
? controlClass({ size, invalid }, 'select-btn')
|
|
140
160
|
: buttonClass({ variant: 'secondary', size, active: filter.active });
|
|
141
|
-
return (_jsxs("div", { className: cx('anchor', className), style: filter === undefined ? { display: 'flex' } : undefined, ref: rootRef, onKeyDown: handleKeyDown, children: [_jsxs("button", { ref: buttonRef, id: id, type: "button", className: triggerClass, "aria-haspopup": "listbox", "aria-expanded": open, "aria-controls": open ? listId : undefined, "aria-invalid": invalid || undefined, disabled: disabled, onClick: () => (open ? setOpen(false) : openMenu()), ...aria, children: [filter !== undefined ? filter.label : selected === undefined ? _jsx("span", { className: "muted trunc", children: placeholder ?? value }) : _jsx(ItemContent, { item: selected }), _jsx(ChevronDown, { className: cx('ic', 'chev', filter !== undefined && 'ic-sm'), "aria-hidden": true })] }), open && (_jsx(FixedPortal, { children: _jsxs("div", { ref: menuRef, className: "pop pop-scroll", style: menuStyle, role: "listbox", id: listId, "aria-labelledby": id,
|
|
161
|
+
return (_jsxs("div", { className: cx('anchor', className), style: filter === undefined ? { display: 'flex' } : undefined, ref: rootRef, onKeyDown: handleKeyDown, children: [_jsxs("button", { ref: buttonRef, id: id, type: "button", className: triggerClass, role: triggerCombobox ? 'combobox' : undefined, "aria-haspopup": "listbox", "aria-expanded": open, "aria-controls": triggerCombobox && open ? listId : undefined, "aria-activedescendant": triggerCombobox ? activeOption : undefined, "aria-invalid": invalid || undefined, disabled: disabled, onClick: () => (open ? setOpen(false) : openMenu({ byKeys: false })), ...aria, children: [filter !== undefined ? filter.label : selected === undefined ? _jsx("span", { className: "muted trunc", children: placeholder ?? value }) : _jsx(ItemContent, { item: selected }), _jsx(ChevronDown, { className: cx('ic', 'chev', filter !== undefined && 'ic-sm'), "aria-hidden": true })] }), open && (_jsx(FixedPortal, { children: _jsxs("div", { ref: menuRef, className: "pop pop-scroll", style: menuStyle, role: "listbox", id: listId, "aria-labelledby": id,
|
|
162
|
+
// Уход мыши снимает её пункт: полоса возвращается на пункт клавиатуры, если он есть
|
|
163
|
+
onMouseLeave: () => setPointerIndex(null), children: [search !== undefined && (_jsx("div", { className: "menu-search", children: _jsxs("label", { className: "with-icon", children: [_jsx(SearchIcon, { className: "ic", "aria-hidden": true }), _jsx("span", { className: "sr-only", children: search.label }), _jsx("input", { ref: searchRef, className: "control control-sm", value: query, placeholder: search.placeholder, role: "combobox", "aria-autocomplete": "list", "aria-expanded": "true", "aria-controls": listId, "aria-activedescendant": activeOption, onChange: (event) => {
|
|
142
164
|
setQuery(event.target.value);
|
|
143
|
-
|
|
165
|
+
setKeysIndex(0);
|
|
166
|
+
setPointerIndex(null);
|
|
144
167
|
} })] }) })), items.length === 0 && (_jsxs("div", { className: "menu-empty", children: [_jsxs("span", { className: "strong", children: ["Nothing matches \u201C", query.trim(), "\u201D"] }), _jsx("span", { className: "hint", children: "Try a shorter name." })] })), shownGroups.map((group, groupIndex) => (_jsxs("div", { role: "group", "aria-label": group.label ?? undefined, children: [group.label !== null && _jsx("div", { className: "menu-label", children: group.label }), group.note !== undefined && (_jsxs("div", { className: "menu-note", children: [_jsx(TriangleAlert, { className: "ic ic-sm", "aria-hidden": true }), _jsx("span", { children: group.note })] })), group.items.map((item) => {
|
|
145
168
|
const index = items.indexOf(item);
|
|
146
169
|
const isSelected = item.value === value;
|
|
147
|
-
return (_jsxs("button", { type: "button", role: "option", "data-index": index, tabIndex: -1, "aria-selected": isSelected, "aria-disabled": item.disabled || undefined, className: cx('menu-item',
|
|
170
|
+
return (_jsxs("button", { type: "button", role: "option", id: optionId(index), "data-index": index, tabIndex: -1, "aria-selected": isSelected, "aria-disabled": item.disabled || undefined, className: cx('menu-item', isKeysActive(index, keysIndex, pointerIndex) && 'is-active'),
|
|
171
|
+
// Только настоящее движение мыши: список, открытый или прокрученный под курсором, пункт не меняет.
|
|
172
|
+
// Выключенный пункт под мышью не меняется
|
|
173
|
+
onMouseMove: () => {
|
|
174
|
+
if (item.disabled || pointerIndex === index)
|
|
175
|
+
return;
|
|
176
|
+
setPointerIndex(index);
|
|
177
|
+
}, onClick: () => choose(item), children: [_jsx(ItemContent, { item: item }), item.trailing !== undefined && _jsx("span", { className: "trail", children: item.trailing }), isSelected && _jsx(Check, { className: "ic check", "aria-hidden": true })] }, item.value));
|
|
148
178
|
})] }, group.label ?? `group-${groupIndex}`)))] }) }))] }));
|
|
149
179
|
}
|
|
150
180
|
function ItemContent({ item }) {
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
interface IStepActiveArgs {
|
|
2
|
+
active: number | null;
|
|
3
|
+
checked: number;
|
|
4
|
+
step: 1 | -1;
|
|
5
|
+
count: number;
|
|
6
|
+
}
|
|
7
|
+
/** Пункт после ↓ / ↑: от активного, а если его нет — от отмеченного галочкой; без обоих ↓ берёт первый, ↑ последний */
|
|
8
|
+
export declare function stepActive({ active, checked, step, count }: IStepActiveArgs): number;
|
|
9
|
+
/** Пункт при открытии стрелкой: текущее значение, иначе первый */
|
|
10
|
+
export declare function openingActive(checked: number): number;
|
|
11
|
+
/** Пункт, у которого полоса: тот, что выбрала клавиатура, пока под мышью ничего нет */
|
|
12
|
+
export declare function isKeysActive(index: number, keysIndex: number | null, pointerIndex: number | null): boolean;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// Активный пункт Select menu и Combobox: тот, что возьмёт Enter (карточки, раздел «Active option»).
|
|
2
|
+
// Два источника: куда поставила клавиатура (keys) и что под мышью (pointer). Активный — pointer ?? keys,
|
|
3
|
+
// полоса is-active — только у пункта клавиатуры, пока мышь ничего не отметила.
|
|
4
|
+
/** Пункт после ↓ / ↑: от активного, а если его нет — от отмеченного галочкой; без обоих ↓ берёт первый, ↑ последний */
|
|
5
|
+
export function stepActive({ active, checked, step, count }) {
|
|
6
|
+
if (count === 0)
|
|
7
|
+
return 0;
|
|
8
|
+
const from = active ?? checked;
|
|
9
|
+
if (from < 0 || from >= count)
|
|
10
|
+
return step === 1 ? 0 : count - 1;
|
|
11
|
+
return (from + step + count) % count;
|
|
12
|
+
}
|
|
13
|
+
/** Пункт при открытии стрелкой: текущее значение, иначе первый */
|
|
14
|
+
export function openingActive(checked) {
|
|
15
|
+
return Math.max(0, checked);
|
|
16
|
+
}
|
|
17
|
+
/** Пункт, у которого полоса: тот, что выбрала клавиатура, пока под мышью ничего нет */
|
|
18
|
+
export function isKeysActive(index, keysIndex, pointerIndex) {
|
|
19
|
+
return pointerIndex === null && keysIndex === index;
|
|
20
|
+
}
|
package/dist/components.css
CHANGED
|
@@ -223,8 +223,14 @@
|
|
|
223
223
|
.menu-item > .ic { color: var(--text-muted); }
|
|
224
224
|
.menu-item:hover, .menu-item.is-hover, .menu-item:focus-visible, .menu-item.is-focus { outline: none; background: var(--bg-subtle); }
|
|
225
225
|
.menu-item:focus-visible, .menu-item.is-focus { box-shadow: inset 0 0 0 2px var(--accent); }
|
|
226
|
+
/* Active option of Select menu and Combobox (aria-activedescendant): focus stays in the field or the trigger,
|
|
227
|
+
so the keyboard position is a bar on the left edge, not a second focus ring. */
|
|
228
|
+
.menu-item.is-active { background: var(--bg-subtle); box-shadow: inset 3px 0 0 var(--accent); }
|
|
226
229
|
.menu-item.is-danger, .menu-item.is-danger > .ic { color: var(--danger-text); }
|
|
227
230
|
.menu-item:disabled, .menu-item[aria-disabled='true'] { color: var(--text-muted); opacity: 0.55; cursor: not-allowed; background: none; }
|
|
231
|
+
/* The keyboard mark on an off item keeps its 3:1: while the keyboard is on it, the content is dimmed, the ring or the bar is not. */
|
|
232
|
+
.menu-item[aria-disabled='true']:focus-visible, .menu-item.is-focus[aria-disabled='true'], .menu-item.is-active[aria-disabled='true'] { opacity: 1; }
|
|
233
|
+
.menu-item[aria-disabled='true']:focus-visible > *, .menu-item.is-focus[aria-disabled='true'] > *, .menu-item.is-active[aria-disabled='true'] > * { opacity: 0.55; }
|
|
228
234
|
/* Selected option: check on the right, as on the agreed Publish window. */
|
|
229
235
|
.menu-item > .check { margin-left: auto; color: var(--accent-text); }
|
|
230
236
|
.menu-item[aria-selected='true'] { font-weight: 500; }
|
|
@@ -245,6 +251,9 @@
|
|
|
245
251
|
.combo > .control-sm + .combo-btn { right: 1px; width: 24px; height: 24px; }
|
|
246
252
|
.combo > .pop { left: 0; right: 0; min-width: 0; }
|
|
247
253
|
.menu-item mark { background: none; color: inherit; font-weight: 600; }
|
|
254
|
+
/* Codes and keys: the options of a mono field are mono too (.mono alone loses to the item's own font). */
|
|
255
|
+
.menu-item.mono { font-family: var(--font-mono); }
|
|
256
|
+
.menu-item.mono .trail { font-family: var(--font-ui); }
|
|
248
257
|
.menu-foot { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-1) var(--space-1); border-top: 1px solid var(--border); margin-top: var(--space-1); }
|
|
249
258
|
|
|
250
259
|
/* ---------- Badge ---------- */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mrktg-common/internal-ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.13.0",
|
|
4
4
|
"description": "Общий интерфейс внутренних инструментов маркетинга (Landings Admin, LP Constructor): токены, классы компонентов и тонкие React-обёртки над ними.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
package/tokens/tokens.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "Internal ui",
|
|
3
3
|
"version": 1,
|
|
4
4
|
"meta": {
|
|
5
|
-
"release": "1.
|
|
5
|
+
"release": "1.13.0",
|
|
6
6
|
"source": "lp-constructor src/styles/tokens.css + Landings Admin admin.css, merged 2026-10-12"
|
|
7
7
|
},
|
|
8
8
|
"color": {
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
"light": "#2f6fed",
|
|
104
104
|
"dark": "#5b8dff"
|
|
105
105
|
},
|
|
106
|
-
"usage": "Primary button, solid badge, count pill, focus border, active tab line, selection outline, progress. A UI mark: 4.6:1 on surface light, 5.0:1 dark."
|
|
106
|
+
"usage": "Primary button, solid badge, count pill, focus border, active tab line, active option bar in Select menu and Combobox, selection outline, progress. A UI mark: 4.6:1 on surface light, 5.0:1 dark."
|
|
107
107
|
},
|
|
108
108
|
{
|
|
109
109
|
"name": "accent-hover",
|