@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.
Files changed (208) hide show
  1. package/dist/{chunk-XR4NBY54.js → chunk-2DYKENBM.js} +10 -10
  2. package/dist/{chunk-SVQCINRE.js → chunk-2I7FIU6R.js} +5 -2
  3. package/dist/{chunk-FHFVBOF3.js → chunk-2Y4WLNEZ.js} +3 -3
  4. package/dist/{chunk-CWS37T3K.js → chunk-3E7X3YK3.js} +4 -2
  5. package/dist/{chunk-GRB6T2TT.js → chunk-3FPJIXG7.js} +19 -13
  6. package/dist/chunk-3MT23LNM.js +171 -0
  7. package/dist/chunk-3QD76BKT.js +80 -0
  8. package/dist/{chunk-B54WADL4.js → chunk-4P2JJ2FH.js} +12 -12
  9. package/dist/chunk-52ZVJPF7.js +1 -0
  10. package/dist/chunk-5KI4YHA3.js +144 -0
  11. package/dist/chunk-5QEARXY3.js +55 -0
  12. package/dist/chunk-5VW6RUKZ.js +134 -0
  13. package/dist/{chunk-CNNJFWFA.js → chunk-6BGUZQAX.js} +4 -4
  14. package/dist/{chunk-LDYD7WL3.js → chunk-6ECOCGZG.js} +4 -3
  15. package/dist/{chunk-3AXIMXDU.js → chunk-6JBQAJJD.js} +6 -12
  16. package/dist/{chunk-YRDCY6BI.js → chunk-6UKNUI46.js} +0 -19
  17. package/dist/chunk-743Y5MY3.js +95 -0
  18. package/dist/{chunk-BFRX6X4O.js → chunk-74RUJ5KZ.js} +23 -17
  19. package/dist/chunk-77LYWSJW.js +85 -0
  20. package/dist/{chunk-YPHNHQYQ.js → chunk-7B4VF2ZU.js} +6 -2
  21. package/dist/{chunk-NCRFKPA4.js → chunk-7MSIOYJZ.js} +6 -8
  22. package/dist/{chunk-AHT35UWY.js → chunk-7Q4T7CB6.js} +10 -6
  23. package/dist/{chunk-GIGOTRXX.js → chunk-7VJABRKB.js} +3 -10
  24. package/dist/{chunk-6QLLH6ID.js → chunk-7XWJCFWI.js} +8 -17
  25. package/dist/chunk-A3O23F2B.js +1 -0
  26. package/dist/chunk-AT2DSFP3.js +47 -0
  27. package/dist/{chunk-OASFXI27.js → chunk-BNFGVFZ3.js} +5 -5
  28. package/dist/{chunk-GHCV6UXG.js → chunk-BTYDDKRQ.js} +5 -5
  29. package/dist/chunk-C6JRJ6JW.js +167 -0
  30. package/dist/chunk-CAOLGXA5.js +1 -0
  31. package/dist/{chunk-IIPYF6ZQ.js → chunk-CBDJRPMD.js} +16 -13
  32. package/dist/{chunk-OJ2TLWYD.js → chunk-CKFRMCZ7.js} +5 -3
  33. package/dist/{chunk-LZB3KTSH.js → chunk-CQWYZPPJ.js} +1 -1
  34. package/dist/{chunk-6RBNM5RO.js → chunk-CUOASXI7.js} +10 -10
  35. package/dist/{chunk-HG6HTUWU.js → chunk-CV5ZKED7.js} +2 -2
  36. package/dist/{chunk-HJERFB7J.js → chunk-DDRYT3SY.js} +2 -2
  37. package/dist/chunk-DGCAM2UJ.js +60 -0
  38. package/dist/{chunk-RLE5RN3T.js → chunk-DGQJRTO6.js} +15 -11
  39. package/dist/{chunk-FD7YU53N.js → chunk-DT3QGFXB.js} +4 -4
  40. package/dist/chunk-F73DTG2V.js +123 -0
  41. package/dist/{chunk-V3TETH4J.js → chunk-FIDUY6SS.js} +17 -16
  42. package/dist/{chunk-Z3IG5WRA.js → chunk-FJUVYRNT.js} +3 -3
  43. package/dist/{chunk-KQPLFVFR.js → chunk-FLZD7HQY.js} +0 -2
  44. package/dist/{chunk-64JDZWCV.js → chunk-GRKCUQG4.js} +6 -5
  45. package/dist/{chunk-EZ23IA3H.js → chunk-GSG2W6DP.js} +3 -3
  46. package/dist/{chunk-4I5ULCYG.js → chunk-HFTS5AN7.js} +3 -3
  47. package/dist/{chunk-RB4CVS22.js → chunk-HH7EHNOW.js} +3 -1
  48. package/dist/{chunk-S46W2QER.js → chunk-HSPGJSFJ.js} +17 -11
  49. package/dist/{chunk-NQVRF4RB.js → chunk-HXV5UA7K.js} +16 -13
  50. package/dist/{chunk-GUB7YKG2.js → chunk-I4U36P54.js} +6 -3
  51. package/dist/{chunk-BTRTORKU.js → chunk-I6CAF7C5.js} +6 -7
  52. package/dist/chunk-IGLOYOCH.js +134 -0
  53. package/dist/{chunk-IK23Q2OF.js → chunk-JHVYI5GK.js} +3 -3
  54. package/dist/chunk-K5FKEAAK.js +94 -0
  55. package/dist/{chunk-5URGARPH.js → chunk-KE4YVG5Q.js} +6 -10
  56. package/dist/{chunk-A4IMFAZX.js → chunk-LESI7J7B.js} +3 -3
  57. package/dist/chunk-MEUJBGY5.js +88 -0
  58. package/dist/chunk-MNEXMMLM.js +23 -0
  59. package/dist/{chunk-PVTACENM.js → chunk-MTK3GHDQ.js} +2 -2
  60. package/dist/chunk-NA5UMOE5.js +55 -0
  61. package/dist/{chunk-YJ3JQYAN.js → chunk-NGQKBDHA.js} +5 -13
  62. package/dist/{chunk-7Q7ZF6BY.js → chunk-NNIFOMIH.js} +18 -8
  63. package/dist/{chunk-7L3CGIRA.js → chunk-NQPGELMP.js} +8 -19
  64. package/dist/chunk-NSVXGOR3.js +54 -0
  65. package/dist/{chunk-6J3QTWKC.js → chunk-NZT4TTNV.js} +18 -9
  66. package/dist/{chunk-TJCHA3OI.js → chunk-O626NJEM.js} +7 -4
  67. package/dist/chunk-O74XEHLA.js +331 -0
  68. package/dist/{chunk-JSD3H7WV.js → chunk-OYCK6BRG.js} +6 -6
  69. package/dist/{chunk-2555JXCP.js → chunk-PBPUSRTJ.js} +19 -11
  70. package/dist/{chunk-QD7H3WV3.js → chunk-PGDXFBKT.js} +8 -8
  71. package/dist/{chunk-PQ6GU7SG.js → chunk-PMWYLYM3.js} +20 -14
  72. package/dist/{chunk-I4BHRVRL.js → chunk-PPCGUIAB.js} +9 -5
  73. package/dist/{chunk-NIX4SEKM.js → chunk-PREMZMLU.js} +7 -4
  74. package/dist/{chunk-4SSUM4CL.js → chunk-Q3ESHXKU.js} +9 -6
  75. package/dist/{chunk-KM6Z3VTI.js → chunk-QVTVDL6Y.js} +1 -1
  76. package/dist/{chunk-AXOKFS4K.js → chunk-RSU2UHN4.js} +20 -4
  77. package/dist/{chunk-DJZZ3FIP.js → chunk-RUR57JZQ.js} +5 -14
  78. package/dist/{chunk-ZV3AF5CL.js → chunk-S2CTBFLN.js} +13 -2
  79. package/dist/{chunk-WESZPFBZ.js → chunk-S7GH2BJP.js} +7 -4
  80. package/dist/chunk-SAUA52EJ.js +131 -0
  81. package/dist/{chunk-72I7EVOL.js → chunk-SYZADSLI.js} +10 -6
  82. package/dist/{chunk-TEOLG3N2.js → chunk-SZ2WPWXJ.js} +10 -6
  83. package/dist/{chunk-W2NEXOTG.js → chunk-T7RLPFGX.js} +2 -2
  84. package/dist/{chunk-J6TU45KP.js → chunk-TRA6A5C5.js} +26 -12
  85. package/dist/{chunk-H2W7IYVY.js → chunk-UTJJ5HFX.js} +18 -12
  86. package/dist/{chunk-5O34ZNC3.js → chunk-VAFBGFKY.js} +19 -13
  87. package/dist/{chunk-OJRSPDNJ.js → chunk-VD4RFTNV.js} +8 -14
  88. package/dist/chunk-VLQGQFW7.js +110 -0
  89. package/dist/{chunk-RTDUTWJ4.js → chunk-VMT7Y3AT.js} +5 -8
  90. package/dist/{chunk-LGQ737BP.js → chunk-WHTLXQB6.js} +1 -1
  91. package/dist/chunk-WLRRMT6W.js +1 -0
  92. package/dist/{chunk-2FCSWBSM.js → chunk-WMWX6DPB.js} +3 -3
  93. package/dist/{chunk-UMC64NCT.js → chunk-WVBGQCYC.js} +6 -3
  94. package/dist/{chunk-QCNLE27O.js → chunk-WXRQ42DR.js} +11 -7
  95. package/dist/{chunk-SY6V3HAK.js → chunk-XDU27NRX.js} +3 -3
  96. package/dist/{chunk-KA2J5OBA.js → chunk-XQDD76EF.js} +4 -7
  97. package/dist/chunk-XTATJMY6.js +64 -0
  98. package/dist/chunk-XYXMPHND.js +1 -0
  99. package/dist/{chunk-7ZWBHHRK.js → chunk-YNU6VRD5.js} +23 -32
  100. package/dist/{chunk-6SJPVQQW.js → chunk-Z3HF6XJ3.js} +1 -1
  101. package/dist/{chunk-I4URNMI7.js → chunk-ZC4MZAEX.js} +9 -7
  102. package/dist/{chunk-PWBPHGM3.js → chunk-ZCEUVK2R.js} +2 -2
  103. package/dist/chunk-ZT3NWE5U.js +1 -0
  104. package/dist/{chunk-RHOYF7MO.js → chunk-ZTLALVWA.js} +6 -15
  105. package/dist/components/Accordion/index.js +1 -1
  106. package/dist/components/Alert/index.js +2 -1
  107. package/dist/components/AlertDialog/index.js +3 -3
  108. package/dist/components/Amount/index.js +3 -1
  109. package/dist/components/AspectRatio/index.js +1 -1
  110. package/dist/components/Autocomplete/index.js +3 -2
  111. package/dist/components/Avatar/index.js +1 -1
  112. package/dist/components/AvatarGroup/index.js +3 -2
  113. package/dist/components/Badge/index.js +1 -1
  114. package/dist/components/Banner/index.js +2 -1
  115. package/dist/components/Breadcrumb/index.js +2 -1
  116. package/dist/components/Button/index.js +1 -1
  117. package/dist/components/ButtonGroup/index.js +1 -1
  118. package/dist/components/Callout/index.js +1 -1
  119. package/dist/components/Card/index.js +3 -1
  120. package/dist/components/CheckList/index.js +1 -1
  121. package/dist/components/Checkbox/index.js +1 -1
  122. package/dist/components/CheckboxCard/index.js +9 -0
  123. package/dist/components/Chip/index.js +2 -1
  124. package/dist/components/Citation/index.js +17 -0
  125. package/dist/components/Code/index.js +1 -1
  126. package/dist/components/Combobox/index.js +1 -1
  127. package/dist/components/CommandPalette/index.js +3 -2
  128. package/dist/components/ContextMenu/index.js +2 -2
  129. package/dist/components/CountryBadge/index.js +1 -1
  130. package/dist/components/DataTable/index.js +2 -1
  131. package/dist/components/DatePicker/index.js +5 -1
  132. package/dist/components/DateRangePicker/index.js +5 -1
  133. package/dist/components/Dialog/index.js +2 -2
  134. package/dist/components/Drawer/index.js +2 -2
  135. package/dist/components/DropdownMenu/index.js +2 -2
  136. package/dist/components/EmptyState/index.js +1 -1
  137. package/dist/components/ErrorState/index.js +2 -1
  138. package/dist/components/EyebrowChip/index.js +4 -1
  139. package/dist/components/FileUpload/index.js +2 -1
  140. package/dist/components/FilterChip/index.js +3 -1
  141. package/dist/components/Flex/index.js +2 -1
  142. package/dist/components/FormError/index.js +1 -1
  143. package/dist/components/FormField/index.js +7 -4
  144. package/dist/components/GradientDivider/index.js +1 -1
  145. package/dist/components/Grid/index.js +2 -1
  146. package/dist/components/Heading/index.js +4 -1
  147. package/dist/components/HelperText/index.js +4 -1
  148. package/dist/components/HoverCard/index.js +3 -2
  149. package/dist/components/IconButton/index.js +2 -1
  150. package/dist/components/Input/index.js +1 -1
  151. package/dist/components/Kbd/index.js +1 -1
  152. package/dist/components/KeyboardShortcut/index.js +2 -2
  153. package/dist/components/Label/index.js +4 -1
  154. package/dist/components/Link/index.js +1 -1
  155. package/dist/components/Logo/index.js +1 -1
  156. package/dist/components/MediaCard/index.js +9 -0
  157. package/dist/components/Menubar/index.js +2 -2
  158. package/dist/components/MessageBubble/index.js +18 -0
  159. package/dist/components/MoneyInput/index.js +3 -2
  160. package/dist/components/NavigationMenu/index.js +2 -2
  161. package/dist/components/NavigationRail/index.js +2 -1
  162. package/dist/components/NexubProvider/index.js +14 -0
  163. package/dist/components/NumberInput/index.js +3 -2
  164. package/dist/components/NumberTicker/index.js +10 -0
  165. package/dist/components/PageHeader/index.js +1 -1
  166. package/dist/components/Pagination/index.js +3 -1
  167. package/dist/components/PasswordInput/index.js +3 -2
  168. package/dist/components/Popover/index.js +2 -2
  169. package/dist/components/Progress/index.js +2 -1
  170. package/dist/components/PromptInput/index.js +15 -0
  171. package/dist/components/RadioCard/index.js +11 -0
  172. package/dist/components/RadioGroup/index.js +1 -1
  173. package/dist/components/Rating/index.js +2 -1
  174. package/dist/components/ScrollArea/index.js +1 -1
  175. package/dist/components/SearchInput/index.js +3 -2
  176. package/dist/components/Section/index.js +1 -1
  177. package/dist/components/SegmentedControl/index.js +3 -2
  178. package/dist/components/Select/index.js +2 -2
  179. package/dist/components/Separator/index.js +1 -1
  180. package/dist/components/Sidebar/index.js +2 -1
  181. package/dist/components/Skeleton/index.js +1 -1
  182. package/dist/components/Spinner/index.js +2 -1
  183. package/dist/components/SplitButton/index.js +5 -5
  184. package/dist/components/Stack/index.js +2 -1
  185. package/dist/components/StatusPill/index.js +1 -1
  186. package/dist/components/StreamingText/index.js +8 -0
  187. package/dist/components/Switch/index.js +1 -1
  188. package/dist/components/Table/index.js +1 -1
  189. package/dist/components/Tabs/index.js +3 -2
  190. package/dist/components/Tag/index.js +1 -1
  191. package/dist/components/Text/index.js +1 -1
  192. package/dist/components/TextGradient/index.js +1 -1
  193. package/dist/components/Textarea/index.js +1 -1
  194. package/dist/components/ThinkingIndicator/index.js +9 -0
  195. package/dist/components/Toast/index.js +3 -1
  196. package/dist/components/Tooltip/index.js +2 -1
  197. package/dist/components/TopNav/index.js +2 -1
  198. package/dist/index.d.ts +407 -22
  199. package/dist/index.js +245 -166
  200. package/package.json +52 -50
  201. package/dist/chunk-63DPMUMR.js +0 -67
  202. package/dist/chunk-CHGPGRML.js +0 -115
  203. package/dist/chunk-J2T4GFFS.js +0 -85
  204. package/dist/chunk-LH3BSAIS.js +0 -119
  205. package/dist/chunk-LMPGHWUA.js +0 -114
  206. package/dist/chunk-NMH5WSZG.js +0 -72
  207. package/dist/chunk-P44EROBX.js +0 -55
  208. package/dist/chunk-TYTW4F3B.js +0 -178
@@ -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
- };
@@ -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
- };
@@ -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
- };