nish-ui 3.0.0 → 3.1.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 -5
- package/dist/chart.d.ts +8 -3
- package/dist/chart.js +2 -417
- package/dist/elements-all.js +71 -70
- package/dist/elements-charts.d.ts +7 -1
- package/dist/elements-charts.js +16 -16
- package/dist/elements-data.d.ts +7 -1
- package/dist/elements-data.js +5 -5
- package/dist/elements-forms.d.ts +7 -1
- package/dist/elements-forms.js +18 -17
- package/dist/elements.d.ts +7 -1
- package/dist/elements.js +4 -4
- package/dist/esm/components/avatar.js +2 -2
- package/dist/esm/components/canvas/legend.js +4 -4
- package/dist/esm/components/canvas/system-canvas.js +24 -1
- package/dist/esm/components/carousel.js +21 -3
- package/dist/esm/components/charts.js +21 -13
- package/dist/esm/components/combobox.js +1 -1
- package/dist/esm/components/data-classes.js +5 -4
- package/dist/esm/components/data.js +1 -5
- package/dist/esm/components/date-picker.js +1 -0
- package/dist/esm/components/date-range-picker.js +1 -0
- package/dist/esm/components/display.js +3 -3
- package/dist/esm/components/file-dropzone.js +21 -1
- package/dist/esm/components/filters.js +3 -1
- package/dist/esm/components/flow.js +12 -11
- package/dist/esm/components/forms.js +24 -2
- package/dist/esm/components/hooks.js +20 -17
- package/dist/esm/components/inbox.js +9 -7
- package/dist/esm/components/layout-vars.js +10 -7
- package/dist/esm/components/menu.js +7 -4
- package/dist/esm/components/multi-select.js +7 -4
- package/dist/esm/components/overlay-core.js +31 -10
- package/dist/esm/components/overlay-dialog.js +17 -2
- package/dist/esm/components/pagination.js +4 -1
- package/dist/esm/components/popover.js +15 -9
- package/dist/esm/components/primitives.js +1 -1
- package/dist/esm/components/progress.js +2 -0
- package/dist/esm/components/resource-classes.js +34 -16
- package/dist/esm/components/resource.js +5 -4
- package/dist/esm/components/settings.js +4 -2
- package/dist/esm/components/slider.js +1 -0
- package/dist/esm/components/strings.js +9 -1
- package/dist/esm/components/tag-input.js +15 -7
- package/dist/esm/components/time-field-classes.js +5 -2
- package/dist/esm/components/time-field.js +15 -7
- package/dist/esm/components/tooltip.js +1 -1
- package/dist/esm/components/url-state.js +1 -0
- package/dist/esm/components/virtual-table.js +8 -2
- package/dist/esm/components/virtual.js +16 -2
- package/dist/esm/format.js +17 -14
- package/dist/esm/runtime.js +1 -1
- package/dist/esm/server/inbox/client.js +1 -1
- package/dist/esm/theme.js +66 -6
- package/dist/format.js +18 -15
- package/dist/inbox-client.js +1 -1
- package/dist/index.d.ts +32 -7
- package/dist/nish-components.css +41 -1
- package/dist/nish-components.min.css +1 -1
- package/dist/node/th-check.js +12 -3
- package/dist/server/hono.d.ts +1 -1
- package/dist/server/hono.js +20 -1
- package/dist/server/index.d.ts +2 -2
- package/dist/server/index.js +19 -5
- package/dist/{spa-BLlMc0eI.d.ts → spa-7myD4xvA.d.ts} +3 -2
- package/dist/system-canvas.d.ts +0 -4
- package/dist/theme.d.ts +20 -2
- package/dist/theme.global.js +67 -7
- package/dist/theme.js +67 -7
- package/package.json +1 -1
package/dist/system-canvas.d.ts
CHANGED
|
@@ -96,10 +96,6 @@ interface SystemCanvasProps extends Omit<ComponentPropsWithoutRef<'div'>, 'onSel
|
|
|
96
96
|
className?: string;
|
|
97
97
|
}
|
|
98
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
99
|
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
100
|
|
|
105
101
|
interface CanvasLayout {
|
package/dist/theme.d.ts
CHANGED
|
@@ -213,6 +213,20 @@ interface NishStrings {
|
|
|
213
213
|
offlineBadge: string;
|
|
214
214
|
/** FlowSteps: group label. */
|
|
215
215
|
progress: string;
|
|
216
|
+
/** AgentNode: spoken state word. */
|
|
217
|
+
agentQueued: string;
|
|
218
|
+
/** AgentNode: spoken state word. */
|
|
219
|
+
agentRunning: string;
|
|
220
|
+
/** AgentNode: spoken state word. */
|
|
221
|
+
agentDone: string;
|
|
222
|
+
/** AgentNode: spoken state word. */
|
|
223
|
+
agentFailed: string;
|
|
224
|
+
/** FlowSteps: hidden text appended to a finished step. */
|
|
225
|
+
stepDone: string;
|
|
226
|
+
/** FlowSteps: hidden text appended to a failed step. */
|
|
227
|
+
stepFailed: string;
|
|
228
|
+
/** ResponsiveTable: label of the sort-direction button, from the current direction. */
|
|
229
|
+
sortToggle: (dir: 'asc' | 'desc' | null) => string;
|
|
216
230
|
/** WorkflowBoard: group label. */
|
|
217
231
|
workflow: string;
|
|
218
232
|
/** ActivityFeed: group label. */
|
|
@@ -283,6 +297,8 @@ interface NishStrings {
|
|
|
283
297
|
breadcrumbs: string;
|
|
284
298
|
/** TagInput: remove button aria label. */
|
|
285
299
|
removeTag: (tag: string) => string;
|
|
300
|
+
/** TagInput: shown when a tag is refused because the limit is reached. */
|
|
301
|
+
maxTags: (max: number) => string;
|
|
286
302
|
/** FileDropzone: drop area text. */
|
|
287
303
|
dropzoneLabel: string;
|
|
288
304
|
/** FileDropzone: browse button. */
|
|
@@ -470,8 +486,10 @@ interface MountScrollspyOptions {
|
|
|
470
486
|
* has passed the offset, the first one at the top of the page), is scrolled into view
|
|
471
487
|
* inside the nav, and the nav gets `data-at-start` / `data-at-end` for its edge fades.
|
|
472
488
|
* Publishes the nav's height as `--nish-sticky-extra` so `.nish-scroll-target` clears it.
|
|
473
|
-
* Returns a function that removes everything. */
|
|
474
|
-
declare function mountScrollspy(nav: HTMLElement, o?: MountScrollspyOptions): () => void
|
|
489
|
+
* Returns a function that removes everything; its `lock(id)` keeps that section's link current until the user scrolls. */
|
|
490
|
+
declare function mountScrollspy(nav: HTMLElement, o?: MountScrollspyOptions): (() => void) & {
|
|
491
|
+
lock: (id: string) => void;
|
|
492
|
+
};
|
|
475
493
|
/** Persist a checklist: the `input[type=checkbox]` inside each `li[data-id]` of `list` is
|
|
476
494
|
* saved to localStorage under `list.dataset.store` (a JSON array of checked ids) and
|
|
477
495
|
* restored now. Updates the `.nish-checklist-progress` element before the list (or the
|
package/dist/theme.global.js
CHANGED
|
@@ -314,7 +314,7 @@ var nishTheme = (() => {
|
|
|
314
314
|
var DEFAULT_THEME = "dark";
|
|
315
315
|
|
|
316
316
|
// src/runtime.ts
|
|
317
|
-
var version = true ? "3.
|
|
317
|
+
var version = true ? "3.1.0" : "dev";
|
|
318
318
|
var KEY = /* @__PURE__ */ Symbol.for("nish-ui.runtime.v1");
|
|
319
319
|
function runtime() {
|
|
320
320
|
var _a;
|
|
@@ -1033,7 +1033,8 @@ var nishTheme = (() => {
|
|
|
1033
1033
|
};
|
|
1034
1034
|
}
|
|
1035
1035
|
function mountScrollspy(nav, o = {}) {
|
|
1036
|
-
|
|
1036
|
+
const noop = Object.assign(() => void 0, { lock: (_id) => void 0 });
|
|
1037
|
+
if (typeof document === "undefined") return noop;
|
|
1037
1038
|
const links = Array.from(nav.querySelectorAll('a[href^="#"]')).filter((a) => a.hash.length > 1);
|
|
1038
1039
|
const target = (a) => {
|
|
1039
1040
|
try {
|
|
@@ -1044,13 +1045,16 @@ var nishTheme = (() => {
|
|
|
1044
1045
|
};
|
|
1045
1046
|
const unheight = o.height === false ? () => void 0 : mountHeightVar(nav, "--nish-sticky-extra");
|
|
1046
1047
|
let current = null;
|
|
1048
|
+
let locked = null;
|
|
1049
|
+
let unlockListeners = null;
|
|
1047
1050
|
const edges = () => {
|
|
1048
1051
|
const max = nav.scrollWidth - nav.clientWidth;
|
|
1049
|
-
|
|
1050
|
-
nav.dataset.
|
|
1052
|
+
const left = getComputedStyle(nav).direction === "rtl" ? nav.scrollLeft + max : nav.scrollLeft;
|
|
1053
|
+
nav.dataset.atStart = String(left <= 1);
|
|
1054
|
+
nav.dataset.atEnd = String(max <= 1 || left >= max - 1);
|
|
1051
1055
|
};
|
|
1052
1056
|
const reveal = (a) => {
|
|
1053
|
-
const left = a.
|
|
1057
|
+
const left = a.getBoundingClientRect().left - nav.getBoundingClientRect().left + nav.scrollLeft - nav.clientLeft;
|
|
1054
1058
|
const view = nav.clientWidth;
|
|
1055
1059
|
if (left < nav.scrollLeft + 24) nav.scrollLeft = Math.max(0, left - 24);
|
|
1056
1060
|
else if (left + a.offsetWidth > nav.scrollLeft + view - 24) nav.scrollLeft = left + a.offsetWidth - view + 24;
|
|
@@ -1077,7 +1081,61 @@ var nishTheme = (() => {
|
|
|
1077
1081
|
if (window.innerHeight + window.scrollY >= de.scrollHeight - 2) {
|
|
1078
1082
|
for (const a of links) if (target(a)) found = a;
|
|
1079
1083
|
}
|
|
1080
|
-
activate(found);
|
|
1084
|
+
activate(locked != null ? locked : found);
|
|
1085
|
+
};
|
|
1086
|
+
const unlock = () => {
|
|
1087
|
+
unlockListeners == null ? void 0 : unlockListeners();
|
|
1088
|
+
unlockListeners = null;
|
|
1089
|
+
locked = null;
|
|
1090
|
+
};
|
|
1091
|
+
const lock = (id) => {
|
|
1092
|
+
const a = links.find((l) => {
|
|
1093
|
+
try {
|
|
1094
|
+
return decodeURIComponent(l.hash.slice(1)) === id;
|
|
1095
|
+
} catch (e) {
|
|
1096
|
+
return false;
|
|
1097
|
+
}
|
|
1098
|
+
});
|
|
1099
|
+
if (!a) return;
|
|
1100
|
+
unlock();
|
|
1101
|
+
locked = a;
|
|
1102
|
+
activate(a);
|
|
1103
|
+
const release = () => {
|
|
1104
|
+
unlock();
|
|
1105
|
+
schedule();
|
|
1106
|
+
};
|
|
1107
|
+
const onKey = (e) => {
|
|
1108
|
+
if (["ArrowUp", "ArrowDown", "PageUp", "PageDown", "Home", "End", " "].includes(e.key)) release();
|
|
1109
|
+
};
|
|
1110
|
+
let settled = false;
|
|
1111
|
+
const settle = () => {
|
|
1112
|
+
settled = true;
|
|
1113
|
+
};
|
|
1114
|
+
let t = setTimeout(settle, 400);
|
|
1115
|
+
const onScroll = () => {
|
|
1116
|
+
if (settled) release();
|
|
1117
|
+
else {
|
|
1118
|
+
clearTimeout(t);
|
|
1119
|
+
t = setTimeout(settle, 200);
|
|
1120
|
+
}
|
|
1121
|
+
};
|
|
1122
|
+
const onScrollEnd = () => {
|
|
1123
|
+
clearTimeout(t);
|
|
1124
|
+
t = setTimeout(settle, 50);
|
|
1125
|
+
};
|
|
1126
|
+
window.addEventListener("wheel", release, { passive: true });
|
|
1127
|
+
window.addEventListener("touchstart", release, { passive: true });
|
|
1128
|
+
window.addEventListener("keydown", onKey);
|
|
1129
|
+
window.addEventListener("scroll", onScroll, { passive: true });
|
|
1130
|
+
window.addEventListener("scrollend", onScrollEnd);
|
|
1131
|
+
unlockListeners = () => {
|
|
1132
|
+
clearTimeout(t);
|
|
1133
|
+
window.removeEventListener("wheel", release);
|
|
1134
|
+
window.removeEventListener("touchstart", release);
|
|
1135
|
+
window.removeEventListener("keydown", onKey);
|
|
1136
|
+
window.removeEventListener("scroll", onScroll);
|
|
1137
|
+
window.removeEventListener("scrollend", onScrollEnd);
|
|
1138
|
+
};
|
|
1081
1139
|
};
|
|
1082
1140
|
let frame = 0;
|
|
1083
1141
|
const schedule = () => {
|
|
@@ -1105,7 +1163,8 @@ var nishTheme = (() => {
|
|
|
1105
1163
|
});
|
|
1106
1164
|
ro.observe(nav);
|
|
1107
1165
|
}
|
|
1108
|
-
|
|
1166
|
+
const stop = () => {
|
|
1167
|
+
unlock();
|
|
1109
1168
|
if (frame) cancelAnimationFrame(frame);
|
|
1110
1169
|
window.removeEventListener("scroll", schedule);
|
|
1111
1170
|
window.removeEventListener("resize", schedule);
|
|
@@ -1117,6 +1176,7 @@ var nishTheme = (() => {
|
|
|
1117
1176
|
delete nav.dataset.atStart;
|
|
1118
1177
|
delete nav.dataset.atEnd;
|
|
1119
1178
|
};
|
|
1179
|
+
return Object.assign(stop, { lock });
|
|
1120
1180
|
}
|
|
1121
1181
|
function mountChecklist(list) {
|
|
1122
1182
|
var _a, _b, _c;
|
package/dist/theme.js
CHANGED
|
@@ -264,7 +264,7 @@ var THEMES = /* @__PURE__ */ Object.fromEntries(
|
|
|
264
264
|
var DEFAULT_THEME = "dark";
|
|
265
265
|
|
|
266
266
|
// src/runtime.ts
|
|
267
|
-
var version = true ? "3.
|
|
267
|
+
var version = true ? "3.1.0" : "dev";
|
|
268
268
|
var KEY = /* @__PURE__ */ Symbol.for("nish-ui.runtime.v1");
|
|
269
269
|
function runtime() {
|
|
270
270
|
const g = globalThis;
|
|
@@ -981,7 +981,8 @@ function mountStuck(el, onChange) {
|
|
|
981
981
|
};
|
|
982
982
|
}
|
|
983
983
|
function mountScrollspy(nav, o = {}) {
|
|
984
|
-
|
|
984
|
+
const noop = Object.assign(() => void 0, { lock: (_id) => void 0 });
|
|
985
|
+
if (typeof document === "undefined") return noop;
|
|
985
986
|
const links = Array.from(nav.querySelectorAll('a[href^="#"]')).filter((a) => a.hash.length > 1);
|
|
986
987
|
const target = (a) => {
|
|
987
988
|
try {
|
|
@@ -992,13 +993,16 @@ function mountScrollspy(nav, o = {}) {
|
|
|
992
993
|
};
|
|
993
994
|
const unheight = o.height === false ? () => void 0 : mountHeightVar(nav, "--nish-sticky-extra");
|
|
994
995
|
let current = null;
|
|
996
|
+
let locked = null;
|
|
997
|
+
let unlockListeners = null;
|
|
995
998
|
const edges = () => {
|
|
996
999
|
const max = nav.scrollWidth - nav.clientWidth;
|
|
997
|
-
|
|
998
|
-
nav.dataset.
|
|
1000
|
+
const left = getComputedStyle(nav).direction === "rtl" ? nav.scrollLeft + max : nav.scrollLeft;
|
|
1001
|
+
nav.dataset.atStart = String(left <= 1);
|
|
1002
|
+
nav.dataset.atEnd = String(max <= 1 || left >= max - 1);
|
|
999
1003
|
};
|
|
1000
1004
|
const reveal = (a) => {
|
|
1001
|
-
const left = a.
|
|
1005
|
+
const left = a.getBoundingClientRect().left - nav.getBoundingClientRect().left + nav.scrollLeft - nav.clientLeft;
|
|
1002
1006
|
const view = nav.clientWidth;
|
|
1003
1007
|
if (left < nav.scrollLeft + 24) nav.scrollLeft = Math.max(0, left - 24);
|
|
1004
1008
|
else if (left + a.offsetWidth > nav.scrollLeft + view - 24) nav.scrollLeft = left + a.offsetWidth - view + 24;
|
|
@@ -1024,7 +1028,61 @@ function mountScrollspy(nav, o = {}) {
|
|
|
1024
1028
|
if (window.innerHeight + window.scrollY >= de.scrollHeight - 2) {
|
|
1025
1029
|
for (const a of links) if (target(a)) found = a;
|
|
1026
1030
|
}
|
|
1027
|
-
activate(found);
|
|
1031
|
+
activate(locked ?? found);
|
|
1032
|
+
};
|
|
1033
|
+
const unlock = () => {
|
|
1034
|
+
unlockListeners?.();
|
|
1035
|
+
unlockListeners = null;
|
|
1036
|
+
locked = null;
|
|
1037
|
+
};
|
|
1038
|
+
const lock = (id) => {
|
|
1039
|
+
const a = links.find((l) => {
|
|
1040
|
+
try {
|
|
1041
|
+
return decodeURIComponent(l.hash.slice(1)) === id;
|
|
1042
|
+
} catch {
|
|
1043
|
+
return false;
|
|
1044
|
+
}
|
|
1045
|
+
});
|
|
1046
|
+
if (!a) return;
|
|
1047
|
+
unlock();
|
|
1048
|
+
locked = a;
|
|
1049
|
+
activate(a);
|
|
1050
|
+
const release = () => {
|
|
1051
|
+
unlock();
|
|
1052
|
+
schedule();
|
|
1053
|
+
};
|
|
1054
|
+
const onKey = (e) => {
|
|
1055
|
+
if (["ArrowUp", "ArrowDown", "PageUp", "PageDown", "Home", "End", " "].includes(e.key)) release();
|
|
1056
|
+
};
|
|
1057
|
+
let settled = false;
|
|
1058
|
+
const settle = () => {
|
|
1059
|
+
settled = true;
|
|
1060
|
+
};
|
|
1061
|
+
let t = setTimeout(settle, 400);
|
|
1062
|
+
const onScroll = () => {
|
|
1063
|
+
if (settled) release();
|
|
1064
|
+
else {
|
|
1065
|
+
clearTimeout(t);
|
|
1066
|
+
t = setTimeout(settle, 200);
|
|
1067
|
+
}
|
|
1068
|
+
};
|
|
1069
|
+
const onScrollEnd = () => {
|
|
1070
|
+
clearTimeout(t);
|
|
1071
|
+
t = setTimeout(settle, 50);
|
|
1072
|
+
};
|
|
1073
|
+
window.addEventListener("wheel", release, { passive: true });
|
|
1074
|
+
window.addEventListener("touchstart", release, { passive: true });
|
|
1075
|
+
window.addEventListener("keydown", onKey);
|
|
1076
|
+
window.addEventListener("scroll", onScroll, { passive: true });
|
|
1077
|
+
window.addEventListener("scrollend", onScrollEnd);
|
|
1078
|
+
unlockListeners = () => {
|
|
1079
|
+
clearTimeout(t);
|
|
1080
|
+
window.removeEventListener("wheel", release);
|
|
1081
|
+
window.removeEventListener("touchstart", release);
|
|
1082
|
+
window.removeEventListener("keydown", onKey);
|
|
1083
|
+
window.removeEventListener("scroll", onScroll);
|
|
1084
|
+
window.removeEventListener("scrollend", onScrollEnd);
|
|
1085
|
+
};
|
|
1028
1086
|
};
|
|
1029
1087
|
let frame = 0;
|
|
1030
1088
|
const schedule = () => {
|
|
@@ -1052,7 +1110,8 @@ function mountScrollspy(nav, o = {}) {
|
|
|
1052
1110
|
});
|
|
1053
1111
|
ro.observe(nav);
|
|
1054
1112
|
}
|
|
1055
|
-
|
|
1113
|
+
const stop = () => {
|
|
1114
|
+
unlock();
|
|
1056
1115
|
if (frame) cancelAnimationFrame(frame);
|
|
1057
1116
|
window.removeEventListener("scroll", schedule);
|
|
1058
1117
|
window.removeEventListener("resize", schedule);
|
|
@@ -1064,6 +1123,7 @@ function mountScrollspy(nav, o = {}) {
|
|
|
1064
1123
|
delete nav.dataset.atStart;
|
|
1065
1124
|
delete nav.dataset.atEnd;
|
|
1066
1125
|
};
|
|
1126
|
+
return Object.assign(stop, { lock });
|
|
1067
1127
|
}
|
|
1068
1128
|
function mountChecklist(list) {
|
|
1069
1129
|
if (typeof document === "undefined") return () => void 0;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nish-ui",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"description": "Design tokens, seven themes, flash-free theme switching and accessible React 19 components for Tailwind 4, plain CSS and static HTML. Live docs: https://design.nish.software",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Nishant Arora",
|