nish-ui 2.2.0 → 3.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/README.md +5 -1
- package/dist/chart.js +1 -1
- package/dist/elements-all.js +58 -58
- package/dist/elements-charts.js +1 -1
- package/dist/elements-data.js +1 -1
- package/dist/elements-forms.js +1 -1
- package/dist/elements.js +4 -4
- package/dist/esm/components/accordion.js +3 -2
- package/dist/esm/components/app-shell.js +3 -2
- package/dist/esm/components/avatar.js +4 -3
- package/dist/esm/components/breadcrumbs.js +3 -2
- package/dist/esm/components/calendar-base.js +4 -3
- package/dist/esm/components/canvas/legend.js +3 -2
- package/dist/esm/components/canvas/node.js +3 -2
- package/dist/esm/components/canvas/system-canvas.js +3 -2
- package/dist/esm/components/carousel.js +3 -2
- package/dist/esm/components/charts.js +8 -7
- package/dist/esm/components/combobox.js +3 -2
- package/dist/esm/components/command.js +4 -3
- package/dist/esm/components/context-menu.js +3 -2
- package/dist/esm/components/data.js +4 -3
- package/dist/esm/components/date-picker.js +4 -3
- package/dist/esm/components/date-range-picker.js +4 -3
- package/dist/esm/components/display.js +7 -6
- package/dist/esm/components/drawer.js +3 -2
- package/dist/esm/components/error-boundary.js +4 -2
- package/dist/esm/components/feedback.js +7 -6
- package/dist/esm/components/file-dropzone.js +3 -2
- package/dist/esm/components/filters.js +4 -3
- package/dist/esm/components/flow.js +6 -5
- package/dist/esm/components/forms.js +13 -8
- package/dist/esm/components/hooks.js +2 -2
- package/dist/esm/components/hover-card.js +2 -2
- package/dist/esm/components/inbox.js +4 -2
- package/dist/esm/components/layout.js +5 -4
- package/dist/esm/components/media.js +3 -2
- package/dist/esm/components/menu.js +5 -4
- package/dist/esm/components/modal.js +4 -3
- package/dist/esm/components/more-sheet.js +3 -2
- package/dist/esm/components/multi-select.js +3 -2
- package/dist/esm/components/nav-items.js +4 -3
- package/dist/esm/components/nav.js +5 -4
- package/dist/esm/components/overlay-dialog.js +3 -2
- package/dist/esm/components/pagination.js +3 -2
- package/dist/esm/components/popover.js +2 -2
- package/dist/esm/components/portal.js +2 -2
- package/dist/esm/components/progress.js +3 -2
- package/dist/esm/components/provider.js +34 -5
- package/dist/esm/components/range-calendar.js +4 -3
- package/dist/esm/components/service-tokens.js +4 -3
- package/dist/esm/components/settings.js +4 -3
- package/dist/esm/components/slider.js +3 -2
- package/dist/esm/components/split.js +4 -3
- package/dist/esm/components/strings.js +174 -65
- package/dist/esm/components/tag-input.js +3 -2
- package/dist/esm/components/theme-toggle.js +3 -2
- package/dist/esm/components/time-field.js +4 -3
- package/dist/esm/components/toast-card.js +155 -0
- package/dist/esm/components/toast-store.js +136 -0
- package/dist/esm/components/toast.js +38 -241
- package/dist/esm/components/tooltip.js +2 -2
- package/dist/esm/components/virtual-table.js +3 -2
- package/dist/esm/index.js +0 -20
- package/dist/esm/runtime.js +1 -1
- package/dist/esm/system-canvas.js +4 -0
- package/dist/esm/theme.js +7 -7
- package/dist/format.js +1 -1
- package/dist/index.d.ts +11 -14
- package/dist/system-canvas.d.ts +183 -2
- package/dist/theme.d.ts +3 -3
- package/dist/theme.global.js +21 -145
- package/dist/theme.js +21 -145
- package/package.json +1 -1
- package/dist/system-canvas-BLuWd69H.d.ts +0 -183
|
@@ -1,183 +0,0 @@
|
|
|
1
|
-
import * as react from 'react';
|
|
2
|
-
import { ReactNode, ComponentPropsWithoutRef, Ref } from 'react';
|
|
3
|
-
|
|
4
|
-
type CanvasHue = 'indigo' | 'emerald' | 'amber' | 'lime' | 'rose' | 'sky' | 'violet' | 'teal';
|
|
5
|
-
type CanvasNodeKind = 'ui' | 'service' | 'worker' | 'library' | 'infra' | 'data' | 'tool' | 'docs';
|
|
6
|
-
interface CanvasNode {
|
|
7
|
-
id: string;
|
|
8
|
-
label: string;
|
|
9
|
-
kind?: CanvasNodeKind;
|
|
10
|
-
detail?: string;
|
|
11
|
-
/** 0..1 afterglow */
|
|
12
|
-
heat?: number;
|
|
13
|
-
/** live work here now */
|
|
14
|
-
active?: boolean;
|
|
15
|
-
/** When the newest activity here happened, ms. Follow mode visits the newest first. */
|
|
16
|
-
activeAt?: number;
|
|
17
|
-
/** shown under an active node, max ~48 chars */
|
|
18
|
-
note?: string;
|
|
19
|
-
/** sessions/agents here */
|
|
20
|
-
count?: number;
|
|
21
|
-
}
|
|
22
|
-
interface CanvasGroup {
|
|
23
|
-
id: string;
|
|
24
|
-
title: string;
|
|
25
|
-
subtitle?: string;
|
|
26
|
-
hue?: CanvasHue;
|
|
27
|
-
/** Left-to-right layer in the "columns" layout; also orders groups inside a band. */
|
|
28
|
-
column: number;
|
|
29
|
-
/** Top-to-bottom band in the "bands" layout. Default: `column`. */
|
|
30
|
-
band?: number;
|
|
31
|
-
badge?: ReactNode;
|
|
32
|
-
nodes: CanvasNode[];
|
|
33
|
-
}
|
|
34
|
-
interface CanvasEdge {
|
|
35
|
-
id: string;
|
|
36
|
-
/** node or group id */
|
|
37
|
-
from: string;
|
|
38
|
-
/** node or group id */
|
|
39
|
-
to: string;
|
|
40
|
-
/** Overrides the kind's line style with a dashed line. */
|
|
41
|
-
dashed?: boolean;
|
|
42
|
-
label?: string;
|
|
43
|
-
/** A `CanvasEdgeKind` id: sets the line style and which legend toggle shows or hides it. */
|
|
44
|
-
kind?: string;
|
|
45
|
-
}
|
|
46
|
-
/** One entry of the line legend. */
|
|
47
|
-
interface CanvasEdgeKind {
|
|
48
|
-
id: string;
|
|
49
|
-
/** Legend text ("Traffic", "Deploys"). */
|
|
50
|
-
label: string;
|
|
51
|
-
/** Default "solid". */
|
|
52
|
-
line?: 'solid' | 'dashed' | 'dotted';
|
|
53
|
-
/** Hidden until the viewer turns it on in the legend. */
|
|
54
|
-
hidden?: boolean;
|
|
55
|
-
}
|
|
56
|
-
/** "columns": layers left to right. "bands": bands top to bottom, each wrapping its groups into
|
|
57
|
-
* rows. "auto": whichever shows the map biggest in the current viewport. */
|
|
58
|
-
type CanvasLayoutMode = 'columns' | 'bands' | 'auto';
|
|
59
|
-
/** Text of the canvas that has no key in `NishStrings`. Each one wins over its English default. */
|
|
60
|
-
interface CanvasLabels {
|
|
61
|
-
/** Added to the "Lines" button when kinds are hidden: "· 2 hidden". */
|
|
62
|
-
hidden: (count: number) => string;
|
|
63
|
-
/** Follow caption when nothing is active. */
|
|
64
|
-
followIdle: string;
|
|
65
|
-
/** Follow caption for one node. */
|
|
66
|
-
followOne: (group: string, label: string) => string;
|
|
67
|
-
/** Follow caption for several nodes. */
|
|
68
|
-
followMany: (count: number) => string;
|
|
69
|
-
}
|
|
70
|
-
declare const DEFAULT_CANVAS_LABELS: CanvasLabels;
|
|
71
|
-
interface SystemCanvasProps extends Omit<ComponentPropsWithoutRef<'div'>, 'onSelect' | 'children' | 'aria-label'> {
|
|
72
|
-
ref?: Ref<HTMLDivElement>;
|
|
73
|
-
groups: CanvasGroup[];
|
|
74
|
-
edges: CanvasEdge[];
|
|
75
|
-
/** Faint titles above each column ("Edge", "Infra", "Apps", ...), by column index. */
|
|
76
|
-
columns?: string[];
|
|
77
|
-
/** Titles of the bands in the "bands" layout, by band index. Falls back to `columns`. */
|
|
78
|
-
bands?: string[];
|
|
79
|
-
/** Default "auto". */
|
|
80
|
-
layout?: CanvasLayoutMode;
|
|
81
|
-
/** The line legend. Edges whose kind is hidden are left out of the layout and routing. */
|
|
82
|
-
edgeKinds?: CanvasEdgeKind[];
|
|
83
|
-
/** Follow mode: the view flies to where work is happening. Controlled when set. */
|
|
84
|
-
follow?: boolean;
|
|
85
|
-
onFollowChange?: (on: boolean) => void;
|
|
86
|
-
/** Overview map in a corner on viewports 600 px wide or more. Default true. */
|
|
87
|
-
minimap?: boolean;
|
|
88
|
-
selected?: string | null;
|
|
89
|
-
onSelect?: (id: string, type: 'node' | 'group') => void;
|
|
90
|
-
/** CSS height of the viewport. Default "100%". */
|
|
91
|
-
height?: string;
|
|
92
|
-
/** aria-label. Default: the `systemMap` string ("System map"). */
|
|
93
|
-
label?: string;
|
|
94
|
-
/** Text without a key in the provider's strings (follow caption, hidden-lines count). */
|
|
95
|
-
labels?: Partial<CanvasLabels>;
|
|
96
|
-
className?: string;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
/** A pannable, zoomable graph-paper canvas of grouped nodes joined by edges. Nodes with
|
|
100
|
-
* `active` pulse in their group's hue, edges into them flow, and `heat` leaves a fading
|
|
101
|
-
* glow behind. Drag or scroll to pan, ctrl+scroll or pinch to zoom, arrow keys, `+`, `-`
|
|
102
|
-
* and `0` from the keyboard. */
|
|
103
|
-
declare function SystemCanvas({ groups, edges, columns, bands, layout: layoutMode, edgeKinds, follow, onFollowChange, minimap, selected, onSelect, height, label: labelProp, labels: labelOverrides, className, style, ref: forwardedRef, ...rest }: SystemCanvasProps): react.JSX.Element;
|
|
104
|
-
|
|
105
|
-
interface CanvasLayout {
|
|
106
|
-
mode: "columns" | "bands";
|
|
107
|
-
width: number;
|
|
108
|
-
height: number;
|
|
109
|
-
/** World px above y = 0 taken by the headers: 36 in "columns" (titles sit above the cards), 0 in "bands" (titles sit inside). */
|
|
110
|
-
titleRoom: number;
|
|
111
|
-
/** Top-left of each column's ("columns") or band's ("bands") title, world px; `index` is the column or band value. */
|
|
112
|
-
headers: {
|
|
113
|
-
index: number;
|
|
114
|
-
x: number;
|
|
115
|
-
y: number;
|
|
116
|
-
}[];
|
|
117
|
-
groups: Record<string, {
|
|
118
|
-
x: number;
|
|
119
|
-
y: number;
|
|
120
|
-
w: number;
|
|
121
|
-
h: number;
|
|
122
|
-
}>;
|
|
123
|
-
nodes: Record<string, {
|
|
124
|
-
x: number;
|
|
125
|
-
y: number;
|
|
126
|
-
w: number;
|
|
127
|
-
h: number;
|
|
128
|
-
}>;
|
|
129
|
-
}
|
|
130
|
-
/** Where every group and node sits, in world units (px at zoom 1). Pure and deterministic.
|
|
131
|
-
*
|
|
132
|
-
* "columns" (default): columns are the distinct `column` values in ascending order, groups
|
|
133
|
-
* stack in the order given, nodes sit in a 2-column grid inside their group (1 column for a
|
|
134
|
-
* group of one), and each column is centered against the tallest. The first sub-column starts
|
|
135
|
-
* 60 px in and `width` includes 60 px after the last, which is room for the edge lanes
|
|
136
|
-
* outside the cards.
|
|
137
|
-
*
|
|
138
|
-
* "bands": bands are the distinct `band ?? column` values in ascending order, stacked top to
|
|
139
|
-
* bottom; each band wraps its groups (by `column`, then input order) into rows no wider than
|
|
140
|
-
* `width`. The gaps between rows grow with the number of edge ends that need lanes there. */
|
|
141
|
-
interface LayoutOptions {
|
|
142
|
-
/** Default "columns". */
|
|
143
|
-
mode?: "columns" | "bands";
|
|
144
|
-
/** "bands" only: the widest a row of groups may get, world px (at least one group per row). */
|
|
145
|
-
width?: number;
|
|
146
|
-
/** "bands" only: used to size the gaps between rows for the edge lanes. */
|
|
147
|
-
edges?: CanvasEdge[];
|
|
148
|
-
columnGap?: number;
|
|
149
|
-
rowGap?: number;
|
|
150
|
-
}
|
|
151
|
-
declare function layoutSystem(groups: CanvasGroup[], o?: LayoutOptions): CanvasLayout;
|
|
152
|
-
/** The layout to show in a viewport of `viewport` px. "columns" and "bands" use that mode;
|
|
153
|
-
* "auto" picks whichever candidate shows the map biggest. Pure and deterministic. */
|
|
154
|
-
declare function pickLayout(groups: CanvasGroup[], edges: CanvasEdge[], viewport: {
|
|
155
|
-
w: number;
|
|
156
|
-
h: number;
|
|
157
|
-
}, mode?: CanvasLayoutMode): CanvasLayout;
|
|
158
|
-
|
|
159
|
-
interface RoutedEdge {
|
|
160
|
-
id: string;
|
|
161
|
-
/** The corners of the line, source port first. Every segment is horizontal or vertical. */
|
|
162
|
-
points: [number, number][];
|
|
163
|
-
/** The same line as an SVG path with rounded corners; also valid for CSS `offset-path`. */
|
|
164
|
-
d: string;
|
|
165
|
-
/** Direction of travel of the last segment: "right" in "columns", "down" in "bands". */
|
|
166
|
-
dir: 'right' | 'down';
|
|
167
|
-
}
|
|
168
|
-
/** Routes every edge as an orthogonal line (horizontal and vertical segments, rounded corners)
|
|
169
|
-
* from the right border of its source card to the left border of its target card. A node
|
|
170
|
-
* attaches at its own center height, a group at its card's middle. Group boxes are clustered
|
|
171
|
-
* into sub-columns by x; the gaps between them (and 60 px outside the first and last) are
|
|
172
|
-
* channels, where vertical lanes run: one lane per source port (edges from a port share a
|
|
173
|
-
* trunk) and one per target port (edges into a port merge). An edge to a sub-column further
|
|
174
|
-
* right than the next travels along a horizontal corridor free of cards; backward edges and
|
|
175
|
-
* edges inside one sub-column do the same, mirrored. Two edges share a line only at a shared
|
|
176
|
-
* source or target port. Pure and deterministic; the result is keyed by edge id and skips
|
|
177
|
-
* edges with an unknown end. In a "bands" layout the same router runs on the transposed layout
|
|
178
|
-
* (x and y swapped) and the points are swapped back: lines leave the bottom border of the
|
|
179
|
-
* source card and enter the top border of the target card, and `dir` is "down". */
|
|
180
|
-
declare function routeEdges(layout: CanvasLayout, groups: CanvasGroup[], edges: CanvasEdge[]): Record<string, RoutedEdge>;
|
|
181
|
-
|
|
182
|
-
export { DEFAULT_CANVAS_LABELS as D, SystemCanvas as S, layoutSystem as l, pickLayout as p, routeEdges as r };
|
|
183
|
-
export type { CanvasEdge as C, LayoutOptions as L, RoutedEdge as R, CanvasEdgeKind as a, CanvasGroup as b, CanvasHue as c, CanvasLabels as d, CanvasLayout as e, CanvasLayoutMode as f, CanvasNode as g, CanvasNodeKind as h, SystemCanvasProps as i };
|