@nikala-ui/core 0.9.9 → 0.9.10-nightly.f842585

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 (53) hide show
  1. package/package.json +2 -2
  2. package/registry/accordion.json +1 -1
  3. package/registry/avatar.json +1 -1
  4. package/registry/badge.json +1 -1
  5. package/registry/button.json +1 -1
  6. package/registry/checkbox.json +1 -1
  7. package/registry/combobox.json +18 -0
  8. package/registry/command.json +1 -1
  9. package/registry/dialog.json +1 -1
  10. package/registry/dropdown-menu.json +1 -1
  11. package/registry/hover-card.json +18 -0
  12. package/registry/index.json +53 -0
  13. package/registry/input-group.json +1 -1
  14. package/registry/input.json +1 -1
  15. package/registry/list.json +1 -1
  16. package/registry/logo.json +17 -0
  17. package/registry/pin-input.json +17 -0
  18. package/registry/popover.json +1 -1
  19. package/registry/progress.json +1 -1
  20. package/registry/select.json +1 -1
  21. package/registry/skeleton.json +1 -1
  22. package/registry/slider.json +18 -0
  23. package/registry/switch.json +1 -1
  24. package/registry/tabs.json +1 -1
  25. package/registry/textarea.json +1 -1
  26. package/registry/theme-manager.json +1 -1
  27. package/registry/toast.json +1 -1
  28. package/src/registry/components/ui/accordion.tsx +0 -4
  29. package/src/registry/components/ui/avatar.tsx +1 -1
  30. package/src/registry/components/ui/badge.tsx +6 -0
  31. package/src/registry/components/ui/button.tsx +6 -2
  32. package/src/registry/components/ui/checkbox.tsx +1 -1
  33. package/src/registry/components/ui/combobox.tsx +295 -0
  34. package/src/registry/components/ui/command.tsx +15 -15
  35. package/src/registry/components/ui/dialog.tsx +3 -3
  36. package/src/registry/components/ui/dropdown-menu.tsx +5 -5
  37. package/src/registry/components/ui/hover-card.tsx +105 -0
  38. package/src/registry/components/ui/input-group.tsx +2 -2
  39. package/src/registry/components/ui/input.tsx +1 -1
  40. package/src/registry/components/ui/list.tsx +5 -5
  41. package/src/registry/components/ui/logo.tsx +68 -0
  42. package/src/registry/components/ui/pin-input.tsx +198 -0
  43. package/src/registry/components/ui/popover.tsx +1 -1
  44. package/src/registry/components/ui/progress.tsx +2 -2
  45. package/src/registry/components/ui/select.tsx +2 -2
  46. package/src/registry/components/ui/skeleton.tsx +1 -1
  47. package/src/registry/components/ui/slider.tsx +153 -0
  48. package/src/registry/components/ui/switch.tsx +2 -2
  49. package/src/registry/components/ui/tabs.tsx +1 -1
  50. package/src/registry/components/ui/textarea.tsx +1 -1
  51. package/src/registry/components/ui/theme-toggle.tsx +1 -1
  52. package/src/registry/components/ui/toast.tsx +1 -1
  53. package/src/registry/metadata.ts +20 -0
@@ -0,0 +1,68 @@
1
+ import { splitProps, type Component, type JSX } from "solid-js";
2
+ import { cn } from "@/lib/cn";
3
+
4
+ export interface LogoProps extends JSX.SvgSVGAttributes<SVGSVGElement> {
5
+ class?: string;
6
+ }
7
+
8
+ /**
9
+ * Official Nikala UI Logo Component with dynamic contrast stroke and accent fill.
10
+ */
11
+ export const Logo: Component<LogoProps> = (props) => {
12
+ const [local, rest] = splitProps(props, ["class"]);
13
+
14
+ return (
15
+ <svg
16
+ viewBox="0 0 223 223"
17
+ fill="none"
18
+ xmlns="http://www.w3.org/2000/svg"
19
+ class={cn("h-7 w-7 shrink-0 select-none", local.class)}
20
+ {...rest}
21
+ >
22
+ <g clip-path="url(#nikala-logo-clip0)">
23
+ {/* Background Box with Dynamic Theme Accent */}
24
+ <path
25
+ d="M0 10C0 4.47716 4.47715 0 10 0H213C218.523 0 223 4.47715 223 10V213C223 218.523 218.523 223 213 223H10C4.47716 223 0 218.523 0 213V10Z"
26
+ fill="currentColor"
27
+ class="text-primary"
28
+ />
29
+ <g clip-path="url(#nikala-logo-clip1)">
30
+ {/* Paintbrush Vector Paths Adapting to --primary-foreground */}
31
+ <path
32
+ d="M304.406 364.173C303.147 366.03 301.738 366.903 299.847 368.109C299.093 368.594 298.339 369.08 297.563 369.58C296.746 370.096 295.929 370.613 295.087 371.145C294.245 371.684 293.402 372.224 292.56 372.764C290.346 374.183 288.127 375.594 285.907 377.003C283.642 378.443 281.381 379.891 279.119 381.338C274.684 384.175 270.243 387.003 265.799 389.826C263.196 387.86 261.543 385.492 259.734 382.813C257.432 379.465 255.089 376.207 252.52 373.055C249.122 368.864 246.081 364.457 243.017 360.02C240.337 356.141 237.507 352.385 234.645 348.639C233.944 347.722 233.244 346.804 232.544 345.886C232.19 345.421 231.836 344.956 231.471 344.477C228.856 341.031 226.35 337.519 223.876 333.97C222.068 331.395 220.171 328.922 218.188 326.48C214.782 322.267 211.726 317.844 208.65 313.389C205.969 309.51 203.14 305.755 200.277 302.009C199.577 301.091 198.877 300.173 198.177 299.255C197.823 298.79 197.468 298.326 197.103 297.847C194.79 294.798 192.553 291.706 190.364 288.567C188.267 285.56 186.094 282.644 183.786 279.794C179.935 275.035 176.476 270.016 173.005 264.978C176.445 262.305 179.941 259.802 183.612 257.457C184.099 257.143 184.587 256.829 185.089 256.505C186.679 255.481 188.271 254.461 189.863 253.441C190.975 252.726 192.086 252.011 193.197 251.296C196.106 249.425 199.016 247.557 201.927 245.689C204.903 243.779 207.878 241.866 210.853 239.953C216.678 236.208 222.505 232.466 228.333 228.726C230.86 230.623 232.252 232.791 233.788 235.512C234.053 235.974 234.319 236.435 234.592 236.911C236.235 239.797 237.775 242.723 239.261 245.694C241.392 249.953 243.79 254.007 246.245 258.083C248.04 261.081 249.715 264.098 251.272 267.229C253.667 272.041 256.413 276.612 259.173 281.219C261.596 285.264 263.845 289.394 266.071 293.549C266.617 294.566 267.163 295.584 267.709 296.601C267.986 297.115 268.262 297.63 268.547 298.161C270.366 301.528 272.256 304.843 274.208 308.135C276.068 311.27 277.812 314.435 279.438 317.698C281.864 322.542 284.628 327.154 287.41 331.798C289.839 335.853 292.092 339.995 294.328 344.159C294.597 344.658 294.866 345.158 295.143 345.673C295.7 346.71 296.256 347.748 296.81 348.786C298.15 351.28 299.518 353.74 300.998 356.154C301.259 356.583 301.519 357.012 301.788 357.454C302.503 358.619 303.23 359.775 303.958 360.931C304.8 362.85 304.8 362.85 304.406 364.173Z"
33
+ fill="var(--primary-foreground, #ffffff)"
34
+ />
35
+ <path
36
+ d="M147.908 159.434C143.029 162.624 138.255 165.222 132.524 166.53C131.568 166.759 131.568 166.759 130.593 166.992C117.641 169.419 104.681 165.652 93.8424 158.557C84.6301 151.709 78.5873 142.443 75.2903 131.528C75.0234 130.675 75.0234 130.675 74.7511 129.804C72.9741 122.986 73.9008 115.665 74.4194 108.713C75.7267 91.1539 72.9686 78.0313 62.8484 63.365C61.808 61.5353 61.808 61.5353 62.2756 59.3756C74.2777 52.1095 87.8993 50.9005 101.359 53.9904C102.212 54.1829 103.066 54.3753 103.945 54.5736C110.197 56.0433 115.833 57.7788 121.484 60.8918C121.926 61.1331 122.368 61.3745 122.823 61.6232C141.727 72.123 158.382 89.1592 164.804 110.159C170.072 129.189 164.608 147.982 147.908 159.434Z"
37
+ fill="var(--primary-foreground, #ffffff)"
38
+ />
39
+ <path
40
+ d="M224.945 222.724C223.467 224.948 221.157 226.154 218.937 227.554C218.142 228.066 218.142 228.067 217.331 228.589C215.58 229.716 213.822 230.833 212.065 231.95C210.849 232.73 209.634 233.51 208.418 234.291C205.22 236.344 202.016 238.389 198.811 240.432C195.542 242.519 192.277 244.613 189.012 246.706C182.605 250.813 176.192 254.911 169.776 259.003C163.425 254.055 159.038 246.461 154.501 239.887C151.859 236.063 149.162 232.301 146.129 228.777C140.59 220.962 138.709 211.47 139.907 202.042C141.806 192.774 145.937 185.415 153.125 179.281C153.821 178.654 154.516 178.028 155.232 177.382C161.199 173.349 167.362 171.636 174.492 171.096C175.187 171.029 175.187 171.029 175.896 170.961C185.36 171.183 194.837 174.7 201.562 181.385C202.406 182.334 203.235 183.298 204.044 184.277C204.596 184.933 204.596 184.933 205.159 185.602C207.879 189.006 209.907 192.696 211.94 196.538C212.966 198.458 213.996 200.376 215.027 202.293C215.301 202.803 215.574 203.312 215.856 203.837C218.216 208.207 220.709 212.489 223.254 216.754C225.579 220.827 225.579 220.827 224.945 222.724Z"
41
+ fill="var(--primary-foreground, #ffffff)"
42
+ />
43
+ <path
44
+ d="M346.445 469.84C341.579 473.016 337.792 473.996 331.992 473.069C323.666 471.041 319.697 464.544 315.142 457.786C314.41 456.773 313.671 455.764 312.923 454.762C312.555 454.269 312.187 453.775 311.808 453.267C310.744 451.858 309.676 450.454 308.605 449.052C304.588 443.792 300.674 438.482 296.873 433.064C294.268 429.365 291.554 425.754 288.807 422.16C288.108 421.244 287.41 420.328 286.711 419.412C286.181 418.717 286.181 418.717 285.639 418.007C283.312 414.94 281.064 411.828 278.863 408.669C275.954 404.511 272.86 400.557 269.591 396.676C270.596 393.987 272.077 392.99 274.463 391.469C275.568 390.758 275.568 390.758 276.694 390.032C277.891 389.276 277.891 389.276 279.111 388.505C279.926 387.983 280.74 387.461 281.58 386.923C283.742 385.538 285.909 384.16 288.077 382.784C290.29 381.378 292.498 379.965 294.707 378.552C299.039 375.782 303.376 373.02 307.716 370.264C310.189 371.73 310.549 372.854 311.779 375.43C313.714 379.343 315.815 383.09 318.072 386.826C320.626 391.064 322.954 395.349 325.158 399.782C326.672 402.673 328.329 405.458 330.013 408.252C332.566 412.491 334.894 416.776 337.098 421.209C338.613 424.099 340.27 426.884 341.953 429.678C344.974 434.704 347.722 439.785 350.305 445.052C350.628 445.646 350.95 446.239 351.282 446.851C355.467 454.895 353.749 464.19 346.445 469.84Z"
45
+ fill="var(--primary-foreground, #ffffff)"
46
+ />
47
+ <path
48
+ d="M175.175 164.461C174.611 164.495 174.047 164.529 173.466 164.565C161.822 165.517 151.451 170.117 143.632 178.98C141.188 182.058 138.963 185.278 136.798 188.557C134.916 187.16 133.636 185.817 132.364 183.853C132.04 183.352 131.717 182.852 131.383 182.336C131.053 181.817 130.724 181.297 130.384 180.762C130.043 180.241 129.703 179.719 129.351 179.182C129.031 178.682 128.711 178.182 128.381 177.668C128.089 177.211 127.796 176.755 127.495 176.285C126.898 175.109 126.898 175.109 127.21 173.669C127.885 173.594 127.885 173.594 128.573 173.517C144.325 171.353 156.368 162.585 166.151 150.449C168.977 152.315 170.506 155.002 172.283 157.806C172.597 158.285 172.911 158.765 173.234 159.26C175.527 162.839 175.527 162.839 175.175 164.461Z"
49
+ fill="var(--primary-foreground, #ffffff)"
50
+ />
51
+ </g>
52
+ </g>
53
+ <defs>
54
+ <clipPath id="nikala-logo-clip0">
55
+ <rect width="223" height="223" rx="10" fill="white" />
56
+ </clipPath>
57
+ <clipPath id="nikala-logo-clip1">
58
+ <rect
59
+ width="377.121"
60
+ height="377.121"
61
+ fill="white"
62
+ transform="translate(431.932 116.81) rotate(102.218)"
63
+ />
64
+ </clipPath>
65
+ </defs>
66
+ </svg>
67
+ );
68
+ };
@@ -0,0 +1,198 @@
1
+ import {
2
+ createSignal,
3
+ createMemo,
4
+ createContext,
5
+ useContext,
6
+ type JSX,
7
+ } from "solid-js";
8
+ import { cn } from "@/lib/cn";
9
+
10
+ export type PinInputType = "numeric" | "alphanumeric";
11
+
12
+ export interface PinInputContextValue {
13
+ value: () => string;
14
+ setValue: (val: string) => void;
15
+ mask: () => boolean;
16
+ disabled: () => boolean;
17
+ length: () => number;
18
+ type: () => PinInputType;
19
+ containerRef: HTMLDivElement | undefined;
20
+ }
21
+
22
+ const PinInputContext = createContext<PinInputContextValue>();
23
+
24
+ export interface PinInputProps {
25
+ value?: string;
26
+ onValueChange?: (value: string) => void;
27
+ length?: number;
28
+ type?: PinInputType;
29
+ mask?: boolean;
30
+ disabled?: boolean;
31
+ class?: string;
32
+ children?: JSX.Element;
33
+ }
34
+
35
+ /**
36
+ * Root PinInput component for 4 or 6-digit OTP / verification PIN codes.
37
+ */
38
+ export const PinInput = (props: PinInputProps) => {
39
+ let containerRef: HTMLDivElement | undefined;
40
+ const [internalValue, setInternalValue] = createSignal(props.value ?? "");
41
+
42
+ const value = () => props.value ?? internalValue();
43
+ const mask = () => props.mask ?? false;
44
+ const disabled = () => props.disabled ?? false;
45
+ const length = () => props.length ?? 6;
46
+
47
+ const inputType = (): PinInputType => {
48
+ const t = props.type ?? "numeric";
49
+ if (t !== "numeric" && t !== "alphanumeric") {
50
+ return "numeric";
51
+ }
52
+ return t;
53
+ };
54
+
55
+ const handleValueChange = (val: string) => {
56
+ setInternalValue(val);
57
+ props.onValueChange?.(val);
58
+ };
59
+
60
+ const contextValue: PinInputContextValue = {
61
+ value,
62
+ setValue: handleValueChange,
63
+ mask,
64
+ disabled,
65
+ length,
66
+ type: inputType,
67
+ get containerRef() {
68
+ return containerRef;
69
+ },
70
+ };
71
+
72
+ return (
73
+ <PinInputContext.Provider value={contextValue}>
74
+ <div ref={containerRef} class={cn("flex items-center gap-2", props.class)}>
75
+ {props.children}
76
+ </div>
77
+ </PinInputContext.Provider>
78
+ );
79
+ };
80
+
81
+ export interface PinInputLabelProps {
82
+ class?: string;
83
+ children?: JSX.Element;
84
+ }
85
+
86
+ /**
87
+ * Accessible label for PinInput.
88
+ */
89
+ export const PinInputLabel = (props: PinInputLabelProps) => {
90
+ return (
91
+ <label class={cn("text-sm font-medium leading-none text-foreground", props.class)}>
92
+ {props.children}
93
+ </label>
94
+ );
95
+ };
96
+
97
+ const focusIndex = (containerRef: HTMLDivElement | undefined, index: number) => {
98
+ const el = containerRef?.querySelector<HTMLInputElement>(
99
+ `[data-pin-input-index="${index}"]`
100
+ );
101
+ el?.focus();
102
+ el?.select();
103
+ };
104
+
105
+ export interface PinInputInputProps {
106
+ index: number;
107
+ class?: string;
108
+ }
109
+
110
+ /**
111
+ * Individual input slot for a single OTP digit/character.
112
+ */
113
+ export const PinInputInput = (props: PinInputInputProps) => {
114
+ const ctx = useContext(PinInputContext);
115
+ const digit = createMemo(() => ctx?.value()[props.index] ?? "");
116
+
117
+ const isCharAllowed = (char: string) => {
118
+ if (!ctx || char === "") return false;
119
+ return ctx.type() === "numeric"
120
+ ? /^[0-9]$/.test(char)
121
+ : /^[a-zA-Z0-9]$/.test(char);
122
+ };
123
+
124
+ const commitChar = (char: string) => {
125
+ if (!ctx) return;
126
+ const currentArray = ctx.value().split("");
127
+ while (currentArray.length < props.index) currentArray.push("");
128
+ currentArray[props.index] = char;
129
+ ctx.setValue(currentArray.join(""));
130
+ };
131
+
132
+ const handleInput = (e: InputEvent & { currentTarget: HTMLInputElement }) => {
133
+ if (!ctx || ctx.disabled()) return;
134
+ const val = e.currentTarget.value;
135
+ const rawChar = val ? val[val.length - 1] : "";
136
+
137
+ // Clear digit if input is empty
138
+ if (rawChar === "") {
139
+ commitChar("");
140
+ return;
141
+ }
142
+
143
+ if (!isCharAllowed(rawChar)) {
144
+ e.currentTarget.value = digit();
145
+ return;
146
+ }
147
+
148
+ commitChar(rawChar);
149
+
150
+ if (props.index < ctx.length() - 1) {
151
+ focusIndex(ctx.containerRef, props.index + 1);
152
+ }
153
+ };
154
+
155
+ const handleKeyDown = (e: KeyboardEvent) => {
156
+ if (!ctx || ctx.disabled()) return;
157
+ if (e.key === "Backspace" && digit() === "" && props.index > 0) {
158
+ focusIndex(ctx.containerRef, props.index - 1);
159
+ }
160
+ };
161
+
162
+ const handlePaste = (e: ClipboardEvent & { currentTarget: HTMLInputElement }) => {
163
+ if (!ctx || ctx.disabled()) return;
164
+ e.preventDefault();
165
+ const pasted = e.clipboardData?.getData("text") ?? "";
166
+ const chars = pasted.split("").filter(isCharAllowed);
167
+ if (chars.length === 0) return;
168
+
169
+ const currentArray = ctx.value().split("");
170
+ let lastFilled = props.index;
171
+ for (let i = 0; i < chars.length && props.index + i < ctx.length(); i++) {
172
+ while (currentArray.length < props.index + i) currentArray.push("");
173
+ currentArray[props.index + i] = chars[i];
174
+ lastFilled = props.index + i;
175
+ }
176
+ ctx.setValue(currentArray.join(""));
177
+ focusIndex(ctx.containerRef, Math.min(lastFilled + 1, ctx.length() - 1));
178
+ };
179
+
180
+ return (
181
+ <input
182
+ type={ctx?.mask() ? "password" : "text"}
183
+ inputMode={ctx?.type() === "numeric" ? "numeric" : "text"}
184
+ autocomplete="one-time-code"
185
+ maxLength={1}
186
+ disabled={ctx?.disabled()}
187
+ data-pin-input-index={props.index}
188
+ value={digit()}
189
+ onInput={handleInput}
190
+ onKeyDown={handleKeyDown}
191
+ onPaste={handlePaste}
192
+ class={cn(
193
+ "relative flex h-10 w-10 text-center text-sm font-semibold rounded-md border border-input bg-background shadow-xs transition-all focus:border-primary focus:outline-none focus:ring-2 focus:ring-primary/20 disabled:cursor-not-allowed disabled:opacity-50",
194
+ props.class
195
+ )}
196
+ />
197
+ );
198
+ };
@@ -40,7 +40,7 @@ export const PopoverContent: Component<ComponentProps<typeof KobaltePopover.Cont
40
40
  if (typeof (props as any).ref === "function") (props as any).ref(el);
41
41
  }}
42
42
  class={cn(
43
- "z-50 w-72 rounded-lg border border-border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[expanded]:animate-in data-[closed]:animate-out data-[closed]:fade-out-0 data-[expanded]:fade-in-0 data-[closed]:zoom-out-95 data-[expanded]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
43
+ "z-50 w-72 rounded-lg border border-border bg-popover p-4 text-popover-foreground shadow-md outline-none data-expanded:animate-in data-closed:animate-out data-[closed]:fade-out-0 data-[expanded]:fade-in-0 data-closed:zoom-out-95 data-expanded:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
44
44
  local.class
45
45
  )}
46
46
  {...rest}
@@ -53,10 +53,10 @@ export const Progress: Component<ProgressProps> = (props) => {
53
53
  </div>
54
54
  </Show>
55
55
 
56
- <KobalteProgress.Track class="relative h-2 w-full overflow-hidden rounded-full bg-primary/20">
56
+ <KobalteProgress.Track class="relative h-2 w-full overflow-hidden rounded-lg bg-primary/20">
57
57
  <KobalteProgress.Fill
58
58
  class={cn(
59
- "h-full w-[var(--kb-progress-fill-width)] bg-primary transition-all duration-300 ease-in-out",
59
+ "h-full w-(--kb-progress-fill-width) bg-primary transition-all duration-300 ease-in-out",
60
60
  local.indicatorClass
61
61
  )}
62
62
  />
@@ -37,7 +37,7 @@ export const SelectTrigger = <T extends ValidComponent = "button">(
37
37
  return (
38
38
  <SelectPrimitive.Trigger
39
39
  class={cn(
40
- "flex h-9 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 cursor-pointer text-foreground",
40
+ "flex h-9 w-full items-center justify-between rounded-md border border-input bg-muted px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-primary disabled:cursor-not-allowed disabled:opacity-50 cursor-pointer text-foreground",
41
41
  local.class
42
42
  )}
43
43
  {...rest}
@@ -109,7 +109,7 @@ export const SelectContent = <T extends ValidComponent = "div">(
109
109
  if (typeof (props as any).ref === "function") (props as any).ref(el);
110
110
  }}
111
111
  class={cn(
112
- "relative z-50 min-w-[8rem] overflow-hidden rounded-md border border-border bg-popover text-popover-foreground shadow-md animate-in fade-in-80",
112
+ "relative z-50 min-w-8rem overflow-hidden rounded-md border border-border bg-popover text-popover-foreground shadow-md animate-in fade-in-80",
113
113
  local.class
114
114
  )}
115
115
  {...rest}
@@ -15,7 +15,7 @@ export const Skeleton: Component<SkeletonProps> = (props) => {
15
15
  return (
16
16
  <div
17
17
  class={cn(
18
- "animate-pulse rounded-md bg-muted",
18
+ "animate-pulse rounded-md bg-accent",
19
19
  local.class
20
20
  )}
21
21
  {...rest}
@@ -0,0 +1,153 @@
1
+ import { splitProps, type JSX, type ValidComponent } from "solid-js";
2
+ import * as SliderPrimitive from "@kobalte/core/slider";
3
+ import { cn } from "@/lib/cn";
4
+
5
+ export type SliderRootProps<T extends ValidComponent = "div"> =
6
+ SliderPrimitive.SliderRootProps<T> & {
7
+ class?: string;
8
+ children?: JSX.Element;
9
+ };
10
+
11
+ /**
12
+ * Root Slider component built on Kobalte primitives.
13
+ */
14
+ export const Slider = <T extends ValidComponent = "div">(
15
+ props: SliderRootProps<T>
16
+ ) => {
17
+ const [local, rest] = splitProps(props as SliderRootProps, ["class", "children"]);
18
+
19
+ return (
20
+ <SliderPrimitive.Root
21
+ class={cn(
22
+ "relative flex w-full touch-none select-none flex-col gap-2 data-[orientation=vertical]:h-full data-[orientation=vertical]:w-auto data-[orientation=vertical]:items-center",
23
+ local.class
24
+ )}
25
+ {...(rest as any)}
26
+ >
27
+ {local.children}
28
+ </SliderPrimitive.Root>
29
+ );
30
+ };
31
+
32
+ export type SliderTrackProps<T extends ValidComponent = "div"> =
33
+ SliderPrimitive.SliderTrackProps<T> & {
34
+ class?: string;
35
+ children?: JSX.Element;
36
+ };
37
+
38
+ /**
39
+ * Slider track containing the active range fill and thumbs.
40
+ */
41
+ export const SliderTrack = <T extends ValidComponent = "div">(
42
+ props: SliderTrackProps<T>
43
+ ) => {
44
+ const [local, rest] = splitProps(props as SliderTrackProps, ["class", "children"]);
45
+
46
+ return (
47
+ <SliderPrimitive.Track
48
+ class={cn(
49
+ "relative h-2 w-full flex items-center rounded-lg bg-secondary cursor-pointer data-[orientation=vertical]:w-2 data-[orientation=vertical]:h-full data-[orientation=vertical]:flex-col data-[orientation=vertical]:justify-center",
50
+ local.class
51
+ )}
52
+ {...(rest as any)}
53
+ >
54
+ <SliderFill />
55
+ {local.children}
56
+ </SliderPrimitive.Track>
57
+ );
58
+ };
59
+
60
+ export type SliderFillProps<T extends ValidComponent = "div"> =
61
+ SliderPrimitive.SliderFillProps<T> & {
62
+ class?: string;
63
+ };
64
+
65
+ /**
66
+ * Active range indicator fill inside SliderTrack.
67
+ */
68
+ export const SliderFill = <T extends ValidComponent = "div">(
69
+ props: SliderFillProps<T>
70
+ ) => {
71
+ const [local, rest] = splitProps(props as SliderFillProps, ["class"]);
72
+
73
+ return (
74
+ <SliderPrimitive.Fill
75
+ class={cn(
76
+ "absolute rounded-lg bg-primary data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full",
77
+ local.class
78
+ )}
79
+ {...(rest as any)}
80
+ />
81
+ );
82
+ };
83
+
84
+ export type SliderThumbProps<T extends ValidComponent = "span"> =
85
+ SliderPrimitive.SliderThumbProps<T> & {
86
+ class?: string;
87
+ children?: JSX.Element;
88
+ };
89
+
90
+ /**
91
+ * Draggable thumb handle for selecting slider values.
92
+ * Positioned centered on Kobalte offset coordinates using -translate-x-1/2 -translate-y-1/2.
93
+ */
94
+ export const SliderThumb = <T extends ValidComponent = "span">(
95
+ props: SliderThumbProps<T>
96
+ ) => {
97
+ const [local, rest] = splitProps(props as SliderThumbProps, ["class", "children"]);
98
+
99
+ return (
100
+ <SliderPrimitive.Thumb
101
+ class={cn(
102
+ "block h-5 w-5 rounded-lg border-2 border-primary bg-background shadow-md transition-transform hover:scale-110 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50 cursor-grab active:cursor-grabbing z-10 data-[orientation=horizontal]:translate-x-0 data-[orientation=horizontal]:translate-y-0 data-[orientation=vertical]:translate-x-0 data-[orientation=vertical]:translate-y-0",
103
+ local.class
104
+ )}
105
+ {...(rest as any)}
106
+ >
107
+ <SliderPrimitive.Input />
108
+ {local.children}
109
+ </SliderPrimitive.Thumb>
110
+ );
111
+ };
112
+
113
+ export type SliderLabelProps<T extends ValidComponent = "label"> =
114
+ SliderPrimitive.SliderLabelProps<T> & {
115
+ class?: string;
116
+ };
117
+
118
+ /**
119
+ * Accessible label for the Slider component.
120
+ */
121
+ export const SliderLabel = <T extends ValidComponent = "label">(
122
+ props: SliderLabelProps<T>
123
+ ) => {
124
+ const [local, rest] = splitProps(props as SliderLabelProps, ["class"]);
125
+
126
+ return (
127
+ <SliderPrimitive.Label
128
+ class={cn("text-sm font-medium leading-none text-foreground", local.class)}
129
+ {...(rest as any)}
130
+ />
131
+ );
132
+ };
133
+
134
+ export type SliderValueLabelProps<T extends ValidComponent = "output"> =
135
+ SliderPrimitive.SliderValueLabelProps<T> & {
136
+ class?: string;
137
+ };
138
+
139
+ /**
140
+ * Displays current formatted value label for single or dual thumbs.
141
+ */
142
+ export const SliderValueLabel = <T extends ValidComponent = "output">(
143
+ props: SliderValueLabelProps<T>
144
+ ) => {
145
+ const [local, rest] = splitProps(props as SliderValueLabelProps, ["class"]);
146
+
147
+ return (
148
+ <SliderPrimitive.ValueLabel
149
+ class={cn("text-sm font-medium text-muted-foreground", local.class)}
150
+ {...(rest as any)}
151
+ />
152
+ );
153
+ };
@@ -47,12 +47,12 @@ export const Switch: Component<SwitchProps> = (props) => {
47
47
  <button
48
48
  type="button"
49
49
  role="switch"
50
- aria-checked={Boolean(isChecked())}
50
+ aria-checked={isChecked()}
51
51
  data-state={isChecked() ? "checked" : "unchecked"}
52
52
  disabled={local.disabled}
53
53
  onClick={toggle}
54
54
  class={cn(
55
- "peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-lg border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",
55
+ "peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-lg border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-muted",
56
56
  local.class
57
57
  )}
58
58
  {...rest}
@@ -153,7 +153,7 @@ export const TabsTrigger: Component<TabsTriggerProps> = (props) => {
153
153
  disabled={local.disabled}
154
154
  onClick={handleClick}
155
155
  class={cn(
156
- "inline-flex items-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm cursor-pointer",
156
+ "inline-flex items-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-accent data-[state=active]:border data-[state=active]:border-border data-[state=active]:text-foreground data-[state=active]:shadow-sm cursor-pointer",
157
157
  isVertical() ? "justify-start py-1.5" : "justify-center",
158
158
  local.class
159
159
  )}
@@ -57,7 +57,7 @@ export const Textarea: Component<TextareaProps> = (props) => {
57
57
  maxLength={local.maxLength}
58
58
  onInput={handleInput}
59
59
  class={cn(
60
- "flex min-h-[80px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-2xs transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
60
+ "flex min-h-20 w-full rounded-md border border-input bg-muted px-3 py-2 text-base shadow-2xs transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
61
61
  local.class
62
62
  )}
63
63
  {...rest}
@@ -83,7 +83,7 @@ export const ThemeToggle: Component<ThemeToggleProps> = (props) => {
83
83
  <DropdownMenu placement="bottom-end">
84
84
  <DropdownMenuTrigger
85
85
  as={Button}
86
- variant="outline"
86
+ variant="ghost"
87
87
  size="icon"
88
88
  class={cn("relative h-9 w-9 cursor-pointer", local.class)}
89
89
  >
@@ -83,7 +83,7 @@ export const ToastRegion: Component<ComponentProps<typeof KobalteToast.Region>>
83
83
  return (
84
84
  <KobalteToast.Region
85
85
  class={cn(
86
- "fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",
86
+ "fixed top-0 z-100 flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-105",
87
87
  local.class
88
88
  )}
89
89
  {...rest}
@@ -75,6 +75,11 @@ export const COMPONENT_METADATA: Record<string, ComponentMeta> = {
75
75
  description: "Displays a list of options for the user to pick from, built on Kobalte primitives.",
76
76
  dependencies: ["clsx", "tailwind-merge", "@kobalte/core"],
77
77
  },
78
+ combobox: {
79
+ title: "Combobox",
80
+ description: "Searchable autocomplete dropdown with single/multi-selection tags, avatars, group headers, and customizable clear controls.",
81
+ dependencies: ["clsx", "tailwind-merge", "@kobalte/core"],
82
+ },
78
83
  tabs: {
79
84
  title: "Tabs",
80
85
  description: "A set of layered sections of content displayed one at a time.",
@@ -169,6 +174,21 @@ export const COMPONENT_METADATA: Record<string, ComponentMeta> = {
169
174
  description: "Displays an indicator showing the completion progress of a task or media playback, built on Kobalte primitives.",
170
175
  dependencies: ["clsx", "tailwind-merge", "@kobalte/core"],
171
176
  },
177
+ slider: {
178
+ title: "Slider",
179
+ description: "Numeric range selection slider supporting single/dual thumbs, custom steps, vertical orientation, and formatted value labels, built on Kobalte primitives.",
180
+ dependencies: ["clsx", "tailwind-merge", "@kobalte/core"],
181
+ },
182
+ "pin-input": {
183
+ title: "Pin Input",
184
+ description: "Interactive multi-slot PIN/OTP input component for SMS and 2FA authentication verification codes.",
185
+ dependencies: ["clsx", "tailwind-merge"],
186
+ },
187
+ "hover-card": {
188
+ title: "Hover Card",
189
+ description: "Profile and link preview popover triggered on hover, built on Kobalte primitives.",
190
+ dependencies: ["clsx", "tailwind-merge", "@kobalte/core"],
191
+ },
172
192
  };
173
193
 
174
194
  /**