@nikala-ui/core 0.9.11 → 0.10.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 (48) hide show
  1. package/package.json +1 -1
  2. package/registry/aspect-ratio.json +17 -0
  3. package/registry/button.json +4 -1
  4. package/registry/collapsible.json +18 -0
  5. package/registry/combobox.json +4 -1
  6. package/registry/command.json +3 -2
  7. package/registry/context-menu.json +24 -0
  8. package/registry/create-form.json +1 -1
  9. package/registry/dialog.json +4 -1
  10. package/registry/dropdown-menu.json +4 -1
  11. package/registry/empty.json +17 -0
  12. package/registry/field.json +20 -0
  13. package/registry/form-message.json +16 -0
  14. package/registry/form.json +17 -0
  15. package/registry/icon-button.json +20 -0
  16. package/registry/index.json +191 -1
  17. package/registry/number-input.json +24 -0
  18. package/registry/resizable.json +21 -0
  19. package/registry/scroll-area.json +21 -0
  20. package/registry/select.json +4 -1
  21. package/registry/sheet.json +4 -1
  22. package/registry/spinner.json +18 -0
  23. package/registry/status.json +18 -0
  24. package/registry/theme-manager.json +1 -1
  25. package/registry/toggle.json +18 -0
  26. package/src/registry/components/ui/aspect-ratio.tsx +31 -0
  27. package/src/registry/components/ui/button.tsx +18 -3
  28. package/src/registry/components/ui/collapsible.tsx +73 -0
  29. package/src/registry/components/ui/combobox.tsx +23 -84
  30. package/src/registry/components/ui/command.tsx +154 -66
  31. package/src/registry/components/ui/context-menu.tsx +192 -0
  32. package/src/registry/components/ui/dialog.tsx +39 -44
  33. package/src/registry/components/ui/dropdown-menu.tsx +40 -45
  34. package/src/registry/components/ui/empty.tsx +83 -0
  35. package/src/registry/components/ui/field.tsx +67 -0
  36. package/src/registry/components/ui/form-message.tsx +36 -0
  37. package/src/registry/components/ui/form.tsx +21 -0
  38. package/src/registry/components/ui/icon-button.tsx +34 -0
  39. package/src/registry/components/ui/number-input.tsx +150 -0
  40. package/src/registry/components/ui/resizable.tsx +193 -0
  41. package/src/registry/components/ui/scroll-area.tsx +218 -0
  42. package/src/registry/components/ui/select.tsx +22 -16
  43. package/src/registry/components/ui/sheet.tsx +62 -63
  44. package/src/registry/components/ui/spinner.tsx +41 -0
  45. package/src/registry/components/ui/status.tsx +119 -0
  46. package/src/registry/components/ui/theme-toggle.tsx +6 -4
  47. package/src/registry/components/ui/toggle.tsx +101 -0
  48. package/src/registry/metadata.ts +84 -2
@@ -121,10 +121,11 @@ export const ThemeToggle: Component<ThemeToggleProps> = (props) => {
121
121
  }
122
122
  >
123
123
  {/* Max Mode: Full Theme Customizer Panel */}
124
- <DropdownMenuContent class="w-64 p-3">
125
- <DropdownMenuLabel class="px-0 pt-0 text-xs font-semibold uppercase tracking-wider text-muted-foreground">
126
- Theme Mode
127
- </DropdownMenuLabel>
124
+ <DropdownMenuContent class="w-64">
125
+ <div class="p-2 space-y-2">
126
+ <DropdownMenuLabel class="px-0 pt-0 text-xs font-semibold uppercase tracking-wider text-muted-foreground">
127
+ Theme Mode
128
+ </DropdownMenuLabel>
128
129
  <div class="grid grid-cols-3 gap-1 my-1.5">
129
130
  <Button
130
131
  variant={theme() === "light" ? "default" : "outline"}
@@ -193,6 +194,7 @@ export const ThemeToggle: Component<ThemeToggleProps> = (props) => {
193
194
  )}
194
195
  </For>
195
196
  </div>
197
+ </div>
196
198
  </DropdownMenuContent>
197
199
  </Show>
198
200
  </DropdownMenu>
@@ -0,0 +1,101 @@
1
+ import { splitProps, type Component, type JSX } from "solid-js";
2
+ import { ToggleButton as KobalteToggle } from "@kobalte/core/toggle-button";
3
+ import { cva, type VariantProps } from "class-variance-authority";
4
+ import { cn } from "@/lib/cn";
5
+
6
+ export const toggleVariants = cva(
7
+ "inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 data-[pressed]:bg-accent data-[pressed]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 cursor-pointer",
8
+ {
9
+ variants: {
10
+ variant: {
11
+ default: "bg-transparent",
12
+ outline:
13
+ "border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground data-[pressed]:bg-accent data-[pressed]:text-accent-foreground",
14
+ },
15
+ size: {
16
+ default: "h-9 px-3 min-w-9",
17
+ sm: "h-8 px-2 text-xs min-w-8",
18
+ lg: "h-10 px-3 min-w-10",
19
+ },
20
+ },
21
+ defaultVariants: {
22
+ variant: "default",
23
+ size: "default",
24
+ },
25
+ }
26
+ );
27
+
28
+ export interface ToggleProps
29
+ extends JSX.ButtonHTMLAttributes<HTMLButtonElement>,
30
+ VariantProps<typeof toggleVariants> {
31
+ pressed?: boolean;
32
+ defaultPressed?: boolean;
33
+ onPressedChange?: (pressed: boolean) => void;
34
+ disabled?: boolean;
35
+ class?: string;
36
+ children?: JSX.Element;
37
+ }
38
+
39
+ export const Toggle: Component<ToggleProps> = (props) => {
40
+ const [local, rest] = splitProps(props, [
41
+ "variant",
42
+ "size",
43
+ "class",
44
+ "children",
45
+ "pressed",
46
+ "defaultPressed",
47
+ "onPressedChange",
48
+ "disabled",
49
+ "onChange",
50
+ ]);
51
+
52
+ return (
53
+ <KobalteToggle
54
+ isPressed={local.pressed}
55
+ defaultIsPressed={local.defaultPressed}
56
+ onChange={local.onPressedChange}
57
+ disabled={local.disabled}
58
+ class={cn(
59
+ toggleVariants({ variant: local.variant, size: local.size }),
60
+ local.class
61
+ )}
62
+ {...rest}
63
+ >
64
+ {local.children}
65
+ </KobalteToggle>
66
+ );
67
+ };
68
+
69
+ export interface ToggleGroupProps extends JSX.HTMLAttributes<HTMLDivElement> {
70
+ type?: "single" | "multiple";
71
+ value?: string | string[];
72
+ defaultValue?: string | string[];
73
+ onChange?: (value: any) => void;
74
+ disabled?: boolean;
75
+ class?: string;
76
+ children?: JSX.Element;
77
+ }
78
+
79
+ export const ToggleGroup: Component<ToggleGroupProps> = (props) => {
80
+ const [local, rest] = splitProps(props, [
81
+ "type",
82
+ "value",
83
+ "defaultValue",
84
+ "onChange",
85
+ "disabled",
86
+ "class",
87
+ "children",
88
+ ]);
89
+
90
+ return (
91
+ <div
92
+ class={cn(
93
+ "flex items-center justify-center gap-1 rounded-md border border-border/40 p-1 bg-background",
94
+ local.class
95
+ )}
96
+ {...rest}
97
+ >
98
+ {local.children}
99
+ </div>
100
+ );
101
+ };
@@ -14,12 +14,50 @@ export const COMPONENT_METADATA: Record<string, ComponentMeta> = {
14
14
  title: "Button",
15
15
  description: "An interactive button component with variant and size options.",
16
16
  dependencies: ["clsx", "tailwind-merge", "class-variance-authority"],
17
+ registryDependencies: ["spinner"],
17
18
  },
18
19
  input: {
19
20
  title: "Input",
20
21
  description: "A standard text input field with styling variants.",
21
22
  dependencies: ["clsx", "tailwind-merge"],
22
23
  },
24
+ spinner: {
25
+ title: "Spinner",
26
+ description: "An accessible animated loading indicator for asynchronous UI states.",
27
+ dependencies: ["clsx", "tailwind-merge", "class-variance-authority"],
28
+ },
29
+ empty: {
30
+ title: "Empty",
31
+ description: "A compound empty-state layout for collections, search results, and initial application states.",
32
+ dependencies: ["clsx", "tailwind-merge"],
33
+ },
34
+ status: {
35
+ title: "Status",
36
+ description: "A compact semantic status indicator with a color dot and label.",
37
+ dependencies: ["clsx", "tailwind-merge", "class-variance-authority"],
38
+ },
39
+ "icon-button": {
40
+ title: "Icon Button",
41
+ description: "An accessible square button intended for a single icon action.",
42
+ dependencies: ["clsx", "tailwind-merge"],
43
+ registryDependencies: ["button"],
44
+ },
45
+ form: {
46
+ title: "Form",
47
+ description: "A semantic form layout wrapper designed to work with the createForm hook.",
48
+ dependencies: ["clsx", "tailwind-merge"],
49
+ },
50
+ "form-message": {
51
+ title: "Form Message",
52
+ description: "Validation message helper connected to createForm errors and touched state.",
53
+ registryDependencies: ["field"],
54
+ },
55
+ field: {
56
+ title: "Field",
57
+ description: "A consistent form field layout for labels, descriptions, and validation errors.",
58
+ dependencies: ["clsx", "tailwind-merge"],
59
+ registryDependencies: ["label"],
60
+ },
23
61
  card: {
24
62
  title: "Card",
25
63
  description: "A versatile container component with header, content, and footer sections.",
@@ -74,11 +112,13 @@ export const COMPONENT_METADATA: Record<string, ComponentMeta> = {
74
112
  title: "Select",
75
113
  description: "Displays a list of options for the user to pick from, built on Kobalte primitives.",
76
114
  dependencies: ["clsx", "tailwind-merge", "@kobalte/core"],
115
+ registryDependencies: ["scroll-area"],
77
116
  },
78
117
  combobox: {
79
118
  title: "Combobox",
80
119
  description: "Searchable autocomplete dropdown with single/multi-selection tags, avatars, group headers, and customizable clear controls.",
81
120
  dependencies: ["clsx", "tailwind-merge", "@kobalte/core"],
121
+ registryDependencies: ["scroll-area"],
82
122
  },
83
123
  tabs: {
84
124
  title: "Tabs",
@@ -104,16 +144,19 @@ export const COMPONENT_METADATA: Record<string, ComponentMeta> = {
104
144
  title: "Dialog",
105
145
  description: "A modal window overlaying the main content, built on Kobalte primitives with blur and outside-click options.",
106
146
  dependencies: ["clsx", "tailwind-merge", "@kobalte/core"],
147
+ registryDependencies: ["scroll-area"],
107
148
  },
108
149
  sheet: {
109
150
  title: "Sheet / Drawer",
110
151
  description: "Extends the dialog component to display content that slides in from screen edges.",
111
152
  dependencies: ["clsx", "tailwind-merge", "class-variance-authority", "@kobalte/core"],
153
+ registryDependencies: ["scroll-area"],
112
154
  },
113
155
  "dropdown-menu": {
114
156
  title: "Dropdown Menu",
115
157
  description: "Displays a menu to the user—such as a set of actions or functions—triggered by a button or avatar.",
116
158
  dependencies: ["clsx", "tailwind-merge", "@kobalte/core"],
159
+ registryDependencies: ["scroll-area"],
117
160
  },
118
161
  "theme-manager": {
119
162
  title: "Theme Manager",
@@ -152,7 +195,7 @@ export const COMPONENT_METADATA: Record<string, ComponentMeta> = {
152
195
  "lucide-solid",
153
196
  "@kobalte/core",
154
197
  ],
155
- registryDependencies: ["kbd", "input-group", "list"],
198
+ registryDependencies: ["kbd", "input-group", "list", "scroll-area"],
156
199
  },
157
200
  toast: {
158
201
  title: "Toast / Sonner",
@@ -179,6 +222,45 @@ export const COMPONENT_METADATA: Record<string, ComponentMeta> = {
179
222
  description: "Numeric range selection slider supporting single/dual thumbs, custom steps, vertical orientation, and formatted value labels, built on Kobalte primitives.",
180
223
  dependencies: ["clsx", "tailwind-merge", "@kobalte/core"],
181
224
  },
225
+ collapsible: {
226
+ title: "Collapsible",
227
+ description: "An interactive component that expands and collapses content panels with smooth height animations, built on Kobalte primitives.",
228
+ dependencies: ["clsx", "tailwind-merge", "@kobalte/core"],
229
+ },
230
+ "aspect-ratio": {
231
+ title: "Aspect Ratio",
232
+ description: "Displays content within a specific aspect ratio using CSS aspect-ratio while preventing layout shifts.",
233
+ dependencies: ["clsx", "tailwind-merge"],
234
+ },
235
+ toggle: {
236
+ title: "Toggle",
237
+ description: "A two-state interactive button component built on Kobalte primitives.",
238
+ dependencies: ["clsx", "tailwind-merge", "@kobalte/core"],
239
+ },
240
+ "number-input": {
241
+ title: "Number Input",
242
+ description: "A numeric stepper input component supporting min, max, step, negative values, and long-press auto-repeat, built on Kobalte primitives.",
243
+ dependencies: ["clsx", "tailwind-merge", "@kobalte/core", "lucide-solid"],
244
+ registryDependencies: ["input", "button", "create-long-press"],
245
+ },
246
+ "context-menu": {
247
+ title: "Context Menu",
248
+ description: "Displays a contextual popup menu triggered by right-clicking target areas, built on Kobalte primitives.",
249
+ dependencies: ["clsx", "tailwind-merge", "@kobalte/core"],
250
+ registryDependencies: ["separator", "kbd", "create-click-outside", "scroll-area"],
251
+ },
252
+ resizable: {
253
+ title: "Resizable",
254
+ description: "Accessible resizable panel layout component supporting drag-to-resize handles.",
255
+ dependencies: ["clsx", "tailwind-merge", "lucide-solid"],
256
+ registryDependencies: ["create-resize-observer"],
257
+ },
258
+ "scroll-area": {
259
+ title: "Scroll Area",
260
+ description: "Augments native scroll functionality with custom styled scrollbars and reactive scroll tracking.",
261
+ dependencies: ["clsx", "tailwind-merge"],
262
+ registryDependencies: ["create-scroll-position", "create-resize-observer"],
263
+ },
182
264
  "pin-input": {
183
265
  title: "Pin Input",
184
266
  description: "Interactive multi-slot PIN/OTP input component for SMS and 2FA authentication verification codes.",
@@ -355,4 +437,4 @@ export const HOOK_METADATA: Record<string, ComponentMeta> = {
355
437
  title: "createScrollIntoView",
356
438
  description: "SolidJS reactive primitive for scrolling a target element into view smooth or auto behavior",
357
439
  },
358
- };
440
+ };