@nexub/react 1.1.0 → 1.3.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-6MYVXJPJ.js +1639 -0
- package/dist/{chunk-4NGB7XIM.js → chunk-CMYEVLQT.js} +21 -1
- package/dist/{chunk-YAGVMERC.js → chunk-E3QPDCEV.js} +17 -1
- package/dist/{chunk-S344IRK4.js → chunk-EVCTOIRS.js} +4 -1
- package/dist/{chunk-AHZQQ7OT.js → chunk-MV7WMQI4.js} +29 -9
- package/dist/{chunk-V6GZZFTV.js → chunk-QRZV2FLW.js} +1 -1
- package/dist/{chunk-2MKB5FQI.js → chunk-RIDDJUPA.js} +1 -1
- package/dist/{chunk-L6GBZ2HB.js → chunk-ZLSUVZM2.js} +1 -1
- package/dist/components/AlertDialog/index.js +1 -1
- package/dist/components/CommandPalette/index.js +1 -1
- package/dist/components/Dialog/index.js +1 -1
- package/dist/components/Drawer/index.js +1 -1
- package/dist/components/Logo/index.js +1 -1
- package/dist/components/Sidebar/index.js +1 -1
- package/dist/components/Tabs/index.js +1 -1
- package/dist/components/ThemeProvider/index.js +3 -1
- package/dist/index.d.ts +109 -27
- package/dist/index.js +14 -12
- package/package.json +8 -7
- package/dist/chunk-4BTP4464.js +0 -92
|
@@ -25,6 +25,26 @@ var Root = React.forwardRef(
|
|
|
25
25
|
)
|
|
26
26
|
);
|
|
27
27
|
Root.displayName = "Sidebar.Root";
|
|
28
|
+
var Header = React.forwardRef(
|
|
29
|
+
({ className, status, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
30
|
+
"div",
|
|
31
|
+
{
|
|
32
|
+
ref,
|
|
33
|
+
className: cn(
|
|
34
|
+
// Wraps instead of overlapping: the status drops to its own line when
|
|
35
|
+
// the logo needs the width, and a logo wider than the sidebar truncates.
|
|
36
|
+
"flex shrink-0 flex-wrap items-center justify-between gap-x-3 gap-y-2 border-b border-[var(--color-border-default)] px-3 py-3 group-data-[collapsed=true]/sidebar:justify-center group-data-[collapsed=true]/sidebar:px-2",
|
|
37
|
+
className
|
|
38
|
+
),
|
|
39
|
+
...props,
|
|
40
|
+
children: [
|
|
41
|
+
/* @__PURE__ */ jsx("div", { className: "flex min-w-0 max-w-full items-center", children }),
|
|
42
|
+
status && /* @__PURE__ */ jsx("div", { className: "flex shrink-0 items-center group-data-[collapsed=true]/sidebar:sr-only", children: status })
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
)
|
|
46
|
+
);
|
|
47
|
+
Header.displayName = "Sidebar.Header";
|
|
28
48
|
var Group = React.forwardRef(
|
|
29
49
|
({ className, label, children, ...props }, ref) => /* @__PURE__ */ jsxs("div", { ref, className: cn("flex flex-col gap-0.5 p-2", className), ...props, children: [
|
|
30
50
|
label && /* @__PURE__ */ jsx("p", { className: "px-2 py-1 text-xs font-semibold uppercase tracking-wider text-[var(--color-text-muted)]", children: label }),
|
|
@@ -81,7 +101,7 @@ var Footer = React.forwardRef(
|
|
|
81
101
|
)
|
|
82
102
|
);
|
|
83
103
|
Footer.displayName = "Sidebar.Footer";
|
|
84
|
-
var Sidebar = { Root, Group, Item, Separator, Footer };
|
|
104
|
+
var Sidebar = { Root, Header, Group, Item, Separator, Footer };
|
|
85
105
|
|
|
86
106
|
export {
|
|
87
107
|
Sidebar
|
|
@@ -74,8 +74,24 @@ function useTheme() {
|
|
|
74
74
|
}
|
|
75
75
|
return ctx;
|
|
76
76
|
}
|
|
77
|
+
var jsString = (s) => JSON.stringify(s).replace(/</g, "\\u003c");
|
|
78
|
+
function themeScriptSource(storageKey, productStorageKey) {
|
|
79
|
+
const product = productStorageKey ? `var b=localStorage.getItem(${jsString(productStorageKey)});if(b&&b!=='base')d.setAttribute('data-product',b);` : "";
|
|
80
|
+
return `try{var d=document.documentElement,t=localStorage.getItem(${jsString(storageKey)});if(t==='light'||t==='dark')d.setAttribute('data-theme',t);${product}}catch(e){}`;
|
|
81
|
+
}
|
|
82
|
+
function ThemeScript({ storageKey = "nexub-theme", productStorageKey, nonce }) {
|
|
83
|
+
return /* @__PURE__ */ jsx(
|
|
84
|
+
"script",
|
|
85
|
+
{
|
|
86
|
+
nonce,
|
|
87
|
+
suppressHydrationWarning: true,
|
|
88
|
+
dangerouslySetInnerHTML: { __html: themeScriptSource(storageKey, productStorageKey) }
|
|
89
|
+
}
|
|
90
|
+
);
|
|
91
|
+
}
|
|
77
92
|
|
|
78
93
|
export {
|
|
79
94
|
ThemeProvider,
|
|
80
|
-
useTheme
|
|
95
|
+
useTheme,
|
|
96
|
+
ThemeScript
|
|
81
97
|
};
|
|
@@ -49,7 +49,10 @@ var Content2 = React.forwardRef(
|
|
|
49
49
|
ref,
|
|
50
50
|
className: cn(
|
|
51
51
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-ring-default)] focus-visible:ring-offset-2 ring-offset-[var(--color-ring-offset)]",
|
|
52
|
-
className
|
|
52
|
+
className,
|
|
53
|
+
// Radix hides inactive panels with the `hidden` attribute, which any
|
|
54
|
+
// display class (`flex`, `md:grid`…) overrides. !important always wins.
|
|
55
|
+
"data-[state=inactive]:!hidden"
|
|
53
56
|
),
|
|
54
57
|
...props
|
|
55
58
|
}
|
|
@@ -7,8 +7,8 @@ import {
|
|
|
7
7
|
import * as React from "react";
|
|
8
8
|
import { NexubMark } from "@nexub/icons";
|
|
9
9
|
import { cva } from "class-variance-authority";
|
|
10
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
|
-
var logoVariants = cva("inline-flex items-center gap-2", {
|
|
10
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
11
|
+
var logoVariants = cva("inline-flex min-w-0 max-w-full items-center gap-2", {
|
|
12
12
|
variants: {
|
|
13
13
|
size: {
|
|
14
14
|
sm: "h-6",
|
|
@@ -26,9 +26,9 @@ var logoVariants = cva("inline-flex items-center gap-2", {
|
|
|
26
26
|
}
|
|
27
27
|
});
|
|
28
28
|
var iconSizeMap = {
|
|
29
|
-
sm: "h-5 w-
|
|
30
|
-
md: "h-7 w-
|
|
31
|
-
lg: "h-9 w-
|
|
29
|
+
sm: "h-5 w-auto aspect-[78/56]",
|
|
30
|
+
md: "h-7 w-auto aspect-[78/56]",
|
|
31
|
+
lg: "h-9 w-auto aspect-[78/56]"
|
|
32
32
|
};
|
|
33
33
|
var wordmarkSizeMap = {
|
|
34
34
|
sm: "text-base",
|
|
@@ -38,6 +38,8 @@ var wordmarkSizeMap = {
|
|
|
38
38
|
var Logo = React.forwardRef(
|
|
39
39
|
({
|
|
40
40
|
variant = "full",
|
|
41
|
+
mark = "color",
|
|
42
|
+
product,
|
|
41
43
|
size = "md",
|
|
42
44
|
tone = "default",
|
|
43
45
|
className,
|
|
@@ -45,31 +47,49 @@ var Logo = React.forwardRef(
|
|
|
45
47
|
}, ref) => {
|
|
46
48
|
const resolvedSize = size ?? "md";
|
|
47
49
|
const resolvedTone = tone ?? "default";
|
|
50
|
+
const full = variant === "full";
|
|
48
51
|
return /* @__PURE__ */ jsxs(
|
|
49
52
|
"span",
|
|
50
53
|
{
|
|
51
54
|
ref,
|
|
55
|
+
role: "img",
|
|
56
|
+
"aria-label": product ? `Nexub ${product}` : "Nexub",
|
|
52
57
|
className: cn(logoVariants({ size: resolvedSize, tone: resolvedTone }), className),
|
|
53
|
-
"aria-label": "Nexub",
|
|
54
58
|
...rest,
|
|
55
59
|
children: [
|
|
56
60
|
/* @__PURE__ */ jsx(
|
|
57
61
|
NexubMark,
|
|
58
62
|
{
|
|
63
|
+
variant: mark,
|
|
59
64
|
className: cn(iconSizeMap[resolvedSize], "shrink-0"),
|
|
60
65
|
"aria-hidden": "true"
|
|
61
66
|
}
|
|
62
67
|
),
|
|
63
|
-
|
|
68
|
+
full && /* @__PURE__ */ jsx(
|
|
64
69
|
"span",
|
|
65
70
|
{
|
|
66
71
|
className: cn(
|
|
67
72
|
wordmarkSizeMap[resolvedSize],
|
|
68
|
-
"font-semibold tracking-tight leading-none"
|
|
73
|
+
"shrink-0 font-semibold tracking-tight leading-none"
|
|
69
74
|
),
|
|
70
75
|
children: "nexub"
|
|
71
76
|
}
|
|
72
|
-
)
|
|
77
|
+
),
|
|
78
|
+
full && product && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
79
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "h-1/2 w-px shrink-0 bg-current opacity-25" }),
|
|
80
|
+
/* @__PURE__ */ jsx(
|
|
81
|
+
"span",
|
|
82
|
+
{
|
|
83
|
+
className: cn(
|
|
84
|
+
wordmarkSizeMap[resolvedSize],
|
|
85
|
+
// leading-normal so the clip box doesn't cut descenders.
|
|
86
|
+
"min-w-0 truncate font-medium tracking-tight leading-normal",
|
|
87
|
+
resolvedTone === "inverse" ? "opacity-70" : "text-[var(--color-text-muted)]"
|
|
88
|
+
),
|
|
89
|
+
children: product
|
|
90
|
+
}
|
|
91
|
+
)
|
|
92
|
+
] })
|
|
73
93
|
]
|
|
74
94
|
}
|
|
75
95
|
);
|
|
@@ -10,7 +10,7 @@ import { Command } from "cmdk";
|
|
|
10
10
|
import { Search } from "@nexub/icons";
|
|
11
11
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
12
|
var Root2 = React.forwardRef(({ children, ...props }, ref) => /* @__PURE__ */ jsx(RadixDialog.Root, { ...props, children: /* @__PURE__ */ jsxs(RadixDialog.Portal, { children: [
|
|
13
|
-
/* @__PURE__ */ jsx(RadixDialog.Overlay, { className: "fixed inset-0 z-[var(--z-modal)] bg-
|
|
13
|
+
/* @__PURE__ */ jsx(RadixDialog.Overlay, { className: "fixed inset-0 z-[var(--z-modal)] bg-[var(--color-overlay)] backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0" }),
|
|
14
14
|
/* @__PURE__ */ jsx(
|
|
15
15
|
RadixDialog.Content,
|
|
16
16
|
{
|
|
@@ -21,7 +21,7 @@ var Overlay2 = React.forwardRef(
|
|
|
21
21
|
{
|
|
22
22
|
ref,
|
|
23
23
|
className: cn(
|
|
24
|
-
"fixed inset-0 z-[var(--z-modal)] bg-
|
|
24
|
+
"fixed inset-0 z-[var(--z-modal)] bg-[var(--color-overlay)] backdrop-blur-sm",
|
|
25
25
|
"data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
26
26
|
"data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0",
|
|
27
27
|
className
|
|
@@ -17,7 +17,7 @@ var Overlay2 = React.forwardRef(
|
|
|
17
17
|
{
|
|
18
18
|
ref,
|
|
19
19
|
className: cn(
|
|
20
|
-
"fixed inset-0 z-[var(--z-modal)] bg-
|
|
20
|
+
"fixed inset-0 z-[var(--z-modal)] bg-[var(--color-overlay)] backdrop-blur-sm",
|
|
21
21
|
"data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
22
22
|
"data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0",
|
|
23
23
|
className
|
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import * as class_variance_authority_types from 'class-variance-authority/types'
|
|
|
5
5
|
import { VariantProps } from 'class-variance-authority';
|
|
6
6
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
7
7
|
export { Root as VisuallyHidden, VisuallyHiddenProps } from '@radix-ui/react-visually-hidden';
|
|
8
|
-
import * as
|
|
8
|
+
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
9
9
|
import * as RadixAlertDialog from '@radix-ui/react-alert-dialog';
|
|
10
10
|
import * as RadixPopover from '@radix-ui/react-popover';
|
|
11
11
|
import * as RadixTooltip from '@radix-ui/react-tooltip';
|
|
@@ -13,7 +13,6 @@ import * as RadixHoverCard from '@radix-ui/react-hover-card';
|
|
|
13
13
|
import * as RadixDropdownMenu from '@radix-ui/react-dropdown-menu';
|
|
14
14
|
import * as RadixContextMenu from '@radix-ui/react-context-menu';
|
|
15
15
|
import * as RadixNav from '@radix-ui/react-navigation-menu';
|
|
16
|
-
import * as vaul from 'vaul';
|
|
17
16
|
import * as RadixSelect from '@radix-ui/react-select';
|
|
18
17
|
import * as RadixSwitch from '@radix-ui/react-switch';
|
|
19
18
|
import * as RadixCheckbox from '@radix-ui/react-checkbox';
|
|
@@ -512,7 +511,12 @@ declare const logoVariants: (props?: ({
|
|
|
512
511
|
tone?: "default" | "inverse" | null | undefined;
|
|
513
512
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
514
513
|
interface LogoProps extends React.HTMLAttributes<HTMLSpanElement>, VariantProps<typeof logoVariants> {
|
|
515
|
-
|
|
514
|
+
/** `full` = mark + wordmark; `icon` = mark only. `mark` is the old name for `icon`. */
|
|
515
|
+
variant?: 'full' | 'icon' | 'mark';
|
|
516
|
+
/** `color` (default) = the official mark in brand colours; `mono` = `currentColor`. */
|
|
517
|
+
mark?: 'color' | 'mono';
|
|
518
|
+
/** Product name shown after the wordmark, e.g. "Command Hub". Ignored for `variant="icon"`. */
|
|
519
|
+
product?: string;
|
|
516
520
|
}
|
|
517
521
|
declare const Logo: React.ForwardRefExoticComponent<LogoProps & React.RefAttributes<HTMLSpanElement>>;
|
|
518
522
|
|
|
@@ -536,19 +540,19 @@ declare const KeyboardShortcut: React.ForwardRefExoticComponent<KeyboardShortcut
|
|
|
536
540
|
|
|
537
541
|
type SurfaceValue = 'solid' | 'glass';
|
|
538
542
|
|
|
539
|
-
interface ContentProps extends
|
|
543
|
+
interface ContentProps extends DialogPrimitive.DialogContentProps {
|
|
540
544
|
size?: 'sm' | 'md' | 'lg' | 'xl' | 'full';
|
|
541
545
|
surface?: SurfaceValue;
|
|
542
546
|
}
|
|
543
547
|
declare const Dialog: {
|
|
544
|
-
Root: React.FC<
|
|
545
|
-
Trigger: React.ForwardRefExoticComponent<
|
|
546
|
-
Portal: React.FC<
|
|
547
|
-
Overlay: React.ForwardRefExoticComponent<
|
|
548
|
+
Root: React.FC<DialogPrimitive.DialogProps>;
|
|
549
|
+
Trigger: React.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
550
|
+
Portal: React.FC<DialogPrimitive.DialogPortalProps>;
|
|
551
|
+
Overlay: React.ForwardRefExoticComponent<DialogPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>>;
|
|
548
552
|
Content: React.ForwardRefExoticComponent<ContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
549
|
-
Close: React.ForwardRefExoticComponent<
|
|
550
|
-
Title: React.ForwardRefExoticComponent<
|
|
551
|
-
Description: React.ForwardRefExoticComponent<
|
|
553
|
+
Close: React.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
554
|
+
Title: React.ForwardRefExoticComponent<DialogPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>>;
|
|
555
|
+
Description: React.ForwardRefExoticComponent<DialogPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>>;
|
|
552
556
|
Header: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
553
557
|
Footer: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
554
558
|
};
|
|
@@ -641,31 +645,91 @@ declare const NavigationMenu: {
|
|
|
641
645
|
Indicator: React.ForwardRefExoticComponent<RadixNav.NavigationMenuIndicatorProps & React.RefAttributes<HTMLDivElement>>;
|
|
642
646
|
};
|
|
643
647
|
|
|
648
|
+
interface DrawerRootProps {
|
|
649
|
+
children?: React.ReactNode;
|
|
650
|
+
open?: boolean;
|
|
651
|
+
/** Opened by default, skips the initial enter animation. Still reacts to `open` changes. */
|
|
652
|
+
defaultOpen?: boolean;
|
|
653
|
+
onOpenChange?: (open: boolean) => void;
|
|
654
|
+
/** Gets triggered after the open or close animation ends. */
|
|
655
|
+
onAnimationEnd?: (open: boolean) => void;
|
|
656
|
+
onClose?: () => void;
|
|
657
|
+
/** Edge the drawer slides in from. Match it to `Content`'s `side`. @default 'bottom' */
|
|
658
|
+
direction?: 'top' | 'bottom' | 'left' | 'right';
|
|
659
|
+
/** When `false`, the page behind stays interactive and nothing is locked or trapped. @default true */
|
|
660
|
+
modal?: boolean;
|
|
661
|
+
/**
|
|
662
|
+
* How page scroll is locked while the drawer is open (modal only).
|
|
663
|
+
* - `'style'` (default): Radix's scroll lock. It injects a `<style>` tag, which a strict
|
|
664
|
+
* `style-src` CSP blocks.
|
|
665
|
+
* - `'class'`: adds the `nexub-scroll-lock` class from `@nexub/themes/base` to `<html>`.
|
|
666
|
+
* Injects nothing, so it works under `style-src 'self'`. Focus trap, Escape and
|
|
667
|
+
* outside-click dismissal are unchanged.
|
|
668
|
+
* @default 'style'
|
|
669
|
+
*/
|
|
670
|
+
scrollLock?: 'style' | 'class';
|
|
671
|
+
/** When `false`, dragging, outside clicks and Escape don't close the drawer. @default true */
|
|
672
|
+
dismissible?: boolean;
|
|
673
|
+
/** Only the `Drawer.Handle` starts a drag. @default false */
|
|
674
|
+
handleOnly?: boolean;
|
|
675
|
+
/** Fraction (0–1) of the drawer that must be dragged away to close it. @default 0.25 */
|
|
676
|
+
closeThreshold?: number;
|
|
677
|
+
/** Snap points, as fractions of the screen (e.g. `[0.4, 1]`) or px strings. */
|
|
678
|
+
snapPoints?: (number | string)[];
|
|
679
|
+
activeSnapPoint?: number | string | null;
|
|
680
|
+
setActiveSnapPoint?: (snapPoint: number | string | null) => void;
|
|
681
|
+
/** Index of the snap point from which the overlay fades. Defaults to the last one. */
|
|
682
|
+
fadeFromIndex?: number;
|
|
683
|
+
/** Don't skip snap points on fast swipes. @default false */
|
|
684
|
+
snapToSequentialPoint?: boolean;
|
|
685
|
+
/** ms during which the drawer can't be dragged after its content scrolls. @default 500 */
|
|
686
|
+
scrollLockTimeout?: number;
|
|
687
|
+
onDrag?: (event: React.PointerEvent<HTMLDivElement>, percentageDragged: number) => void;
|
|
688
|
+
onRelease?: (event: React.PointerEvent<HTMLDivElement>, open: boolean) => void;
|
|
689
|
+
shouldScaleBackground?: boolean;
|
|
690
|
+
/** @default true */
|
|
691
|
+
setBackgroundColorOnScale?: boolean;
|
|
692
|
+
/** When `true`, vaul sets no styles on `body`. */
|
|
693
|
+
noBodyStyles?: boolean;
|
|
694
|
+
/** Only resize (don't move) the drawer when the on-screen keyboard opens. */
|
|
695
|
+
fixed?: boolean;
|
|
696
|
+
nested?: boolean;
|
|
697
|
+
disablePreventScroll?: boolean;
|
|
698
|
+
preventScrollRestoration?: boolean;
|
|
699
|
+
/** Reposition inputs instead of scrolling them into view when the keyboard opens. */
|
|
700
|
+
repositionInputs?: boolean;
|
|
701
|
+
container?: HTMLElement | null;
|
|
702
|
+
autoFocus?: boolean;
|
|
703
|
+
}
|
|
704
|
+
declare function Root({ scrollLock, onOpenChange, ...props }: DrawerRootProps): react_jsx_runtime.JSX.Element;
|
|
705
|
+
declare namespace Root {
|
|
706
|
+
var displayName: string;
|
|
707
|
+
}
|
|
644
708
|
declare const Drawer: {
|
|
645
|
-
Root: typeof
|
|
646
|
-
Trigger: React.ForwardRefExoticComponent<
|
|
647
|
-
Portal:
|
|
648
|
-
Overlay: React.ForwardRefExoticComponent<
|
|
649
|
-
Content: React.ForwardRefExoticComponent<
|
|
709
|
+
Root: typeof Root;
|
|
710
|
+
Trigger: React.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
711
|
+
Portal: (props: DialogPrimitive.DialogPortalProps) => React.JSX.Element;
|
|
712
|
+
Overlay: React.ForwardRefExoticComponent<DialogPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>>;
|
|
713
|
+
Content: React.ForwardRefExoticComponent<DialogPrimitive.DialogContentProps & {
|
|
650
714
|
side?: "left" | "right" | "top" | "bottom";
|
|
651
715
|
surface?: SurfaceValue;
|
|
652
|
-
}
|
|
653
|
-
Close: React.ForwardRefExoticComponent<
|
|
716
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
717
|
+
Close: React.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
654
718
|
Title: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLHeadingElement> & React.RefAttributes<HTMLHeadingElement>>;
|
|
655
719
|
Description: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
656
720
|
Header: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
657
721
|
Footer: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
658
722
|
};
|
|
659
723
|
declare const Sheet: {
|
|
660
|
-
Root: typeof
|
|
661
|
-
Trigger: React.ForwardRefExoticComponent<
|
|
662
|
-
Portal:
|
|
663
|
-
Overlay: React.ForwardRefExoticComponent<
|
|
664
|
-
Content: React.ForwardRefExoticComponent<
|
|
724
|
+
Root: typeof Root;
|
|
725
|
+
Trigger: React.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
726
|
+
Portal: (props: DialogPrimitive.DialogPortalProps) => React.JSX.Element;
|
|
727
|
+
Overlay: React.ForwardRefExoticComponent<DialogPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>>;
|
|
728
|
+
Content: React.ForwardRefExoticComponent<DialogPrimitive.DialogContentProps & {
|
|
665
729
|
side?: "left" | "right" | "top" | "bottom";
|
|
666
730
|
surface?: SurfaceValue;
|
|
667
|
-
}
|
|
668
|
-
Close: React.ForwardRefExoticComponent<
|
|
731
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
732
|
+
Close: React.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
669
733
|
Title: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLHeadingElement> & React.RefAttributes<HTMLHeadingElement>>;
|
|
670
734
|
Description: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
671
735
|
Header: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -922,6 +986,10 @@ declare const TopNav: {
|
|
|
922
986
|
interface SidebarRootProps extends React.HTMLAttributes<HTMLElement> {
|
|
923
987
|
collapsed?: boolean;
|
|
924
988
|
}
|
|
989
|
+
interface SidebarHeaderProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
990
|
+
/** Trailing element next to the logo, e.g. a "Live" `<Badge>`. Moves under the logo when they don't fit. */
|
|
991
|
+
status?: React.ReactNode;
|
|
992
|
+
}
|
|
925
993
|
interface SidebarGroupProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
926
994
|
label?: string;
|
|
927
995
|
}
|
|
@@ -933,6 +1001,7 @@ interface SidebarItemProps extends React.AnchorHTMLAttributes<HTMLAnchorElement>
|
|
|
933
1001
|
}
|
|
934
1002
|
declare const Sidebar: {
|
|
935
1003
|
Root: React.ForwardRefExoticComponent<SidebarRootProps & React.RefAttributes<HTMLElement>>;
|
|
1004
|
+
Header: React.ForwardRefExoticComponent<SidebarHeaderProps & React.RefAttributes<HTMLDivElement>>;
|
|
936
1005
|
Group: React.ForwardRefExoticComponent<SidebarGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
937
1006
|
Item: React.ForwardRefExoticComponent<SidebarItemProps & React.RefAttributes<HTMLAnchorElement>>;
|
|
938
1007
|
Separator: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLHRElement> & React.RefAttributes<HTMLHRElement>>;
|
|
@@ -986,7 +1055,7 @@ interface PaginationProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
986
1055
|
declare const Pagination: React.ForwardRefExoticComponent<PaginationProps & React.RefAttributes<HTMLElement>>;
|
|
987
1056
|
|
|
988
1057
|
declare const CommandPalette: {
|
|
989
|
-
Root: React.ForwardRefExoticComponent<
|
|
1058
|
+
Root: React.ForwardRefExoticComponent<DialogPrimitive.DialogProps & {
|
|
990
1059
|
className?: string;
|
|
991
1060
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
992
1061
|
Input: React.ForwardRefExoticComponent<Omit<Omit<Pick<Pick<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "key" | keyof React.InputHTMLAttributes<HTMLInputElement>> & {
|
|
@@ -1152,6 +1221,19 @@ interface ThemeProviderProps {
|
|
|
1152
1221
|
}
|
|
1153
1222
|
declare function ThemeProvider({ children, defaultTheme, storageKey, }: ThemeProviderProps): react_jsx_runtime.JSX.Element;
|
|
1154
1223
|
declare function useTheme(): ThemeContextValue;
|
|
1224
|
+
interface ThemeScriptProps {
|
|
1225
|
+
/** Must match ThemeProvider's `storageKey`. Defaults to 'nexub-theme'. */
|
|
1226
|
+
storageKey?: string;
|
|
1227
|
+
/** If set, a stored product brand (e.g. 'bookub') is applied as `data-product`. */
|
|
1228
|
+
productStorageKey?: string;
|
|
1229
|
+
/** CSP nonce for pages whose script-src disallows inline scripts. */
|
|
1230
|
+
nonce?: string;
|
|
1231
|
+
}
|
|
1232
|
+
/**
|
|
1233
|
+
* Applies the stored theme before first paint, so there is no light/dark flash.
|
|
1234
|
+
* Render it in `<head>` (or at the top of `<body>`) on server-rendered pages.
|
|
1235
|
+
*/
|
|
1236
|
+
declare function ThemeScript({ storageKey, productStorageKey, nonce }: ThemeScriptProps): react_jsx_runtime.JSX.Element;
|
|
1155
1237
|
|
|
1156
1238
|
type MotionDuration = 'instant' | 'fast' | 'normal' | 'slow' | 'slower';
|
|
1157
1239
|
type MotionEasing = 'linear' | 'in' | 'out' | 'in-out' | 'out-expo' | 'spring';
|
|
@@ -1259,4 +1341,4 @@ interface CollapseProps extends Omit<MotionBaseProps, 'easing'>, React.HTMLAttri
|
|
|
1259
1341
|
*/
|
|
1260
1342
|
declare const Collapse: React.ForwardRefExoticComponent<CollapseProps & React.RefAttributes<HTMLDivElement>>;
|
|
1261
1343
|
|
|
1262
|
-
export { Accordion, Alert, AlertDialog, type AlertProps, AppShell, AspectRatio, type AspectRatioProps, Autocomplete, type AutocompleteOption, type AutocompleteProps, Avatar, AvatarGroup, type AvatarGroupProps, type AvatarProps, Badge, type BadgeProps, Banner, type BannerProps, Box, type BoxProps, Breadcrumb, Button, ButtonGroup, type ButtonGroupProps, type ButtonProps, Callout, type CalloutProps, Card, type CardProps, CheckList, CheckListItem, type CheckListItemProps, type CheckListProps, Checkbox, type CheckboxProps, Chip, type ChipProps, Code, type CodeProps, Collapse, type CollapseProps, Collapsible, Combobox, CommandPalette, Container, type ContainerProps, ContextMenu, CountryBadge, type CountryBadgeProps, DataTable, type DataTableProps, DatePicker, type DatePickerProps, DateRangePicker, type DateRangePickerProps, Dialog, Drawer, DropdownMenu, EmptyState, ErrorState, type ErrorStateProps, EyebrowChip, type EyebrowChipProps, Fade, type FadeProps, FileUpload, type FileUploadRootProps, FilterChip, type FilterChipProps, Flag, type FlagProps, Flex, type FlexProps, FormError, type FormErrorProps, FormField, type FormFieldContextValue, type FormFieldRootProps, GradientDivider, type GradientDividerProps, Grid, type GridProps, Heading, type HeadingProps, HelperText, type HelperTextProps, HoverCard, IconButton, type IconButtonProps, Input, type InputProps, Kbd, type KbdProps, KeyboardShortcut, type KeyboardShortcutProps, Label, type LabelProps, Link, type LinkProps, Logo, type LogoProps, Menubar, type MotionBaseProps, type MotionDuration, type MotionEasing, NavigationMenu, NumberInput, type NumberInputProps, PageHeader, type PageHeaderProps, Pagination, type PaginationProps, PasswordInput, type PasswordInputProps, Popover, Progress, type ProgressProps, RadioGroup, Rating, type RatingProps, Scale, type ScaleProps, ScrollArea, type ScrollAreaProps, SearchInput, type SearchInputProps, Section, type SectionProps, SegmentedControl, type SegmentedControlItemProps, type SegmentedControlProps, Select, Separator, type SeparatorProps, Sheet, Sidebar, type SidebarGroupProps, type SidebarItemProps, type SidebarRootProps, Skeleton, type SkeletonProps, Slide, type SlideDirection, type SlideProps, Slider, type SliderProps, Spinner, type SpinnerProps, Stack, type StackProps, StatusPill, type StatusPillProps, Switch, type SwitchProps, Table, Tabs, Tag, type TagProps, Text, TextGradient, type TextGradientProps, type TextProps, Textarea, type TextareaProps, type ThemeContextValue, type ThemeMode, ThemeProvider, type ThemeProviderProps, Toast, type ToastItem, Toaster, Toggle, ToggleGroup, type ToggleProps, type ToneValue, Toolbar, Tooltip, Provider as TooltipProvider, TopNav, type TopNavItemProps, addonVariants, alertVariants, avatarGroupVariants, avatarVariants, badgeVariants, bannerVariants, buttonVariants, calloutVariants, cardVariants, chipVariants, cn, containerVariants, headingVariants, iconButtonVariants, inputVariants, inputWrapperVariants, labelVariants, linkVariants, logoVariants, progressFillVariants, progressTrackVariants, ratingVariants, sectionVariants, separatorVariants, skeletonVariants, spinnerVariants, statusPillVariants, tagVariants, textVariants, textareaVariants, toast, toggleVariants, useControllableState, useDisclosure, useIsomorphicLayoutEffect, useMediaQuery, useMergedRefs, useTheme, useToastStore };
|
|
1344
|
+
export { Accordion, Alert, AlertDialog, type AlertProps, AppShell, AspectRatio, type AspectRatioProps, Autocomplete, type AutocompleteOption, type AutocompleteProps, Avatar, AvatarGroup, type AvatarGroupProps, type AvatarProps, Badge, type BadgeProps, Banner, type BannerProps, Box, type BoxProps, Breadcrumb, Button, ButtonGroup, type ButtonGroupProps, type ButtonProps, Callout, type CalloutProps, Card, type CardProps, CheckList, CheckListItem, type CheckListItemProps, type CheckListProps, Checkbox, type CheckboxProps, Chip, type ChipProps, Code, type CodeProps, Collapse, type CollapseProps, Collapsible, Combobox, CommandPalette, Container, type ContainerProps, ContextMenu, CountryBadge, type CountryBadgeProps, DataTable, type DataTableProps, DatePicker, type DatePickerProps, DateRangePicker, type DateRangePickerProps, Dialog, Drawer, type DrawerRootProps, DropdownMenu, EmptyState, ErrorState, type ErrorStateProps, EyebrowChip, type EyebrowChipProps, Fade, type FadeProps, FileUpload, type FileUploadRootProps, FilterChip, type FilterChipProps, Flag, type FlagProps, Flex, type FlexProps, FormError, type FormErrorProps, FormField, type FormFieldContextValue, type FormFieldRootProps, GradientDivider, type GradientDividerProps, Grid, type GridProps, Heading, type HeadingProps, HelperText, type HelperTextProps, HoverCard, IconButton, type IconButtonProps, Input, type InputProps, Kbd, type KbdProps, KeyboardShortcut, type KeyboardShortcutProps, Label, type LabelProps, Link, type LinkProps, Logo, type LogoProps, Menubar, type MotionBaseProps, type MotionDuration, type MotionEasing, NavigationMenu, NumberInput, type NumberInputProps, PageHeader, type PageHeaderProps, Pagination, type PaginationProps, PasswordInput, type PasswordInputProps, Popover, Progress, type ProgressProps, RadioGroup, Rating, type RatingProps, Scale, type ScaleProps, ScrollArea, type ScrollAreaProps, SearchInput, type SearchInputProps, Section, type SectionProps, SegmentedControl, type SegmentedControlItemProps, type SegmentedControlProps, Select, Separator, type SeparatorProps, Sheet, Sidebar, type SidebarGroupProps, type SidebarHeaderProps, type SidebarItemProps, type SidebarRootProps, Skeleton, type SkeletonProps, Slide, type SlideDirection, type SlideProps, Slider, type SliderProps, Spinner, type SpinnerProps, Stack, type StackProps, StatusPill, type StatusPillProps, Switch, type SwitchProps, Table, Tabs, Tag, type TagProps, Text, TextGradient, type TextGradientProps, type TextProps, Textarea, type TextareaProps, type ThemeContextValue, type ThemeMode, ThemeProvider, type ThemeProviderProps, ThemeScript, type ThemeScriptProps, Toast, type ToastItem, Toaster, Toggle, ToggleGroup, type ToggleProps, type ToneValue, Toolbar, Tooltip, Provider as TooltipProvider, TopNav, type TopNavItemProps, addonVariants, alertVariants, avatarGroupVariants, avatarVariants, badgeVariants, bannerVariants, buttonVariants, calloutVariants, cardVariants, chipVariants, cn, containerVariants, headingVariants, iconButtonVariants, inputVariants, inputWrapperVariants, labelVariants, linkVariants, logoVariants, progressFillVariants, progressTrackVariants, ratingVariants, sectionVariants, separatorVariants, skeletonVariants, spinnerVariants, statusPillVariants, tagVariants, textVariants, textareaVariants, toast, toggleVariants, useControllableState, useDisclosure, useIsomorphicLayoutEffect, useMediaQuery, useMergedRefs, useTheme, useToastStore };
|
package/dist/index.js
CHANGED
|
@@ -12,14 +12,14 @@ import {
|
|
|
12
12
|
import {
|
|
13
13
|
Root
|
|
14
14
|
} from "./chunk-ZXLACKEB.js";
|
|
15
|
-
import {
|
|
16
|
-
Tag,
|
|
17
|
-
tagVariants
|
|
18
|
-
} from "./chunk-IBCYG6HR.js";
|
|
19
15
|
import {
|
|
20
16
|
Text,
|
|
21
17
|
textVariants
|
|
22
18
|
} from "./chunk-UWWL5FPC.js";
|
|
19
|
+
import {
|
|
20
|
+
Tag,
|
|
21
|
+
tagVariants
|
|
22
|
+
} from "./chunk-IBCYG6HR.js";
|
|
23
23
|
import {
|
|
24
24
|
TextGradient
|
|
25
25
|
} from "./chunk-HW3I7I3R.js";
|
|
@@ -29,8 +29,9 @@ import {
|
|
|
29
29
|
} from "./chunk-W4IEXUD4.js";
|
|
30
30
|
import {
|
|
31
31
|
ThemeProvider,
|
|
32
|
+
ThemeScript,
|
|
32
33
|
useTheme
|
|
33
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-E3QPDCEV.js";
|
|
34
35
|
import {
|
|
35
36
|
Toast,
|
|
36
37
|
Toaster,
|
|
@@ -71,7 +72,7 @@ import {
|
|
|
71
72
|
} from "./chunk-ELC2NBGH.js";
|
|
72
73
|
import {
|
|
73
74
|
Tabs
|
|
74
|
-
} from "./chunk-
|
|
75
|
+
} from "./chunk-EVCTOIRS.js";
|
|
75
76
|
import {
|
|
76
77
|
Rating,
|
|
77
78
|
ratingVariants,
|
|
@@ -102,7 +103,7 @@ import {
|
|
|
102
103
|
} from "./chunk-KWWV3CM3.js";
|
|
103
104
|
import {
|
|
104
105
|
Sidebar
|
|
105
|
-
} from "./chunk-
|
|
106
|
+
} from "./chunk-CMYEVLQT.js";
|
|
106
107
|
import {
|
|
107
108
|
NavigationMenu
|
|
108
109
|
} from "./chunk-7W2YDJ5W.js";
|
|
@@ -151,7 +152,7 @@ import {
|
|
|
151
152
|
import {
|
|
152
153
|
Logo,
|
|
153
154
|
logoVariants
|
|
154
|
-
} from "./chunk-
|
|
155
|
+
} from "./chunk-MV7WMQI4.js";
|
|
155
156
|
import {
|
|
156
157
|
Menubar
|
|
157
158
|
} from "./chunk-MY6XUJ5P.js";
|
|
@@ -239,11 +240,11 @@ import {
|
|
|
239
240
|
} from "./chunk-TCTFQYLH.js";
|
|
240
241
|
import {
|
|
241
242
|
Dialog
|
|
242
|
-
} from "./chunk-
|
|
243
|
+
} from "./chunk-RIDDJUPA.js";
|
|
243
244
|
import {
|
|
244
245
|
Drawer,
|
|
245
246
|
Sheet
|
|
246
|
-
} from "./chunk-
|
|
247
|
+
} from "./chunk-6MYVXJPJ.js";
|
|
247
248
|
import {
|
|
248
249
|
Card,
|
|
249
250
|
cardVariants
|
|
@@ -269,7 +270,7 @@ import {
|
|
|
269
270
|
import "./chunk-HY3JWSG4.js";
|
|
270
271
|
import {
|
|
271
272
|
CommandPalette
|
|
272
|
-
} from "./chunk-
|
|
273
|
+
} from "./chunk-QRZV2FLW.js";
|
|
273
274
|
import {
|
|
274
275
|
AvatarGroup,
|
|
275
276
|
avatarGroupVariants
|
|
@@ -308,7 +309,7 @@ import {
|
|
|
308
309
|
} from "./chunk-24CZFBTG.js";
|
|
309
310
|
import {
|
|
310
311
|
AlertDialog
|
|
311
|
-
} from "./chunk-
|
|
312
|
+
} from "./chunk-ZLSUVZM2.js";
|
|
312
313
|
import {
|
|
313
314
|
AppShell
|
|
314
315
|
} from "./chunk-KZW37FQZ.js";
|
|
@@ -462,6 +463,7 @@ export {
|
|
|
462
463
|
TextGradient,
|
|
463
464
|
Textarea,
|
|
464
465
|
ThemeProvider,
|
|
466
|
+
ThemeScript,
|
|
465
467
|
Toast,
|
|
466
468
|
Toaster,
|
|
467
469
|
Toggle,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nexub/react",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "React component library for Nexub Design System — 90+ accessible, themeable UI components built on Radix UI primitives.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -67,13 +67,12 @@
|
|
|
67
67
|
"date-fns": "^4.1.0",
|
|
68
68
|
"react-day-picker": "^9.14.0",
|
|
69
69
|
"tailwind-merge": "^2.5.4",
|
|
70
|
-
"
|
|
71
|
-
"@nexub/icons": "1.1.0"
|
|
70
|
+
"@nexub/icons": "1.3.0"
|
|
72
71
|
},
|
|
73
72
|
"peerDependencies": {
|
|
74
73
|
"react": ">=18 <20",
|
|
75
74
|
"react-dom": ">=18 <20",
|
|
76
|
-
"@nexub/tokens": "^1.
|
|
75
|
+
"@nexub/tokens": "^1.3.0"
|
|
77
76
|
},
|
|
78
77
|
"devDependencies": {
|
|
79
78
|
"@storybook/addon-essentials": "8.6.14",
|
|
@@ -85,6 +84,7 @@
|
|
|
85
84
|
"@types/react": "^19.0.0",
|
|
86
85
|
"@types/react-dom": "^19.0.0",
|
|
87
86
|
"autoprefixer": "^10.4.20",
|
|
87
|
+
"axe-core": "^4.11.3",
|
|
88
88
|
"jsdom": "^25.0.1",
|
|
89
89
|
"postcss": "^8.4.49",
|
|
90
90
|
"react": "^19.0.0",
|
|
@@ -93,12 +93,13 @@
|
|
|
93
93
|
"tailwindcss": "^3.4.0",
|
|
94
94
|
"tsup": "^8.3.5",
|
|
95
95
|
"typescript": "^5.6.3",
|
|
96
|
+
"vaul": "1.1.2",
|
|
96
97
|
"vitest": "^2.1.8",
|
|
97
|
-
"@nexub/themes": "1.
|
|
98
|
-
"@nexub/tokens": "1.
|
|
98
|
+
"@nexub/themes": "1.3.0",
|
|
99
|
+
"@nexub/tokens": "1.3.0"
|
|
99
100
|
},
|
|
100
101
|
"scripts": {
|
|
101
|
-
"build": "tsup",
|
|
102
|
+
"build": "tsup && node scripts/check-dts.mjs",
|
|
102
103
|
"dev": "tsup --watch",
|
|
103
104
|
"clean": "rm -rf dist",
|
|
104
105
|
"typecheck": "tsc --noEmit",
|