@nexub/react 1.5.1 → 1.7.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-24ZFAXB2.js +101 -0
- package/dist/{chunk-XR4NBY54.js → chunk-2DYKENBM.js} +10 -10
- package/dist/{chunk-SVQCINRE.js → chunk-2I7FIU6R.js} +5 -2
- package/dist/{chunk-S46W2QER.js → chunk-37L5ERUJ.js} +17 -11
- package/dist/{chunk-CWS37T3K.js → chunk-3E7X3YK3.js} +4 -2
- package/dist/{chunk-EZ23IA3H.js → chunk-3LTB6TGN.js} +4 -4
- package/dist/chunk-3QD76BKT.js +80 -0
- package/dist/{chunk-PQ6GU7SG.js → chunk-4HQFOIZW.js} +20 -14
- package/dist/{chunk-RLE5RN3T.js → chunk-4NFUBFYK.js} +15 -11
- package/dist/{chunk-B54WADL4.js → chunk-4P2JJ2FH.js} +12 -12
- package/dist/{chunk-I4BHRVRL.js → chunk-4UBVU53C.js} +9 -5
- package/dist/chunk-52ZVJPF7.js +1 -0
- package/dist/chunk-5QEARXY3.js +55 -0
- package/dist/chunk-643EYCLL.js +54 -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-77LYWSJW.js +85 -0
- package/dist/{chunk-NCRFKPA4.js → chunk-7MSIOYJZ.js} +6 -8
- 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-AGYGWU6C.js +88 -0
- package/dist/chunk-AT2DSFP3.js +47 -0
- package/dist/{chunk-IIPYF6ZQ.js → chunk-B254JXS7.js} +16 -13
- package/dist/{chunk-GRB6T2TT.js → chunk-BSL62LBX.js} +19 -13
- 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-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-FD7YU53N.js → chunk-DT3QGFXB.js} +4 -4
- package/dist/chunk-F73DTG2V.js +123 -0
- package/dist/{chunk-Z3IG5WRA.js → chunk-FJUVYRNT.js} +3 -3
- package/dist/{chunk-KQPLFVFR.js → chunk-FLZD7HQY.js} +0 -2
- package/dist/chunk-GG54WBLA.js +134 -0
- package/dist/{chunk-64JDZWCV.js → chunk-GRKCUQG4.js} +6 -5
- package/dist/{chunk-YPHNHQYQ.js → chunk-GWDEKW7P.js} +6 -2
- package/dist/{chunk-4I5ULCYG.js → chunk-HFTS5AN7.js} +3 -3
- package/dist/{chunk-GUB7YKG2.js → chunk-I4U36P54.js} +6 -3
- package/dist/{chunk-BTRTORKU.js → chunk-I6CAF7C5.js} +6 -7
- package/dist/{chunk-TJCHA3OI.js → chunk-J65MK3N4.js} +7 -4
- package/dist/{chunk-IK23Q2OF.js → chunk-JHVYI5GK.js} +3 -3
- package/dist/{chunk-J6TU45KP.js → chunk-JSBNYRO4.js} +26 -12
- package/dist/chunk-K5FKEAAK.js +94 -0
- package/dist/{chunk-5URGARPH.js → chunk-KE4YVG5Q.js} +6 -10
- package/dist/{chunk-QCNLE27O.js → chunk-KRCLK5O4.js} +11 -7
- package/dist/{chunk-A4IMFAZX.js → chunk-LESI7J7B.js} +3 -3
- package/dist/chunk-MLT7SA3T.js +171 -0
- package/dist/chunk-MNEXMMLM.js +23 -0
- package/dist/{chunk-PVTACENM.js → chunk-MTK3GHDQ.js} +2 -2
- package/dist/chunk-MYP5ZTC3.js +169 -0
- package/dist/chunk-NA5UMOE5.js +55 -0
- package/dist/chunk-NAJKIBU2.js +163 -0
- package/dist/{chunk-WESZPFBZ.js → chunk-NERAWEIQ.js} +7 -4
- 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-5O34ZNC3.js → chunk-NYWD5SI4.js} +19 -13
- package/dist/chunk-NZR4UGUZ.js +143 -0
- package/dist/{chunk-6J3QTWKC.js → chunk-NZT4TTNV.js} +18 -9
- 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-NIX4SEKM.js → chunk-PREMZMLU.js} +7 -4
- package/dist/{chunk-4SSUM4CL.js → chunk-QUNH4BFR.js} +9 -6
- package/dist/{chunk-FHFVBOF3.js → chunk-QUYOV2ZJ.js} +6 -4
- package/dist/{chunk-KM6Z3VTI.js → chunk-QVTVDL6Y.js} +1 -1
- package/dist/{chunk-XI63BK3S.js → chunk-RATKKN3F.js} +3 -3
- package/dist/chunk-RM7MTOT5.js +339 -0
- package/dist/{chunk-DJZZ3FIP.js → chunk-RUR57JZQ.js} +5 -14
- package/dist/{chunk-ZV3AF5CL.js → chunk-S2CTBFLN.js} +13 -2
- package/dist/{chunk-72I7EVOL.js → chunk-SYZADSLI.js} +10 -6
- package/dist/{chunk-W2NEXOTG.js → chunk-T7RLPFGX.js} +2 -2
- package/dist/chunk-TAVVXXGO.js +131 -0
- package/dist/{chunk-BFRX6X4O.js → chunk-TZ6KJIR4.js} +23 -17
- package/dist/{chunk-V3TETH4J.js → chunk-U2ZYPPRG.js} +17 -16
- package/dist/{chunk-AHT35UWY.js → chunk-UTLKZPKJ.js} +10 -6
- 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-AXOKFS4K.js → chunk-W3KO3JNZ.js} +20 -4
- 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-TEOLG3N2.js → chunk-X4BQHXLB.js} +10 -6
- 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-NQVRF4RB.js → chunk-ZMJ54TG6.js} +16 -13
- 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/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 +440 -24
- package/dist/index.js +225 -146
- package/package.json +52 -50
- package/dist/chunk-63DPMUMR.js +0 -67
- package/dist/chunk-CHGPGRML.js +0 -115
- package/dist/chunk-H2W7IYVY.js +0 -155
- 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
|
@@ -34,21 +34,21 @@ var thumbVariants = cva(
|
|
|
34
34
|
[
|
|
35
35
|
"pointer-events-none block rounded-full shadow-elevation-1",
|
|
36
36
|
"transition-[transform,background-color] duration-expressive-fast ease-expressive-fast",
|
|
37
|
-
"translate-x-0.5 data-[state=unchecked]:bg-[var(--color-outline)] data-[state=checked]:bg-[var(--color-on-primary)] data-[disabled]:data-[state=unchecked]:bg-[var(--color-outline-variant)]"
|
|
37
|
+
"translate-x-0.5 rtl:-translate-x-0.5 data-[state=unchecked]:bg-[var(--color-outline)] data-[state=checked]:bg-[var(--color-on-primary)] data-[disabled]:data-[state=unchecked]:bg-[var(--color-outline-variant)]"
|
|
38
38
|
],
|
|
39
39
|
{
|
|
40
40
|
variants: {
|
|
41
41
|
size: {
|
|
42
|
-
sm: "h-3 w-3 data-[state=checked]:translate-x-[18px]",
|
|
43
|
-
md: "h-5 w-5 data-[state=checked]:translate-x-[22px]",
|
|
44
|
-
lg: "h-6 w-6 data-[state=checked]:translate-x-[26px]"
|
|
42
|
+
sm: "h-3 w-3 data-[state=checked]:translate-x-[18px] rtl:data-[state=checked]:-translate-x-[18px]",
|
|
43
|
+
md: "h-5 w-5 data-[state=checked]:translate-x-[22px] rtl:data-[state=checked]:-translate-x-[22px]",
|
|
44
|
+
lg: "h-6 w-6 data-[state=checked]:translate-x-[26px] rtl:data-[state=checked]:-translate-x-[26px]"
|
|
45
45
|
}
|
|
46
46
|
},
|
|
47
47
|
defaultVariants: { size: "md" }
|
|
48
48
|
}
|
|
49
49
|
);
|
|
50
50
|
var Switch = React.forwardRef(
|
|
51
|
-
({ className, size, ...props }, ref) => /* @__PURE__ */ jsx(RadixSwitch.Root, { ref, className: cn(switchVariants({ size }), className), ...props, children: /* @__PURE__ */ jsx(RadixSwitch.Thumb, { className: cn(thumbVariants({ size })) }) })
|
|
51
|
+
({ className, size, ...props }, ref) => /* @__PURE__ */ jsx(RadixSwitch.Root, { ref, className: cn(switchVariants({ size }), "nx-hit", className), ...props, children: /* @__PURE__ */ jsx(RadixSwitch.Thumb, { className: cn(thumbVariants({ size })) }) })
|
|
52
52
|
);
|
|
53
53
|
Switch.displayName = "Switch";
|
|
54
54
|
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import {
|
|
3
|
+
disabledContainer,
|
|
4
|
+
disabledText,
|
|
5
|
+
pressable
|
|
6
|
+
} from "./chunk-7SXR4PGO.js";
|
|
7
|
+
import {
|
|
8
|
+
glassSurfaceClass
|
|
9
|
+
} from "./chunk-DEIBF3P7.js";
|
|
10
|
+
import {
|
|
11
|
+
cn
|
|
12
|
+
} from "./chunk-Q7G5WGYV.js";
|
|
13
|
+
|
|
14
|
+
// src/components/Button/Button.tsx
|
|
15
|
+
import * as React from "react";
|
|
16
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
17
|
+
import { Loader2 } from "@nexub/icons";
|
|
18
|
+
import { cva } from "class-variance-authority";
|
|
19
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
20
|
+
var toneTextClasses = {
|
|
21
|
+
neutral: "text-[var(--color-on-surface-variant)]",
|
|
22
|
+
info: "text-[var(--color-info)]",
|
|
23
|
+
success: "text-[var(--color-success)]",
|
|
24
|
+
warning: "text-[var(--color-warning)]",
|
|
25
|
+
danger: "text-[var(--color-error)]",
|
|
26
|
+
leap: "text-[var(--color-leap)]",
|
|
27
|
+
bookub: "text-[var(--color-bookub)]",
|
|
28
|
+
payub: "text-[var(--color-payub)]",
|
|
29
|
+
founderub: "text-[var(--color-founderub)]"
|
|
30
|
+
};
|
|
31
|
+
var toneClasses = {
|
|
32
|
+
neutral: "bg-[var(--color-surface-container-high)] text-[var(--color-on-surface)]",
|
|
33
|
+
info: "bg-[var(--color-info)] text-[var(--color-on-info)]",
|
|
34
|
+
success: "bg-[var(--color-success)] text-[var(--color-on-success)]",
|
|
35
|
+
warning: "bg-[var(--color-warning)] text-[var(--color-on-warning)]",
|
|
36
|
+
danger: "bg-[var(--color-error)] text-[var(--color-on-error)]",
|
|
37
|
+
leap: "bg-[var(--color-leap)] text-[var(--color-on-leap)]",
|
|
38
|
+
bookub: "bg-[var(--color-bookub)] text-[var(--color-on-bookub)]",
|
|
39
|
+
payub: "bg-[var(--color-payub)] text-[var(--color-on-payub)]",
|
|
40
|
+
founderub: "bg-[var(--color-founderub)] text-[var(--color-on-founderub)]"
|
|
41
|
+
};
|
|
42
|
+
var filled = `bg-[var(--color-primary)] text-[var(--color-on-primary)] ${disabledContainer}`;
|
|
43
|
+
var tonal = `bg-[var(--color-secondary-container)] text-[var(--color-on-secondary-container)] ${disabledContainer}`;
|
|
44
|
+
var outlined = `bg-transparent border border-[var(--color-outline-variant)] text-[var(--color-on-surface)] ${disabledContainer}`;
|
|
45
|
+
var text = `bg-transparent text-[var(--color-on-surface)] ${disabledText}`;
|
|
46
|
+
var buttonVariants = cva(
|
|
47
|
+
[pressable, "nx-hit relative inline-flex items-center justify-center gap-2 whitespace-nowrap"],
|
|
48
|
+
{
|
|
49
|
+
variants: {
|
|
50
|
+
variant: {
|
|
51
|
+
filled,
|
|
52
|
+
tonal,
|
|
53
|
+
outlined,
|
|
54
|
+
text,
|
|
55
|
+
// Thin glass: for buttons floating over content/media (toolbars, media controls).
|
|
56
|
+
glass: `border ${glassSurfaceClass} text-[var(--color-on-surface)] ${disabledContainer}`,
|
|
57
|
+
// Legacy names (kept as aliases).
|
|
58
|
+
primary: filled,
|
|
59
|
+
secondary: tonal,
|
|
60
|
+
subtle: `bg-[var(--color-surface-container-high)] text-[var(--color-on-surface)] ${disabledContainer}`,
|
|
61
|
+
outline: outlined,
|
|
62
|
+
ghost: text,
|
|
63
|
+
destructive: `bg-[var(--color-error)] text-[var(--color-on-error)] ${disabledContainer}`,
|
|
64
|
+
accent: `bg-[var(--color-tertiary)] text-[var(--color-on-tertiary)] ${disabledContainer}`,
|
|
65
|
+
link: `bg-transparent text-[var(--color-primary)] underline underline-offset-[0.3em] ${disabledText}`
|
|
66
|
+
},
|
|
67
|
+
// The control ladder (density-aware: data-density="compact" shrinks it).
|
|
68
|
+
size: {
|
|
69
|
+
xs: "h-control-xs px-2.5 text-label-sm",
|
|
70
|
+
sm: "h-control-sm px-3.5 text-label-md",
|
|
71
|
+
md: "h-control-md px-5 text-label-lg",
|
|
72
|
+
lg: "h-control-lg px-6 text-title-md",
|
|
73
|
+
xl: "h-control-xl px-7 text-title-md"
|
|
74
|
+
},
|
|
75
|
+
fullWidth: {
|
|
76
|
+
true: "w-full"
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
defaultVariants: {
|
|
80
|
+
variant: "primary",
|
|
81
|
+
size: "md"
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
);
|
|
85
|
+
var CheckIcon = () => /* @__PURE__ */ jsx("svg", { className: "h-4 w-4", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { className: "nx-check-draw", pathLength: 1, d: "M20 6 9 17l-5-5" }) });
|
|
86
|
+
var Button = React.forwardRef(
|
|
87
|
+
({
|
|
88
|
+
className,
|
|
89
|
+
variant,
|
|
90
|
+
size,
|
|
91
|
+
tone,
|
|
92
|
+
status: statusProp,
|
|
93
|
+
loading,
|
|
94
|
+
loadingLabel = "Loading",
|
|
95
|
+
successLabel,
|
|
96
|
+
errorLabel = "Something went wrong",
|
|
97
|
+
fullWidth,
|
|
98
|
+
leadingIcon,
|
|
99
|
+
trailingIcon,
|
|
100
|
+
asChild = false,
|
|
101
|
+
disabled,
|
|
102
|
+
onClick,
|
|
103
|
+
children,
|
|
104
|
+
...props
|
|
105
|
+
}, ref) => {
|
|
106
|
+
const status = statusProp ?? (loading ? "loading" : "idle");
|
|
107
|
+
const sharedProps = {
|
|
108
|
+
className: cn(
|
|
109
|
+
buttonVariants({ variant, size, fullWidth }),
|
|
110
|
+
tone ? toneClasses[tone] : "",
|
|
111
|
+
!asChild && status === "error" && "nx-shake",
|
|
112
|
+
className
|
|
113
|
+
),
|
|
114
|
+
"data-tone": tone,
|
|
115
|
+
...variant === "glass" && { "data-material": "glass", "data-glass-thickness": "thin" },
|
|
116
|
+
...props
|
|
117
|
+
};
|
|
118
|
+
if (asChild) {
|
|
119
|
+
return /* @__PURE__ */ jsx(Slot, { ref, onClick, ...sharedProps, children });
|
|
120
|
+
}
|
|
121
|
+
const busy = status === "loading";
|
|
122
|
+
const swapLabel = status === "success" && successLabel !== void 0;
|
|
123
|
+
const overlay = busy ? /* @__PURE__ */ jsx(Loader2, { className: "h-4 w-4 animate-spin", "aria-hidden": "true" }) : status === "success" && !swapLabel ? /* @__PURE__ */ jsx(CheckIcon, {}) : null;
|
|
124
|
+
const announcement = status === "loading" ? loadingLabel : status === "success" ? successLabel ?? "Done" : status === "error" ? errorLabel : "";
|
|
125
|
+
const button = /* @__PURE__ */ jsxs(
|
|
126
|
+
"button",
|
|
127
|
+
{
|
|
128
|
+
ref,
|
|
129
|
+
disabled,
|
|
130
|
+
"aria-busy": busy || void 0,
|
|
131
|
+
"aria-disabled": busy || props["aria-disabled"] || void 0,
|
|
132
|
+
onClick: (e) => {
|
|
133
|
+
if (busy) {
|
|
134
|
+
e.preventDefault();
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
onClick?.(e);
|
|
138
|
+
},
|
|
139
|
+
"data-status": status === "idle" ? void 0 : status,
|
|
140
|
+
...sharedProps,
|
|
141
|
+
children: [
|
|
142
|
+
/* @__PURE__ */ jsx("span", { className: cn("contents", overlay && "text-transparent [&_img]:invisible [&_svg]:invisible"), children: swapLabel ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
143
|
+
/* @__PURE__ */ jsx(CheckIcon, {}),
|
|
144
|
+
successLabel
|
|
145
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
146
|
+
leadingIcon,
|
|
147
|
+
children,
|
|
148
|
+
trailingIcon
|
|
149
|
+
] }) }),
|
|
150
|
+
overlay && /* @__PURE__ */ jsx("span", { className: "absolute inset-0 flex items-center justify-center", "aria-hidden": "true", children: overlay })
|
|
151
|
+
]
|
|
152
|
+
}
|
|
153
|
+
);
|
|
154
|
+
if (statusProp === void 0 && loading === void 0) return button;
|
|
155
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
156
|
+
button,
|
|
157
|
+
/* @__PURE__ */ jsx("span", { role: "status", className: "sr-only", children: announcement })
|
|
158
|
+
] });
|
|
159
|
+
}
|
|
160
|
+
);
|
|
161
|
+
Button.displayName = "Button";
|
|
162
|
+
|
|
163
|
+
export {
|
|
164
|
+
toneTextClasses,
|
|
165
|
+
buttonVariants,
|
|
166
|
+
Button
|
|
167
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use client';
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import {
|
|
3
|
-
useMergedRefs,
|
|
4
3
|
useSlidingIndicator
|
|
5
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-6UKNUI46.js";
|
|
5
|
+
import {
|
|
6
|
+
useMergedRefs
|
|
7
|
+
} from "./chunk-MNEXMMLM.js";
|
|
6
8
|
import {
|
|
7
9
|
cn
|
|
8
10
|
} from "./chunk-Q7G5WGYV.js";
|
|
@@ -55,7 +57,7 @@ var Trigger2 = React.forwardRef(
|
|
|
55
57
|
ref,
|
|
56
58
|
className: cn(
|
|
57
59
|
// State layer for hover/press; focus = the global ring.
|
|
58
|
-
"nx-state-layer relative inline-flex h-control-md items-center justify-center whitespace-nowrap rounded-t-
|
|
60
|
+
"nx-state-layer relative inline-flex h-control-md items-center justify-center whitespace-nowrap rounded-t-[var(--shape-field)] px-4 text-label-lg select-none",
|
|
59
61
|
"text-[var(--color-on-surface-variant)] transition-colors duration-effects-fast ease-effects-fast",
|
|
60
62
|
"data-[state=active]:text-[var(--color-primary)]",
|
|
61
63
|
"disabled:pointer-events-none disabled:text-[var(--color-text-disabled)]",
|
|
@@ -11,18 +11,18 @@ var separatorVariants = cva("", {
|
|
|
11
11
|
variants: {
|
|
12
12
|
orientation: {
|
|
13
13
|
horizontal: "w-full border-t",
|
|
14
|
-
vertical: "h-full border-
|
|
14
|
+
vertical: "h-full border-s self-stretch"
|
|
15
15
|
},
|
|
16
16
|
tone: {
|
|
17
|
-
neutral: "border-[var(--color-
|
|
18
|
-
info: "border-[var(--color-
|
|
19
|
-
success: "border-[var(--color-
|
|
20
|
-
warning: "border-[var(--color-
|
|
21
|
-
danger: "border-[var(--color-
|
|
22
|
-
leap: "border-[var(--color-leap
|
|
23
|
-
bookub: "border-[var(--color-bookub
|
|
24
|
-
payub: "border-[var(--color-payub
|
|
25
|
-
founderub: "border-[var(--color-founderub
|
|
17
|
+
neutral: "border-[var(--color-outline-variant)]",
|
|
18
|
+
info: "border-[color-mix(in_srgb,var(--color-info)_30%,transparent)]",
|
|
19
|
+
success: "border-[color-mix(in_srgb,var(--color-success)_30%,transparent)]",
|
|
20
|
+
warning: "border-[color-mix(in_srgb,var(--color-warning)_30%,transparent)]",
|
|
21
|
+
danger: "border-[color-mix(in_srgb,var(--color-error)_30%,transparent)]",
|
|
22
|
+
leap: "border-[color-mix(in_srgb,var(--color-leap)_30%,transparent)]",
|
|
23
|
+
bookub: "border-[color-mix(in_srgb,var(--color-bookub)_30%,transparent)]",
|
|
24
|
+
payub: "border-[color-mix(in_srgb,var(--color-payub)_30%,transparent)]",
|
|
25
|
+
founderub: "border-[color-mix(in_srgb,var(--color-founderub)_30%,transparent)]"
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
defaultVariants: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import {
|
|
3
3
|
Kbd
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-LESI7J7B.js";
|
|
5
5
|
import {
|
|
6
6
|
cn
|
|
7
7
|
} from "./chunk-Q7G5WGYV.js";
|
|
@@ -22,7 +22,7 @@ var KeyboardShortcut = React.forwardRef(
|
|
|
22
22
|
index > 0 && /* @__PURE__ */ jsx(
|
|
23
23
|
"span",
|
|
24
24
|
{
|
|
25
|
-
className: "text-[var(--color-
|
|
25
|
+
className: "text-[var(--color-on-surface-muted)] text-xs select-none",
|
|
26
26
|
"aria-hidden": "true",
|
|
27
27
|
children: "+"
|
|
28
28
|
}
|
|
@@ -14,7 +14,7 @@ var Code = React.forwardRef(
|
|
|
14
14
|
{
|
|
15
15
|
ref,
|
|
16
16
|
className: cn(
|
|
17
|
-
"font-mono text-sm bg-[var(--color-
|
|
17
|
+
"font-mono text-sm bg-[var(--color-surface-container-high)] px-1.5 py-0.5 rounded-shape-min",
|
|
18
18
|
className
|
|
19
19
|
),
|
|
20
20
|
...rest,
|
|
@@ -26,7 +26,7 @@ var Code = React.forwardRef(
|
|
|
26
26
|
"pre",
|
|
27
27
|
{
|
|
28
28
|
className: cn(
|
|
29
|
-
"overflow-x-auto rounded-
|
|
29
|
+
"overflow-x-auto rounded-shape-container bg-[var(--color-surface-container-high)] p-4",
|
|
30
30
|
className
|
|
31
31
|
),
|
|
32
32
|
children: /* @__PURE__ */ jsx(
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import {
|
|
3
|
+
cn
|
|
4
|
+
} from "./chunk-Q7G5WGYV.js";
|
|
5
|
+
|
|
6
|
+
// src/components/Skeleton/Skeleton.tsx
|
|
7
|
+
import * as React from "react";
|
|
8
|
+
import { cva } from "class-variance-authority";
|
|
9
|
+
import { jsx } from "react/jsx-runtime";
|
|
10
|
+
var skeletonVariants = cva(
|
|
11
|
+
"block bg-surface-container-highest",
|
|
12
|
+
{
|
|
13
|
+
variants: {
|
|
14
|
+
shape: {
|
|
15
|
+
line: "h-[1em] w-full rounded-shape-min",
|
|
16
|
+
rect: "w-full rounded-shape-container",
|
|
17
|
+
circle: "size-10 rounded-full"
|
|
18
|
+
},
|
|
19
|
+
animated: {
|
|
20
|
+
true: "animate-pulse motion-reduce:animate-none"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
defaultVariants: {
|
|
24
|
+
shape: "line",
|
|
25
|
+
animated: true
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
var px = (v) => typeof v === "number" ? `${v}px` : v;
|
|
30
|
+
var Skeleton = React.forwardRef(
|
|
31
|
+
({
|
|
32
|
+
className,
|
|
33
|
+
shape = "line",
|
|
34
|
+
width,
|
|
35
|
+
height,
|
|
36
|
+
animated = true,
|
|
37
|
+
style,
|
|
38
|
+
...props
|
|
39
|
+
}, ref) => {
|
|
40
|
+
const w = width ?? (shape === "circle" ? height : void 0);
|
|
41
|
+
const h = height ?? (shape === "circle" ? width : void 0);
|
|
42
|
+
const sizeStyle = w !== void 0 || h !== void 0 ? { ...w !== void 0 && { width: px(w) }, ...h !== void 0 && { height: px(h) } } : void 0;
|
|
43
|
+
return /* @__PURE__ */ jsx(
|
|
44
|
+
"span",
|
|
45
|
+
{
|
|
46
|
+
ref,
|
|
47
|
+
"aria-hidden": "true",
|
|
48
|
+
className: cn(skeletonVariants({ shape, animated }), className),
|
|
49
|
+
style: sizeStyle || style ? { ...sizeStyle, ...style } : void 0,
|
|
50
|
+
...props
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
Skeleton.displayName = "Skeleton";
|
|
56
|
+
|
|
57
|
+
export {
|
|
58
|
+
skeletonVariants,
|
|
59
|
+
Skeleton
|
|
60
|
+
};
|
|
@@ -16,10 +16,10 @@ var sectionVariants = cva("w-full", {
|
|
|
16
16
|
lg: "py-32"
|
|
17
17
|
},
|
|
18
18
|
tone: {
|
|
19
|
-
default: "bg-[var(--color-
|
|
20
|
-
subtle: "bg-[var(--color-
|
|
21
|
-
muted: "bg-[var(--color-
|
|
22
|
-
inverse: "bg-[var(--color-
|
|
19
|
+
default: "bg-[var(--color-surface)]",
|
|
20
|
+
subtle: "bg-[var(--color-surface-container-low)]",
|
|
21
|
+
muted: "bg-[var(--color-surface-container-high)]",
|
|
22
|
+
inverse: "bg-[var(--color-inverse-surface)] text-[var(--color-inverse-on-surface)]"
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
25
|
defaultVariants: {
|
|
@@ -0,0 +1,123 @@
|
|
|
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 React2 from "react";
|
|
11
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
12
|
+
import { cva } from "class-variance-authority";
|
|
13
|
+
|
|
14
|
+
// src/hooks/usePointerSheen.ts
|
|
15
|
+
import * as React from "react";
|
|
16
|
+
function usePointerSheen(enabled, onPointerMove) {
|
|
17
|
+
const frame = React.useRef(0);
|
|
18
|
+
React.useEffect(() => () => cancelAnimationFrame(frame.current), []);
|
|
19
|
+
const handler = React.useCallback(
|
|
20
|
+
(event) => {
|
|
21
|
+
onPointerMove?.(event);
|
|
22
|
+
if (event.pointerType === "touch") return;
|
|
23
|
+
const el = event.currentTarget;
|
|
24
|
+
const { clientX, clientY } = event;
|
|
25
|
+
cancelAnimationFrame(frame.current);
|
|
26
|
+
frame.current = requestAnimationFrame(() => {
|
|
27
|
+
const r = el.getBoundingClientRect();
|
|
28
|
+
el.style.setProperty("--nx-mx", `${clientX - r.left}px`);
|
|
29
|
+
el.style.setProperty("--nx-my", `${clientY - r.top}px`);
|
|
30
|
+
});
|
|
31
|
+
},
|
|
32
|
+
[onPointerMove]
|
|
33
|
+
);
|
|
34
|
+
return enabled ? handler : onPointerMove;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// src/components/Card/Card.tsx
|
|
38
|
+
import { jsx } from "react/jsx-runtime";
|
|
39
|
+
var cardVariants = cva(
|
|
40
|
+
// In-flow content: tone + a soft alpha hairline, no shadow (shadows are for floating layers).
|
|
41
|
+
// A CardLink inside stretches over the card; the card then carries its focus ring.
|
|
42
|
+
"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)] has-[[data-card-link]]:relative has-[[data-card-link]:focus-visible]:outline has-[[data-card-link]:focus-visible]:outline-[3px] has-[[data-card-link]:focus-visible]:outline-offset-2 has-[[data-card-link]:focus-visible]:outline-[var(--color-primary)]",
|
|
43
|
+
{
|
|
44
|
+
variants: {
|
|
45
|
+
variant: {
|
|
46
|
+
flat: "",
|
|
47
|
+
surface: "bg-[var(--color-surface-elevated)] shadow-elevation-1",
|
|
48
|
+
// Lift on hover (spring, elevation 1 → 2), sink on press, state layer
|
|
49
|
+
// tint; see .nx-lift in themes/base.css.
|
|
50
|
+
interactive: "nx-state-layer nx-lift cursor-pointer bg-[var(--color-surface-elevated)] shadow-elevation-1"
|
|
51
|
+
},
|
|
52
|
+
// Material. 'glass' needs data-material="glass" on the element (set in the
|
|
53
|
+
// component) for the --glass-* vars to resolve. Single box-shadow carries
|
|
54
|
+
// both the inset specular highlight and the drop shadow so neither clobbers
|
|
55
|
+
// the other. Listed after `variant` so tailwind-merge lets it win on bg/border.
|
|
56
|
+
surface: {
|
|
57
|
+
solid: "",
|
|
58
|
+
glass: glassSurfaceClass
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
defaultVariants: {
|
|
62
|
+
variant: "flat",
|
|
63
|
+
surface: "solid"
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
var toneBorderMap = {
|
|
68
|
+
neutral: "",
|
|
69
|
+
info: "border-s-4 border-s-[var(--color-info)]",
|
|
70
|
+
success: "border-s-4 border-s-[var(--color-success)]",
|
|
71
|
+
warning: "border-s-4 border-s-[var(--color-warning)]",
|
|
72
|
+
danger: "border-s-4 border-s-[var(--color-error)]",
|
|
73
|
+
leap: "border-s-4 border-s-[var(--color-leap)]",
|
|
74
|
+
bookub: "border-s-4 border-s-[var(--color-bookub)]",
|
|
75
|
+
payub: "border-s-4 border-s-[var(--color-payub)]",
|
|
76
|
+
founderub: "border-s-4 border-s-[var(--color-founderub)]"
|
|
77
|
+
};
|
|
78
|
+
var Card = React2.forwardRef(
|
|
79
|
+
({ className, variant = "flat", surface = "solid", effect = "none", tone, asChild = false, onPointerMove, children, ...props }, ref) => {
|
|
80
|
+
const Comp = asChild ? Slot : "div";
|
|
81
|
+
const toneStyle = tone ? toneBorderMap[tone] : "";
|
|
82
|
+
const sheen = effect === "sheen";
|
|
83
|
+
const handlePointerMove = usePointerSheen(sheen, onPointerMove);
|
|
84
|
+
return /* @__PURE__ */ jsx(
|
|
85
|
+
Comp,
|
|
86
|
+
{
|
|
87
|
+
ref,
|
|
88
|
+
className: cn(cardVariants({ variant, surface }), toneStyle, sheen && "nx-sheen", className),
|
|
89
|
+
onPointerMove: handlePointerMove,
|
|
90
|
+
"data-tone": tone,
|
|
91
|
+
"data-material": surface === "glass" ? "glass" : void 0,
|
|
92
|
+
...props,
|
|
93
|
+
children
|
|
94
|
+
}
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
);
|
|
98
|
+
Card.displayName = "Card";
|
|
99
|
+
var CardLink = React2.forwardRef(
|
|
100
|
+
({ className, asChild = false, ...props }, ref) => {
|
|
101
|
+
const Comp = asChild ? Slot : "a";
|
|
102
|
+
return /* @__PURE__ */ jsx(
|
|
103
|
+
Comp,
|
|
104
|
+
{
|
|
105
|
+
ref,
|
|
106
|
+
"data-card-link": "",
|
|
107
|
+
className: cn(
|
|
108
|
+
"text-inherit no-underline outline-none after:absolute after:inset-0 after:rounded-[inherit] after:content-['']",
|
|
109
|
+
className
|
|
110
|
+
),
|
|
111
|
+
...props
|
|
112
|
+
}
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
);
|
|
116
|
+
CardLink.displayName = "CardLink";
|
|
117
|
+
|
|
118
|
+
export {
|
|
119
|
+
usePointerSheen,
|
|
120
|
+
cardVariants,
|
|
121
|
+
Card,
|
|
122
|
+
CardLink
|
|
123
|
+
};
|
|
@@ -27,7 +27,7 @@ var Input = React.forwardRef(
|
|
|
27
27
|
{
|
|
28
28
|
ref,
|
|
29
29
|
className: cn(
|
|
30
|
-
"flex h-control-md w-full bg-transparent text-body-md outline-none placeholder:text-[var(--color-
|
|
30
|
+
"flex h-control-md w-full bg-transparent text-body-md outline-none placeholder:text-[var(--color-on-surface-muted)] disabled:cursor-not-allowed disabled:text-[var(--color-text-disabled)]",
|
|
31
31
|
className
|
|
32
32
|
),
|
|
33
33
|
...props
|
|
@@ -63,7 +63,7 @@ var Group = React.forwardRef(
|
|
|
63
63
|
{
|
|
64
64
|
ref,
|
|
65
65
|
className: cn(
|
|
66
|
-
"overflow-hidden p-1 text-[var(--color-
|
|
66
|
+
"overflow-hidden p-1 text-[var(--color-on-surface)] [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-[var(--color-on-surface-muted)]",
|
|
67
67
|
className
|
|
68
68
|
),
|
|
69
69
|
...props
|
|
@@ -77,7 +77,7 @@ var Item = React.forwardRef(
|
|
|
77
77
|
{
|
|
78
78
|
ref,
|
|
79
79
|
className: cn(
|
|
80
|
-
"relative flex cursor-default select-none items-center rounded-
|
|
80
|
+
"relative flex cursor-default select-none items-center rounded-[10px] px-2.5 py-2 text-body-sm outline-none",
|
|
81
81
|
// Highlight = the on-surface state layer at hover opacity.
|
|
82
82
|
"aria-selected:bg-[color-mix(in_srgb,var(--color-on-surface)_8%,transparent)]",
|
|
83
83
|
"data-[disabled=true]:pointer-events-none data-[disabled=true]:text-[var(--color-text-disabled)]",
|
|
@@ -12,7 +12,6 @@ var menuItem = [
|
|
|
12
12
|
].join(" ");
|
|
13
13
|
var menuSeparator = "-mx-1.5 my-1.5 h-px bg-[var(--color-outline-variant)]";
|
|
14
14
|
var menuLabel = "px-2.5 py-1.5 text-label-sm text-[var(--color-on-surface-muted)]";
|
|
15
|
-
var enterExit = "duration-spatial-default ease-spatial-default data-[state=closed]:duration-effects-fast data-[state=closed]:ease-effects-fast";
|
|
16
15
|
var scrim = "bg-[color-mix(in_srgb,var(--color-scrim,#000)_40%,transparent)]";
|
|
17
16
|
|
|
18
17
|
export {
|
|
@@ -22,6 +21,5 @@ export {
|
|
|
22
21
|
menuItem,
|
|
23
22
|
menuSeparator,
|
|
24
23
|
menuLabel,
|
|
25
|
-
enterExit,
|
|
26
24
|
scrim
|
|
27
25
|
};
|