@kbach/react 0.5.38 → 0.5.41
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/README.md +173 -98
- package/dist/{chunk-EJFQKJPT.mjs → chunk-AAPA3CRV.mjs} +40 -59
- package/dist/{chunk-W7UBSRE5.mjs → chunk-GOQNOKFN.mjs} +19 -12
- package/dist/{chunk-NWVL4BES.mjs → chunk-VCNP57PR.mjs} +408 -1019
- package/dist/index.d.mts +10 -20
- package/dist/index.d.ts +10 -20
- package/dist/index.js +443 -1051
- package/dist/index.mjs +40 -22
- package/dist/jsx-dev-runtime.d.mts +6 -4
- package/dist/jsx-dev-runtime.d.ts +6 -4
- package/dist/jsx-dev-runtime.js +445 -1078
- package/dist/jsx-dev-runtime.mjs +10 -5
- package/dist/jsx-runtime.d.mts +2 -3
- package/dist/jsx-runtime.d.ts +2 -3
- package/dist/jsx-runtime.js +443 -1076
- package/dist/jsx-runtime.mjs +5 -3
- package/dist/types-D-24rbXu.d.mts +126 -0
- package/dist/types-D-24rbXu.d.ts +126 -0
- package/dist/vite-plugin.d.mts +1 -1
- package/dist/vite-plugin.d.ts +1 -1
- package/dist/vite-plugin.js +303 -842
- package/dist/vite-plugin.mjs +76 -25
- package/package.json +4 -2
- package/types.d.ts +1 -0
- package/dist/types-CV5vXnSH.d.mts +0 -70
- package/dist/types-CV5vXnSH.d.ts +0 -70
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import React__default, { ReactNode, ComponentType, ForwardRefExoticComponent } from 'react';
|
|
3
|
-
import { T as ThemeColors, a as ThemeConfig, P as ParsedClass, R as ResolvedStyle, S as StyleValue, F as FrameworkConfig, b as ResolvedConfig, c as ThemeMode } from './types-
|
|
4
|
-
export { d as PluginAPI } from './types-
|
|
3
|
+
import { T as ThemeColors, a as ThemeConfig, P as ParsedClass, R as ResolvedStyle, S as StyleValue, F as FrameworkConfig, b as ResolvedConfig, c as ThemeMode } from './types-D-24rbXu.mjs';
|
|
4
|
+
export { d as PluginAPI } from './types-D-24rbXu.mjs';
|
|
5
5
|
|
|
6
6
|
declare const defaultColors: ThemeColors;
|
|
7
7
|
declare const defaultTheme: ThemeConfig;
|
|
@@ -9,10 +9,8 @@ declare const defaultTheme: ThemeConfig;
|
|
|
9
9
|
declare function parseClass(className: string): ParsedClass | null;
|
|
10
10
|
/**
|
|
11
11
|
* Split a class string into tokens. Whitespace at bracket depth > 0 is STRIPPED
|
|
12
|
-
* (not just skipped
|
|
13
|
-
*
|
|
14
|
-
* Spaces inside brackets are illegal in HTML class attributes and would cause the
|
|
15
|
-
* browser to split the class into multiple broken tokens.
|
|
12
|
+
* (not just skipped) so that arbitrary values like rgb(41, 172, 15) become valid
|
|
13
|
+
* CSS class name tokens: bg-[rgb(41,172,15)].
|
|
16
14
|
*/
|
|
17
15
|
declare function splitClassTokens(classString: string): string[];
|
|
18
16
|
/**
|
|
@@ -26,25 +24,17 @@ declare function parseClasses(classString: string): ParsedClass[];
|
|
|
26
24
|
/**
|
|
27
25
|
* Resolve a class string to a ResolvedStyle object.
|
|
28
26
|
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
* - 'hover' → hover styles
|
|
33
|
-
* - 'dark:hover' → combined dark + hover
|
|
34
|
-
* - etc.
|
|
35
|
-
*
|
|
36
|
-
* Results are cached — repeated calls with the same string are O(1).
|
|
27
|
+
* Results are cached per (theme, classString, darkMode) — repeated calls with
|
|
28
|
+
* the same arguments are O(1). Different theme objects each get their own
|
|
29
|
+
* cache so concurrent ThemeProviders with different configs are always correct.
|
|
37
30
|
*/
|
|
38
31
|
declare function resolve(classString: string, theme: ThemeConfig, darkMode?: 'attribute' | 'class' | 'media'): ResolvedStyle;
|
|
39
32
|
/**
|
|
40
|
-
* Flatten a ResolvedStyle into a single StyleValue for the
|
|
33
|
+
* Flatten a ResolvedStyle into a single StyleValue for the current runtime state.
|
|
41
34
|
* Used by useStyles() and styled().
|
|
42
35
|
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
* @param state Interaction state flags
|
|
46
|
-
* @param breakpoints Active breakpoint names (sm, md, lg, xl, 2xl). On web,
|
|
47
|
-
* pass an empty Set — CSS @media rules handle responsive.
|
|
36
|
+
* The sort step is memoized per resolved object reference (#6) — when resolve()
|
|
37
|
+
* returns a cached object, getSortedEntries() is O(1) on all subsequent calls.
|
|
48
38
|
*/
|
|
49
39
|
declare function flatten(resolved: ResolvedStyle, isDark: boolean, state?: {
|
|
50
40
|
hover?: boolean;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import React__default, { ReactNode, ComponentType, ForwardRefExoticComponent } from 'react';
|
|
3
|
-
import { T as ThemeColors, a as ThemeConfig, P as ParsedClass, R as ResolvedStyle, S as StyleValue, F as FrameworkConfig, b as ResolvedConfig, c as ThemeMode } from './types-
|
|
4
|
-
export { d as PluginAPI } from './types-
|
|
3
|
+
import { T as ThemeColors, a as ThemeConfig, P as ParsedClass, R as ResolvedStyle, S as StyleValue, F as FrameworkConfig, b as ResolvedConfig, c as ThemeMode } from './types-D-24rbXu.js';
|
|
4
|
+
export { d as PluginAPI } from './types-D-24rbXu.js';
|
|
5
5
|
|
|
6
6
|
declare const defaultColors: ThemeColors;
|
|
7
7
|
declare const defaultTheme: ThemeConfig;
|
|
@@ -9,10 +9,8 @@ declare const defaultTheme: ThemeConfig;
|
|
|
9
9
|
declare function parseClass(className: string): ParsedClass | null;
|
|
10
10
|
/**
|
|
11
11
|
* Split a class string into tokens. Whitespace at bracket depth > 0 is STRIPPED
|
|
12
|
-
* (not just skipped
|
|
13
|
-
*
|
|
14
|
-
* Spaces inside brackets are illegal in HTML class attributes and would cause the
|
|
15
|
-
* browser to split the class into multiple broken tokens.
|
|
12
|
+
* (not just skipped) so that arbitrary values like rgb(41, 172, 15) become valid
|
|
13
|
+
* CSS class name tokens: bg-[rgb(41,172,15)].
|
|
16
14
|
*/
|
|
17
15
|
declare function splitClassTokens(classString: string): string[];
|
|
18
16
|
/**
|
|
@@ -26,25 +24,17 @@ declare function parseClasses(classString: string): ParsedClass[];
|
|
|
26
24
|
/**
|
|
27
25
|
* Resolve a class string to a ResolvedStyle object.
|
|
28
26
|
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
* - 'hover' → hover styles
|
|
33
|
-
* - 'dark:hover' → combined dark + hover
|
|
34
|
-
* - etc.
|
|
35
|
-
*
|
|
36
|
-
* Results are cached — repeated calls with the same string are O(1).
|
|
27
|
+
* Results are cached per (theme, classString, darkMode) — repeated calls with
|
|
28
|
+
* the same arguments are O(1). Different theme objects each get their own
|
|
29
|
+
* cache so concurrent ThemeProviders with different configs are always correct.
|
|
37
30
|
*/
|
|
38
31
|
declare function resolve(classString: string, theme: ThemeConfig, darkMode?: 'attribute' | 'class' | 'media'): ResolvedStyle;
|
|
39
32
|
/**
|
|
40
|
-
* Flatten a ResolvedStyle into a single StyleValue for the
|
|
33
|
+
* Flatten a ResolvedStyle into a single StyleValue for the current runtime state.
|
|
41
34
|
* Used by useStyles() and styled().
|
|
42
35
|
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
* @param state Interaction state flags
|
|
46
|
-
* @param breakpoints Active breakpoint names (sm, md, lg, xl, 2xl). On web,
|
|
47
|
-
* pass an empty Set — CSS @media rules handle responsive.
|
|
36
|
+
* The sort step is memoized per resolved object reference (#6) — when resolve()
|
|
37
|
+
* returns a cached object, getSortedEntries() is O(1) on all subsequent calls.
|
|
48
38
|
*/
|
|
49
39
|
declare function flatten(resolved: ResolvedStyle, isDark: boolean, state?: {
|
|
50
40
|
hover?: boolean;
|