@kbach/react 0.5.62 → 0.6.1
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 +51 -9
- package/dist/{chunk-5MX3E4OL.mjs → chunk-36QRQNPL.mjs} +77 -73
- package/dist/{chunk-MZKQ7H67.mjs → chunk-6ZORO3BP.mjs} +6 -64
- package/dist/{chunk-BRCQK5DA.mjs → chunk-MPHPB357.mjs} +143 -170
- package/dist/index.d.mts +12 -29
- package/dist/index.d.ts +12 -29
- package/dist/index.js +344 -536
- package/dist/index.mjs +62 -231
- package/dist/jsx-dev-runtime.js +204 -289
- package/dist/jsx-dev-runtime.mjs +4 -4
- package/dist/jsx-runtime.js +203 -288
- package/dist/jsx-runtime.mjs +3 -3
- package/dist/vite-plugin.js +139 -163
- package/dist/vite-plugin.mjs +3 -2
- package/kbach-react.md +14 -8
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -7,6 +7,8 @@ export { r as registerWebElement } from './web-substitute-CfpYFnE7.js';
|
|
|
7
7
|
declare const defaultColors: ThemeColors;
|
|
8
8
|
declare const defaultTheme: ThemeConfig;
|
|
9
9
|
|
|
10
|
+
declare function setResolveTarget(target: 'web' | 'native' | null): void;
|
|
11
|
+
|
|
10
12
|
declare function parseClass(className: string): ParsedClass | null;
|
|
11
13
|
/**
|
|
12
14
|
* Split a class string into tokens. Whitespace at bracket depth > 0 is STRIPPED
|
|
@@ -48,6 +50,14 @@ declare function flatten(resolved: ResolvedStyle, isDark: boolean, state?: {
|
|
|
48
50
|
visited?: boolean;
|
|
49
51
|
placeholder?: boolean;
|
|
50
52
|
}, breakpoints?: Set<string>): StyleValue;
|
|
53
|
+
/**
|
|
54
|
+
* Clear CSS injection state so stale rules are re-injected when the theme changes.
|
|
55
|
+
*
|
|
56
|
+
* The per-theme style cache (WeakMap) does not need to be cleared manually:
|
|
57
|
+
* updateConfig() creates a new theme object, making the old cache entry
|
|
58
|
+
* automatically unreachable for GC.
|
|
59
|
+
*/
|
|
60
|
+
declare function clearCache(): void;
|
|
51
61
|
|
|
52
62
|
/**
|
|
53
63
|
* Load, merge, and cache the resolved config.
|
|
@@ -133,34 +143,6 @@ interface ThemeProviderProps {
|
|
|
133
143
|
}
|
|
134
144
|
declare function ThemeProvider({ children, defaultMode, colorScheme, windowWidth: windowWidthProp, config: configOverride, disablePersistence, }: ThemeProviderProps): React__default.JSX.Element;
|
|
135
145
|
|
|
136
|
-
type ToggleVariant = 'button' | 'switch' | 'icon-button';
|
|
137
|
-
interface ThemeToggleProps {
|
|
138
|
-
/** Visual variant. Default: 'button' */
|
|
139
|
-
variant?: ToggleVariant;
|
|
140
|
-
/** Override label text (button variant) */
|
|
141
|
-
label?: string;
|
|
142
|
-
/** Custom light-mode label */
|
|
143
|
-
lightLabel?: string;
|
|
144
|
-
/** Custom dark-mode label */
|
|
145
|
-
darkLabel?: string;
|
|
146
|
-
/** Show system mode option */
|
|
147
|
-
includeSystem?: boolean;
|
|
148
|
-
/** Custom styles applied to the root container */
|
|
149
|
-
style?: object;
|
|
150
|
-
/** Custom styles for the label text */
|
|
151
|
-
labelStyle?: object;
|
|
152
|
-
}
|
|
153
|
-
/**
|
|
154
|
-
* Drop-in theme toggle. Works on web and React Native.
|
|
155
|
-
*
|
|
156
|
-
* ```tsx
|
|
157
|
-
* <ThemeToggle />
|
|
158
|
-
* <ThemeToggle variant="switch" />
|
|
159
|
-
* <ThemeToggle variant="icon-button" lightLabel="☀️" darkLabel="🌙" />
|
|
160
|
-
* ```
|
|
161
|
-
*/
|
|
162
|
-
declare function ThemeToggle({ variant, label, lightLabel, darkLabel, includeSystem, style, labelStyle, }: ThemeToggleProps): React__default.JSX.Element;
|
|
163
|
-
|
|
164
146
|
interface StyledProps {
|
|
165
147
|
/** Additional utility classes applied on top of the base classes */
|
|
166
148
|
kb?: string;
|
|
@@ -257,6 +239,7 @@ interface InteractiveWrapperProps {
|
|
|
257
239
|
onPointerDown?: (...args: any[]) => void;
|
|
258
240
|
onPointerUp?: (...args: any[]) => void;
|
|
259
241
|
onPointerLeave?: (...args: any[]) => void;
|
|
242
|
+
onPointerCancel?: (...args: any[]) => void;
|
|
260
243
|
onMouseEnter?: (...args: any[]) => void;
|
|
261
244
|
onMouseLeave?: (...args: any[]) => void;
|
|
262
245
|
onFocus?: (...args: any[]) => void;
|
|
@@ -306,4 +289,4 @@ declare function kb(classString: string, isDark?: boolean): StyleValue | string;
|
|
|
306
289
|
*/
|
|
307
290
|
declare function cx(...classes: Array<string | false | null | undefined>): string;
|
|
308
291
|
|
|
309
|
-
export { type ColorScale, type ColorsAPI, FrameworkConfig, type InteractionState, InteractiveWrapper, type InteractiveWrapperProps, ParsedClass, ResolvedConfig, ResolvedStyle, StyleValue, type StyledProps, ThemeConfig, ThemeContext, type ThemeContextValue, ThemeMode, ThemeProvider, type ThemeProviderProps,
|
|
292
|
+
export { type ColorScale, type ColorsAPI, FrameworkConfig, type InteractionState, InteractiveWrapper, type InteractiveWrapperProps, ParsedClass, ResolvedConfig, ResolvedStyle, StyleValue, type StyledProps, ThemeConfig, ThemeContext, type ThemeContextValue, ThemeMode, ThemeProvider, type ThemeProviderProps, buildConfig, clearCache, cx, defaultColors, defaultTheme, disableRuntimeCSS, flatten, getConfig, initConfig, kb, normalizeClassString, parseClass, parseClasses, resolve, setResolveTarget, splitClassTokens, styled, updateConfig, useBreakpoint, useColors, useGlobalDarkMode, useIsDark, useResolvedStyle, useResponsive, useStyles, useTheme, wrapColors };
|