@botiverse/raft-ui 0.22.0 → 0.23.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 +121 -0
- package/dist/components/steps/steps.css +15 -10
- package/dist/components/timeline/timeline.css +2 -2
- package/dist/foundation.css +9 -3
- package/dist/{inbox-item.recipe-3j4DHKZ2.mjs → inbox-item-B-y7PxZ_.mjs} +625 -14
- package/dist/{index-DT1Hg5N-.d.mts → inbox-item-ChGeZBFb.d.mts} +263 -4
- package/dist/index.d.mts +40 -252
- package/dist/index.mjs +356 -640
- package/dist/style.css +7 -7
- package/dist/styles.css +80 -5
- package/dist/tokens.json +15 -2
- package/dist/wip.d.mts +65 -2
- package/dist/wip.mjs +140 -4
- package/package.json +1 -1
package/dist/style.css
CHANGED
|
@@ -276,7 +276,7 @@
|
|
|
276
276
|
}
|
|
277
277
|
}
|
|
278
278
|
.r-timeline {
|
|
279
|
-
--r-timeline-icon-size: var(--r-timeline-custom-icon-size,
|
|
279
|
+
--r-timeline-icon-size: var(--r-timeline-custom-icon-size, 10px);
|
|
280
280
|
--r-timeline-title-font-size: var(--text-callout);
|
|
281
281
|
--r-timeline-content-font-size: var(--text-mono-meta);
|
|
282
282
|
--r-timeline-time-font-size: var(--text-mono-meta);
|
|
@@ -771,14 +771,14 @@
|
|
|
771
771
|
}
|
|
772
772
|
}
|
|
773
773
|
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
774
|
+
.r-steps--horizontal {
|
|
775
|
+
flex-wrap: wrap;
|
|
776
|
+
row-gap: 8px;
|
|
777
|
+
inline-size: 100%;
|
|
778
|
+
container-type: inline-size;
|
|
779
779
|
}
|
|
780
780
|
|
|
781
|
-
@
|
|
781
|
+
@container (width < 40rem) {
|
|
782
782
|
.r-steps--horizontal > .r-step {
|
|
783
783
|
--r-steps-connector-gap: 6px;
|
|
784
784
|
--r-steps-connector-min-width: 8px;
|
package/dist/styles.css
CHANGED
|
@@ -225,6 +225,7 @@
|
|
|
225
225
|
--color-brand-950: var(--brand-950);
|
|
226
226
|
--color-brand-strong: var(--brand-strong);
|
|
227
227
|
--color-brand-soft: var(--brand-soft);
|
|
228
|
+
--color-selection: var(--selection);
|
|
228
229
|
--color-brand-hover: var(--brand-hover);
|
|
229
230
|
--color-brand-active: var(--brand-active);
|
|
230
231
|
|
|
@@ -561,11 +562,12 @@ textarea:-webkit-autofill:disabled {
|
|
|
561
562
|
yellow of a highlight and a 2px yellow underline; the passage of the open
|
|
562
563
|
discussion gets the full yellow with ink type, like a search hit, in both
|
|
563
564
|
modes. `--brand-400` is the `brand` role (what `bg-brand` paints):
|
|
564
|
-
`--color-brand` is an inline theme value and emits no variable.
|
|
565
|
+
`--color-brand` is an inline theme value and emits no variable. In dark
|
|
566
|
+
mode the wash is `--selection` (brand at 22%), kept in one place. */
|
|
565
567
|
::highlight(raft-comment) {
|
|
566
568
|
background-color: light-dark(
|
|
567
569
|
color-mix(in oklch, var(--brand-400) 35%, transparent),
|
|
568
|
-
|
|
570
|
+
var(--selection)
|
|
569
571
|
);
|
|
570
572
|
text-decoration-line: underline;
|
|
571
573
|
text-decoration-color: var(--brand-400);
|
|
@@ -578,6 +580,79 @@ textarea:-webkit-autofill:disabled {
|
|
|
578
580
|
text-decoration-line: none;
|
|
579
581
|
}
|
|
580
582
|
|
|
583
|
+
/* Located: the item a jump took someone to (a link to a message, Back to the
|
|
584
|
+
results, a comment's anchor, the rows a bulk change touched) shows
|
|
585
|
+
`info-soft` at once, holds it 1.2s, fades out over 0.8s and is gone at 2s
|
|
586
|
+
(design/foundations/states.md#located). The fill is a registered colour so
|
|
587
|
+
it can animate; it is painted as a layer over the item's own fill, so a
|
|
588
|
+
row's surface stays underneath and comes back as the cyan fades.
|
|
589
|
+
- Stronger marks win: an item that is selected, active, current, a search
|
|
590
|
+
match, checked, or has its popup open isn't painted; its own mark already
|
|
591
|
+
says where it is.
|
|
592
|
+
- Unlayered, so it beats the hover utilities (a located item doesn't answer
|
|
593
|
+
hover: the pointer often rests where the item lands, and a grey would
|
|
594
|
+
hide the cyan). Not while pressed: :active lets the press tier show.
|
|
595
|
+
- The app sets data-located through useLocated (lib/located.ts), which
|
|
596
|
+
drops it after LOCATED_MS. Setting the attribute again while it is on
|
|
597
|
+
doesn't restart the animation; it restarts only after it was removed
|
|
598
|
+
for a frame, which useLocated does. Left on, the end state is a
|
|
599
|
+
transparent layer that still hides hover, so don't set it by hand.
|
|
600
|
+
- A message row takes the fill as --mi-row-fill instead: its resting
|
|
601
|
+
fill is var(--located-fill), so its own marks (an open menu, a search
|
|
602
|
+
match, a checked box) override it like any other state, with no has-selector
|
|
603
|
+
here, and the delegated face's ring keeps matching the row
|
|
604
|
+
(message-item.recipe.ts). */
|
|
605
|
+
@property --located-fill {
|
|
606
|
+
syntax: "<color>";
|
|
607
|
+
inherits: false;
|
|
608
|
+
initial-value: transparent;
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
@keyframes raft-located {
|
|
612
|
+
0%,
|
|
613
|
+
60% {
|
|
614
|
+
--located-fill: var(--info-soft);
|
|
615
|
+
animation-timing-function: ease-out;
|
|
616
|
+
}
|
|
617
|
+
100% {
|
|
618
|
+
--located-fill: transparent;
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
@keyframes raft-located-still {
|
|
623
|
+
from,
|
|
624
|
+
to {
|
|
625
|
+
--located-fill: var(--info-soft);
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
/* The shorthand replaces any animation of the element's own while it is
|
|
630
|
+
located; no raft-ui row has one. It runs on every located item, marked or
|
|
631
|
+
not, so a mark that comes and goes (a popup opened and closed) doesn't
|
|
632
|
+
start the highlight over. */
|
|
633
|
+
[data-located] {
|
|
634
|
+
animation: var(--located-animation, raft-located) 2s linear;
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
[data-located]:not(
|
|
638
|
+
[data-message-item],
|
|
639
|
+
:active,
|
|
640
|
+
[data-selected]:not([data-selected="false"]),
|
|
641
|
+
[data-active="true"],
|
|
642
|
+
[aria-selected="true"],
|
|
643
|
+
[aria-current]:not([aria-current="false"]),
|
|
644
|
+
[data-popup-open]
|
|
645
|
+
) {
|
|
646
|
+
background-image: linear-gradient(var(--located-fill), var(--located-fill));
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
/* Reduced motion: the same 2s, held still, then off without a fade. */
|
|
650
|
+
@media (prefers-reduced-motion: reduce) {
|
|
651
|
+
[data-located] {
|
|
652
|
+
--located-animation: raft-located-still;
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
|
|
581
656
|
@utility image-transparency-bg {
|
|
582
657
|
--checker-cell: light-dark(oklch(0.1813 0.00497 17.62 / 0.12), oklch(1 0 0 / 0.1));
|
|
583
658
|
background-color: light-dark(oklch(1 0 0), oklch(0.23 0 0));
|
|
@@ -640,8 +715,8 @@ textarea:-webkit-autofill:disabled {
|
|
|
640
715
|
the mark reads `1lh` from it.
|
|
641
716
|
|
|
642
717
|
`lead-dot` places a status light the same way, in a box one line tall,
|
|
643
|
-
and keeps it at its one size beside text,
|
|
644
|
-
(status.md#sizes). It is kept at
|
|
718
|
+
and keeps it at its one size beside text, 10px with a 1.5px ink edge
|
|
719
|
+
(status.md#sizes). It is kept at 10px inside components (Badge,
|
|
645
720
|
PanelActivity, a panel header); when placing Status yourself, don't pass
|
|
646
721
|
a size. A notice never uses a status light to say what kind of notice
|
|
647
722
|
it is; it leads with its intent's icon (status.md#sizes). */
|
|
@@ -651,7 +726,7 @@ textarea:-webkit-autofill:disabled {
|
|
|
651
726
|
translate: 0 calc(0.5lh - 50%);
|
|
652
727
|
}
|
|
653
728
|
@utility lead-dot {
|
|
654
|
-
--lead-dot:
|
|
729
|
+
--lead-dot: 10px;
|
|
655
730
|
flex-shrink: 0;
|
|
656
731
|
width: var(--lead-dot);
|
|
657
732
|
height: var(--lead-dot);
|
package/dist/tokens.json
CHANGED
|
@@ -1261,14 +1261,14 @@
|
|
|
1261
1261
|
"link": {
|
|
1262
1262
|
"$value": {
|
|
1263
1263
|
"colorSpace": "oklch",
|
|
1264
|
-
"components": [0.
|
|
1264
|
+
"components": [0.4327, 0.1282, 256.54]
|
|
1265
1265
|
},
|
|
1266
1266
|
"$extensions": {
|
|
1267
1267
|
"build.botiverse.raft": {
|
|
1268
1268
|
"modes": {
|
|
1269
1269
|
"dark": {
|
|
1270
1270
|
"colorSpace": "oklch",
|
|
1271
|
-
"components": [0.
|
|
1271
|
+
"components": [0.717, 0.1183, 253.58]
|
|
1272
1272
|
}
|
|
1273
1273
|
}
|
|
1274
1274
|
}
|
|
@@ -2529,6 +2529,19 @@
|
|
|
2529
2529
|
}
|
|
2530
2530
|
}
|
|
2531
2531
|
},
|
|
2532
|
+
"selection": {
|
|
2533
|
+
"$type": "color",
|
|
2534
|
+
"$value": "{brand.soft}",
|
|
2535
|
+
"$description": "Selected text (::selection). brand-soft in light mode; in dark mode brand over the page at 22%, the wash of a commented passage, because brand-soft left a selection almost the same as the page.",
|
|
2536
|
+
"$extensions": {
|
|
2537
|
+
"build.botiverse.raft": {
|
|
2538
|
+
"css": true,
|
|
2539
|
+
"modes": {
|
|
2540
|
+
"dark": "color-mix(in oklch, var(--brand-400) 22%, transparent)"
|
|
2541
|
+
}
|
|
2542
|
+
}
|
|
2543
|
+
}
|
|
2544
|
+
},
|
|
2532
2545
|
"field": {
|
|
2533
2546
|
"font-size": {
|
|
2534
2547
|
"$value": {
|
package/dist/wip.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $
|
|
1
|
+
import { $i as MobileNavServerPopoverDestinationProps, As as DialogContentProps, B as MessageListJumpPill, C as InboxItemProps, Ca as PopoverBodyProps, Cs as DialogSheetContentProps, Ds as DialogClose, Fs as DialogFooterNoteProps, G as MessageListJumpPillProps, H as MessageListJumpPillDismissProps, Ji as MobileNavServerItemProps, Jt as MessageReferenceIcon, Ks as DialogSheetBack, Ps as DialogFooterNote, Qi as MobileNavServerPopoverDestination, Qs as DialogTrigger, R as MessageListJumpControls, Sa as PopoverBody, Ss as DialogSheetContent, Ti as PreviewCardMetaProps, U as MessageListJumpPillGroup, V as MessageListJumpPillDismiss, W as MessageListJumpPillGroupProps, Xi as MobileNavServerPopoverContent, Yi as MobileNavServerPopover, Yt as MessageReferenceIconProps, Zi as MobileNavServerPopoverContentProps, Zs as DialogTitleProps, _a as PopoverActionsProps, aa as MobileNavServerPopoverListProps, ar as MessageItemDelegatedByButtonProps, bi as PreviewCardFooter, bs as DialogCommit, ca as MobileNavServerPopoverRowBody, cc as DataAttributes, ci as PreviewCardActions, cr as MessageItemDelegatedByProps, ct as MessageQuotedPreviewAuthorDelegatedBy, da as MobileNavServerPopoverRowDescriptionProps, ea as MobileNavServerPopoverDestinations, fa as MobileNavServerPopoverRowLabel, fi as PreviewCardBody, ga as PopoverActions, ho as DropdownMenuLinkItemProps, ia as MobileNavServerPopoverList, ir as MessageItemDelegatedByButton, la as MobileNavServerPopoverRowBodyProps, lc as StyledProps, li as PreviewCardActionsProps, ls as ListRowProps, lt as MessageQuotedPreviewAuthorDelegatedByProps, ma as MobileNavServerPopoverRowProps, mo as DropdownMenuLinkItem, na as MobileNavServerPopoverGroup, nn as MessageReferenceReadMark, nr as MessageItemDelegatedAvatarProps, oa as MobileNavServerPopoverProps, or as MessageItemDelegatedByName, pa as MobileNavServerPopoverRowLabelProps, pi as PreviewCardBodyProps, qi as MobileNavServerItem, qs as DialogSheetBackProps, ra as MobileNavServerPopoverGroupProps, rc as ButtonProps, rn as MessageReferenceReadMarkProps, rr as MessageItemDelegatedBy, sa as MobileNavServerPopoverRow, sc as VariantProps, sr as MessageItemDelegatedByNameProps, ta as MobileNavServerPopoverDestinationsProps, tr as MessageItemDelegatedAvatar, u as InboxItemDensity, ua as MobileNavServerPopoverRowDescription, vi as PreviewCardEyebrow, vs as TextLinkProps, wi as PreviewCardMeta, ws as Dialog, xi as PreviewCardFooterProps, xs as DialogCommitProps, yi as PreviewCardEyebrowProps, z as MessageListJumpControlsProps } from "./inbox-item-ChGeZBFb.mjs";
|
|
2
2
|
import { CSSProperties, ComponentProps, ComponentPropsWithRef, PointerEvent, ReactNode, RefObject } from "react";
|
|
3
3
|
import { Button } from "@base-ui/react/button";
|
|
4
4
|
import { useRender } from "@base-ui/react/use-render";
|
|
@@ -392,6 +392,69 @@ type InboxItemLeadingBadgeProps = useRender.ComponentProps<"span">;
|
|
|
392
392
|
*/
|
|
393
393
|
export declare function InboxItemLeadingBadge({ className, render, ...props }: InboxItemLeadingBadgeProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
394
394
|
//#endregion
|
|
395
|
+
//#region src/components/inbox-item/inbox-item-skeleton.d.ts
|
|
396
|
+
type InboxItemSkeletonShape = {
|
|
397
|
+
/** The density of the rows it stands for. */
|
|
398
|
+
density?: InboxItemDensity;
|
|
399
|
+
/** A 35px block where the rows have an `InboxItemLeading` avatar or tile. */
|
|
400
|
+
leading?: boolean;
|
|
401
|
+
/** A context line above the title, where the rows have an `InboxItemContext`. */
|
|
402
|
+
context?: boolean;
|
|
403
|
+
};
|
|
404
|
+
type InboxItemSkeletonProps = Omit<InboxItemProps, "active" | "disabled" | "children"> & InboxItemSkeletonShape;
|
|
405
|
+
/**
|
|
406
|
+
* A placeholder for one `InboxItem` while the list loads. It is an
|
|
407
|
+
* `InboxItem` itself, with the same parts as the loaded row (an optional
|
|
408
|
+
* leading block, the context line, the title, the excerpt, the timestamp),
|
|
409
|
+
* each holding a bar instead of text. The padding, the divider and every
|
|
410
|
+
* line's height are the loaded row's, so nothing moves when the content
|
|
411
|
+
* arrives. Match `density`, `leading` and `context` to the rows it stands for.
|
|
412
|
+
* Hidden from assistive technology: mark the region that stays while the
|
|
413
|
+
* list loads `aria-busy`.
|
|
414
|
+
*/
|
|
415
|
+
export declare function InboxItemSkeleton({ density, leading, context, ...props }: InboxItemSkeletonProps): import("react").JSX.Element;
|
|
416
|
+
type InboxItemSkeletonListProps = useRender.ComponentProps<"div"> & InboxItemSkeletonShape & {
|
|
417
|
+
/** How many rows to show. About a screenful; ignored when there are children. */
|
|
418
|
+
count?: number;
|
|
419
|
+
/**
|
|
420
|
+
* Milliseconds to wait before the rows appear, so a fast load doesn't
|
|
421
|
+
* flash them (Feedback, "Empty, loading and failed"). The list is empty
|
|
422
|
+
* until then. A list skeleton is only for a slow load, so it waits 1
|
|
423
|
+
* second by default; pass `0` to show the rows at once.
|
|
424
|
+
*/
|
|
425
|
+
delay?: number;
|
|
426
|
+
};
|
|
427
|
+
/**
|
|
428
|
+
* The list of `InboxItemSkeleton` rows that stands in for a list of
|
|
429
|
+
* `InboxItem` rows while it loads, with nothing between or around the rows
|
|
430
|
+
* that the loaded list doesn't have (no gap, no border, no card). Renders
|
|
431
|
+
* `count` rows of the given shape, or its children, once `delay` (1 second by
|
|
432
|
+
* default) has passed. It isn't `aria-busy` itself: it goes away when the
|
|
433
|
+
* content arrives, so mark the region that stays, such as the list's panel or
|
|
434
|
+
* viewport, `aria-busy` while it loads.
|
|
435
|
+
*/
|
|
436
|
+
export declare function InboxItemSkeletonList({ count, delay, density, leading, context, children, className, render, ...props }: InboxItemSkeletonListProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
437
|
+
//#endregion
|
|
438
|
+
//#region src/components/list-row/list-row-skeleton.d.ts
|
|
439
|
+
type ListRowSkeletonProps = Omit<ListRowProps, "tone" | "selected" | "interactive" | "children"> & {
|
|
440
|
+
/**
|
|
441
|
+
* A leading block: 35px for an avatar or tile in a `default` row, 20px for
|
|
442
|
+
* a `ListRowIcon` in a `plain` or `entry` row. On by default in a `default`
|
|
443
|
+
* row.
|
|
444
|
+
*/
|
|
445
|
+
leading?: boolean;
|
|
446
|
+
/** A second line, where the rows have a `ListRowDescription`. On by default in a `default` row. */
|
|
447
|
+
description?: boolean;
|
|
448
|
+
};
|
|
449
|
+
/**
|
|
450
|
+
* A placeholder for one `ListRow` while the list loads. It is a display-only
|
|
451
|
+
* `ListRow` of the same `variant`, with a bar in its title, its time and its
|
|
452
|
+
* description, so it is the loaded row's size and its divider sits in the
|
|
453
|
+
* same place. Hidden from assistive technology: mark the region that stays
|
|
454
|
+
* while the list loads, such as its `ListRowGroup`, `aria-busy`.
|
|
455
|
+
*/
|
|
456
|
+
export declare function ListRowSkeleton({ variant, leading, description, className, ...props }: ListRowSkeletonProps): import("react").JSX.Element;
|
|
457
|
+
//#endregion
|
|
395
458
|
//#region src/components/meter/meter.d.ts
|
|
396
459
|
declare const meter: import("tailwind-variants/lite").TVReturnType<{
|
|
397
460
|
level: {
|
|
@@ -541,4 +604,4 @@ export declare function OverlayLayerProvider({ kind, modal, children }: OverlayL
|
|
|
541
604
|
*/
|
|
542
605
|
export declare function useParentOverlayKind(): OverlayLayerKind | null;
|
|
543
606
|
//#endregion
|
|
544
|
-
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, 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, 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, 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 UseCommentMarginFitsOptions };
|
|
607
|
+
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, 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 UseCommentMarginFitsOptions };
|
package/dist/wip.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $r as ListRowTitle, An as MobileNavServerItem, Bn as MobileNavServerPopoverRowLabel, C as MessageListJumpPillDismiss, Fi as OverlayLayerProvider, Fn as MobileNavServerPopoverGroup, Ft as MessageItemDelegatedBy, Gn as PopoverBody, Gr as ListRow, Hn as PopoverActions, Ii as useParentOverlayKind, In as MobileNavServerPopoverList, It as MessageItemDelegatedByButton, Kr as ListRowBody, Ln as MobileNavServerPopoverRow, Lt as MessageItemDelegatedByName, Mn as MobileNavServerPopoverContent, Nn as MobileNavServerPopoverDestination, Oi as TextLink, P as MessageQuotedPreviewAuthorDelegatedBy, Pi as defaultNativeButton, Pn as MobileNavServerPopoverDestinations, Pt as MessageItemDelegatedAvatar, Qr as ListRowMeta, Ri as useThemeScopeProps, Rn as MobileNavServerPopoverRowBody, S as MessageListJumpPill, Si as DialogSheetBack, Sn as PreviewCardFooter, Ti as DialogTrigger, Vi as tv, Yr as ListRowDescription, _ as InboxItemTrailing, _i as DialogFooterNote, a as InboxItemContext, b as Skeleton, c as InboxItemLeading, ci as DialogCommit, ct as MessageReferenceReadMark, di as Dialog, dn as measureContent, ei as ListRowTop, fn as measureElement, g as InboxItemTitle, gn as PreviewCardActions, gr as DropdownMenuLinkItem, h as InboxItemTimestamp, i as InboxItemContent, it as MessageReferenceIcon, ji as Button$1, jn as MobileNavServerPopover, li as DialogSheetContent, mi as DialogContent, mn as readNow, ni as Tooltip, nr as useHoldThenMoveTouchSensor, o as InboxItemHeading, oi as TooltipTrigger, pi as DialogClose, pn as observeTruncation, qr as ListRowBottom, r as InboxItemBody, ri as TooltipContent, t as InboxItem, un as useOverflowTitle, vn as PreviewCardBody, w as MessageListJumpPillGroup, wi as DialogTitle, wn as PreviewCardMeta, x as MessageListJumpControls, xn as PreviewCardEyebrow, y as inboxItem, zi as useTheme, zn as MobileNavServerPopoverRowDescription } from "./inbox-item-B-y7PxZ_.mjs";
|
|
2
2
|
import { Check, ChevronDown, LoaderCircle, Plus, X } from "lucide-react";
|
|
3
3
|
import { createContext, use, useCallback, useContext, useEffect, useId, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
|
|
4
4
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -528,7 +528,7 @@ const announcement = tv({ slots: {
|
|
|
528
528
|
],
|
|
529
529
|
header: ["flex min-w-0 items-center justify-between gap-3"],
|
|
530
530
|
label: ["flex min-w-0 items-center gap-2 wrap-break-word", "text-caption text-foreground-muted"],
|
|
531
|
-
dot: ["shrink-0", "size-
|
|
531
|
+
dot: ["shrink-0", "size-2.5 rounded-[2px] border-[1.5px] border-sticker-ink bg-attention-400"],
|
|
532
532
|
title: ["mt-3 wrap-break-word normal-case", "text-headline font-bold tracking-normal"],
|
|
533
533
|
picture: ["mt-5 h-44 w-full overflow-hidden border border-line-hairline [&_img]:size-full [&_img]:object-contain", "rounded-container bg-fill-muted"],
|
|
534
534
|
text: [
|
|
@@ -668,7 +668,7 @@ const comment = tv({
|
|
|
668
668
|
entryBody: [
|
|
669
669
|
"wrap-break-word select-text",
|
|
670
670
|
"text-callout text-foreground",
|
|
671
|
-
"selection:bg-
|
|
671
|
+
"selection:bg-selection"
|
|
672
672
|
],
|
|
673
673
|
marker: [
|
|
674
674
|
"relative inline-flex h-6 shrink-0 items-center gap-1 align-top whitespace-nowrap",
|
|
@@ -1491,6 +1491,142 @@ function InboxItemLeadingBadge({ className, render, ...props }) {
|
|
|
1491
1491
|
});
|
|
1492
1492
|
}
|
|
1493
1493
|
//#endregion
|
|
1494
|
+
//#region src/components/inbox-item/inbox-item-skeleton.recipe.ts
|
|
1495
|
+
const inboxItemSkeleton = tv({ slots: {
|
|
1496
|
+
list: ["flex min-w-0 flex-col"],
|
|
1497
|
+
row: [
|
|
1498
|
+
"[--inbox-item-skeleton-context:5rem] [--inbox-item-skeleton-title:60%] [--inbox-item-skeleton-body:80%]",
|
|
1499
|
+
"nth-[3n+2]:[--inbox-item-skeleton-context:4rem] nth-[3n+2]:[--inbox-item-skeleton-title:45%] nth-[3n+2]:[--inbox-item-skeleton-body:70%]",
|
|
1500
|
+
"nth-[3n]:[--inbox-item-skeleton-context:6rem] nth-[3n]:[--inbox-item-skeleton-title:55%] nth-[3n]:[--inbox-item-skeleton-body:75%]"
|
|
1501
|
+
],
|
|
1502
|
+
leading: ["size-[35px]"],
|
|
1503
|
+
line: ["min-w-0 flex-1"],
|
|
1504
|
+
title: ["pl-0"],
|
|
1505
|
+
bar: ["inline-block h-[0.75em] max-w-full align-middle"],
|
|
1506
|
+
contextBar: ["w-(--inbox-item-skeleton-context)"],
|
|
1507
|
+
titleBar: ["w-(--inbox-item-skeleton-title)"],
|
|
1508
|
+
bodyBar: ["w-(--inbox-item-skeleton-body)"],
|
|
1509
|
+
timestampBar: ["w-9"]
|
|
1510
|
+
} });
|
|
1511
|
+
//#endregion
|
|
1512
|
+
//#region src/components/inbox-item/inbox-item-skeleton.tsx
|
|
1513
|
+
/**
|
|
1514
|
+
* A placeholder for one `InboxItem` while the list loads. It is an
|
|
1515
|
+
* `InboxItem` itself, with the same parts as the loaded row (an optional
|
|
1516
|
+
* leading block, the context line, the title, the excerpt, the timestamp),
|
|
1517
|
+
* each holding a bar instead of text. The padding, the divider and every
|
|
1518
|
+
* line's height are the loaded row's, so nothing moves when the content
|
|
1519
|
+
* arrives. Match `density`, `leading` and `context` to the rows it stands for.
|
|
1520
|
+
* Hidden from assistive technology: mark the region that stays while the
|
|
1521
|
+
* list loads `aria-busy`.
|
|
1522
|
+
*/
|
|
1523
|
+
function InboxItemSkeleton({ density, leading = false, context = false, ...props }) {
|
|
1524
|
+
const slots = inboxItemSkeleton();
|
|
1525
|
+
const bar = (width) => /* @__PURE__ */ jsx(Skeleton, {
|
|
1526
|
+
variant: "line",
|
|
1527
|
+
className: slots.bar({ className: width })
|
|
1528
|
+
});
|
|
1529
|
+
return /* @__PURE__ */ jsxs(InboxItem, {
|
|
1530
|
+
"aria-hidden": true,
|
|
1531
|
+
"data-skeleton": "",
|
|
1532
|
+
density,
|
|
1533
|
+
disabled: true,
|
|
1534
|
+
...props,
|
|
1535
|
+
className: slots.row({ className: props.className }),
|
|
1536
|
+
children: [
|
|
1537
|
+
leading ? /* @__PURE__ */ jsx(InboxItemLeading, { children: /* @__PURE__ */ jsx(Skeleton, { className: slots.leading() }) }) : null,
|
|
1538
|
+
/* @__PURE__ */ jsxs(InboxItemContent, { children: [
|
|
1539
|
+
context ? /* @__PURE__ */ jsx(InboxItemContext, { children: /* @__PURE__ */ jsx("span", {
|
|
1540
|
+
className: slots.line(),
|
|
1541
|
+
children: bar(slots.contextBar())
|
|
1542
|
+
}) }) : null,
|
|
1543
|
+
/* @__PURE__ */ jsx(InboxItemHeading, { children: /* @__PURE__ */ jsx(InboxItemTitle, {
|
|
1544
|
+
className: slots.title(),
|
|
1545
|
+
children: bar(slots.titleBar())
|
|
1546
|
+
}) }),
|
|
1547
|
+
/* @__PURE__ */ jsx(InboxItemBody, { children: bar(slots.bodyBar()) })
|
|
1548
|
+
] }),
|
|
1549
|
+
/* @__PURE__ */ jsx(InboxItemTrailing, { children: /* @__PURE__ */ jsx(InboxItemTimestamp, { children: bar(slots.timestampBar()) }) })
|
|
1550
|
+
]
|
|
1551
|
+
});
|
|
1552
|
+
}
|
|
1553
|
+
/**
|
|
1554
|
+
* The list of `InboxItemSkeleton` rows that stands in for a list of
|
|
1555
|
+
* `InboxItem` rows while it loads, with nothing between or around the rows
|
|
1556
|
+
* that the loaded list doesn't have (no gap, no border, no card). Renders
|
|
1557
|
+
* `count` rows of the given shape, or its children, once `delay` (1 second by
|
|
1558
|
+
* default) has passed. It isn't `aria-busy` itself: it goes away when the
|
|
1559
|
+
* content arrives, so mark the region that stays, such as the list's panel or
|
|
1560
|
+
* viewport, `aria-busy` while it loads.
|
|
1561
|
+
*/
|
|
1562
|
+
function InboxItemSkeletonList({ count = 6, delay = 1e3, density, leading, context, children, className, render, ...props }) {
|
|
1563
|
+
const { list } = inboxItemSkeleton();
|
|
1564
|
+
const shown = useDelayPassed(delay);
|
|
1565
|
+
const defaultProps = {
|
|
1566
|
+
"data-slot": "inbox-item-skeleton-list",
|
|
1567
|
+
"data-waiting": shown ? void 0 : "",
|
|
1568
|
+
className: list({ className }),
|
|
1569
|
+
children: shown ? children ?? Array.from({ length: count }, (_, index) => /* @__PURE__ */ jsx(InboxItemSkeleton, {
|
|
1570
|
+
density,
|
|
1571
|
+
leading,
|
|
1572
|
+
context
|
|
1573
|
+
}, index)) : null
|
|
1574
|
+
};
|
|
1575
|
+
return useRender({
|
|
1576
|
+
defaultTagName: "div",
|
|
1577
|
+
render,
|
|
1578
|
+
props: mergeProps(defaultProps, props)
|
|
1579
|
+
});
|
|
1580
|
+
}
|
|
1581
|
+
/** Whether `delay` milliseconds have passed since mount; at once for `0`. */
|
|
1582
|
+
function useDelayPassed(delay) {
|
|
1583
|
+
const [passed, setPassed] = useState(false);
|
|
1584
|
+
useEffect(() => {
|
|
1585
|
+
if (delay <= 0) return;
|
|
1586
|
+
const timer = setTimeout(() => setPassed(true), delay);
|
|
1587
|
+
return () => clearTimeout(timer);
|
|
1588
|
+
}, [delay]);
|
|
1589
|
+
return passed || delay <= 0;
|
|
1590
|
+
}
|
|
1591
|
+
//#endregion
|
|
1592
|
+
//#region src/components/list-row/list-row-skeleton.tsx
|
|
1593
|
+
const listRowSkeleton = tv({ slots: {
|
|
1594
|
+
row: [
|
|
1595
|
+
"[--list-row-skeleton-title:45%] [--list-row-skeleton-description:75%]",
|
|
1596
|
+
"nth-[3n+2]:[--list-row-skeleton-title:35%] nth-[3n+2]:[--list-row-skeleton-description:60%]",
|
|
1597
|
+
"nth-[3n]:[--list-row-skeleton-title:55%] nth-[3n]:[--list-row-skeleton-description:70%]"
|
|
1598
|
+
],
|
|
1599
|
+
avatar: ["size-[35px] shrink-0"],
|
|
1600
|
+
icon: ["size-5 shrink-0"],
|
|
1601
|
+
bar: ["inline-block h-[0.75em] max-w-full align-middle"],
|
|
1602
|
+
titleBar: ["w-(--list-row-skeleton-title)"],
|
|
1603
|
+
descriptionBar: ["w-(--list-row-skeleton-description)"],
|
|
1604
|
+
metaBar: ["w-9"]
|
|
1605
|
+
} });
|
|
1606
|
+
/**
|
|
1607
|
+
* A placeholder for one `ListRow` while the list loads. It is a display-only
|
|
1608
|
+
* `ListRow` of the same `variant`, with a bar in its title, its time and its
|
|
1609
|
+
* description, so it is the loaded row's size and its divider sits in the
|
|
1610
|
+
* same place. Hidden from assistive technology: mark the region that stays
|
|
1611
|
+
* while the list loads, such as its `ListRowGroup`, `aria-busy`.
|
|
1612
|
+
*/
|
|
1613
|
+
function ListRowSkeleton({ variant = "default", leading = variant === "default", description = variant === "default", className, ...props }) {
|
|
1614
|
+
const slots = listRowSkeleton();
|
|
1615
|
+
const bar = (width) => /* @__PURE__ */ jsx(Skeleton, {
|
|
1616
|
+
variant: "line",
|
|
1617
|
+
className: slots.bar({ className: width })
|
|
1618
|
+
});
|
|
1619
|
+
return /* @__PURE__ */ jsxs(ListRow, {
|
|
1620
|
+
"aria-hidden": true,
|
|
1621
|
+
"data-skeleton": "",
|
|
1622
|
+
interactive: false,
|
|
1623
|
+
variant,
|
|
1624
|
+
...props,
|
|
1625
|
+
className: slots.row({ className }),
|
|
1626
|
+
children: [leading ? /* @__PURE__ */ jsx(Skeleton, { className: variant === "default" ? slots.avatar() : slots.icon() }) : null, /* @__PURE__ */ jsxs(ListRowBody, { children: [/* @__PURE__ */ jsxs(ListRowTop, { children: [/* @__PURE__ */ jsx(ListRowTitle, { children: bar(slots.titleBar()) }), variant === "default" ? /* @__PURE__ */ jsx(ListRowMeta, { children: bar(slots.metaBar()) }) : null] }), description ? /* @__PURE__ */ jsx(ListRowBottom, { children: /* @__PURE__ */ jsx(ListRowDescription, { children: bar(slots.descriptionBar()) }) }) : null] })]
|
|
1627
|
+
});
|
|
1628
|
+
}
|
|
1629
|
+
//#endregion
|
|
1494
1630
|
//#region src/components/meter/meter.tsx
|
|
1495
1631
|
const meter = tv({
|
|
1496
1632
|
slots: {
|
|
@@ -1614,4 +1750,4 @@ function MeterIndicator({ className, ...props }) {
|
|
|
1614
1750
|
});
|
|
1615
1751
|
}
|
|
1616
1752
|
//#endregion
|
|
1617
|
-
export { Dialog as AnnouncementDialog, AnnouncementDialogAction, AnnouncementDialogBody, DialogClose as AnnouncementDialogClose, AnnouncementDialogContent, AnnouncementDialogFooter, AnnouncementDialogHeader, AnnouncementDialogLabel, AnnouncementDialogPicture, AnnouncementDialogSecondaryAction, AnnouncementDialogText, AnnouncementDialogTitle, DialogTrigger as AnnouncementDialogTrigger, COMMENT_HIGHLIGHT, COMMENT_HIGHLIGHT_ACTIVE, ComboboxSelect, CommentCard, CommentCardMeta, CommentCardQuote, CommentCardTrigger, CommentEntry, CommentEntryAuthor, CommentEntryBody, CommentEntryHeader, CommentEntryTime, CommentMargin, CommentMarginItem, CommentMarker, DialogCommit, DialogFooterNote, DialogSheetBack, DialogSheetContent, DropdownMenuLinkItem, Ellipsis, EllipsisToggle, InboxItemLeadingBadge, MessageItemDelegatedAvatar, MessageItemDelegatedBy, MessageItemDelegatedByButton, MessageItemDelegatedByName, MessageListJumpControls, MessageListJumpPill, MessageListJumpPillDismiss, MessageListJumpPillGroup, MessageQuotedPreviewAuthorDelegatedBy, MessageReferenceIcon, Meter, MeterHeader, MeterIndicator, MeterLabel, MeterTrack, MeterValue, MobileNavServerItem, MobileNavServerPopover, MobileNavServerPopoverContent, MobileNavServerPopoverDestination, MobileNavServerPopoverDestinations, MobileNavServerPopoverGroup, MobileNavServerPopoverList, MobileNavServerPopoverRow, MobileNavServerPopoverRowBody, MobileNavServerPopoverRowDescription, MobileNavServerPopoverRowLabel, OverlayLayerProvider, PopoverActions, PopoverBody, PreviewCardActions, PreviewCardBody, PreviewCardEyebrow, PreviewCardFooter, PreviewCardMeta, resolveCommentMarginLayout, setCommentHighlights, useCommentMarginFits, useHoldThenMoveTouchSensor, useParentOverlayKind, useTruncated };
|
|
1753
|
+
export { Dialog as AnnouncementDialog, AnnouncementDialogAction, AnnouncementDialogBody, DialogClose as AnnouncementDialogClose, AnnouncementDialogContent, AnnouncementDialogFooter, AnnouncementDialogHeader, AnnouncementDialogLabel, AnnouncementDialogPicture, AnnouncementDialogSecondaryAction, AnnouncementDialogText, AnnouncementDialogTitle, DialogTrigger as AnnouncementDialogTrigger, COMMENT_HIGHLIGHT, COMMENT_HIGHLIGHT_ACTIVE, ComboboxSelect, CommentCard, CommentCardMeta, CommentCardQuote, CommentCardTrigger, CommentEntry, CommentEntryAuthor, CommentEntryBody, CommentEntryHeader, CommentEntryTime, CommentMargin, CommentMarginItem, CommentMarker, DialogCommit, DialogFooterNote, DialogSheetBack, DialogSheetContent, DropdownMenuLinkItem, Ellipsis, EllipsisToggle, InboxItemLeadingBadge, InboxItemSkeleton, InboxItemSkeletonList, ListRowSkeleton, MessageItemDelegatedAvatar, MessageItemDelegatedBy, MessageItemDelegatedByButton, MessageItemDelegatedByName, MessageListJumpControls, MessageListJumpPill, MessageListJumpPillDismiss, MessageListJumpPillGroup, MessageQuotedPreviewAuthorDelegatedBy, MessageReferenceIcon, MessageReferenceReadMark, Meter, MeterHeader, MeterIndicator, MeterLabel, MeterTrack, MeterValue, MobileNavServerItem, MobileNavServerPopover, MobileNavServerPopoverContent, MobileNavServerPopoverDestination, MobileNavServerPopoverDestinations, MobileNavServerPopoverGroup, MobileNavServerPopoverList, MobileNavServerPopoverRow, MobileNavServerPopoverRowBody, MobileNavServerPopoverRowDescription, MobileNavServerPopoverRowLabel, OverlayLayerProvider, PopoverActions, PopoverBody, PreviewCardActions, PreviewCardBody, PreviewCardEyebrow, PreviewCardFooter, PreviewCardMeta, resolveCommentMarginLayout, setCommentHighlights, useCommentMarginFits, useHoldThenMoveTouchSensor, useParentOverlayKind, useTruncated };
|