@botiverse/raft-ui 0.11.0 → 0.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/style.css CHANGED
@@ -1138,6 +1138,14 @@
1138
1138
  overflow: hidden;
1139
1139
  }
1140
1140
 
1141
+ .r-combobox-select__option .r-combobox-select__text {
1142
+ -webkit-line-clamp: 2;
1143
+ white-space: normal;
1144
+ overflow-wrap: anywhere;
1145
+ -webkit-box-orient: vertical;
1146
+ display: -webkit-box;
1147
+ }
1148
+
1141
1149
  .r-combobox-select__actions {
1142
1150
  flex: none;
1143
1151
  align-items: center;
@@ -1205,7 +1213,7 @@
1205
1213
  width: var(--anchor-width, max-content);
1206
1214
  min-width: 13.75rem;
1207
1215
  max-width: var(--available-width);
1208
- max-height: min(var(--available-height), 24rem);
1216
+ max-height: min(var(--available-height), max(24rem, var(--combobox-select-list-max-height, 0px)));
1209
1217
  background: var(--layer-popover);
1210
1218
  color: var(--foreground);
1211
1219
  box-shadow: 0 0 0 1px var(--line-seam),
@@ -1217,8 +1225,9 @@
1217
1225
  }
1218
1226
 
1219
1227
  .r-combobox-select__list {
1228
+ box-sizing: border-box;
1229
+ max-height: var(--combobox-select-list-max-height, 16rem);
1220
1230
  overscroll-behavior: contain;
1221
- max-height: 16rem;
1222
1231
  padding: 6px;
1223
1232
  scroll-padding-block: 6px;
1224
1233
  overflow-y: auto;
@@ -1238,7 +1247,7 @@
1238
1247
  justify-content: space-between;
1239
1248
  align-items: center;
1240
1249
  gap: 10px;
1241
- padding: 0 10px;
1250
+ padding: 6px 10px;
1242
1251
  font-weight: 500;
1243
1252
  transition: background-color .12s, color .12s;
1244
1253
  display: flex;
@@ -1349,134 +1358,12 @@
1349
1358
  color: var(--foreground-disabled);
1350
1359
  }
1351
1360
 
1352
- .r-combobox-select__trigger {
1353
- box-sizing: border-box;
1354
- min-width: 0;
1355
- min-height: inherit;
1356
- color: inherit;
1357
- font: inherit;
1358
- text-align: start;
1359
- cursor: default;
1360
- -webkit-tap-highlight-color: transparent;
1361
- background: none;
1362
- border: 0;
1363
- outline: 0;
1364
- flex: 1;
1365
- align-items: center;
1366
- padding: 0;
1367
- display: flex;
1368
- }
1369
-
1370
- .r-combobox-select__trigger:after {
1371
- content: "";
1372
- border-radius: inherit;
1373
- position: absolute;
1374
- inset: 0;
1375
- }
1376
-
1377
- .r-combobox-select__trigger:disabled {
1378
- color: inherit;
1379
- }
1380
-
1381
- .r-combobox-select__value {
1382
- text-overflow: ellipsis;
1383
- white-space: nowrap;
1384
- min-width: 0;
1385
- overflow: hidden;
1386
- }
1387
-
1388
- .r-combobox-select__placeholder {
1389
- text-overflow: ellipsis;
1390
- white-space: nowrap;
1391
- min-width: 0;
1392
- color: var(--foreground-hint);
1393
- overflow: hidden;
1394
- }
1395
-
1396
- .r-combobox-select__trigger .r-combobox-select__chips {
1397
- margin-inline-start: -6px;
1398
- }
1399
-
1400
- .r-combobox-select__trigger .r-combobox-select__chip {
1401
- padding-inline-end: 8px;
1402
- }
1403
-
1404
- .r-combobox-select__clear {
1405
- z-index: 1;
1406
- position: relative;
1407
- }
1408
-
1409
- .r-combobox-select__arrow {
1410
- pointer-events: none;
1411
- }
1412
-
1413
- .r-combobox-select__control--trigger[data-popup-open] .r-combobox-select__arrow > svg {
1414
- transform: rotate(180deg);
1415
- }
1416
-
1417
1361
  .r-combobox-select__popup--anchored .r-combobox-select__list {
1418
- box-sizing: border-box;
1419
- max-height: min(calc(16rem + 12px), var(--available-height, 100vh));
1420
- }
1421
-
1422
- .r-combobox-select__sheet-popup {
1423
- height: 82dvh;
1424
- }
1425
-
1426
- .r-combobox-select__sheet {
1427
- flex-direction: column;
1428
- flex: 1;
1429
- min-height: 0;
1430
- display: flex;
1431
- }
1432
-
1433
- .r-combobox-select__sheet-header {
1434
- flex-direction: row;
1435
- justify-content: space-between;
1436
- align-items: center;
1437
- gap: 8px;
1438
- padding-inline-end: 8px;
1439
- }
1440
-
1441
- .r-combobox-select__sheet-title {
1442
- flex: 1;
1443
- min-width: 0;
1444
- }
1445
-
1446
- .r-combobox-select__sheet-search {
1447
- flex: none;
1448
- padding: 4px 16px 8px;
1449
- }
1450
-
1451
- .r-combobox-select__search-icon {
1452
- width: 16px;
1453
- height: 16px;
1454
- color: var(--foreground-hint);
1455
- flex: none;
1456
- }
1457
-
1458
- .r-combobox-select__sheet-body {
1459
- overscroll-behavior: contain;
1460
- min-height: 0;
1461
- padding: 0 8px calc(16px + env(safe-area-inset-bottom, 0px));
1462
- overflow-y: auto;
1463
- }
1464
-
1465
- .r-combobox-select__sheet .r-combobox-select__list {
1466
- max-height: none;
1467
- padding: 0;
1468
- overflow: visible;
1469
- }
1470
-
1471
- .r-combobox-select__sheet .r-combobox-select__option {
1472
- min-height: 52px;
1473
- font-size: var(--text-body);
1474
- line-height: var(--text-body--line-height);
1475
- padding: 0 12px;
1362
+ max-height: min(var(--combobox-select-list-max-height, 16rem), var(--available-height, 100vh));
1476
1363
  }
1477
1364
 
1478
- .r-combobox-select__sheet .r-combobox-select__group-label {
1479
- padding: 12px 12px 4px;
1365
+ .r-combobox-select__control--phone .r-combobox-select__input {
1366
+ font-size: max(1em, 16px);
1480
1367
  }
1481
1368
 
1482
1369
  @keyframes r-combobox-select-spin {
package/dist/styles.css CHANGED
@@ -283,6 +283,9 @@
283
283
  --color-foreground-on-frame-active: var(--foreground-on-frame-active);
284
284
  --color-fill-frame-pressed: var(--fill-frame-pressed);
285
285
  --color-fill-pressed: var(--fill-pressed);
286
+ --color-fill-row-hover: var(--fill-row-hover);
287
+ --color-fill-message-hover: var(--fill-message-hover);
288
+ --color-fill-row-open: var(--fill-row-open);
286
289
  --color-layer-code: var(--layer-code);
287
290
  --color-foreground-link: var(--foreground-link);
288
291
  --color-sticker-ink: var(--sticker-ink);
@@ -490,6 +493,18 @@ body {
490
493
  background-image: linear-gradient(var(--fill-pressed), var(--fill-pressed));
491
494
  }
492
495
 
496
+ /* A row laid over a solid surface (a list row on a card, a file row) hovers
497
+ with the lighter row step, as an overlay too, so press (press-overlay)
498
+ replaces it instead of stacking on it. */
499
+ @utility row-hover-overlay {
500
+ background-image: linear-gradient(var(--fill-row-hover), var(--fill-row-hover));
501
+ }
502
+
503
+ /* The same row with its menu open: fill-row-open, as an overlay. */
504
+ @utility row-open-overlay {
505
+ background-image: linear-gradient(var(--fill-row-open), var(--fill-row-open));
506
+ }
507
+
493
508
  @utility press-overlay-sticker {
494
509
  background-image: linear-gradient(var(--sticker-pressed), var(--sticker-pressed));
495
510
  }
package/dist/tokens.json CHANGED
@@ -1527,6 +1527,63 @@
1527
1527
  }
1528
1528
  }
1529
1529
  }
1530
+ },
1531
+ "row-hover": {
1532
+ "$description": "Hover on a whole row (sidebar, list, inbox, search result, table, file row): one perceptible step (OKLab dE about 2.8 in both modes), below every selection tint, so text keeps its contrast.",
1533
+ "$value": {
1534
+ "colorSpace": "oklch",
1535
+ "components": [0.1813, 0.005, 17.62],
1536
+ "alpha": 0.04
1537
+ },
1538
+ "$extensions": {
1539
+ "build.botiverse.raft": {
1540
+ "modes": {
1541
+ "dark": {
1542
+ "colorSpace": "oklch",
1543
+ "components": [0.9843, 0.004, 106.47],
1544
+ "alpha": 0.03
1545
+ }
1546
+ }
1547
+ }
1548
+ }
1549
+ },
1550
+ "message-hover": {
1551
+ "$description": "Hover on a message: the lightest perceptible step (OKLab dE about 2.1 in both modes), because a message is a large block someone reads with the pointer resting on it.",
1552
+ "$value": {
1553
+ "colorSpace": "oklch",
1554
+ "components": [0.1813, 0.005, 17.62],
1555
+ "alpha": 0.03
1556
+ },
1557
+ "$extensions": {
1558
+ "build.botiverse.raft": {
1559
+ "modes": {
1560
+ "dark": {
1561
+ "colorSpace": "oklch",
1562
+ "components": [0.9843, 0.004, 106.47],
1563
+ "alpha": 0.022
1564
+ }
1565
+ }
1566
+ }
1567
+ }
1568
+ },
1569
+ "row-open": {
1570
+ "$description": "Any row with its menu open (right-click, its menu button, press and hold): one step over a hover (OKLab dE 3.4 to 4.3 on every row surface), because on a phone, which has no hover, it is the only sign of which row the menu acts on. Still under info-soft and brand-soft on every surface.",
1571
+ "$value": {
1572
+ "colorSpace": "oklch",
1573
+ "components": [0.1813, 0.005, 17.62],
1574
+ "alpha": 0.05
1575
+ },
1576
+ "$extensions": {
1577
+ "build.botiverse.raft": {
1578
+ "modes": {
1579
+ "dark": {
1580
+ "colorSpace": "oklch",
1581
+ "components": [0.9843, 0.004, 106.47],
1582
+ "alpha": 0.04
1583
+ }
1584
+ }
1585
+ }
1586
+ }
1530
1587
  }
1531
1588
  },
1532
1589
  "line": {
package/dist/wip.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { M as StyledProps, O as ButtonProps, T as DialogTrigger, i as DialogClose, j as DataAttributes, s as DialogContentProps, t as Dialog, w as DialogTitleProps } from "./index-CAdZkAtE.mjs";
1
+ import { C as MessageQuotedPreviewAuthorDelegatedBy, Hi as DialogTitleProps, Ki as ButtonProps, Si as DialogClose, Ti as DialogContentProps, Ui as DialogTrigger, Xi as StyledProps, Yi as DataAttributes, a as MessageListJumpPillDismissProps, c as MessageListJumpPillProps, cn as MessageItemDelegatedAvatar, dn as MessageItemDelegatedByButton, fn as MessageItemDelegatedByButtonProps, hn as MessageItemDelegatedByProps, i as MessageListJumpPillDismiss, ln as MessageItemDelegatedAvatarProps, mn as MessageItemDelegatedByNameProps, n as MessageListJumpControlsProps, o as MessageListJumpPillGroup, pn as MessageItemDelegatedByName, r as MessageListJumpPill, s as MessageListJumpPillGroupProps, t as MessageListJumpControls, un as MessageItemDelegatedBy, w as MessageQuotedPreviewAuthorDelegatedByProps, yi as Dialog } from "./index-epyBg4aG.mjs";
2
2
  import { CSSProperties, ComponentPropsWithRef, ReactNode } from "react";
3
3
  import { Button } from "@base-ui/react/button";
4
4
  import { useRender } from "@base-ui/react/use-render";
@@ -24,12 +24,6 @@ interface ComboboxSelectMessages {
24
24
  chipDescription: string;
25
25
  inputDescription: string;
26
26
  remove: (label: string) => string;
27
- /** The placeholder of the search input at the top of the phone's bottom sheet. */
28
- search: string;
29
- /** The button that closes the phone's bottom sheet of a multiple select. */
30
- done: string;
31
- /** The close button of the phone's bottom sheet. */
32
- close: string;
33
27
  }
34
28
  type RootProps = Combobox.Root.Props<unknown, boolean>;
35
29
  type ComboboxSelectProps<Option = ComboboxSelectOption, Multiple extends boolean | undefined = false> = Pick<RootProps, "name" | "form" | "required" | "disabled" | "readOnly" | "open" | "defaultOpen" | "onOpenChange" | "onOpenChangeComplete" | "autoHighlight" | "autoComplete" | "inputValue" | "defaultInputValue" | "onInputValueChange"> & Pick<ComponentPropsWithRef<"input">, "id" | "ref" | "aria-label" | "aria-labelledby" | "aria-describedby" | "aria-invalid"> & {
@@ -75,30 +69,23 @@ type ComboboxSelectProps<Option = ComboboxSelectOption, Multiple extends boolean
75
69
  loadingContent?: ReactNode;
76
70
  messages?: Partial<ComboboxSelectMessages>;
77
71
  /**
78
- * On a phone (a touch screen under 48rem), more selectable options than this open a
79
- * bottom sheet instead of the anchored list.
80
- * @default 10
72
+ * The tallest the list gets before it scrolls, its 6px padding above and below
73
+ * included: a CSS length, or a number of pixels. On a phone the list also gets
74
+ * shorter to fit the room on its side, and opens above when that side has more
75
+ * room and below is short of this height.
76
+ * @default "16rem"
81
77
  */
82
- sheetThreshold?: number;
83
- /**
84
- * The title of the phone's bottom sheet. Defaults to the field's name: `aria-label`,
85
- * the text of `aria-labelledby`, or the `<label>` whose `for` is the field's `id`.
86
- */
87
- sheetTitle?: ReactNode;
88
- /** The text input: the field on a desktop, the search input of the bottom sheet on a phone. */
78
+ listMaxHeight?: number | string;
89
79
  inputProps?: Omit<Combobox.Input.Props, "value" | "defaultValue" | "size" | "children">;
90
- /** The portal of the list, and of the phone's anchored list and bottom sheet. */
91
80
  portalProps?: Combobox.Portal.Props;
92
- /** The desktop list's positioner. A phone positions its list itself. */
93
81
  positionerProps?: Omit<Combobox.Positioner.Props, "children">;
94
- /** The desktop list's popup. */
95
82
  popupProps?: Omit<Combobox.Popup.Props, "children">;
96
83
  className?: string;
97
84
  style?: CSSProperties;
98
85
  };
99
86
  //#endregion
100
87
  //#region src/components/combobox-select/combobox-select.d.ts
101
- export declare function ComboboxSelect<Option = ComboboxSelectOption, Multiple extends boolean | undefined = false>({ options, multiple, value, defaultValue, onValueChange, labelField, valueField, disabledField, fallbackOption, filterable, filter, remote, onSearch, loading, create, creatable, onCreate, clearable, showArrow, clearFilterAfterSelect, onClear, maxTagCount, size, status, placeholder, renderLabel, renderOption, renderTag, renderCreateLabel, emptyContent, loadingContent, messages, sheetThreshold, sheetTitle, inputProps, portalProps, positionerProps, popupProps, className, style, id: idProp, ref, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, inputValue, defaultInputValue, onInputValueChange, disabled, readOnly, autoHighlight, ...rootProps }: ComboboxSelectProps<Option, Multiple>): import("react").JSX.Element;
88
+ export declare function ComboboxSelect<Option = ComboboxSelectOption, Multiple extends boolean | undefined = false>({ options, multiple, value, defaultValue, onValueChange, labelField, valueField, disabledField, fallbackOption, filterable, filter, remote, onSearch, loading, create, creatable, onCreate, clearable, showArrow, clearFilterAfterSelect, onClear, maxTagCount, size, status, placeholder, renderLabel, renderOption, renderTag, renderCreateLabel, emptyContent, loadingContent, messages, listMaxHeight, inputProps, portalProps, positionerProps, popupProps, className, style, id: idProp, ref, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, inputValue, defaultInputValue, onInputValueChange, disabled, readOnly, autoHighlight, onOpenChange, ...rootProps }: ComboboxSelectProps<Option, Multiple>): import("react").JSX.Element;
102
89
  //#endregion
103
90
  //#region src/components/announcement-dialog/announcement-dialog.d.ts
104
91
  export declare function AnnouncementDialogContent({ className, initialFocus, ref, ...props }: DialogContentProps): import("react").JSX.Element;
@@ -278,4 +265,4 @@ type UseCommentMarginFitsOptions = {
278
265
  */
279
266
  export declare function useCommentMarginFits(element: Element | null, { minWidth }?: UseCommentMarginFitsOptions): boolean;
280
267
  //#endregion
281
- export { Dialog as AnnouncementDialog, DialogClose as AnnouncementDialogClose, DialogTrigger as AnnouncementDialogTrigger, 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, type UseCommentMarginFitsOptions };
268
+ export { Dialog as AnnouncementDialog, DialogClose as AnnouncementDialogClose, DialogTrigger as AnnouncementDialogTrigger, 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, 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, type UseCommentMarginFitsOptions };