@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
package/dist/chunk-NMH5WSZG.js
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
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/Card/Card.tsx
|
|
10
|
-
import * as React from "react";
|
|
11
|
-
import { Slot } from "@radix-ui/react-slot";
|
|
12
|
-
import { cva } from "class-variance-authority";
|
|
13
|
-
import { jsx } from "react/jsx-runtime";
|
|
14
|
-
var cardVariants = cva(
|
|
15
|
-
// In-flow content: tone + a soft alpha hairline, no shadow (shadows are for floating layers).
|
|
16
|
-
"rounded-shape-container bg-[var(--color-surface-elevated)] border border-[color-mix(in_srgb,var(--color-outline-variant)_60%,transparent)] text-[var(--color-on-surface)]",
|
|
17
|
-
{
|
|
18
|
-
variants: {
|
|
19
|
-
variant: {
|
|
20
|
-
flat: "",
|
|
21
|
-
surface: "bg-[var(--color-surface-elevated)] shadow-elevation-1",
|
|
22
|
-
interactive: "nx-state-layer cursor-pointer bg-[var(--color-surface-elevated)] shadow-elevation-1 transition-[box-shadow,transform] duration-spatial-fast ease-spatial-fast hover:-translate-y-0.5 hover:shadow-elevation-2"
|
|
23
|
-
},
|
|
24
|
-
// Material. 'glass' needs data-material="glass" on the element (set in the
|
|
25
|
-
// component) for the --glass-* vars to resolve. Single box-shadow carries
|
|
26
|
-
// both the inset specular highlight and the drop shadow so neither clobbers
|
|
27
|
-
// the other. Listed after `variant` so tailwind-merge lets it win on bg/border.
|
|
28
|
-
surface: {
|
|
29
|
-
solid: "",
|
|
30
|
-
glass: glassSurfaceClass
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
defaultVariants: {
|
|
34
|
-
variant: "flat",
|
|
35
|
-
surface: "solid"
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
);
|
|
39
|
-
var toneBorderMap = {
|
|
40
|
-
neutral: "",
|
|
41
|
-
info: "border-l-4 border-l-[var(--color-semantic-info-default)]",
|
|
42
|
-
success: "border-l-4 border-l-[var(--color-semantic-success-default)]",
|
|
43
|
-
warning: "border-l-4 border-l-[var(--color-semantic-warning-default)]",
|
|
44
|
-
danger: "border-l-4 border-l-[var(--color-semantic-error-default)]",
|
|
45
|
-
leap: "border-l-4 border-l-[var(--color-leap-500)]",
|
|
46
|
-
bookub: "border-l-4 border-l-[var(--color-bookub-500)]",
|
|
47
|
-
payub: "border-l-4 border-l-[var(--color-payub-500)]",
|
|
48
|
-
founderub: "border-l-4 border-l-[var(--color-founderub-500)]"
|
|
49
|
-
};
|
|
50
|
-
var Card = React.forwardRef(
|
|
51
|
-
({ className, variant = "flat", surface = "solid", tone, asChild = false, children, ...props }, ref) => {
|
|
52
|
-
const Comp = asChild ? Slot : "div";
|
|
53
|
-
const toneStyle = tone ? toneBorderMap[tone] : "";
|
|
54
|
-
return /* @__PURE__ */ jsx(
|
|
55
|
-
Comp,
|
|
56
|
-
{
|
|
57
|
-
ref,
|
|
58
|
-
className: cn(cardVariants({ variant, surface }), toneStyle, className),
|
|
59
|
-
"data-tone": tone,
|
|
60
|
-
"data-material": surface === "glass" ? "glass" : void 0,
|
|
61
|
-
...props,
|
|
62
|
-
children
|
|
63
|
-
}
|
|
64
|
-
);
|
|
65
|
-
}
|
|
66
|
-
);
|
|
67
|
-
Card.displayName = "Card";
|
|
68
|
-
|
|
69
|
-
export {
|
|
70
|
-
cardVariants,
|
|
71
|
-
Card
|
|
72
|
-
};
|
package/dist/chunk-P44EROBX.js
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import {
|
|
3
|
-
cn
|
|
4
|
-
} from "./chunk-Q7G5WGYV.js";
|
|
5
|
-
|
|
6
|
-
// src/components/Tag/Tag.tsx
|
|
7
|
-
import * as React from "react";
|
|
8
|
-
import { cva } from "class-variance-authority";
|
|
9
|
-
import { jsx } from "react/jsx-runtime";
|
|
10
|
-
var tagVariants = cva(
|
|
11
|
-
"inline-flex items-center rounded font-medium select-none whitespace-nowrap",
|
|
12
|
-
{
|
|
13
|
-
variants: {
|
|
14
|
-
size: {
|
|
15
|
-
sm: "px-1.5 py-0.5 text-xs",
|
|
16
|
-
md: "px-2 py-0.5 text-xs",
|
|
17
|
-
lg: "px-2.5 py-1 text-sm"
|
|
18
|
-
},
|
|
19
|
-
tone: {
|
|
20
|
-
neutral: "bg-[var(--color-neutral-100)] text-[var(--color-neutral-700)]",
|
|
21
|
-
info: "bg-[var(--color-semantic-info-default)]/10 text-[var(--color-semantic-info-default)]",
|
|
22
|
-
success: "bg-[var(--color-semantic-success-default)]/10 text-[var(--color-semantic-success-default)]",
|
|
23
|
-
warning: "bg-[var(--color-semantic-warning-default)]/10 text-[var(--color-semantic-warning-default)]",
|
|
24
|
-
danger: "bg-[var(--color-semantic-error-default)]/10 text-[var(--color-semantic-error-default)]",
|
|
25
|
-
leap: "bg-[var(--color-leap-500)]/10 text-[var(--color-leap-700)]",
|
|
26
|
-
bookub: "bg-[var(--color-bookub-500)]/10 text-[var(--color-bookub-700)]",
|
|
27
|
-
payub: "bg-[var(--color-payub-500)]/10 text-[var(--color-payub-700)]",
|
|
28
|
-
founderub: "bg-[var(--color-founderub-500)]/10 text-[var(--color-founderub-700)]"
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
defaultVariants: {
|
|
32
|
-
size: "md",
|
|
33
|
-
tone: "neutral"
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
);
|
|
37
|
-
var Tag = React.forwardRef(
|
|
38
|
-
({ className, size, tone = "neutral", children, ...props }, ref) => {
|
|
39
|
-
return /* @__PURE__ */ jsx(
|
|
40
|
-
"span",
|
|
41
|
-
{
|
|
42
|
-
ref,
|
|
43
|
-
className: cn(tagVariants({ size, tone }), className),
|
|
44
|
-
...props,
|
|
45
|
-
children
|
|
46
|
-
}
|
|
47
|
-
);
|
|
48
|
-
}
|
|
49
|
-
);
|
|
50
|
-
Tag.displayName = "Tag";
|
|
51
|
-
|
|
52
|
-
export {
|
|
53
|
-
tagVariants,
|
|
54
|
-
Tag
|
|
55
|
-
};
|
package/dist/chunk-TYTW4F3B.js
DELETED
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import {
|
|
3
|
-
cn
|
|
4
|
-
} from "./chunk-Q7G5WGYV.js";
|
|
5
|
-
|
|
6
|
-
// src/components/Toast/Toast.tsx
|
|
7
|
-
import * as React from "react";
|
|
8
|
-
import * as RadixToast from "@radix-ui/react-toast";
|
|
9
|
-
import { jsx } from "react/jsx-runtime";
|
|
10
|
-
var Provider2 = RadixToast.Provider;
|
|
11
|
-
var Viewport2 = React.forwardRef(
|
|
12
|
-
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
13
|
-
RadixToast.Viewport,
|
|
14
|
-
{
|
|
15
|
-
ref,
|
|
16
|
-
className: cn(
|
|
17
|
-
"fixed top-0 right-0 z-[var(--z-toast,2000)] flex max-h-screen w-full flex-col-reverse p-4 sm:max-w-sm gap-2",
|
|
18
|
-
className
|
|
19
|
-
),
|
|
20
|
-
...props
|
|
21
|
-
}
|
|
22
|
-
)
|
|
23
|
-
);
|
|
24
|
-
Viewport2.displayName = "Toast.Viewport";
|
|
25
|
-
var Root2 = React.forwardRef(
|
|
26
|
-
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
27
|
-
RadixToast.Root,
|
|
28
|
-
{
|
|
29
|
-
ref,
|
|
30
|
-
className: cn(
|
|
31
|
-
// Snackbar: the inverse surface stands out from any page, light or dark.
|
|
32
|
-
"group pointer-events-auto relative flex w-full items-center justify-between gap-3 overflow-hidden rounded-shape-container bg-[var(--color-inverse-surface)] py-3 pl-4 pr-2 text-[var(--color-inverse-on-surface)] shadow-elevation-2",
|
|
33
|
-
"duration-spatial-default ease-spatial-default data-[state=closed]:duration-effects-fast",
|
|
34
|
-
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-80 data-[state=open]:slide-in-from-top-full data-[state=closed]:slide-out-to-right-full",
|
|
35
|
-
className
|
|
36
|
-
),
|
|
37
|
-
...props
|
|
38
|
-
}
|
|
39
|
-
)
|
|
40
|
-
);
|
|
41
|
-
Root2.displayName = "Toast.Root";
|
|
42
|
-
var Title2 = React.forwardRef(
|
|
43
|
-
({ className, ...props }, ref) => /* @__PURE__ */ jsx(RadixToast.Title, { ref, className: cn("text-title-sm", className), ...props })
|
|
44
|
-
);
|
|
45
|
-
Title2.displayName = "Toast.Title";
|
|
46
|
-
var Description2 = React.forwardRef(
|
|
47
|
-
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
48
|
-
RadixToast.Description,
|
|
49
|
-
{
|
|
50
|
-
ref,
|
|
51
|
-
className: cn("text-body-sm text-[color-mix(in_srgb,var(--color-inverse-on-surface)_80%,transparent)]", className),
|
|
52
|
-
...props
|
|
53
|
-
}
|
|
54
|
-
)
|
|
55
|
-
);
|
|
56
|
-
Description2.displayName = "Toast.Description";
|
|
57
|
-
var Action2 = React.forwardRef(
|
|
58
|
-
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
59
|
-
RadixToast.Action,
|
|
60
|
-
{
|
|
61
|
-
ref,
|
|
62
|
-
className: cn(
|
|
63
|
-
"nx-state-layer relative inline-flex min-h-[44px] min-w-[44px] shrink-0 items-center justify-center rounded-shape-control px-3 text-label-lg text-[var(--color-inverse-primary)]",
|
|
64
|
-
className
|
|
65
|
-
),
|
|
66
|
-
...props
|
|
67
|
-
}
|
|
68
|
-
)
|
|
69
|
-
);
|
|
70
|
-
Action2.displayName = "Toast.Action";
|
|
71
|
-
var Close2 = React.forwardRef(
|
|
72
|
-
({ className, ...props }, ref) => /* @__PURE__ */ jsx(RadixToast.Close, { ref, className: cn("nx-state-layer relative grid h-8 w-8 place-items-center rounded-full", className), ...props })
|
|
73
|
-
);
|
|
74
|
-
Close2.displayName = "Toast.Close";
|
|
75
|
-
var Toast = { Provider: Provider2, Viewport: Viewport2, Root: Root2, Title: Title2, Description: Description2, Action: Action2, Close: Close2 };
|
|
76
|
-
|
|
77
|
-
// src/components/Toast/Toaster.tsx
|
|
78
|
-
import "react";
|
|
79
|
-
import * as RadixToast2 from "@radix-ui/react-toast";
|
|
80
|
-
import { X } from "@nexub/icons";
|
|
81
|
-
|
|
82
|
-
// src/components/Toast/useToast.ts
|
|
83
|
-
import { useState, useEffect } from "react";
|
|
84
|
-
var g = typeof window !== "undefined" ? (() => {
|
|
85
|
-
const _g = globalThis;
|
|
86
|
-
_g.__nexub_toast_items ??= [];
|
|
87
|
-
_g.__nexub_toast_listeners ??= /* @__PURE__ */ new Set();
|
|
88
|
-
_g.__nexub_toast_counter ??= 0;
|
|
89
|
-
return _g;
|
|
90
|
-
})() : { __nexub_toast_items: [], __nexub_toast_listeners: /* @__PURE__ */ new Set(), __nexub_toast_counter: 0 };
|
|
91
|
-
function notify() {
|
|
92
|
-
g.__nexub_toast_listeners.forEach((l) => l([...g.__nexub_toast_items]));
|
|
93
|
-
}
|
|
94
|
-
function add(item) {
|
|
95
|
-
const id = String(++g.__nexub_toast_counter);
|
|
96
|
-
g.__nexub_toast_items = [...g.__nexub_toast_items, { ...item, id }];
|
|
97
|
-
notify();
|
|
98
|
-
return id;
|
|
99
|
-
}
|
|
100
|
-
function useToastStore() {
|
|
101
|
-
const [state, setState] = useState([...g.__nexub_toast_items]);
|
|
102
|
-
useEffect(() => {
|
|
103
|
-
g.__nexub_toast_listeners.add(setState);
|
|
104
|
-
return () => {
|
|
105
|
-
g.__nexub_toast_listeners.delete(setState);
|
|
106
|
-
};
|
|
107
|
-
}, []);
|
|
108
|
-
return state;
|
|
109
|
-
}
|
|
110
|
-
function dismiss(id) {
|
|
111
|
-
g.__nexub_toast_items = id ? g.__nexub_toast_items.filter((i) => i.id !== id) : [];
|
|
112
|
-
notify();
|
|
113
|
-
}
|
|
114
|
-
var toast = {
|
|
115
|
-
success: (title, opts) => add({ title, tone: "success", ...opts }),
|
|
116
|
-
error: (title, opts) => add({ title, tone: "error", ...opts }),
|
|
117
|
-
info: (title, opts) => add({ title, tone: "info", ...opts }),
|
|
118
|
-
warning: (title, opts) => add({ title, tone: "warning", ...opts }),
|
|
119
|
-
custom: (title, opts) => add({ title, tone: "neutral", ...opts }),
|
|
120
|
-
dismiss
|
|
121
|
-
};
|
|
122
|
-
|
|
123
|
-
// src/components/Toast/Toaster.tsx
|
|
124
|
-
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
125
|
-
var toneMap = {
|
|
126
|
-
success: "border-l-4 border-[var(--color-semantic-success-default)]",
|
|
127
|
-
error: "border-l-4 border-[var(--color-semantic-error-default)]",
|
|
128
|
-
warning: "border-l-4 border-[var(--color-semantic-warning-default)]",
|
|
129
|
-
info: "border-l-4 border-[var(--color-semantic-info-default)]",
|
|
130
|
-
neutral: ""
|
|
131
|
-
};
|
|
132
|
-
function Toaster() {
|
|
133
|
-
const toasts = useToastStore();
|
|
134
|
-
return /* @__PURE__ */ jsxs(RadixToast2.Provider, { swipeDirection: "right", children: [
|
|
135
|
-
toasts.map((t) => /* @__PURE__ */ jsxs(
|
|
136
|
-
RadixToast2.Root,
|
|
137
|
-
{
|
|
138
|
-
className: cn(
|
|
139
|
-
"group pointer-events-auto relative flex w-full items-center justify-between gap-3 overflow-hidden rounded-shape-container bg-[var(--color-inverse-surface)] py-3 pl-4 pr-2 text-[var(--color-inverse-on-surface)] shadow-elevation-2",
|
|
140
|
-
"duration-spatial-default ease-spatial-default data-[state=closed]:duration-effects-fast",
|
|
141
|
-
"data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none",
|
|
142
|
-
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-80 data-[state=open]:slide-in-from-top-full data-[state=closed]:slide-out-to-right-full",
|
|
143
|
-
toneMap[t.tone ?? "neutral"]
|
|
144
|
-
),
|
|
145
|
-
duration: t.duration ?? 5e3,
|
|
146
|
-
children: [
|
|
147
|
-
/* @__PURE__ */ jsxs("div", { className: "grid gap-1", children: [
|
|
148
|
-
/* @__PURE__ */ jsx2(RadixToast2.Title, { className: "text-title-sm", children: t.title }),
|
|
149
|
-
t.description && /* @__PURE__ */ jsx2(RadixToast2.Description, { className: "text-body-sm text-[color-mix(in_srgb,var(--color-inverse-on-surface)_80%,transparent)]", children: t.description })
|
|
150
|
-
] }),
|
|
151
|
-
t.action && /* @__PURE__ */ jsx2(
|
|
152
|
-
RadixToast2.Action,
|
|
153
|
-
{
|
|
154
|
-
altText: t.action.label,
|
|
155
|
-
onClick: t.action.onClick,
|
|
156
|
-
className: "shrink-0 rounded-md border border-[var(--color-border-default)] px-3 py-1.5 text-sm font-medium hover:bg-[var(--color-bg-subtle)] focus:outline-none focus:ring-2 focus:ring-[var(--color-ring-default)]",
|
|
157
|
-
children: t.action.label
|
|
158
|
-
}
|
|
159
|
-
),
|
|
160
|
-
/* @__PURE__ */ jsxs(RadixToast2.Close, { className: "rounded-md p-1 transition-opacity [@media(hover:hover)]:opacity-0 group-hover:opacity-100 focus:opacity-100 focus:outline-none focus:ring-2 focus:ring-[var(--color-ring-default)]", children: [
|
|
161
|
-
/* @__PURE__ */ jsx2(X, { size: "sm", "aria-hidden": "true" }),
|
|
162
|
-
/* @__PURE__ */ jsx2("span", { className: "sr-only", children: "Close" })
|
|
163
|
-
] })
|
|
164
|
-
]
|
|
165
|
-
},
|
|
166
|
-
t.id
|
|
167
|
-
)),
|
|
168
|
-
/* @__PURE__ */ jsx2(RadixToast2.Viewport, { className: "fixed top-0 right-0 z-[var(--z-toast,2000)] flex max-h-screen w-full flex-col-reverse p-4 sm:max-w-sm gap-2" })
|
|
169
|
-
] });
|
|
170
|
-
}
|
|
171
|
-
Toaster.displayName = "Toaster";
|
|
172
|
-
|
|
173
|
-
export {
|
|
174
|
-
Toast,
|
|
175
|
-
useToastStore,
|
|
176
|
-
toast,
|
|
177
|
-
Toaster
|
|
178
|
-
};
|