@nadicodeai/ui 7.1.3 → 8.0.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/AGENTS.md +0 -7
- package/dist/components/agent-card.js +1 -1
- package/dist/components/agent-visual.js +1 -1
- package/dist/components/alert-dialog.js +1 -1
- package/dist/components/automation-section.js +1 -1
- package/dist/components/card-marketing.d.ts +1 -1
- package/dist/components/card-marketing.js +4 -4
- package/dist/components/card.js +3 -3
- package/dist/components/chart-area-stacked.d.ts +4 -0
- package/dist/components/chart-area-stacked.d.ts.map +1 -0
- package/dist/components/chart-area-stacked.js +24 -0
- package/dist/components/chart-axis.d.ts +38 -0
- package/dist/components/chart-axis.d.ts.map +1 -0
- package/dist/components/chart-axis.js +83 -0
- package/dist/components/chart-bar-multiple.d.ts +9 -0
- package/dist/components/chart-bar-multiple.d.ts.map +1 -0
- package/dist/components/chart-bar-multiple.js +26 -0
- package/dist/components/chart-bar-stacked.d.ts +10 -0
- package/dist/components/chart-bar-stacked.d.ts.map +1 -0
- package/dist/components/chart-bar-stacked.js +41 -0
- package/dist/components/chart-card.d.ts +75 -0
- package/dist/components/chart-card.d.ts.map +1 -0
- package/dist/components/chart-card.js +71 -0
- package/dist/components/chart-date-range-control.d.ts +4 -6
- package/dist/components/chart-date-range-control.d.ts.map +1 -1
- package/dist/components/chart-date-range-control.js +34 -32
- package/dist/components/chart-sparkline.d.ts +6 -42
- package/dist/components/chart-sparkline.d.ts.map +1 -1
- package/dist/components/chart-sparkline.js +22 -35
- package/dist/components/chart.d.ts +3 -4
- package/dist/components/chart.d.ts.map +1 -1
- package/dist/components/chart.js +7 -16
- package/dist/components/combobox.js +1 -1
- package/dist/components/command.js +2 -2
- package/dist/components/context-menu.js +1 -1
- package/dist/components/dialog.js +1 -1
- package/dist/components/drawer.js +1 -1
- package/dist/components/dropdown-menu.js +1 -1
- package/dist/components/glass-control.js +1 -1
- package/dist/components/hover-card.js +1 -1
- package/dist/components/kpi-card.d.ts +37 -0
- package/dist/components/kpi-card.d.ts.map +1 -0
- package/dist/components/kpi-card.js +20 -0
- package/dist/components/live-demo.js +1 -1
- package/dist/components/menubar.js +1 -1
- package/dist/components/model-mark.js +1 -1
- package/dist/components/navigation-menu.js +2 -2
- package/dist/components/popover.d.ts +1 -1
- package/dist/components/popover.d.ts.map +1 -1
- package/dist/components/popover.js +2 -2
- package/dist/components/progress.d.ts +18 -2
- package/dist/components/progress.d.ts.map +1 -1
- package/dist/components/progress.js +40 -10
- package/dist/components/select.js +2 -2
- package/dist/components/sheet.js +1 -1
- package/dist/components/sidebar.js +1 -1
- package/dist/components/toggle.js +1 -1
- package/dist/components/trend-badge.d.ts +22 -0
- package/dist/components/trend-badge.d.ts.map +1 -0
- package/dist/components/trend-badge.js +31 -0
- package/dist/index.d.ts +13 -14
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -14
- package/docs/component-classification.md +1 -1
- package/docs/contract.md +19 -21
- package/package.json +9 -9
- package/dist/components/chart-breakdown-table.d.ts +0 -69
- package/dist/components/chart-breakdown-table.d.ts.map +0 -1
- package/dist/components/chart-breakdown-table.js +0 -35
- package/dist/components/chart-bullet-bar.d.ts +0 -53
- package/dist/components/chart-bullet-bar.d.ts.map +0 -1
- package/dist/components/chart-bullet-bar.js +0 -63
- package/dist/components/chart-delta.d.ts +0 -30
- package/dist/components/chart-delta.d.ts.map +0 -1
- package/dist/components/chart-delta.js +0 -32
- package/dist/components/chart-kpi-stat.d.ts +0 -44
- package/dist/components/chart-kpi-stat.d.ts.map +0 -1
- package/dist/components/chart-kpi-stat.js +0 -51
- package/dist/components/chart-time-series-layout.d.ts +0 -6
- package/dist/components/chart-time-series-layout.d.ts.map +0 -1
- package/dist/components/chart-time-series-layout.js +0 -6
- package/dist/components/chart-time-series.d.ts +0 -103
- package/dist/components/chart-time-series.d.ts.map +0 -1
- package/dist/components/chart-time-series.js +0 -310
- package/dist/components/stat-block.d.ts +0 -24
- package/dist/components/stat-block.d.ts.map +0 -1
- package/dist/components/stat-block.js +0 -26
- package/dist/components/stats-band.d.ts +0 -22
- package/dist/components/stats-band.d.ts.map +0 -1
- package/dist/components/stats-band.js +0 -32
|
@@ -1,8 +1,24 @@
|
|
|
1
1
|
import { Progress as ProgressPrimitive } from "@base-ui/react/progress";
|
|
2
|
-
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
/**
|
|
4
|
+
* The measured bar. Stock shadcn `progress` plus one variant: a product-owned
|
|
5
|
+
* `tone`, because the meters this replaces (usage against an included
|
|
6
|
+
* allowance) have to say whether a full bar is fine or a problem. Tone is a
|
|
7
|
+
* consumer decision, never derived from the measurement. A value past `max`
|
|
8
|
+
* fills the track and takes the over-cap paint, which is the bar saying the
|
|
9
|
+
* allowance is spent — not a second segment.
|
|
10
|
+
*/
|
|
11
|
+
declare const progressIndicatorVariants: (props?: ({
|
|
12
|
+
tone?: "default" | "warning" | "critical" | null | undefined;
|
|
13
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
14
|
+
type ProgressTone = NonNullable<VariantProps<typeof progressIndicatorVariants>["tone"]>;
|
|
15
|
+
declare function Progress({ className, children, value, min, max, tone, ...props }: ProgressPrimitive.Root.Props & {
|
|
16
|
+
tone?: ProgressTone;
|
|
17
|
+
}): import("react").JSX.Element;
|
|
3
18
|
declare function ProgressTrack({ className, ...props }: ProgressPrimitive.Track.Props): import("react").JSX.Element;
|
|
4
19
|
declare function ProgressIndicator({ className, style, ...props }: ProgressPrimitive.Indicator.Props): import("react").JSX.Element;
|
|
5
20
|
declare function ProgressLabel({ className, ...props }: ProgressPrimitive.Label.Props): import("react").JSX.Element;
|
|
6
21
|
declare function ProgressValue({ className, ...props }: ProgressPrimitive.Value.Props): import("react").JSX.Element;
|
|
7
|
-
export { Progress, ProgressTrack, ProgressIndicator, ProgressLabel, ProgressValue };
|
|
22
|
+
export { Progress, ProgressTrack, ProgressIndicator, ProgressLabel, ProgressValue, progressIndicatorVariants, };
|
|
23
|
+
export type { ProgressTone };
|
|
8
24
|
//# sourceMappingURL=progress.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../../src/components/progress.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,IAAI,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../../src/components/progress.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,IAAI,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACxE,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAKlE;;;;;;;GAOG;AAEH,QAAA,MAAM,yBAAyB;;8EAc9B,CAAC;AAEF,KAAK,YAAY,GAAG,WAAW,CAAC,YAAY,CAAC,OAAO,yBAAyB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AAYxF,iBAAS,QAAQ,CAAC,EAChB,SAAS,EACT,QAAQ,EACR,KAAK,EACL,GAAO,EACP,GAAS,EACT,IAAgB,EAChB,GAAG,KAAK,EACT,EAAE,iBAAiB,CAAC,IAAI,CAAC,KAAK,GAAG;IAAE,IAAI,CAAC,EAAE,YAAY,CAAA;CAAE,+BAwBxD;AAED,iBAAS,aAAa,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,iBAAiB,CAAC,KAAK,CAAC,KAAK,+BAW5E;AAED,iBAAS,iBAAiB,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,iBAAiB,CAAC,SAAS,CAAC,KAAK,+BA6B3F;AAED,iBAAS,aAAa,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,iBAAiB,CAAC,KAAK,CAAC,KAAK,+BAQ5E;AAED,iBAAS,aAAa,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,iBAAiB,CAAC,KAAK,CAAC,KAAK,+BAQ5E;AAED,OAAO,EACL,QAAQ,EACR,aAAa,EACb,iBAAiB,EACjB,aAAa,EACb,aAAa,EACb,yBAAyB,GAC1B,CAAC;AACF,YAAY,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -1,29 +1,59 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { Progress as ProgressPrimitive } from "@base-ui/react/progress";
|
|
4
|
+
import { cva } from "class-variance-authority";
|
|
4
5
|
import { createContext, useContext } from "react";
|
|
5
6
|
import { cn } from "../lib/utils.js";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
/**
|
|
8
|
+
* The measured bar. Stock shadcn `progress` plus one variant: a product-owned
|
|
9
|
+
* `tone`, because the meters this replaces (usage against an included
|
|
10
|
+
* allowance) have to say whether a full bar is fine or a problem. Tone is a
|
|
11
|
+
* consumer decision, never derived from the measurement. A value past `max`
|
|
12
|
+
* fills the track and takes the over-cap paint, which is the bar saying the
|
|
13
|
+
* allowance is spent — not a second segment.
|
|
14
|
+
*/
|
|
15
|
+
const progressIndicatorVariants = cva("h-full origin-left scale-x-[var(--progress-scale)] transition-transform duration-[var(--nc-duration-open)] ease-[var(--nc-ease-out-strong)] motion-reduce:transition-none rtl:origin-right", {
|
|
16
|
+
variants: {
|
|
17
|
+
tone: {
|
|
18
|
+
default: "bg-primary",
|
|
19
|
+
warning: "bg-(--nc-state-review)",
|
|
20
|
+
critical: "bg-(--nc-state-blocked)",
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
defaultVariants: {
|
|
24
|
+
tone: "default",
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
const OVER_CAP_CLASS = "bg-(--nc-error-deep)";
|
|
28
|
+
const ProgressStateContext = createContext({
|
|
29
|
+
scale: 0,
|
|
30
|
+
tone: "default",
|
|
31
|
+
overCap: false,
|
|
32
|
+
});
|
|
33
|
+
function Progress({ className, children, value, min = 0, max = 100, tone = "default", ...props }) {
|
|
34
|
+
const measured = typeof value === "number" && Number.isFinite(value);
|
|
35
|
+
const scale = measured && max > min ? Math.min(1, Math.max(0, (value - min) / (max - min))) : 0;
|
|
36
|
+
const overCap = measured && value > max;
|
|
37
|
+
return (_jsx(ProgressPrimitive.Root, { value: value, min: min, max: max, "data-slot": "progress", "data-tone": tone, "data-over-cap": overCap || undefined, className: cn("flex flex-wrap gap-3", className), ...props, children: _jsxs(ProgressStateContext.Provider, { value: { scale, tone, overCap }, children: [children, _jsx(ProgressTrack, { children: _jsx(ProgressIndicator, {}) })] }) }));
|
|
12
38
|
}
|
|
13
39
|
function ProgressTrack({ className, ...props }) {
|
|
14
40
|
return (_jsx(ProgressPrimitive.Track, { className: cn("relative flex h-1 w-full items-center overflow-x-hidden rounded-full bg-muted", className), "data-slot": "progress-track", ...props }));
|
|
15
41
|
}
|
|
16
42
|
function ProgressIndicator({ className, style, ...props }) {
|
|
17
|
-
const
|
|
43
|
+
const { scale, tone, overCap } = useContext(ProgressStateContext);
|
|
18
44
|
const indicatorStyle = (state) => {
|
|
19
45
|
const resolvedStyle = typeof style === "function" ? style(state) : style;
|
|
20
46
|
return {
|
|
21
47
|
width: "100%",
|
|
22
|
-
"--progress-scale":
|
|
48
|
+
"--progress-scale": scale,
|
|
23
49
|
...resolvedStyle,
|
|
24
50
|
};
|
|
25
51
|
};
|
|
26
|
-
return (_jsx(ProgressPrimitive.Indicator, { "data-slot": "progress-indicator",
|
|
52
|
+
return (_jsx(ProgressPrimitive.Indicator, { "data-slot": "progress-indicator", "data-over-cap": overCap || undefined, className: cn(progressIndicatorVariants({ tone }),
|
|
53
|
+
// After the variant, so the merge keeps this one paint: an allowance
|
|
54
|
+
// spent reads the same whatever tone the product chose for approaching
|
|
55
|
+
// it.
|
|
56
|
+
overCap && OVER_CAP_CLASS, className), style: indicatorStyle, ...props }));
|
|
27
57
|
}
|
|
28
58
|
function ProgressLabel({ className, ...props }) {
|
|
29
59
|
return (_jsx(ProgressPrimitive.Label, { className: cn("text-sm font-medium", className), "data-slot": "progress-label", ...props }));
|
|
@@ -31,4 +61,4 @@ function ProgressLabel({ className, ...props }) {
|
|
|
31
61
|
function ProgressValue({ className, ...props }) {
|
|
32
62
|
return (_jsx(ProgressPrimitive.Value, { className: cn("ml-auto text-sm text-muted-foreground tabular-nums", className), "data-slot": "progress-value", ...props }));
|
|
33
63
|
}
|
|
34
|
-
export { Progress, ProgressTrack, ProgressIndicator, ProgressLabel, ProgressValue };
|
|
64
|
+
export { Progress, ProgressTrack, ProgressIndicator, ProgressLabel, ProgressValue, progressIndicatorVariants, };
|
|
@@ -15,13 +15,13 @@ function SelectTrigger({ className, size = "default", children, ...props }) {
|
|
|
15
15
|
return (_jsxs(SelectPrimitive.Trigger, { "data-slot": "select-trigger", "data-size": size, className: cn("flex h-control-height min-h-touch-target w-fit items-center justify-between gap-1.5 rounded-md border border-input bg-background py-2 pr-2 pl-control-padding-inline text-sm whitespace-nowrap transition-colors select-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive data-placeholder:text-placeholder data-[size=sm]:h-7 [@media(hover:hover)_and_(pointer:fine)]:min-h-0 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className), ...props, children: [children, _jsx(SelectPrimitive.Icon, { render: _jsx(ChevronDownIcon, { className: "pointer-events-none size-4 text-muted-foreground" }) })] }));
|
|
16
16
|
}
|
|
17
17
|
function SelectContent({ className, children, side = "bottom", sideOffset = 4, align = "center", alignOffset = 0, alignItemWithTrigger = true, ...props }) {
|
|
18
|
-
return (_jsx(SelectPrimitive.Portal, { children: _jsx(SelectPrimitive.Positioner, { side: side, sideOffset: sideOffset, align: align, alignOffset: alignOffset, alignItemWithTrigger: alignItemWithTrigger, className: "isolate z-50", children: _jsxs(SelectPrimitive.Popup, { "data-slot": "select-content", "data-align-trigger": alignItemWithTrigger, className: cn("relative isolate z-50 max-h-(--available-height) w-(--
|
|
18
|
+
return (_jsx(SelectPrimitive.Portal, { children: _jsx(SelectPrimitive.Positioner, { side: side, sideOffset: sideOffset, align: align, alignOffset: alignOffset, alignItemWithTrigger: alignItemWithTrigger, className: "isolate z-50", children: _jsxs(SelectPrimitive.Popup, { "data-slot": "select-content", "data-align-trigger": alignItemWithTrigger, className: cn("relative isolate z-50 max-h-(--available-height) w-auto max-w-(--available-width) min-w-(--anchor-width) overflow-x-hidden overflow-y-auto rounded-md border-0 nc-glass text-popover-foreground nc-elevation-floating data-[align-trigger=true]:transition-none", anchoredOverlayMotion, className), ...props, children: [_jsx(SelectScrollUpButton, {}), _jsx(SelectPrimitive.List, { children: children }), _jsx(SelectScrollDownButton, {})] }) }) }));
|
|
19
19
|
}
|
|
20
20
|
function SelectLabel({ className, ...props }) {
|
|
21
21
|
return (_jsx(SelectPrimitive.GroupLabel, { "data-slot": "select-label", className: cn("px-1.5 py-1 text-xs text-muted-foreground", className), ...props }));
|
|
22
22
|
}
|
|
23
23
|
function SelectItem({ className, children, ...props }) {
|
|
24
|
-
return (_jsxs(SelectPrimitive.Item, { "data-slot": "select-item", className: cn("relative flex min-h-touch-target w-full cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [@media(hover:hover)_and_(pointer:fine)]:min-h-0 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2", className), ...props, children: [_jsx(SelectPrimitive.ItemText, { className: "flex flex-1 shrink-0 gap-2 whitespace-nowrap", children: children }), _jsx(SelectPrimitive.ItemIndicator, { render: _jsx("span", { className: "pointer-events-none absolute right-2 flex size-4 items-center justify-center" }), children: _jsx(CheckIcon, { className: "pointer-events-none" }) })] }));
|
|
24
|
+
return (_jsxs(SelectPrimitive.Item, { "data-slot": "select-item", className: cn("relative flex min-h-touch-target w-full cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm whitespace-nowrap outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [@media(hover:hover)_and_(pointer:fine)]:min-h-0 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2", className), ...props, children: [_jsx(SelectPrimitive.ItemText, { className: "flex flex-1 shrink-0 gap-2 whitespace-nowrap", children: children }), _jsx(SelectPrimitive.ItemIndicator, { render: _jsx("span", { className: "pointer-events-none absolute right-2 flex size-4 items-center justify-center" }), children: _jsx(CheckIcon, { className: "pointer-events-none" }) })] }));
|
|
25
25
|
}
|
|
26
26
|
function SelectSeparator({ className, ...props }) {
|
|
27
27
|
return (_jsx(SelectPrimitive.Separator, { "data-slot": "select-separator", className: cn("pointer-events-none -mx-1 my-1 h-px bg-border", className), ...props }));
|
package/dist/components/sheet.js
CHANGED
|
@@ -21,7 +21,7 @@ function SheetOverlay({ className, ...props }) {
|
|
|
21
21
|
return (_jsx(SheetPrimitive.Backdrop, { "data-slot": "sheet-overlay", className: cn("fixed inset-0 z-50 bg-scrim/scrim", overlayBackdropMotion, className), ...props }));
|
|
22
22
|
}
|
|
23
23
|
function SheetContent({ className, children, side = "right", showCloseButton = true, closeLabel = "Close", ...props }) {
|
|
24
|
-
return (_jsxs(SheetPortal, { children: [_jsx(SheetOverlay, {}), _jsxs(SheetPrimitive.Popup, { "data-slot": "sheet-content", "data-side": side, className: cn("fixed z-50 flex max-h-[calc(100%-var(--nc-lg))] flex-col gap-nadicode-md rounded-
|
|
24
|
+
return (_jsxs(SheetPortal, { children: [_jsx(SheetOverlay, {}), _jsxs(SheetPrimitive.Popup, { "data-slot": "sheet-content", "data-side": side, className: cn("fixed z-50 flex max-h-[calc(100%-var(--nc-lg))] flex-col gap-nadicode-md rounded-md border-0 bg-popover bg-clip-padding text-sm text-popover-foreground nc-elevation-modal transition-[opacity,translate] duration-[var(--nc-duration-close)] ease-[var(--nc-ease-out-strong)] data-open:duration-[var(--nc-duration-open)] data-ending-style:opacity-0 data-starting-style:opacity-0 motion-reduce:transition-none motion-reduce:data-ending-style:opacity-100 motion-reduce:data-starting-style:opacity-100 data-[side=bottom]:inset-x-nadicode-sm data-[side=bottom]:bottom-nadicode-sm data-[side=bottom]:h-auto data-[side=bottom]:data-ending-style:translate-y-nadicode-md data-[side=bottom]:data-starting-style:translate-y-nadicode-md motion-reduce:data-[side=bottom]:data-ending-style:translate-none motion-reduce:data-[side=bottom]:data-starting-style:translate-none data-[side=left]:inset-y-nadicode-sm data-[side=left]:left-nadicode-sm data-[side=left]:w-3/4 data-[side=left]:data-ending-style:-translate-x-nadicode-md data-[side=left]:data-starting-style:-translate-x-nadicode-md motion-reduce:data-[side=left]:data-ending-style:translate-none motion-reduce:data-[side=left]:data-starting-style:translate-none data-[side=right]:inset-y-nadicode-sm data-[side=right]:right-nadicode-sm data-[side=right]:w-3/4 data-[side=right]:data-ending-style:translate-x-nadicode-md data-[side=right]:data-starting-style:translate-x-nadicode-md motion-reduce:data-[side=right]:data-ending-style:translate-none motion-reduce:data-[side=right]:data-starting-style:translate-none data-[side=top]:inset-x-nadicode-sm data-[side=top]:top-nadicode-sm data-[side=top]:h-auto data-[side=top]:data-ending-style:-translate-y-nadicode-md data-[side=top]:data-starting-style:-translate-y-nadicode-md motion-reduce:data-[side=top]:data-ending-style:translate-none motion-reduce:data-[side=top]:data-starting-style:translate-none data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm", className), ...props, children: [children, showCloseButton && (_jsxs(SheetPrimitive.Close, { "data-slot": "sheet-close", render: _jsx(Button, { variant: "ghost", className: "absolute top-nadicode-md right-nadicode-md", size: "icon-sm" }), children: [_jsx(XIcon, {}), _jsx("span", { className: "sr-only", children: closeLabel })] }))] })] }));
|
|
25
25
|
}
|
|
26
26
|
function SheetHeader({ className, ...props }) {
|
|
27
27
|
return (_jsx("div", { "data-slot": "sheet-header", className: cn("flex flex-col gap-0.5 p-nadicode-lg", className), ...props }));
|
|
@@ -94,7 +94,7 @@ function Sidebar({ side = "left", variant = "sidebar", collapsible = "offcanvas"
|
|
|
94
94
|
// Adjust the padding for floating and inset variants.
|
|
95
95
|
variant === "floating" || variant === "inset"
|
|
96
96
|
? "p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+var(--nc-rounded-xs))]"
|
|
97
|
-
: "group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l", className), ...props, children: _jsx("div", { "data-sidebar": "sidebar", "data-slot": "sidebar-inner", className: "flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-
|
|
97
|
+
: "group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l", className), ...props, children: _jsx("div", { "data-sidebar": "sidebar", "data-slot": "sidebar-inner", className: "flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-md group-data-[variant=floating]:border-0 group-data-[variant=floating]:bg-popover group-data-[variant=floating]:nc-elevation-floating", children: children }) })] }));
|
|
98
98
|
}
|
|
99
99
|
function SidebarTrigger({ className, onClick, ...props }) {
|
|
100
100
|
const { toggleSidebar } = useSidebar();
|
|
@@ -3,7 +3,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import { Toggle as TogglePrimitive } from "@base-ui/react/toggle";
|
|
4
4
|
import { cva } from "class-variance-authority";
|
|
5
5
|
import { cn } from "../lib/utils.js";
|
|
6
|
-
const toggleVariants = cva("group/toggle inline-flex min-h-touch-target min-w-touch-target items-center justify-center gap-1 rounded-md border border-transparent text-sm font-medium whitespace-nowrap transition-[background-color,border-color,color,opacity] duration-[var(--nc-duration-confirm)] ease-[var(--nc-ease-out-strong)] motion-reduce:transition-none hover:bg-muted hover:text-foreground disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-pressed:bg-
|
|
6
|
+
const toggleVariants = cva("group/toggle inline-flex min-h-touch-target min-w-touch-target items-center justify-center gap-1 rounded-md border border-transparent text-sm font-medium whitespace-nowrap transition-[background-color,border-color,color,opacity] duration-[var(--nc-duration-confirm)] ease-[var(--nc-ease-out-strong)] motion-reduce:transition-none hover:bg-muted hover:text-foreground disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-pressed:bg-accent aria-pressed:font-semibold aria-pressed:text-accent-foreground data-pressed:bg-accent data-pressed:font-semibold data-pressed:text-accent-foreground [@media(hover:hover)_and_(pointer:fine)]:min-h-0 [@media(hover:hover)_and_(pointer:fine)]:min-w-0 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", {
|
|
7
7
|
variants: {
|
|
8
8
|
variant: {
|
|
9
9
|
default: "bg-transparent",
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type * as React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* trend-badge — a change as the dashboard-01 section card shows it: shadcn's
|
|
4
|
+
* outline `Badge` holding a lucide trend icon and the formatted change. `KpiCard`
|
|
5
|
+
* puts it top right; a Trending list row and a chart footer use the same one, so
|
|
6
|
+
* the reading exists once.
|
|
7
|
+
*/
|
|
8
|
+
type TrendDirection = "up" | "down" | "flat";
|
|
9
|
+
type TrendTone = "positive" | "negative" | "neutral";
|
|
10
|
+
/** Direction crossed with whether up is good here. A flat or neutral change takes no tone. */
|
|
11
|
+
declare function trendTone(direction: TrendDirection, upIsGood?: boolean, neutral?: boolean): TrendTone;
|
|
12
|
+
declare function TrendBadge({ value, direction, tone, directionLabel, }: {
|
|
13
|
+
/** The formatted change, e.g. "+12.5%". */
|
|
14
|
+
value: React.ReactNode;
|
|
15
|
+
direction: TrendDirection;
|
|
16
|
+
tone: TrendTone;
|
|
17
|
+
/** The direction in the reader's language, because an arrow alone is not a reading. */
|
|
18
|
+
directionLabel?: string;
|
|
19
|
+
}): React.JSX.Element;
|
|
20
|
+
export { TrendBadge, trendTone };
|
|
21
|
+
export type { TrendDirection, TrendTone };
|
|
22
|
+
//# sourceMappingURL=trend-badge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trend-badge.d.ts","sourceRoot":"","sources":["../../src/components/trend-badge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAMpC;;;;;GAKG;AAEH,KAAK,cAAc,GAAG,IAAI,GAAG,MAAM,GAAG,MAAM,CAAC;AAC7C,KAAK,SAAS,GAAG,UAAU,GAAG,UAAU,GAAG,SAAS,CAAC;AAqBrD,8FAA8F;AAC9F,iBAAS,SAAS,CAAC,SAAS,EAAE,cAAc,EAAE,QAAQ,UAAO,EAAE,OAAO,UAAQ,GAAG,SAAS,CAGzF;AAED,iBAAS,UAAU,CAAC,EAClB,KAAK,EACL,SAAS,EACT,IAAI,EACJ,cAAc,GACf,EAAE;IACD,2CAA2C;IAC3C,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,SAAS,EAAE,cAAc,CAAC;IAC1B,IAAI,EAAE,SAAS,CAAC;IAChB,uFAAuF;IACvF,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,qBAeA;AAED,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC;AACjC,YAAY,EAAE,cAAc,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { MinusIcon, TrendingDownIcon, TrendingUpIcon } from "lucide-react";
|
|
3
|
+
import { cn } from "../lib/utils.js";
|
|
4
|
+
import { Badge } from "./badge.js";
|
|
5
|
+
const TREND_ICONS = {
|
|
6
|
+
up: TrendingUpIcon,
|
|
7
|
+
down: TrendingDownIcon,
|
|
8
|
+
flat: MinusIcon,
|
|
9
|
+
};
|
|
10
|
+
/** The fallback reading for a caller with no dictionary; a localized caller passes `directionLabel`. */
|
|
11
|
+
const TREND_DIRECTION_TEXT = {
|
|
12
|
+
up: "up",
|
|
13
|
+
down: "down",
|
|
14
|
+
flat: "unchanged",
|
|
15
|
+
};
|
|
16
|
+
const TREND_TONE_CLASS = {
|
|
17
|
+
positive: "text-(--nc-state-complete)",
|
|
18
|
+
negative: "text-(--nc-state-blocked)",
|
|
19
|
+
neutral: "text-muted-foreground",
|
|
20
|
+
};
|
|
21
|
+
/** Direction crossed with whether up is good here. A flat or neutral change takes no tone. */
|
|
22
|
+
function trendTone(direction, upIsGood = true, neutral = false) {
|
|
23
|
+
if (neutral || direction === "flat")
|
|
24
|
+
return "neutral";
|
|
25
|
+
return (direction === "up") === upIsGood ? "positive" : "negative";
|
|
26
|
+
}
|
|
27
|
+
function TrendBadge({ value, direction, tone, directionLabel, }) {
|
|
28
|
+
const Icon = TREND_ICONS[direction];
|
|
29
|
+
return (_jsxs(Badge, { "data-slot": "trend-badge", "data-direction": direction, "data-tone": tone, variant: "outline", className: cn("tabular-nums", TREND_TONE_CLASS[tone]), children: [_jsx(Icon, { "aria-hidden": "true" }), _jsx("span", { className: "sr-only", children: directionLabel ?? TREND_DIRECTION_TEXT[direction] }), value] }));
|
|
30
|
+
}
|
|
31
|
+
export { TrendBadge, trendTone };
|
package/dist/index.d.ts
CHANGED
|
@@ -3,10 +3,10 @@ export * from "./components/action-band.js";
|
|
|
3
3
|
export * from "./components/action-menu.js";
|
|
4
4
|
export * from "./components/action-status.js";
|
|
5
5
|
export * from "./components/activity-orb.js";
|
|
6
|
-
export * from "./components/alert.js";
|
|
7
|
-
export * from "./components/alert-dialog.js";
|
|
8
6
|
export * from "./components/agent-card.js";
|
|
9
7
|
export * from "./components/agent-visual.js";
|
|
8
|
+
export * from "./components/alert.js";
|
|
9
|
+
export * from "./components/alert-dialog.js";
|
|
10
10
|
export * from "./components/aspect-ratio.js";
|
|
11
11
|
export * from "./components/automation-section.js";
|
|
12
12
|
export * from "./components/avatar.js";
|
|
@@ -21,23 +21,24 @@ export * from "./components/button.js";
|
|
|
21
21
|
export * from "./components/button-group.js";
|
|
22
22
|
export * from "./components/calendar.js";
|
|
23
23
|
export * from "./components/card.js";
|
|
24
|
-
export * from "./components/collection-scope.js";
|
|
25
24
|
export * from "./components/card-marketing.js";
|
|
26
25
|
export * from "./components/card-row.js";
|
|
27
26
|
export * from "./components/carousel.js";
|
|
28
27
|
export * from "./components/chart.js";
|
|
29
|
-
export * from "./components/chart-
|
|
30
|
-
export * from "./components/chart-
|
|
28
|
+
export * from "./components/chart-area-stacked.js";
|
|
29
|
+
export * from "./components/chart-bar-multiple.js";
|
|
30
|
+
export * from "./components/chart-bar-stacked.js";
|
|
31
|
+
export * from "./components/chart-card.js";
|
|
31
32
|
export * from "./components/chart-date-range.js";
|
|
32
33
|
export * from "./components/chart-date-range-control.js";
|
|
33
|
-
export * from "./components/chart-delta.js";
|
|
34
34
|
export * from "./components/chart-entity-colors.js";
|
|
35
|
-
export * from "./components/chart-kpi-stat.js";
|
|
36
35
|
export * from "./components/chart-sparkline.js";
|
|
37
|
-
export * from "./components/chart-time-series.js";
|
|
38
36
|
export * from "./components/checkbox.js";
|
|
39
37
|
export * from "./components/code-editor-mockup.js";
|
|
40
38
|
export * from "./components/collapsible.js";
|
|
39
|
+
export * from "./components/collection-filters.js";
|
|
40
|
+
export * from "./components/collection-scope.js";
|
|
41
|
+
export * from "./components/collection-toolbar.js";
|
|
41
42
|
export * from "./components/combobox.js";
|
|
42
43
|
export * from "./components/command.js";
|
|
43
44
|
export * from "./components/confirm-dialog.js";
|
|
@@ -64,8 +65,8 @@ export * from "./components/file-type-icon.js";
|
|
|
64
65
|
export * from "./components/footer.js";
|
|
65
66
|
export * from "./components/form.js";
|
|
66
67
|
export * from "./components/forma-avatar.js";
|
|
67
|
-
export * from "./components/glyph-spinner.js";
|
|
68
68
|
export * from "./components/glass-control.js";
|
|
69
|
+
export * from "./components/glyph-spinner.js";
|
|
69
70
|
export * from "./components/handoff-banner.js";
|
|
70
71
|
export * from "./components/hero.js";
|
|
71
72
|
export * from "./components/hero-split.js";
|
|
@@ -77,6 +78,7 @@ export * from "./components/installer-shell.js";
|
|
|
77
78
|
export * from "./components/integration-flow.js";
|
|
78
79
|
export * from "./components/item.js";
|
|
79
80
|
export * from "./components/kbd.js";
|
|
81
|
+
export * from "./components/kpi-card.js";
|
|
80
82
|
export * from "./components/label.js";
|
|
81
83
|
export * from "./components/label-system.js";
|
|
82
84
|
export * from "./components/live-demo.js";
|
|
@@ -111,10 +113,8 @@ export * from "./components/section-intro.js";
|
|
|
111
113
|
export * from "./components/security-grid.js";
|
|
112
114
|
export * from "./components/select.js";
|
|
113
115
|
export * from "./components/separator.js";
|
|
114
|
-
export * from "./components/settings-section.js";
|
|
115
116
|
export * from "./components/settings-facts.js";
|
|
116
|
-
export * from "./components/
|
|
117
|
-
export * from "./components/collection-filters.js";
|
|
117
|
+
export * from "./components/settings-section.js";
|
|
118
118
|
export * from "./components/sheet.js";
|
|
119
119
|
export * from "./components/shift-band.js";
|
|
120
120
|
export * from "./components/sidebar.js";
|
|
@@ -122,9 +122,7 @@ export * from "./components/skeleton.js";
|
|
|
122
122
|
export * from "./components/slider.js";
|
|
123
123
|
export * from "./components/sonner.js";
|
|
124
124
|
export * from "./components/spinner.js";
|
|
125
|
-
export * from "./components/stat-block.js";
|
|
126
125
|
export * from "./components/statement.js";
|
|
127
|
-
export * from "./components/stats-band.js";
|
|
128
126
|
export * from "./components/status-dot.js";
|
|
129
127
|
export * from "./components/status-row.js";
|
|
130
128
|
export * from "./components/steps.js";
|
|
@@ -140,6 +138,7 @@ export * from "./components/toggle.js";
|
|
|
140
138
|
export * from "./components/toggle-group.js";
|
|
141
139
|
export * from "./components/tool-icon.js";
|
|
142
140
|
export * from "./components/tooltip.js";
|
|
141
|
+
export * from "./components/trend-badge.js";
|
|
143
142
|
export * from "./components/usage-meter.js";
|
|
144
143
|
export * from "./components/use-case-bento.js";
|
|
145
144
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"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"}
|
package/dist/index.js
CHANGED
|
@@ -3,10 +3,10 @@ export * from "./components/action-band.js";
|
|
|
3
3
|
export * from "./components/action-menu.js";
|
|
4
4
|
export * from "./components/action-status.js";
|
|
5
5
|
export * from "./components/activity-orb.js";
|
|
6
|
-
export * from "./components/alert.js";
|
|
7
|
-
export * from "./components/alert-dialog.js";
|
|
8
6
|
export * from "./components/agent-card.js";
|
|
9
7
|
export * from "./components/agent-visual.js";
|
|
8
|
+
export * from "./components/alert.js";
|
|
9
|
+
export * from "./components/alert-dialog.js";
|
|
10
10
|
export * from "./components/aspect-ratio.js";
|
|
11
11
|
export * from "./components/automation-section.js";
|
|
12
12
|
export * from "./components/avatar.js";
|
|
@@ -21,23 +21,24 @@ export * from "./components/button.js";
|
|
|
21
21
|
export * from "./components/button-group.js";
|
|
22
22
|
export * from "./components/calendar.js";
|
|
23
23
|
export * from "./components/card.js";
|
|
24
|
-
export * from "./components/collection-scope.js";
|
|
25
24
|
export * from "./components/card-marketing.js";
|
|
26
25
|
export * from "./components/card-row.js";
|
|
27
26
|
export * from "./components/carousel.js";
|
|
28
27
|
export * from "./components/chart.js";
|
|
29
|
-
export * from "./components/chart-
|
|
30
|
-
export * from "./components/chart-
|
|
28
|
+
export * from "./components/chart-area-stacked.js";
|
|
29
|
+
export * from "./components/chart-bar-multiple.js";
|
|
30
|
+
export * from "./components/chart-bar-stacked.js";
|
|
31
|
+
export * from "./components/chart-card.js";
|
|
31
32
|
export * from "./components/chart-date-range.js";
|
|
32
33
|
export * from "./components/chart-date-range-control.js";
|
|
33
|
-
export * from "./components/chart-delta.js";
|
|
34
34
|
export * from "./components/chart-entity-colors.js";
|
|
35
|
-
export * from "./components/chart-kpi-stat.js";
|
|
36
35
|
export * from "./components/chart-sparkline.js";
|
|
37
|
-
export * from "./components/chart-time-series.js";
|
|
38
36
|
export * from "./components/checkbox.js";
|
|
39
37
|
export * from "./components/code-editor-mockup.js";
|
|
40
38
|
export * from "./components/collapsible.js";
|
|
39
|
+
export * from "./components/collection-filters.js";
|
|
40
|
+
export * from "./components/collection-scope.js";
|
|
41
|
+
export * from "./components/collection-toolbar.js";
|
|
41
42
|
export * from "./components/combobox.js";
|
|
42
43
|
export * from "./components/command.js";
|
|
43
44
|
export * from "./components/confirm-dialog.js";
|
|
@@ -64,8 +65,8 @@ export * from "./components/file-type-icon.js";
|
|
|
64
65
|
export * from "./components/footer.js";
|
|
65
66
|
export * from "./components/form.js";
|
|
66
67
|
export * from "./components/forma-avatar.js";
|
|
67
|
-
export * from "./components/glyph-spinner.js";
|
|
68
68
|
export * from "./components/glass-control.js";
|
|
69
|
+
export * from "./components/glyph-spinner.js";
|
|
69
70
|
export * from "./components/handoff-banner.js";
|
|
70
71
|
export * from "./components/hero.js";
|
|
71
72
|
export * from "./components/hero-split.js";
|
|
@@ -77,6 +78,7 @@ export * from "./components/installer-shell.js";
|
|
|
77
78
|
export * from "./components/integration-flow.js";
|
|
78
79
|
export * from "./components/item.js";
|
|
79
80
|
export * from "./components/kbd.js";
|
|
81
|
+
export * from "./components/kpi-card.js";
|
|
80
82
|
export * from "./components/label.js";
|
|
81
83
|
export * from "./components/label-system.js";
|
|
82
84
|
export * from "./components/live-demo.js";
|
|
@@ -111,10 +113,8 @@ export * from "./components/section-intro.js";
|
|
|
111
113
|
export * from "./components/security-grid.js";
|
|
112
114
|
export * from "./components/select.js";
|
|
113
115
|
export * from "./components/separator.js";
|
|
114
|
-
export * from "./components/settings-section.js";
|
|
115
116
|
export * from "./components/settings-facts.js";
|
|
116
|
-
export * from "./components/
|
|
117
|
-
export * from "./components/collection-filters.js";
|
|
117
|
+
export * from "./components/settings-section.js";
|
|
118
118
|
export * from "./components/sheet.js";
|
|
119
119
|
export * from "./components/shift-band.js";
|
|
120
120
|
export * from "./components/sidebar.js";
|
|
@@ -122,9 +122,7 @@ export * from "./components/skeleton.js";
|
|
|
122
122
|
export * from "./components/slider.js";
|
|
123
123
|
export * from "./components/sonner.js";
|
|
124
124
|
export * from "./components/spinner.js";
|
|
125
|
-
export * from "./components/stat-block.js";
|
|
126
125
|
export * from "./components/statement.js";
|
|
127
|
-
export * from "./components/stats-band.js";
|
|
128
126
|
export * from "./components/status-dot.js";
|
|
129
127
|
export * from "./components/status-row.js";
|
|
130
128
|
export * from "./components/steps.js";
|
|
@@ -140,5 +138,6 @@ export * from "./components/toggle.js";
|
|
|
140
138
|
export * from "./components/toggle-group.js";
|
|
141
139
|
export * from "./components/tool-icon.js";
|
|
142
140
|
export * from "./components/tooltip.js";
|
|
141
|
+
export * from "./components/trend-badge.js";
|
|
143
142
|
export * from "./components/usage-meter.js";
|
|
144
143
|
export * from "./components/use-case-bento.js";
|
|
@@ -13,7 +13,7 @@ copy, and behavior.
|
|
|
13
13
|
| --- | --- | --- |
|
|
14
14
|
| `DataTable`, `DataTableColumnControls`, `DataTableEmptyState`, `DataTableState` | `@shadcn/data-table-demo` or the `DataTable` inside `@shadcn/dashboard-01` | shadcn already ships first-party data-table examples with sorting, selection, visibility, filtering, and pagination patterns. |
|
|
15
15
|
| `CommandPalette`, `ModelPickerCommand`, `SessionPickerCommand` | `@shadcn/command`, `@shadcn/command-demo`, `@shadcn/command-dialog` | shadcn already ships the command primitives and command-dialog example; model/session execution is app behavior. |
|
|
16
|
-
| `ChartCard`, `MetricChart`, `semanticChartColors` |
|
|
16
|
+
| `ChartCard`, `MetricChart`, `semanticChartColors` | The package chart kit, owned by [`contract.md`](contract.md) | shadcn already ships the chart primitives and blocks the kit is pulled from; metric aggregation and chart choice are app behavior. |
|
|
17
17
|
|
|
18
18
|
## Retained Package Compositions
|
|
19
19
|
|
package/docs/contract.md
CHANGED
|
@@ -99,11 +99,9 @@ parents stay in the selector. Apps bind authorized options and URL state; cleari
|
|
|
99
99
|
record filters preserves the parent scope. Parent details belong on their detail
|
|
100
100
|
page, not in repeated panels surrounding identical child tables.
|
|
101
101
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
An entity's optional `mark` prints between its color dot and its label, so a
|
|
106
|
-
ranked model row shows the maker's mark beside the name.
|
|
102
|
+
A ranked breakdown is not a kit component: the Portal renders it through its
|
|
103
|
+
one table owner, `DataTable`, with a `Progress` cell. The kit composes no second
|
|
104
|
+
table (`tests/chart-kpi-ownership.test.ts`).
|
|
107
105
|
|
|
108
106
|
### Record action menus
|
|
109
107
|
|
|
@@ -147,7 +145,8 @@ states to the orb.
|
|
|
147
145
|
- **Package surface is source-backed.** Public components stay flat under `src/components/`. Reviewed registry source under `src/internal/` is implementation, not a package namespace. Do not add top-level exports for recipes, blocks, agent, terminal, or vendor groupings unless a later package API decision adds concrete public source, built files, docs, and tests in the same change.
|
|
148
146
|
- **Agents is the client-only conversation interface.** `@nadicodeai/ui/agents` re-exports the complete `@assistant-ui/react` runtime and primitive API plus the reviewed, branded registry composition held under `src/internal/assistant-ui/`. Its built entry retains `"use client"`. Consumers receive Thread, attachments, Markdown, reasoning, tools, suggestions, providers, runtimes, hooks, and types from that one domain namespace. Agent identity components use their direct component subpaths so server compositions do not import the conversation runtime. The vendor name is not a public NadicodeAI subpath, and the package does not rename, wrap, or rebuild assistant-ui behavior.
|
|
149
147
|
- **Base UI is the active primitive base.** `components.json` must resolve through a Base style, currently `base-nova`, and `npx shadcn@latest info --json` must report `base: "base"`. Do not reintroduce `radix-ui`, `@radix-ui/*`, or `vaul` to package source, dependencies, or app optimizer configuration. Registry-owned shadcn primitives stay aligned with current `shadcn@latest` Base UI output; use Base UI `render` composition instead of Radix `asChild`. `cmdk` is allowed only for the stock shadcn Command component while the current `base-nova` registry declares that dependency; do not use it elsewhere or replace it without a shadcn/compatibility decision and tests.
|
|
150
|
-
- **Charts are shadcn charts.** `chart.tsx` is shadcn's `chart`
|
|
148
|
+
- **Charts are stock shadcn charts.** Every chart and KPI here is a registry item, changed as little as possible: `chart.tsx` is shadcn's `chart` over Recharts; `chart-bar-stacked`, `chart-area-stacked`, and `chart-bar-multiple` are the blocks of those names; `chart-sparkline` is `chart-line-linear` stripped of its card, axes, grid and tooltip; `kpi-card` is the `dashboard-01` block's section card; `chart-card` is their shared Card frame. Each pulled file names its registry item on line one. `base-nova` does not publish the chart gallery and the CLI search does not list it, so a chart the kit lacks is pulled from `https://ui.shadcn.com/r/styles/new-york-v4/<name>.json` (`files[0].content`) and added here. What deviates from stock, and why, is listed once in [`DESIGN.md`, "Chart source"](../../design-system/DESIGN.md#chart-source); a change to a pulled chart that is not on that list is drift. There is no hidden table twin, no mark inside a legend, and no second axis. Every chart component renders the whole card — `Card > CardHeader(CardTitle, CardDescription, CardAction) > CardContent(ChartContainer) > CardFooter?` — at a fixed plot height (`h-64`, `h-80` at `size="lg"`), legend below the plot, left-aligned and wrapping. An app composes these, never builds a chart card frame by hand, and never imports `recharts`, which this package alone declares. Which chart a reading question deserves is owned by [`skills/design/product-design/references/charts.md`](../../../skills/design/product-design/references/charts.md).
|
|
149
|
+
|
|
151
150
|
- **Named shadcn blocks stay named.** When a user, plan, or issue selects a shadcn block/example such as `login-02`, `signup-02`, `dashboard-01`, or `sidebar-*`, use that registry item as the source of truth through shadcn CLI/MCP. Do not replace it with a package-authored abstraction unless the plan explicitly records the substitution, the reason, and the true consumer route that proves it.
|
|
152
151
|
- **A change to what the package ships bumps the version.** Any change to exported components, `src/index.ts`, package `exports`, `globals.css`, theme behavior, package docs, or design-system token, CSS, or theme output this package consumes bumps both package versions in lockstep before handoff, and `npm pack --dry-run -w @nadicodeai/ui` shows exactly what consumers receive (procedure: `../../../docs/agents/publish.md`).
|
|
153
152
|
|
|
@@ -183,11 +182,10 @@ explicitly and never infers or randomizes one from a free-form role.
|
|
|
183
182
|
When the product chooses a card presentation, use `AgentCard`; registry cells,
|
|
184
183
|
membership rows, and compact detail headers compose the shared `AgentVisual`
|
|
185
184
|
within the structure their reading task requires. An Agent's presence does not
|
|
186
|
-
by itself choose a card layout. There is no `AgentGlyph`,
|
|
187
|
-
|
|
188
|
-
package.
|
|
185
|
+
by itself choose a card layout. There is no `AgentGlyph`, `AgentRow`, or
|
|
186
|
+
product-domain `agent` object prop in the shared package.
|
|
189
187
|
|
|
190
|
-
- **Standard components, not app-owned product features.** This package ships primitives, standard UI components, assistant-ui compositions, brand adapters, React adapters, reusable sections, and presentational product components. It must not ship app-specific feature/use-case screens or names such as operator-login, portal activation, customer credential control, or customer management. Domain registries, command search providers, and chart dashboards bind app data and routes in the app; that binding is not a reason to copy reusable presentation. Portal's DataTable owns its Next.js query and registry protocol once, while consuming the shared UI foundation. Product-independent compositions belong here with a real consumer. The source-backed `chart-*` package surface is the plan-approved exception per issue #166; apps select charts and bind their titles, data, and navigation.
|
|
188
|
+
- **Standard components, not app-owned product features.** This package ships primitives, standard UI components, assistant-ui compositions, brand adapters, React adapters, reusable sections, and presentational product components. It must not ship app-specific feature/use-case screens or names such as operator-login, portal activation, customer credential control, or customer management. Domain registries, command search providers, and chart dashboards bind app data and routes in the app; that binding is not a reason to copy reusable presentation. Portal's DataTable owns its Next.js query and registry protocol once, while consuming the shared UI foundation. Product-independent compositions belong here with a real consumer. The source-backed `chart-*` and `kpi-card` package surface is the plan-approved exception per issue #166; apps select charts and bind their titles, data, and navigation. A chart is named by the card title above it and navigated through Recharts' own accessibility layer; the kit ships no hidden table twin, because a component whose complete value is already available in visible text or `aria-valuetext` does not add a redundant table.
|
|
191
189
|
- **Auth routes are consumer-owned shadcn block work.** Login, signup, OTP, two-factor, magic-link, and provider-button flows start from the selected shadcn block/example in the consuming app, with app-owned Better Auth behavior. Do not ship generic auth, signup, OTP, federated-login, or provider abstractions from this package unless a later explicit boundary decision replaces the selected shadcn block.
|
|
192
190
|
- **Reusable sections and compositions live here after proof.** Bento grids, media mounts, demo surfaces, page frames, section intros, CTA bands, proof slots, benefits grids, generic shells, and homepage/use-case sections belong in `@nadicodeai/ui` when a second concrete consumer, a plan-approved shared component, or a named validation slice proves the package boundary. Website, portal, and sibling Nadia routes pass data and media children into existing compositions instead of rebuilding layout locally.
|
|
193
191
|
- **Brand renderers live here for React consumers.** Logo geometry, asset generation, and usage semantics are owned by [`packages/design-system/DESIGN.md`, "Brand media authority"](../../design-system/DESIGN.md#brand-media-authority). `BrandLockup` supplies the approved horizontal lockup. `BrandMark` serves tight spaces and `BrandWordmark` serves placements where the name must read by itself. All three render the package's public neutral geometry seam with React-scoped SVG ids, dynamic theme paint, and accessible names. Consuming routes use these adapters; they never import raw logo assets, draw brand SVG inline, mask or recolor assets, or create another lockup rule.
|
|
@@ -207,16 +205,10 @@ scales the artwork inside it; `size` states that box, and the author slug prints
|
|
|
207
205
|
as reported.
|
|
208
206
|
|
|
209
207
|
One component has two readings: with `name`, the row a table cell or ranked
|
|
210
|
-
list reads; without one, the bare mark
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
chart places it on each surface itself: the legend through the explicit `marks`
|
|
215
|
-
path on `ChartLegendContent`, and the tooltip row through the kit's own row
|
|
216
|
-
renderer, because `rule/model-shown-with-logo` names tooltips among the places a
|
|
217
|
-
model appears. A series' mark never travels through `ChartConfig`, whose label
|
|
218
|
-
the legend and the default tooltip item both read, so an identity parked there
|
|
219
|
-
would appear on a surface that never asked for it. No legend is forked. A mark is
|
|
208
|
+
list reads; without one, the bare mark beside text that already names the model.
|
|
209
|
+
The chart kit does not place marks: its legend and tooltip are the stock shadcn
|
|
210
|
+
content, and a chart names a model through the label in its `ChartConfig`. A
|
|
211
|
+
model's row in a table or a ranked list is where `ModelMark` belongs. A mark is
|
|
220
212
|
decoration beside the label that already names it; one standing alone takes
|
|
221
213
|
`label` (`role="img"` with an accessible name) or stays hidden.
|
|
222
214
|
|
|
@@ -232,7 +224,13 @@ app supplies the author slug, the name, and the colors it pairs with them.
|
|
|
232
224
|
|
|
233
225
|
The source tree, barrels, and package exports own the current reusable section vocabulary. When a page needs a variation, extend the owning source component with a small typed prop or slot; do not fork the layout in a consumer or document a second component inventory here.
|
|
234
226
|
|
|
235
|
-
`
|
|
227
|
+
`KpiCard` is one measured figure, in the shape of the `dashboard-01` section
|
|
228
|
+
card: label, value, the change as a badge top right, and a footer carrying the
|
|
229
|
+
comparison line and a note, both in the caller's language. There is no grouped or divided variant — a
|
|
230
|
+
row of KPIs is a `CardRow` of `KpiCard`s, each its own card. Apps supply the
|
|
231
|
+
figures and bind links through `render`. Charts expose `size` (`default` or
|
|
232
|
+
`lg`), which selects a fixed plot height, so consumers never select internal
|
|
233
|
+
chart elements.
|
|
236
234
|
|
|
237
235
|
`CollectionToolbar` owns the collection-control layout: compact filters at the
|
|
238
236
|
leading edge, a flexible search field, and trailing actions. Its slot order is
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nadicodeai/ui",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -62,29 +62,29 @@
|
|
|
62
62
|
"test": "vitest run"
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"@assistant-ui/react": "0.15.
|
|
66
|
-
"@assistant-ui/react-markdown": "0.14.
|
|
65
|
+
"@assistant-ui/react": "0.15.20",
|
|
66
|
+
"@assistant-ui/react-markdown": "0.14.15",
|
|
67
67
|
"@base-ui/react": "^1.8.0",
|
|
68
|
-
"@nadicodeai/design-system": "
|
|
69
|
-
"@paper-design/shaders": "0.0.
|
|
68
|
+
"@nadicodeai/design-system": "8.0.0",
|
|
69
|
+
"@paper-design/shaders": "0.0.81",
|
|
70
70
|
"class-variance-authority": "^0.7.1",
|
|
71
71
|
"clsx": "^2.1.1",
|
|
72
72
|
"cmdk": "^1.1.1",
|
|
73
73
|
"embla-carousel-react": "^8.6.0",
|
|
74
74
|
"input-otp": "^1.5.0",
|
|
75
75
|
"lucide-react": "1.47.0",
|
|
76
|
-
"motion": "^13.
|
|
76
|
+
"motion": "^13.4.0",
|
|
77
77
|
"next-themes": "^0.4.6",
|
|
78
78
|
"react-day-picker": "^10.0.1",
|
|
79
|
-
"react-hook-form": "^7.
|
|
79
|
+
"react-hook-form": "^7.88.0",
|
|
80
80
|
"react-resizable-panels": "^4.12.3",
|
|
81
81
|
"recharts": "^3.10.1",
|
|
82
82
|
"remark-gfm": "^4.0.1",
|
|
83
83
|
"sonner": "^2.0.8",
|
|
84
|
-
"tailwind-merge": "^3.
|
|
84
|
+
"tailwind-merge": "^3.7.0",
|
|
85
85
|
"thinking-orbs": "0.3.1",
|
|
86
86
|
"tw-animate-css": "^1.4.0",
|
|
87
|
-
"tw-shimmer": "0.4.
|
|
87
|
+
"tw-shimmer": "0.4.13",
|
|
88
88
|
"zustand": "^5.0.14"
|
|
89
89
|
},
|
|
90
90
|
"peerDependencies": {
|