@nexub/react 1.5.0 → 1.6.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/{chunk-XR4NBY54.js → chunk-2DYKENBM.js} +10 -10
- package/dist/{chunk-SVQCINRE.js → chunk-2I7FIU6R.js} +5 -2
- package/dist/{chunk-FHFVBOF3.js → chunk-2Y4WLNEZ.js} +3 -3
- package/dist/{chunk-CWS37T3K.js → chunk-3E7X3YK3.js} +4 -2
- package/dist/{chunk-GRB6T2TT.js → chunk-3FPJIXG7.js} +19 -13
- package/dist/chunk-3MT23LNM.js +171 -0
- package/dist/chunk-3QD76BKT.js +80 -0
- package/dist/{chunk-B54WADL4.js → chunk-4P2JJ2FH.js} +12 -12
- package/dist/chunk-52ZVJPF7.js +1 -0
- package/dist/chunk-5KI4YHA3.js +144 -0
- package/dist/chunk-5QEARXY3.js +55 -0
- package/dist/chunk-5VW6RUKZ.js +134 -0
- package/dist/{chunk-CNNJFWFA.js → chunk-6BGUZQAX.js} +4 -4
- package/dist/{chunk-LDYD7WL3.js → chunk-6ECOCGZG.js} +4 -3
- package/dist/{chunk-3AXIMXDU.js → chunk-6JBQAJJD.js} +6 -12
- package/dist/{chunk-YRDCY6BI.js → chunk-6UKNUI46.js} +0 -19
- package/dist/chunk-743Y5MY3.js +95 -0
- package/dist/{chunk-BFRX6X4O.js → chunk-74RUJ5KZ.js} +23 -17
- package/dist/chunk-77LYWSJW.js +85 -0
- package/dist/{chunk-YPHNHQYQ.js → chunk-7B4VF2ZU.js} +6 -2
- package/dist/{chunk-NCRFKPA4.js → chunk-7MSIOYJZ.js} +6 -8
- package/dist/{chunk-AHT35UWY.js → chunk-7Q4T7CB6.js} +10 -6
- package/dist/{chunk-GIGOTRXX.js → chunk-7VJABRKB.js} +3 -10
- package/dist/{chunk-6QLLH6ID.js → chunk-7XWJCFWI.js} +8 -17
- package/dist/chunk-A3O23F2B.js +1 -0
- package/dist/chunk-AT2DSFP3.js +47 -0
- package/dist/{chunk-OASFXI27.js → chunk-BNFGVFZ3.js} +5 -5
- package/dist/{chunk-GHCV6UXG.js → chunk-BTYDDKRQ.js} +5 -5
- package/dist/chunk-C6JRJ6JW.js +167 -0
- package/dist/chunk-CAOLGXA5.js +1 -0
- package/dist/{chunk-IIPYF6ZQ.js → chunk-CBDJRPMD.js} +16 -13
- package/dist/{chunk-OJ2TLWYD.js → chunk-CKFRMCZ7.js} +5 -3
- package/dist/{chunk-LZB3KTSH.js → chunk-CQWYZPPJ.js} +1 -1
- package/dist/{chunk-6RBNM5RO.js → chunk-CUOASXI7.js} +10 -10
- package/dist/{chunk-HG6HTUWU.js → chunk-CV5ZKED7.js} +2 -2
- package/dist/{chunk-HJERFB7J.js → chunk-DDRYT3SY.js} +2 -2
- package/dist/chunk-DGCAM2UJ.js +60 -0
- package/dist/{chunk-RLE5RN3T.js → chunk-DGQJRTO6.js} +15 -11
- package/dist/{chunk-FD7YU53N.js → chunk-DT3QGFXB.js} +4 -4
- package/dist/chunk-F73DTG2V.js +123 -0
- package/dist/{chunk-V3TETH4J.js → chunk-FIDUY6SS.js} +17 -16
- package/dist/{chunk-Z3IG5WRA.js → chunk-FJUVYRNT.js} +3 -3
- package/dist/{chunk-KQPLFVFR.js → chunk-FLZD7HQY.js} +0 -2
- package/dist/{chunk-64JDZWCV.js → chunk-GRKCUQG4.js} +6 -5
- package/dist/{chunk-EZ23IA3H.js → chunk-GSG2W6DP.js} +3 -3
- package/dist/{chunk-4I5ULCYG.js → chunk-HFTS5AN7.js} +3 -3
- package/dist/{chunk-RB4CVS22.js → chunk-HH7EHNOW.js} +3 -1
- package/dist/{chunk-S46W2QER.js → chunk-HSPGJSFJ.js} +17 -11
- package/dist/{chunk-NQVRF4RB.js → chunk-HXV5UA7K.js} +16 -13
- package/dist/{chunk-GUB7YKG2.js → chunk-I4U36P54.js} +6 -3
- package/dist/{chunk-BTRTORKU.js → chunk-I6CAF7C5.js} +6 -7
- package/dist/chunk-IGLOYOCH.js +134 -0
- package/dist/{chunk-IK23Q2OF.js → chunk-JHVYI5GK.js} +3 -3
- package/dist/chunk-K5FKEAAK.js +94 -0
- package/dist/{chunk-5URGARPH.js → chunk-KE4YVG5Q.js} +6 -10
- package/dist/{chunk-A4IMFAZX.js → chunk-LESI7J7B.js} +3 -3
- package/dist/chunk-MEUJBGY5.js +88 -0
- package/dist/chunk-MNEXMMLM.js +23 -0
- package/dist/{chunk-PVTACENM.js → chunk-MTK3GHDQ.js} +2 -2
- package/dist/chunk-NA5UMOE5.js +55 -0
- package/dist/{chunk-YJ3JQYAN.js → chunk-NGQKBDHA.js} +5 -13
- package/dist/{chunk-7Q7ZF6BY.js → chunk-NNIFOMIH.js} +18 -8
- package/dist/{chunk-7L3CGIRA.js → chunk-NQPGELMP.js} +8 -19
- package/dist/chunk-NSVXGOR3.js +54 -0
- package/dist/{chunk-6J3QTWKC.js → chunk-NZT4TTNV.js} +18 -9
- package/dist/{chunk-TJCHA3OI.js → chunk-O626NJEM.js} +7 -4
- package/dist/chunk-O74XEHLA.js +331 -0
- package/dist/{chunk-JSD3H7WV.js → chunk-OYCK6BRG.js} +6 -6
- package/dist/{chunk-2555JXCP.js → chunk-PBPUSRTJ.js} +19 -11
- package/dist/{chunk-QD7H3WV3.js → chunk-PGDXFBKT.js} +8 -8
- package/dist/{chunk-PQ6GU7SG.js → chunk-PMWYLYM3.js} +20 -14
- package/dist/{chunk-I4BHRVRL.js → chunk-PPCGUIAB.js} +9 -5
- package/dist/{chunk-NIX4SEKM.js → chunk-PREMZMLU.js} +7 -4
- package/dist/{chunk-4SSUM4CL.js → chunk-Q3ESHXKU.js} +9 -6
- package/dist/{chunk-KM6Z3VTI.js → chunk-QVTVDL6Y.js} +1 -1
- package/dist/{chunk-AXOKFS4K.js → chunk-RSU2UHN4.js} +20 -4
- package/dist/{chunk-DJZZ3FIP.js → chunk-RUR57JZQ.js} +5 -14
- package/dist/{chunk-ZV3AF5CL.js → chunk-S2CTBFLN.js} +13 -2
- package/dist/{chunk-WESZPFBZ.js → chunk-S7GH2BJP.js} +7 -4
- package/dist/chunk-SAUA52EJ.js +131 -0
- package/dist/{chunk-72I7EVOL.js → chunk-SYZADSLI.js} +10 -6
- package/dist/{chunk-TEOLG3N2.js → chunk-SZ2WPWXJ.js} +10 -6
- package/dist/{chunk-W2NEXOTG.js → chunk-T7RLPFGX.js} +2 -2
- package/dist/{chunk-J6TU45KP.js → chunk-TRA6A5C5.js} +26 -12
- package/dist/{chunk-H2W7IYVY.js → chunk-UTJJ5HFX.js} +18 -12
- package/dist/{chunk-5O34ZNC3.js → chunk-VAFBGFKY.js} +19 -13
- package/dist/{chunk-OJRSPDNJ.js → chunk-VD4RFTNV.js} +8 -14
- package/dist/chunk-VLQGQFW7.js +110 -0
- package/dist/{chunk-RTDUTWJ4.js → chunk-VMT7Y3AT.js} +5 -8
- package/dist/{chunk-LGQ737BP.js → chunk-WHTLXQB6.js} +1 -1
- package/dist/chunk-WLRRMT6W.js +1 -0
- package/dist/{chunk-2FCSWBSM.js → chunk-WMWX6DPB.js} +3 -3
- package/dist/{chunk-UMC64NCT.js → chunk-WVBGQCYC.js} +6 -3
- package/dist/{chunk-QCNLE27O.js → chunk-WXRQ42DR.js} +11 -7
- package/dist/{chunk-SY6V3HAK.js → chunk-XDU27NRX.js} +3 -3
- package/dist/{chunk-KA2J5OBA.js → chunk-XQDD76EF.js} +4 -7
- package/dist/chunk-XTATJMY6.js +64 -0
- package/dist/chunk-XYXMPHND.js +1 -0
- package/dist/{chunk-7ZWBHHRK.js → chunk-YNU6VRD5.js} +23 -32
- package/dist/{chunk-6SJPVQQW.js → chunk-Z3HF6XJ3.js} +1 -1
- package/dist/{chunk-I4URNMI7.js → chunk-ZC4MZAEX.js} +9 -7
- package/dist/{chunk-PWBPHGM3.js → chunk-ZCEUVK2R.js} +2 -2
- package/dist/chunk-ZT3NWE5U.js +1 -0
- package/dist/{chunk-RHOYF7MO.js → chunk-ZTLALVWA.js} +6 -15
- package/dist/components/Accordion/index.js +1 -1
- package/dist/components/Alert/index.js +2 -1
- package/dist/components/AlertDialog/index.js +3 -3
- package/dist/components/Amount/index.js +3 -1
- package/dist/components/AspectRatio/index.js +1 -1
- package/dist/components/Autocomplete/index.js +3 -2
- package/dist/components/Avatar/index.js +1 -1
- package/dist/components/AvatarGroup/index.js +3 -2
- package/dist/components/Badge/index.js +1 -1
- package/dist/components/Banner/index.js +2 -1
- package/dist/components/Breadcrumb/index.js +2 -1
- package/dist/components/Button/index.js +1 -1
- package/dist/components/ButtonGroup/index.js +1 -1
- package/dist/components/Callout/index.js +1 -1
- package/dist/components/Card/index.js +3 -1
- package/dist/components/CheckList/index.js +1 -1
- package/dist/components/Checkbox/index.js +1 -1
- package/dist/components/CheckboxCard/index.js +9 -0
- package/dist/components/Chip/index.js +2 -1
- package/dist/components/Citation/index.js +17 -0
- package/dist/components/Code/index.js +1 -1
- package/dist/components/Combobox/index.js +1 -1
- package/dist/components/CommandPalette/index.js +3 -2
- package/dist/components/ContextMenu/index.js +2 -2
- package/dist/components/CountryBadge/index.js +1 -1
- package/dist/components/DataTable/index.js +2 -1
- package/dist/components/DatePicker/index.js +5 -1
- package/dist/components/DateRangePicker/index.js +5 -1
- package/dist/components/Dialog/index.js +2 -2
- package/dist/components/Drawer/index.js +2 -2
- package/dist/components/DropdownMenu/index.js +2 -2
- package/dist/components/EmptyState/index.js +1 -1
- package/dist/components/ErrorState/index.js +2 -1
- package/dist/components/EyebrowChip/index.js +4 -1
- package/dist/components/FileUpload/index.js +2 -1
- package/dist/components/FilterChip/index.js +3 -1
- package/dist/components/Flex/index.js +2 -1
- package/dist/components/FormError/index.js +1 -1
- package/dist/components/FormField/index.js +7 -4
- package/dist/components/GradientDivider/index.js +1 -1
- package/dist/components/Grid/index.js +2 -1
- package/dist/components/Heading/index.js +4 -1
- package/dist/components/HelperText/index.js +4 -1
- package/dist/components/HoverCard/index.js +3 -2
- package/dist/components/IconButton/index.js +2 -1
- package/dist/components/Input/index.js +1 -1
- package/dist/components/Kbd/index.js +1 -1
- package/dist/components/KeyboardShortcut/index.js +2 -2
- package/dist/components/Label/index.js +4 -1
- package/dist/components/Link/index.js +1 -1
- package/dist/components/Logo/index.js +1 -1
- package/dist/components/MediaCard/index.js +9 -0
- package/dist/components/Menubar/index.js +2 -2
- package/dist/components/MessageBubble/index.js +18 -0
- package/dist/components/MoneyInput/index.js +3 -2
- package/dist/components/NavigationMenu/index.js +2 -2
- package/dist/components/NavigationRail/index.js +2 -1
- package/dist/components/NexubProvider/index.js +14 -0
- package/dist/components/NumberInput/index.js +3 -2
- package/dist/components/NumberTicker/index.js +10 -0
- package/dist/components/PageHeader/index.js +1 -1
- package/dist/components/Pagination/index.js +3 -1
- package/dist/components/PasswordInput/index.js +3 -2
- package/dist/components/Popover/index.js +2 -2
- package/dist/components/Progress/index.js +2 -1
- package/dist/components/PromptInput/index.js +15 -0
- package/dist/components/RadioCard/index.js +11 -0
- package/dist/components/RadioGroup/index.js +1 -1
- package/dist/components/Rating/index.js +2 -1
- package/dist/components/ScrollArea/index.js +1 -1
- package/dist/components/SearchInput/index.js +3 -2
- package/dist/components/Section/index.js +1 -1
- package/dist/components/SegmentedControl/index.js +3 -2
- package/dist/components/Select/index.js +2 -2
- package/dist/components/Separator/index.js +1 -1
- package/dist/components/Sidebar/index.js +2 -1
- package/dist/components/Skeleton/index.js +1 -1
- package/dist/components/Spinner/index.js +2 -1
- package/dist/components/SplitButton/index.js +5 -5
- package/dist/components/Stack/index.js +2 -1
- package/dist/components/StatusPill/index.js +1 -1
- package/dist/components/StreamingText/index.js +8 -0
- package/dist/components/Switch/index.js +1 -1
- package/dist/components/Table/index.js +1 -1
- package/dist/components/Tabs/index.js +3 -2
- package/dist/components/Tag/index.js +1 -1
- package/dist/components/Text/index.js +1 -1
- package/dist/components/TextGradient/index.js +1 -1
- package/dist/components/Textarea/index.js +1 -1
- package/dist/components/ThinkingIndicator/index.js +9 -0
- package/dist/components/Toast/index.js +3 -1
- package/dist/components/Tooltip/index.js +2 -1
- package/dist/components/TopNav/index.js +2 -1
- package/dist/index.d.ts +407 -22
- package/dist/index.js +245 -166
- package/package.json +52 -50
- package/dist/chunk-63DPMUMR.js +0 -67
- package/dist/chunk-CHGPGRML.js +0 -115
- package/dist/chunk-J2T4GFFS.js +0 -85
- package/dist/chunk-LH3BSAIS.js +0 -119
- package/dist/chunk-LMPGHWUA.js +0 -114
- package/dist/chunk-NMH5WSZG.js +0 -72
- package/dist/chunk-P44EROBX.js +0 -55
- package/dist/chunk-TYTW4F3B.js +0 -178
|
@@ -8,19 +8,19 @@ import * as React from "react";
|
|
|
8
8
|
import { cva } from "class-variance-authority";
|
|
9
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
10
|
var calloutVariants = cva(
|
|
11
|
-
"flex gap-2.5 rounded-
|
|
11
|
+
"flex gap-2.5 rounded-shape-container px-3 py-2.5 text-sm",
|
|
12
12
|
{
|
|
13
13
|
variants: {
|
|
14
14
|
tone: {
|
|
15
|
-
neutral: "bg-[var(--color-
|
|
16
|
-
info: "bg-[var(--color-
|
|
17
|
-
success: "bg-[var(--color-
|
|
18
|
-
warning: "bg-[var(--color-
|
|
19
|
-
danger: "bg-[var(--color-
|
|
20
|
-
leap: "bg-[var(--color-leap-
|
|
21
|
-
bookub: "bg-[var(--color-bookub-
|
|
22
|
-
payub: "bg-[var(--color-payub-
|
|
23
|
-
founderub: "bg-[var(--color-founderub-
|
|
15
|
+
neutral: "bg-[var(--color-surface-container-low)] text-[var(--color-on-surface)]",
|
|
16
|
+
info: "bg-[var(--color-info-container)] text-[var(--color-on-info-container)]",
|
|
17
|
+
success: "bg-[var(--color-success-container)] text-[var(--color-on-success-container)]",
|
|
18
|
+
warning: "bg-[var(--color-warning-container)] text-[var(--color-on-warning-container)]",
|
|
19
|
+
danger: "bg-[var(--color-error-container)] text-[var(--color-on-error-container)]",
|
|
20
|
+
leap: "bg-[var(--color-leap-container)] text-[var(--color-on-leap-container)]",
|
|
21
|
+
bookub: "bg-[var(--color-bookub-container)] text-[var(--color-on-bookub-container)]",
|
|
22
|
+
payub: "bg-[var(--color-payub-container)] text-[var(--color-on-payub-container)]",
|
|
23
|
+
founderub: "bg-[var(--color-founderub-container)] text-[var(--color-on-founderub-container)]"
|
|
24
24
|
}
|
|
25
25
|
},
|
|
26
26
|
defaultVariants: {
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
|
+
import {
|
|
3
|
+
toneTextClasses
|
|
4
|
+
} from "./chunk-C6JRJ6JW.js";
|
|
2
5
|
import {
|
|
3
6
|
cn
|
|
4
7
|
} from "./chunk-Q7G5WGYV.js";
|
|
@@ -51,16 +54,16 @@ var Heading = React.forwardRef(
|
|
|
51
54
|
const resolvedSize = size ?? levelSizeMap[level];
|
|
52
55
|
const Tag = `h${level}`;
|
|
53
56
|
const Comp = asChild ? Slot : Tag;
|
|
54
|
-
const toneStyle = tone && tone !== "default" ? { color: `var(--color-text-${tone})` } : {};
|
|
55
57
|
return /* @__PURE__ */ jsx(
|
|
56
58
|
Comp,
|
|
57
59
|
{
|
|
58
60
|
ref,
|
|
59
61
|
className: cn(
|
|
60
62
|
headingVariants({ size: resolvedSize, weight }),
|
|
63
|
+
tone && tone !== "default" && toneTextClasses[tone],
|
|
61
64
|
className
|
|
62
65
|
),
|
|
63
|
-
style
|
|
66
|
+
style,
|
|
64
67
|
"data-tone": tone,
|
|
65
68
|
...rest,
|
|
66
69
|
children
|
|
@@ -8,7 +8,7 @@ import * as React from "react";
|
|
|
8
8
|
import { cva } from "class-variance-authority";
|
|
9
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
10
|
var avatarVariants = cva(
|
|
11
|
-
"relative inline-flex items-center justify-center shrink-0 rounded-full overflow-hidden bg-[var(--color-
|
|
11
|
+
"relative inline-flex items-center justify-center shrink-0 rounded-full overflow-hidden bg-[var(--color-surface-container-high)] text-[var(--color-on-surface-muted)] font-medium select-none",
|
|
12
12
|
{
|
|
13
13
|
variants: {
|
|
14
14
|
size: {
|
|
@@ -86,9 +86,9 @@ var Avatar = React.forwardRef(
|
|
|
86
86
|
"span",
|
|
87
87
|
{
|
|
88
88
|
className: cn(
|
|
89
|
-
"absolute bottom-0
|
|
89
|
+
"absolute bottom-0 end-0 rounded-full ring-2 ring-[var(--color-surface)]",
|
|
90
90
|
badgeSizeMap[size ?? "md"],
|
|
91
|
-
badgeColor ?? "bg-[var(--color-
|
|
91
|
+
badgeColor ?? "bg-[var(--color-success)]"
|
|
92
92
|
),
|
|
93
93
|
"aria-hidden": "true"
|
|
94
94
|
}
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
import {
|
|
3
3
|
glassSurfaceClass
|
|
4
4
|
} from "./chunk-DEIBF3P7.js";
|
|
5
|
+
import {
|
|
6
|
+
useNexubMessages
|
|
7
|
+
} from "./chunk-743Y5MY3.js";
|
|
5
8
|
import {
|
|
6
9
|
cn
|
|
7
10
|
} from "./chunk-Q7G5WGYV.js";
|
|
@@ -33,18 +36,21 @@ var Logo = React.forwardRef(
|
|
|
33
36
|
);
|
|
34
37
|
Logo.displayName = "TopNav.Logo";
|
|
35
38
|
var Menu = React.forwardRef(
|
|
36
|
-
({ className, ...props }, ref) =>
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
39
|
+
({ className, ...props }, ref) => {
|
|
40
|
+
const messages = useNexubMessages();
|
|
41
|
+
return (
|
|
42
|
+
// Scrolls horizontally on narrow screens rather than hiding the links.
|
|
43
|
+
/* @__PURE__ */ jsx(
|
|
44
|
+
"nav",
|
|
45
|
+
{
|
|
46
|
+
ref,
|
|
47
|
+
"aria-label": messages.mainNavigation,
|
|
48
|
+
className: cn("flex min-w-0 items-center gap-1 overflow-x-auto", className),
|
|
49
|
+
...props
|
|
50
|
+
}
|
|
51
|
+
)
|
|
52
|
+
);
|
|
53
|
+
}
|
|
48
54
|
);
|
|
49
55
|
Menu.displayName = "TopNav.Menu";
|
|
50
56
|
var Item = React.forwardRef(
|
|
@@ -67,7 +73,7 @@ var Item = React.forwardRef(
|
|
|
67
73
|
);
|
|
68
74
|
Item.displayName = "TopNav.Item";
|
|
69
75
|
var Actions = React.forwardRef(
|
|
70
|
-
({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("
|
|
76
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("ms-auto flex items-center gap-2", className), ...props })
|
|
71
77
|
);
|
|
72
78
|
Actions.displayName = "TopNav.Actions";
|
|
73
79
|
var TopNav = { Root, Logo, Menu, Item, Actions };
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import {
|
|
3
|
+
useMergedRefs
|
|
4
|
+
} from "./chunk-MNEXMMLM.js";
|
|
5
|
+
import {
|
|
6
|
+
useControllableState
|
|
7
|
+
} from "./chunk-JLUCMNVS.js";
|
|
8
|
+
import {
|
|
9
|
+
IconButton
|
|
10
|
+
} from "./chunk-CQWYZPPJ.js";
|
|
11
|
+
import {
|
|
12
|
+
fieldDisabledWithin,
|
|
13
|
+
fieldFocusWithin
|
|
14
|
+
} from "./chunk-7SXR4PGO.js";
|
|
15
|
+
import {
|
|
16
|
+
glassSurfaceClass
|
|
17
|
+
} from "./chunk-DEIBF3P7.js";
|
|
18
|
+
import {
|
|
19
|
+
useNexubMessages
|
|
20
|
+
} from "./chunk-743Y5MY3.js";
|
|
21
|
+
import {
|
|
22
|
+
cn
|
|
23
|
+
} from "./chunk-Q7G5WGYV.js";
|
|
24
|
+
|
|
25
|
+
// src/components/PromptInput/PromptInput.tsx
|
|
26
|
+
import * as React from "react";
|
|
27
|
+
import { ArrowUp } from "@nexub/icons";
|
|
28
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
29
|
+
var fallbackMessages = {
|
|
30
|
+
promptLabel: "Message",
|
|
31
|
+
sendMessage: "Send message",
|
|
32
|
+
stopGenerating: "Stop generating",
|
|
33
|
+
promptHint: "Press Enter to send, Shift+Enter for a new line"
|
|
34
|
+
};
|
|
35
|
+
var stopIcon = /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "size-3.5 rounded-shape-min bg-current" });
|
|
36
|
+
var PromptInput = React.forwardRef(
|
|
37
|
+
({
|
|
38
|
+
value: valueProp,
|
|
39
|
+
defaultValue = "",
|
|
40
|
+
onValueChange,
|
|
41
|
+
onSubmit,
|
|
42
|
+
onStop,
|
|
43
|
+
status = "idle",
|
|
44
|
+
maxRows = 8,
|
|
45
|
+
attachments,
|
|
46
|
+
actions,
|
|
47
|
+
surface = "solid",
|
|
48
|
+
label,
|
|
49
|
+
messages: messagesProp,
|
|
50
|
+
className,
|
|
51
|
+
textareaClassName,
|
|
52
|
+
disabled,
|
|
53
|
+
onKeyDown,
|
|
54
|
+
id,
|
|
55
|
+
"aria-describedby": describedBy,
|
|
56
|
+
...props
|
|
57
|
+
}, ref) => {
|
|
58
|
+
const m = {
|
|
59
|
+
...fallbackMessages,
|
|
60
|
+
...useNexubMessages(),
|
|
61
|
+
...messagesProp
|
|
62
|
+
};
|
|
63
|
+
const [value = "", setValue] = useControllableState({
|
|
64
|
+
value: valueProp,
|
|
65
|
+
defaultValue,
|
|
66
|
+
onChange: onValueChange
|
|
67
|
+
});
|
|
68
|
+
const hintId = React.useId();
|
|
69
|
+
const growRef = React.useRef(null);
|
|
70
|
+
const textareaRef = React.useRef(null);
|
|
71
|
+
const mergedRef = useMergedRefs(ref, textareaRef);
|
|
72
|
+
React.useEffect(() => {
|
|
73
|
+
growRef.current?.style.setProperty("--nx-max-rows", String(maxRows));
|
|
74
|
+
}, [maxRows]);
|
|
75
|
+
const streaming = status === "streaming";
|
|
76
|
+
const canSubmit = !disabled && status === "idle" && value.trim() !== "";
|
|
77
|
+
const submit = () => {
|
|
78
|
+
if (!canSubmit) return;
|
|
79
|
+
onSubmit?.(value);
|
|
80
|
+
if (valueProp === void 0) setValue("");
|
|
81
|
+
};
|
|
82
|
+
const handleKeyDown = (e) => {
|
|
83
|
+
onKeyDown?.(e);
|
|
84
|
+
if (e.defaultPrevented) return;
|
|
85
|
+
if (e.key === "Enter" && !e.shiftKey) {
|
|
86
|
+
if (e.nativeEvent.isComposing || e.keyCode === 229) return;
|
|
87
|
+
e.preventDefault();
|
|
88
|
+
submit();
|
|
89
|
+
} else if (e.key === "Escape" && streaming) {
|
|
90
|
+
e.preventDefault();
|
|
91
|
+
onStop?.();
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
const textClass = "col-start-1 row-start-1 m-0 px-1 py-1.5 text-body-md max-h-[calc(var(--nx-max-rows,8)*1lh+0.75rem)] whitespace-pre-wrap break-words";
|
|
95
|
+
return /* @__PURE__ */ jsxs(
|
|
96
|
+
"div",
|
|
97
|
+
{
|
|
98
|
+
className: cn(
|
|
99
|
+
"flex flex-col gap-2 p-3 rounded-shape-overlay border border-[var(--color-outline-variant)] bg-[var(--color-surface-container-low)] text-[var(--color-on-surface)]",
|
|
100
|
+
"transition-[border-color,box-shadow] duration-effects-fast ease-effects-fast",
|
|
101
|
+
fieldFocusWithin,
|
|
102
|
+
fieldDisabledWithin,
|
|
103
|
+
surface === "glass" && glassSurfaceClass,
|
|
104
|
+
className
|
|
105
|
+
),
|
|
106
|
+
"data-material": surface === "glass" ? "glass" : void 0,
|
|
107
|
+
"data-status": status,
|
|
108
|
+
children: [
|
|
109
|
+
attachments && /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-2", children: attachments }),
|
|
110
|
+
/* @__PURE__ */ jsxs("div", { ref: growRef, className: "grid", children: [
|
|
111
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: cn(textClass, "invisible overflow-hidden pointer-events-none"), children: value + "\u200B" }),
|
|
112
|
+
/* @__PURE__ */ jsx(
|
|
113
|
+
"textarea",
|
|
114
|
+
{
|
|
115
|
+
ref: mergedRef,
|
|
116
|
+
id,
|
|
117
|
+
rows: 1,
|
|
118
|
+
value,
|
|
119
|
+
onChange: (e) => setValue(e.target.value),
|
|
120
|
+
onKeyDown: handleKeyDown,
|
|
121
|
+
disabled,
|
|
122
|
+
"aria-label": label ?? m.promptLabel,
|
|
123
|
+
"aria-describedby": describedBy ? `${hintId} ${describedBy}` : hintId,
|
|
124
|
+
className: cn(
|
|
125
|
+
textClass,
|
|
126
|
+
"w-full resize-none overflow-y-auto bg-transparent border-0 text-inherit",
|
|
127
|
+
"placeholder:text-[var(--color-on-surface-muted)] focus-visible:outline-none disabled:cursor-not-allowed",
|
|
128
|
+
textareaClassName
|
|
129
|
+
),
|
|
130
|
+
...props
|
|
131
|
+
}
|
|
132
|
+
)
|
|
133
|
+
] }),
|
|
134
|
+
/* @__PURE__ */ jsx("span", { id: hintId, hidden: true, children: m.promptHint }),
|
|
135
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-end gap-2", children: [
|
|
136
|
+
/* @__PURE__ */ jsx("div", { className: "flex min-w-0 flex-1 flex-wrap items-center gap-1", children: actions }),
|
|
137
|
+
streaming ? /* @__PURE__ */ jsx(
|
|
138
|
+
IconButton,
|
|
139
|
+
{
|
|
140
|
+
type: "button",
|
|
141
|
+
label: m.stopGenerating,
|
|
142
|
+
variant: "subtle",
|
|
143
|
+
disabled,
|
|
144
|
+
onClick: onStop,
|
|
145
|
+
className: "bg-[var(--color-secondary-container)] text-[var(--color-on-secondary-container)]",
|
|
146
|
+
children: stopIcon
|
|
147
|
+
}
|
|
148
|
+
) : /* @__PURE__ */ jsx(
|
|
149
|
+
IconButton,
|
|
150
|
+
{
|
|
151
|
+
type: "button",
|
|
152
|
+
label: m.sendMessage,
|
|
153
|
+
variant: "solid",
|
|
154
|
+
disabled,
|
|
155
|
+
"aria-disabled": !canSubmit || void 0,
|
|
156
|
+
onClick: submit,
|
|
157
|
+
className: "aria-disabled:bg-[color-mix(in_srgb,var(--color-on-surface)_12%,transparent)] aria-disabled:text-[var(--color-text-disabled)]",
|
|
158
|
+
children: /* @__PURE__ */ jsx(ArrowUp, { size: "md" })
|
|
159
|
+
}
|
|
160
|
+
)
|
|
161
|
+
] })
|
|
162
|
+
]
|
|
163
|
+
}
|
|
164
|
+
);
|
|
165
|
+
}
|
|
166
|
+
);
|
|
167
|
+
PromptInput.displayName = "PromptInput";
|
|
168
|
+
|
|
169
|
+
export {
|
|
170
|
+
PromptInput
|
|
171
|
+
};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import {
|
|
3
|
+
glassSurfaceClass
|
|
4
|
+
} from "./chunk-DEIBF3P7.js";
|
|
5
|
+
import {
|
|
6
|
+
cn
|
|
7
|
+
} from "./chunk-Q7G5WGYV.js";
|
|
8
|
+
|
|
9
|
+
// src/components/MediaCard/MediaCard.tsx
|
|
10
|
+
import * as React from "react";
|
|
11
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
+
var ratioClass = {
|
|
13
|
+
"16/9": "aspect-video",
|
|
14
|
+
"4/3": "aspect-[4/3]",
|
|
15
|
+
"1/1": "aspect-square",
|
|
16
|
+
"3/4": "aspect-[3/4]"
|
|
17
|
+
};
|
|
18
|
+
var MediaCard = React.forwardRef(
|
|
19
|
+
({ src, alt, ratio = "16/9", title, description, eyebrow, href, className, children, ...props }, ref) => {
|
|
20
|
+
const hasCaption = title != null || description != null || eyebrow != null || children != null;
|
|
21
|
+
return /* @__PURE__ */ jsxs(
|
|
22
|
+
"div",
|
|
23
|
+
{
|
|
24
|
+
ref,
|
|
25
|
+
className: cn(
|
|
26
|
+
"group relative grid overflow-hidden rounded-shape-container border border-[color-mix(in_srgb,var(--color-outline-variant)_60%,transparent)] bg-[var(--color-surface-container-high)]",
|
|
27
|
+
href && "shadow-elevation-1 transition-[box-shadow,transform] duration-effects-fast ease-effects-fast hover:shadow-elevation-2 hover:duration-spatial-default hover:ease-spatial-default motion-safe:hover:-translate-y-0.5 has-[a:focus-visible]:outline has-[a:focus-visible]:outline-[3px] has-[a:focus-visible]:outline-offset-2 has-[a:focus-visible]:outline-[var(--color-primary)]",
|
|
28
|
+
className
|
|
29
|
+
),
|
|
30
|
+
...props,
|
|
31
|
+
children: [
|
|
32
|
+
/* @__PURE__ */ jsx("div", { className: cn("relative [grid-area:1/1]", ratioClass[ratio]), children: /* @__PURE__ */ jsx(
|
|
33
|
+
"img",
|
|
34
|
+
{
|
|
35
|
+
src,
|
|
36
|
+
alt,
|
|
37
|
+
loading: "lazy",
|
|
38
|
+
decoding: "async",
|
|
39
|
+
className: cn(
|
|
40
|
+
"absolute inset-0 h-full w-full object-cover",
|
|
41
|
+
href && "transition-transform duration-effects-fast ease-effects-fast motion-safe:group-hover:scale-[1.03] group-hover:duration-spatial-default group-hover:ease-spatial-default"
|
|
42
|
+
)
|
|
43
|
+
}
|
|
44
|
+
) }),
|
|
45
|
+
hasCaption && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
46
|
+
/* @__PURE__ */ jsx(
|
|
47
|
+
"div",
|
|
48
|
+
{
|
|
49
|
+
"aria-hidden": "true",
|
|
50
|
+
className: "pointer-events-none h-2/3 self-end bg-gradient-to-t from-[color-mix(in_srgb,var(--color-scrim,black)_45%,transparent)] to-transparent [grid-area:1/1]"
|
|
51
|
+
}
|
|
52
|
+
),
|
|
53
|
+
/* @__PURE__ */ jsxs("div", { className: "m-1 grid self-end [grid-area:1/1]", children: [
|
|
54
|
+
/* @__PURE__ */ jsx(
|
|
55
|
+
"div",
|
|
56
|
+
{
|
|
57
|
+
"aria-hidden": "true",
|
|
58
|
+
"data-material": "glass",
|
|
59
|
+
"data-glass-thickness": "thin",
|
|
60
|
+
className: cn("rounded-shape-field [grid-area:1/1]", glassSurfaceClass)
|
|
61
|
+
}
|
|
62
|
+
),
|
|
63
|
+
/* @__PURE__ */ jsxs("div", { className: "z-[1] flex flex-col gap-0.5 px-3 py-2.5 [grid-area:1/1]", children: [
|
|
64
|
+
eyebrow != null && /* @__PURE__ */ jsx("span", { className: "text-label-sm text-[var(--color-on-surface-variant)]", children: eyebrow }),
|
|
65
|
+
title != null && /* @__PURE__ */ jsx("h3", { className: "text-title-sm text-[var(--color-on-surface)]", children: href ? /* @__PURE__ */ jsx("a", { href, className: "after:absolute after:inset-0 after:content-[''] focus-visible:outline-none", children: title }) : title }),
|
|
66
|
+
description != null && /* @__PURE__ */ jsx("p", { className: "text-body-sm text-[var(--color-on-surface-variant)]", children: description }),
|
|
67
|
+
children != null && /* @__PURE__ */ jsx("div", { className: "relative z-[1] mt-2 flex flex-wrap gap-2", children })
|
|
68
|
+
] })
|
|
69
|
+
] })
|
|
70
|
+
] })
|
|
71
|
+
]
|
|
72
|
+
}
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
);
|
|
76
|
+
MediaCard.displayName = "MediaCard";
|
|
77
|
+
|
|
78
|
+
export {
|
|
79
|
+
MediaCard
|
|
80
|
+
};
|
|
@@ -57,24 +57,24 @@ var toneClasses = {
|
|
|
57
57
|
outline: "border-[color-mix(in_srgb,var(--color-error)_50%,transparent)] text-[var(--color-error)]"
|
|
58
58
|
},
|
|
59
59
|
leap: {
|
|
60
|
-
solid: "bg-[
|
|
61
|
-
soft: "bg-[
|
|
62
|
-
outline: "border-[color:light-dark(var(--color-palette-leap-80),var(--color-palette-leap-40))] text-[
|
|
60
|
+
solid: "bg-[var(--color-leap)] text-[var(--color-on-leap)]",
|
|
61
|
+
soft: "bg-[var(--color-leap-container)] text-[var(--color-on-leap-container)]",
|
|
62
|
+
outline: "border-[color:light-dark(var(--color-palette-leap-80),var(--color-palette-leap-40))] text-[var(--color-leap)]"
|
|
63
63
|
},
|
|
64
64
|
bookub: {
|
|
65
|
-
solid: "bg-[
|
|
66
|
-
soft: "bg-[
|
|
67
|
-
outline: "border-[color:light-dark(var(--color-palette-bookub-80),var(--color-palette-bookub-40))] text-[
|
|
65
|
+
solid: "bg-[var(--color-bookub)] text-[var(--color-on-bookub)]",
|
|
66
|
+
soft: "bg-[var(--color-bookub-container)] text-[var(--color-on-bookub-container)]",
|
|
67
|
+
outline: "border-[color:light-dark(var(--color-palette-bookub-80),var(--color-palette-bookub-40))] text-[var(--color-bookub)]"
|
|
68
68
|
},
|
|
69
69
|
payub: {
|
|
70
|
-
solid: "bg-[
|
|
71
|
-
soft: "bg-[
|
|
72
|
-
outline: "border-[color:light-dark(var(--color-palette-payub-80),var(--color-palette-payub-40))] text-[
|
|
70
|
+
solid: "bg-[var(--color-payub)] text-[var(--color-on-payub)]",
|
|
71
|
+
soft: "bg-[var(--color-payub-container)] text-[var(--color-on-payub-container)]",
|
|
72
|
+
outline: "border-[color:light-dark(var(--color-palette-payub-80),var(--color-palette-payub-40))] text-[var(--color-payub)]"
|
|
73
73
|
},
|
|
74
74
|
founderub: {
|
|
75
|
-
solid: "bg-[
|
|
76
|
-
soft: "bg-[
|
|
77
|
-
outline: "border-[color:light-dark(var(--color-palette-founderub-80),var(--color-palette-founderub-40))] text-[
|
|
75
|
+
solid: "bg-[var(--color-founderub)] text-[var(--color-on-founderub)]",
|
|
76
|
+
soft: "bg-[var(--color-founderub-container)] text-[var(--color-on-founderub-container)]",
|
|
77
|
+
outline: "border-[color:light-dark(var(--color-palette-founderub-80),var(--color-palette-founderub-40))] text-[var(--color-founderub)]"
|
|
78
78
|
}
|
|
79
79
|
};
|
|
80
80
|
var Badge = React.forwardRef(
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use client';
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import {
|
|
3
|
+
formatDate
|
|
4
|
+
} from "./chunk-IGLOYOCH.js";
|
|
5
|
+
import {
|
|
6
|
+
floatingSurface
|
|
7
|
+
} from "./chunk-FLZD7HQY.js";
|
|
8
|
+
import {
|
|
9
|
+
field,
|
|
10
|
+
fieldFocusVisible
|
|
11
|
+
} from "./chunk-7SXR4PGO.js";
|
|
12
|
+
import {
|
|
13
|
+
useIntlLocale,
|
|
14
|
+
useNexubMessages
|
|
15
|
+
} from "./chunk-743Y5MY3.js";
|
|
16
|
+
import {
|
|
17
|
+
cn
|
|
18
|
+
} from "./chunk-Q7G5WGYV.js";
|
|
19
|
+
|
|
20
|
+
// src/components/DateRangePicker/DateRangePicker.tsx
|
|
21
|
+
import * as React from "react";
|
|
22
|
+
import * as RadixPopover from "@radix-ui/react-popover";
|
|
23
|
+
import { DayPicker } from "react-day-picker";
|
|
24
|
+
import { CalendarDays, ChevronLeft, ChevronRight } from "@nexub/icons";
|
|
25
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
26
|
+
function formatRange(range, placeholder, locale) {
|
|
27
|
+
if (!range) return placeholder;
|
|
28
|
+
if (range.from && range.to) {
|
|
29
|
+
return `${formatDate(range.from, locale)} \u2013 ${formatDate(range.to, locale)}`;
|
|
30
|
+
}
|
|
31
|
+
if (range.from) return `${formatDate(range.from, locale)} \u2013 \u2026`;
|
|
32
|
+
return placeholder;
|
|
33
|
+
}
|
|
34
|
+
var calendarClassNames = {
|
|
35
|
+
months: "flex flex-col sm:flex-row gap-4",
|
|
36
|
+
month: "flex flex-col gap-4",
|
|
37
|
+
month_caption: "flex h-8 items-center justify-center",
|
|
38
|
+
caption_label: "text-label-lg text-[var(--color-on-surface)]",
|
|
39
|
+
// v9 renders nav beside the months, not in the caption: pin it to the caption row.
|
|
40
|
+
nav: "pointer-events-none absolute inset-x-3 top-3 flex h-8 items-center justify-between",
|
|
41
|
+
button_previous: "nx-state-layer pointer-events-auto inline-flex h-7 w-7 items-center justify-center rounded-full text-[var(--color-on-surface)] disabled:pointer-events-none disabled:text-[var(--color-text-disabled)]",
|
|
42
|
+
button_next: "nx-state-layer pointer-events-auto inline-flex h-7 w-7 items-center justify-center rounded-full text-[var(--color-on-surface)] disabled:pointer-events-none disabled:text-[var(--color-text-disabled)]",
|
|
43
|
+
month_grid: "w-full border-collapse",
|
|
44
|
+
weekdays: "flex",
|
|
45
|
+
weekday: "text-[var(--color-on-surface-muted)] w-8 text-label-sm flex-1 text-center",
|
|
46
|
+
week: "flex w-full mt-2",
|
|
47
|
+
day: "relative flex flex-1 justify-center p-0 text-center focus-within:z-20",
|
|
48
|
+
day_button: cn(
|
|
49
|
+
// Capsule day with a state layer; focus = the global ring. The transparent
|
|
50
|
+
// border carries today's primary outline.
|
|
51
|
+
"nx-state-layer inline-flex h-8 w-8 items-center justify-center rounded-full border border-transparent text-body-sm text-[var(--color-on-surface)]",
|
|
52
|
+
"disabled:pointer-events-none disabled:text-[var(--color-text-disabled)]"
|
|
53
|
+
),
|
|
54
|
+
// Ends (and a lone start) are filled primary capsules; the middle is a
|
|
55
|
+
// primary-container band. `nx-range-middle` is a marker so `selected`
|
|
56
|
+
// skips middle days without depending on CSS order.
|
|
57
|
+
selected: "[&:not(.nx-range-middle)>button]:bg-[var(--color-primary)] [&:not(.nx-range-middle)>button]:text-[var(--color-on-primary)]",
|
|
58
|
+
// Half bands join the end capsules to the middle band (not on a one-day range).
|
|
59
|
+
range_start: "nx-range-start [&:not(.nx-range-end)]:bg-[linear-gradient(to_right,transparent_50%,var(--color-primary-container)_50%)]",
|
|
60
|
+
range_end: "nx-range-end [&:not(.nx-range-start)]:bg-[linear-gradient(to_left,transparent_50%,var(--color-primary-container)_50%)]",
|
|
61
|
+
range_middle: "nx-range-middle bg-[var(--color-primary-container)] [&>button]:text-[var(--color-on-primary-container)]",
|
|
62
|
+
today: "[&>button]:border-[var(--color-primary)]",
|
|
63
|
+
outside: "[&:not([data-selected]):not([data-disabled])>button]:text-[var(--color-on-surface-muted)]",
|
|
64
|
+
disabled: "",
|
|
65
|
+
hidden: "invisible"
|
|
66
|
+
};
|
|
67
|
+
var DateRangePicker = React.forwardRef(function DateRangePicker2({
|
|
68
|
+
value,
|
|
69
|
+
onChange,
|
|
70
|
+
placeholder: placeholderProp,
|
|
71
|
+
disabled = false,
|
|
72
|
+
minDate,
|
|
73
|
+
maxDate,
|
|
74
|
+
className,
|
|
75
|
+
id,
|
|
76
|
+
"aria-label": ariaLabel
|
|
77
|
+
}, ref) {
|
|
78
|
+
const [open, setOpen] = React.useState(false);
|
|
79
|
+
const messages = useNexubMessages();
|
|
80
|
+
const locale = useIntlLocale();
|
|
81
|
+
const placeholder = placeholderProp ?? messages.pickDateRange;
|
|
82
|
+
const display = formatRange(value, placeholder, locale);
|
|
83
|
+
const label = ariaLabel ? `${ariaLabel}: ${display}` : display;
|
|
84
|
+
return /* @__PURE__ */ jsxs(RadixPopover.Root, { open, onOpenChange: setOpen, children: [
|
|
85
|
+
/* @__PURE__ */ jsx(RadixPopover.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
86
|
+
"button",
|
|
87
|
+
{
|
|
88
|
+
ref,
|
|
89
|
+
id,
|
|
90
|
+
disabled,
|
|
91
|
+
"aria-label": label,
|
|
92
|
+
className: cn(
|
|
93
|
+
"inline-flex h-control-md w-full items-center justify-start gap-2 px-3.5 text-body-md",
|
|
94
|
+
field,
|
|
95
|
+
fieldFocusVisible,
|
|
96
|
+
// Open reads like focus: the 2px primary border (as Select).
|
|
97
|
+
"data-[state=open]:border-[var(--color-primary)] data-[state=open]:shadow-[inset_0_0_0_1px_var(--color-primary)]",
|
|
98
|
+
"disabled:cursor-not-allowed disabled:border-[var(--color-outline-variant)] disabled:bg-[var(--color-surface-container-low)] disabled:text-[var(--color-text-disabled)]",
|
|
99
|
+
!value && "text-[var(--color-on-surface-muted)]",
|
|
100
|
+
className
|
|
101
|
+
),
|
|
102
|
+
children: [
|
|
103
|
+
/* @__PURE__ */ jsx(CalendarDays, { size: "sm", "aria-hidden": "true" }),
|
|
104
|
+
display
|
|
105
|
+
]
|
|
106
|
+
}
|
|
107
|
+
) }),
|
|
108
|
+
/* @__PURE__ */ jsx(RadixPopover.Portal, { children: /* @__PURE__ */ jsx(
|
|
109
|
+
RadixPopover.Content,
|
|
110
|
+
{
|
|
111
|
+
align: "start",
|
|
112
|
+
className: cn(
|
|
113
|
+
"z-[var(--z-popover)] outline-none",
|
|
114
|
+
floatingSurface,
|
|
115
|
+
"nx-motion nx-pop origin-[var(--radix-popover-content-transform-origin)]"
|
|
116
|
+
),
|
|
117
|
+
children: /* @__PURE__ */ jsx(
|
|
118
|
+
DayPicker,
|
|
119
|
+
{
|
|
120
|
+
mode: "range",
|
|
121
|
+
selected: value,
|
|
122
|
+
defaultMonth: value?.from,
|
|
123
|
+
onSelect: onChange,
|
|
124
|
+
numberOfMonths: 2,
|
|
125
|
+
startMonth: minDate,
|
|
126
|
+
endMonth: maxDate,
|
|
127
|
+
initialFocus: true,
|
|
128
|
+
showOutsideDays: false,
|
|
129
|
+
className: "relative p-3",
|
|
130
|
+
classNames: calendarClassNames,
|
|
131
|
+
components: {
|
|
132
|
+
Chevron: ({ orientation, ...rest }) => orientation === "left" ? /* @__PURE__ */ jsx(ChevronLeft, { size: "xs", "aria-hidden": "true" }) : orientation === "right" ? /* @__PURE__ */ jsx(ChevronRight, { size: "xs", "aria-hidden": "true" }) : /* @__PURE__ */ jsx(ChevronRight, { size: "xs", "aria-hidden": "true", ...rest })
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
)
|
|
136
|
+
}
|
|
137
|
+
) })
|
|
138
|
+
] });
|
|
139
|
+
});
|
|
140
|
+
DateRangePicker.displayName = "DateRangePicker";
|
|
141
|
+
|
|
142
|
+
export {
|
|
143
|
+
DateRangePicker
|
|
144
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import {
|
|
3
|
+
cn
|
|
4
|
+
} from "./chunk-Q7G5WGYV.js";
|
|
5
|
+
|
|
6
|
+
// src/components/StreamingText/StreamingText.tsx
|
|
7
|
+
import * as React from "react";
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
var MAX_ANIMATED = 3;
|
|
10
|
+
function next(prev, text, streaming) {
|
|
11
|
+
if (!text.startsWith(prev.source) || !streaming) {
|
|
12
|
+
return { source: text, settled: text, chunks: [], nextId: prev.nextId };
|
|
13
|
+
}
|
|
14
|
+
const chunks = [...prev.chunks, { id: prev.nextId, text: text.slice(prev.source.length) }];
|
|
15
|
+
let settled = prev.settled;
|
|
16
|
+
while (chunks.length > MAX_ANIMATED) settled += chunks.shift().text;
|
|
17
|
+
return { source: text, settled, chunks, nextId: prev.nextId + 1 };
|
|
18
|
+
}
|
|
19
|
+
var StreamingText = React.forwardRef(
|
|
20
|
+
({ text, streaming = false, as: Comp = "div", className, "aria-live": ariaLive = "off", ...props }, ref) => {
|
|
21
|
+
const [state, setState] = React.useState(() => ({ source: text, settled: text, chunks: [], nextId: 0 }));
|
|
22
|
+
let current = state;
|
|
23
|
+
if (text !== state.source || !streaming && state.chunks.length > 0) {
|
|
24
|
+
current = next(state, text, streaming);
|
|
25
|
+
setState(current);
|
|
26
|
+
}
|
|
27
|
+
return /* @__PURE__ */ jsxs(
|
|
28
|
+
Comp,
|
|
29
|
+
{
|
|
30
|
+
ref,
|
|
31
|
+
"aria-busy": streaming,
|
|
32
|
+
"aria-live": ariaLive,
|
|
33
|
+
className: cn("whitespace-pre-wrap break-words", className),
|
|
34
|
+
...props,
|
|
35
|
+
children: [
|
|
36
|
+
current.settled,
|
|
37
|
+
current.chunks.map((c) => /* @__PURE__ */ jsx("span", { className: "nx-reveal motion-reduce:animate-none", children: c.text }, c.id)),
|
|
38
|
+
streaming && /* @__PURE__ */ jsx(
|
|
39
|
+
"span",
|
|
40
|
+
{
|
|
41
|
+
"aria-hidden": "true",
|
|
42
|
+
"data-caret": "",
|
|
43
|
+
className: "nx-caret ms-0.5 inline-block h-[1em] w-[2px] align-text-bottom rounded-full bg-[var(--color-primary)] motion-reduce:animate-none"
|
|
44
|
+
}
|
|
45
|
+
)
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
StreamingText.displayName = "StreamingText";
|
|
52
|
+
|
|
53
|
+
export {
|
|
54
|
+
StreamingText
|
|
55
|
+
};
|