@botiverse/raft-ui 0.47.0 → 0.47.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/CHANGELOG.md +8 -0
- package/dist/index.d.mts +3 -2
- package/dist/index.mjs +23 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
## [0.47.1](https://github.com/botiverse/raft-design/compare/v0.47.0...v0.47.1) (2026-10-28)
|
|
2
|
+
|
|
3
|
+
### Fixed
|
|
4
|
+
|
|
5
|
+
- **SelectActionItem:** when its action adds items above the row and the list stays open, the row keeps the highlight, so the next arrow key goes on from the row instead of from whatever item now sits at its old position. ([#873](https://github.com/botiverse/raft-design/pull/873))
|
|
6
|
+
- **SelectActionItem:** the docs no longer ask for `aria-expanded`, which ARIA does not allow on an option; remove it where you added it. ([#873](https://github.com/botiverse/raft-design/pull/873))
|
|
7
|
+
- Docs: https://raft-design.botiverse.build/components/select/
|
|
8
|
+
|
|
1
9
|
## [0.47.0](https://github.com/botiverse/raft-design/compare/v0.46.0...v0.47.0) (2026-10-28)
|
|
2
10
|
|
|
3
11
|
### Changed
|
package/dist/index.d.mts
CHANGED
|
@@ -1157,8 +1157,9 @@ type SelectActionItemProps = StyledProps<Omit<Select$1.Item.Props, "value" | "la
|
|
|
1157
1157
|
/**
|
|
1158
1158
|
* An action row inside the list, placed last after a `SelectSeparator`, such as
|
|
1159
1159
|
* Show All. It is reached by the arrow keys and typeahead like an item, but
|
|
1160
|
-
* pressing it runs `onAction` instead of choosing a value.
|
|
1161
|
-
*
|
|
1160
|
+
* pressing it runs `onAction` instead of choosing a value. It is an option to
|
|
1161
|
+
* assistive technology, so it takes no `aria-expanded`: its label says what it
|
|
1162
|
+
* does.
|
|
1162
1163
|
*/
|
|
1163
1164
|
export declare function SelectActionItem({ className, onAction, closeOnAction, ...props }: SelectActionItemProps): import("react").JSX.Element;
|
|
1164
1165
|
type SelectLabelProps = StyledProps<Select$1.Label.Props>;
|
package/dist/index.mjs
CHANGED
|
@@ -4211,7 +4211,7 @@ const select = tv({
|
|
|
4211
4211
|
itemText: ["min-w-0 flex-1 line-clamp-2 wrap-anywhere"],
|
|
4212
4212
|
itemDescription: [
|
|
4213
4213
|
"order-last min-w-0 basis-full wrap-anywhere",
|
|
4214
|
-
"[[data-slot=select-item-leading]~&]:ps-[calc(--spacing(4)
|
|
4214
|
+
"[[data-slot=select-item-leading]~&]:ps-[calc(--spacing(4)+(--spacing(2.5)))]",
|
|
4215
4215
|
"font-sans text-caption font-normal text-foreground-hint"
|
|
4216
4216
|
],
|
|
4217
4217
|
label: ["m-0", "font-sans text-footnote font-semibold text-foreground-muted"],
|
|
@@ -4277,6 +4277,24 @@ function findActionValue(value) {
|
|
|
4277
4277
|
if (value instanceof SelectActionValue) return value;
|
|
4278
4278
|
if (Array.isArray(value)) return value.find((entry) => entry instanceof SelectActionValue);
|
|
4279
4279
|
}
|
|
4280
|
+
/**
|
|
4281
|
+
* Base UI keeps the highlight by position. When an action adds items above its
|
|
4282
|
+
* row, the same position then holds another item while focus stays on the row,
|
|
4283
|
+
* and the next arrow key starts from the wrong place. Once the list has
|
|
4284
|
+
* re-rendered, focus the list and then the row again: the row's focus handler
|
|
4285
|
+
* re-reads its position and moves the highlight back to it.
|
|
4286
|
+
*/
|
|
4287
|
+
function keepActionHighlighted(event) {
|
|
4288
|
+
const target = event.target;
|
|
4289
|
+
if (!(target instanceof Element)) return;
|
|
4290
|
+
const row = target.closest("[data-slot=\"select-action-item\"]");
|
|
4291
|
+
if (!row) return;
|
|
4292
|
+
requestAnimationFrame(() => {
|
|
4293
|
+
if (!row.isConnected || row.hasAttribute("data-highlighted")) return;
|
|
4294
|
+
row.closest("[role=\"listbox\"]")?.focus({ preventScroll: true });
|
|
4295
|
+
row.focus({ preventScroll: true });
|
|
4296
|
+
});
|
|
4297
|
+
}
|
|
4280
4298
|
function Select({ chrome = "default", onValueChange, onOpenChange, isItemEqualToValue, itemToStringLabel, itemToStringValue, ...props }) {
|
|
4281
4299
|
const pendingActionClose = useRef(void 0);
|
|
4282
4300
|
const handleValueChange = useCallback((next, details) => {
|
|
@@ -4290,6 +4308,7 @@ function Select({ chrome = "default", onValueChange, onOpenChange, isItemEqualTo
|
|
|
4290
4308
|
if (details.reason !== "item-press") return;
|
|
4291
4309
|
pendingActionClose.current = action.closeOnActionRef.current;
|
|
4292
4310
|
action.onActionRef.current?.(details.event);
|
|
4311
|
+
if (!action.closeOnActionRef.current) keepActionHighlighted(details.event);
|
|
4293
4312
|
}, [onValueChange]);
|
|
4294
4313
|
const handleOpenChange = useCallback((open, details) => {
|
|
4295
4314
|
const closeOnAction = pendingActionClose.current;
|
|
@@ -4505,8 +4524,9 @@ function SelectItemDescription({ className, id, ...props }) {
|
|
|
4505
4524
|
/**
|
|
4506
4525
|
* An action row inside the list, placed last after a `SelectSeparator`, such as
|
|
4507
4526
|
* Show All. It is reached by the arrow keys and typeahead like an item, but
|
|
4508
|
-
* pressing it runs `onAction` instead of choosing a value.
|
|
4509
|
-
*
|
|
4527
|
+
* pressing it runs `onAction` instead of choosing a value. It is an option to
|
|
4528
|
+
* assistive technology, so it takes no `aria-expanded`: its label says what it
|
|
4529
|
+
* does.
|
|
4510
4530
|
*/
|
|
4511
4531
|
function SelectActionItem({ className, onAction, closeOnAction = false, ...props }) {
|
|
4512
4532
|
const chrome = useSelectChrome();
|