@nikala-ui/core 0.10.1 → 0.11.0-nightly.b01fa01

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.
Files changed (106) hide show
  1. package/package.json +1 -1
  2. package/registry/banner.json +1 -1
  3. package/registry/bubble.json +18 -0
  4. package/registry/button-group.json +20 -0
  5. package/registry/button.json +1 -1
  6. package/registry/checkbox.json +4 -1
  7. package/registry/combobox.json +1 -1
  8. package/registry/command.json +3 -2
  9. package/registry/context-menu.json +1 -1
  10. package/registry/create-app-updater.json +13 -0
  11. package/registry/create-chat-scroll.json +13 -0
  12. package/registry/create-document-tabs.json +13 -0
  13. package/registry/create-drop-zone.json +13 -0
  14. package/registry/create-global-shortcut.json +13 -0
  15. package/registry/create-pagination.json +13 -0
  16. package/registry/create-tauri-window.json +13 -0
  17. package/registry/dialog.json +1 -1
  18. package/registry/dropdown-menu.json +3 -2
  19. package/registry/dropzone.json +21 -0
  20. package/registry/field.json +1 -1
  21. package/registry/footer.json +18 -0
  22. package/registry/forgot-password-01.json +28 -0
  23. package/registry/form-message.json +3 -2
  24. package/registry/hero-01.json +22 -0
  25. package/registry/icon-button.json +1 -1
  26. package/registry/index.json +432 -5
  27. package/registry/login-01.json +28 -0
  28. package/registry/marker.json +17 -0
  29. package/registry/marquee.json +17 -0
  30. package/registry/message.json +17 -0
  31. package/registry/navbar.json +19 -0
  32. package/registry/navigation-menu.json +22 -0
  33. package/registry/number-input.json +1 -1
  34. package/registry/otp-verification-01.json +26 -0
  35. package/registry/pagination.json +22 -0
  36. package/registry/popover.json +4 -1
  37. package/registry/rating.json +19 -0
  38. package/registry/register-01.json +31 -0
  39. package/registry/resizable.json +1 -1
  40. package/registry/review-card.json +23 -0
  41. package/registry/scroll-area.json +1 -1
  42. package/registry/select.json +3 -2
  43. package/registry/sheet.json +1 -1
  44. package/registry/sidebar.json +24 -0
  45. package/registry/spinner.json +1 -1
  46. package/registry/stat.json +19 -0
  47. package/registry/status.json +1 -1
  48. package/registry/switch.json +4 -1
  49. package/registry/table.json +17 -0
  50. package/registry/tabs.json +4 -1
  51. package/registry/theme-manager.json +4 -3
  52. package/registry/timeline.json +18 -0
  53. package/registry/titlebar-tabs.json +24 -0
  54. package/registry/titlebar.json +26 -0
  55. package/registry/toggle-group.json +21 -0
  56. package/registry/updater-modal.json +26 -0
  57. package/src/registry/blocks/forgot-password-01.tsx +141 -0
  58. package/src/registry/blocks/hero-01.tsx +28 -0
  59. package/src/registry/blocks/login-01.tsx +231 -0
  60. package/src/registry/blocks/otp-verification-01.tsx +170 -0
  61. package/src/registry/blocks/register-01.tsx +318 -0
  62. package/src/registry/components/ui/banner.tsx +0 -2
  63. package/src/registry/components/ui/bubble.tsx +142 -0
  64. package/src/registry/components/ui/button-group.tsx +42 -0
  65. package/src/registry/components/ui/button.tsx +1 -1
  66. package/src/registry/components/ui/checkbox.tsx +1 -1
  67. package/src/registry/components/ui/combobox.tsx +83 -18
  68. package/src/registry/components/ui/command.tsx +101 -105
  69. package/src/registry/components/ui/context-menu.tsx +67 -22
  70. package/src/registry/components/ui/dialog.tsx +42 -32
  71. package/src/registry/components/ui/dropdown-menu.tsx +69 -31
  72. package/src/registry/components/ui/dropzone.tsx +189 -0
  73. package/src/registry/components/ui/field.tsx +7 -3
  74. package/src/registry/components/ui/footer.tsx +247 -0
  75. package/src/registry/components/ui/form-message.tsx +2 -2
  76. package/src/registry/components/ui/icon-button.tsx +1 -1
  77. package/src/registry/components/ui/marker.tsx +102 -0
  78. package/src/registry/components/ui/marquee.tsx +118 -0
  79. package/src/registry/components/ui/message.tsx +168 -0
  80. package/src/registry/components/ui/navbar.tsx +375 -0
  81. package/src/registry/components/ui/navigation-menu.tsx +358 -0
  82. package/src/registry/components/ui/number-input.tsx +3 -3
  83. package/src/registry/components/ui/pagination.tsx +258 -0
  84. package/src/registry/components/ui/popover.tsx +1 -1
  85. package/src/registry/components/ui/rating.tsx +185 -0
  86. package/src/registry/components/ui/resizable.tsx +3 -1
  87. package/src/registry/components/ui/review-card.tsx +195 -0
  88. package/src/registry/components/ui/scroll-area.tsx +13 -3
  89. package/src/registry/components/ui/select.tsx +16 -19
  90. package/src/registry/components/ui/sheet.tsx +58 -53
  91. package/src/registry/components/ui/sidebar.tsx +692 -0
  92. package/src/registry/components/ui/spinner.tsx +1 -1
  93. package/src/registry/components/ui/stat.tsx +245 -0
  94. package/src/registry/components/ui/status.tsx +7 -5
  95. package/src/registry/components/ui/switch.tsx +1 -1
  96. package/src/registry/components/ui/table.tsx +160 -0
  97. package/src/registry/components/ui/tabs.tsx +1 -1
  98. package/src/registry/components/ui/theme-toggle.tsx +80 -79
  99. package/src/registry/components/ui/timeline.tsx +350 -0
  100. package/src/registry/components/ui/titlebar-tabs.tsx +412 -0
  101. package/src/registry/components/ui/titlebar.tsx +399 -0
  102. package/src/registry/components/ui/toggle-group.tsx +203 -0
  103. package/src/registry/components/ui/updater-modal.tsx +254 -0
  104. package/src/registry/index.ts +3 -3
  105. package/src/registry/metadata.ts +184 -5
  106. package/src/registry/providers/theme-transitions.ts +81 -50
@@ -0,0 +1,375 @@
1
+ import {
2
+ createContext,
3
+ createSignal,
4
+ useContext,
5
+ splitProps,
6
+ Show,
7
+ type JSX,
8
+ type ParentComponent,
9
+ type Component,
10
+ type Accessor,
11
+ type ValidComponent,
12
+ } from "solid-js";
13
+ import { Dynamic } from "solid-js/web";
14
+ import { cva, type VariantProps } from "class-variance-authority";
15
+ import { Menu, X } from "lucide-solid";
16
+ import { cn } from "@/lib/cn";
17
+
18
+ /* --- Navbar Context --- */
19
+ interface NavbarContextValue {
20
+ isOpen: Accessor<boolean>;
21
+ setIsOpen: (open: boolean) => void;
22
+ toggleMobileMenu: () => void;
23
+ }
24
+
25
+ const NavbarContext = createContext<NavbarContextValue>();
26
+
27
+ export function useNavbar() {
28
+ const context = useContext(NavbarContext);
29
+ if (!context) {
30
+ throw new Error("useNavbar must be used within a <Navbar /> component");
31
+ }
32
+ return context;
33
+ }
34
+
35
+ /* --- Root Navbar --- */
36
+ export const navbarVariants = cva(
37
+ "w-full transition-all duration-200 z-40",
38
+ {
39
+ variants: {
40
+ variant: {
41
+ default: "border-b border-border/60 bg-background/80 backdrop-blur-md",
42
+ floating: "my-3 rounded-lg border border-border/80 bg-background/90 backdrop-blur-md shadow-sm",
43
+ bordered: "border-b border-border bg-background",
44
+ transparent: "bg-transparent border-transparent",
45
+ },
46
+ isSticky: {
47
+ true: "sticky top-0",
48
+ false: "relative",
49
+ },
50
+ },
51
+ defaultVariants: {
52
+ variant: "default",
53
+ isSticky: true,
54
+ },
55
+ }
56
+ );
57
+
58
+ export interface NavbarProps
59
+ extends JSX.HTMLAttributes<HTMLElement>,
60
+ VariantProps<typeof navbarVariants> {
61
+ maxWidth?: "sm" | "md" | "lg" | "xl" | "2xl" | "full";
62
+ open?: boolean;
63
+ onOpenChange?: (open: boolean) => void;
64
+ }
65
+
66
+ export const Navbar: ParentComponent<NavbarProps> = (props) => {
67
+ const [local, rest] = splitProps(props, [
68
+ "class",
69
+ "variant",
70
+ "isSticky",
71
+ "maxWidth",
72
+ "open",
73
+ "onOpenChange",
74
+ "children",
75
+ ]);
76
+
77
+ const [internalOpen, setInternalOpen] = createSignal(false);
78
+ const isOpen = () => (local.open !== undefined ? local.open : internalOpen());
79
+
80
+ const setIsOpen = (open: boolean) => {
81
+ if (local.open === undefined) {
82
+ setInternalOpen(open);
83
+ }
84
+ local.onOpenChange?.(open);
85
+ };
86
+
87
+ const toggleMobileMenu = () => setIsOpen(!isOpen());
88
+
89
+ const maxWidthClass = () => {
90
+ switch (local.maxWidth) {
91
+ case "sm":
92
+ return "max-w-screen-sm";
93
+ case "md":
94
+ return "max-w-screen-md";
95
+ case "lg":
96
+ return "max-w-screen-lg";
97
+ case "xl":
98
+ return "max-w-screen-xl";
99
+ case "full":
100
+ return "max-w-full";
101
+ case "2xl":
102
+ default:
103
+ return "max-w-screen-2xl";
104
+ }
105
+ };
106
+
107
+ return (
108
+ <NavbarContext.Provider value={{ isOpen, setIsOpen, toggleMobileMenu }}>
109
+ <header
110
+ class={cn(
111
+ navbarVariants({
112
+ variant: local.variant,
113
+ isSticky: local.isSticky,
114
+ }),
115
+ local.variant === "floating" && cn("mx-auto", maxWidthClass()),
116
+ local.class
117
+ )}
118
+ {...rest}
119
+ >
120
+ <div class={cn("w-full", local.variant !== "floating" && cn("mx-auto", maxWidthClass()))}>
121
+ {local.children}
122
+ </div>
123
+ </header>
124
+ </NavbarContext.Provider>
125
+ );
126
+ };
127
+
128
+ /* --- Navbar Container (Top Flex Row) --- */
129
+ export interface NavbarContainerProps extends JSX.HTMLAttributes<HTMLDivElement> {
130
+ class?: string;
131
+ }
132
+
133
+ export const NavbarContainer: ParentComponent<NavbarContainerProps> = (props) => {
134
+ const [local, rest] = splitProps(props, ["class", "children"]);
135
+
136
+ return (
137
+ <div
138
+ class={cn(
139
+ "flex h-14 md:h-16 items-center justify-between px-4 sm:px-6 lg:px-8 gap-3 w-full",
140
+ local.class
141
+ )}
142
+ {...rest}
143
+ >
144
+ {local.children}
145
+ </div>
146
+ );
147
+ };
148
+
149
+ /* --- Navbar Brand / Logo Container --- */
150
+ export interface NavbarBrandProps<T extends ValidComponent = "a"> extends JSX.AnchorHTMLAttributes<HTMLAnchorElement> {
151
+ class?: string;
152
+ as?: T;
153
+ href?: string;
154
+ }
155
+
156
+ export const NavbarBrand = <T extends ValidComponent = "a">(props: NavbarBrandProps<T>) => {
157
+ const [local, rest] = splitProps(props as NavbarBrandProps, ["class", "as", "children"]);
158
+
159
+ return (
160
+ <Dynamic
161
+ component={local.as || "a"}
162
+ class={cn(
163
+ "flex items-center gap-2 font-bold text-foreground transition-opacity hover:opacity-90 cursor-pointer shrink-0",
164
+ local.class
165
+ )}
166
+ {...rest}
167
+ >
168
+ {local.children}
169
+ </Dynamic>
170
+ );
171
+ };
172
+
173
+ /* --- Navbar Content / Section --- */
174
+ export const navbarContentVariants = cva("flex items-center gap-1 sm:gap-2 h-full", {
175
+ variants: {
176
+ justify: {
177
+ start: "justify-start flex-1",
178
+ center: "justify-center flex-1",
179
+ end: "justify-end flex-1",
180
+ },
181
+ },
182
+ defaultVariants: {
183
+ justify: "center",
184
+ },
185
+ });
186
+
187
+ export interface NavbarContentProps
188
+ extends JSX.HTMLAttributes<HTMLDivElement>,
189
+ VariantProps<typeof navbarContentVariants> {
190
+ class?: string;
191
+ hideOnMobile?: boolean;
192
+ }
193
+
194
+ export const NavbarContent: ParentComponent<NavbarContentProps> = (props) => {
195
+ const [local, rest] = splitProps(props, ["class", "justify", "hideOnMobile", "children"]);
196
+
197
+ return (
198
+ <div
199
+ class={cn(
200
+ navbarContentVariants({ justify: local.justify }),
201
+ local.class
202
+ )}
203
+ {...rest}
204
+ >
205
+ {local.children}
206
+ </div>
207
+ );
208
+ };
209
+
210
+ /* --- Navbar Item --- */
211
+ export interface NavbarItemProps extends JSX.HTMLAttributes<HTMLDivElement> {
212
+ class?: string;
213
+ isActive?: boolean;
214
+ }
215
+
216
+ export const NavbarItem: ParentComponent<NavbarItemProps> = (props) => {
217
+ const [local, rest] = splitProps(props, ["class", "isActive", "children"]);
218
+
219
+ return (
220
+ <div
221
+ class={cn(
222
+ "relative flex items-center h-full text-sm font-medium",
223
+ local.class
224
+ )}
225
+ {...rest}
226
+ >
227
+ {local.children}
228
+ <Show when={local.isActive}>
229
+ <div class="absolute -bottom-px left-0 right-0 h-0.5 bg-primary rounded-lg z-10" />
230
+ </Show>
231
+ </div>
232
+ );
233
+ };
234
+
235
+ /* --- Navbar Link --- */
236
+ export const navbarLinkVariants = cva(
237
+ "inline-flex h-9 items-center justify-center rounded-md px-3 text-sm font-medium transition-colors cursor-pointer select-none focus-visible:outline-hidden",
238
+ {
239
+ variants: {
240
+ variant: {
241
+ default:
242
+ "text-muted-foreground hover:bg-muted hover:text-foreground",
243
+ active:
244
+ "text-foreground font-semibold bg-muted/80",
245
+ ghost:
246
+ "text-foreground hover:text-primary",
247
+ },
248
+ },
249
+ defaultVariants: {
250
+ variant: "default",
251
+ },
252
+ }
253
+ );
254
+
255
+ export interface NavbarLinkProps<T extends ValidComponent = "a">
256
+ extends JSX.AnchorHTMLAttributes<HTMLAnchorElement>,
257
+ VariantProps<typeof navbarLinkVariants> {
258
+ class?: string;
259
+ isActive?: boolean;
260
+ as?: T;
261
+ href?: string;
262
+ }
263
+
264
+ export const NavbarLink = <T extends ValidComponent = "a">(props: NavbarLinkProps<T>) => {
265
+ const [local, rest] = splitProps(props as NavbarLinkProps, ["class", "variant", "isActive", "as", "children"]);
266
+
267
+ return (
268
+ <Dynamic
269
+ component={local.as || "a"}
270
+ class={cn(
271
+ navbarLinkVariants({
272
+ variant: local.isActive ? "active" : local.variant,
273
+ }),
274
+ local.class
275
+ )}
276
+ {...rest}
277
+ >
278
+ {local.children}
279
+ </Dynamic>
280
+ );
281
+ };
282
+
283
+ /* --- Navbar Actions Container --- */
284
+ export interface NavbarActionsProps extends JSX.HTMLAttributes<HTMLDivElement> {
285
+ class?: string;
286
+ }
287
+
288
+ export const NavbarActions: ParentComponent<NavbarActionsProps> = (props) => {
289
+ const [local, rest] = splitProps(props, ["class", "children"]);
290
+
291
+ return (
292
+ <div class={cn("flex items-center gap-2 shrink-0", local.class)} {...rest}>
293
+ {local.children}
294
+ </div>
295
+ );
296
+ };
297
+
298
+ /* --- Navbar Mobile Toggle Button --- */
299
+ export interface NavbarMobileToggleProps extends JSX.ButtonHTMLAttributes<HTMLButtonElement> {
300
+ class?: string;
301
+ }
302
+
303
+ export const NavbarMobileToggle: Component<NavbarMobileToggleProps> = (props) => {
304
+ const [local, rest] = splitProps(props, ["class"]);
305
+ const { isOpen, toggleMobileMenu } = useNavbar();
306
+
307
+ return (
308
+ <button
309
+ type="button"
310
+ onClick={toggleMobileMenu}
311
+ aria-label="Toggle navigation menu"
312
+ aria-expanded={isOpen()}
313
+ class={cn(
314
+ "inline-flex md:hidden size-8 items-center justify-center rounded-md border border-border/60 bg-muted/30 text-muted-foreground hover:bg-muted hover:text-foreground transition-colors cursor-pointer focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring shrink-0",
315
+ local.class
316
+ )}
317
+ {...rest}
318
+ >
319
+ <Show when={isOpen()} fallback={<Menu class="size-4" />}>
320
+ <X class="size-4" />
321
+ </Show>
322
+ </button>
323
+ );
324
+ };
325
+
326
+ /* --- Navbar Mobile Menu Container --- */
327
+ export interface NavbarMobileMenuProps extends JSX.HTMLAttributes<HTMLDivElement> {
328
+ class?: string;
329
+ }
330
+
331
+ export const NavbarMobileMenu: ParentComponent<NavbarMobileMenuProps> = (props) => {
332
+ const [local, rest] = splitProps(props, ["class", "children"]);
333
+ const { isOpen } = useNavbar();
334
+
335
+ return (
336
+ <Show when={isOpen()}>
337
+ <div
338
+ class={cn(
339
+ "md:hidden w-full border-t border-border/60 bg-background/95 backdrop-blur-lg px-4 py-3 space-y-1 shadow-md transition-all",
340
+ local.class
341
+ )}
342
+ {...rest}
343
+ >
344
+ {local.children}
345
+ </div>
346
+ </Show>
347
+ );
348
+ };
349
+
350
+ /* --- Navbar Mobile Item & Link --- */
351
+ export interface NavbarMobileLinkProps extends JSX.AnchorHTMLAttributes<HTMLAnchorElement> {
352
+ class?: string;
353
+ isActive?: boolean;
354
+ }
355
+
356
+ export const NavbarMobileLink: ParentComponent<NavbarMobileLinkProps> = (props) => {
357
+ const [local, rest] = splitProps(props, ["class", "isActive", "children"]);
358
+ const { setIsOpen } = useNavbar();
359
+
360
+ return (
361
+ <a
362
+ onClick={() => setIsOpen(false)}
363
+ class={cn(
364
+ "flex w-full items-center justify-between rounded-md px-3 py-2 text-sm font-medium transition-colors cursor-pointer",
365
+ local.isActive
366
+ ? "bg-primary text-primary-foreground font-semibold shadow-2xs"
367
+ : "text-muted-foreground hover:bg-muted/80 hover:text-foreground",
368
+ local.class
369
+ )}
370
+ {...rest}
371
+ >
372
+ {local.children}
373
+ </a>
374
+ );
375
+ };