burne-ui 1.6.4 → 1.6.5
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 +11 -1
- package/cli/init.js +8 -2
- package/dist/components/composite/AlertDialog/AlertDialog.d.ts +1 -1
- package/dist/components/composite/AlertDialog/alertDialogA11y.d.ts +1 -0
- package/dist/components/composite/AlertDialog/alertDialogParts.d.ts +1 -1
- package/dist/components/composite/AlertDialog/alertDialogStyles.d.ts +3 -2
- package/dist/components/composite/AlertDialog/alertDialogTypes.d.ts +14 -1
- package/dist/components/composite/AlertDialog/useAlertDialogRootState.d.ts +1 -1
- package/dist/components/core/Breadcrumbs/breadcrumbsA11y.d.ts +3 -4
- package/dist/components/core/Calendar/calendarA11y.d.ts +5 -0
- package/dist/components/core/Calendar/calendarAPI.d.ts +22 -0
- package/dist/components/core/Calendar/calendarTypes.d.ts +9 -1
- package/dist/components/core/CloseButton/closeButtonA11y.d.ts +1 -1
- package/dist/components/core/CloseButton/closeButtonStyles.d.ts +1 -2
- package/dist/components/core/ColorPicker/colorPickerA11y.d.ts +10 -5
- package/dist/components/core/ColorPicker/colorPickerAnimations.d.ts +3 -1
- package/dist/components/core/ColorPicker/colorPickerStyles.d.ts +5 -5
- package/dist/components/core/ComboBox/comboBoxA11y.d.ts +4 -1
- package/dist/components/core/ComboBox/comboBoxStyles.d.ts +2 -2
- package/dist/components/core/Dialog/dialogParts.d.ts +1 -1
- package/dist/components/core/Dialog/dialogStyles.d.ts +3 -2
- package/dist/components/core/Dialog/dialogTypes.d.ts +3 -0
- package/dist/components/core/Drawer/drawerA11y.d.ts +4 -2
- package/dist/components/core/Drawer/drawerParts.d.ts +2 -2
- package/dist/components/core/Drawer/drawerStyles.d.ts +4 -3
- package/dist/components/core/Drawer/drawerTypes.d.ts +3 -0
- package/dist/components/core/Dropdown/dropdownA11y.d.ts +1 -0
- package/dist/components/core/Dropdown/dropdownAnimations.d.ts +3 -1
- package/dist/components/core/Dropdown/dropdownStyles.d.ts +3 -3
- package/dist/components/core/Dropdown/dropdownTypes.d.ts +8 -0
- package/dist/components/core/Input/inputA11y.d.ts +3 -3
- package/dist/components/core/ListBox/listBoxA11y.d.ts +3 -0
- package/dist/components/core/ListBox/listBoxAPI.d.ts +13 -0
- package/dist/components/core/ListBox/listBoxParts.d.ts +1 -1
- package/dist/components/core/ListBox/listBoxStyles.d.ts +1 -1
- package/dist/components/core/ListBox/listBoxTypes.d.ts +5 -0
- package/dist/components/core/Pagination/paginationA11y.d.ts +3 -4
- package/dist/components/core/Popover/popoverA11y.d.ts +8 -0
- package/dist/components/core/Popover/popoverStyles.d.ts +2 -2
- package/dist/components/core/SearchInput/searchInputA11y.d.ts +3 -3
- package/dist/components/core/SearchInput/searchInputStyles.d.ts +1 -0
- package/dist/components/core/SearchInput/searchInputTypes.d.ts +2 -0
- package/dist/components/core/SearchInput/useSearchInputRootState.d.ts +2 -2
- package/dist/components/core/Select/selectA11y.d.ts +4 -1
- package/dist/components/core/Select/selectAPI.d.ts +3 -0
- package/dist/components/core/Select/selectStyles.d.ts +4 -4
- package/dist/components/core/Skeleton/Skeleton.d.ts +3 -3
- package/dist/components/core/Skeleton/index.d.ts +5 -1
- package/dist/components/core/Skeleton/skeletonA11y.d.ts +5 -0
- package/dist/components/core/Skeleton/skeletonParts.d.ts +4 -0
- package/dist/components/core/Skeleton/skeletonTypes.d.ts +9 -0
- package/dist/components/core/Slider/useSliderTrackState.d.ts +2 -2
- package/dist/components/core/Switch/useSwitchRootState.d.ts +1 -1
- package/dist/components/core/Table/tableA11y.d.ts +9 -2
- package/dist/components/core/Table/tableAPI.d.ts +5 -0
- package/dist/components/core/Table/tableStyles.d.ts +7 -2
- package/dist/components/core/Table/tableTypes.d.ts +5 -0
- package/dist/components/core/TextArea/textAreaA11y.d.ts +1 -1
- package/dist/components/core/TextArea/textAreaStyles.d.ts +1 -1
- package/dist/components/core/TextArea/useTextAreaResize.d.ts +2 -1
- package/dist/components/core/TimeField/timeFieldA11y.d.ts +7 -5
- package/dist/components/core/TimeField/useTimeFieldControlState.d.ts +1 -1
- package/dist/components/core/TimeField/useTimeFieldRootState.d.ts +0 -1
- package/dist/components/core/Toast/toastA11y.d.ts +8 -2
- package/dist/components/core/Toast/toastStyles.d.ts +1 -1
- package/dist/components/core/Toast/toastTypes.d.ts +6 -0
- package/dist/components/core/Toast/useToastProviderState.d.ts +2 -1
- package/dist/components/core/Toast/useToastRootState.d.ts +0 -1
- package/dist/components/core/Tooltip/tooltipStyles.d.ts +2 -2
- package/dist/components/core/utils/typeahead.d.ts +20 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +13988 -12749
- package/dist/internal.cjs +1 -1
- package/dist/internal.js +1 -1
- package/dist/theme/BurneLabelsProvider.d.ts +17 -0
- package/dist/theme/BurneUIProvider.d.ts +11 -3
- package/dist/theme/burneLabels.d.ts +54 -0
- package/dist/theme/index.d.ts +4 -1
- package/dist/theme/themeConfig.d.ts +10 -0
- package/dist/theme/themeDefaults.d.ts +6 -0
- package/dist/theme/themeScript.d.ts +30 -0
- package/dist/{themeRuntimeContext-Cn9YgR1F.cjs → themeRuntimeContext-CQapx3IE.cjs} +11 -11
- package/dist/{themeRuntimeContext-rM9wHr74.js → themeRuntimeContext-DmzqBFsv.js} +737 -712
- package/dist/tokens/config.d.ts +2 -0
- package/dist/tokens/index.d.ts +2 -1
- package/dist/tokens/zIndex.d.ts +15 -0
- package/dist/ui.css +131 -19
- package/package.json +1 -1
- package/dist/components/core/Dialog/dialogA11y.d.ts +0 -1
package/dist/internal.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./themeRuntimeContext-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./themeRuntimeContext-CQapx3IE.cjs");exports.COLOR_CSS_VAR=e.COLOR_CSS_VAR;exports.CONTROL_SIZE_LAYOUT=e.CONTROL_SIZE_LAYOUT;exports.ConvergeRippleLayer=e.ConvergeRippleLayer;exports.DARK_COLORS=e.DARK_COLORS;exports.DEFAULT_FONT=e.DEFAULT_FONT;exports.DEFAULT_FONT_MONO=e.DEFAULT_FONT_MONO;exports.FIELD_SHELL_FOCUS_CLASS=e.FIELD_SHELL_FOCUS_CLASS;exports.FIELD_SHELL_TRANSITION_CLASS=e.FIELD_SHELL_TRANSITION_CLASS;exports.FONT_WEIGHT_CSS_VAR=e.FONT_WEIGHT_CSS_VAR;exports.FONT_WEIGHT_DEFAULTS=e.FONT_WEIGHT_DEFAULTS;exports.LIGHT_COLORS=e.LIGHT_COLORS;exports.MOTION_DEFAULTS=e.MOTION_DEFAULTS;exports.SCALE_DEFAULTS=e.SCALE_DEFAULTS;exports.SHADOW_LIFT_MOTION_CLASS=e.SHADOW_LIFT_MOTION_CLASS;exports.TEXT_SCALE_BASES=e.TEXT_SCALE_BASES;exports.activateThemeModePalette=e.activateThemeModePalette;exports.affixSlotClass=e.affixSlotClass;exports.affixToggleMinWClass=e.affixToggleMinWClass;exports.animateInteractiveHoverLift=e.animateInteractiveHoverLift;exports.animateInteractivePressSqueeze=e.animateInteractivePressSqueeze;exports.applyBurneThemeConfig=e.applyBurneThemeConfig;exports.applyCustomThemeTokens=e.applyCustomThemeTokens;exports.applyThemeMode=e.applyThemeMode;exports.applyThemeTokens=e.applyThemeTokens;exports.applyTokens=e.applyTokens;exports.buttonGroupOverlapBorderClasses=e.buttonGroupOverlapBorderClasses;exports.buttonGroupRoundingClasses=e.buttonGroupRoundingClasses;exports.buttonGroupSegmentSurfaceClasses=e.buttonGroupSegmentSurfaceClasses;exports.buttonGroupTextFrameClass=e.buttonGroupTextFrameClass;exports.buttonGroupTextSurfaceClasses=e.buttonGroupTextSurfaceClasses;exports.buttonRippleTone=e.buttonRippleTone;exports.buttonRootClass=e.buttonRootClass;exports.buttonSpinnerClass=e.buttonSpinnerClass;exports.clearCustomThemeTokens=e.clearCustomThemeTokens;exports.clearThemeInlineTokens=e.clearThemeInlineTokens;exports.controlShellClass=e.controlShellClass;exports.createConvergeRippleAtPointer=e.createConvergeRippleAtPointer;exports.createConvergeRippleFromPointer=e.createConvergeRippleFromPointer;exports.createDefaultBurneThemeConfig=e.createDefaultBurneThemeConfig;exports.createDefaultThemeState=e.createDefaultThemeState;exports.ensureModePalettes=e.ensureModePalettes;exports.ensureRippleEase=e.ensureRippleEase;exports.exportBurneThemeConfigSource=e.exportBurneThemeConfigSource;exports.exportBurneThemeCss=e.exportBurneThemeCss;exports.exportDefaultBurneThemeConfigSource=e.exportDefaultBurneThemeConfigSource;exports.exportThemeCss=e.exportThemeCss;exports.fieldShellHoverClass=e.fieldShellHoverClass;exports.firstLevelHoverShadow=e.firstLevelHoverShadow;exports.gsap=e.gsapWithCSS;exports.initElementShadow=e.initElementShadow;exports.killMotion=e.killMotion;exports.mergeThemeTokenOverrides=e.mergeThemeTokenOverrides;exports.patchThemeColor=e.patchThemeColor;exports.prefersReducedInteractiveHoverLift=e.prefersReducedInteractiveHoverLift;exports.readControlHeightPx=e.readControlHeightPx;exports.readShadowSize=e.readShadowSize;exports.resolveCustomThemeTokens=e.resolveCustomThemeTokens;exports.resolveTheme=e.resolveTheme;exports.resolveThemeTokenState=e.resolveThemeTokenState;exports.secondLevelShadow=e.secondLevelShadow;exports.shadowBase=e.shadowBase;exports.shadowLarge=e.shadowLarge;exports.shadowMid=e.shadowMid;exports.shadowNone=e.shadowNone;exports.shouldSkipInteractiveHoverLift=e.shouldSkipInteractiveHoverLift;exports.themeTokenStateToConfig=e.themeTokenStateToConfig;exports.useBurneThemeRuntime=e.useBurneThemeRuntime;exports.useBurneThemeRuntimeOptional=e.useBurneThemeRuntimeOptional;exports.useConvergeRipples=e.useConvergeRipples;exports.useFieldShellHoverLift=e.useFieldShellHoverLift;exports.useGSAP=e.useGSAP;exports.useInteractiveHoverLiftContainerHandlers=e.useInteractiveHoverLiftContainerHandlers;exports.usePersistentElShadow=e.usePersistentElShadow;exports.useSecondLevelShadow=e.useSecondLevelShadow;exports.useSecondLevelShadowContainer=e.useSecondLevelShadowContainer;
|
package/dist/internal.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as s, a as o, b as t, D as r, c as n, d as l, F as T, e as i, f as S, g as u, L as C, M as h, S as p, h as m, T as L, i as d, j as _, k as v, l as O, m as f, n as c, o as A, p as E, q as R, r as g, s as I, t as F, u as H, v as k, w as D, x as w, y as N, z as x, A as B, B as b, E as G, G as M, H as P, I as U, J as y, K as W, N as z, O as V, P as j, Q as q, R as K, U as X, V as Y, W as Z, X as J, Y as Q, Z as $, _ as ee, $ as ae, a0 as se, a1 as oe, a2 as te, a3 as re, a4 as ne, a5 as le, a6 as Te, a7 as ie, a8 as Se, a9 as ue, aa as Ce, ab as he, ac as pe, ad as me, ae as Le, af as de, ag as _e, ah as ve, ai as Oe, aj as fe, ak as ce } from "./themeRuntimeContext-
|
|
1
|
+
import { C as s, a as o, b as t, D as r, c as n, d as l, F as T, e as i, f as S, g as u, L as C, M as h, S as p, h as m, T as L, i as d, j as _, k as v, l as O, m as f, n as c, o as A, p as E, q as R, r as g, s as I, t as F, u as H, v as k, w as D, x as w, y as N, z as x, A as B, B as b, E as G, G as M, H as P, I as U, J as y, K as W, N as z, O as V, P as j, Q as q, R as K, U as X, V as Y, W as Z, X as J, Y as Q, Z as $, _ as ee, $ as ae, a0 as se, a1 as oe, a2 as te, a3 as re, a4 as ne, a5 as le, a6 as Te, a7 as ie, a8 as Se, a9 as ue, aa as Ce, ab as he, ac as pe, ad as me, ae as Le, af as de, ag as _e, ah as ve, ai as Oe, aj as fe, ak as ce } from "./themeRuntimeContext-DmzqBFsv.js";
|
|
2
2
|
export {
|
|
3
3
|
s as COLOR_CSS_VAR,
|
|
4
4
|
o as CONTROL_SIZE_LAYOUT,
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { BurneLabels, BurneLabelsKey } from './burneLabels';
|
|
3
|
+
export type BurneLabelsProviderProps = {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
/** Partial override of default accessible / UI strings. */
|
|
6
|
+
labels?: Partial<BurneLabels>;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Provides localized default aria / UI strings for burne-ui components.
|
|
10
|
+
* Usually used via `BurneUIProvider` (`labels` prop); stand-alone when you
|
|
11
|
+
* only need strings without theme/toast.
|
|
12
|
+
*/
|
|
13
|
+
export declare function BurneLabelsProvider({ children, labels }: BurneLabelsProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
/** Full merged label dictionary (defaults + overrides). Safe outside provider. */
|
|
15
|
+
export declare function useBurneLabels(): BurneLabels;
|
|
16
|
+
/** Single label by key. Safe outside provider (falls back to English defaults). */
|
|
17
|
+
export declare function useBurneLabel<K extends BurneLabelsKey>(key: K): BurneLabels[K];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { MotionConfig } from '../components/core/utils/motionConfig';
|
|
3
3
|
import { ToastProviderProps } from '../components/core/Toast/toastTypes';
|
|
4
|
+
import { BurneLabels } from './burneLabels';
|
|
4
5
|
import { BurneThemeConfig, BurneThemeMode, CustomThemeTokens, ThemeTokenOverrides } from './themeConfig';
|
|
5
6
|
import { ThemeProviderProps } from './ThemeProvider';
|
|
6
7
|
export type BurneUIProviderProps = {
|
|
@@ -16,6 +17,11 @@ export type BurneUIProviderProps = {
|
|
|
16
17
|
tokens?: ThemeTokenOverrides;
|
|
17
18
|
customTokens?: CustomThemeTokens;
|
|
18
19
|
motion?: Partial<MotionConfig>;
|
|
20
|
+
/**
|
|
21
|
+
* Override default accessible / UI strings (Close, Search, Pagination, …).
|
|
22
|
+
* Merged over English defaults. Prop wins over `config.labels`.
|
|
23
|
+
*/
|
|
24
|
+
labels?: Partial<BurneLabels>;
|
|
19
25
|
/**
|
|
20
26
|
* Wrap with `Toast.Provider`.
|
|
21
27
|
* Pass `false` to skip, or an options object for Toast defaults.
|
|
@@ -26,14 +32,16 @@ export type BurneUIProviderProps = {
|
|
|
26
32
|
onThemeChange?: ThemeProviderProps["onThemeChange"];
|
|
27
33
|
};
|
|
28
34
|
/**
|
|
29
|
-
* App-level provider: theme (`data-theme`), design tokens, motion, and Toast.
|
|
35
|
+
* App-level provider: theme (`data-theme`), design tokens, motion, labels, and Toast.
|
|
30
36
|
*
|
|
31
37
|
* @example
|
|
32
38
|
* ```tsx
|
|
33
|
-
* import { BurneUIProvider } from "burne-ui";
|
|
39
|
+
* import { BurneUIProvider, BURNE_LABELS_RU } from "burne-ui";
|
|
34
40
|
* import burneTheme from "./burne-theme";
|
|
35
41
|
*
|
|
36
|
-
* <BurneUIProvider config={burneTheme}
|
|
42
|
+
* <BurneUIProvider config={burneTheme} labels={BURNE_LABELS_RU}>
|
|
43
|
+
* {children}
|
|
44
|
+
* </BurneUIProvider>
|
|
37
45
|
* ```
|
|
38
46
|
*/
|
|
39
47
|
export declare function BurneUIProvider(props: BurneUIProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default accessible / UI strings used when a component does not receive an
|
|
3
|
+
* explicit `aria-label` (or visible label override).
|
|
4
|
+
*
|
|
5
|
+
* Pass a partial override via `BurneUIProvider` `labels` / `config.labels`,
|
|
6
|
+
* or wrap with `BurneLabelsProvider`. Templates use `{name}` placeholders.
|
|
7
|
+
*/
|
|
8
|
+
export type BurneLabels = {
|
|
9
|
+
close: string;
|
|
10
|
+
openSearch: string;
|
|
11
|
+
search: string;
|
|
12
|
+
clearField: string;
|
|
13
|
+
time: string;
|
|
14
|
+
timeHours: string;
|
|
15
|
+
timeMinutes: string;
|
|
16
|
+
timeSeconds: string;
|
|
17
|
+
openList: string;
|
|
18
|
+
closeList: string;
|
|
19
|
+
showPassword: string;
|
|
20
|
+
hidePassword: string;
|
|
21
|
+
removeFile: string;
|
|
22
|
+
resizeHeight: string;
|
|
23
|
+
breadcrumbs: string;
|
|
24
|
+
/** Template: `{count}` */
|
|
25
|
+
breadcrumbsShowHidden: string;
|
|
26
|
+
breadcrumbsHiddenSections: string;
|
|
27
|
+
pagination: string;
|
|
28
|
+
paginationPrevious: string;
|
|
29
|
+
paginationNext: string;
|
|
30
|
+
/** Template: `{n}` */
|
|
31
|
+
paginationPage: string;
|
|
32
|
+
drawerDragDownToClose: string;
|
|
33
|
+
drawerDragUpToClose: string;
|
|
34
|
+
drawerDragLeftToClose: string;
|
|
35
|
+
drawerDragRightToClose: string;
|
|
36
|
+
/** Template: `{placement}` */
|
|
37
|
+
toastNotifications: string;
|
|
38
|
+
colorPickerArea: string;
|
|
39
|
+
/** Template: `{saturation}`, `{brightness}` */
|
|
40
|
+
colorPickerAreaValue: string;
|
|
41
|
+
colorPickerContent: string;
|
|
42
|
+
colorPickerHex: string;
|
|
43
|
+
colorPickerAlpha: string;
|
|
44
|
+
/** Template: `{hex}` */
|
|
45
|
+
colorPickerSelected: string;
|
|
46
|
+
};
|
|
47
|
+
export type BurneLabelsKey = keyof BurneLabels;
|
|
48
|
+
/** English defaults shipped with the library. */
|
|
49
|
+
export declare const DEFAULT_BURNE_LABELS: BurneLabels;
|
|
50
|
+
/** Russian preset — pass to `BurneUIProvider` `labels={BURNE_LABELS_RU}`. */
|
|
51
|
+
export declare const BURNE_LABELS_RU: BurneLabels;
|
|
52
|
+
export declare function mergeBurneLabels(partial?: Partial<BurneLabels> | null): BurneLabels;
|
|
53
|
+
/** Replace `{name}` placeholders in a label template. */
|
|
54
|
+
export declare function formatBurneLabel(template: string, vars: Record<string, string | number>): string;
|
package/dist/theme/index.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
export { applyThemeTokens, clearThemeInlineTokens, createDefaultThemeState, ensureModePalettes, activateThemeModePalette, patchThemeColor, exportThemeCss, COLOR_CSS_VAR, DEFAULT_FONT, DEFAULT_FONT_MONO, FONT_WEIGHT_CSS_VAR, FONT_WEIGHT_DEFAULTS, MOTION_DEFAULTS, SCALE_DEFAULTS, TEXT_SCALE_BASES, type ThemeColorKey, type ThemeColors, type ThemeDerivedColorKey, type ThemeFontWeightKey, type ThemeFontWeights, type ThemeMode, type ThemeStatusForegroundKey, type ThemeStatusForegrounds, type ThemeTokenState, } from './themeDefaults';
|
|
2
2
|
export { DARK_COLORS, LIGHT_COLORS } from './themePalettes';
|
|
3
|
-
export { applyBurneThemeConfig, applyCustomThemeTokens, applyTokens, clearCustomThemeTokens, exportBurneThemeConfigSource, exportBurneThemeCss, mergeThemeTokenOverrides, resolveTheme, resolveCustomThemeTokens, resolveThemeTokenState, createDefaultBurneThemeConfig, exportDefaultBurneThemeConfigSource, themeTokenStateToConfig, type BurneThemeConfig, type BurneThemeMode, type CustomThemeTokenControl, type CustomThemeTokenDefinition, type CustomThemeTokens, type CustomThemeTokenValue, type ThemeModeColorOverrides, type ThemeTokenOverrides, } from './themeConfig';
|
|
3
|
+
export { applyBurneThemeConfig, applyCustomThemeTokens, applyTokens, clearCustomThemeTokens, exportBurneThemeConfigSource, exportBurneThemeCss, mergeThemeTokenOverrides, resolveTheme, resolveCustomThemeTokens, resolveThemeTokenState, createDefaultBurneThemeConfig, exportDefaultBurneThemeConfigSource, themeTokenStateToConfig, DEFAULT_THEME_STORAGE_KEY, type BurneThemeConfig, type BurneThemeMode, type CustomThemeTokenControl, type CustomThemeTokenDefinition, type CustomThemeTokens, type CustomThemeTokenValue, type ThemeModeColorOverrides, type ThemeTokenOverrides, } from './themeConfig';
|
|
4
4
|
export { ThemeProvider, applyThemeMode, useBurneTheme, useBurneThemeOptional, type BurneThemeContextValue, type ThemeProviderProps, } from './ThemeProvider';
|
|
5
|
+
export { ThemeScript, getThemeScript, type ThemeScriptOptions, type ThemeScriptProps, } from './themeScript';
|
|
5
6
|
export { BurneUIProvider, type BurneUIProviderProps } from './BurneUIProvider';
|
|
7
|
+
export { BurneLabelsProvider, useBurneLabel, useBurneLabels, type BurneLabelsProviderProps, } from './BurneLabelsProvider';
|
|
8
|
+
export { BURNE_LABELS_RU, DEFAULT_BURNE_LABELS, formatBurneLabel, mergeBurneLabels, type BurneLabels, type BurneLabelsKey, } from './burneLabels';
|
|
6
9
|
export { useBurneThemeRuntime, useBurneThemeRuntimeOptional, type BurneThemeRuntimeContextValue, } from './themeRuntimeContext';
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { MotionConfig } from '../components/core/utils/motionConfig';
|
|
2
2
|
import { ToastProviderProps } from '../components/core/Toast/toastTypes';
|
|
3
|
+
import { BurneLabels } from './burneLabels';
|
|
3
4
|
import { ThemeColors, ThemeFontWeights, ThemeMode, ThemeTokenState } from './themeDefaults';
|
|
4
5
|
/** Color mode for ThemeProvider / BurneUIProvider (`system` follows OS). */
|
|
5
6
|
export type BurneThemeMode = ThemeMode | "system";
|
|
7
|
+
/** Default `localStorage` key for theme persistence. */
|
|
8
|
+
export declare const DEFAULT_THEME_STORAGE_KEY = "burne-ui-theme";
|
|
6
9
|
/**
|
|
7
10
|
* Shared (mode-independent) token overrides.
|
|
8
11
|
* Colors live only under `BurneThemeConfig.colors`.
|
|
@@ -12,6 +15,8 @@ export type ThemeTokenOverrides = {
|
|
|
12
15
|
size?: number;
|
|
13
16
|
radius?: number;
|
|
14
17
|
borderWidth?: number;
|
|
18
|
+
focusRingWidth?: number;
|
|
19
|
+
focusRingOffset?: number;
|
|
15
20
|
textScale?: number;
|
|
16
21
|
fontFamily?: string;
|
|
17
22
|
fontFamilyMono?: string;
|
|
@@ -65,6 +70,11 @@ export type BurneThemeConfig = {
|
|
|
65
70
|
motion?: Partial<MotionConfig>;
|
|
66
71
|
/** Wrap children with `Toast.Provider`. @default true */
|
|
67
72
|
toast?: boolean | Omit<ToastProviderProps, "children">;
|
|
73
|
+
/**
|
|
74
|
+
* Override default accessible / UI strings (Close, Search, Pagination, …).
|
|
75
|
+
* Merged over English defaults. See `DEFAULT_BURNE_LABELS` / `BURNE_LABELS_RU`.
|
|
76
|
+
*/
|
|
77
|
+
labels?: Partial<BurneLabels>;
|
|
68
78
|
};
|
|
69
79
|
/** Merge shared `tokens` with `colors[mode]` into a full `ThemeTokenState`. */
|
|
70
80
|
export declare function resolveThemeTokenState(config: Pick<BurneThemeConfig, "tokens" | "colors">, mode: ThemeMode): ThemeTokenState;
|
|
@@ -16,6 +16,10 @@ export type ThemeTokenState = {
|
|
|
16
16
|
size: number;
|
|
17
17
|
radius: number;
|
|
18
18
|
borderWidth: number;
|
|
19
|
+
/** Keyboard focus ring outline width (`--focus-ring-width`), px. */
|
|
20
|
+
focusRingWidth: number;
|
|
21
|
+
/** Keyboard focus ring outline offset (`--focus-ring-offset`), px. */
|
|
22
|
+
focusRingOffset: number;
|
|
19
23
|
textScale: number;
|
|
20
24
|
fontFamily: string;
|
|
21
25
|
fontFamilyMono: string;
|
|
@@ -73,6 +77,8 @@ export declare const SCALE_DEFAULTS: {
|
|
|
73
77
|
readonly size: 1;
|
|
74
78
|
readonly radius: 0.5;
|
|
75
79
|
readonly borderWidth: 1;
|
|
80
|
+
readonly focusRingWidth: 2;
|
|
81
|
+
readonly focusRingOffset: 0;
|
|
76
82
|
readonly textScale: 1;
|
|
77
83
|
readonly shadowStrength: 1;
|
|
78
84
|
readonly shadowSize: 1;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { DEFAULT_THEME_STORAGE_KEY, BurneThemeMode } from './themeConfig';
|
|
3
|
+
export type ThemeScriptOptions = {
|
|
4
|
+
/**
|
|
5
|
+
* Same key as `ThemeProvider` / `BurneUIProvider` `storageKey`.
|
|
6
|
+
* @default "burne-ui-theme"
|
|
7
|
+
*/
|
|
8
|
+
storageKey?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Same as provider `defaultTheme` when storage is empty / invalid.
|
|
11
|
+
* @default "dark"
|
|
12
|
+
*/
|
|
13
|
+
defaultTheme?: BurneThemeMode;
|
|
14
|
+
};
|
|
15
|
+
export type ThemeScriptProps = ThemeScriptOptions & {
|
|
16
|
+
/** CSP nonce for the inline `<script>`. */
|
|
17
|
+
nonce?: string;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Blocking inline script that applies `data-theme` before first paint.
|
|
21
|
+
* Place in root layout `<head>` (or as first child of `<html>`) with
|
|
22
|
+
* `suppressHydrationWarning` on `<html>` to avoid SSR theme flash.
|
|
23
|
+
*/
|
|
24
|
+
export declare function getThemeScript(options?: ThemeScriptOptions): string;
|
|
25
|
+
/**
|
|
26
|
+
* Renders the no-flash theme bootstrap `<script>`.
|
|
27
|
+
* Safe in Server Components (no hooks) — e.g. Next.js App Router `layout.tsx`.
|
|
28
|
+
*/
|
|
29
|
+
export declare function ThemeScript({ storageKey, defaultTheme, nonce, }?: ThemeScriptProps): ReactElement;
|
|
30
|
+
export { DEFAULT_THEME_STORAGE_KEY };
|