@botiverse/raft-ui 0.30.0 → 0.31.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/CHANGELOG.md +19 -0
- package/dist/wip.d.mts +33 -1
- package/dist/wip.mjs +125 -45
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,22 @@
|
|
|
1
|
+
## [0.31.0](https://github.com/botiverse/raft-design/compare/v0.30.0...v0.31.0) (2026-10-23)
|
|
2
|
+
|
|
3
|
+
### Design System
|
|
4
|
+
|
|
5
|
+
- **A row swipe on a phone**: a swipe starts once the finger has gone 10px on the web (twice as far across as up or down), and swipes that start within 24px of the screen edge stay with the browser. A release applies the action past 40% of the row's width, or past 20% with a quick flick. The uncovered layer is soft until a release would apply, then solid `success` with ink, and ticks once on Android as it turns solid. It says "Done"; the menu keeps "Mark as Done". The row leaves at once, with an 8-second Undo. On a phone, Activity's Mark as Done stays in the row as a button only screen readers see. ([#775](https://github.com/botiverse/raft-design/pull/775), [#776](https://github.com/botiverse/raft-design/pull/776))
|
|
6
|
+
- Why: Activity on a phone moved Mark as Done to the swipe (stdrc); the swipe must be predictable, reversible, and reachable without swiping.
|
|
7
|
+
- Affects: a rule for products.
|
|
8
|
+
- Docs: https://raft-design.botiverse.build/patterns/responsive/#touch-screens
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- **ChoiceList** (wip): ([#774](https://github.com/botiverse/raft-design/pull/774))
|
|
13
|
+
- `groups` with headings. Each group is named by its heading, and the arrow keys cross groups.
|
|
14
|
+
- `searchValue` / `onSearchValueChange`, so the app can read and set the search text. It hears `""` when the box hides.
|
|
15
|
+
- `footer`, which stays in view while the rows scroll.
|
|
16
|
+
- `fill`, which fills its container's height.
|
|
17
|
+
- The frame now wraps a `choice-list-scroller`.
|
|
18
|
+
- Docs: https://raft-design.botiverse.build/components/choice-list/
|
|
19
|
+
|
|
1
20
|
## [0.30.0](https://github.com/botiverse/raft-design/compare/v0.29.0...v0.30.0) (2026-10-23)
|
|
2
21
|
|
|
3
22
|
### Design System
|
package/dist/wip.d.mts
CHANGED
|
@@ -727,6 +727,13 @@ type ChoiceListItem = {
|
|
|
727
727
|
*/
|
|
728
728
|
action?: ReactNode;
|
|
729
729
|
disabled?: boolean;
|
|
730
|
+
/** The `value` of the group in `groups` this item is listed under. */
|
|
731
|
+
group?: string;
|
|
732
|
+
};
|
|
733
|
+
type ChoiceListGroup = {
|
|
734
|
+
value: string;
|
|
735
|
+
/** The small heading over the group's rows, such as "Agents". */
|
|
736
|
+
label: ReactNode;
|
|
730
737
|
};
|
|
731
738
|
type ChoiceListCommonProps = {
|
|
732
739
|
items: readonly ChoiceListItem[];
|
|
@@ -748,12 +755,37 @@ type ChoiceListCommonProps = {
|
|
|
748
755
|
searchPlaceholder?: string;
|
|
749
756
|
/** The search box's text when the list first draws, such as a search carried over. */
|
|
750
757
|
defaultSearchValue?: string;
|
|
758
|
+
/**
|
|
759
|
+
* The search box's text, for a caller that uses it: a "Create “…”" row
|
|
760
|
+
* named after it, or a no-match line that quotes it. With it, the caller
|
|
761
|
+
* owns the text, and `onSearchValueChange` reports each change.
|
|
762
|
+
*/
|
|
763
|
+
searchValue?: string;
|
|
764
|
+
onSearchValueChange?: (value: string) => void;
|
|
751
765
|
/** The clear button's accessible name. */
|
|
752
766
|
clearSearchLabel: string;
|
|
753
767
|
/** The line under the chosen rows when nothing else matches. */
|
|
754
768
|
noMatchLabel?: ReactNode;
|
|
755
769
|
/** The line drawn when there are no items at all. */
|
|
756
770
|
empty?: ReactNode;
|
|
771
|
+
/**
|
|
772
|
+
* Headings that split the rows by kind, in this order, such as Agents then
|
|
773
|
+
* People. Each item names its group; a group with no rows to show, or a
|
|
774
|
+
* search that leaves it empty, draws no heading.
|
|
775
|
+
*/
|
|
776
|
+
groups?: readonly ChoiceListGroup[];
|
|
777
|
+
/**
|
|
778
|
+
* A row of the caller's under the list, inside its frame, that stays in
|
|
779
|
+
* view while the rows scroll: the way out when the item isn't there, such
|
|
780
|
+
* as "Create an agent".
|
|
781
|
+
*/
|
|
782
|
+
footer?: ReactNode;
|
|
783
|
+
/**
|
|
784
|
+
* The list takes the height it is given and its rows scroll inside it, for
|
|
785
|
+
* a sheet or panel whose main content is the list. Otherwise a list with a
|
|
786
|
+
* search scrolls past 18rem.
|
|
787
|
+
*/
|
|
788
|
+
fill?: boolean;
|
|
757
789
|
className?: string;
|
|
758
790
|
};
|
|
759
791
|
type ChoiceListSingleProps = ChoiceListCommonProps & {
|
|
@@ -769,4 +801,4 @@ type ChoiceListMultipleProps = ChoiceListCommonProps & {
|
|
|
769
801
|
type ChoiceListProps = ChoiceListSingleProps | ChoiceListMultipleProps;
|
|
770
802
|
export declare function ChoiceList(props: ChoiceListProps): import("react").JSX.Element;
|
|
771
803
|
//#endregion
|
|
772
|
-
export { Dialog as AnnouncementDialog, DialogClose as AnnouncementDialogClose, DialogTrigger as AnnouncementDialogTrigger, type ChoiceListItem, type ChoiceListMultipleProps, type ChoiceListProps, type ChoiceListSingleProps, type ComboboxSelectGroup, type ComboboxSelectMessages, type ComboboxSelectOption, type ComboboxSelectProps, type ComboboxSelectSelection, type ComboboxSelectValue, type CommentCardMetaProps, type CommentCardProps, type CommentCardQuoteProps, type CommentCardTriggerProps, type CommentEntryAuthorProps, type CommentEntryBodyProps, type CommentEntryHeaderProps, type CommentEntryProps, type CommentEntryTimeProps, type CommentMarginItemProps, type CommentMarginLayout, type CommentMarginLayoutItem, type CommentMarginLayoutOptions, type CommentMarginProps, type CommentMarkerProps, DialogCommit, type DialogCommitProps, DialogFooterNote, type DialogFooterNoteProps, DialogSheetBack, type DialogSheetBackProps, DialogSheetContent, type DialogSheetContentProps, DropdownMenuLinkItem, type DropdownMenuLinkItemProps, type EllipsisProps, type EllipsisState, type EllipsisToggleProps, type HoldThenMoveOptions, type InboxItemLeadingBadgeProps, type InboxItemSkeletonListProps, type InboxItemSkeletonProps, type ListRowSkeletonProps, MessageItemDelegatedAvatar, type MessageItemDelegatedAvatarProps, MessageItemDelegatedBy, MessageItemDelegatedByButton, type MessageItemDelegatedByButtonProps, MessageItemDelegatedByName, type MessageItemDelegatedByNameProps, type MessageItemDelegatedByProps, MessageListJumpControls, type MessageListJumpControlsProps, MessageListJumpPill, MessageListJumpPillDismiss, type MessageListJumpPillDismissProps, MessageListJumpPillGroup, type MessageListJumpPillGroupProps, type MessageListJumpPillProps, MessageQuotedPreviewAuthorDelegatedBy, type MessageQuotedPreviewAuthorDelegatedByProps, MessageReferenceIcon, type MessageReferenceIconProps, MessageReferenceReadMark, type MessageReferenceReadMarkProps, type MeterHeaderProps, type MeterIndicatorProps, type MeterLabelProps, type MeterProps, type MeterTrackProps, type MeterValueProps, MobileNavServerItem, type MobileNavServerItemProps, MobileNavServerPopover, MobileNavServerPopoverContent, type MobileNavServerPopoverContentProps, MobileNavServerPopoverDestination, type MobileNavServerPopoverDestinationProps, MobileNavServerPopoverDestinations, type MobileNavServerPopoverDestinationsProps, MobileNavServerPopoverGroup, type MobileNavServerPopoverGroupProps, MobileNavServerPopoverList, type MobileNavServerPopoverListProps, type MobileNavServerPopoverProps, MobileNavServerPopoverRow, MobileNavServerPopoverRowBody, type MobileNavServerPopoverRowBodyProps, MobileNavServerPopoverRowDescription, type MobileNavServerPopoverRowDescriptionProps, MobileNavServerPopoverRowLabel, type MobileNavServerPopoverRowLabelProps, type MobileNavServerPopoverRowProps, type OverlayLayerKind, type OverlayLayerProviderProps, PopoverActions, type PopoverActionsProps, PopoverBody, type PopoverBodyProps, PreviewCardActions, type PreviewCardActionsProps, PreviewCardBody, type PreviewCardBodyProps, PreviewCardEyebrow, type PreviewCardEyebrowProps, PreviewCardFooter, type PreviewCardFooterProps, PreviewCardMeta, type PreviewCardMetaProps, type PullToRefresh, type PullToRefreshIndicatorProps, type PullToRefreshPlatform, type PullToRefreshState, type UseCommentMarginFitsOptions, type UsePullToRefreshOptions };
|
|
804
|
+
export { Dialog as AnnouncementDialog, DialogClose as AnnouncementDialogClose, DialogTrigger as AnnouncementDialogTrigger, type ChoiceListGroup, type ChoiceListItem, type ChoiceListMultipleProps, type ChoiceListProps, type ChoiceListSingleProps, type ComboboxSelectGroup, type ComboboxSelectMessages, type ComboboxSelectOption, type ComboboxSelectProps, type ComboboxSelectSelection, type ComboboxSelectValue, type CommentCardMetaProps, type CommentCardProps, type CommentCardQuoteProps, type CommentCardTriggerProps, type CommentEntryAuthorProps, type CommentEntryBodyProps, type CommentEntryHeaderProps, type CommentEntryProps, type CommentEntryTimeProps, type CommentMarginItemProps, type CommentMarginLayout, type CommentMarginLayoutItem, type CommentMarginLayoutOptions, type CommentMarginProps, type CommentMarkerProps, DialogCommit, type DialogCommitProps, DialogFooterNote, type DialogFooterNoteProps, DialogSheetBack, type DialogSheetBackProps, DialogSheetContent, type DialogSheetContentProps, DropdownMenuLinkItem, type DropdownMenuLinkItemProps, type EllipsisProps, type EllipsisState, type EllipsisToggleProps, type HoldThenMoveOptions, type InboxItemLeadingBadgeProps, type InboxItemSkeletonListProps, type InboxItemSkeletonProps, type ListRowSkeletonProps, MessageItemDelegatedAvatar, type MessageItemDelegatedAvatarProps, MessageItemDelegatedBy, MessageItemDelegatedByButton, type MessageItemDelegatedByButtonProps, MessageItemDelegatedByName, type MessageItemDelegatedByNameProps, type MessageItemDelegatedByProps, MessageListJumpControls, type MessageListJumpControlsProps, MessageListJumpPill, MessageListJumpPillDismiss, type MessageListJumpPillDismissProps, MessageListJumpPillGroup, type MessageListJumpPillGroupProps, type MessageListJumpPillProps, MessageQuotedPreviewAuthorDelegatedBy, type MessageQuotedPreviewAuthorDelegatedByProps, MessageReferenceIcon, type MessageReferenceIconProps, MessageReferenceReadMark, type MessageReferenceReadMarkProps, type MeterHeaderProps, type MeterIndicatorProps, type MeterLabelProps, type MeterProps, type MeterTrackProps, type MeterValueProps, MobileNavServerItem, type MobileNavServerItemProps, MobileNavServerPopover, MobileNavServerPopoverContent, type MobileNavServerPopoverContentProps, MobileNavServerPopoverDestination, type MobileNavServerPopoverDestinationProps, MobileNavServerPopoverDestinations, type MobileNavServerPopoverDestinationsProps, MobileNavServerPopoverGroup, type MobileNavServerPopoverGroupProps, MobileNavServerPopoverList, type MobileNavServerPopoverListProps, type MobileNavServerPopoverProps, MobileNavServerPopoverRow, MobileNavServerPopoverRowBody, type MobileNavServerPopoverRowBodyProps, MobileNavServerPopoverRowDescription, type MobileNavServerPopoverRowDescriptionProps, MobileNavServerPopoverRowLabel, type MobileNavServerPopoverRowLabelProps, type MobileNavServerPopoverRowProps, type OverlayLayerKind, type OverlayLayerProviderProps, PopoverActions, type PopoverActionsProps, PopoverBody, type PopoverBodyProps, PreviewCardActions, type PreviewCardActionsProps, PreviewCardBody, type PreviewCardBodyProps, PreviewCardEyebrow, type PreviewCardEyebrowProps, PreviewCardFooter, type PreviewCardFooterProps, PreviewCardMeta, type PreviewCardMetaProps, type PullToRefresh, type PullToRefreshIndicatorProps, type PullToRefreshPlatform, type PullToRefreshState, type UseCommentMarginFitsOptions, type UsePullToRefreshOptions };
|
package/dist/wip.mjs
CHANGED
|
@@ -2333,9 +2333,12 @@ const choiceList = tv({
|
|
|
2333
2333
|
slots: {
|
|
2334
2334
|
root: ["grid min-w-0 gap-2"],
|
|
2335
2335
|
searchInput: ["[&::-webkit-search-cancel-button]:appearance-none"],
|
|
2336
|
-
frame: ["min-w-0 rounded-container border border-line-hairline bg-layer-card
|
|
2336
|
+
frame: ["flex min-w-0 flex-col overflow-hidden", "rounded-container border border-line-hairline bg-layer-card"],
|
|
2337
|
+
scroller: ["min-h-0 min-w-0 p-1"],
|
|
2337
2338
|
rows: ["grid grid-cols-[minmax(0,1fr)_auto] gap-x-0 gap-y-0.5"],
|
|
2338
2339
|
group: ["col-span-2 col-start-1 grid grid-cols-subgrid grid-rows-subgrid gap-x-0 gap-y-0.5"],
|
|
2340
|
+
section: ["col-span-2 col-start-1 grid grid-cols-subgrid grid-rows-subgrid"],
|
|
2341
|
+
heading: ["col-span-2 px-2.5 pt-2 pb-1", "font-sans text-caption font-bold text-foreground-hint"],
|
|
2339
2342
|
item: [
|
|
2340
2343
|
"col-span-2 flex min-w-0 items-start gap-2.5 rounded-chip px-2.5",
|
|
2341
2344
|
"min-h-option py-option-inset",
|
|
@@ -2353,10 +2356,16 @@ const choiceList = tv({
|
|
|
2353
2356
|
"mt-option-inset pointer-coarse:mt-[calc((--spacing(11)-1lh)/2)]",
|
|
2354
2357
|
"font-sans text-subhead"
|
|
2355
2358
|
],
|
|
2356
|
-
note: ["px-2.5 py-2 font-sans text-callout text-foreground-hint"]
|
|
2359
|
+
note: ["px-2.5 py-2 font-sans text-callout text-foreground-hint"],
|
|
2360
|
+
footer: ["shrink-0 border-t border-line-seam p-1"]
|
|
2357
2361
|
},
|
|
2358
2362
|
variants: {
|
|
2359
|
-
scroll: { true: {
|
|
2363
|
+
scroll: { true: { scroller: ["max-h-72 overflow-y-auto overscroll-contain"] } },
|
|
2364
|
+
fill: { true: {
|
|
2365
|
+
root: ["flex min-h-0 flex-1 flex-col"],
|
|
2366
|
+
frame: ["min-h-0 flex-1"],
|
|
2367
|
+
scroller: ["flex-1 overflow-y-auto overscroll-contain"]
|
|
2368
|
+
} },
|
|
2360
2369
|
hasAction: { true: { item: ["pr-11"] } }
|
|
2361
2370
|
}
|
|
2362
2371
|
});
|
|
@@ -2405,11 +2414,42 @@ function visibleItems(items, needle, pinned, chosen) {
|
|
|
2405
2414
|
noMatch: !items.some(matches)
|
|
2406
2415
|
};
|
|
2407
2416
|
}
|
|
2417
|
+
function layoutSections(rows, groups) {
|
|
2418
|
+
const known = new Set(groups?.map((group) => group.value));
|
|
2419
|
+
const sections = groups ? groups.map((group) => ({
|
|
2420
|
+
group,
|
|
2421
|
+
rows: rows.filter((item) => item.group === group.value)
|
|
2422
|
+
})) : [];
|
|
2423
|
+
sections.push({
|
|
2424
|
+
group: null,
|
|
2425
|
+
rows: rows.filter((item) => !groups || item.group === void 0 || !known.has(item.group))
|
|
2426
|
+
});
|
|
2427
|
+
const drawn = sections.filter((section) => section.rows.length > 0);
|
|
2428
|
+
const gridRowOf = /* @__PURE__ */ new Map();
|
|
2429
|
+
let gridRows = 0;
|
|
2430
|
+
for (const section of drawn) {
|
|
2431
|
+
if (section.group) gridRows += 1;
|
|
2432
|
+
for (const item of section.rows) {
|
|
2433
|
+
gridRows += 1;
|
|
2434
|
+
gridRowOf.set(item.value, gridRows);
|
|
2435
|
+
}
|
|
2436
|
+
}
|
|
2437
|
+
return {
|
|
2438
|
+
sections: drawn,
|
|
2439
|
+
gridRowOf,
|
|
2440
|
+
gridRows
|
|
2441
|
+
};
|
|
2442
|
+
}
|
|
2408
2443
|
function ChoiceList(props) {
|
|
2409
|
-
const { items, search = "auto", "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, disabled = false, searchLabel, searchPlaceholder, defaultSearchValue = "", clearSearchLabel, noMatchLabel, empty, className } = props;
|
|
2444
|
+
const { items, search = "auto", "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, disabled = false, searchLabel, searchPlaceholder, defaultSearchValue = "", searchValue, onSearchValueChange, clearSearchLabel, noMatchLabel, empty, groups, footer, fill = false, className } = props;
|
|
2410
2445
|
const value = props.value;
|
|
2411
2446
|
const chosen = useMemo(() => value === null ? [] : typeof value === "string" ? [value] : value, [value]);
|
|
2412
|
-
const [
|
|
2447
|
+
const [ownQuery, setOwnQuery] = useState(defaultSearchValue);
|
|
2448
|
+
const query = searchValue ?? ownQuery;
|
|
2449
|
+
const setQuery = useCallback((next) => {
|
|
2450
|
+
if (searchValue === void 0) setOwnQuery(next);
|
|
2451
|
+
onSearchValueChange?.(next);
|
|
2452
|
+
}, [searchValue, onSearchValueChange]);
|
|
2413
2453
|
const [pinned, setPinned] = useState(chosen);
|
|
2414
2454
|
const inputRef = useRef(null);
|
|
2415
2455
|
const baseId = useId();
|
|
@@ -2417,11 +2457,26 @@ function ChoiceList(props) {
|
|
|
2417
2457
|
const [wasSearchable, setWasSearchable] = useState(searchable);
|
|
2418
2458
|
if (wasSearchable !== searchable) {
|
|
2419
2459
|
setWasSearchable(searchable);
|
|
2420
|
-
if (!searchable)
|
|
2460
|
+
if (!searchable) setOwnQuery("");
|
|
2461
|
+
}
|
|
2462
|
+
useEffect(() => {
|
|
2463
|
+
if (!searchable && searchValue) onSearchValueChange?.("");
|
|
2464
|
+
}, [
|
|
2465
|
+
searchable,
|
|
2466
|
+
searchValue,
|
|
2467
|
+
onSearchValueChange
|
|
2468
|
+
]);
|
|
2469
|
+
const [pinnedFor, setPinnedFor] = useState(query);
|
|
2470
|
+
if (pinnedFor !== query) {
|
|
2471
|
+
setPinnedFor(query);
|
|
2472
|
+
setPinned(chosen);
|
|
2421
2473
|
}
|
|
2422
2474
|
const { rows, noMatch } = visibleItems(items, searchable ? query.trim().toLowerCase() : "", pinned, chosen);
|
|
2423
2475
|
const hasAction = rows.some((item) => item.action !== void 0 && item.action !== null);
|
|
2424
|
-
const slots = choiceList({
|
|
2476
|
+
const slots = choiceList({
|
|
2477
|
+
scroll: searchable && !fill,
|
|
2478
|
+
fill
|
|
2479
|
+
});
|
|
2425
2480
|
useEffect(() => {
|
|
2426
2481
|
if (process.env.NODE_ENV === "production") return;
|
|
2427
2482
|
if (!ariaLabel && !ariaLabelledBy) console.warn("raft-ui: a ChoiceList has neither aria-label nor aria-labelledby.");
|
|
@@ -2444,21 +2499,20 @@ function ChoiceList(props) {
|
|
|
2444
2499
|
}, [focusSearch]);
|
|
2445
2500
|
const changeQuery = useCallback((event) => {
|
|
2446
2501
|
setQuery(event.currentTarget.value);
|
|
2447
|
-
|
|
2448
|
-
}, [chosen]);
|
|
2502
|
+
}, [setQuery]);
|
|
2449
2503
|
const clearQuery = useCallback(() => {
|
|
2450
2504
|
setQuery("");
|
|
2451
|
-
setPinned(chosen);
|
|
2452
2505
|
inputRef.current?.focus();
|
|
2453
|
-
}, [
|
|
2506
|
+
}, [setQuery]);
|
|
2507
|
+
const { sections, gridRowOf, gridRows } = layoutSections(rows, groups);
|
|
2454
2508
|
const groupProps = {
|
|
2455
2509
|
"aria-label": ariaLabel,
|
|
2456
2510
|
"aria-labelledby": ariaLabelledBy,
|
|
2457
2511
|
disabled,
|
|
2458
2512
|
className: slots.group(),
|
|
2459
|
-
style: { gridRow: `1 / span ${
|
|
2513
|
+
style: { gridRow: `1 / span ${gridRows}` }
|
|
2460
2514
|
};
|
|
2461
|
-
const
|
|
2515
|
+
const rowElement = (item) => {
|
|
2462
2516
|
const id = `${baseId}-${items.indexOf(item)}`;
|
|
2463
2517
|
const lines = descriptionLines(item.description).slice(0, MAX_DESCRIPTION_LINES);
|
|
2464
2518
|
const rowDisabled = disabled || item.disabled === true;
|
|
@@ -2499,6 +2553,24 @@ function ChoiceList(props) {
|
|
|
2499
2553
|
})
|
|
2500
2554
|
]
|
|
2501
2555
|
}, item.value);
|
|
2556
|
+
};
|
|
2557
|
+
const rowElements = sections.map((section, index) => {
|
|
2558
|
+
if (!section.group) return section.rows.map(rowElement);
|
|
2559
|
+
const headingId = `${baseId}-group-${index}`;
|
|
2560
|
+
const start = (gridRowOf.get(section.rows[0].value) ?? 1) - 1;
|
|
2561
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
2562
|
+
role: "group",
|
|
2563
|
+
"aria-labelledby": headingId,
|
|
2564
|
+
"data-slot": "choice-list-section",
|
|
2565
|
+
className: slots.section(),
|
|
2566
|
+
style: { gridRow: `${start} / span ${section.rows.length + 1}` },
|
|
2567
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
2568
|
+
id: headingId,
|
|
2569
|
+
"data-slot": "choice-list-heading",
|
|
2570
|
+
className: slots.heading(),
|
|
2571
|
+
children: section.group.label
|
|
2572
|
+
}), section.rows.map(rowElement)]
|
|
2573
|
+
}, section.group.value);
|
|
2502
2574
|
});
|
|
2503
2575
|
return /* @__PURE__ */ jsxs("div", {
|
|
2504
2576
|
"data-slot": "choice-list",
|
|
@@ -2529,40 +2601,48 @@ function ChoiceList(props) {
|
|
|
2529
2601
|
})
|
|
2530
2602
|
}) : null
|
|
2531
2603
|
]
|
|
2532
|
-
}) : null, /* @__PURE__ */
|
|
2604
|
+
}) : null, /* @__PURE__ */ jsxs("div", {
|
|
2533
2605
|
"data-slot": "choice-list-frame",
|
|
2534
2606
|
className: slots.frame(),
|
|
2535
|
-
children:
|
|
2536
|
-
"data-slot": "choice-list-
|
|
2537
|
-
className: slots.
|
|
2538
|
-
children:
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
children: [
|
|
2543
|
-
"data-slot": "choice-list-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2607
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
2608
|
+
"data-slot": "choice-list-scroller",
|
|
2609
|
+
className: slots.scroller(),
|
|
2610
|
+
children: items.length === 0 ? /* @__PURE__ */ jsx("p", {
|
|
2611
|
+
"data-slot": "choice-list-note",
|
|
2612
|
+
className: slots.note(),
|
|
2613
|
+
children: empty
|
|
2614
|
+
}) : /* @__PURE__ */ jsxs(Fragment$1, { children: [rows.length > 0 ? /* @__PURE__ */ jsxs("div", {
|
|
2615
|
+
"data-slot": "choice-list-rows",
|
|
2616
|
+
className: slots.rows(),
|
|
2617
|
+
children: [props.multiple ? /* @__PURE__ */ jsx(CheckboxGroup, {
|
|
2618
|
+
"data-slot": "choice-list-group",
|
|
2619
|
+
value: props.value,
|
|
2620
|
+
onValueChange: props.onValueChange,
|
|
2621
|
+
...groupProps,
|
|
2622
|
+
children: rowElements
|
|
2623
|
+
}) : /* @__PURE__ */ jsx(RadioGroup, {
|
|
2624
|
+
"data-slot": "choice-list-group",
|
|
2625
|
+
value: props.value,
|
|
2626
|
+
onValueChange: props.onValueChange,
|
|
2627
|
+
...groupProps,
|
|
2628
|
+
children: rowElements
|
|
2629
|
+
}), sections.flatMap((section) => section.rows.map((item) => item.action !== void 0 && item.action !== null ? /* @__PURE__ */ jsx("div", {
|
|
2630
|
+
"data-slot": "choice-list-action",
|
|
2631
|
+
className: slots.action(),
|
|
2632
|
+
style: { gridRow: gridRowOf.get(item.value) },
|
|
2633
|
+
children: item.action
|
|
2634
|
+
}, item.value) : null))]
|
|
2635
|
+
}) : null, searchable ? /* @__PURE__ */ jsx("p", {
|
|
2636
|
+
role: "status",
|
|
2637
|
+
"data-slot": "choice-list-status",
|
|
2638
|
+
className: noMatch ? slots.note() : "sr-only",
|
|
2639
|
+
children: noMatch ? noMatchLabel : null
|
|
2640
|
+
}) : null] })
|
|
2641
|
+
}), footer !== void 0 && footer !== null ? /* @__PURE__ */ jsx("div", {
|
|
2642
|
+
"data-slot": "choice-list-footer",
|
|
2643
|
+
className: slots.footer(),
|
|
2644
|
+
children: footer
|
|
2645
|
+
}) : null]
|
|
2566
2646
|
})]
|
|
2567
2647
|
});
|
|
2568
2648
|
}
|