@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.
Files changed (149) hide show
  1. package/dist/_COMPONENT_TEMPLATE/ComponentName.styles.d.ts +3 -2
  2. package/dist/_COMPONENT_TEMPLATE/ComponentName.styles.d.ts.map +1 -1
  3. package/dist/_COMPONENT_TEMPLATE/ComponentName.types.d.ts +1 -1
  4. package/dist/_COMPONENT_TEMPLATE/ComponentName.types.d.ts.map +1 -1
  5. package/dist/composites/actions/Button/Button.styles.d.ts +1 -1
  6. package/dist/composites/actions/Button/Button.styles.d.ts.map +1 -1
  7. package/dist/composites/form-controls/Select/Select.d.ts.map +1 -1
  8. package/dist/composites/form-controls/Select/Select.styles.d.ts +2 -2
  9. package/dist/composites/form-controls/Select/Select.styles.d.ts.map +1 -1
  10. package/dist/composites/form-controls/Select/SelectOption.d.ts.map +1 -1
  11. package/dist/composites/form-controls/TextInput/TextInput.d.ts.map +1 -1
  12. package/dist/composites/form-controls/TextInput/TextInput.styles.d.ts +2 -2
  13. package/dist/composites/form-controls/TextInput/TextInput.styles.d.ts.map +1 -1
  14. package/dist/composites/form-controls/Toggle/Toggle.styles.d.ts +2 -2
  15. package/dist/composites/form-controls/Toggle/Toggle.styles.d.ts.map +1 -1
  16. package/dist/composites/layout/AppShell/AppShell.styles.d.ts +2 -2
  17. package/dist/composites/layout/AppShell/AppShell.styles.d.ts.map +1 -1
  18. package/dist/composites/layout/Card/Card.styles.d.ts +2 -2
  19. package/dist/composites/layout/Card/Card.styles.d.ts.map +1 -1
  20. package/dist/composites/layout/Card/Card.types.d.ts +1 -1
  21. package/dist/composites/layout/Card/Card.types.d.ts.map +1 -1
  22. package/dist/composites/layout/Navbar/Navbar.styles.d.ts +3 -2
  23. package/dist/composites/layout/Navbar/Navbar.styles.d.ts.map +1 -1
  24. package/dist/composites/layout/Sidebar/Sidebar.styles.d.ts +3 -2
  25. package/dist/composites/layout/Sidebar/Sidebar.styles.d.ts.map +1 -1
  26. package/dist/composites/overlays/Popover/Popover.styles.d.ts +2 -2
  27. package/dist/composites/overlays/Popover/Popover.styles.d.ts.map +1 -1
  28. package/dist/composites/range-inputs/ColorScaleSlider/ColorScaleSlider.d.ts +1 -1
  29. package/dist/composites/range-inputs/ColorScaleSlider/ColorScaleSlider.d.ts.map +1 -1
  30. package/dist/composites/range-inputs/ColorScaleSlider/ColorScaleSlider.styles.d.ts +2 -2
  31. package/dist/composites/range-inputs/ColorScaleSlider/ColorScaleSlider.styles.d.ts.map +1 -1
  32. package/dist/composites/range-inputs/ColorScaleSlider/ColorScaleSlider.types.d.ts +2 -0
  33. package/dist/composites/range-inputs/ColorScaleSlider/ColorScaleSlider.types.d.ts.map +1 -1
  34. package/dist/composites/range-inputs/HueSlider/HueSlider.d.ts +3 -4
  35. package/dist/composites/range-inputs/HueSlider/HueSlider.d.ts.map +1 -1
  36. package/dist/composites/range-inputs/HueSlider/HueSlider.styles.d.ts +4 -4
  37. package/dist/composites/range-inputs/HueSlider/HueSlider.styles.d.ts.map +1 -1
  38. package/dist/composites/range-inputs/Slider/Slider.styles.d.ts +2 -2
  39. package/dist/composites/range-inputs/Slider/Slider.styles.d.ts.map +1 -1
  40. package/dist/index.cjs +1232 -1823
  41. package/dist/index.cjs.map +1 -1
  42. package/dist/index.d.ts +12 -24
  43. package/dist/index.d.ts.map +1 -1
  44. package/dist/index.js +1084 -1737
  45. package/dist/index.js.map +1 -1
  46. package/dist/primitives/Frame/Frame.d.ts.map +1 -1
  47. package/dist/primitives/Frame/Frame.styles.d.ts +3 -2
  48. package/dist/primitives/Frame/Frame.styles.d.ts.map +1 -1
  49. package/dist/primitives/Frame/Frame.types.d.ts +1 -1
  50. package/dist/primitives/Frame/Frame.types.d.ts.map +1 -1
  51. package/dist/primitives/Frame/Frame.utils.d.ts +1 -1
  52. package/dist/primitives/Frame/Frame.utils.d.ts.map +1 -1
  53. package/dist/primitives/Icon/Icon.d.ts.map +1 -1
  54. package/dist/primitives/Text/Text.d.ts +1 -1
  55. package/dist/primitives/Text/Text.d.ts.map +1 -1
  56. package/dist/primitives/Text/Text.types.d.ts +1 -1
  57. package/dist/primitives/Text/Text.types.d.ts.map +1 -1
  58. package/dist/primitives/Wrapper/Wrapper.styles.d.ts +1 -1
  59. package/dist/primitives/Wrapper/Wrapper.styles.d.ts.map +1 -1
  60. package/package.json +3 -2
  61. package/src/_COMPONENT_TEMPLATE/ComponentName.styles.ts +4 -4
  62. package/src/_COMPONENT_TEMPLATE/ComponentName.tsx +2 -2
  63. package/src/_COMPONENT_TEMPLATE/ComponentName.types.ts +1 -1
  64. package/src/composites/actions/Button/Button.styles.ts +37 -36
  65. package/src/composites/actions/Button/Button.tsx +1 -1
  66. package/src/composites/form-controls/Select/Select.styles.ts +8 -8
  67. package/src/composites/form-controls/Select/Select.tsx +4 -5
  68. package/src/composites/form-controls/Select/SelectOption.tsx +7 -8
  69. package/src/composites/form-controls/TextInput/TextInput.styles.ts +7 -8
  70. package/src/composites/form-controls/TextInput/TextInput.tsx +3 -4
  71. package/src/composites/form-controls/Toggle/Toggle.styles.ts +6 -6
  72. package/src/composites/form-controls/Toggle/Toggle.tsx +2 -2
  73. package/src/composites/layout/AppShell/AppShell.styles.ts +3 -4
  74. package/src/composites/layout/AppShell/AppShell.tsx +2 -2
  75. package/src/composites/layout/Card/Card.styles.ts +4 -5
  76. package/src/composites/layout/Card/Card.tsx +2 -2
  77. package/src/composites/layout/Card/Card.types.ts +1 -1
  78. package/src/composites/layout/Navbar/Navbar.styles.ts +5 -5
  79. package/src/composites/layout/Navbar/Navbar.tsx +2 -2
  80. package/src/composites/layout/Sidebar/Sidebar.styles.ts +5 -5
  81. package/src/composites/layout/Sidebar/Sidebar.tsx +2 -2
  82. package/src/composites/overlays/Popover/Popover.styles.ts +4 -4
  83. package/src/composites/overlays/Popover/Popover.tsx +2 -2
  84. package/src/composites/range-inputs/ColorScaleSlider/ColorScaleSlider.styles.ts +5 -6
  85. package/src/composites/range-inputs/ColorScaleSlider/ColorScaleSlider.tsx +6 -3
  86. package/src/composites/range-inputs/ColorScaleSlider/ColorScaleSlider.types.ts +2 -0
  87. package/src/composites/range-inputs/HueSlider/HueSlider.styles.ts +14 -21
  88. package/src/composites/range-inputs/HueSlider/HueSlider.tsx +8 -9
  89. package/src/composites/range-inputs/Slider/Slider.styles.ts +9 -10
  90. package/src/composites/range-inputs/Slider/Slider.tsx +2 -2
  91. package/src/index.ts +73 -60
  92. package/src/primitives/Frame/Frame.styles.ts +8 -7
  93. package/src/primitives/Frame/Frame.tsx +9 -9
  94. package/src/primitives/Frame/Frame.types.ts +1 -1
  95. package/src/primitives/Frame/Frame.utils.ts +1 -1
  96. package/src/primitives/Icon/Icon.tsx +2 -3
  97. package/src/primitives/Text/Text.spans.ts +1 -1
  98. package/src/primitives/Text/Text.tsx +16 -16
  99. package/src/primitives/Text/Text.types.ts +1 -1
  100. package/src/primitives/Wrapper/Wrapper.styles.ts +1 -1
  101. package/src/primitives/Wrapper/Wrapper.tsx +1 -1
  102. package/dist/fonts/GoogleFontLoader.d.ts +0 -20
  103. package/dist/fonts/GoogleFontLoader.d.ts.map +0 -1
  104. package/dist/fonts/IconFontLoader.d.ts +0 -13
  105. package/dist/fonts/IconFontLoader.d.ts.map +0 -1
  106. package/dist/fonts/SelfHostedFontLoader.d.ts +0 -14
  107. package/dist/fonts/SelfHostedFontLoader.d.ts.map +0 -1
  108. package/dist/fonts/buildGoogleFontsUrl.d.ts +0 -2
  109. package/dist/fonts/buildGoogleFontsUrl.d.ts.map +0 -1
  110. package/dist/fonts/measureFont.d.ts +0 -19
  111. package/dist/fonts/measureFont.d.ts.map +0 -1
  112. package/dist/fonts/reportQueue.d.ts +0 -7
  113. package/dist/fonts/reportQueue.d.ts.map +0 -1
  114. package/dist/fonts/useLocalCalibration.d.ts +0 -19
  115. package/dist/fonts/useLocalCalibration.d.ts.map +0 -1
  116. package/dist/fonts/useTypographyCalibrations.d.ts +0 -11
  117. package/dist/fonts/useTypographyCalibrations.d.ts.map +0 -1
  118. package/dist/theme/FrameContext.d.ts +0 -26
  119. package/dist/theme/FrameContext.d.ts.map +0 -1
  120. package/dist/theme/NewtoneProvider.d.ts +0 -40
  121. package/dist/theme/NewtoneProvider.d.ts.map +0 -1
  122. package/dist/theme/defaults.d.ts +0 -8
  123. package/dist/theme/defaults.d.ts.map +0 -1
  124. package/dist/theme/types.d.ts +0 -156
  125. package/dist/theme/types.d.ts.map +0 -1
  126. package/dist/theme/useBreakpoint.d.ts +0 -9
  127. package/dist/theme/useBreakpoint.d.ts.map +0 -1
  128. package/dist/tokens/computeTokens.d.ts +0 -151
  129. package/dist/tokens/computeTokens.d.ts.map +0 -1
  130. package/dist/tokens/types.d.ts +0 -162
  131. package/dist/tokens/types.d.ts.map +0 -1
  132. package/dist/tokens/useTokens.d.ts +0 -26
  133. package/dist/tokens/useTokens.d.ts.map +0 -1
  134. package/src/fonts/GoogleFontLoader.tsx +0 -80
  135. package/src/fonts/IconFontLoader.tsx +0 -51
  136. package/src/fonts/SelfHostedFontLoader.tsx +0 -44
  137. package/src/fonts/buildGoogleFontsUrl.ts +0 -2
  138. package/src/fonts/measureFont.ts +0 -55
  139. package/src/fonts/reportQueue.ts +0 -54
  140. package/src/fonts/useLocalCalibration.ts +0 -97
  141. package/src/fonts/useTypographyCalibrations.ts +0 -15
  142. package/src/theme/FrameContext.tsx +0 -31
  143. package/src/theme/NewtoneProvider.tsx +0 -84
  144. package/src/theme/defaults.ts +0 -71
  145. package/src/theme/types.ts +0 -191
  146. package/src/theme/useBreakpoint.ts +0 -14
  147. package/src/tokens/computeTokens.ts +0 -516
  148. package/src/tokens/types.ts +0 -146
  149. package/src/tokens/useTokens.ts +0 -62
@@ -1,156 +0,0 @@
1
- import type { DynamicRange, PaletteConfig } from 'newtone';
2
- export type { FontConfig, FontWeights, FontSlot, FontSizeScale, LineHeightScale, RoleSizeStep, RoleScale, RoleScales, BreakpointKey, Breakpoints, BreakpointRoleScales, FontRuntimeMetrics, } from '@newtonedev/fonts';
3
- import type { FontSlot, FontSizeScale, LineHeightScale, RoleScales, BreakpointRoleScales, FontRuntimeMetrics, TextRole } from '@newtonedev/fonts';
4
- /**
5
- * Color mode: light or dark
6
- */
7
- export type ColorMode = 'light' | 'dark';
8
- /**
9
- * Elevation levels for surfaces (internal)
10
- * 0 = sunken, 1 = default, 2 = elevated
11
- */
12
- export type ElevationLevel = 0 | 1 | 2;
13
- /**
14
- * User-facing elevation for Frame component
15
- * -2 = deeply sunken (inset shadow), -1 = sunken, 0 = default,
16
- * 1 = elevated, 2 = prominently elevated (drop shadow)
17
- */
18
- export type FrameElevation = -2 | -1 | 0 | 1 | 2;
19
- /**
20
- * Complete color system configuration
21
- */
22
- export interface ColorSystemConfig {
23
- readonly dynamicRange: DynamicRange;
24
- readonly palettes: ReadonlyArray<PaletteConfig>;
25
- }
26
- /**
27
- * Overrides for hardcoded token computation constants.
28
- * All values are optional — omitted fields fall back to engine defaults.
29
- *
30
- * All values are NV (normalized value / luminosity) offsets on a unified scale.
31
- * 0.10 means the same 10% luminosity shift whether applied to borders, text,
32
- * or interactive components. Direction auto-inverts per effective mode
33
- * (darker in light mode, lighter in dark mode) unless noted otherwise.
34
- */
35
- export interface TokenOverrides {
36
- readonly interactiveComponentOffset?: number;
37
- readonly hoverShift?: number;
38
- readonly activeShift?: number;
39
- readonly borderOffset?: number;
40
- readonly interactiveComponentOffsetDark?: number;
41
- readonly hoverShiftDark?: number;
42
- readonly activeShiftDark?: number;
43
- readonly borderOffsetDark?: number;
44
- readonly borderFocusedOffset?: number;
45
- readonly borderFocusedOffsetDark?: number;
46
- readonly borderFilledOffset?: number;
47
- readonly borderFilledOffsetDark?: number;
48
- readonly backgroundElevated?: number;
49
- readonly backgroundDefault?: number;
50
- readonly backgroundSunken?: number;
51
- readonly textPrimaryNormalized?: number;
52
- readonly textSecondaryNormalized?: number;
53
- readonly textTertiaryNormalized?: number;
54
- readonly textDisabledNormalized?: number;
55
- readonly backgroundElevatedDark?: number;
56
- readonly backgroundDefaultDark?: number;
57
- readonly backgroundSunkenDark?: number;
58
- readonly textPrimaryNormalizedDark?: number;
59
- readonly textSecondaryNormalizedDark?: number;
60
- readonly textTertiaryNormalizedDark?: number;
61
- readonly textDisabledNormalizedDark?: number;
62
- }
63
- /**
64
- * Newtone theme configuration
65
- */
66
- export interface NewtoneThemeConfig {
67
- readonly colorSystem: ColorSystemConfig;
68
- readonly spacing: {
69
- readonly '00': number;
70
- readonly '02': number;
71
- readonly '04': number;
72
- readonly '06': number;
73
- readonly '08': number;
74
- readonly '10': number;
75
- readonly '12': number;
76
- readonly '16': number;
77
- readonly '20': number;
78
- readonly '24': number;
79
- readonly '32': number;
80
- readonly '40': number;
81
- readonly '48': number;
82
- };
83
- readonly radius: {
84
- readonly none: number;
85
- readonly sm: number;
86
- readonly md: number;
87
- readonly lg: number;
88
- readonly xl: number;
89
- readonly pill: 999;
90
- };
91
- readonly typography: {
92
- readonly fonts: {
93
- readonly main: FontSlot;
94
- readonly display: FontSlot;
95
- readonly mono: FontSlot;
96
- readonly currency: FontSlot;
97
- };
98
- /** Primitive font size scale — numbered tokens ('01'-'16'), values in px. */
99
- readonly fontSizes: FontSizeScale;
100
- /** Primitive line height scale — numbered tokens ('01'-'16'), values in px. */
101
- readonly lineHeights: LineHeightScale;
102
- /** Role mapping — pairs fontSizes and lineHeights for each role x size combination. */
103
- readonly roles: RoleScales;
104
- /**
105
- * Per-font avgCharWidth ratios, keyed by font family name.
106
- * Measured with canvas at editor publish time (Layer 1 calibration).
107
- * Used by resolveResponsiveSize to improve line break estimation accuracy.
108
- * Falls back to 0.55 when absent.
109
- */
110
- readonly calibrations?: Record<string, number>;
111
- /**
112
- * Pre-computed role scales for each viewport breakpoint (sm/md/lg).
113
- * Enables CSS-only consumers to generate @media rules from the theme JSON
114
- * without importing newtone-fonts. Runtime components use useBreakpoint
115
- * instead and compute scaling on the fly.
116
- */
117
- readonly breakpointRoles?: BreakpointRoleScales;
118
- /**
119
- * Per-font OpenType-derived metrics, keyed by font family name.
120
- * Extracted from font binaries at upload time, looked up at publish time.
121
- * Used by Text for line height correction (adjustLineHeight),
122
- * vertical centering (verticalCenterOffset), and font feature validation.
123
- * Falls back to Inter-equivalent defaults when absent.
124
- */
125
- readonly fontMetrics?: Readonly<Record<string, FontRuntimeMetrics>>;
126
- /**
127
- * Per-role font weight (CSS font-weight 100–900).
128
- * Primary weight path — the Text component uses these values directly.
129
- * When populated via toThemeConfig, defaults are merged with user overrides.
130
- * Per-instance weight prop still takes priority.
131
- */
132
- readonly roleWeights?: Partial<Record<TextRole, number>>;
133
- };
134
- readonly icons: {
135
- readonly variant: 'outlined' | 'rounded' | 'sharp';
136
- readonly weight: 100 | 200 | 300 | 400 | 500 | 600 | 700;
137
- readonly autoGrade: boolean;
138
- };
139
- readonly tokenOverrides?: TokenOverrides;
140
- }
141
- /**
142
- * Current theme context state
143
- */
144
- export interface NewtoneThemeContext {
145
- readonly config: NewtoneThemeConfig;
146
- readonly mode: ColorMode;
147
- readonly setMode: (mode: ColorMode) => void;
148
- /**
149
- * Optional URL for the typography telemetry reporting endpoint.
150
- * When set, the Text component (in responsive mode) will batch and POST
151
- * ObserverPayload observations to this URL for cross-site aggregation.
152
- * When absent, no telemetry is sent (opt-in).
153
- */
154
- readonly reportingEndpoint?: string;
155
- }
156
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/theme/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAG3D,YAAY,EACV,UAAU,EACV,WAAW,EACX,QAAQ,EACR,aAAa,EACb,eAAe,EACf,YAAY,EACZ,SAAS,EACT,UAAU,EACV,aAAa,EACb,WAAW,EACX,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,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AAM,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC;KAC1D,CAAC;IACF,QAAQ,CAAC,KAAK,EAAE;QACd,QAAQ,CAAC,OAAO,EAAE,UAAU,GAAG,SAAS,GAAG,OAAO,CAAC;QACnD,QAAQ,CAAC,MAAM,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;QACzD,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;KAC7B,CAAC;IACF,QAAQ,CAAC,cAAc,CAAC,EAAE,cAAc,CAAC;CAC1C;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,MAAM,EAAE,kBAAkB,CAAC;IACpC,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,CAAC;IAC5C;;;;;OAKG;IACH,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;CACrC"}
@@ -1,9 +0,0 @@
1
- import type { BreakpointKey } from '@newtonedev/fonts';
2
- /**
3
- * Returns the current viewport breakpoint key ('sm' | 'md' | 'lg').
4
- *
5
- * Uses `useWindowDimensions` from react-native (cross-platform — works
6
- * on web via react-native-web) and re-evaluates on window resize.
7
- */
8
- export declare function useBreakpoint(): BreakpointKey;
9
- //# sourceMappingURL=useBreakpoint.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useBreakpoint.d.ts","sourceRoot":"","sources":["../../src/theme/useBreakpoint.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEvD;;;;;GAKG;AACH,wBAAgB,aAAa,IAAI,aAAa,CAG7C"}
@@ -1,151 +0,0 @@
1
- import type { ColorSystemConfig, ColorMode, ElevationLevel, FontSlot, TokenOverrides } from '../theme/types';
2
- import type { ResolvedTokens } from './types';
3
- /**
4
- * Per-mode fallback defaults shape shared by all palette defaults.
5
- */
6
- export type PaletteDefaults = {
7
- readonly light: {
8
- readonly background: {
9
- readonly elevated: number;
10
- readonly ground: number;
11
- readonly sunken: number;
12
- };
13
- readonly text: {
14
- readonly primary: number;
15
- readonly secondary: number;
16
- readonly tertiary: number;
17
- readonly disabled: number;
18
- };
19
- readonly action: {
20
- readonly enabled: number;
21
- readonly hovered: number;
22
- readonly pressed: number;
23
- };
24
- readonly border: {
25
- readonly enabled: number;
26
- readonly focused: number;
27
- readonly filled: number;
28
- };
29
- };
30
- readonly dark: {
31
- readonly background: {
32
- readonly elevated: number;
33
- readonly ground: number;
34
- readonly sunken: number;
35
- };
36
- readonly text: {
37
- readonly primary: number;
38
- readonly secondary: number;
39
- readonly tertiary: number;
40
- readonly disabled: number;
41
- };
42
- readonly action: {
43
- readonly enabled: number;
44
- readonly hovered: number;
45
- readonly pressed: number;
46
- };
47
- readonly border: {
48
- readonly enabled: number;
49
- readonly focused: number;
50
- readonly filled: number;
51
- };
52
- };
53
- };
54
- /**
55
- * Per-mode fallback defaults for the neutral palette (normalized scale).
56
- * Single source of truth — consumed by computeTokens and the admin Token Tuner.
57
- *
58
- * Light: 0 = lightest, 1 = darkest. Dark: 0 = darkest, 1 = lightest.
59
- * Structured by token group so all per-palette defaults follow the same shape.
60
- */
61
- export declare const NEUTRAL_DEFAULTS: PaletteDefaults;
62
- /**
63
- * Accent palette defaults. Initial values match neutral — will be tuned per-palette later.
64
- */
65
- export declare const ACCENT_DEFAULTS: PaletteDefaults;
66
- /**
67
- * Success palette defaults. Initial values match neutral — will be tuned per-palette later.
68
- */
69
- export declare const SUCCESS_DEFAULTS: PaletteDefaults;
70
- /**
71
- * Warning palette defaults. Initial values match neutral — will be tuned per-palette later.
72
- */
73
- export declare const WARNING_DEFAULTS: PaletteDefaults;
74
- /**
75
- * Error palette defaults. Initial values match neutral — will be tuned per-palette later.
76
- */
77
- export declare const ERROR_DEFAULTS: PaletteDefaults;
78
- /**
79
- * Compute design tokens for a specific mode/theme/elevation combination.
80
- *
81
- * This function calls the Newtone engine to generate all necessary color tokens
82
- * based on the current theme context. All colors are computed on-demand using
83
- * the pure functions from the engine.
84
- *
85
- * Background surfaces use absolute positions from NEUTRAL_DEFAULTS (or tokenOverrides
86
- * when present). Elevation compensation is derived from the difference between
87
- * the current surface and the elevated reference surface.
88
- *
89
- * @param config - Complete color system configuration (dynamic range + palettes)
90
- * @param mode - Current color mode ('light' or 'dark')
91
- * @param elevation - Elevation level (0=sunken, 1=default, 2=elevated)
92
- * @param spacing - Spacing scale for paddings, gaps, and margins
93
- * @param radius - Border radius scale for component roundness
94
- * @param typography - Typography configuration with fonts and scales
95
- * @param icons - Icon configuration with variant, weight, and auto-grade setting
96
- * @returns Resolved design tokens with all necessary colors
97
- *
98
- * @example
99
- * ```typescript
100
- * const tokens = computeTokens(
101
- * config.colorSystem,
102
- * 'light',
103
- * 1,
104
- * config.spacing,
105
- * config.radius,
106
- * config.typography,
107
- * config.icons
108
- * );
109
- * console.log(tokens.background.srgb); // { r: 0.95, g: 0.95, b: 0.95 }
110
- * ```
111
- */
112
- export declare function computeTokens(config: ColorSystemConfig, mode: ColorMode, elevation: ElevationLevel, spacing: {
113
- readonly '00': number;
114
- readonly '02': number;
115
- readonly '04': number;
116
- readonly '06': number;
117
- readonly '08': number;
118
- readonly '10': number;
119
- readonly '12': number;
120
- readonly '16': number;
121
- readonly '20': number;
122
- readonly '24': number;
123
- readonly '32': number;
124
- readonly '40': number;
125
- readonly '48': number;
126
- }, radius: {
127
- readonly none: number;
128
- readonly sm: number;
129
- readonly md: number;
130
- readonly lg: number;
131
- readonly xl: number;
132
- readonly pill: 999;
133
- }, typography: {
134
- readonly fonts: {
135
- readonly main: FontSlot;
136
- readonly display: FontSlot;
137
- readonly mono: FontSlot;
138
- readonly currency: FontSlot;
139
- };
140
- readonly fontSizes: {
141
- readonly [key: string]: number;
142
- };
143
- readonly lineHeights: {
144
- readonly [key: string]: number;
145
- };
146
- }, icons: {
147
- readonly variant: 'outlined' | 'rounded' | 'sharp';
148
- readonly weight: 100 | 200 | 300 | 400 | 500 | 600 | 700;
149
- readonly autoGrade: boolean;
150
- }, tokenOverrides?: TokenOverrides): ResolvedTokens;
151
- //# sourceMappingURL=computeTokens.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"computeTokens.d.ts","sourceRoot":"","sources":["../../src/tokens/computeTokens.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAE,cAAc,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC7G,OAAO,KAAK,EAAE,cAAc,EAAiB,MAAM,SAAS,CAAC;AAE7D;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,QAAQ,CAAC,KAAK,EAAE;QACd,QAAQ,CAAC,UAAU,EAAE;YAAE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;YAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;YAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;SAAE,CAAC;QACrG,QAAQ,CAAC,IAAI,EAAE;YAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;YAAC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;YAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;YAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;SAAE,CAAC;QAC9H,QAAQ,CAAC,MAAM,EAAE;YAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;YAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;YAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;SAAE,CAAC;QAClG,QAAQ,CAAC,MAAM,EAAE;YAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;YAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;YAAC,QAAQ,CAAC,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AAM,CAAA;KAAE,CAAC;IACvD,QAAQ,CAAC,WAAW,EAAE;QAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;CAC1D,EACD,KAAK,EAAE;IACL,QAAQ,CAAC,OAAO,EAAE,UAAU,GAAG,SAAS,GAAG,OAAO,CAAC;IACnD,QAAQ,CAAC,MAAM,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;IACzD,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;CAC7B,EACD,cAAc,CAAC,EAAE,cAAc,GAC9B,cAAc,CAwPhB"}
@@ -1,162 +0,0 @@
1
- import type { ColorResult } from 'newtone';
2
- /**
3
- * Complete token set for a non-neutral palette (accent, success, warning, error).
4
- *
5
- * Fill tokens use the palette's key NV position (user-chosen or WCAG auto-derived).
6
- * Surface tokens use standard positions from PaletteDefaults, rendered in the palette's hue/saturation.
7
- */
8
- export interface PaletteTokens {
9
- /** Key color at the palette's keyNormalizedValue (used for primary Button fills, badges, indicators) */
10
- readonly fill: ColorResult;
11
- /** Key color shifted for hover state */
12
- readonly fillHover: ColorResult;
13
- /** Key color shifted for pressed/active state */
14
- readonly fillActive: ColorResult;
15
- /** High-contrast color for text/icons on top of fill (auto: dark text on light fills, light on dark) */
16
- readonly onFill: ColorResult;
17
- /** Palette-tinted background at current elevation */
18
- readonly background: ColorResult;
19
- /** Palette-tinted elevated surface */
20
- readonly backgroundElevated: ColorResult;
21
- /** Palette-tinted sunken surface */
22
- readonly backgroundSunken: ColorResult;
23
- /** Interactive element background within palette surface */
24
- readonly backgroundInteractive: ColorResult;
25
- /** Hover state for interactive elements within palette surface */
26
- readonly backgroundInteractiveHover: ColorResult;
27
- /** Pressed/active state for interactive elements within palette surface */
28
- readonly backgroundInteractiveActive: ColorResult;
29
- /** High-contrast palette-colored text */
30
- readonly textPrimary: ColorResult;
31
- /** Medium-contrast palette-colored text */
32
- readonly textSecondary: ColorResult;
33
- /** Low-contrast palette-colored text */
34
- readonly textTertiary: ColorResult;
35
- /** Disabled palette-colored text */
36
- readonly textDisabled: ColorResult;
37
- /** Palette-colored border */
38
- readonly border: ColorResult;
39
- }
40
- /**
41
- * Resolved design tokens for a specific mode/theme/elevation combination
42
- */
43
- export interface ResolvedTokens {
44
- /** Background color for the current surface */
45
- readonly background: ColorResult;
46
- /** Background color for elevated surfaces (cards, modals) */
47
- readonly backgroundElevated: ColorResult;
48
- /** Background color for sunken surfaces (input fields, wells) */
49
- readonly backgroundSunken: ColorResult;
50
- /**
51
- * Background color for interactive components with neutral backgrounds.
52
- * Uses a fixed NV offset from current background to ensure
53
- * consistent visual contrast across all elevations (-2 to 2).
54
- *
55
- * Use for: Button (neutral primary enabled), and future components with neutral filled backgrounds.
56
- * Don't use for: Semantic variants (accent/success/error/warning), transparent backgrounds,
57
- * or primitives (Frame/Wrapper/Text/Icon already handle elevation correctly).
58
- */
59
- readonly backgroundInteractive: ColorResult;
60
- /** Hover state for neutral interactive components (enabled + hoverShift) */
61
- readonly backgroundInteractiveHover: ColorResult;
62
- /** Pressed/active state for neutral interactive components (enabled + activeShift) */
63
- readonly backgroundInteractiveActive: ColorResult;
64
- /** Primary text color (high contrast for body text, 4.5:1 default) */
65
- readonly textPrimary: ColorResult;
66
- /** Secondary text color (lower contrast for captions, labels, 3.0:1 default) */
67
- readonly textSecondary: ColorResult;
68
- /** Tertiary text color (hints, placeholders, 2.0:1 default) */
69
- readonly textTertiary: ColorResult;
70
- /** Disabled text color (disabled elements, 1.5:1 default) */
71
- readonly textDisabled: ColorResult;
72
- /** Border color for subtle separators */
73
- readonly border: ColorResult;
74
- /** Accent palette tokens (palette index 1) — interactive elements, brand color */
75
- readonly accent: PaletteTokens;
76
- /** Success palette tokens (palette index 2) — positive state indicators */
77
- readonly success: PaletteTokens;
78
- /** Warning palette tokens (palette index 3) — caution state indicators */
79
- readonly warning: PaletteTokens;
80
- /** Error palette tokens (palette index 4) — destructive/error state indicators */
81
- readonly error: PaletteTokens;
82
- /** Spacing tokens for paddings, gaps, and margins.
83
- * Token names represent pixel values at Medium (8px) spacing preset.
84
- * Actual values scale based on the selected spacing preset. */
85
- readonly spacing: {
86
- readonly '00': number;
87
- readonly '02': number;
88
- readonly '04': number;
89
- readonly '06': number;
90
- readonly '08': number;
91
- readonly '10': number;
92
- readonly '12': number;
93
- readonly '16': number;
94
- readonly '20': number;
95
- readonly '24': number;
96
- readonly '32': number;
97
- readonly '40': number;
98
- readonly '48': number;
99
- };
100
- /** Border radius tokens for component roundness */
101
- readonly radius: {
102
- readonly none: number;
103
- readonly sm: number;
104
- readonly md: number;
105
- readonly lg: number;
106
- readonly xl: number;
107
- readonly pill: 999;
108
- };
109
- /** Typography tokens for fonts (per-scope) and primitive size/lineHeight scales */
110
- readonly typography: {
111
- /** Per-scope font family + weight mapping */
112
- readonly fonts: {
113
- readonly main: {
114
- readonly family: string;
115
- readonly weights: {
116
- readonly regular: number;
117
- readonly medium: number;
118
- readonly bold: number;
119
- };
120
- };
121
- readonly display: {
122
- readonly family: string;
123
- readonly weights: {
124
- readonly regular: number;
125
- readonly medium: number;
126
- readonly bold: number;
127
- };
128
- };
129
- readonly mono: {
130
- readonly family: string;
131
- readonly weights: {
132
- readonly regular: number;
133
- readonly medium: number;
134
- readonly bold: number;
135
- };
136
- };
137
- readonly currency: {
138
- readonly family: string;
139
- readonly weights: {
140
- readonly regular: number;
141
- readonly medium: number;
142
- readonly bold: number;
143
- };
144
- };
145
- };
146
- /** Primitive font size scale — numbered tokens ('01'–'16'), values in px */
147
- readonly fontSizes: {
148
- readonly [key: string]: number;
149
- };
150
- /** Primitive line height scale — numbered tokens ('01'–'16'), values in px */
151
- readonly lineHeights: {
152
- readonly [key: string]: number;
153
- };
154
- };
155
- /** Icon tokens for Material Symbols configuration */
156
- readonly icons: {
157
- readonly variant: 'outlined' | 'rounded' | 'sharp';
158
- readonly weight: 100 | 200 | 300 | 400 | 500 | 600 | 700;
159
- readonly grade: -25 | 0 | 200;
160
- };
161
- }
162
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/tokens/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAE5B,wGAAwG;IACxG,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,wCAAwC;IACxC,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAC;IAChC,iDAAiD;IACjD,QAAQ,CAAC,UAAU,EAAE,WAAW,CAAC;IACjC,wGAAwG;IACxG,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAG7B,qDAAqD;IACrD,QAAQ,CAAC,UAAU,EAAE,WAAW,CAAC;IACjC,sCAAsC;IACtC,QAAQ,CAAC,kBAAkB,EAAE,WAAW,CAAC;IACzC,oCAAoC;IACpC,QAAQ,CAAC,gBAAgB,EAAE,WAAW,CAAC;IAGvC,4DAA4D;IAC5D,QAAQ,CAAC,qBAAqB,EAAE,WAAW,CAAC;IAC5C,kEAAkE;IAClE,QAAQ,CAAC,0BAA0B,EAAE,WAAW,CAAC;IACjD,2EAA2E;IAC3E,QAAQ,CAAC,2BAA2B,EAAE,WAAW,CAAC;IAGlD,yCAAyC;IACzC,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;IAClC,2CAA2C;IAC3C,QAAQ,CAAC,aAAa,EAAE,WAAW,CAAC;IACpC,wCAAwC;IACxC,QAAQ,CAAC,YAAY,EAAE,WAAW,CAAC;IACnC,oCAAoC;IACpC,QAAQ,CAAC,YAAY,EAAE,WAAW,CAAC;IAGnC,6BAA6B;IAC7B,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;CAC9B;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAG7B,+CAA+C;IAC/C,QAAQ,CAAC,U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QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;gBAAC,QAAQ,CAAC,OAAO,EAAE;oBAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;oBAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;oBAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;iBAAE,CAAA;aAAE,CAAC;YAC5I,QAAQ,CAAC,QAAQ,EAAE;gBAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;gBAAC,QAAQ,CAAC,OAAO,EAAE;oBAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;oBAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;oBAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;iBAAE,CAAA;aAAE,CAAC;SACjJ,CAAC;QACF,4EAA4E;QAC5E,QAAQ,CAAC,SAAS,EAAE;YAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;SAAE,CAAC;QACvD,8EAA8E;QAC9E,QAAQ,CAAC,WAAW,EAAE;YAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;SAAE,CAAC;KAC1D,CAAC;IACF,qDAAqD;IACrD,QAAQ,CAAC,KAAK,EAAE;QACd,QAAQ,CAAC,OAAO,EAAE,UAAU,GAAG,SAAS,GAAG,OAAO,CAAC;QACnD,QAAQ,CAAC,MAAM,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;QACzD,QAAQ,CAAC,KAAK,EAAE,CAAC,EAAE,GAAG,CAAC,GAAG,GAAG,CAAC;KAC/B,CAAC;CACH"}
@@ -1,26 +0,0 @@
1
- import type { ElevationLevel } from '../theme/types';
2
- import type { ResolvedTokens } from './types';
3
- /**
4
- * Extended tokens result that includes the resolved elevation level.
5
- * This allows components to make elevation-aware styling decisions.
6
- */
7
- export interface UseTokensResult extends ResolvedTokens {
8
- elevation: ElevationLevel;
9
- }
10
- /**
11
- * Hook to compute design tokens for the current theme/mode/elevation.
12
- *
13
- * Resolution order:
14
- * 1. Explicit elevation parameter takes highest priority
15
- * 2. FrameContext values (from nearest parent Frame) are used when elevation is omitted
16
- * 3. Falls back to NewtoneProvider theme + elevation 1
17
- *
18
- * When inside a Frame and no explicit elevation override is given, reuses the
19
- * Frame's pre-computed tokens to avoid redundant computeTokens calls.
20
- *
21
- * @param elevation - Elevation level (0=sunken, 1=default, 2=elevated).
22
- * When omitted, reads from FrameContext or defaults to 1.
23
- * @returns Resolved design tokens with all necessary colors + resolved elevation
24
- */
25
- export declare function useTokens(elevation?: ElevationLevel): UseTokensResult;
26
- //# sourceMappingURL=useTokens.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useTokens.d.ts","sourceRoot":"","sources":["../../src/tokens/useTokens.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C;;;GAGG;AACH,MAAM,WAAW,eAAgB,SAAQ,cAAc;IACrD,SAAS,EAAE,cAAc,CAAC;CAC3B;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,SAAS,CAAC,SAAS,CAAC,EAAE,cAAc,GAAG,eAAe,CA+BrE"}
@@ -1,80 +0,0 @@
1
- import { useEffect, useRef } from 'react';
2
- import type { FontSlot } from '../theme/types';
3
- import { buildGoogleFontsUrl } from './buildGoogleFontsUrl';
4
-
5
- interface GoogleFontLoaderProps {
6
- readonly fonts: {
7
- readonly main: FontSlot;
8
- readonly display: FontSlot;
9
- readonly mono: FontSlot;
10
- readonly currency: FontSlot;
11
- };
12
- }
13
-
14
- /**
15
- * Manages a single <link> tag in <head> for Google Fonts.
16
- * Removes the previous link when fonts change to avoid accumulation.
17
- * Does nothing when no Google fonts are present.
18
- *
19
- * Uses imperative DOM manipulation because react-native-web's View
20
- * cannot render <link> elements.
21
- */
22
- export function GoogleFontLoader({ fonts }: GoogleFontLoaderProps) {
23
- const linkRef = useRef<HTMLLinkElement | null>(null);
24
-
25
- useEffect(() => {
26
- // Web-only: on native, fonts are linked at build time (no DOM to inject <link> tags).
27
- // Also guards against SSR where document is undefined.
28
- if (typeof document === 'undefined') return;
29
-
30
- const url = buildGoogleFontsUrl(fonts);
31
-
32
- // Clean up previous link
33
- if (linkRef.current) {
34
- linkRef.current.remove();
35
- linkRef.current = null;
36
- }
37
-
38
- if (!url) return;
39
-
40
- // Check if an identical link already exists (another provider instance)
41
- const links = Array.from(document.head.querySelectorAll('link[rel="stylesheet"]'));
42
- if (links.some((el) => (el as HTMLLinkElement).href === url)) return;
43
-
44
- const link = document.createElement('link');
45
- link.rel = 'stylesheet';
46
- link.href = url;
47
- document.head.appendChild(link);
48
- linkRef.current = link;
49
-
50
- return () => {
51
- if (linkRef.current) {
52
- linkRef.current.remove();
53
- linkRef.current = null;
54
- }
55
- };
56
- }, [
57
- fonts.main.config.family,
58
- fonts.main.config.type,
59
- fonts.main.weights.regular,
60
- fonts.main.weights.medium,
61
- fonts.main.weights.bold,
62
- fonts.display.config.family,
63
- fonts.display.config.type,
64
- fonts.display.weights.regular,
65
- fonts.display.weights.medium,
66
- fonts.display.weights.bold,
67
- fonts.mono.config.family,
68
- fonts.mono.config.type,
69
- fonts.mono.weights.regular,
70
- fonts.mono.weights.medium,
71
- fonts.mono.weights.bold,
72
- fonts.currency.config.family,
73
- fonts.currency.config.type,
74
- fonts.currency.weights.regular,
75
- fonts.currency.weights.medium,
76
- fonts.currency.weights.bold,
77
- ]);
78
-
79
- return null;
80
- }
@@ -1,51 +0,0 @@
1
- import { useEffect, useRef } from 'react';
2
-
3
- interface IconFontLoaderProps {
4
- readonly icons: {
5
- readonly variant: 'outlined' | 'rounded' | 'sharp';
6
- };
7
- }
8
-
9
- /**
10
- * Manages a single <link> tag in <head> for the Material Symbols icon font.
11
- * Loads the variable font with all axes (FILL, wght, GRAD, opsz).
12
- * Removes the previous link when the variant changes to avoid accumulation.
13
- */
14
- export function IconFontLoader({ icons }: IconFontLoaderProps) {
15
- const linkRef = useRef<HTMLLinkElement | null>(null);
16
-
17
- useEffect(() => {
18
- // Web-only: on native, fonts are linked at build time (no DOM to inject <link> tags).
19
- // Also guards against SSR where document is undefined.
20
- if (typeof document === 'undefined') return;
21
-
22
- const variantName = icons.variant.charAt(0).toUpperCase() + icons.variant.slice(1);
23
- const family = `Material+Symbols+${variantName}`;
24
- const url = `https://fonts.googleapis.com/css2?family=${family}:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=block`;
25
-
26
- // Clean up previous link
27
- if (linkRef.current) {
28
- linkRef.current.remove();
29
- linkRef.current = null;
30
- }
31
-
32
- // Check if an identical link already exists (another provider instance)
33
- const links = Array.from(document.head.querySelectorAll('link[rel="stylesheet"]'));
34
- if (links.some((el) => (el as HTMLLinkElement).href === url)) return;
35
-
36
- const link = document.createElement('link');
37
- link.rel = 'stylesheet';
38
- link.href = url;
39
- document.head.appendChild(link);
40
- linkRef.current = link;
41
-
42
- return () => {
43
- if (linkRef.current) {
44
- linkRef.current.remove();
45
- linkRef.current = null;
46
- }
47
- };
48
- }, [icons.variant]);
49
-
50
- return null;
51
- }