@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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import {
|
|
3
3
|
floatingSurface
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-FLZD7HQY.js";
|
|
5
5
|
import {
|
|
6
6
|
cn
|
|
7
7
|
} from "./chunk-Q7G5WGYV.js";
|
|
@@ -56,7 +56,7 @@ var Trigger2 = React.forwardRef(
|
|
|
56
56
|
ChevronDown,
|
|
57
57
|
{
|
|
58
58
|
size: "xs",
|
|
59
|
-
className: "relative
|
|
59
|
+
className: "relative ms-1 transition duration-300 group-data-[state=open]:rotate-180",
|
|
60
60
|
"aria-hidden": "true"
|
|
61
61
|
}
|
|
62
62
|
)
|
|
@@ -71,7 +71,7 @@ var Content2 = React.forwardRef(
|
|
|
71
71
|
{
|
|
72
72
|
ref,
|
|
73
73
|
className: cn(
|
|
74
|
-
"
|
|
74
|
+
"nx-motion start-0 top-0 w-full md:absolute md:w-auto",
|
|
75
75
|
className
|
|
76
76
|
),
|
|
77
77
|
...props
|
|
@@ -94,14 +94,14 @@ var Link2 = React.forwardRef(
|
|
|
94
94
|
);
|
|
95
95
|
Link2.displayName = "NavigationMenu.Link";
|
|
96
96
|
var Viewport2 = React.forwardRef(
|
|
97
|
-
({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { className: "absolute
|
|
97
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { className: "absolute start-0 top-full flex justify-center", children: /* @__PURE__ */ jsx(
|
|
98
98
|
RadixNav.Viewport,
|
|
99
99
|
{
|
|
100
100
|
ref,
|
|
101
101
|
className: cn(
|
|
102
|
-
"origin-top
|
|
102
|
+
"nx-motion nx-pop origin-top relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden",
|
|
103
103
|
floatingSurface,
|
|
104
|
-
"
|
|
104
|
+
"md:w-[var(--radix-navigation-menu-viewport-width)]",
|
|
105
105
|
className
|
|
106
106
|
),
|
|
107
107
|
...props
|
|
@@ -115,11 +115,11 @@ var Indicator2 = React.forwardRef(
|
|
|
115
115
|
{
|
|
116
116
|
ref,
|
|
117
117
|
className: cn(
|
|
118
|
-
"top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden
|
|
118
|
+
"top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden transition-opacity duration-effects-fast ease-effects-fast data-[state=hidden]:opacity-0",
|
|
119
119
|
className
|
|
120
120
|
),
|
|
121
121
|
...props,
|
|
122
|
-
children: /* @__PURE__ */ jsx("div", { className: "relative top-[60%] h-2 w-2 rotate-45 rounded-
|
|
122
|
+
children: /* @__PURE__ */ jsx("div", { className: "relative top-[60%] h-2 w-2 rotate-45 rounded-ss-[2px] bg-[var(--color-outline-variant)] shadow-elevation-1" })
|
|
123
123
|
}
|
|
124
124
|
)
|
|
125
125
|
);
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import {
|
|
3
3
|
inputWrapperVariants
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-JHVYI5GK.js";
|
|
5
|
+
import {
|
|
6
|
+
disabledText
|
|
7
|
+
} from "./chunk-7SXR4PGO.js";
|
|
8
|
+
import {
|
|
9
|
+
useNexubMessages
|
|
10
|
+
} from "./chunk-743Y5MY3.js";
|
|
5
11
|
import {
|
|
6
12
|
cn
|
|
7
13
|
} from "./chunk-Q7G5WGYV.js";
|
|
@@ -36,6 +42,7 @@ var NumberInput = React.forwardRef(
|
|
|
36
42
|
...props
|
|
37
43
|
}, ref) => {
|
|
38
44
|
const [internalValue, setInternalValue] = React.useState(defaultValue);
|
|
45
|
+
const messages = useNexubMessages();
|
|
39
46
|
const controlled = value !== void 0;
|
|
40
47
|
const currentValue = controlled ? value : internalValue;
|
|
41
48
|
const commit = (next) => {
|
|
@@ -51,12 +58,11 @@ var NumberInput = React.forwardRef(
|
|
|
51
58
|
const decrement = () => commit(currentValue - step);
|
|
52
59
|
const stepperButtonClass = cn(
|
|
53
60
|
"flex items-center justify-center px-2 self-stretch shrink-0",
|
|
54
|
-
|
|
55
|
-
"hover:
|
|
56
|
-
|
|
57
|
-
"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[var(--color-ring-default)]"
|
|
61
|
+
// State layer for hover/press; tabIndex -1, so no focus styling needed.
|
|
62
|
+
"nx-state-layer text-[var(--color-on-surface-muted)] hover:text-[var(--color-on-surface)]",
|
|
63
|
+
disabledText
|
|
58
64
|
);
|
|
59
|
-
return /* @__PURE__ */ jsxs("div", { className: cn(inputWrapperVariants({ size, invalid }), "
|
|
65
|
+
return /* @__PURE__ */ jsxs("div", { className: cn(inputWrapperVariants({ size, invalid }), "pe-0 gap-0 overflow-hidden", className), children: [
|
|
60
66
|
/* @__PURE__ */ jsx(
|
|
61
67
|
"input",
|
|
62
68
|
{
|
|
@@ -71,19 +77,19 @@ var NumberInput = React.forwardRef(
|
|
|
71
77
|
"aria-invalid": invalid ?? void 0,
|
|
72
78
|
className: cn(
|
|
73
79
|
// Wrapper owns ALL focus styling — strip every indicator from the inner input.
|
|
74
|
-
"flex-1 min-w-0 bg-transparent text-[var(--color-
|
|
80
|
+
"flex-1 min-w-0 bg-transparent text-[var(--color-on-surface)]",
|
|
75
81
|
"border-0 shadow-none",
|
|
76
82
|
"outline-none focus:outline-none focus-visible:outline-none",
|
|
77
83
|
"ring-0 focus:ring-0 focus-visible:ring-0",
|
|
78
|
-
"placeholder:text-[var(--color-
|
|
79
|
-
"disabled:
|
|
84
|
+
"placeholder:text-[var(--color-on-surface-muted)]",
|
|
85
|
+
"disabled:cursor-not-allowed disabled:text-[var(--color-text-disabled)]",
|
|
80
86
|
"[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",
|
|
81
|
-
size === "sm" ? "text-sm" :
|
|
87
|
+
size === "sm" ? "text-body-sm" : "text-body-md"
|
|
82
88
|
),
|
|
83
89
|
...props
|
|
84
90
|
}
|
|
85
91
|
),
|
|
86
|
-
showSteppers && /* @__PURE__ */ jsxs("div", { className: "flex flex-col border-
|
|
92
|
+
showSteppers && /* @__PURE__ */ jsxs("div", { className: "flex flex-col border-s border-[var(--color-outline-variant)] self-stretch", children: [
|
|
87
93
|
/* @__PURE__ */ jsx(
|
|
88
94
|
"button",
|
|
89
95
|
{
|
|
@@ -91,8 +97,8 @@ var NumberInput = React.forwardRef(
|
|
|
91
97
|
tabIndex: -1,
|
|
92
98
|
onClick: increment,
|
|
93
99
|
disabled: disabled || max !== void 0 && currentValue >= max,
|
|
94
|
-
className: cn(stepperButtonClass, "border-b border-[var(--color-
|
|
95
|
-
"aria-label":
|
|
100
|
+
className: cn(stepperButtonClass, "border-b border-[var(--color-outline-variant)] text-xs leading-none flex-1"),
|
|
101
|
+
"aria-label": messages.increment,
|
|
96
102
|
children: "\u25B2"
|
|
97
103
|
}
|
|
98
104
|
),
|
|
@@ -104,7 +110,7 @@ var NumberInput = React.forwardRef(
|
|
|
104
110
|
onClick: decrement,
|
|
105
111
|
disabled: disabled || min !== void 0 && currentValue <= min,
|
|
106
112
|
className: cn(stepperButtonClass, "text-xs leading-none flex-1"),
|
|
107
|
-
"aria-label":
|
|
113
|
+
"aria-label": messages.decrement,
|
|
108
114
|
children: "\u25BC"
|
|
109
115
|
}
|
|
110
116
|
)
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
import {
|
|
3
3
|
useControllableState
|
|
4
4
|
} from "./chunk-JLUCMNVS.js";
|
|
5
|
+
import {
|
|
6
|
+
useNexubMessages
|
|
7
|
+
} from "./chunk-743Y5MY3.js";
|
|
5
8
|
import {
|
|
6
9
|
cn
|
|
7
10
|
} from "./chunk-Q7G5WGYV.js";
|
|
@@ -38,6 +41,7 @@ var Rating = React.forwardRef(
|
|
|
38
41
|
onChange: onValueChange
|
|
39
42
|
});
|
|
40
43
|
const [hovered, setHovered] = React.useState(null);
|
|
44
|
+
const messages = useNexubMessages();
|
|
41
45
|
const displayValue = hovered ?? value ?? 0;
|
|
42
46
|
const starRefs = React.useRef([]);
|
|
43
47
|
const tabStop = value && value > 0 ? value : 1;
|
|
@@ -54,7 +58,7 @@ var Rating = React.forwardRef(
|
|
|
54
58
|
ref,
|
|
55
59
|
className: cn(ratingVariants({ size }), className),
|
|
56
60
|
role: "radiogroup",
|
|
57
|
-
"aria-label":
|
|
61
|
+
"aria-label": messages.rating,
|
|
58
62
|
"aria-readonly": readOnly || void 0,
|
|
59
63
|
...props,
|
|
60
64
|
children: Array.from({ length: max }, (_, i) => {
|
|
@@ -70,7 +74,7 @@ var Rating = React.forwardRef(
|
|
|
70
74
|
role: "radio",
|
|
71
75
|
tabIndex: starValue === tabStop ? 0 : -1,
|
|
72
76
|
"aria-checked": starValue === (value ?? 0),
|
|
73
|
-
"aria-label":
|
|
77
|
+
"aria-label": messages.ratingStars(starValue),
|
|
74
78
|
disabled: readOnly,
|
|
75
79
|
onClick: () => !readOnly && setValue(starValue),
|
|
76
80
|
onKeyDown: (e) => !readOnly && handleKeyDown(e, starValue),
|
|
@@ -80,7 +84,7 @@ var Rating = React.forwardRef(
|
|
|
80
84
|
"bg-transparent border-0 p-0 m-0 inline-flex items-center justify-center transition-transform",
|
|
81
85
|
!readOnly && "cursor-pointer hover:scale-110",
|
|
82
86
|
readOnly && "cursor-default",
|
|
83
|
-
"
|
|
87
|
+
"rounded-shape-min",
|
|
84
88
|
"disabled:pointer-events-none"
|
|
85
89
|
),
|
|
86
90
|
children: /* @__PURE__ */ jsx(
|
|
@@ -104,8 +108,8 @@ function StarIcon({ filled, ...props }) {
|
|
|
104
108
|
"svg",
|
|
105
109
|
{
|
|
106
110
|
viewBox: "0 0 20 20",
|
|
107
|
-
fill: filled ? "var(--color-
|
|
108
|
-
stroke: filled ? "var(--color-
|
|
111
|
+
fill: filled ? "var(--color-palette-warning-72)" : "none",
|
|
112
|
+
stroke: filled ? "var(--color-warning)" : "var(--color-outline-variant)",
|
|
109
113
|
strokeWidth: "1.5",
|
|
110
114
|
xmlns: "http://www.w3.org/2000/svg",
|
|
111
115
|
...props,
|
|
@@ -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";
|
|
@@ -27,16 +30,16 @@ var labelVariants = cva(
|
|
|
27
30
|
);
|
|
28
31
|
var Label = React.forwardRef(
|
|
29
32
|
({ className, size, required, disabled, tone, style, children, ...props }, ref) => {
|
|
30
|
-
const toneStyle = tone ? { color: `var(--color-text-${tone})` } : {};
|
|
31
33
|
return /* @__PURE__ */ jsxs(
|
|
32
34
|
"label",
|
|
33
35
|
{
|
|
34
36
|
ref,
|
|
35
37
|
"data-tone": tone,
|
|
36
|
-
style
|
|
38
|
+
style,
|
|
37
39
|
className: cn(
|
|
38
40
|
labelVariants({ size, disabled }),
|
|
39
|
-
"text-[var(--color-
|
|
41
|
+
"text-[var(--color-on-surface)]",
|
|
42
|
+
tone && toneTextClasses[tone],
|
|
40
43
|
className
|
|
41
44
|
),
|
|
42
45
|
...props,
|
|
@@ -46,7 +49,7 @@ var Label = React.forwardRef(
|
|
|
46
49
|
"span",
|
|
47
50
|
{
|
|
48
51
|
"aria-hidden": "true",
|
|
49
|
-
className: "text-[var(--color-
|
|
52
|
+
className: "text-[var(--color-error)] leading-none",
|
|
50
53
|
children: "*"
|
|
51
54
|
}
|
|
52
55
|
)
|
|
@@ -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,7 +11,7 @@ import * as React from "react";
|
|
|
8
11
|
import { ChevronRight, MoreHorizontal } from "@nexub/icons";
|
|
9
12
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
13
|
var Root = React.forwardRef(
|
|
11
|
-
({ className, ...props }, ref) => /* @__PURE__ */ jsx("nav", { ref, "aria-label":
|
|
14
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx("nav", { ref, "aria-label": useNexubMessages().breadcrumb, className: cn("", className), ...props })
|
|
12
15
|
);
|
|
13
16
|
Root.displayName = "Breadcrumb.Root";
|
|
14
17
|
var List = React.forwardRef(
|
|
@@ -17,7 +20,7 @@ var List = React.forwardRef(
|
|
|
17
20
|
{
|
|
18
21
|
ref,
|
|
19
22
|
className: cn(
|
|
20
|
-
"flex flex-wrap items-center gap-1.5 text-sm text-[var(--color-
|
|
23
|
+
"flex flex-wrap items-center gap-1.5 text-sm text-[var(--color-on-surface-muted)] sm:gap-2.5",
|
|
21
24
|
className
|
|
22
25
|
),
|
|
23
26
|
...props
|
|
@@ -33,7 +36,7 @@ var Link = React.forwardRef(({ className, children, ...props }, ref) => /* @__PU
|
|
|
33
36
|
"a",
|
|
34
37
|
{
|
|
35
38
|
ref,
|
|
36
|
-
className: cn("transition-colors hover:text-[var(--color-
|
|
39
|
+
className: cn("transition-colors hover:text-[var(--color-on-surface)]", className),
|
|
37
40
|
...props,
|
|
38
41
|
children
|
|
39
42
|
}
|
|
@@ -47,7 +50,7 @@ var Page = React.forwardRef(
|
|
|
47
50
|
role: "link",
|
|
48
51
|
"aria-current": "page",
|
|
49
52
|
"aria-disabled": "true",
|
|
50
|
-
className: cn("font-normal text-[var(--color-
|
|
53
|
+
className: cn("font-normal text-[var(--color-on-surface)]", className),
|
|
51
54
|
...props
|
|
52
55
|
}
|
|
53
56
|
)
|
|
@@ -62,7 +65,7 @@ var Separator = ({
|
|
|
62
65
|
role: "presentation",
|
|
63
66
|
"aria-hidden": "true",
|
|
64
67
|
className: cn("[&>svg]:h-3.5 [&>svg]:w-3.5", className),
|
|
65
|
-
children: children ?? /* @__PURE__ */ jsx(ChevronRight, { "aria-hidden": "true" })
|
|
68
|
+
children: children ?? /* @__PURE__ */ jsx(ChevronRight, { "aria-hidden": "true", className: "rtl:-scale-x-100" })
|
|
66
69
|
}
|
|
67
70
|
);
|
|
68
71
|
Separator.displayName = "Breadcrumb.Separator";
|
|
@@ -75,7 +78,7 @@ var Ellipsis = ({ className, ...props }) => /* @__PURE__ */ jsxs(
|
|
|
75
78
|
...props,
|
|
76
79
|
children: [
|
|
77
80
|
/* @__PURE__ */ jsx(MoreHorizontal, { size: "sm", "aria-hidden": "true" }),
|
|
78
|
-
/* @__PURE__ */ jsx("span", { className: "sr-only", children:
|
|
81
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: useNexubMessages().breadcrumbMore })
|
|
79
82
|
]
|
|
80
83
|
}
|
|
81
84
|
);
|
|
@@ -15,7 +15,7 @@ var FormError = React.forwardRef(
|
|
|
15
15
|
ref,
|
|
16
16
|
role: "alert",
|
|
17
17
|
className: cn(
|
|
18
|
-
"flex items-center gap-1.5 text-sm text-[var(--color-
|
|
18
|
+
"flex items-center gap-1.5 text-sm text-[var(--color-on-error-container)] leading-snug",
|
|
19
19
|
className
|
|
20
20
|
),
|
|
21
21
|
...props,
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
'use client';
|
|
2
|
+
import {
|
|
3
|
+
NumberTicker
|
|
4
|
+
} from "./chunk-MEUJBGY5.js";
|
|
2
5
|
import {
|
|
3
6
|
moneyFormatter
|
|
4
7
|
} from "./chunk-CIQHFMF6.js";
|
|
8
|
+
import {
|
|
9
|
+
useIntlLocale
|
|
10
|
+
} from "./chunk-743Y5MY3.js";
|
|
5
11
|
import {
|
|
6
12
|
cn
|
|
7
13
|
} from "./chunk-Q7G5WGYV.js";
|
|
@@ -15,8 +21,11 @@ var sizes = {
|
|
|
15
21
|
lg: "text-title-lg",
|
|
16
22
|
display: "font-display text-display-sm"
|
|
17
23
|
};
|
|
24
|
+
var mutedClass = "text-[0.55em] font-semibold text-[var(--color-on-surface-variant)]";
|
|
25
|
+
var muted = (type) => type === "currency" || type === "decimal" || type === "fraction";
|
|
18
26
|
var Amount = React.forwardRef(
|
|
19
|
-
({ value, currency, locale, size = "md", tone = "neutral", signDisplay, className, ...props }, ref) => {
|
|
27
|
+
({ value, currency, locale: localeProp, size = "md", tone = "neutral", signDisplay, animate = false, className, ...props }, ref) => {
|
|
28
|
+
const locale = useIntlLocale(localeProp);
|
|
20
29
|
const parts = moneyFormatter(currency, locale, { signDisplay }).formatToParts(value);
|
|
21
30
|
const quiet = size === "display";
|
|
22
31
|
return /* @__PURE__ */ jsx(
|
|
@@ -32,10 +41,17 @@ var Amount = React.forwardRef(
|
|
|
32
41
|
className
|
|
33
42
|
),
|
|
34
43
|
...props,
|
|
35
|
-
children:
|
|
44
|
+
children: animate ? /* @__PURE__ */ jsx(
|
|
45
|
+
NumberTicker,
|
|
46
|
+
{
|
|
47
|
+
value: parts.map((p) => ({
|
|
48
|
+
value: p.type === "minusSign" ? "\u2212" : p.value,
|
|
49
|
+
className: quiet && muted(p.type) ? mutedClass : void 0
|
|
50
|
+
}))
|
|
51
|
+
}
|
|
52
|
+
) : parts.map((p, i) => {
|
|
36
53
|
const text = p.type === "minusSign" ? "\u2212" : p.value;
|
|
37
|
-
|
|
38
|
-
return muted ? /* @__PURE__ */ jsx("span", { className: "text-[0.55em] font-semibold text-[var(--color-on-surface-variant)]", children: text }, i) : /* @__PURE__ */ jsx(React.Fragment, { children: text }, i);
|
|
54
|
+
return quiet && muted(p.type) ? /* @__PURE__ */ jsx("span", { className: mutedClass, children: text }, i) : /* @__PURE__ */ jsx(React.Fragment, { children: text }, i);
|
|
39
55
|
})
|
|
40
56
|
}
|
|
41
57
|
);
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import {
|
|
3
|
-
enterExit,
|
|
4
3
|
overlaySurface,
|
|
5
4
|
scrim
|
|
6
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-FLZD7HQY.js";
|
|
7
6
|
import {
|
|
8
7
|
glassSurfaceClass
|
|
9
8
|
} from "./chunk-DEIBF3P7.js";
|
|
@@ -26,11 +25,8 @@ var Overlay2 = React.forwardRef(
|
|
|
26
25
|
{
|
|
27
26
|
ref,
|
|
28
27
|
className: cn(
|
|
29
|
-
"fixed inset-0 z-[var(--z-modal)]",
|
|
28
|
+
"fixed inset-0 z-[var(--z-modal)] nx-motion",
|
|
30
29
|
scrim,
|
|
31
|
-
enterExit,
|
|
32
|
-
"data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
33
|
-
"data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0",
|
|
34
30
|
className
|
|
35
31
|
),
|
|
36
32
|
...props
|
|
@@ -54,14 +50,9 @@ var Content2 = React.forwardRef(
|
|
|
54
50
|
ref,
|
|
55
51
|
className: cn(
|
|
56
52
|
"fixed left-1/2 top-1/2 z-[var(--z-modal)] w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2",
|
|
53
|
+
"nx-motion nx-dialog",
|
|
57
54
|
overlaySurface,
|
|
58
|
-
enterExit,
|
|
59
55
|
"max-h-[90vh] overflow-y-auto p-6 focus:outline-none",
|
|
60
|
-
"data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
61
|
-
"data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
|
|
62
|
-
"data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
|
|
63
|
-
"data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]",
|
|
64
|
-
"data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%]",
|
|
65
56
|
sizeMap[size],
|
|
66
57
|
surface === "glass" && glassSurfaceClass,
|
|
67
58
|
className
|
|
@@ -81,7 +72,7 @@ var Title2 = React.forwardRef(
|
|
|
81
72
|
RadixDialog.Title,
|
|
82
73
|
{
|
|
83
74
|
ref,
|
|
84
|
-
className: cn("text-lg font-semibold text-[var(--color-
|
|
75
|
+
className: cn("text-lg font-semibold text-[var(--color-on-surface)]", className),
|
|
85
76
|
...props
|
|
86
77
|
}
|
|
87
78
|
);
|
|
@@ -94,7 +85,7 @@ var Description2 = React.forwardRef(
|
|
|
94
85
|
RadixDialog.Description,
|
|
95
86
|
{
|
|
96
87
|
ref,
|
|
97
|
-
className: cn("mt-1 text-sm text-[var(--color-
|
|
88
|
+
className: cn("mt-1 text-sm text-[var(--color-on-surface-muted)]", className),
|
|
98
89
|
...props
|
|
99
90
|
}
|
|
100
91
|
);
|
|
@@ -6,14 +6,25 @@ import {
|
|
|
6
6
|
// src/components/AspectRatio/AspectRatio.tsx
|
|
7
7
|
import * as React from "react";
|
|
8
8
|
import { jsx } from "react/jsx-runtime";
|
|
9
|
+
var RATIO_CLASS = {
|
|
10
|
+
"1.0000": "aspect-square",
|
|
11
|
+
"1.7778": "aspect-video",
|
|
12
|
+
"1.3333": "aspect-[4/3]",
|
|
13
|
+
"1.5000": "aspect-[3/2]",
|
|
14
|
+
"2.3333": "aspect-[21/9]",
|
|
15
|
+
"0.5625": "aspect-[9/16]",
|
|
16
|
+
"0.7500": "aspect-[3/4]",
|
|
17
|
+
"0.6667": "aspect-[2/3]"
|
|
18
|
+
};
|
|
9
19
|
var AspectRatio = React.forwardRef(
|
|
10
20
|
({ ratio = 16 / 9, className, children, style, ...rest }, ref) => {
|
|
21
|
+
const ratioClass = RATIO_CLASS[ratio.toFixed(4)];
|
|
11
22
|
return /* @__PURE__ */ jsx(
|
|
12
23
|
"div",
|
|
13
24
|
{
|
|
14
25
|
ref,
|
|
15
|
-
className: cn("relative w-full overflow-hidden", className),
|
|
16
|
-
style: { aspectRatio: String(ratio), ...style },
|
|
26
|
+
className: cn("relative w-full overflow-hidden", ratioClass, className),
|
|
27
|
+
style: ratioClass ? style : { aspectRatio: String(ratio), ...style },
|
|
17
28
|
...rest,
|
|
18
29
|
children: /* @__PURE__ */ jsx("div", { className: "absolute inset-0 h-full w-full", children })
|
|
19
30
|
}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import {
|
|
3
3
|
Input
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-JHVYI5GK.js";
|
|
5
|
+
import {
|
|
6
|
+
useNexubMessages
|
|
7
|
+
} from "./chunk-743Y5MY3.js";
|
|
5
8
|
import {
|
|
6
9
|
cn
|
|
7
10
|
} from "./chunk-Q7G5WGYV.js";
|
|
@@ -13,15 +16,15 @@ import { jsx } from "react/jsx-runtime";
|
|
|
13
16
|
var PasswordInput = React.forwardRef(
|
|
14
17
|
({ className, ...props }, ref) => {
|
|
15
18
|
const [showPassword, setShowPassword] = React.useState(false);
|
|
19
|
+
const messages = useNexubMessages();
|
|
16
20
|
const toggleButton = /* @__PURE__ */ jsx(
|
|
17
21
|
"button",
|
|
18
22
|
{
|
|
19
23
|
type: "button",
|
|
20
24
|
onClick: () => setShowPassword((prev) => !prev),
|
|
21
|
-
"aria-label": showPassword ?
|
|
25
|
+
"aria-label": showPassword ? messages.hidePassword : messages.showPassword,
|
|
22
26
|
className: cn(
|
|
23
|
-
"shrink-0 text-[var(--color-
|
|
24
|
-
"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[var(--color-ring-default)] rounded"
|
|
27
|
+
"shrink-0 rounded-full text-[var(--color-on-surface-muted)] hover:text-[var(--color-on-surface)] transition-colors"
|
|
25
28
|
),
|
|
26
29
|
children: showPassword ? /* @__PURE__ */ jsx(EyeOff, { className: "h-4 w-4", "aria-hidden": "true" }) : /* @__PURE__ */ jsx(Eye, { className: "h-4 w-4", "aria-hidden": "true" })
|
|
27
30
|
}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import {
|
|
3
|
+
HoverCard
|
|
4
|
+
} from "./chunk-KE4YVG5Q.js";
|
|
5
|
+
import {
|
|
6
|
+
useNexubMessages
|
|
7
|
+
} from "./chunk-743Y5MY3.js";
|
|
8
|
+
import {
|
|
9
|
+
cn
|
|
10
|
+
} from "./chunk-Q7G5WGYV.js";
|
|
11
|
+
|
|
12
|
+
// src/components/Citation/Citation.tsx
|
|
13
|
+
import * as React from "react";
|
|
14
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
15
|
+
var fallbackMessages = {
|
|
16
|
+
sources: "Sources",
|
|
17
|
+
source: (index) => `Source ${index}`
|
|
18
|
+
};
|
|
19
|
+
function useCitationMessages(overrides) {
|
|
20
|
+
const provided = useNexubMessages();
|
|
21
|
+
return { ...fallbackMessages, sources: provided.sources ?? fallbackMessages.sources, source: provided.source ?? fallbackMessages.source, ...overrides };
|
|
22
|
+
}
|
|
23
|
+
function safeUrl(url) {
|
|
24
|
+
if (!url) return void 0;
|
|
25
|
+
try {
|
|
26
|
+
const u = new URL(url);
|
|
27
|
+
return u.protocol === "http:" || u.protocol === "https:" ? u.href : void 0;
|
|
28
|
+
} catch {
|
|
29
|
+
return void 0;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
function sourceDomain(source) {
|
|
33
|
+
if (source.domain) return source.domain;
|
|
34
|
+
const href = safeUrl(source.url);
|
|
35
|
+
return href ? new URL(href).hostname.replace(/^www\./, "") : "";
|
|
36
|
+
}
|
|
37
|
+
function Favicon({ source, className }) {
|
|
38
|
+
const src = safeUrl(source.favicon);
|
|
39
|
+
const [failed, setFailed] = React.useState(false);
|
|
40
|
+
const base = cn("inline-flex shrink-0 items-center justify-center overflow-hidden rounded-full", className);
|
|
41
|
+
if (src && !failed) {
|
|
42
|
+
return /* @__PURE__ */ jsx(
|
|
43
|
+
"img",
|
|
44
|
+
{
|
|
45
|
+
src,
|
|
46
|
+
alt: "",
|
|
47
|
+
referrerPolicy: "no-referrer",
|
|
48
|
+
loading: "lazy",
|
|
49
|
+
onError: () => setFailed(true),
|
|
50
|
+
className: cn(base, "object-cover")
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
const letter = (sourceDomain(source) || source.title).charAt(0).toUpperCase();
|
|
55
|
+
return /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: cn(base, "bg-[var(--color-surface-container-high)] text-label-sm text-[var(--color-on-surface-variant)]"), children: letter });
|
|
56
|
+
}
|
|
57
|
+
var linkProps = { target: "_blank", rel: "noopener noreferrer" };
|
|
58
|
+
var Citation = React.forwardRef(
|
|
59
|
+
({ index, source, messages, className, ...props }, ref) => {
|
|
60
|
+
const m = useCitationMessages(messages);
|
|
61
|
+
const href = safeUrl(source.url);
|
|
62
|
+
const label = `${m.source(index)}: ${source.title}`;
|
|
63
|
+
const domain = sourceDomain(source);
|
|
64
|
+
const marker = cn(
|
|
65
|
+
"mx-0.5 inline-flex h-5 min-w-[1.25rem] items-center justify-center rounded-shape-control px-1.5 align-middle",
|
|
66
|
+
"bg-[var(--color-secondary-container)] text-label-sm leading-none text-[var(--color-on-secondary-container)] no-underline",
|
|
67
|
+
href && "nx-state-layer",
|
|
68
|
+
className
|
|
69
|
+
);
|
|
70
|
+
return /* @__PURE__ */ jsxs(HoverCard.Root, { children: [
|
|
71
|
+
/* @__PURE__ */ jsx(HoverCard.Trigger, { asChild: true, children: href ? /* @__PURE__ */ jsx("a", { ref, href, ...linkProps, "aria-label": label, className: marker, ...props, children: index }) : /* @__PURE__ */ jsxs("span", { ref, className: marker, ...props, children: [
|
|
72
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: index }),
|
|
73
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: label })
|
|
74
|
+
] }) }),
|
|
75
|
+
/* @__PURE__ */ jsxs(HoverCard.Content, { className: "w-72", children: [
|
|
76
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
77
|
+
/* @__PURE__ */ jsx(Favicon, { source, className: "h-4 w-4" }),
|
|
78
|
+
/* @__PURE__ */ jsx("span", { className: "min-w-0 truncate text-label-sm text-[var(--color-on-surface-muted)]", children: domain })
|
|
79
|
+
] }),
|
|
80
|
+
/* @__PURE__ */ jsx("p", { className: "mt-2 line-clamp-2 text-title-sm text-[var(--color-on-surface)]", children: source.title }),
|
|
81
|
+
source.snippet && /* @__PURE__ */ jsx("p", { className: "mt-1 line-clamp-3 text-body-sm text-[var(--color-on-surface-variant)]", children: source.snippet })
|
|
82
|
+
] })
|
|
83
|
+
] });
|
|
84
|
+
}
|
|
85
|
+
);
|
|
86
|
+
Citation.displayName = "Citation";
|
|
87
|
+
var SourceChip = React.forwardRef(
|
|
88
|
+
({ source, className, ...props }, ref) => {
|
|
89
|
+
const href = safeUrl(source.url);
|
|
90
|
+
const cls = cn(
|
|
91
|
+
"inline-flex h-9 max-w-[16rem] items-center gap-2 rounded-shape-control border border-[var(--color-outline-variant)] px-3",
|
|
92
|
+
"bg-[var(--color-surface-container-low)] text-label-md text-[var(--color-on-surface)] no-underline",
|
|
93
|
+
href && "nx-state-layer",
|
|
94
|
+
className
|
|
95
|
+
);
|
|
96
|
+
const content = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
97
|
+
/* @__PURE__ */ jsx(Favicon, { source, className: "h-4 w-4" }),
|
|
98
|
+
/* @__PURE__ */ jsx("span", { className: "shrink-0 text-[var(--color-on-surface-muted)]", children: sourceDomain(source) }),
|
|
99
|
+
/* @__PURE__ */ jsx("span", { className: "min-w-0 truncate", children: source.title })
|
|
100
|
+
] });
|
|
101
|
+
return href ? /* @__PURE__ */ jsx("a", { ref, href, ...linkProps, className: cls, ...props, children: content }) : /* @__PURE__ */ jsx("span", { ref, className: cls, ...props, children: content });
|
|
102
|
+
}
|
|
103
|
+
);
|
|
104
|
+
SourceChip.displayName = "SourceChip";
|
|
105
|
+
var SourceList = React.forwardRef(
|
|
106
|
+
({ sources, messages, className, ...props }, ref) => {
|
|
107
|
+
const m = useCitationMessages(messages);
|
|
108
|
+
const id = React.useId();
|
|
109
|
+
return /* @__PURE__ */ jsxs("section", { ref, "aria-labelledby": id, className: cn("[container-type:inline-size]", className), ...props, children: [
|
|
110
|
+
/* @__PURE__ */ jsx("p", { id, className: "mb-2 text-label-md text-[var(--color-on-surface-variant)]", children: m.sources }),
|
|
111
|
+
/* @__PURE__ */ jsx(
|
|
112
|
+
"ul",
|
|
113
|
+
{
|
|
114
|
+
className: cn(
|
|
115
|
+
"flex snap-x snap-mandatory scroll-px-1 gap-2 overflow-x-auto p-1",
|
|
116
|
+
"[@container(min-width:480px)]:flex-wrap [@container(min-width:480px)]:overflow-x-visible"
|
|
117
|
+
),
|
|
118
|
+
children: sources.map((s, i) => /* @__PURE__ */ jsx("li", { className: "shrink-0 snap-start", children: /* @__PURE__ */ jsx(SourceChip, { source: s }) }, `${i}-${s.url}`))
|
|
119
|
+
}
|
|
120
|
+
)
|
|
121
|
+
] });
|
|
122
|
+
}
|
|
123
|
+
);
|
|
124
|
+
SourceList.displayName = "SourceList";
|
|
125
|
+
|
|
126
|
+
export {
|
|
127
|
+
safeUrl,
|
|
128
|
+
Citation,
|
|
129
|
+
SourceChip,
|
|
130
|
+
SourceList
|
|
131
|
+
};
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
|
+
import {
|
|
3
|
+
pressable
|
|
4
|
+
} from "./chunk-7SXR4PGO.js";
|
|
2
5
|
import {
|
|
3
6
|
cn
|
|
4
7
|
} from "./chunk-Q7G5WGYV.js";
|
|
@@ -10,15 +13,15 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
10
13
|
var toneConfig = {
|
|
11
14
|
error: {
|
|
12
15
|
icon: /* @__PURE__ */ jsx(AlertCircle, { size: "xl", "aria-hidden": "true" }),
|
|
13
|
-
color: "text-[var(--color-
|
|
16
|
+
color: "text-[var(--color-error)]"
|
|
14
17
|
},
|
|
15
18
|
warning: {
|
|
16
19
|
icon: /* @__PURE__ */ jsx(AlertTriangle, { size: "xl", "aria-hidden": "true" }),
|
|
17
|
-
color: "text-[var(--color-
|
|
20
|
+
color: "text-[var(--color-warning)]"
|
|
18
21
|
},
|
|
19
22
|
info: {
|
|
20
23
|
icon: /* @__PURE__ */ jsx(Info, { size: "xl", "aria-hidden": "true" }),
|
|
21
|
-
color: "text-[var(--color-
|
|
24
|
+
color: "text-[var(--color-info)]"
|
|
22
25
|
}
|
|
23
26
|
};
|
|
24
27
|
var ErrorState = React.forwardRef(
|
|
@@ -36,14 +39,15 @@ var ErrorState = React.forwardRef(
|
|
|
36
39
|
children: [
|
|
37
40
|
/* @__PURE__ */ jsx("span", { className: color, children: icon }),
|
|
38
41
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
39
|
-
/* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold text-[var(--color-
|
|
40
|
-
description && /* @__PURE__ */ jsx("p", { className: "max-w-sm text-sm text-[var(--color-
|
|
42
|
+
/* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold text-[var(--color-on-surface)]", children: title }),
|
|
43
|
+
description && /* @__PURE__ */ jsx("p", { className: "max-w-sm text-sm text-[var(--color-on-surface-muted)]", children: description })
|
|
41
44
|
] }),
|
|
42
45
|
onRetry && /* @__PURE__ */ jsx(
|
|
43
46
|
"button",
|
|
44
47
|
{
|
|
48
|
+
type: "button",
|
|
45
49
|
onClick: onRetry,
|
|
46
|
-
className: "inline-flex h-9 items-center justify-center
|
|
50
|
+
className: cn(pressable, "inline-flex h-9 items-center justify-center bg-[var(--color-primary)] px-4 text-label-lg text-[var(--color-on-primary)]"),
|
|
47
51
|
children: "Try again"
|
|
48
52
|
}
|
|
49
53
|
)
|