@c9up/aurora 0.1.13 → 0.1.14
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/dist/cn.d.ts +27 -0
- package/dist/cn.js +908 -0
- package/dist/hydrate.js +74 -8
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/render.js +11 -0
- package/dist/server/renderPage.d.ts +8 -0
- package/dist/server/renderPage.js +8 -1
- package/dist/ssr.js +14 -56
- package/dist/url.d.ts +33 -0
- package/dist/url.js +68 -0
- package/package.json +1 -1
- package/src/cn.ts +979 -0
- package/src/hydrate.ts +107 -8
- package/src/index.ts +2 -0
- package/src/render.ts +13 -0
- package/src/server/renderPage.ts +16 -1
- package/src/ssr.ts +14 -53
- package/src/url.ts +91 -0
package/dist/cn.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `cn` — class-name composition with Tailwind conflict resolution, reimplemented
|
|
3
|
+
* from scratch with ZERO dependencies (no clsx, no tailwind-merge).
|
|
4
|
+
*
|
|
5
|
+
* cn('px-2 py-1', isActive && 'bg-indigo-600', props.class)
|
|
6
|
+
* cn('px-2', 'px-4') // → 'px-4' (later wins within a group)
|
|
7
|
+
* cn('mr-4', 'mr-8') // → 'mr-8' (dedup is the whole point)
|
|
8
|
+
* cn('text-red-500', 'text-sm') // → 'text-red-500 text-sm' (different groups)
|
|
9
|
+
* cn('hover:p-2', 'hover:p-4', 'p-1')// → 'p-1 hover:p-4' (variant-scoped)
|
|
10
|
+
*
|
|
11
|
+
* Two parts:
|
|
12
|
+
* 1. {@link clsx} — flatten strings / numbers / arrays / objects into a class
|
|
13
|
+
* string, dropping falsy values (full clsx semantics).
|
|
14
|
+
* 2. {@link twMerge} — within the SAME variant stack (`hover:`, `md:`, `!`, …),
|
|
15
|
+
* keep only the LAST class of each conflicting Tailwind group; unknown
|
|
16
|
+
* classes never conflict and are always kept, in source order.
|
|
17
|
+
*
|
|
18
|
+
* Targets the standard Tailwind v4 utility set. Node-free — part of aurora's
|
|
19
|
+
* client runtime.
|
|
20
|
+
*/
|
|
21
|
+
export type ClassValue = ClassValue[] | Record<string, unknown> | string | number | bigint | null | boolean | undefined;
|
|
22
|
+
/** clsx-equivalent: join truthy class values (strings, numbers, arrays, objects). */
|
|
23
|
+
export declare function clsx(...inputs: ClassValue[]): string;
|
|
24
|
+
/** Resolve Tailwind class conflicts: within a variant scope, the last class of each group wins. */
|
|
25
|
+
export declare function twMerge(classList: string): string;
|
|
26
|
+
/** Compose class values (clsx) then resolve Tailwind conflicts (twMerge). */
|
|
27
|
+
export declare function cn(...inputs: ClassValue[]): string;
|