@newtonedev/components 0.1.12 → 0.1.13
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/_COMPONENT_TEMPLATE/ComponentName.styles.d.ts +3 -2
- package/dist/_COMPONENT_TEMPLATE/ComponentName.styles.d.ts.map +1 -1
- package/dist/_COMPONENT_TEMPLATE/ComponentName.types.d.ts +1 -1
- package/dist/_COMPONENT_TEMPLATE/ComponentName.types.d.ts.map +1 -1
- package/dist/composites/actions/Button/Button.styles.d.ts +1 -1
- package/dist/composites/actions/Button/Button.styles.d.ts.map +1 -1
- package/dist/composites/form-controls/Select/Select.d.ts.map +1 -1
- package/dist/composites/form-controls/Select/Select.styles.d.ts +2 -2
- package/dist/composites/form-controls/Select/Select.styles.d.ts.map +1 -1
- package/dist/composites/form-controls/Select/SelectOption.d.ts.map +1 -1
- package/dist/composites/form-controls/TextInput/TextInput.d.ts.map +1 -1
- package/dist/composites/form-controls/TextInput/TextInput.styles.d.ts +2 -2
- package/dist/composites/form-controls/TextInput/TextInput.styles.d.ts.map +1 -1
- package/dist/composites/form-controls/Toggle/Toggle.styles.d.ts +2 -2
- package/dist/composites/form-controls/Toggle/Toggle.styles.d.ts.map +1 -1
- package/dist/composites/layout/AppShell/AppShell.styles.d.ts +2 -2
- package/dist/composites/layout/AppShell/AppShell.styles.d.ts.map +1 -1
- package/dist/composites/layout/Card/Card.styles.d.ts +2 -2
- package/dist/composites/layout/Card/Card.styles.d.ts.map +1 -1
- package/dist/composites/layout/Card/Card.types.d.ts +1 -1
- package/dist/composites/layout/Card/Card.types.d.ts.map +1 -1
- package/dist/composites/layout/Navbar/Navbar.styles.d.ts +3 -2
- package/dist/composites/layout/Navbar/Navbar.styles.d.ts.map +1 -1
- package/dist/composites/layout/Sidebar/Sidebar.styles.d.ts +3 -2
- package/dist/composites/layout/Sidebar/Sidebar.styles.d.ts.map +1 -1
- package/dist/composites/overlays/Popover/Popover.styles.d.ts +2 -2
- package/dist/composites/overlays/Popover/Popover.styles.d.ts.map +1 -1
- package/dist/composites/range-inputs/ColorScaleSlider/ColorScaleSlider.d.ts +1 -1
- package/dist/composites/range-inputs/ColorScaleSlider/ColorScaleSlider.d.ts.map +1 -1
- package/dist/composites/range-inputs/ColorScaleSlider/ColorScaleSlider.styles.d.ts +2 -2
- package/dist/composites/range-inputs/ColorScaleSlider/ColorScaleSlider.styles.d.ts.map +1 -1
- package/dist/composites/range-inputs/ColorScaleSlider/ColorScaleSlider.types.d.ts +2 -0
- package/dist/composites/range-inputs/ColorScaleSlider/ColorScaleSlider.types.d.ts.map +1 -1
- package/dist/composites/range-inputs/HueSlider/HueSlider.d.ts +3 -4
- package/dist/composites/range-inputs/HueSlider/HueSlider.d.ts.map +1 -1
- package/dist/composites/range-inputs/HueSlider/HueSlider.styles.d.ts +4 -4
- package/dist/composites/range-inputs/HueSlider/HueSlider.styles.d.ts.map +1 -1
- package/dist/composites/range-inputs/Slider/Slider.styles.d.ts +2 -2
- package/dist/composites/range-inputs/Slider/Slider.styles.d.ts.map +1 -1
- package/dist/index.cjs +1232 -1823
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +12 -24
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1084 -1737
- package/dist/index.js.map +1 -1
- package/dist/primitives/Frame/Frame.d.ts.map +1 -1
- package/dist/primitives/Frame/Frame.styles.d.ts +3 -2
- package/dist/primitives/Frame/Frame.styles.d.ts.map +1 -1
- package/dist/primitives/Frame/Frame.types.d.ts +1 -1
- package/dist/primitives/Frame/Frame.types.d.ts.map +1 -1
- package/dist/primitives/Frame/Frame.utils.d.ts +1 -1
- package/dist/primitives/Frame/Frame.utils.d.ts.map +1 -1
- package/dist/primitives/Icon/Icon.d.ts.map +1 -1
- package/dist/primitives/Text/Text.d.ts +1 -1
- package/dist/primitives/Text/Text.d.ts.map +1 -1
- package/dist/primitives/Text/Text.types.d.ts +1 -1
- package/dist/primitives/Text/Text.types.d.ts.map +1 -1
- package/dist/primitives/Wrapper/Wrapper.styles.d.ts +1 -1
- package/dist/primitives/Wrapper/Wrapper.styles.d.ts.map +1 -1
- package/package.json +3 -2
- package/src/_COMPONENT_TEMPLATE/ComponentName.styles.ts +4 -4
- package/src/_COMPONENT_TEMPLATE/ComponentName.tsx +2 -2
- package/src/_COMPONENT_TEMPLATE/ComponentName.types.ts +1 -1
- package/src/composites/actions/Button/Button.styles.ts +37 -36
- package/src/composites/actions/Button/Button.tsx +1 -1
- package/src/composites/form-controls/Select/Select.styles.ts +8 -8
- package/src/composites/form-controls/Select/Select.tsx +4 -5
- package/src/composites/form-controls/Select/SelectOption.tsx +7 -8
- package/src/composites/form-controls/TextInput/TextInput.styles.ts +7 -8
- package/src/composites/form-controls/TextInput/TextInput.tsx +3 -4
- package/src/composites/form-controls/Toggle/Toggle.styles.ts +6 -6
- package/src/composites/form-controls/Toggle/Toggle.tsx +2 -2
- package/src/composites/layout/AppShell/AppShell.styles.ts +3 -4
- package/src/composites/layout/AppShell/AppShell.tsx +2 -2
- package/src/composites/layout/Card/Card.styles.ts +4 -5
- package/src/composites/layout/Card/Card.tsx +2 -2
- package/src/composites/layout/Card/Card.types.ts +1 -1
- package/src/composites/layout/Navbar/Navbar.styles.ts +5 -5
- package/src/composites/layout/Navbar/Navbar.tsx +2 -2
- package/src/composites/layout/Sidebar/Sidebar.styles.ts +5 -5
- package/src/composites/layout/Sidebar/Sidebar.tsx +2 -2
- package/src/composites/overlays/Popover/Popover.styles.ts +4 -4
- package/src/composites/overlays/Popover/Popover.tsx +2 -2
- package/src/composites/range-inputs/ColorScaleSlider/ColorScaleSlider.styles.ts +5 -6
- package/src/composites/range-inputs/ColorScaleSlider/ColorScaleSlider.tsx +6 -3
- package/src/composites/range-inputs/ColorScaleSlider/ColorScaleSlider.types.ts +2 -0
- package/src/composites/range-inputs/HueSlider/HueSlider.styles.ts +14 -21
- package/src/composites/range-inputs/HueSlider/HueSlider.tsx +8 -9
- package/src/composites/range-inputs/Slider/Slider.styles.ts +9 -10
- package/src/composites/range-inputs/Slider/Slider.tsx +2 -2
- package/src/index.ts +73 -60
- package/src/primitives/Frame/Frame.styles.ts +8 -7
- package/src/primitives/Frame/Frame.tsx +9 -9
- package/src/primitives/Frame/Frame.types.ts +1 -1
- package/src/primitives/Frame/Frame.utils.ts +1 -1
- package/src/primitives/Icon/Icon.tsx +2 -3
- package/src/primitives/Text/Text.spans.ts +1 -1
- package/src/primitives/Text/Text.tsx +16 -16
- package/src/primitives/Text/Text.types.ts +1 -1
- package/src/primitives/Wrapper/Wrapper.styles.ts +1 -1
- package/src/primitives/Wrapper/Wrapper.tsx +1 -1
- package/dist/fonts/GoogleFontLoader.d.ts +0 -20
- package/dist/fonts/GoogleFontLoader.d.ts.map +0 -1
- package/dist/fonts/IconFontLoader.d.ts +0 -13
- package/dist/fonts/IconFontLoader.d.ts.map +0 -1
- package/dist/fonts/SelfHostedFontLoader.d.ts +0 -14
- package/dist/fonts/SelfHostedFontLoader.d.ts.map +0 -1
- package/dist/fonts/buildGoogleFontsUrl.d.ts +0 -2
- package/dist/fonts/buildGoogleFontsUrl.d.ts.map +0 -1
- package/dist/fonts/measureFont.d.ts +0 -19
- package/dist/fonts/measureFont.d.ts.map +0 -1
- package/dist/fonts/reportQueue.d.ts +0 -7
- package/dist/fonts/reportQueue.d.ts.map +0 -1
- package/dist/fonts/useLocalCalibration.d.ts +0 -19
- package/dist/fonts/useLocalCalibration.d.ts.map +0 -1
- package/dist/fonts/useTypographyCalibrations.d.ts +0 -11
- package/dist/fonts/useTypographyCalibrations.d.ts.map +0 -1
- package/dist/theme/FrameContext.d.ts +0 -26
- package/dist/theme/FrameContext.d.ts.map +0 -1
- package/dist/theme/NewtoneProvider.d.ts +0 -40
- package/dist/theme/NewtoneProvider.d.ts.map +0 -1
- package/dist/theme/defaults.d.ts +0 -8
- package/dist/theme/defaults.d.ts.map +0 -1
- package/dist/theme/types.d.ts +0 -156
- package/dist/theme/types.d.ts.map +0 -1
- package/dist/theme/useBreakpoint.d.ts +0 -9
- package/dist/theme/useBreakpoint.d.ts.map +0 -1
- package/dist/tokens/computeTokens.d.ts +0 -151
- package/dist/tokens/computeTokens.d.ts.map +0 -1
- package/dist/tokens/types.d.ts +0 -162
- package/dist/tokens/types.d.ts.map +0 -1
- package/dist/tokens/useTokens.d.ts +0 -26
- package/dist/tokens/useTokens.d.ts.map +0 -1
- package/src/fonts/GoogleFontLoader.tsx +0 -80
- package/src/fonts/IconFontLoader.tsx +0 -51
- package/src/fonts/SelfHostedFontLoader.tsx +0 -44
- package/src/fonts/buildGoogleFontsUrl.ts +0 -2
- package/src/fonts/measureFont.ts +0 -55
- package/src/fonts/reportQueue.ts +0 -54
- package/src/fonts/useLocalCalibration.ts +0 -97
- package/src/fonts/useTypographyCalibrations.ts +0 -15
- package/src/theme/FrameContext.tsx +0 -31
- package/src/theme/NewtoneProvider.tsx +0 -84
- package/src/theme/defaults.ts +0 -71
- package/src/theme/types.ts +0 -191
- package/src/theme/useBreakpoint.ts +0 -14
- package/src/tokens/computeTokens.ts +0 -516
- package/src/tokens/types.ts +0 -146
- package/src/tokens/useTokens.ts +0 -62
package/src/index.ts
CHANGED
|
@@ -1,46 +1,68 @@
|
|
|
1
|
-
//
|
|
2
|
-
export {
|
|
1
|
+
// Re-export theme engine (backward compatibility — consumers keep importing from @newtonedev/components)
|
|
2
|
+
export {
|
|
3
|
+
NewtoneProvider,
|
|
4
|
+
useNewtoneTheme,
|
|
5
|
+
FrameContext,
|
|
6
|
+
useFrameContext,
|
|
7
|
+
useBreakpoint,
|
|
8
|
+
DEFAULT_THEME_CONFIG,
|
|
9
|
+
DEFAULT_FONT_SIZES,
|
|
10
|
+
DEFAULT_LINE_HEIGHTS,
|
|
11
|
+
DEFAULT_ROLE_SCALES,
|
|
12
|
+
useTokens,
|
|
13
|
+
computeTokens,
|
|
14
|
+
NEUTRAL_DEFAULTS,
|
|
15
|
+
ACCENT_DEFAULTS,
|
|
16
|
+
SUCCESS_DEFAULTS,
|
|
17
|
+
WARNING_DEFAULTS,
|
|
18
|
+
ERROR_DEFAULTS,
|
|
19
|
+
buildGoogleFontsUrl,
|
|
20
|
+
measureAvgCharWidth,
|
|
21
|
+
useLocalCalibration,
|
|
22
|
+
useTypographyCalibrations,
|
|
23
|
+
enqueueObservation,
|
|
24
|
+
migrateV1ToV2,
|
|
25
|
+
isV2TokenOverrides,
|
|
26
|
+
} from 'newtone-api';
|
|
3
27
|
export type {
|
|
4
28
|
ColorMode,
|
|
29
|
+
ColorGamut,
|
|
5
30
|
ElevationLevel,
|
|
6
31
|
FrameElevation,
|
|
7
32
|
ColorSystemConfig,
|
|
33
|
+
ColorSystemPaletteConfig,
|
|
8
34
|
NewtoneThemeConfig,
|
|
9
35
|
NewtoneThemeContext,
|
|
10
36
|
FontConfig,
|
|
11
37
|
FontWeights,
|
|
12
38
|
FontSlot,
|
|
13
39
|
TokenOverrides,
|
|
40
|
+
TokenColor,
|
|
41
|
+
PaletteModeTokens,
|
|
42
|
+
PaletteTokenOverrides,
|
|
43
|
+
LegacyTokenOverrides,
|
|
14
44
|
FontSizeScale,
|
|
15
45
|
LineHeightScale,
|
|
16
46
|
RoleSizeStep,
|
|
17
47
|
RoleScale,
|
|
18
48
|
RoleScales,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
} from '
|
|
34
|
-
export type { PaletteDefaults } from './tokens/computeTokens';
|
|
35
|
-
export type { ResolvedTokens, PaletteTokens } from './tokens/types';
|
|
36
|
-
|
|
37
|
-
// Composite Components
|
|
38
|
-
export { Button } from './composites/actions/Button/Button';
|
|
39
|
-
export type { ButtonProps, ButtonVariant, ButtonSemantic, ButtonSize, ButtonIconPosition } from './composites/actions/Button/Button.types';
|
|
40
|
-
|
|
41
|
-
export { Card } from './composites/layout/Card/Card';
|
|
42
|
-
export type { CardProps } from './composites/layout/Card/Card.types';
|
|
49
|
+
BreakpointKey,
|
|
50
|
+
Breakpoints,
|
|
51
|
+
BreakpointRoleScales,
|
|
52
|
+
FontRuntimeMetrics,
|
|
53
|
+
FrameContextValue,
|
|
54
|
+
UseTokensResult,
|
|
55
|
+
PaletteDefaults,
|
|
56
|
+
ResolvedTokens,
|
|
57
|
+
PaletteTokens,
|
|
58
|
+
DynamicRange,
|
|
59
|
+
ColorResult,
|
|
60
|
+
Srgb,
|
|
61
|
+
Oklch,
|
|
62
|
+
HexColor,
|
|
63
|
+
} from 'newtone-api';
|
|
43
64
|
|
|
65
|
+
// Primitive Components
|
|
44
66
|
export { useFocusVisible } from './primitives/useFocusVisible';
|
|
45
67
|
export type { FocusVisibleResult } from './primitives/useFocusVisible';
|
|
46
68
|
|
|
@@ -66,6 +88,31 @@ export type {
|
|
|
66
88
|
} from './primitives/Frame/Frame.types';
|
|
67
89
|
export type { ResolvedCorners } from './primitives/Frame/Frame.utils';
|
|
68
90
|
|
|
91
|
+
export { Icon } from './primitives/Icon/Icon';
|
|
92
|
+
export type { IconProps } from './primitives/Icon/Icon.types';
|
|
93
|
+
|
|
94
|
+
export { Wrapper } from './primitives/Wrapper/Wrapper';
|
|
95
|
+
export type { WrapperProps } from './primitives/Wrapper/Wrapper.types';
|
|
96
|
+
|
|
97
|
+
export { Text } from './primitives/Text';
|
|
98
|
+
export type {
|
|
99
|
+
TextProps,
|
|
100
|
+
TextSize,
|
|
101
|
+
TextWeight,
|
|
102
|
+
TextColor,
|
|
103
|
+
TextScope,
|
|
104
|
+
TextRole,
|
|
105
|
+
TextAlign,
|
|
106
|
+
TextSpanProps,
|
|
107
|
+
} from './primitives/Text';
|
|
108
|
+
|
|
109
|
+
// Composite Components
|
|
110
|
+
export { Button } from './composites/actions/Button/Button';
|
|
111
|
+
export type { ButtonProps, ButtonVariant, ButtonSemantic, ButtonSize, ButtonIconPosition } from './composites/actions/Button/Button.types';
|
|
112
|
+
|
|
113
|
+
export { Card } from './composites/layout/Card/Card';
|
|
114
|
+
export type { CardProps } from './composites/layout/Card/Card.types';
|
|
115
|
+
|
|
69
116
|
export { TextInput } from './composites/form-controls/TextInput/TextInput';
|
|
70
117
|
export type { TextInputProps } from './composites/form-controls/TextInput/TextInput.types';
|
|
71
118
|
|
|
@@ -89,24 +136,6 @@ export type { HueSliderProps } from './composites/range-inputs/HueSlider/HueSlid
|
|
|
89
136
|
export { ColorScaleSlider } from './composites/range-inputs/ColorScaleSlider/ColorScaleSlider';
|
|
90
137
|
export type { ColorScaleSliderProps } from './composites/range-inputs/ColorScaleSlider/ColorScaleSlider.types';
|
|
91
138
|
|
|
92
|
-
export { Icon } from './primitives/Icon/Icon';
|
|
93
|
-
export type { IconProps } from './primitives/Icon/Icon.types';
|
|
94
|
-
|
|
95
|
-
export { Wrapper } from './primitives/Wrapper/Wrapper';
|
|
96
|
-
export type { WrapperProps } from './primitives/Wrapper/Wrapper.types';
|
|
97
|
-
|
|
98
|
-
export { Text } from './primitives/Text';
|
|
99
|
-
export type {
|
|
100
|
-
TextProps,
|
|
101
|
-
TextSize,
|
|
102
|
-
TextWeight,
|
|
103
|
-
TextColor,
|
|
104
|
-
TextScope,
|
|
105
|
-
TextRole,
|
|
106
|
-
TextAlign,
|
|
107
|
-
TextSpanProps,
|
|
108
|
-
} from './primitives/Text';
|
|
109
|
-
|
|
110
139
|
export { AppShell } from './composites/layout/AppShell/AppShell';
|
|
111
140
|
export type { AppShellProps } from './composites/layout/AppShell/AppShell.types';
|
|
112
141
|
|
|
@@ -134,19 +163,3 @@ export {
|
|
|
134
163
|
generateComponentCode,
|
|
135
164
|
ICON_CATALOG,
|
|
136
165
|
} from './registry';
|
|
137
|
-
|
|
138
|
-
// Fonts
|
|
139
|
-
export { buildGoogleFontsUrl } from './fonts/buildGoogleFontsUrl';
|
|
140
|
-
export { measureAvgCharWidth } from './fonts/measureFont';
|
|
141
|
-
export { useLocalCalibration } from './fonts/useLocalCalibration';
|
|
142
|
-
export { useTypographyCalibrations } from './fonts/useTypographyCalibrations';
|
|
143
|
-
|
|
144
|
-
// Re-export core engine types for convenience
|
|
145
|
-
export type {
|
|
146
|
-
DynamicRange,
|
|
147
|
-
PaletteConfig,
|
|
148
|
-
ColorResult,
|
|
149
|
-
Srgb,
|
|
150
|
-
Oklch,
|
|
151
|
-
HexColor,
|
|
152
|
-
} from 'newtone';
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { ViewStyle } from 'react-native';
|
|
2
2
|
import { StyleSheet } from 'react-native';
|
|
3
|
-
import {
|
|
4
|
-
import type {
|
|
5
|
-
import type { FrameElevation } from '../../theme/types';
|
|
3
|
+
import type { ResolvedTokens, ColorGamut } from 'newtone-api';
|
|
4
|
+
import type { FrameElevation } from 'newtone-api';
|
|
6
5
|
import type {
|
|
7
6
|
PaddingProp,
|
|
8
7
|
GapProp,
|
|
@@ -28,6 +27,7 @@ import {
|
|
|
28
27
|
|
|
29
28
|
export interface FrameStyleInput {
|
|
30
29
|
readonly tokens: ResolvedTokens;
|
|
30
|
+
readonly gamut: ColorGamut;
|
|
31
31
|
readonly frameElevation: FrameElevation;
|
|
32
32
|
|
|
33
33
|
// Layout
|
|
@@ -87,6 +87,7 @@ export interface FrameStyles {
|
|
|
87
87
|
export function getFrameStyles(input: FrameStyleInput): FrameStyles {
|
|
88
88
|
const {
|
|
89
89
|
tokens,
|
|
90
|
+
gamut,
|
|
90
91
|
frameElevation,
|
|
91
92
|
layout = 'flex',
|
|
92
93
|
direction = 'vertical',
|
|
@@ -116,8 +117,8 @@ export function getFrameStyles(input: FrameStyleInput): FrameStyles {
|
|
|
116
117
|
|
|
117
118
|
// ── Background & foreground ──
|
|
118
119
|
// Set the surface color and default text color from the current theme.
|
|
119
|
-
container.backgroundColor =
|
|
120
|
-
container.color =
|
|
120
|
+
container.backgroundColor = tokens.background[gamut];
|
|
121
|
+
container.color = tokens.textPrimary[gamut];
|
|
121
122
|
|
|
122
123
|
// ── Layout mode ──
|
|
123
124
|
if (layout === 'flex') {
|
|
@@ -191,7 +192,7 @@ export function getFrameStyles(input: FrameStyleInput): FrameStyles {
|
|
|
191
192
|
// Add a thin border using the theme's border color.
|
|
192
193
|
if (bordered) {
|
|
193
194
|
container.borderWidth = 1;
|
|
194
|
-
container.borderColor =
|
|
195
|
+
container.borderColor = tokens.border[gamut];
|
|
195
196
|
}
|
|
196
197
|
|
|
197
198
|
// ── Outer shadow (elevation 2) ──
|
|
@@ -216,7 +217,7 @@ export function getFrameStyles(input: FrameStyleInput): FrameStyles {
|
|
|
216
217
|
// When the user is pressing an interactive Frame, shift the background
|
|
217
218
|
// to a darker "sunken" shade to give visual feedback.
|
|
218
219
|
const pressed = StyleSheet.create({
|
|
219
|
-
s: { backgroundColor:
|
|
220
|
+
s: { backgroundColor: tokens.backgroundSunken[gamut] },
|
|
220
221
|
}).s;
|
|
221
222
|
|
|
222
223
|
// ── Grid web style (web-only) ──
|
|
@@ -2,11 +2,10 @@ import React, { useMemo } from 'react';
|
|
|
2
2
|
import { View, Pressable, Text } from 'react-native';
|
|
3
3
|
import type { ViewStyle, TextStyle } from 'react-native';
|
|
4
4
|
import type { FrameProps } from './Frame.types';
|
|
5
|
-
import type { ElevationLevel, FrameElevation } from '
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { computeTokens } from '../../tokens/computeTokens';
|
|
5
|
+
import type { ElevationLevel, FrameElevation } from 'newtone-api';
|
|
6
|
+
import { FrameContext, useFrameContext } from 'newtone-api';
|
|
7
|
+
import { useNewtoneTheme } from 'newtone-api';
|
|
8
|
+
import { computeTokens } from 'newtone-api';
|
|
10
9
|
import { getFrameStyles } from './Frame.styles';
|
|
11
10
|
import { useFocusVisible } from '../useFocusVisible';
|
|
12
11
|
|
|
@@ -131,7 +130,7 @@ export function Frame({
|
|
|
131
130
|
style,
|
|
132
131
|
}: FrameProps) {
|
|
133
132
|
// Read the global theme configuration and current color mode (light/dark).
|
|
134
|
-
const { config, mode } = useNewtoneTheme();
|
|
133
|
+
const { config, mode, gamut } = useNewtoneTheme();
|
|
135
134
|
// Read the elevation from the nearest parent Frame (if nested).
|
|
136
135
|
const parentFrameCtx = useFrameContext();
|
|
137
136
|
|
|
@@ -167,6 +166,7 @@ export function Frame({
|
|
|
167
166
|
const styles = useMemo(
|
|
168
167
|
() => getFrameStyles({
|
|
169
168
|
tokens,
|
|
169
|
+
gamut,
|
|
170
170
|
frameElevation: resolvedFrameElevation,
|
|
171
171
|
layout,
|
|
172
172
|
direction,
|
|
@@ -189,7 +189,7 @@ export function Frame({
|
|
|
189
189
|
disabled,
|
|
190
190
|
}),
|
|
191
191
|
[
|
|
192
|
-
tokens, resolvedFrameElevation,
|
|
192
|
+
tokens, gamut, resolvedFrameElevation,
|
|
193
193
|
layout, direction, wrap, reverse, columns, rows,
|
|
194
194
|
align, justify, padding, gap,
|
|
195
195
|
width, height, minWidth, maxWidth, minHeight, maxHeight,
|
|
@@ -233,7 +233,7 @@ export function Frame({
|
|
|
233
233
|
const focusRingStyle = isFocusVisible && !disabled ? {
|
|
234
234
|
outlineWidth: 2,
|
|
235
235
|
outlineStyle: 'solid',
|
|
236
|
-
outlineColor:
|
|
236
|
+
outlineColor: tokens.accent.fill[gamut],
|
|
237
237
|
outlineOffset: 2,
|
|
238
238
|
} as unknown as ViewStyle : undefined; // web-only
|
|
239
239
|
|
|
@@ -245,7 +245,7 @@ export function Frame({
|
|
|
245
245
|
// Uses the theme's primary text color, default font, and base size.
|
|
246
246
|
const textStyle = useMemo<TextStyle>(
|
|
247
247
|
() => ({
|
|
248
|
-
color:
|
|
248
|
+
color: tokens.textPrimary[gamut],
|
|
249
249
|
fontSize: tokens.typography.fontSizes['05'],
|
|
250
250
|
fontFamily: tokens.typography.fonts.main.family,
|
|
251
251
|
lineHeight: tokens.typography.lineHeights['06'],
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React, { useMemo } from 'react';
|
|
2
2
|
import { Text, type TextStyle } from 'react-native';
|
|
3
|
-
import {
|
|
4
|
-
import { useTokens } from '../../tokens/useTokens';
|
|
3
|
+
import { useTokens } from 'newtone-api';
|
|
5
4
|
import type { IconProps } from './Icon.types';
|
|
6
5
|
|
|
7
6
|
/**
|
|
@@ -55,7 +54,7 @@ export function Icon({
|
|
|
55
54
|
const opsz = opticalSize ?? getOpticalSize(fontSize);
|
|
56
55
|
|
|
57
56
|
// Use the provided color, or fall back to the theme's primary text color.
|
|
58
|
-
const iconColor = color ??
|
|
57
|
+
const iconColor = color ?? tokens.textPrimary[tokens.gamut];
|
|
59
58
|
|
|
60
59
|
// Build the font family name from the theme's icon variant setting.
|
|
61
60
|
// Example: variant 'rounded' → 'Material Symbols Rounded'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useContext, useMemo } from 'react';
|
|
2
2
|
import { Text as RNText } from 'react-native';
|
|
3
3
|
import type { TextStyle } from 'react-native';
|
|
4
|
-
import { useTokens } from '
|
|
4
|
+
import { useTokens } from 'newtone-api';
|
|
5
5
|
import { TextScopeContext, resolveTextColor } from './Text';
|
|
6
6
|
import type { TextSpanProps, TextWeight } from './Text.types';
|
|
7
7
|
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import React, { createContext, useMemo, useState, useEffect } from 'react';
|
|
2
2
|
import { Text as RNText, View } from 'react-native';
|
|
3
3
|
import type { LayoutChangeEvent, TextStyle } from 'react-native';
|
|
4
|
-
import { srgbToHex } from 'newtone';
|
|
5
4
|
import { resolveResponsiveSize, estimateLineWidths, BREAKPOINT_ROLE_SCALE, scaleRoleStep, REFERENCE_LINE_HEIGHT_RATIO, buildFontFeatureSettings, SEMANTIC_WEIGHT_MAP, ROLE_DEFAULT_WEIGHTS } from '@newtonedev/fonts';
|
|
6
|
-
import { useTokens } from '
|
|
7
|
-
import { useNewtoneTheme } from '
|
|
8
|
-
import type { UseTokensResult } from '
|
|
5
|
+
import { useTokens } from 'newtone-api';
|
|
6
|
+
import { useNewtoneTheme } from 'newtone-api';
|
|
7
|
+
import type { UseTokensResult } from 'newtone-api';
|
|
9
8
|
import type { TextProps, TextColor } from './Text.types';
|
|
10
|
-
import { useLocalCalibration } from '
|
|
11
|
-
import { useTypographyCalibrations } from '
|
|
12
|
-
import { enqueueObservation } from '
|
|
13
|
-
import { useBreakpoint } from '
|
|
9
|
+
import { useLocalCalibration } from 'newtone-api';
|
|
10
|
+
import { useTypographyCalibrations } from 'newtone-api';
|
|
11
|
+
import { enqueueObservation } from 'newtone-api';
|
|
12
|
+
import { useBreakpoint } from 'newtone-api';
|
|
14
13
|
|
|
15
14
|
/**
|
|
16
15
|
* Context to pass the active scope's weight map to span sub-components.
|
|
@@ -27,15 +26,16 @@ export const TextScopeContext = createContext<{
|
|
|
27
26
|
* Neutral text colors are top-level; palette colors use nested PaletteTokens.fill.
|
|
28
27
|
*/
|
|
29
28
|
export function resolveTextColor(color: TextColor, tokens: UseTokensResult): string {
|
|
29
|
+
const { gamut } = tokens;
|
|
30
30
|
switch (color) {
|
|
31
|
-
case 'primary': return
|
|
32
|
-
case 'secondary': return
|
|
33
|
-
case 'tertiary': return
|
|
34
|
-
case 'disabled': return
|
|
35
|
-
case 'accent': return
|
|
36
|
-
case 'success': return
|
|
37
|
-
case 'warning': return
|
|
38
|
-
case 'error': return
|
|
31
|
+
case 'primary': return tokens.textPrimary[gamut];
|
|
32
|
+
case 'secondary': return tokens.textSecondary[gamut];
|
|
33
|
+
case 'tertiary': return tokens.textTertiary[gamut];
|
|
34
|
+
case 'disabled': return tokens.textDisabled[gamut];
|
|
35
|
+
case 'accent': return tokens.accent.fill[gamut];
|
|
36
|
+
case 'success': return tokens.success.fill[gamut];
|
|
37
|
+
case 'warning': return tokens.warning.fill[gamut];
|
|
38
|
+
case 'error': return tokens.error.fill[gamut];
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Text as RNText, TextStyle } from 'react-native';
|
|
2
|
-
import type { ElevationLevel } from '
|
|
2
|
+
import type { ElevationLevel } from 'newtone-api';
|
|
3
3
|
|
|
4
4
|
/** Typography size step — selects within the current role's 3-step scale. @default 'md' */
|
|
5
5
|
export type TextSize = 'sm' | 'md' | 'lg';
|
|
@@ -2,7 +2,7 @@ import React, { useMemo } from 'react';
|
|
|
2
2
|
import { View } from 'react-native';
|
|
3
3
|
import type { WrapperProps } from './Wrapper.types';
|
|
4
4
|
import { getWrapperStyles } from './Wrapper.styles';
|
|
5
|
-
import { useTokens } from '
|
|
5
|
+
import { useTokens } from 'newtone-api';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Wrapper — Lightweight, invisible layout container.
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { FontSlot } from '../theme/types';
|
|
2
|
-
interface GoogleFontLoaderProps {
|
|
3
|
-
readonly fonts: {
|
|
4
|
-
readonly main: FontSlot;
|
|
5
|
-
readonly display: FontSlot;
|
|
6
|
-
readonly mono: FontSlot;
|
|
7
|
-
readonly currency: FontSlot;
|
|
8
|
-
};
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Manages a single <link> tag in <head> for Google Fonts.
|
|
12
|
-
* Removes the previous link when fonts change to avoid accumulation.
|
|
13
|
-
* Does nothing when no Google fonts are present.
|
|
14
|
-
*
|
|
15
|
-
* Uses imperative DOM manipulation because react-native-web's View
|
|
16
|
-
* cannot render <link> elements.
|
|
17
|
-
*/
|
|
18
|
-
export declare function GoogleFontLoader({ fonts }: GoogleFontLoaderProps): null;
|
|
19
|
-
export {};
|
|
20
|
-
//# sourceMappingURL=GoogleFontLoader.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GoogleFontLoader.d.ts","sourceRoot":"","sources":["../../src/fonts/GoogleFontLoader.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAG/C,UAAU,qBAAqB;IAC7B,QAAQ,CAAC,KAAK,EAAE;QACd,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;QACxB,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC;QAC3B,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;QACxB,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;KAC7B,CAAC;CACH;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,KAAK,EAAE,EAAE,qBAAqB,QA0DhE"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
interface IconFontLoaderProps {
|
|
2
|
-
readonly icons: {
|
|
3
|
-
readonly variant: 'outlined' | 'rounded' | 'sharp';
|
|
4
|
-
};
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* Manages a single <link> tag in <head> for the Material Symbols icon font.
|
|
8
|
-
* Loads the variable font with all axes (FILL, wght, GRAD, opsz).
|
|
9
|
-
* Removes the previous link when the variant changes to avoid accumulation.
|
|
10
|
-
*/
|
|
11
|
-
export declare function IconFontLoader({ icons }: IconFontLoaderProps): null;
|
|
12
|
-
export {};
|
|
13
|
-
//# sourceMappingURL=IconFontLoader.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IconFontLoader.d.ts","sourceRoot":"","sources":["../../src/fonts/IconFontLoader.tsx"],"names":[],"mappings":"AAEA,UAAU,mBAAmB;IAC3B,QAAQ,CAAC,KAAK,EAAE;QACd,QAAQ,CAAC,OAAO,EAAE,UAAU,GAAG,SAAS,GAAG,OAAO,CAAC;KACpD,CAAC;CACH;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,EAAE,KAAK,EAAE,EAAE,mBAAmB,QAqC5D"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
interface SelfHostedFontLoaderProps {
|
|
2
|
-
/** Raw @font-face CSS string from the theme API. */
|
|
3
|
-
readonly fontFaceCss: string;
|
|
4
|
-
}
|
|
5
|
-
/**
|
|
6
|
-
* Injects self-hosted @font-face CSS into <head> via a <style> tag.
|
|
7
|
-
* Used instead of GoogleFontLoader when self-hosted font CSS is available.
|
|
8
|
-
*
|
|
9
|
-
* Uses imperative DOM manipulation because react-native-web's View
|
|
10
|
-
* cannot render <style> elements.
|
|
11
|
-
*/
|
|
12
|
-
export declare function SelfHostedFontLoader({ fontFaceCss }: SelfHostedFontLoaderProps): null;
|
|
13
|
-
export {};
|
|
14
|
-
//# sourceMappingURL=SelfHostedFontLoader.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SelfHostedFontLoader.d.ts","sourceRoot":"","sources":["../../src/fonts/SelfHostedFontLoader.tsx"],"names":[],"mappings":"AAEA,UAAU,yBAAyB;IACjC,oDAAoD;IACpD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,EAAE,WAAW,EAAE,EAAE,yBAAyB,QA6B9E"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"buildGoogleFontsUrl.d.ts","sourceRoot":"","sources":["../../src/fonts/buildGoogleFontsUrl.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Measure the average character width ratio for a font using the Canvas API.
|
|
3
|
-
*
|
|
4
|
-
* Waits for the font to load via `document.fonts.load()` before measuring,
|
|
5
|
-
* with a 3-second timeout to prevent hangs when fonts fail to load silently.
|
|
6
|
-
* Falls back to 0.55 if the browser context is unavailable, the font fails
|
|
7
|
-
* to load, or canvas is not supported.
|
|
8
|
-
*
|
|
9
|
-
* The returned ratio represents `avgCharWidth / fontSize`. Multiply by a
|
|
10
|
-
* desired fontSize to estimate character widths for that font.
|
|
11
|
-
*
|
|
12
|
-
* @param fontFamily - Font family name, e.g. "Inter" or "system-ui"
|
|
13
|
-
* @param fontWeight - CSS font-weight number, e.g. 400
|
|
14
|
-
* @param fallback - CSS fallback stack, e.g. "sans-serif"
|
|
15
|
-
* @param fontSize - Reference font size in px (default 16)
|
|
16
|
-
* @returns Average character width ratio, e.g. 0.52 for Inter
|
|
17
|
-
*/
|
|
18
|
-
export declare function measureAvgCharWidth(fontFamily: string, fontWeight: number, fallback: string, fontSize?: number): Promise<number>;
|
|
19
|
-
//# sourceMappingURL=measureFont.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"measureFont.d.ts","sourceRoot":"","sources":["../../src/fonts/measureFont.ts"],"names":[],"mappings":"AAeA;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,mBAAmB,CACvC,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,QAAQ,SAAK,GACZ,OAAO,CAAC,MAAM,CAAC,CAiBjB"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { ObserverPayload } from '@newtonedev/fonts';
|
|
2
|
-
/**
|
|
3
|
-
* Enqueue a typography observation for batch reporting.
|
|
4
|
-
* Resets the 2s debounce timer on each call.
|
|
5
|
-
*/
|
|
6
|
-
export declare function enqueueObservation(endpoint: string, payload: ObserverPayload): void;
|
|
7
|
-
//# sourceMappingURL=reportQueue.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"reportQueue.d.ts","sourceRoot":"","sources":["../../src/fonts/reportQueue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AA6CzD;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,GAAG,IAAI,CAInF"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Returns the avgCharWidth ratio for a font, using a device-local measurement
|
|
3
|
-
* cached in localStorage (Layer 2 calibration).
|
|
4
|
-
*
|
|
5
|
-
* Resolution order:
|
|
6
|
-
* 1. localStorage cache (if fresh, < 7 days old)
|
|
7
|
-
* 2. `baseCalibration` (Layer 1 — editor-time canvas measurement from theme config)
|
|
8
|
-
* 3. 0.55 (fallback constant)
|
|
9
|
-
*
|
|
10
|
-
* On mount, measures the font if the cache is stale or absent, then updates
|
|
11
|
-
* localStorage and triggers a re-render with the device-accurate ratio.
|
|
12
|
-
*
|
|
13
|
-
* @param fontFamily - CSS font family name, e.g. "Inter"
|
|
14
|
-
* @param fontWeight - CSS font-weight number, e.g. 400
|
|
15
|
-
* @param fallback - CSS fallback stack, e.g. "sans-serif"
|
|
16
|
-
* @param baseCalibration - Layer 1 ratio from `themeConfig.typography.calibrations`
|
|
17
|
-
*/
|
|
18
|
-
export declare function useLocalCalibration(fontFamily: string, fontWeight: number, fallback: string, baseCalibration?: number): number;
|
|
19
|
-
//# sourceMappingURL=useLocalCalibration.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useLocalCalibration.d.ts","sourceRoot":"","sources":["../../src/fonts/useLocalCalibration.ts"],"names":[],"mappings":"AAoCA;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,mBAAmB,CACjC,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,eAAe,CAAC,EAAE,MAAM,GACvB,MAAM,CAsCR"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Returns the per-font avgCharWidth calibrations from the current theme config.
|
|
3
|
-
*
|
|
4
|
-
* These are Layer 1 (editor-time) calibrations — measured with canvas at publish
|
|
5
|
-
* time and stored in `themeConfig.typography.calibrations`. Use `useLocalCalibration`
|
|
6
|
-
* to overlay device-local (Layer 2) measurements on top.
|
|
7
|
-
*
|
|
8
|
-
* @returns Record of fontFamily → avgCharWidthRatio, or an empty object if absent.
|
|
9
|
-
*/
|
|
10
|
-
export declare function useTypographyCalibrations(): Record<string, number>;
|
|
11
|
-
//# sourceMappingURL=useTypographyCalibrations.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useTypographyCalibrations.d.ts","sourceRoot":"","sources":["../../src/fonts/useTypographyCalibrations.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,wBAAgB,yBAAyB,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAGlE"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { ElevationLevel } from './types';
|
|
2
|
-
import type { ResolvedTokens } from '../tokens/types';
|
|
3
|
-
/**
|
|
4
|
-
* Context value provided by Frame to its descendants.
|
|
5
|
-
* Contains the resolved elevation and pre-computed tokens.
|
|
6
|
-
* Tokens are included to avoid redundant computeTokens calls in child components.
|
|
7
|
-
*/
|
|
8
|
-
export interface FrameContextValue {
|
|
9
|
-
readonly elevation: ElevationLevel;
|
|
10
|
-
readonly tokens: ResolvedTokens;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* FrameContext - Propagates elevation overrides from Frame to descendants.
|
|
14
|
-
*
|
|
15
|
-
* When null, components fall back to default elevation (1).
|
|
16
|
-
* When present, useTokens() reads from this context instead.
|
|
17
|
-
*/
|
|
18
|
-
export declare const FrameContext: import("react").Context<FrameContextValue | null>;
|
|
19
|
-
/**
|
|
20
|
-
* useFrameContext - Read the nearest Frame's context, if any.
|
|
21
|
-
*
|
|
22
|
-
* Returns null when no parent Frame exists. This is intentionally not an error —
|
|
23
|
-
* components outside a Frame simply fall back to the NewtoneProvider defaults.
|
|
24
|
-
*/
|
|
25
|
-
export declare function useFrameContext(): FrameContextValue | null;
|
|
26
|
-
//# sourceMappingURL=FrameContext.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FrameContext.d.ts","sourceRoot":"","sources":["../../src/theme/FrameContext.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEtD;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,SAAS,EAAE,cAAc,CAAC;IACnC,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC;CACjC;AAED;;;;;GAKG;AACH,eAAO,MAAM,YAAY,mDAAgD,CAAC;AAE1E;;;;;GAKG;AACH,wBAAgB,eAAe,IAAI,iBAAiB,GAAG,IAAI,CAE1D"}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { NewtoneThemeConfig, NewtoneThemeContext, ColorMode } from './types';
|
|
3
|
-
export interface NewtoneProviderProps {
|
|
4
|
-
readonly config?: NewtoneThemeConfig;
|
|
5
|
-
readonly initialMode?: ColorMode;
|
|
6
|
-
readonly children: React.ReactNode;
|
|
7
|
-
/** Optional URL for typography telemetry. When set, adaptive Text instances report observations. */
|
|
8
|
-
readonly reportingEndpoint?: string;
|
|
9
|
-
/**
|
|
10
|
-
* Self-hosted @font-face CSS from the theme API.
|
|
11
|
-
* When provided, injects this CSS instead of loading from Google CDN.
|
|
12
|
-
* Falls back to Google CDN when absent or null.
|
|
13
|
-
*/
|
|
14
|
-
readonly fontFaceCss?: string | null;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* NewtoneProvider - Provides theme context to all Newtone components
|
|
18
|
-
*
|
|
19
|
-
* Wrap your app with this provider to enable mode switching.
|
|
20
|
-
*
|
|
21
|
-
* @example
|
|
22
|
-
* ```tsx
|
|
23
|
-
* <NewtoneProvider initialMode="light">
|
|
24
|
-
* <App />
|
|
25
|
-
* </NewtoneProvider>
|
|
26
|
-
* ```
|
|
27
|
-
*/
|
|
28
|
-
export declare function NewtoneProvider({ config, initialMode, children, reportingEndpoint, fontFaceCss, }: NewtoneProviderProps): React.JSX.Element;
|
|
29
|
-
/**
|
|
30
|
-
* useNewtoneTheme - Hook to access theme context
|
|
31
|
-
*
|
|
32
|
-
* Must be used within a NewtoneProvider.
|
|
33
|
-
*
|
|
34
|
-
* @example
|
|
35
|
-
* ```tsx
|
|
36
|
-
* const { mode, setMode } = useNewtoneTheme();
|
|
37
|
-
* ```
|
|
38
|
-
*/
|
|
39
|
-
export declare function useNewtoneTheme(): NewtoneThemeContext;
|
|
40
|
-
//# sourceMappingURL=NewtoneProvider.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NewtoneProvider.d.ts","sourceRoot":"","sources":["../../src/theme/NewtoneProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuD,MAAM,OAAO,CAAC;AAC5E,OAAO,KAAK,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAQlF,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,MAAM,CAAC,EAAE,kBAAkB,CAAC;IACrC,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS,CAAC;IACjC,QAAQ,CAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IACnC,oGAAoG;IACpG,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IACpC;;;;OAIG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACtC;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAAC,EAC9B,MAA6B,EAC7B,WAAqB,EACrB,QAAQ,EACR,iBAAiB,EACjB,WAAW,GACZ,EAAE,oBAAoB,qBAwBtB;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,IAAI,mBAAmB,CAMrD"}
|
package/dist/theme/defaults.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { NewtoneThemeConfig } from './types';
|
|
2
|
-
export { DEFAULT_FONT_SIZES, DEFAULT_LINE_HEIGHTS, DEFAULT_ROLE_SCALES } from '@newtonedev/fonts';
|
|
3
|
-
/**
|
|
4
|
-
* Default theme configuration matching playground defaults.
|
|
5
|
-
* Palettes: [0] Neutral, [1] Accent, [2] Success, [3] Warning, [4] Error
|
|
6
|
-
*/
|
|
7
|
-
export declare const DEFAULT_THEME_CONFIG: NewtoneThemeConfig;
|
|
8
|
-
//# sourceMappingURL=defaults.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../src/theme/defaults.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAgBlD,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAElG;;;GAGG;AACH,eAAO,MAAM,oBAAoB,EAAE,kBAgDlC,CAAC"}
|