@neasg/design-system 0.4.7 → 0.4.9
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/README.md +121 -0
- package/dist/alert.d.ts +21 -2
- package/dist/alert.js +10 -3
- package/dist/avatar.d.ts +5 -2
- package/dist/avatar.js +76 -8
- package/dist/back-button.d.ts +2 -0
- package/dist/back-button.js +1 -1
- package/dist/badge.d.ts +3 -2
- package/dist/badge.js +9 -3
- package/dist/breadcrumb.js +2 -1
- package/dist/button.d.ts +1 -1
- package/dist/button.js +13 -10
- package/dist/calendar.js +10 -9
- package/dist/card.d.ts +29 -1
- package/dist/card.js +61 -7
- package/dist/checkbox.d.ts +2 -0
- package/dist/checkbox.js +2 -2
- package/dist/close-button.d.ts +6 -0
- package/dist/close-button.js +8 -0
- package/dist/collapsible.d.ts +7 -1
- package/dist/collapsible.js +2 -2
- package/dist/command-search.d.ts +16 -1
- package/dist/command-search.js +42 -16
- package/dist/command.js +3 -3
- package/dist/copy-button.d.ts +3 -1
- package/dist/copy-button.js +4 -2
- package/dist/count-badge.d.ts +3 -1
- package/dist/count-badge.js +10 -5
- package/dist/date-input.d.ts +18 -3
- package/dist/date-input.js +94 -21
- package/dist/dialog-primitive.js +4 -3
- package/dist/draggable-tabs.d.ts +7 -0
- package/dist/draggable-tabs.js +6 -5
- package/dist/drawer.js +2 -2
- package/dist/dropdown-button.d.ts +18 -0
- package/dist/dropdown-button.js +31 -0
- package/dist/edit-button.d.ts +10 -0
- package/dist/edit-button.js +7 -0
- package/dist/editable-table.d.ts +3 -1
- package/dist/editable-table.js +25 -12
- package/dist/field.d.ts +2 -2
- package/dist/field.js +4 -3
- package/dist/file-upload-status-toast.d.ts +28 -0
- package/dist/file-upload-status-toast.js +136 -0
- package/dist/file-upload.js +8 -7
- package/dist/filter-popover.d.ts +37 -0
- package/dist/filter-popover.js +73 -0
- package/dist/filter-toggle.js +2 -2
- package/dist/index.d.ts +45 -14
- package/dist/index.js +19 -4
- package/dist/input-control.d.ts +3 -2
- package/dist/input-control.js +3 -2
- package/dist/label-value-grid.d.ts +4 -2
- package/dist/label-value-grid.js +7 -6
- package/dist/label-value.js +3 -1
- package/dist/layout-right-panel-edge.d.ts +6 -0
- package/dist/layout-right-panel-edge.js +6 -0
- package/dist/layout.d.ts +77 -5
- package/dist/layout.js +439 -35
- package/dist/lib/date-utils.d.ts +10 -2
- package/dist/lib/date-utils.js +91 -11
- package/dist/lib/utils.js +8 -1
- package/dist/link.js +2 -2
- package/dist/message-item.d.ts +62 -0
- package/dist/message-item.js +148 -0
- package/dist/multi-select.js +31 -5
- package/dist/notification.d.ts +82 -0
- package/dist/notification.js +121 -0
- package/dist/otp-input.js +1 -1
- package/dist/page-header.js +1 -1
- package/dist/page-section.d.ts +2 -1
- package/dist/page-section.js +4 -3
- package/dist/pagination.js +2 -2
- package/dist/popover-menu.d.ts +23 -1
- package/dist/popover-menu.js +75 -5
- package/dist/popover-primitive.js +1 -1
- package/dist/progress.d.ts +5 -2
- package/dist/progress.js +6 -3
- package/dist/radio-group.d.ts +21 -0
- package/dist/radio-group.js +41 -0
- package/dist/rich-text-editor.d.ts +56 -0
- package/dist/rich-text-editor.js +394 -0
- package/dist/routing-timeline.d.ts +22 -0
- package/dist/routing-timeline.js +58 -0
- package/dist/scroll-hint.d.ts +8 -0
- package/dist/scroll-hint.js +7 -0
- package/dist/search-input-shell.js +1 -1
- package/dist/search-input.js +2 -2
- package/dist/section-nav.js +4 -4
- package/dist/select-primitive.js +3 -3
- package/dist/select.js +1 -1
- package/dist/skeleton.js +1 -1
- package/dist/styles.css +235 -57
- package/dist/table-column-visibility.d.ts +21 -0
- package/dist/table-column-visibility.js +74 -0
- package/dist/table-toolbar.js +1 -1
- package/dist/table.d.ts +12 -1
- package/dist/table.js +67 -33
- package/dist/tabs.d.ts +14 -3
- package/dist/tabs.js +60 -6
- package/dist/tailwind-preset.js +46 -0
- package/dist/task-mode-shell.d.ts +24 -0
- package/dist/task-mode-shell.js +110 -0
- package/dist/textarea.js +2 -1
- package/dist/theme-switcher.d.ts +28 -0
- package/dist/theme-switcher.js +27 -0
- package/dist/theme.d.ts +167 -0
- package/dist/theme.js +112 -0
- package/dist/toaster.js +5 -4
- package/dist/tooltip.js +1 -1
- package/dist/typography.d.ts +1 -1
- package/dist/typography.js +5 -5
- package/dist/workspace-header.d.ts +13 -0
- package/dist/workspace-header.js +11 -0
- package/package.json +15 -1
package/dist/label-value.js
CHANGED
|
@@ -13,9 +13,11 @@ export function isEmptyValue(value) {
|
|
|
13
13
|
}
|
|
14
14
|
function LabelValue({ label, value, className, labelClassName, hideIfEmpty = false, hideLabel = false, loading = false, required = false, }) {
|
|
15
15
|
const empty = isEmptyValue(value);
|
|
16
|
+
const hasPrimitiveValue = typeof value === "string" || typeof value === "number";
|
|
17
|
+
const hasRichValue = !empty && !hasPrimitiveValue;
|
|
16
18
|
if (!loading && hideIfEmpty && empty) {
|
|
17
19
|
return null;
|
|
18
20
|
}
|
|
19
|
-
return (_jsxs("div", { className: cn("min-w-0 h-full space-y-1", className), children: [!hideLabel && (loading ? (_jsx(Skeleton, { className: "h-3.5 w-20" })) : (_jsxs(Typography, { as: "p", variant: "label",
|
|
21
|
+
return (_jsxs("div", { className: cn("min-w-0 h-full", hasRichValue ? "space-y-2" : "space-y-1", className), children: [!hideLabel && (loading ? (_jsx(Skeleton, { className: "h-3.5 w-20" })) : (_jsxs(Typography, { as: "p", variant: "label", color: "muted", className: labelClassName, children: [label, required ? (_jsx("span", { "aria-hidden": "true", className: "ml-0.5 text-destructive", children: "*" })) : null] }))), loading ? (_jsx(Skeleton, { className: "h-4 w-32" })) : (_jsx(Typography, { as: "div", variant: "bodySm", className: cn("min-w-0 max-w-full break-words [overflow-wrap:anywhere]", hasRichValue && "[&>*]:min-w-0 [&>*]:max-w-full", !empty && hasPrimitiveValue && "font-medium", empty && "italic text-muted-foreground/60"), children: empty ? "-" : value }))] }));
|
|
20
22
|
}
|
|
21
23
|
export { LabelValue };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
declare const rightPanelEdgeClassName = "border-l";
|
|
2
|
+
declare const rightPanelEdgeOpenClassName = "border-[hsl(var(--layout-right-panel-border))] shadow-[var(--layout-right-panel-shadow)]";
|
|
3
|
+
declare const rightPanelEdgeClosedClassName = "border-transparent shadow-none";
|
|
4
|
+
declare const rightPanelEdgeDividerClassName = "bg-[hsl(var(--layout-right-panel-border)/0.55)]";
|
|
5
|
+
declare const rightPanelResizeHandleSurfaceClassName = "border-[hsl(var(--layout-right-panel-border))] bg-[hsl(var(--layout-right-panel-background))]";
|
|
6
|
+
export { rightPanelEdgeClassName, rightPanelEdgeClosedClassName, rightPanelEdgeDividerClassName, rightPanelEdgeOpenClassName, rightPanelResizeHandleSurfaceClassName, };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
const rightPanelEdgeClassName = "border-l";
|
|
2
|
+
const rightPanelEdgeOpenClassName = "border-[hsl(var(--layout-right-panel-border))] shadow-[var(--layout-right-panel-shadow)]";
|
|
3
|
+
const rightPanelEdgeClosedClassName = "border-transparent shadow-none";
|
|
4
|
+
const rightPanelEdgeDividerClassName = "bg-[hsl(var(--layout-right-panel-border)/0.55)]";
|
|
5
|
+
const rightPanelResizeHandleSurfaceClassName = "border-[hsl(var(--layout-right-panel-border))] bg-[hsl(var(--layout-right-panel-background))]";
|
|
6
|
+
export { rightPanelEdgeClassName, rightPanelEdgeClosedClassName, rightPanelEdgeDividerClassName, rightPanelEdgeOpenClassName, rightPanelResizeHandleSurfaceClassName, };
|
package/dist/layout.d.ts
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import { type AvatarProfileProps } from "./avatar";
|
|
2
3
|
import { type CountBadgeProps } from "./count-badge";
|
|
4
|
+
import { type TabsProps } from "./tabs";
|
|
5
|
+
export type DashboardRightPanelMode = "responsive" | "persistent";
|
|
3
6
|
type SidebarContextType = {
|
|
4
7
|
isCollapsed: boolean;
|
|
5
8
|
toggle: () => void;
|
|
9
|
+
collapse: () => void;
|
|
6
10
|
};
|
|
7
|
-
export declare function SidebarProvider({ children }: {
|
|
11
|
+
export declare function SidebarProvider({ children, defaultCollapsed, }: {
|
|
8
12
|
children: React.ReactNode;
|
|
13
|
+
defaultCollapsed?: boolean;
|
|
9
14
|
}): import("react/jsx-runtime").JSX.Element;
|
|
10
15
|
export declare function useSidebar(): SidebarContextType;
|
|
11
16
|
export interface DashboardLayoutProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
@@ -13,12 +18,35 @@ export interface DashboardLayoutProps extends React.HTMLAttributes<HTMLDivElemen
|
|
|
13
18
|
prototypeBanner?: React.ReactNode;
|
|
14
19
|
/** Sidebar element, typically a <DashboardSidebar />. */
|
|
15
20
|
sidebar?: React.ReactNode;
|
|
21
|
+
/** Optional contextual column rendered inside the right side of the workspace surface. */
|
|
22
|
+
rightPanel?: React.ReactNode;
|
|
16
23
|
/** Class names applied to the inner content surface (the rounded card around children). */
|
|
17
24
|
surfaceClassName?: string;
|
|
18
25
|
/** Class names applied to the content `<main>` wrapper. */
|
|
19
26
|
contentClassName?: string;
|
|
27
|
+
/** Class names applied to the optional right panel column. */
|
|
28
|
+
rightPanelClassName?: string;
|
|
29
|
+
/** Floating trigger shown below the desktop right-panel breakpoint. */
|
|
30
|
+
rightPanelFallbackTrigger?: React.ReactNode;
|
|
31
|
+
/** Right panel rendering strategy. `persistent` keeps the panel in the workspace grid. */
|
|
32
|
+
rightPanelMode?: DashboardRightPanelMode;
|
|
33
|
+
/** Allows users to drag-resize a persistent right panel. */
|
|
34
|
+
rightPanelResizable?: boolean;
|
|
35
|
+
/** Initial persistent right panel width in pixels when resizing is enabled. */
|
|
36
|
+
rightPanelDefaultWidth?: number;
|
|
37
|
+
/** Minimum persistent right panel width in pixels when resizing is enabled. */
|
|
38
|
+
rightPanelMinWidth?: number;
|
|
39
|
+
/** Maximum persistent right panel width in pixels when resizing is enabled. */
|
|
40
|
+
rightPanelMaxWidth?: number;
|
|
41
|
+
/**
|
|
42
|
+
* Collapses the sidebar when a right panel opens below this viewport width.
|
|
43
|
+
* Set to `false` to opt out.
|
|
44
|
+
*/
|
|
45
|
+
rightPanelAutoCollapseSidebarBreakpoint?: number | false;
|
|
46
|
+
/** Initial sidebar state on desktop before the user toggles it. */
|
|
47
|
+
defaultSidebarCollapsed?: boolean;
|
|
20
48
|
}
|
|
21
|
-
declare function DashboardLayout({ className, masthead, prototypeBanner, sidebar, surfaceClassName, contentClassName, children, style, ...props }: DashboardLayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
49
|
+
declare function DashboardLayout({ className, masthead, prototypeBanner, sidebar, rightPanel, surfaceClassName, contentClassName, rightPanelClassName, rightPanelFallbackTrigger, rightPanelMode, rightPanelResizable, rightPanelDefaultWidth, rightPanelMinWidth, rightPanelMaxWidth, rightPanelAutoCollapseSidebarBreakpoint, defaultSidebarCollapsed, children, style, ...props }: DashboardLayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
22
50
|
export interface DashboardSidebarProps extends React.HTMLAttributes<HTMLElement> {
|
|
23
51
|
logo?: React.ReactNode | ((context: {
|
|
24
52
|
isCollapsed: boolean;
|
|
@@ -39,7 +67,6 @@ interface DashboardSidebarNavItemBase {
|
|
|
39
67
|
icon?: React.ElementType;
|
|
40
68
|
active?: boolean;
|
|
41
69
|
disabled?: boolean;
|
|
42
|
-
wip?: boolean;
|
|
43
70
|
badgeCount?: number;
|
|
44
71
|
badgeVariant?: CountBadgeProps["variant"];
|
|
45
72
|
badgePulse?: boolean;
|
|
@@ -72,9 +99,54 @@ export interface DashboardSidebarNavGroup {
|
|
|
72
99
|
label?: string;
|
|
73
100
|
items: DashboardSidebarNavItem[];
|
|
74
101
|
}
|
|
102
|
+
export interface DashboardSidebarProfileProps extends Omit<AvatarProfileProps, "className" | "avatarClassName" | "fallbackClassName" | "avatarOverlay" | "imageClassName" | "contentClassName" | "nameClassName" | "roleClassName" | "topInfoClassName" | "bottomInfoClassName" | "rolePlacement"> {
|
|
103
|
+
isCollapsed?: boolean;
|
|
104
|
+
rolePlacement?: "above" | "below";
|
|
105
|
+
status?: "online" | "busy" | "offline" | "none";
|
|
106
|
+
}
|
|
107
|
+
declare function DashboardSidebarProfile({ isCollapsed, status, name, role, rolePlacement, size, ...props }: DashboardSidebarProfileProps): import("react/jsx-runtime").JSX.Element;
|
|
75
108
|
declare function DashboardSidebar({ className, children, logo, search, navGroups, footerItems, footer, toggleAriaLabel, ...props }: DashboardSidebarProps): import("react/jsx-runtime").JSX.Element;
|
|
76
109
|
export interface DashboardContentProps extends React.HTMLAttributes<HTMLElement> {
|
|
110
|
+
hasSidebar?: boolean;
|
|
111
|
+
rightPanel?: React.ReactNode;
|
|
112
|
+
rightPanelClassName?: string;
|
|
113
|
+
rightPanelFallbackTrigger?: React.ReactNode;
|
|
114
|
+
rightPanelMode?: DashboardRightPanelMode;
|
|
115
|
+
rightPanelResizable?: boolean;
|
|
116
|
+
rightPanelDefaultWidth?: number;
|
|
117
|
+
rightPanelMinWidth?: number;
|
|
118
|
+
rightPanelMaxWidth?: number;
|
|
119
|
+
rightPanelAutoCollapseSidebarBreakpoint?: number | false;
|
|
77
120
|
surfaceClassName?: string;
|
|
78
121
|
}
|
|
79
|
-
|
|
80
|
-
|
|
122
|
+
export interface DashboardRightPanelProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
123
|
+
}
|
|
124
|
+
export interface DashboardRightPanelHeaderProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "title"> {
|
|
125
|
+
title: React.ReactNode;
|
|
126
|
+
subtitle?: React.ReactNode;
|
|
127
|
+
badge?: React.ReactNode;
|
|
128
|
+
action?: React.ReactNode;
|
|
129
|
+
}
|
|
130
|
+
export interface DashboardRightPanelBodyProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
131
|
+
/** Fixed footer content such as a composer or action bar. */
|
|
132
|
+
footer?: React.ReactNode;
|
|
133
|
+
/** Class names applied to the scrollable body content when `footer` is provided. */
|
|
134
|
+
contentClassName?: string;
|
|
135
|
+
/** Class names applied to the fixed footer wrapper. */
|
|
136
|
+
footerClassName?: string;
|
|
137
|
+
}
|
|
138
|
+
export interface DashboardRightPanelSectionProps extends Omit<React.HTMLAttributes<HTMLElement>, "title"> {
|
|
139
|
+
title?: React.ReactNode;
|
|
140
|
+
description?: React.ReactNode;
|
|
141
|
+
titleClassName?: string;
|
|
142
|
+
descriptionClassName?: string;
|
|
143
|
+
}
|
|
144
|
+
export interface DashboardRightPanelTabsProps extends TabsProps {
|
|
145
|
+
}
|
|
146
|
+
declare function DashboardRightPanelSection({ className, title, description, titleClassName, descriptionClassName, children, ...props }: DashboardRightPanelSectionProps): import("react/jsx-runtime").JSX.Element;
|
|
147
|
+
declare function DashboardRightPanelTabs({ className, listWrapperClassName, panelClassName, ...props }: DashboardRightPanelTabsProps): import("react/jsx-runtime").JSX.Element;
|
|
148
|
+
declare function DashboardRightPanel({ className, ...props }: DashboardRightPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
149
|
+
declare function DashboardRightPanelHeader({ className, title, subtitle, badge, action, children, ...props }: DashboardRightPanelHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
150
|
+
declare function DashboardRightPanelBody({ className, contentClassName, footer, footerClassName, children, ...props }: DashboardRightPanelBodyProps): import("react/jsx-runtime").JSX.Element;
|
|
151
|
+
declare function DashboardContent({ className, hasSidebar, rightPanel, rightPanelClassName, rightPanelFallbackTrigger, rightPanelMode, rightPanelResizable, rightPanelDefaultWidth, rightPanelMinWidth, rightPanelMaxWidth, rightPanelAutoCollapseSidebarBreakpoint, surfaceClassName, children, ...props }: DashboardContentProps): import("react/jsx-runtime").JSX.Element;
|
|
152
|
+
export { DashboardLayout, DashboardSidebar, DashboardSidebarProfile, DashboardContent, DashboardRightPanel, DashboardRightPanelHeader, DashboardRightPanelBody, DashboardRightPanelSection, DashboardRightPanelTabs, };
|