@nebutra/ui 0.2.2 → 0.2.3
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/{canonical-CrO71UPO.d.ts → canonical-Drca5UMj.d.ts} +354 -103
- package/dist/components/index.js +289 -103
- package/dist/components/index.js.map +1 -1
- package/dist/layout/index.d.ts +2 -2
- package/dist/layout/index.js +110 -21
- package/dist/layout/index.js.map +1 -1
- package/dist/layouts/index.d.ts +80 -2
- package/dist/layouts/index.js +22 -11
- package/dist/layouts/index.js.map +1 -1
- package/dist/patterns/index.d.ts +3 -3
- package/dist/patterns/index.js +149 -53
- package/dist/patterns/index.js.map +1 -1
- package/dist/primitives/canonical.d.ts +2 -2
- package/dist/primitives/canonical.js +507 -141
- package/dist/primitives/canonical.js.map +1 -1
- package/dist/primitives/index.d.ts +138 -20
- package/dist/primitives/index.js +1415 -847
- package/dist/primitives/index.js.map +1 -1
- package/dist/typography/fonts.css +21 -26
- package/dist/utils/index.d.ts +31 -1
- package/dist/utils/index.js +10 -1
- package/dist/utils/index.js.map +1 -1
- package/package.json +23 -7
- package/src/styles/sources.css +10 -0
- package/src/typography/fonts.css +21 -26
package/dist/components/index.js
CHANGED
|
@@ -17,6 +17,7 @@ import { twMerge } from 'tailwind-merge';
|
|
|
17
17
|
import { cva } from 'class-variance-authority';
|
|
18
18
|
import { Tooltip as Tooltip$1 } from '@base-ui/react/tooltip';
|
|
19
19
|
import { useAsciiText, slant } from 'react-ascii-text';
|
|
20
|
+
import { Popover as Popover$1 } from '@base-ui/react/popover';
|
|
20
21
|
import { ReactFlowProvider, ReactFlow, Background, Controls, Panel, Handle, Position } from '@xyflow/react';
|
|
21
22
|
import '@xyflow/react/dist/style.css';
|
|
22
23
|
import { wouldCreateCycle } from '@nebutra/graph-model';
|
|
@@ -298,13 +299,15 @@ var primitiveFontSize = {
|
|
|
298
299
|
// src/tokens/shadows.ts
|
|
299
300
|
var shadowClasses = {
|
|
300
301
|
md: "shadow-md",
|
|
302
|
+
xl: "shadow-xl",
|
|
301
303
|
"2xl": "shadow-2xl"};
|
|
302
304
|
|
|
303
305
|
// src/tokens/components/overlay.ts
|
|
304
|
-
var overlayFocusRingClassName = "outline-none
|
|
306
|
+
var overlayFocusRingClassName = "outline-none";
|
|
305
307
|
var overlayZIndex = {
|
|
306
308
|
backdrop: 1040,
|
|
307
309
|
modal: 1050,
|
|
310
|
+
popover: 1060,
|
|
308
311
|
tooltip: 1070
|
|
309
312
|
};
|
|
310
313
|
var overlayClassNames = {
|
|
@@ -319,6 +322,13 @@ var overlayClassNames = {
|
|
|
319
322
|
"data-starting-style:scale-95 data-starting-style:opacity-0 data-ending-style:scale-95 data-ending-style:opacity-0",
|
|
320
323
|
"motion-reduce:transition-none motion-reduce:data-starting-style:transform-none motion-reduce:data-ending-style:transform-none"
|
|
321
324
|
].join(" "),
|
|
325
|
+
popoverSurface: [
|
|
326
|
+
"w-72 rounded-[var(--radius-lg)] border border-border/70 bg-popover/95 p-4 text-popover-foreground backdrop-blur-md",
|
|
327
|
+
shadowClasses.xl,
|
|
328
|
+
"outline-none transition-[opacity,transform,display] duration-[var(--motion-duration-flow)] ease-[var(--ease-out)]",
|
|
329
|
+
"data-[open]:opacity-100 data-[closed]:opacity-0 data-[closed]:scale-95 data-[open]:scale-100",
|
|
330
|
+
"motion-reduce:transition-none motion-reduce:data-[closed]:transform-none motion-reduce:data-[open]:transform-none"
|
|
331
|
+
].join(" "),
|
|
322
332
|
tooltipSurface: [
|
|
323
333
|
"overflow-hidden rounded-[var(--radius-md)] border border-border/70 bg-popover/95 px-3 py-1.5 text-sm text-popover-foreground backdrop-blur-md",
|
|
324
334
|
shadowClasses.md,
|
|
@@ -332,7 +342,8 @@ function cn(...inputs) {
|
|
|
332
342
|
return twMerge(clsx(inputs));
|
|
333
343
|
}
|
|
334
344
|
var overlayPrimitiveClassNames = {
|
|
335
|
-
modalSurface: "rounded-[var(--radius-md)] border-border/70 bg-popover/95 text-popover-foreground shadow-xl"
|
|
345
|
+
modalSurface: "rounded-[var(--radius-md)] border-border/70 bg-popover/95 text-popover-foreground shadow-xl",
|
|
346
|
+
popoverSurface: "rounded-[var(--radius-md)] border-border/70 bg-popover/95 shadow-md"};
|
|
336
347
|
var Dialog = Dialog$1.Root;
|
|
337
348
|
var DialogPortal = Dialog$1.Portal;
|
|
338
349
|
var DialogTrigger = ({
|
|
@@ -550,7 +561,6 @@ var buttonVariants = cva(
|
|
|
550
561
|
"rounded-[var(--btn-default-radius,var(--radius-md))]",
|
|
551
562
|
"text-[length:var(--control-font-size-md,0.875rem)] font-[number:var(--font-weight-medium,500)]",
|
|
552
563
|
"transition-colors duration-micro ease-out",
|
|
553
|
-
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
554
564
|
"disabled:pointer-events-none disabled:opacity-50",
|
|
555
565
|
"aria-busy:cursor-wait"
|
|
556
566
|
].join(" "),
|
|
@@ -577,8 +587,30 @@ var buttonVariants = cva(
|
|
|
577
587
|
},
|
|
578
588
|
shape: {
|
|
579
589
|
default: "",
|
|
580
|
-
|
|
581
|
-
|
|
590
|
+
// Radius from --btn-default-radius / --radius-md — brand-switchable.
|
|
591
|
+
// Do not hardcode rounded-md here; a language must be able to retarget
|
|
592
|
+
// the corner treatment of every icon trigger at once.
|
|
593
|
+
square: "rounded-[var(--btn-default-radius,var(--radius-md))]",
|
|
594
|
+
// Pill radius token, not Tailwind rounded-full — same 9999px default,
|
|
595
|
+
// but a brand that ships a softer "circle" can override --radius-pill.
|
|
596
|
+
circle: "rounded-[var(--radius-pill,9999px)]",
|
|
597
|
+
pill: "rounded-[var(--radius-pill,9999px)]"
|
|
598
|
+
},
|
|
599
|
+
// Icon-only box size — orthogonal to `size` (which tunes text-button
|
|
600
|
+
// height/padding/font together) and to `shape` (which picks the
|
|
601
|
+
// corner treatment). Only takes effect combined with shape="square"
|
|
602
|
+
// or shape="circle" (see compoundVariants below); every other
|
|
603
|
+
// combination ignores it. 28/32/36 cover the icon-trigger sizes that
|
|
604
|
+
// actually occur in the app — 24/40/48 are already reachable via
|
|
605
|
+
// shape + size (tiny/default/lg). Heights read --control-height-icon-*
|
|
606
|
+
// so density-aware Brand Packages can scale them with the ladder.
|
|
607
|
+
iconSize: {
|
|
608
|
+
sm: "",
|
|
609
|
+
// 28px default
|
|
610
|
+
md: "",
|
|
611
|
+
// 32px default
|
|
612
|
+
lg: ""
|
|
613
|
+
// 36px default
|
|
582
614
|
}
|
|
583
615
|
},
|
|
584
616
|
compoundVariants: [
|
|
@@ -589,22 +621,56 @@ var buttonVariants = cva(
|
|
|
589
621
|
{
|
|
590
622
|
shape: "circle",
|
|
591
623
|
size: "tiny",
|
|
592
|
-
className: "w-[var(--control-height-tiny,1.5rem)] px-0
|
|
624
|
+
className: "w-[var(--control-height-tiny,1.5rem)] px-0"
|
|
593
625
|
},
|
|
594
626
|
{
|
|
595
627
|
shape: "circle",
|
|
596
628
|
size: "sm",
|
|
597
|
-
className: "w-[var(--control-height-sm,2rem)] px-0
|
|
629
|
+
className: "w-[var(--control-height-sm,2rem)] px-0"
|
|
598
630
|
},
|
|
599
631
|
{
|
|
600
632
|
shape: "circle",
|
|
601
633
|
size: "default",
|
|
602
|
-
className: "w-[var(--control-height-md,2.5rem)] px-0
|
|
634
|
+
className: "w-[var(--control-height-md,2.5rem)] px-0"
|
|
603
635
|
},
|
|
604
636
|
{
|
|
605
637
|
shape: "circle",
|
|
606
638
|
size: "lg",
|
|
607
|
-
className: "w-[var(--control-height-lg,3rem)] px-0
|
|
639
|
+
className: "w-[var(--control-height-lg,3rem)] px-0"
|
|
640
|
+
},
|
|
641
|
+
// iconSize wins over the size-driven box above — matched on shape +
|
|
642
|
+
// iconSize only, so it applies regardless of whatever `size` was
|
|
643
|
+
// passed (or left at its "default" fallback). Corner treatment stays
|
|
644
|
+
// on the shape variant (token-backed); only the box is set here.
|
|
645
|
+
{
|
|
646
|
+
shape: "square",
|
|
647
|
+
iconSize: "sm",
|
|
648
|
+
className: "h-[var(--control-height-icon-sm,1.75rem)] w-[var(--control-height-icon-sm,1.75rem)] px-0"
|
|
649
|
+
},
|
|
650
|
+
{
|
|
651
|
+
shape: "square",
|
|
652
|
+
iconSize: "md",
|
|
653
|
+
className: "h-[var(--control-height-icon-md,2rem)] w-[var(--control-height-icon-md,2rem)] px-0"
|
|
654
|
+
},
|
|
655
|
+
{
|
|
656
|
+
shape: "square",
|
|
657
|
+
iconSize: "lg",
|
|
658
|
+
className: "h-[var(--control-height-icon-lg,2.25rem)] w-[var(--control-height-icon-lg,2.25rem)] px-0"
|
|
659
|
+
},
|
|
660
|
+
{
|
|
661
|
+
shape: "circle",
|
|
662
|
+
iconSize: "sm",
|
|
663
|
+
className: "h-[var(--control-height-icon-sm,1.75rem)] w-[var(--control-height-icon-sm,1.75rem)] px-0"
|
|
664
|
+
},
|
|
665
|
+
{
|
|
666
|
+
shape: "circle",
|
|
667
|
+
iconSize: "md",
|
|
668
|
+
className: "h-[var(--control-height-icon-md,2rem)] w-[var(--control-height-icon-md,2rem)] px-0"
|
|
669
|
+
},
|
|
670
|
+
{
|
|
671
|
+
shape: "circle",
|
|
672
|
+
iconSize: "lg",
|
|
673
|
+
className: "h-[var(--control-height-icon-lg,2.25rem)] w-[var(--control-height-icon-lg,2.25rem)] px-0"
|
|
608
674
|
}
|
|
609
675
|
],
|
|
610
676
|
defaultVariants: {
|
|
@@ -626,7 +692,10 @@ function Spinner({ className }) {
|
|
|
626
692
|
}
|
|
627
693
|
);
|
|
628
694
|
}
|
|
629
|
-
function getIconSizeClass(size) {
|
|
695
|
+
function getIconSizeClass(size, iconSize) {
|
|
696
|
+
if (iconSize === "sm") return "[&>svg]:size-3.5";
|
|
697
|
+
if (iconSize === "md") return "[&>svg]:size-3.5";
|
|
698
|
+
if (iconSize === "lg") return "[&>svg]:size-4";
|
|
630
699
|
switch (size) {
|
|
631
700
|
case "tiny":
|
|
632
701
|
return "[&>svg]:size-3";
|
|
@@ -641,7 +710,10 @@ function getIconSizeClass(size) {
|
|
|
641
710
|
return "[&>svg]:size-4";
|
|
642
711
|
}
|
|
643
712
|
}
|
|
644
|
-
function getSpinnerSizeClass(size) {
|
|
713
|
+
function getSpinnerSizeClass(size, iconSize) {
|
|
714
|
+
if (iconSize === "sm") return "size-3.5";
|
|
715
|
+
if (iconSize === "md") return "size-3.5";
|
|
716
|
+
if (iconSize === "lg") return "size-4";
|
|
645
717
|
switch (size) {
|
|
646
718
|
case "tiny":
|
|
647
719
|
return "size-3";
|
|
@@ -666,10 +738,10 @@ function resolveShadowClass(shadow) {
|
|
|
666
738
|
const level = shadow === true ? "md" : shadow;
|
|
667
739
|
return SHADOW_CLASSES[level];
|
|
668
740
|
}
|
|
669
|
-
function ButtonContent({ loading, prefix, suffix, size, children }) {
|
|
670
|
-
const iconSizeClass = getIconSizeClass(size);
|
|
741
|
+
function ButtonContent({ loading, prefix, suffix, size, iconSize, children }) {
|
|
742
|
+
const iconSizeClass = getIconSizeClass(size, iconSize);
|
|
671
743
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
672
|
-
loading && /* @__PURE__ */ jsx(Spinner, { className: getSpinnerSizeClass(size) }),
|
|
744
|
+
loading && /* @__PURE__ */ jsx(Spinner, { className: getSpinnerSizeClass(size, iconSize) }),
|
|
673
745
|
prefix != null && /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: cn("shrink-0", iconSizeClass), children: prefix }),
|
|
674
746
|
children,
|
|
675
747
|
suffix != null && /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: cn("shrink-0", iconSizeClass), children: suffix })
|
|
@@ -680,6 +752,7 @@ var Button = ({
|
|
|
680
752
|
variant,
|
|
681
753
|
size,
|
|
682
754
|
shape,
|
|
755
|
+
iconSize,
|
|
683
756
|
asChild = false,
|
|
684
757
|
loading = false,
|
|
685
758
|
disabled,
|
|
@@ -697,11 +770,21 @@ var Button = ({
|
|
|
697
770
|
Comp,
|
|
698
771
|
{
|
|
699
772
|
ref,
|
|
700
|
-
className: cn(buttonVariants({ variant, size, shape }), shadowClass, className),
|
|
773
|
+
className: cn(buttonVariants({ variant, size, shape, iconSize }), shadowClass, className),
|
|
701
774
|
disabled: isDisabled,
|
|
702
775
|
"aria-busy": loading || void 0,
|
|
703
776
|
...props,
|
|
704
|
-
children: asChild ? children : /* @__PURE__ */ jsx(
|
|
777
|
+
children: asChild ? children : /* @__PURE__ */ jsx(
|
|
778
|
+
ButtonContent,
|
|
779
|
+
{
|
|
780
|
+
loading,
|
|
781
|
+
prefix,
|
|
782
|
+
suffix,
|
|
783
|
+
size,
|
|
784
|
+
iconSize,
|
|
785
|
+
children
|
|
786
|
+
}
|
|
787
|
+
)
|
|
705
788
|
}
|
|
706
789
|
);
|
|
707
790
|
};
|
|
@@ -736,6 +819,12 @@ var textareaTokens = {
|
|
|
736
819
|
focusRingWidth: 3,
|
|
737
820
|
fieldGap: primitiveSpacing[2] - primitiveSpacing[1] / 2};
|
|
738
821
|
|
|
822
|
+
// src/utils/primitive-props.ts
|
|
823
|
+
function asPlainStyle(style) {
|
|
824
|
+
if (style == null || typeof style === "function") return {};
|
|
825
|
+
return style;
|
|
826
|
+
}
|
|
827
|
+
|
|
739
828
|
// src/primitives/form-control.ts
|
|
740
829
|
var formControlFocusClassNames = {
|
|
741
830
|
input: "outline-none focus:border-ring focus:ring-[length:var(--input-focus-ring-width)] focus:ring-ring/30",
|
|
@@ -756,7 +845,7 @@ function getTextareaStyle(size, style) {
|
|
|
756
845
|
"--textarea-focus-ring-width": `${textareaTokens.focusRingWidth}px`,
|
|
757
846
|
borderRadius: "var(--textarea-radius)",
|
|
758
847
|
outline: "none",
|
|
759
|
-
...style
|
|
848
|
+
...asPlainStyle(style)
|
|
760
849
|
};
|
|
761
850
|
}
|
|
762
851
|
function getTextareaFieldStyle() {
|
|
@@ -1040,7 +1129,7 @@ var PromptInputTextarea = ({ className, onKeyDown, disableAutosize = false, plac
|
|
|
1040
1129
|
onKeyDown: handleKeyDown,
|
|
1041
1130
|
rows: 1,
|
|
1042
1131
|
style: { "--textarea-min-height": "2rem", ...style },
|
|
1043
|
-
className: cn("resize-none border-0 shadow-none
|
|
1132
|
+
className: cn("resize-none border-0 shadow-none", className),
|
|
1044
1133
|
disabled,
|
|
1045
1134
|
placeholder,
|
|
1046
1135
|
...props
|
|
@@ -1240,7 +1329,7 @@ function PromptSubmitAction({
|
|
|
1240
1329
|
variant: "default",
|
|
1241
1330
|
size: "icon",
|
|
1242
1331
|
className: cn(
|
|
1243
|
-
"h-8 w-8 rounded-full transition-[background-color,border-color,box-shadow,color,opacity,transform] duration-
|
|
1332
|
+
"h-8 w-8 rounded-full transition-[background-color,border-color,box-shadow,color,opacity,transform] duration-micro",
|
|
1244
1333
|
isRecording ? "bg-transparent hover:bg-accent text-destructive hover:text-destructive/80" : hasContent ? "bg-primary hover:bg-primary/90 text-primary-foreground" : "bg-transparent hover:bg-accent text-muted-foreground hover:text-foreground"
|
|
1245
1334
|
),
|
|
1246
1335
|
onClick: onActivate,
|
|
@@ -1599,6 +1688,93 @@ function AsciiText({ text, className = "", font = slant }) {
|
|
|
1599
1688
|
}
|
|
1600
1689
|
);
|
|
1601
1690
|
}
|
|
1691
|
+
function Popover({ ...props }) {
|
|
1692
|
+
return /* @__PURE__ */ jsx(Popover$1.Root, { "data-slot": "popover", ...props });
|
|
1693
|
+
}
|
|
1694
|
+
function PopoverTrigger({ asChild, children, render, ...props }) {
|
|
1695
|
+
const renderElement = asChild && React5.isValidElement(children) ? children : render;
|
|
1696
|
+
return /* @__PURE__ */ jsx(
|
|
1697
|
+
Popover$1.Trigger,
|
|
1698
|
+
{
|
|
1699
|
+
"data-slot": "popover-trigger",
|
|
1700
|
+
render: renderElement,
|
|
1701
|
+
...renderElement ? props : { ...props, children }
|
|
1702
|
+
}
|
|
1703
|
+
);
|
|
1704
|
+
}
|
|
1705
|
+
function PopoverContent({
|
|
1706
|
+
className,
|
|
1707
|
+
align = "center",
|
|
1708
|
+
sideOffset = 8,
|
|
1709
|
+
alignOffset = 0,
|
|
1710
|
+
side = "bottom",
|
|
1711
|
+
children,
|
|
1712
|
+
showArrow = false,
|
|
1713
|
+
style,
|
|
1714
|
+
...props
|
|
1715
|
+
}) {
|
|
1716
|
+
return /* @__PURE__ */ jsx(Popover$1.Portal, { children: /* @__PURE__ */ jsx(
|
|
1717
|
+
Popover$1.Positioner,
|
|
1718
|
+
{
|
|
1719
|
+
"data-slot": "popover-positioner",
|
|
1720
|
+
sideOffset,
|
|
1721
|
+
align,
|
|
1722
|
+
alignOffset,
|
|
1723
|
+
side,
|
|
1724
|
+
children: /* @__PURE__ */ jsxs(
|
|
1725
|
+
Popover$1.Popup,
|
|
1726
|
+
{
|
|
1727
|
+
"data-slot": "popover-content",
|
|
1728
|
+
className: cn(
|
|
1729
|
+
overlayClassNames.popoverSurface,
|
|
1730
|
+
overlayPrimitiveClassNames.popoverSurface,
|
|
1731
|
+
className
|
|
1732
|
+
),
|
|
1733
|
+
style: { zIndex: overlayZIndex.popover, ...style },
|
|
1734
|
+
...props,
|
|
1735
|
+
children: [
|
|
1736
|
+
children,
|
|
1737
|
+
showArrow && /* @__PURE__ */ jsx(PopoverArrow, {})
|
|
1738
|
+
]
|
|
1739
|
+
}
|
|
1740
|
+
)
|
|
1741
|
+
}
|
|
1742
|
+
) });
|
|
1743
|
+
}
|
|
1744
|
+
function PopoverArrow({
|
|
1745
|
+
className,
|
|
1746
|
+
style,
|
|
1747
|
+
...props
|
|
1748
|
+
}) {
|
|
1749
|
+
return /* @__PURE__ */ jsx(
|
|
1750
|
+
Popover$1.Arrow,
|
|
1751
|
+
{
|
|
1752
|
+
"data-slot": "popover-arrow",
|
|
1753
|
+
className: cn(
|
|
1754
|
+
"data-[side=bottom]:top-[-8px] data-[side=left]:right-[-13px] data-[side=left]:rotate-90 data-[side=right]:left-[-13px] data-[side=right]:-rotate-90 data-[side=top]:bottom-[-8px] data-[side=top]:rotate-180",
|
|
1755
|
+
className
|
|
1756
|
+
),
|
|
1757
|
+
style: { zIndex: overlayZIndex.popover, ...style },
|
|
1758
|
+
...props,
|
|
1759
|
+
children: /* @__PURE__ */ jsxs("svg", { "aria-hidden": "true", width: "20", height: "10", viewBox: "0 0 20 10", fill: "none", children: [
|
|
1760
|
+
/* @__PURE__ */ jsx(
|
|
1761
|
+
"path",
|
|
1762
|
+
{
|
|
1763
|
+
d: "M9.66437 2.60207L4.80758 6.97318C4.07308 7.63423 3.11989 8 2.13172 8H0V9H20V8H18.5349C17.5468 8 16.5936 7.63423 15.8591 6.97318L11.0023 2.60207C10.622 2.2598 10.0447 2.25979 9.66437 2.60207Z",
|
|
1764
|
+
className: "fill-popover"
|
|
1765
|
+
}
|
|
1766
|
+
),
|
|
1767
|
+
/* @__PURE__ */ jsx(
|
|
1768
|
+
"path",
|
|
1769
|
+
{
|
|
1770
|
+
d: "M10.3333 3.34539L5.47654 7.71648C4.55842 8.54279 3.36693 9 2.13172 9H0V8H2.13172C3.11989 8 4.07308 7.63423 4.80758 6.97318L9.66437 2.60207C10.0447 2.25979 10.622 2.2598 11.0023 2.60207L15.8591 6.97318C16.5936 7.63423 17.5468 8 18.5349 8H20V9H18.5349C17.2998 9 16.1083 8.54278 15.1901 7.71648L10.3333 3.34539Z",
|
|
1771
|
+
className: "fill-border"
|
|
1772
|
+
}
|
|
1773
|
+
)
|
|
1774
|
+
] })
|
|
1775
|
+
}
|
|
1776
|
+
);
|
|
1777
|
+
}
|
|
1602
1778
|
var TAG_COLOR_MAP = {
|
|
1603
1779
|
feature: "bg-[hsl(var(--primary))] text-white",
|
|
1604
1780
|
fix: "bg-[var(--status-success)] text-white",
|
|
@@ -1623,93 +1799,81 @@ function ChangelogWidget({
|
|
|
1623
1799
|
}) {
|
|
1624
1800
|
const [isOpen, setIsOpen] = React5.useState(false);
|
|
1625
1801
|
const [lastSeenVersion, setLastSeenVersion] = React5.useState(null);
|
|
1626
|
-
const dropdownRef = React5.useRef(null);
|
|
1627
1802
|
const unreadCount = getUnreadCount(entries, lastSeenVersion);
|
|
1628
1803
|
const recentEntries = entries.slice(0, 5);
|
|
1629
1804
|
const latestVersion = recentEntries[0]?.version ?? null;
|
|
1630
|
-
const
|
|
1631
|
-
setIsOpen(
|
|
1632
|
-
if (latestVersion) setLastSeenVersion(latestVersion);
|
|
1805
|
+
const handleOpenChange = (open) => {
|
|
1806
|
+
setIsOpen(open);
|
|
1807
|
+
if (!open && latestVersion) setLastSeenVersion(latestVersion);
|
|
1633
1808
|
};
|
|
1634
|
-
|
|
1635
|
-
closeAndMarkSeen();
|
|
1636
|
-
});
|
|
1637
|
-
React5.useEffect(() => {
|
|
1638
|
-
if (!isOpen) return;
|
|
1639
|
-
const handleEscape = (e) => {
|
|
1640
|
-
if (e.key === "Escape") closeFromDocumentEvent();
|
|
1641
|
-
};
|
|
1642
|
-
const handleClickOutside = (e) => {
|
|
1643
|
-
if (dropdownRef.current && !dropdownRef.current.contains(e.target)) {
|
|
1644
|
-
closeFromDocumentEvent();
|
|
1645
|
-
}
|
|
1646
|
-
};
|
|
1647
|
-
document.addEventListener("keydown", handleEscape);
|
|
1648
|
-
document.addEventListener("mousedown", handleClickOutside);
|
|
1649
|
-
return () => {
|
|
1650
|
-
document.removeEventListener("keydown", handleEscape);
|
|
1651
|
-
document.removeEventListener("mousedown", handleClickOutside);
|
|
1652
|
-
};
|
|
1653
|
-
}, [isOpen]);
|
|
1654
|
-
return /* @__PURE__ */ jsxs("div", { className: cn("relative", className), ref: dropdownRef, children: [
|
|
1809
|
+
return /* @__PURE__ */ jsxs(Popover, { open: isOpen, onOpenChange: handleOpenChange, children: [
|
|
1655
1810
|
/* @__PURE__ */ jsxs(
|
|
1656
|
-
|
|
1811
|
+
PopoverTrigger,
|
|
1657
1812
|
{
|
|
1658
|
-
type: "button",
|
|
1659
1813
|
"aria-label": "View changelog",
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1814
|
+
className: cn(
|
|
1815
|
+
"relative inline-flex items-center justify-center rounded-[var(--radius-lg)] p-2 transition-colors hover:bg-muted",
|
|
1816
|
+
className
|
|
1817
|
+
),
|
|
1663
1818
|
children: [
|
|
1664
1819
|
/* @__PURE__ */ jsx(Bell, { className: "h-5 w-5 text-muted-foreground" }),
|
|
1665
1820
|
unreadCount > 0 && /* @__PURE__ */ jsx("span", { className: "absolute right-0 top-0 flex h-5 w-5 items-center justify-center rounded-full bg-[var(--status-danger)] text-xs font-bold text-white", children: unreadCount > 9 ? "9+" : unreadCount })
|
|
1666
1821
|
]
|
|
1667
1822
|
}
|
|
1668
1823
|
),
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
"
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
{
|
|
1685
|
-
className:
|
|
1686
|
-
"
|
|
1687
|
-
|
|
1688
|
-
),
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1824
|
+
/* @__PURE__ */ jsxs(
|
|
1825
|
+
PopoverContent,
|
|
1826
|
+
{
|
|
1827
|
+
align: "end",
|
|
1828
|
+
side: "bottom",
|
|
1829
|
+
sideOffset: 8,
|
|
1830
|
+
className: "w-80 overflow-hidden rounded-[var(--radius-lg)] border-border bg-white p-0 shadow-lg",
|
|
1831
|
+
children: [
|
|
1832
|
+
/* @__PURE__ */ jsx("div", { className: "bg-gradient-to-r from-[var(--blue-3)] to-[var(--cyan-3)] px-4 py-3", children: /* @__PURE__ */ jsx("h3", { className: "font-semibold text-foreground", children: "What's New" }) }),
|
|
1833
|
+
/* @__PURE__ */ jsx("div", { className: "max-h-96 overflow-y-auto", children: recentEntries.length === 0 ? /* @__PURE__ */ jsx("div", { className: "px-4 py-6 text-center text-sm text-muted-foreground", children: "No updates available" }) : recentEntries.map((entry) => /* @__PURE__ */ jsxs(
|
|
1834
|
+
"a",
|
|
1835
|
+
{
|
|
1836
|
+
href: entry.url,
|
|
1837
|
+
className: "block border-b border-border px-4 py-3 transition-colors hover:bg-muted",
|
|
1838
|
+
children: [
|
|
1839
|
+
/* @__PURE__ */ jsx("div", { className: "mb-2 flex items-center justify-between gap-2", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
1840
|
+
/* @__PURE__ */ jsxs("span", { className: "font-mono text-xs font-bold text-primary", children: [
|
|
1841
|
+
"v",
|
|
1842
|
+
entry.version
|
|
1843
|
+
] }),
|
|
1844
|
+
entry.tag && /* @__PURE__ */ jsx(
|
|
1845
|
+
"span",
|
|
1846
|
+
{
|
|
1847
|
+
className: cn(
|
|
1848
|
+
"rounded px-2 py-0.5 text-xs font-medium",
|
|
1849
|
+
getTagColor(entry.tag)
|
|
1850
|
+
),
|
|
1851
|
+
children: entry.tag
|
|
1852
|
+
}
|
|
1853
|
+
)
|
|
1854
|
+
] }) }),
|
|
1855
|
+
/* @__PURE__ */ jsx("p", { className: "mb-1 text-sm font-medium text-foreground", children: entry.title }),
|
|
1856
|
+
/* @__PURE__ */ jsx("p", { className: "mb-2 line-clamp-2 text-xs text-muted-foreground", children: entry.excerpt }),
|
|
1857
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: entry.date })
|
|
1858
|
+
]
|
|
1859
|
+
},
|
|
1860
|
+
entry.version
|
|
1861
|
+
)) }),
|
|
1862
|
+
/* @__PURE__ */ jsxs(
|
|
1863
|
+
"a",
|
|
1864
|
+
{
|
|
1865
|
+
href: changelogUrl,
|
|
1866
|
+
onClick: () => handleOpenChange(false),
|
|
1867
|
+
className: "flex items-center justify-between border-t border-border bg-background px-4 py-3 text-sm font-medium text-primary transition-colors hover:bg-muted",
|
|
1868
|
+
children: [
|
|
1869
|
+
/* @__PURE__ */ jsx("span", { children: "View all updates" }),
|
|
1870
|
+
/* @__PURE__ */ jsx(ChevronRight, { className: "h-4 w-4" })
|
|
1871
|
+
]
|
|
1872
|
+
}
|
|
1873
|
+
)
|
|
1874
|
+
]
|
|
1875
|
+
}
|
|
1876
|
+
)
|
|
1713
1877
|
] });
|
|
1714
1878
|
}
|
|
1715
1879
|
var GRAPH_NODE_FLOW_TYPE = "graph-node";
|
|
@@ -1997,7 +2161,7 @@ function OnboardingChecklist({
|
|
|
1997
2161
|
"a",
|
|
1998
2162
|
{
|
|
1999
2163
|
href: item.helperLink.href,
|
|
2000
|
-
className: "text-primary underline-offset-4 hover:underline
|
|
2164
|
+
className: "text-primary underline-offset-4 hover:underline rounded-[var(--radius-sm)]",
|
|
2001
2165
|
children: item.helperLink.text
|
|
2002
2166
|
}
|
|
2003
2167
|
)
|
|
@@ -2014,7 +2178,8 @@ function OnboardingChecklist({
|
|
|
2014
2178
|
"button",
|
|
2015
2179
|
{
|
|
2016
2180
|
type: "button",
|
|
2017
|
-
|
|
2181
|
+
"aria-label": "Play the video guide",
|
|
2182
|
+
className: "w-full h-full rounded-[var(--radius-lg)]",
|
|
2018
2183
|
children: [
|
|
2019
2184
|
/* @__PURE__ */ jsx(
|
|
2020
2185
|
Image,
|
|
@@ -2181,11 +2346,11 @@ var Kbd = ({
|
|
|
2181
2346
|
Kbd.displayName = "Kbd";
|
|
2182
2347
|
var inputVariants = cva(
|
|
2183
2348
|
[
|
|
2184
|
-
"flex h-[var(--input-height)] w-full rounded-[var(--input-radius)]
|
|
2185
|
-
"px-[var(--input-padding-x)] text-[length:var(--input-font-size)] text-foreground
|
|
2349
|
+
"flex h-[var(--input-height)] w-full rounded-[var(--input-radius)]",
|
|
2350
|
+
"px-[var(--input-padding-x)] text-[length:var(--input-font-size)] text-foreground",
|
|
2186
2351
|
"transition-[background-color,border-color,box-shadow,color] duration-micro ease-out",
|
|
2187
2352
|
"placeholder:text-muted-foreground",
|
|
2188
|
-
|
|
2353
|
+
"outline-none",
|
|
2189
2354
|
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
2190
2355
|
"read-only:bg-muted/70 read-only:cursor-default",
|
|
2191
2356
|
"file:h-full file:border-0 file:border-e file:border-solid file:border-input file:bg-transparent",
|
|
@@ -2208,11 +2373,31 @@ var inputVariants = cva(
|
|
|
2208
2373
|
prefix: "pl-[var(--input-padding-left)]",
|
|
2209
2374
|
suffix: "pr-[var(--input-padding-right)]",
|
|
2210
2375
|
both: "pl-[var(--input-padding-left)] pr-[var(--input-padding-right)]"
|
|
2376
|
+
},
|
|
2377
|
+
/**
|
|
2378
|
+
* `bare` drops the field's own stroke, fill and lift so it can sit inside
|
|
2379
|
+
* a container that already provides them — a footer subscribe group, a
|
|
2380
|
+
* search well, a segmented composer. Those surfaces were each being built
|
|
2381
|
+
* by hand with a raw <input>, because overriding the bordered look from
|
|
2382
|
+
* outside is not reliable: `border-transparent` passed via className and
|
|
2383
|
+
* `border-input` from the base are both border-color utilities, so which
|
|
2384
|
+
* one wins depends on their order in the generated stylesheet rather than
|
|
2385
|
+
* on the order they were written. That is why the stroke, fill and shadow
|
|
2386
|
+
* live in this variant instead of the base — the two tones now never emit
|
|
2387
|
+
* a competing declaration.
|
|
2388
|
+
*
|
|
2389
|
+
* A bare field draws no focus ring of its own. The container owns it, so
|
|
2390
|
+
* the ring surrounds the whole group rather than a box inside it.
|
|
2391
|
+
*/
|
|
2392
|
+
tone: {
|
|
2393
|
+
bordered: `border border-input bg-background shadow-xs ${formControlFocusClassNames.input}`,
|
|
2394
|
+
bare: "border-0 bg-transparent shadow-none"
|
|
2211
2395
|
}
|
|
2212
2396
|
},
|
|
2213
2397
|
defaultVariants: {
|
|
2214
2398
|
size: "md",
|
|
2215
|
-
affix: "none"
|
|
2399
|
+
affix: "none",
|
|
2400
|
+
tone: "bordered"
|
|
2216
2401
|
}
|
|
2217
2402
|
}
|
|
2218
2403
|
);
|
|
@@ -2235,7 +2420,7 @@ var inputControlButtonVariants = cva(
|
|
|
2235
2420
|
"absolute right-[var(--input-control-inset)] top-1/2 flex size-[var(--input-control-size)] -translate-y-1/2 items-center justify-center",
|
|
2236
2421
|
"rounded-[var(--radius-sm)] text-muted-foreground transition-colors duration-micro ease-out",
|
|
2237
2422
|
"hover:bg-accent hover:text-foreground",
|
|
2238
|
-
"focus-visible:outline-none
|
|
2423
|
+
"focus-visible:outline-none",
|
|
2239
2424
|
"disabled:pointer-events-none disabled:opacity-50",
|
|
2240
2425
|
"[&_svg]:size-[var(--input-control-icon-size)]"
|
|
2241
2426
|
].join(" ")
|
|
@@ -2274,7 +2459,7 @@ function getInputStyle(size, style) {
|
|
|
2274
2459
|
"--input-focus-ring-width": `${inputTokens.focusRingWidth}px`,
|
|
2275
2460
|
borderRadius: "var(--input-radius)",
|
|
2276
2461
|
outline: "none",
|
|
2277
|
-
...style
|
|
2462
|
+
...asPlainStyle(style)
|
|
2278
2463
|
};
|
|
2279
2464
|
}
|
|
2280
2465
|
function getAffixMode(prefix, hasRightAdornment) {
|
|
@@ -2300,6 +2485,7 @@ var Input = ({
|
|
|
2300
2485
|
className,
|
|
2301
2486
|
type = "text",
|
|
2302
2487
|
size = "md",
|
|
2488
|
+
tone = "bordered",
|
|
2303
2489
|
prefix,
|
|
2304
2490
|
suffix,
|
|
2305
2491
|
clearable,
|
|
@@ -2419,7 +2605,7 @@ var Input = ({
|
|
|
2419
2605
|
"aria-describedby": describedBy,
|
|
2420
2606
|
"aria-busy": loading || void 0,
|
|
2421
2607
|
className: cn(
|
|
2422
|
-
inputVariants({ size, affix }),
|
|
2608
|
+
inputVariants({ size, affix, tone }),
|
|
2423
2609
|
type === "file" && "p-0 pr-[var(--input-padding-x)] text-muted-foreground",
|
|
2424
2610
|
className
|
|
2425
2611
|
),
|
|
@@ -2585,7 +2771,7 @@ function TeamChat({
|
|
|
2585
2771
|
"div",
|
|
2586
2772
|
{
|
|
2587
2773
|
className: cn(
|
|
2588
|
-
"w-full max-w-
|
|
2774
|
+
"w-full max-w-[var(--container-content)] mx-auto p-6 bg-white dark:bg-black rounded-[var(--radius-3xl)] shadow-lg flex flex-col h-[550px] border border-border",
|
|
2589
2775
|
className
|
|
2590
2776
|
),
|
|
2591
2777
|
children: [
|