@nikala-ui/core 0.11.0 → 0.12.1
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/LICENSE +20 -0
- package/README.md +97 -20
- package/package.json +43 -2
- package/registry/api-table.json +21 -0
- package/registry/banner.json +1 -1
- package/registry/button.json +1 -1
- package/registry/callout.json +19 -0
- package/registry/checkbox.json +4 -1
- package/registry/code-block.json +26 -0
- package/registry/code-group.json +20 -0
- package/registry/combobox.json +1 -1
- package/registry/command.json +3 -2
- package/registry/component-viewer.json +25 -0
- package/registry/container.json +18 -0
- package/registry/context-menu.json +1 -1
- package/registry/create-app-updater.json +13 -0
- package/registry/create-document-tabs.json +13 -0
- package/registry/create-global-shortcut.json +13 -0
- package/registry/create-tauri-window.json +13 -0
- package/registry/create-tiptap-editor.json +34 -0
- package/registry/dialog.json +1 -1
- package/registry/dropdown-menu.json +3 -2
- package/registry/field.json +1 -1
- package/registry/file-tree.json +21 -0
- package/registry/footer.json +1 -1
- package/registry/form-message.json +3 -2
- package/registry/icon-button.json +1 -1
- package/registry/index.json +336 -5
- package/registry/navbar.json +1 -1
- package/registry/navigation-menu.json +1 -1
- package/registry/number-input.json +1 -1
- package/registry/package-manager-tabs.json +24 -0
- package/registry/pager.json +21 -0
- package/registry/popover.json +4 -1
- package/registry/resizable.json +1 -1
- package/registry/rich-text-editor.json +95 -0
- package/registry/scroll-area.json +1 -1
- package/registry/section-heading.json +21 -0
- package/registry/select.json +3 -2
- package/registry/sheet.json +1 -1
- package/registry/sidebar.json +1 -1
- package/registry/status.json +1 -1
- package/registry/steps.json +20 -0
- package/registry/switch.json +4 -1
- package/registry/table-of-contents.json +23 -0
- package/registry/tabs.json +4 -1
- package/registry/theme-manager.json +6 -5
- package/registry/titlebar-tabs.json +24 -0
- package/registry/titlebar.json +26 -0
- package/registry/toggle-group.json +1 -1
- package/registry/updater-modal.json +26 -0
- package/src/index.ts +48 -0
- package/src/registry/components/ui/api-table.tsx +117 -0
- package/src/registry/components/ui/banner.tsx +0 -2
- package/src/registry/components/ui/button.tsx +1 -1
- package/src/registry/components/ui/callout.tsx +137 -0
- package/src/registry/components/ui/checkbox.tsx +1 -1
- package/src/registry/components/ui/code-block.tsx +326 -0
- package/src/registry/components/ui/code-group.tsx +105 -0
- package/src/registry/components/ui/combobox.tsx +83 -18
- package/src/registry/components/ui/command.tsx +110 -106
- package/src/registry/components/ui/component-viewer.tsx +363 -0
- package/src/registry/components/ui/container.tsx +45 -0
- package/src/registry/components/ui/context-menu.tsx +67 -22
- package/src/registry/components/ui/dialog.tsx +42 -32
- package/src/registry/components/ui/dropdown-menu.tsx +69 -31
- package/src/registry/components/ui/field.tsx +7 -3
- package/src/registry/components/ui/file-tree.tsx +181 -0
- package/src/registry/components/ui/footer.tsx +1 -1
- package/src/registry/components/ui/form-message.tsx +2 -2
- package/src/registry/components/ui/icon-button.tsx +1 -1
- package/src/registry/components/ui/navbar.tsx +18 -11
- package/src/registry/components/ui/navigation-menu.tsx +2 -2
- package/src/registry/components/ui/number-input.tsx +3 -3
- package/src/registry/components/ui/package-manager-tabs.tsx +226 -0
- package/src/registry/components/ui/pager.tsx +102 -0
- package/src/registry/components/ui/popover.tsx +1 -1
- package/src/registry/components/ui/resizable.tsx +3 -1
- package/src/registry/components/ui/rich-text-editor/bubble-menu.tsx +236 -0
- package/src/registry/components/ui/rich-text-editor/editor.tsx +308 -0
- package/src/registry/components/ui/rich-text-editor/extensions.ts +116 -0
- package/src/registry/components/ui/rich-text-editor/footer.tsx +36 -0
- package/src/registry/components/ui/rich-text-editor/image-dialog.tsx +75 -0
- package/src/registry/components/ui/rich-text-editor/index.ts +11 -0
- package/src/registry/components/ui/rich-text-editor/link-dialog.tsx +48 -0
- package/src/registry/components/ui/rich-text-editor/markdown.ts +170 -0
- package/src/registry/components/ui/rich-text-editor/slash-command.tsx +301 -0
- package/src/registry/components/ui/rich-text-editor/table-controls.tsx +68 -0
- package/src/registry/components/ui/rich-text-editor/toolbar.tsx +465 -0
- package/src/registry/components/ui/rich-text-editor/use-editor.ts +231 -0
- package/src/registry/components/ui/scroll-area.tsx +12 -2
- package/src/registry/components/ui/section-heading.tsx +108 -0
- package/src/registry/components/ui/select.tsx +16 -19
- package/src/registry/components/ui/sheet.tsx +58 -53
- package/src/registry/components/ui/sidebar.tsx +4 -4
- package/src/registry/components/ui/status.tsx +7 -5
- package/src/registry/components/ui/steps.tsx +198 -0
- package/src/registry/components/ui/switch.tsx +1 -1
- package/src/registry/components/ui/table-of-contents.tsx +131 -0
- package/src/registry/components/ui/tabs.tsx +1 -1
- package/src/registry/components/ui/theme-toggle.tsx +175 -139
- package/src/registry/components/ui/titlebar-tabs.tsx +773 -0
- package/src/registry/components/ui/titlebar.tsx +468 -0
- package/src/registry/components/ui/toggle-group.tsx +1 -1
- package/src/registry/components/ui/updater-modal.tsx +254 -0
- package/src/registry/metadata.ts +167 -6
- package/src/registry/providers/theme-provider.tsx +16 -8
- package/src/registry/providers/theme-script.tsx +29 -9
- package/src/registry/providers/theme-transitions.ts +81 -50
|
@@ -26,8 +26,25 @@ function ensureTransitionStyles() {
|
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
+
/**
|
|
30
|
+
* Checks whether the current environment is Linux WebKitGTK (e.g. Tauri on Linux)
|
|
31
|
+
* where CSS View Transitions pseudo-element animations trigger known WebProcess crashes.
|
|
32
|
+
*/
|
|
33
|
+
function isLinuxWebKit(): boolean {
|
|
34
|
+
if (typeof navigator === "undefined") return false;
|
|
35
|
+
const ua = navigator.userAgent || "";
|
|
36
|
+
const isLinux = /linux/i.test(ua);
|
|
37
|
+
const isWebKit = /applewebkit/i.test(ua);
|
|
38
|
+
const isChrome = /chrome|chromium|edg/i.test(ua);
|
|
39
|
+
const isTauri = typeof window !== "undefined" && typeof (window as any).__TAURI_INTERNALS__ !== "undefined";
|
|
40
|
+
|
|
41
|
+
return isLinux && ((isWebKit && !isChrome) || isTauri);
|
|
42
|
+
}
|
|
43
|
+
|
|
29
44
|
/**
|
|
30
45
|
* Executes a theme change with the specified transition effect using the Web View Transitions API.
|
|
46
|
+
* Supported on modern browsers, Windows (Tauri WebView2), and macOS (Tauri WKWebView).
|
|
47
|
+
* Automatically falls back to safe instant transitions on Linux WebKitGTK.
|
|
31
48
|
*
|
|
32
49
|
* @param effect - Desired transition animation ("none", "circular", "fade")
|
|
33
50
|
* @param event - Mouse or Pointer event to calculate transition center coordinates
|
|
@@ -38,12 +55,14 @@ export function runThemeTransition(
|
|
|
38
55
|
event: MouseEvent | undefined,
|
|
39
56
|
updateThemeCallback: () => void
|
|
40
57
|
) {
|
|
41
|
-
// Safe fallback if View Transitions API is unsupported
|
|
58
|
+
// Safe fallback if View Transitions API is unsupported, reduced motion is preferred,
|
|
59
|
+
// or on Linux WebKitGTK where pseudo-element clipping transitions trigger WebProcess faults
|
|
42
60
|
if (
|
|
43
61
|
effect === "none" ||
|
|
44
62
|
typeof document === "undefined" ||
|
|
45
63
|
!(document as any).startViewTransition ||
|
|
46
|
-
window.matchMedia("(prefers-reduced-motion: reduce)").matches
|
|
64
|
+
window.matchMedia("(prefers-reduced-motion: reduce)").matches ||
|
|
65
|
+
isLinuxWebKit()
|
|
47
66
|
) {
|
|
48
67
|
updateThemeCallback();
|
|
49
68
|
return;
|
|
@@ -51,58 +70,70 @@ export function runThemeTransition(
|
|
|
51
70
|
|
|
52
71
|
ensureTransitionStyles();
|
|
53
72
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
73
|
+
try {
|
|
74
|
+
// Circular expanding ripple transition originating from click coordinates
|
|
75
|
+
if (effect === "circular" && event) {
|
|
76
|
+
const x = event.clientX;
|
|
77
|
+
const y = event.clientY;
|
|
58
78
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
79
|
+
const endRadius = Math.hypot(
|
|
80
|
+
Math.max(x, window.innerWidth - x),
|
|
81
|
+
Math.max(y, window.innerHeight - y)
|
|
82
|
+
);
|
|
63
83
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
84
|
+
const transition = (document as any).startViewTransition(() => {
|
|
85
|
+
updateThemeCallback();
|
|
86
|
+
});
|
|
67
87
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
88
|
+
transition.ready
|
|
89
|
+
?.then(() => {
|
|
90
|
+
document.documentElement.animate(
|
|
91
|
+
{
|
|
92
|
+
clipPath: [
|
|
93
|
+
`circle(0px at ${x}px ${y}px)`,
|
|
94
|
+
`circle(${endRadius}px at ${x}px ${y}px)`,
|
|
95
|
+
],
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
duration: 500,
|
|
99
|
+
easing: "ease-in-out",
|
|
100
|
+
pseudoElement: "::view-transition-new(root)",
|
|
101
|
+
}
|
|
102
|
+
);
|
|
103
|
+
})
|
|
104
|
+
?.catch(() => {
|
|
105
|
+
// Graceful fallback
|
|
106
|
+
});
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
85
109
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
110
|
+
// Smooth opacity fade view transition
|
|
111
|
+
if (effect === "fade") {
|
|
112
|
+
const transition = (document as any).startViewTransition(() => {
|
|
113
|
+
updateThemeCallback();
|
|
114
|
+
});
|
|
91
115
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
116
|
+
transition.ready
|
|
117
|
+
?.then(() => {
|
|
118
|
+
document.documentElement.animate(
|
|
119
|
+
{
|
|
120
|
+
opacity: [0, 1],
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
duration: 350,
|
|
124
|
+
easing: "ease-in-out",
|
|
125
|
+
pseudoElement: "::view-transition-new(root)",
|
|
126
|
+
}
|
|
127
|
+
);
|
|
128
|
+
})
|
|
129
|
+
?.catch(() => {
|
|
130
|
+
// Graceful fallback
|
|
131
|
+
});
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
106
134
|
|
|
107
|
-
|
|
135
|
+
updateThemeCallback();
|
|
136
|
+
} catch {
|
|
137
|
+
updateThemeCallback();
|
|
138
|
+
}
|
|
108
139
|
}
|