@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
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import {
|
|
3
|
+
Provider,
|
|
4
|
+
Tooltip
|
|
5
|
+
} from "./chunk-XQDD76EF.js";
|
|
6
|
+
import {
|
|
7
|
+
useControllableState
|
|
8
|
+
} from "./chunk-JLUCMNVS.js";
|
|
9
|
+
import {
|
|
10
|
+
IconButton
|
|
11
|
+
} from "./chunk-CQWYZPPJ.js";
|
|
12
|
+
import {
|
|
13
|
+
useNexubMessages
|
|
14
|
+
} from "./chunk-743Y5MY3.js";
|
|
15
|
+
import {
|
|
16
|
+
cn
|
|
17
|
+
} from "./chunk-Q7G5WGYV.js";
|
|
18
|
+
|
|
19
|
+
// src/components/MessageBubble/MessageBubble.tsx
|
|
20
|
+
import * as React from "react";
|
|
21
|
+
import { Copy, RefreshCw, ThumbsDown, ThumbsUp } from "@nexub/icons";
|
|
22
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
23
|
+
var defaultMessageStrings = {
|
|
24
|
+
youSaid: "You said",
|
|
25
|
+
assistantSaid: "Assistant said",
|
|
26
|
+
failedToSend: "Failed to send",
|
|
27
|
+
retry: "Retry",
|
|
28
|
+
copy: "Copy",
|
|
29
|
+
copied: "Copied",
|
|
30
|
+
goodResponse: "Good response",
|
|
31
|
+
badResponse: "Bad response",
|
|
32
|
+
regenerate: "Regenerate"
|
|
33
|
+
};
|
|
34
|
+
var MessageBubble = React.forwardRef(
|
|
35
|
+
({ from, avatar, name, status, onRetry, messages, className, children, ...props }, ref) => {
|
|
36
|
+
const m = { ...useNexubMessages(), ...messages };
|
|
37
|
+
const label = name ?? (from === "user" ? m.youSaid : from === "assistant" ? m.assistantSaid : void 0);
|
|
38
|
+
const error = status === "error" && /* @__PURE__ */ jsxs("p", { role: "alert", className: "mt-1 flex items-center gap-2 text-label-sm text-[var(--color-error)]", children: [
|
|
39
|
+
m.failedToSend,
|
|
40
|
+
onRetry && /* @__PURE__ */ jsx(
|
|
41
|
+
"button",
|
|
42
|
+
{
|
|
43
|
+
type: "button",
|
|
44
|
+
onClick: onRetry,
|
|
45
|
+
className: "nx-state-layer rounded-shape-min px-1 font-medium text-[var(--color-primary)] underline-offset-2 hover:underline",
|
|
46
|
+
children: m.retry
|
|
47
|
+
}
|
|
48
|
+
)
|
|
49
|
+
] });
|
|
50
|
+
return /* @__PURE__ */ jsx(
|
|
51
|
+
"article",
|
|
52
|
+
{
|
|
53
|
+
ref,
|
|
54
|
+
"aria-label": label,
|
|
55
|
+
"aria-busy": status === "sending" || void 0,
|
|
56
|
+
"data-from": from,
|
|
57
|
+
className: cn(
|
|
58
|
+
"group flex w-full",
|
|
59
|
+
from === "user" && "flex-col items-end",
|
|
60
|
+
from === "assistant" && "items-start gap-3",
|
|
61
|
+
from === "system" && "justify-center text-center text-label-sm text-[var(--color-on-surface-muted)]",
|
|
62
|
+
className
|
|
63
|
+
),
|
|
64
|
+
...props,
|
|
65
|
+
children: from === "user" ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
66
|
+
/* @__PURE__ */ jsx("div", { className: "max-w-[85%] whitespace-pre-wrap break-words rounded-shape-container rounded-ee-[6px] bg-[var(--color-primary-container)] px-4 py-2.5 text-body-md text-[var(--color-on-primary-container)]", children }),
|
|
67
|
+
error
|
|
68
|
+
] }) : from === "assistant" ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
69
|
+
avatar && /* @__PURE__ */ jsx("div", { className: "shrink-0", children: avatar }),
|
|
70
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1 text-body-md text-[var(--color-on-surface)]", children: [
|
|
71
|
+
children,
|
|
72
|
+
error
|
|
73
|
+
] })
|
|
74
|
+
] }) : /* @__PURE__ */ jsxs("div", { children: [
|
|
75
|
+
children,
|
|
76
|
+
error
|
|
77
|
+
] })
|
|
78
|
+
}
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
);
|
|
82
|
+
MessageBubble.displayName = "MessageBubble";
|
|
83
|
+
var MessageActions = React.forwardRef(
|
|
84
|
+
({ text = "", copy = true, feedback: feedbackProp, defaultFeedback = null, onFeedback, onRegenerate, messages, className, ...props }, ref) => {
|
|
85
|
+
const m = { ...useNexubMessages(), ...messages };
|
|
86
|
+
const [feedback, setFeedback] = useControllableState({
|
|
87
|
+
value: feedbackProp,
|
|
88
|
+
defaultValue: defaultFeedback,
|
|
89
|
+
onChange: onFeedback
|
|
90
|
+
});
|
|
91
|
+
const [copied, setCopied] = React.useState(false);
|
|
92
|
+
const timer = React.useRef(void 0);
|
|
93
|
+
React.useEffect(() => () => clearTimeout(timer.current), []);
|
|
94
|
+
const onCopy = async () => {
|
|
95
|
+
try {
|
|
96
|
+
await navigator.clipboard.writeText(text);
|
|
97
|
+
} catch {
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
setCopied(true);
|
|
101
|
+
clearTimeout(timer.current);
|
|
102
|
+
timer.current = setTimeout(() => setCopied(false), 1500);
|
|
103
|
+
};
|
|
104
|
+
const toggle = (value) => setFeedback(feedback === value ? null : value);
|
|
105
|
+
return /* @__PURE__ */ jsx(Provider, { children: /* @__PURE__ */ jsxs(
|
|
106
|
+
"div",
|
|
107
|
+
{
|
|
108
|
+
ref,
|
|
109
|
+
className: cn(
|
|
110
|
+
"mt-1 flex items-center gap-0.5 transition-opacity duration-effects-fast ease-effects-fast",
|
|
111
|
+
"[@media(hover:hover)]:opacity-0 group-hover:opacity-100 group-focus-within:opacity-100",
|
|
112
|
+
className
|
|
113
|
+
),
|
|
114
|
+
...props,
|
|
115
|
+
children: [
|
|
116
|
+
copy && /* @__PURE__ */ jsx(Tooltip, { label: copied ? m.copied : m.copy, children: /* @__PURE__ */ jsx(IconButton, { size: "sm", label: m.copy, onClick: onCopy, children: copied ? /* @__PURE__ */ jsx("svg", { className: "h-4 w-4", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { className: "nx-check-draw", pathLength: 1, d: "M20 6 9 17l-5-5" }) }) : /* @__PURE__ */ jsx(Copy, { size: "sm", "aria-hidden": "true" }) }) }),
|
|
117
|
+
onFeedback && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
118
|
+
/* @__PURE__ */ jsx(Tooltip, { label: m.goodResponse, children: /* @__PURE__ */ jsx(IconButton, { size: "sm", label: m.goodResponse, "aria-pressed": feedback === "up", onClick: () => toggle("up"), children: /* @__PURE__ */ jsx(ThumbsUp, { size: "sm", "aria-hidden": "true", className: cn(feedback === "up" && "text-[var(--color-primary)]") }) }) }),
|
|
119
|
+
/* @__PURE__ */ jsx(Tooltip, { label: m.badResponse, children: /* @__PURE__ */ jsx(IconButton, { size: "sm", label: m.badResponse, "aria-pressed": feedback === "down", onClick: () => toggle("down"), children: /* @__PURE__ */ jsx(ThumbsDown, { size: "sm", "aria-hidden": "true", className: cn(feedback === "down" && "text-[var(--color-primary)]") }) }) })
|
|
120
|
+
] }),
|
|
121
|
+
onRegenerate && /* @__PURE__ */ jsx(Tooltip, { label: m.regenerate, children: /* @__PURE__ */ jsx(IconButton, { size: "sm", label: m.regenerate, onClick: onRegenerate, children: /* @__PURE__ */ jsx(RefreshCw, { size: "sm", "aria-hidden": "true" }) }) }),
|
|
122
|
+
/* @__PURE__ */ jsx("span", { role: "status", className: "sr-only", children: copied ? m.copied : "" })
|
|
123
|
+
]
|
|
124
|
+
}
|
|
125
|
+
) });
|
|
126
|
+
}
|
|
127
|
+
);
|
|
128
|
+
MessageActions.displayName = "MessageActions";
|
|
129
|
+
|
|
130
|
+
export {
|
|
131
|
+
defaultMessageStrings,
|
|
132
|
+
MessageBubble,
|
|
133
|
+
MessageActions
|
|
134
|
+
};
|
|
@@ -12,14 +12,14 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
|
12
12
|
var linkVariants = cva(
|
|
13
13
|
[
|
|
14
14
|
"inline-flex items-center gap-1 transition-colors",
|
|
15
|
-
"
|
|
15
|
+
"rounded-shape-min"
|
|
16
16
|
],
|
|
17
17
|
{
|
|
18
18
|
variants: {
|
|
19
19
|
variant: {
|
|
20
|
-
default: "text-[var(--color-
|
|
21
|
-
muted: "text-[var(--color-
|
|
22
|
-
underlined: "text-[var(--color-
|
|
20
|
+
default: "text-[var(--color-primary)] underline-offset-4 hover:underline",
|
|
21
|
+
muted: "text-[var(--color-on-surface-muted)] hover:text-[var(--color-on-surface)]",
|
|
22
|
+
underlined: "text-[var(--color-primary)] underline underline-offset-4 hover:decoration-2"
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
25
|
defaultVariants: {
|
|
@@ -16,8 +16,9 @@ var logoVariants = cva("inline-flex min-w-0 max-w-full items-center gap-2", {
|
|
|
16
16
|
lg: "h-10"
|
|
17
17
|
},
|
|
18
18
|
tone: {
|
|
19
|
-
default: "text-[var(--color-
|
|
20
|
-
|
|
19
|
+
default: "text-[var(--color-on-surface)]",
|
|
20
|
+
// Brand asset: the inverse mark is always white (on dark or imagery), in both themes.
|
|
21
|
+
inverse: "text-[var(--color-palette-neutral-100)]"
|
|
21
22
|
}
|
|
22
23
|
},
|
|
23
24
|
defaultVariants: {
|
|
@@ -84,7 +85,7 @@ var Logo = React.forwardRef(
|
|
|
84
85
|
wordmarkSizeMap[resolvedSize],
|
|
85
86
|
// leading-normal so the clip box doesn't cut descenders.
|
|
86
87
|
"min-w-0 truncate font-medium tracking-tight leading-normal",
|
|
87
|
-
resolvedTone === "inverse" ? "opacity-70" : "text-[var(--color-
|
|
88
|
+
resolvedTone === "inverse" ? "opacity-70" : "text-[var(--color-on-surface-muted)]"
|
|
88
89
|
),
|
|
89
90
|
children: product
|
|
90
91
|
}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
|
+
import {
|
|
3
|
+
layoutProps
|
|
4
|
+
} from "./chunk-VLQGQFW7.js";
|
|
2
5
|
import {
|
|
3
6
|
cn
|
|
4
7
|
} from "./chunk-Q7G5WGYV.js";
|
|
@@ -25,22 +28,13 @@ var Grid = React.forwardRef(
|
|
|
25
28
|
...rest
|
|
26
29
|
}, ref) => {
|
|
27
30
|
const Comp = asChild ? Slot : "div";
|
|
28
|
-
const
|
|
29
|
-
...cols !== void 0 ? {
|
|
30
|
-
gridTemplateColumns: typeof cols === "number" ? `repeat(${cols}, minmax(0, 1fr))` : cols
|
|
31
|
-
} : {},
|
|
32
|
-
...rows !== void 0 ? {
|
|
33
|
-
gridTemplateRows: typeof rows === "number" ? `repeat(${rows}, minmax(0, 1fr))` : rows
|
|
34
|
-
} : {},
|
|
35
|
-
...gap !== void 0 ? { gap: typeof gap === "number" ? `${gap * 0.25}rem` : gap } : {},
|
|
36
|
-
...style
|
|
37
|
-
};
|
|
31
|
+
const layout = layoutProps({ gap, cols, rows, style });
|
|
38
32
|
return /* @__PURE__ */ jsx(
|
|
39
33
|
Comp,
|
|
40
34
|
{
|
|
41
35
|
ref,
|
|
42
|
-
className: cn("grid", flow && flowClass[flow], className),
|
|
43
|
-
style:
|
|
36
|
+
className: cn("grid", layout.className, flow && flowClass[flow], className),
|
|
37
|
+
style: layout.style,
|
|
44
38
|
...rest,
|
|
45
39
|
children
|
|
46
40
|
}
|
|
@@ -3,24 +3,6 @@ import {
|
|
|
3
3
|
useIsomorphicLayoutEffect
|
|
4
4
|
} from "./chunk-NHUQLIHL.js";
|
|
5
5
|
|
|
6
|
-
// src/hooks/useMergedRefs.ts
|
|
7
|
-
import { useCallback, useRef } from "react";
|
|
8
|
-
function setRef(ref, value) {
|
|
9
|
-
if (!ref) return;
|
|
10
|
-
if (typeof ref === "function") {
|
|
11
|
-
ref(value);
|
|
12
|
-
} else {
|
|
13
|
-
ref.current = value;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
function useMergedRefs(...refs) {
|
|
17
|
-
const refsRef = useRef(refs);
|
|
18
|
-
refsRef.current = refs;
|
|
19
|
-
return useCallback((node) => {
|
|
20
|
-
for (const ref of refsRef.current) setRef(ref, node);
|
|
21
|
-
}, []);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
6
|
// src/hooks/useSlidingIndicator.ts
|
|
25
7
|
function useSlidingIndicator(ref, activeSelector) {
|
|
26
8
|
useIsomorphicLayoutEffect(() => {
|
|
@@ -50,6 +32,5 @@ function useSlidingIndicator(ref, activeSelector) {
|
|
|
50
32
|
}
|
|
51
33
|
|
|
52
34
|
export {
|
|
53
|
-
useMergedRefs,
|
|
54
35
|
useSlidingIndicator
|
|
55
36
|
};
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
// src/components/NexubProvider/NexubProvider.tsx
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
import { DirectionProvider } from "@radix-ui/react-direction";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
var defaultMessages = {
|
|
8
|
+
close: "Close",
|
|
9
|
+
dismissAlert: "Dismiss alert",
|
|
10
|
+
dismissBanner: "Dismiss banner",
|
|
11
|
+
remove: "Remove",
|
|
12
|
+
removeFilter: "Remove filter",
|
|
13
|
+
removeFile: (fileName) => `Remove ${fileName}`,
|
|
14
|
+
uploadFiles: "Upload files",
|
|
15
|
+
clickToUpload: "Click to upload",
|
|
16
|
+
orDragAndDrop: "or drag and drop",
|
|
17
|
+
clearSearch: "Clear search",
|
|
18
|
+
showPassword: "Show password",
|
|
19
|
+
hidePassword: "Hide password",
|
|
20
|
+
increment: "Increment",
|
|
21
|
+
decrement: "Decrement",
|
|
22
|
+
loading: "Loading\u2026",
|
|
23
|
+
pagination: "Pagination",
|
|
24
|
+
previousPage: "Go to previous page",
|
|
25
|
+
nextPage: "Go to next page",
|
|
26
|
+
goToPage: (page) => `Go to page ${page}`,
|
|
27
|
+
breadcrumb: "breadcrumb",
|
|
28
|
+
breadcrumbMore: "More",
|
|
29
|
+
moreCount: (count) => `${count} more`,
|
|
30
|
+
rating: "Rating",
|
|
31
|
+
ratingStars: (stars) => `${stars} star${stars !== 1 ? "s" : ""}`,
|
|
32
|
+
mainNavigation: "Main",
|
|
33
|
+
sidebar: "Sidebar",
|
|
34
|
+
searchPlaceholder: "Search\u2026",
|
|
35
|
+
noResults: "No results found.",
|
|
36
|
+
pickDate: "Pick a date",
|
|
37
|
+
pickDateRange: "Pick a date range",
|
|
38
|
+
commandPalette: "Command palette",
|
|
39
|
+
notifications: "Notifications ({hotkey})",
|
|
40
|
+
undo: "Undo",
|
|
41
|
+
promptLabel: "Message",
|
|
42
|
+
sendMessage: "Send message",
|
|
43
|
+
stopGenerating: "Stop generating",
|
|
44
|
+
promptHint: "Press Enter to send, Shift+Enter for a new line",
|
|
45
|
+
thinking: "Thinking",
|
|
46
|
+
youSaid: "You said",
|
|
47
|
+
assistantSaid: "Assistant said",
|
|
48
|
+
failedToSend: "Failed to send",
|
|
49
|
+
retry: "Retry",
|
|
50
|
+
copy: "Copy",
|
|
51
|
+
copied: "Copied",
|
|
52
|
+
goodResponse: "Good response",
|
|
53
|
+
badResponse: "Bad response",
|
|
54
|
+
regenerate: "Regenerate",
|
|
55
|
+
sources: "Sources",
|
|
56
|
+
source: (n) => `Source ${n}`,
|
|
57
|
+
jumpToLatest: "Jump to latest",
|
|
58
|
+
conversation: "Conversation"
|
|
59
|
+
};
|
|
60
|
+
var NexubContext = React.createContext({
|
|
61
|
+
locale: void 0,
|
|
62
|
+
dir: "ltr",
|
|
63
|
+
messages: defaultMessages
|
|
64
|
+
});
|
|
65
|
+
var RTL_LANGUAGES = /* @__PURE__ */ new Set(["ar", "he", "fa", "ur"]);
|
|
66
|
+
function directionOf(locale) {
|
|
67
|
+
return RTL_LANGUAGES.has(locale.toLowerCase().split(/[-_]/)[0]) ? "rtl" : "ltr";
|
|
68
|
+
}
|
|
69
|
+
function NexubProvider({ locale = "en", dir, messages, children }) {
|
|
70
|
+
const resolvedDir = dir ?? directionOf(locale);
|
|
71
|
+
const value = React.useMemo(
|
|
72
|
+
() => ({ locale, dir: resolvedDir, messages: { ...defaultMessages, ...messages } }),
|
|
73
|
+
[locale, resolvedDir, messages]
|
|
74
|
+
);
|
|
75
|
+
return /* @__PURE__ */ jsx(NexubContext.Provider, { value, children: /* @__PURE__ */ jsx(DirectionProvider, { dir: resolvedDir, children }) });
|
|
76
|
+
}
|
|
77
|
+
function useNexubMessages() {
|
|
78
|
+
return React.useContext(NexubContext).messages;
|
|
79
|
+
}
|
|
80
|
+
function useLocale() {
|
|
81
|
+
const { locale = "en", dir } = React.useContext(NexubContext);
|
|
82
|
+
return { locale, dir };
|
|
83
|
+
}
|
|
84
|
+
function useIntlLocale(explicit) {
|
|
85
|
+
const ctx = React.useContext(NexubContext).locale;
|
|
86
|
+
return explicit ?? ctx;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export {
|
|
90
|
+
defaultMessages,
|
|
91
|
+
NexubProvider,
|
|
92
|
+
useNexubMessages,
|
|
93
|
+
useLocale,
|
|
94
|
+
useIntlLocale
|
|
95
|
+
};
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
|
+
import {
|
|
3
|
+
useNexubMessages
|
|
4
|
+
} from "./chunk-743Y5MY3.js";
|
|
2
5
|
import {
|
|
3
6
|
cn
|
|
4
7
|
} from "./chunk-Q7G5WGYV.js";
|
|
@@ -8,22 +11,25 @@ import * as React from "react";
|
|
|
8
11
|
import { Slot } from "@radix-ui/react-slot";
|
|
9
12
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
10
13
|
var Root = React.forwardRef(
|
|
11
|
-
({ className, collapsed = false, ...props }, ref) =>
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
14
|
+
({ className, collapsed = false, ...props }, ref) => {
|
|
15
|
+
const messages = useNexubMessages();
|
|
16
|
+
return /* @__PURE__ */ jsx(
|
|
17
|
+
"nav",
|
|
18
|
+
{
|
|
19
|
+
ref,
|
|
20
|
+
"aria-label": messages.sidebar,
|
|
21
|
+
"data-collapsed": collapsed,
|
|
22
|
+
className: cn(
|
|
23
|
+
// Chrome recedes: a tonal panel, no divider.
|
|
24
|
+
"group/sidebar flex flex-col gap-1 bg-[var(--color-surface-container-low)] transition-[width] duration-spatial-default ease-spatial-default",
|
|
25
|
+
collapsed ? "w-[var(--size-nav-sidebar-collapsed,56px)]" : "w-[var(--size-nav-sidebar,240px)]",
|
|
26
|
+
"h-full overflow-y-auto overflow-x-hidden",
|
|
27
|
+
className
|
|
28
|
+
),
|
|
29
|
+
...props
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
}
|
|
27
33
|
);
|
|
28
34
|
Root.displayName = "Sidebar.Root";
|
|
29
35
|
var Header = React.forwardRef(
|
|
@@ -48,7 +54,7 @@ var Header = React.forwardRef(
|
|
|
48
54
|
Header.displayName = "Sidebar.Header";
|
|
49
55
|
var Group = React.forwardRef(
|
|
50
56
|
({ className, label, children, ...props }, ref) => /* @__PURE__ */ jsxs("div", { ref, className: cn("flex flex-col gap-0.5 p-2", className), ...props, children: [
|
|
51
|
-
label && /* @__PURE__ */ jsx("p", { className: "px-2 py-1 text-xs font-semibold uppercase tracking-wider text-[var(--color-
|
|
57
|
+
label && /* @__PURE__ */ jsx("p", { className: "px-2 py-1 text-xs font-semibold uppercase tracking-wider text-[var(--color-on-surface-muted)]", children: label }),
|
|
52
58
|
children
|
|
53
59
|
] })
|
|
54
60
|
);
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import {
|
|
3
|
+
cn
|
|
4
|
+
} from "./chunk-Q7G5WGYV.js";
|
|
5
|
+
|
|
6
|
+
// src/components/StatusPill/StatusPill.tsx
|
|
7
|
+
import * as React from "react";
|
|
8
|
+
import { cva } from "class-variance-authority";
|
|
9
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
var statusPillVariants = cva(
|
|
11
|
+
"inline-flex items-center gap-1.5 rounded-shape-control px-2.5 py-1 text-xs font-medium select-none",
|
|
12
|
+
{
|
|
13
|
+
variants: {
|
|
14
|
+
tone: {
|
|
15
|
+
neutral: "bg-[var(--color-surface-container-high)] text-[var(--color-on-surface-variant)] border border-[var(--color-outline-variant)]",
|
|
16
|
+
info: "bg-[var(--color-info-container)] text-[var(--color-on-info-container)] border border-[color-mix(in_srgb,var(--color-info)_35%,transparent)]",
|
|
17
|
+
success: "bg-[var(--color-success-container)] text-[var(--color-on-success-container)] border border-[color-mix(in_srgb,var(--color-success)_35%,transparent)]",
|
|
18
|
+
warning: "bg-[var(--color-warning-container)] text-[var(--color-on-warning-container)] border border-[color-mix(in_srgb,var(--color-warning)_35%,transparent)]",
|
|
19
|
+
danger: "bg-[var(--color-error-container)] text-[var(--color-on-error-container)] border border-[color-mix(in_srgb,var(--color-error)_35%,transparent)]",
|
|
20
|
+
leap: "bg-[var(--color-leap-container)] text-[var(--color-on-leap-container)] border border-[color-mix(in_srgb,var(--color-leap)_35%,transparent)]",
|
|
21
|
+
bookub: "bg-[var(--color-bookub-container)] text-[var(--color-on-bookub-container)] border border-[color-mix(in_srgb,var(--color-bookub)_35%,transparent)]",
|
|
22
|
+
payub: "bg-[var(--color-payub-container)] text-[var(--color-on-payub-container)] border border-[color-mix(in_srgb,var(--color-payub)_35%,transparent)]",
|
|
23
|
+
founderub: "bg-[var(--color-founderub-container)] text-[var(--color-on-founderub-container)] border border-[color-mix(in_srgb,var(--color-founderub)_35%,transparent)]"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
defaultVariants: {
|
|
27
|
+
tone: "neutral"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
var dotColorMap = {
|
|
32
|
+
neutral: "bg-[var(--color-outline)]",
|
|
33
|
+
info: "bg-[var(--color-info)]",
|
|
34
|
+
success: "bg-[var(--color-success)]",
|
|
35
|
+
warning: "bg-[var(--color-warning)]",
|
|
36
|
+
danger: "bg-[var(--color-error)]",
|
|
37
|
+
leap: "bg-[var(--color-leap)]",
|
|
38
|
+
bookub: "bg-[var(--color-bookub)]",
|
|
39
|
+
payub: "bg-[var(--color-payub)]",
|
|
40
|
+
founderub: "bg-[var(--color-founderub)]"
|
|
41
|
+
};
|
|
42
|
+
var pulseTones = ["success", "info"];
|
|
43
|
+
var StatusPill = React.forwardRef(
|
|
44
|
+
({ className, tone = "neutral", label, dot = false, ...props }, ref) => {
|
|
45
|
+
const shouldPulse = dot && pulseTones.includes(tone);
|
|
46
|
+
return /* @__PURE__ */ jsxs(
|
|
47
|
+
"span",
|
|
48
|
+
{
|
|
49
|
+
ref,
|
|
50
|
+
className: cn(statusPillVariants({ tone }), className),
|
|
51
|
+
...props,
|
|
52
|
+
children: [
|
|
53
|
+
dot && /* @__PURE__ */ jsxs("span", { className: "relative inline-flex h-2 w-2 shrink-0", children: [
|
|
54
|
+
shouldPulse && /* @__PURE__ */ jsx(
|
|
55
|
+
"span",
|
|
56
|
+
{
|
|
57
|
+
className: cn(
|
|
58
|
+
"animate-ping absolute inline-flex h-full w-full rounded-full opacity-75",
|
|
59
|
+
dotColorMap[tone]
|
|
60
|
+
),
|
|
61
|
+
"aria-hidden": "true"
|
|
62
|
+
}
|
|
63
|
+
),
|
|
64
|
+
/* @__PURE__ */ jsx(
|
|
65
|
+
"span",
|
|
66
|
+
{
|
|
67
|
+
className: cn(
|
|
68
|
+
"relative inline-flex rounded-full h-2 w-2",
|
|
69
|
+
dotColorMap[tone]
|
|
70
|
+
)
|
|
71
|
+
}
|
|
72
|
+
)
|
|
73
|
+
] }),
|
|
74
|
+
label
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
);
|
|
80
|
+
StatusPill.displayName = "StatusPill";
|
|
81
|
+
|
|
82
|
+
export {
|
|
83
|
+
statusPillVariants,
|
|
84
|
+
StatusPill
|
|
85
|
+
};
|
|
@@ -4,13 +4,16 @@ import {
|
|
|
4
4
|
} from "./chunk-JLUCMNVS.js";
|
|
5
5
|
import {
|
|
6
6
|
Input
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-JHVYI5GK.js";
|
|
8
8
|
import {
|
|
9
9
|
currencySymbol,
|
|
10
10
|
formatForDisplay,
|
|
11
11
|
formatForEditing,
|
|
12
12
|
parseMoney
|
|
13
13
|
} from "./chunk-CIQHFMF6.js";
|
|
14
|
+
import {
|
|
15
|
+
useIntlLocale
|
|
16
|
+
} from "./chunk-743Y5MY3.js";
|
|
14
17
|
import {
|
|
15
18
|
cn
|
|
16
19
|
} from "./chunk-Q7G5WGYV.js";
|
|
@@ -19,7 +22,8 @@ import {
|
|
|
19
22
|
import * as React from "react";
|
|
20
23
|
import { jsx } from "react/jsx-runtime";
|
|
21
24
|
var MoneyInput = React.forwardRef(
|
|
22
|
-
({ value: valueProp, defaultValue = null, onValueChange, currency, locale, onFocus, onBlur, className, ...props }, ref) => {
|
|
25
|
+
({ value: valueProp, defaultValue = null, onValueChange, currency, locale: localeProp, onFocus, onBlur, className, ...props }, ref) => {
|
|
26
|
+
const locale = useIntlLocale(localeProp);
|
|
23
27
|
const [value, setValue] = useControllableState({
|
|
24
28
|
value: valueProp,
|
|
25
29
|
defaultValue,
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
|
+
import {
|
|
3
|
+
layoutProps
|
|
4
|
+
} from "./chunk-VLQGQFW7.js";
|
|
2
5
|
import {
|
|
3
6
|
cn
|
|
4
7
|
} from "./chunk-Q7G5WGYV.js";
|
|
@@ -27,18 +30,13 @@ var Flex = React.forwardRef(
|
|
|
27
30
|
...rest
|
|
28
31
|
}, ref) => {
|
|
29
32
|
const Comp = asChild ? Slot : "div";
|
|
30
|
-
const
|
|
31
|
-
...gap !== void 0 ? { gap: typeof gap === "number" ? `${gap * 0.25}rem` : gap } : {},
|
|
32
|
-
...align ? { alignItems: align } : {},
|
|
33
|
-
...justify ? { justifyContent: justify } : {},
|
|
34
|
-
...style
|
|
35
|
-
};
|
|
33
|
+
const layout = layoutProps({ gap, align, justify, style });
|
|
36
34
|
return /* @__PURE__ */ jsx(
|
|
37
35
|
Comp,
|
|
38
36
|
{
|
|
39
37
|
ref,
|
|
40
|
-
className: cn("flex", directionClass[direction], wrap && "flex-wrap", className),
|
|
41
|
-
style:
|
|
38
|
+
className: cn("flex", layout.className, directionClass[direction], wrap && "flex-wrap", className),
|
|
39
|
+
style: layout.style,
|
|
42
40
|
...rest,
|
|
43
41
|
children
|
|
44
42
|
}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
|
+
import {
|
|
3
|
+
useNexubMessages
|
|
4
|
+
} from "./chunk-743Y5MY3.js";
|
|
2
5
|
import {
|
|
3
6
|
cn
|
|
4
7
|
} from "./chunk-Q7G5WGYV.js";
|
|
@@ -22,10 +25,10 @@ var chipVariants = cva(
|
|
|
22
25
|
success: "bg-[var(--color-success-container)] text-[var(--color-on-success-container)]",
|
|
23
26
|
warning: "bg-[var(--color-warning-container)] text-[var(--color-on-warning-container)]",
|
|
24
27
|
danger: "bg-[var(--color-error-container)] text-[var(--color-on-error-container)]",
|
|
25
|
-
leap: "bg-[
|
|
26
|
-
bookub: "bg-[
|
|
27
|
-
payub: "bg-[
|
|
28
|
-
founderub: "bg-[
|
|
28
|
+
leap: "bg-[var(--color-leap-container)] text-[var(--color-on-leap-container)]",
|
|
29
|
+
bookub: "bg-[var(--color-bookub-container)] text-[var(--color-on-bookub-container)]",
|
|
30
|
+
payub: "bg-[var(--color-payub-container)] text-[var(--color-on-payub-container)]",
|
|
31
|
+
founderub: "bg-[var(--color-founderub-container)] text-[var(--color-on-founderub-container)]"
|
|
29
32
|
}
|
|
30
33
|
},
|
|
31
34
|
defaultVariants: {
|
|
@@ -36,6 +39,7 @@ var chipVariants = cva(
|
|
|
36
39
|
);
|
|
37
40
|
var Chip = React.forwardRef(
|
|
38
41
|
({ className, size, tone = "neutral", onRemove, children, ...props }, ref) => {
|
|
42
|
+
const messages = useNexubMessages();
|
|
39
43
|
return /* @__PURE__ */ jsxs(
|
|
40
44
|
"span",
|
|
41
45
|
{
|
|
@@ -48,14 +52,14 @@ var Chip = React.forwardRef(
|
|
|
48
52
|
"button",
|
|
49
53
|
{
|
|
50
54
|
type: "button",
|
|
51
|
-
"aria-label":
|
|
55
|
+
"aria-label": messages.remove,
|
|
52
56
|
onClick: (e) => {
|
|
53
57
|
e.stopPropagation();
|
|
54
58
|
onRemove();
|
|
55
59
|
},
|
|
56
60
|
className: cn(
|
|
57
61
|
// State layer for hover/press; focus = the global ring.
|
|
58
|
-
"nx-state-layer inline-flex items-center justify-center rounded-full text-current -
|
|
62
|
+
"nx-state-layer inline-flex items-center justify-center rounded-full text-current -me-1",
|
|
59
63
|
size === "sm" ? "w-4 h-4" : "w-5 h-5"
|
|
60
64
|
),
|
|
61
65
|
children: /* @__PURE__ */ jsx(
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import {
|
|
3
|
-
enterExit,
|
|
4
3
|
floatingSurface
|
|
5
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-FLZD7HQY.js";
|
|
6
5
|
import {
|
|
7
6
|
glassSurfaceClass
|
|
8
7
|
} from "./chunk-DEIBF3P7.js";
|
|
@@ -28,13 +27,7 @@ var Content2 = React.forwardRef(
|
|
|
28
27
|
className: cn(
|
|
29
28
|
"z-[var(--z-popover)] p-4 outline-none",
|
|
30
29
|
floatingSurface,
|
|
31
|
-
|
|
32
|
-
"outline-none",
|
|
33
|
-
"data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
34
|
-
"data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0",
|
|
35
|
-
"data-[state=open]:zoom-in-95 data-[state=closed]:zoom-out-95",
|
|
36
|
-
"data-[side=bottom]:slide-in-from-top-2 data-[side=top]:slide-in-from-bottom-2",
|
|
37
|
-
"data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2",
|
|
30
|
+
"nx-motion nx-pop origin-[var(--radix-popover-content-transform-origin)]",
|
|
38
31
|
surface === "glass" && glassSurfaceClass,
|
|
39
32
|
className
|
|
40
33
|
),
|
|
@@ -51,7 +44,7 @@ var Arrow2 = React.forwardRef(
|
|
|
51
44
|
RadixPopover.Arrow,
|
|
52
45
|
{
|
|
53
46
|
ref,
|
|
54
|
-
className: cn("fill-[var(--color-
|
|
47
|
+
className: cn("fill-[var(--color-outline-variant)]", className),
|
|
55
48
|
...props
|
|
56
49
|
}
|
|
57
50
|
);
|