@nikala-ui/core 0.10.1 → 0.11.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.
Files changed (55) hide show
  1. package/package.json +1 -1
  2. package/registry/bubble.json +18 -0
  3. package/registry/button-group.json +20 -0
  4. package/registry/create-chat-scroll.json +13 -0
  5. package/registry/create-drop-zone.json +13 -0
  6. package/registry/create-pagination.json +13 -0
  7. package/registry/dropzone.json +21 -0
  8. package/registry/footer.json +18 -0
  9. package/registry/forgot-password-01.json +28 -0
  10. package/registry/hero-01.json +22 -0
  11. package/registry/index.json +331 -0
  12. package/registry/login-01.json +28 -0
  13. package/registry/marker.json +17 -0
  14. package/registry/marquee.json +17 -0
  15. package/registry/message.json +17 -0
  16. package/registry/navbar.json +19 -0
  17. package/registry/navigation-menu.json +22 -0
  18. package/registry/otp-verification-01.json +26 -0
  19. package/registry/pagination.json +22 -0
  20. package/registry/rating.json +19 -0
  21. package/registry/register-01.json +31 -0
  22. package/registry/review-card.json +23 -0
  23. package/registry/scroll-area.json +1 -1
  24. package/registry/sidebar.json +24 -0
  25. package/registry/spinner.json +1 -1
  26. package/registry/stat.json +19 -0
  27. package/registry/table.json +17 -0
  28. package/registry/timeline.json +18 -0
  29. package/registry/toggle-group.json +21 -0
  30. package/src/registry/blocks/forgot-password-01.tsx +141 -0
  31. package/src/registry/blocks/hero-01.tsx +28 -0
  32. package/src/registry/blocks/login-01.tsx +231 -0
  33. package/src/registry/blocks/otp-verification-01.tsx +170 -0
  34. package/src/registry/blocks/register-01.tsx +318 -0
  35. package/src/registry/components/ui/bubble.tsx +142 -0
  36. package/src/registry/components/ui/button-group.tsx +42 -0
  37. package/src/registry/components/ui/dropzone.tsx +189 -0
  38. package/src/registry/components/ui/footer.tsx +247 -0
  39. package/src/registry/components/ui/marker.tsx +102 -0
  40. package/src/registry/components/ui/marquee.tsx +118 -0
  41. package/src/registry/components/ui/message.tsx +168 -0
  42. package/src/registry/components/ui/navbar.tsx +368 -0
  43. package/src/registry/components/ui/navigation-menu.tsx +358 -0
  44. package/src/registry/components/ui/pagination.tsx +258 -0
  45. package/src/registry/components/ui/rating.tsx +185 -0
  46. package/src/registry/components/ui/review-card.tsx +195 -0
  47. package/src/registry/components/ui/scroll-area.tsx +2 -2
  48. package/src/registry/components/ui/sidebar.tsx +692 -0
  49. package/src/registry/components/ui/spinner.tsx +1 -1
  50. package/src/registry/components/ui/stat.tsx +245 -0
  51. package/src/registry/components/ui/table.tsx +160 -0
  52. package/src/registry/components/ui/timeline.tsx +350 -0
  53. package/src/registry/components/ui/toggle-group.tsx +203 -0
  54. package/src/registry/index.ts +3 -3
  55. package/src/registry/metadata.ts +141 -0
@@ -0,0 +1,245 @@
1
+ import {
2
+ splitProps,
3
+ type JSX,
4
+ type ParentComponent,
5
+ } from "solid-js";
6
+ import { cva, type VariantProps } from "class-variance-authority";
7
+ import { TrendingUp, TrendingDown, Minus } from "lucide-solid";
8
+ import { cn } from "@/lib/cn";
9
+
10
+ /* --- 1. Stat Group (Container Grid) --- */
11
+ export interface StatGroupProps extends JSX.HTMLAttributes<HTMLDivElement> {
12
+ class?: string;
13
+ columns?: 1 | 2 | 3 | 4 | 5;
14
+ }
15
+
16
+ export const StatGroup: ParentComponent<StatGroupProps> = (props) => {
17
+ const [local, rest] = splitProps(props, ["class", "columns", "children"]);
18
+
19
+ const columnClass = () => {
20
+ switch (local.columns) {
21
+ case 1:
22
+ return "grid-cols-1";
23
+ case 2:
24
+ return "grid-cols-1 sm:grid-cols-2";
25
+ case 3:
26
+ return "grid-cols-1 sm:grid-cols-2 lg:grid-cols-3";
27
+ case 5:
28
+ return "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-5";
29
+ case 4:
30
+ default:
31
+ return "grid-cols-1 sm:grid-cols-2 lg:grid-cols-4";
32
+ }
33
+ };
34
+
35
+ return (
36
+ <div
37
+ class={cn("grid gap-4 sm:gap-5 w-full", columnClass(), local.class)}
38
+ {...rest}
39
+ >
40
+ {local.children}
41
+ </div>
42
+ );
43
+ };
44
+
45
+ /* --- 2. Stat Root Card --- */
46
+ export const statVariants = cva(
47
+ "relative flex flex-col justify-between rounded-lg transition-all duration-200",
48
+ {
49
+ variants: {
50
+ variant: {
51
+ default: "border border-border bg-card text-card-foreground p-4 sm:p-5 shadow-2xs space-y-2",
52
+ flat: "bg-muted/40 text-foreground p-4 sm:p-5 space-y-2",
53
+ bordered: "border-2 border-border bg-background text-foreground p-4 sm:p-5 space-y-2",
54
+ ghost: "bg-transparent text-foreground p-2 space-y-1",
55
+ },
56
+ },
57
+ defaultVariants: {
58
+ variant: "default",
59
+ },
60
+ }
61
+ );
62
+
63
+ export interface StatProps
64
+ extends JSX.HTMLAttributes<HTMLDivElement>,
65
+ VariantProps<typeof statVariants> {
66
+ class?: string;
67
+ }
68
+
69
+ export const Stat: ParentComponent<StatProps> = (props) => {
70
+ const [local, rest] = splitProps(props, ["class", "variant", "children"]);
71
+
72
+ return (
73
+ <div
74
+ class={cn(statVariants({ variant: local.variant }), local.class)}
75
+ {...rest}
76
+ >
77
+ {local.children}
78
+ </div>
79
+ );
80
+ };
81
+
82
+ /* --- 3. Stat Header (Top Row) --- */
83
+ export interface StatHeaderProps extends JSX.HTMLAttributes<HTMLDivElement> {
84
+ class?: string;
85
+ }
86
+
87
+ export const StatHeader: ParentComponent<StatHeaderProps> = (props) => {
88
+ const [local, rest] = splitProps(props, ["class", "children"]);
89
+
90
+ return (
91
+ <div
92
+ class={cn("flex items-center justify-between gap-2", local.class)}
93
+ {...rest}
94
+ >
95
+ {local.children}
96
+ </div>
97
+ );
98
+ };
99
+
100
+ /* --- 4. Stat Label / Title --- */
101
+ export interface StatLabelProps extends JSX.HTMLAttributes<HTMLParagraphElement> {
102
+ class?: string;
103
+ }
104
+
105
+ export const StatLabel: ParentComponent<StatLabelProps> = (props) => {
106
+ const [local, rest] = splitProps(props, ["class", "children"]);
107
+
108
+ return (
109
+ <p
110
+ class={cn(
111
+ "text-xs sm:text-sm font-medium text-muted-foreground leading-tight tracking-tight",
112
+ local.class
113
+ )}
114
+ {...rest}
115
+ >
116
+ {local.children}
117
+ </p>
118
+ );
119
+ };
120
+
121
+ /* --- 5. Stat Icon Wrapper --- */
122
+ export interface StatIconProps extends JSX.HTMLAttributes<HTMLDivElement> {
123
+ class?: string;
124
+ }
125
+
126
+ export const StatIcon: ParentComponent<StatIconProps> = (props) => {
127
+ const [local, rest] = splitProps(props, ["class", "children"]);
128
+
129
+ return (
130
+ <div
131
+ class={cn(
132
+ "flex size-4 sm:size-4.5 shrink-0 items-center justify-center text-muted-foreground",
133
+ local.class
134
+ )}
135
+ {...rest}
136
+ >
137
+ {local.children}
138
+ </div>
139
+ );
140
+ };
141
+
142
+ /* --- 6. Stat Value (Big Number) --- */
143
+ export interface StatValueProps extends JSX.HTMLAttributes<HTMLDivElement> {
144
+ class?: string;
145
+ }
146
+
147
+ export const StatValue: ParentComponent<StatValueProps> = (props) => {
148
+ const [local, rest] = splitProps(props, ["class", "children"]);
149
+
150
+ return (
151
+ <div
152
+ class={cn(
153
+ "text-2xl sm:text-3xl font-bold tracking-tight text-foreground flex items-baseline gap-1 my-0.5",
154
+ local.class
155
+ )}
156
+ {...rest}
157
+ >
158
+ {local.children}
159
+ </div>
160
+ );
161
+ };
162
+
163
+ /* --- 7. Stat Unit / Currency (Prefix or Suffix) --- */
164
+ export interface StatUnitProps extends JSX.HTMLAttributes<HTMLSpanElement> {
165
+ class?: string;
166
+ }
167
+
168
+ export const StatUnit: ParentComponent<StatUnitProps> = (props) => {
169
+ const [local, rest] = splitProps(props, ["class", "children"]);
170
+
171
+ return (
172
+ <span
173
+ class={cn("text-lg sm:text-xl font-semibold text-muted-foreground self-baseline", local.class)}
174
+ {...rest}
175
+ >
176
+ {local.children}
177
+ </span>
178
+ );
179
+ };
180
+
181
+ /* --- 8. Stat Trend (Growth / Decline Indicator - No Background) --- */
182
+ export const statTrendVariants = cva(
183
+ "inline-flex items-center gap-1 text-xs font-semibold select-none shrink-0 tracking-tight",
184
+ {
185
+ variants: {
186
+ type: {
187
+ up: "text-emerald-600 dark:text-emerald-400",
188
+ down: "text-red-600 dark:text-red-400",
189
+ neutral: "text-muted-foreground",
190
+ },
191
+ },
192
+ defaultVariants: {
193
+ type: "up",
194
+ },
195
+ }
196
+ );
197
+
198
+ export interface StatTrendProps
199
+ extends JSX.HTMLAttributes<HTMLSpanElement>,
200
+ VariantProps<typeof statTrendVariants> {
201
+ class?: string;
202
+ hideIcon?: boolean;
203
+ }
204
+
205
+ export const StatTrend: ParentComponent<StatTrendProps> = (props) => {
206
+ const [local, rest] = splitProps(props, ["class", "type", "hideIcon", "children"]);
207
+
208
+ const Icon = () => {
209
+ if (local.hideIcon) return null;
210
+ if (local.type === "down") return <TrendingDown class="size-3.5 stroke-[2.5]" />;
211
+ if (local.type === "neutral") return <Minus class="size-3.5 stroke-[2.5]" />;
212
+ return <TrendingUp class="size-3.5 stroke-[2.5]" />;
213
+ };
214
+
215
+ return (
216
+ <span
217
+ class={cn(statTrendVariants({ type: local.type }), local.class)}
218
+ {...rest}
219
+ >
220
+ <Icon />
221
+ <span>{local.children}</span>
222
+ </span>
223
+ );
224
+ };
225
+
226
+ /* --- 9. Stat Help Text / Bottom Row (Between Alignment) --- */
227
+ export interface StatHelpTextProps extends JSX.HTMLAttributes<HTMLDivElement> {
228
+ class?: string;
229
+ }
230
+
231
+ export const StatHelpText: ParentComponent<StatHelpTextProps> = (props) => {
232
+ const [local, rest] = splitProps(props, ["class", "children"]);
233
+
234
+ return (
235
+ <div
236
+ class={cn(
237
+ "flex items-center justify-between gap-2 text-xs text-muted-foreground pt-1",
238
+ local.class
239
+ )}
240
+ {...rest}
241
+ >
242
+ {local.children}
243
+ </div>
244
+ );
245
+ };
@@ -0,0 +1,160 @@
1
+ import { splitProps, type Component, type JSX } from "solid-js";
2
+ import { cn } from "@/lib/cn";
3
+
4
+ export interface TableProps extends JSX.HTMLAttributes<HTMLTableElement> {
5
+ class?: string;
6
+ }
7
+
8
+ /**
9
+ * Root Table container component wrapped in a responsive scroll container.
10
+ */
11
+ export const Table: Component<TableProps> = (props) => {
12
+ const [local, rest] = splitProps(props, ["class"]);
13
+
14
+ return (
15
+ <div class="relative w-full overflow-auto">
16
+ <table
17
+ class={cn("w-full caption-bottom text-sm", local.class)}
18
+ {...rest}
19
+ />
20
+ </div>
21
+ );
22
+ };
23
+
24
+ export interface TableHeaderProps extends JSX.HTMLAttributes<HTMLTableSectionElement> {
25
+ class?: string;
26
+ }
27
+
28
+ /**
29
+ * Header section wrapper for the Table component.
30
+ */
31
+ export const TableHeader: Component<TableHeaderProps> = (props) => {
32
+ const [local, rest] = splitProps(props, ["class"]);
33
+
34
+ return (
35
+ <thead
36
+ class={cn("[&_tr]:border-b border-border", local.class)}
37
+ {...rest}
38
+ />
39
+ );
40
+ };
41
+
42
+ export interface TableBodyProps extends JSX.HTMLAttributes<HTMLTableSectionElement> {
43
+ class?: string;
44
+ }
45
+
46
+ /**
47
+ * Main body section wrapper for the Table component.
48
+ */
49
+ export const TableBody: Component<TableBodyProps> = (props) => {
50
+ const [local, rest] = splitProps(props, ["class"]);
51
+
52
+ return (
53
+ <tbody
54
+ class={cn("[&_tr:last-child]:border-0", local.class)}
55
+ {...rest}
56
+ />
57
+ );
58
+ };
59
+
60
+ export interface TableFooterProps extends JSX.HTMLAttributes<HTMLTableSectionElement> {
61
+ class?: string;
62
+ }
63
+
64
+ /**
65
+ * Footer section wrapper for the Table component.
66
+ */
67
+ export const TableFooter: Component<TableFooterProps> = (props) => {
68
+ const [local, rest] = splitProps(props, ["class"]);
69
+
70
+ return (
71
+ <tfoot
72
+ class={cn(
73
+ "border-t border-border bg-muted/50 font-medium [&>tr]:last:border-b-0",
74
+ local.class
75
+ )}
76
+ {...rest}
77
+ />
78
+ );
79
+ };
80
+
81
+ export interface TableRowProps extends JSX.HTMLAttributes<HTMLTableRowElement> {
82
+ class?: string;
83
+ }
84
+
85
+ /**
86
+ * Table row component with hover highlight states.
87
+ */
88
+ export const TableRow: Component<TableRowProps> = (props) => {
89
+ const [local, rest] = splitProps(props, ["class"]);
90
+
91
+ return (
92
+ <tr
93
+ class={cn(
94
+ "border-b border-border transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",
95
+ local.class
96
+ )}
97
+ {...rest}
98
+ />
99
+ );
100
+ };
101
+
102
+ export interface TableHeadProps extends JSX.ThHTMLAttributes<HTMLTableCellElement> {
103
+ class?: string;
104
+ }
105
+
106
+ /**
107
+ * Header cell component for table columns.
108
+ */
109
+ export const TableHead: Component<TableHeadProps> = (props) => {
110
+ const [local, rest] = splitProps(props, ["class"]);
111
+
112
+ return (
113
+ <th
114
+ class={cn(
115
+ "h-10 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
116
+ local.class
117
+ )}
118
+ {...rest}
119
+ />
120
+ );
121
+ };
122
+
123
+ export interface TableCellProps extends JSX.TdHTMLAttributes<HTMLTableCellElement> {
124
+ class?: string;
125
+ }
126
+
127
+ /**
128
+ * Standard data cell component for table rows.
129
+ */
130
+ export const TableCell: Component<TableCellProps> = (props) => {
131
+ const [local, rest] = splitProps(props, ["class"]);
132
+
133
+ return (
134
+ <td
135
+ class={cn(
136
+ "p-4 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
137
+ local.class
138
+ )}
139
+ {...rest}
140
+ />
141
+ );
142
+ };
143
+
144
+ export interface TableCaptionProps extends JSX.HTMLAttributes<HTMLTableCaptionElement> {
145
+ class?: string;
146
+ }
147
+
148
+ /**
149
+ * Accessible table caption for describing table contents.
150
+ */
151
+ export const TableCaption: Component<TableCaptionProps> = (props) => {
152
+ const [local, rest] = splitProps(props, ["class"]);
153
+
154
+ return (
155
+ <caption
156
+ class={cn("mt-4 text-xs text-muted-foreground pb-2", local.class)}
157
+ {...rest}
158
+ />
159
+ );
160
+ };