@newtonedev/components 0.1.5 → 0.1.7
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/composites/actions/Button/Button.d.ts.map +1 -1
- package/dist/composites/actions/Button/Button.styles.d.ts +3 -1
- package/dist/composites/actions/Button/Button.styles.d.ts.map +1 -1
- package/dist/index.cjs +603 -249
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +6 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +599 -251
- package/dist/index.js.map +1 -1
- package/dist/primitives/Frame/Frame.d.ts +2 -3
- package/dist/primitives/Frame/Frame.d.ts.map +1 -1
- package/dist/primitives/Frame/Frame.types.d.ts +4 -15
- package/dist/primitives/Frame/Frame.types.d.ts.map +1 -1
- package/dist/primitives/Icon/Icon.d.ts +1 -1
- package/dist/primitives/Icon/Icon.d.ts.map +1 -1
- package/dist/primitives/Icon/Icon.types.d.ts +7 -12
- package/dist/primitives/Icon/Icon.types.d.ts.map +1 -1
- package/dist/primitives/Text/Text.d.ts.map +1 -1
- package/dist/primitives/Text/Text.types.d.ts +9 -4
- package/dist/primitives/Text/Text.types.d.ts.map +1 -1
- package/dist/primitives/Wrapper/Wrapper.d.ts +1 -1
- package/dist/primitives/Wrapper/Wrapper.types.d.ts +1 -1
- package/dist/registry/icons.d.ts +7 -0
- package/dist/registry/icons.d.ts.map +1 -0
- package/dist/registry/index.d.ts +2 -0
- package/dist/registry/index.d.ts.map +1 -1
- package/dist/registry/registry.d.ts.map +1 -1
- package/dist/registry/types.d.ts +1 -1
- package/dist/registry/types.d.ts.map +1 -1
- package/dist/theme/FrameContext.d.ts +7 -5
- package/dist/theme/FrameContext.d.ts.map +1 -1
- package/dist/theme/NewtoneProvider.d.ts +5 -6
- package/dist/theme/NewtoneProvider.d.ts.map +1 -1
- package/dist/theme/defaults.d.ts.map +1 -1
- package/dist/theme/types.d.ts +38 -24
- package/dist/theme/types.d.ts.map +1 -1
- package/dist/tokens/computeTokens.d.ts +82 -7
- package/dist/tokens/computeTokens.d.ts.map +1 -1
- package/dist/tokens/types.d.ts +58 -16
- package/dist/tokens/types.d.ts.map +1 -1
- package/dist/tokens/useTokens.d.ts +2 -23
- package/dist/tokens/useTokens.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/composites/actions/Button/Button.styles.ts +53 -80
- package/src/composites/actions/Button/Button.tsx +6 -2
- package/src/composites/form-controls/Select/SelectOption.tsx +2 -2
- package/src/composites/form-controls/Toggle/Toggle.styles.ts +1 -1
- package/src/composites/range-inputs/ColorScaleSlider/ColorScaleSlider.styles.ts +1 -1
- package/src/composites/range-inputs/Slider/Slider.styles.ts +2 -2
- package/src/index.ts +13 -4
- package/src/primitives/Frame/Frame.tsx +10 -18
- package/src/primitives/Frame/Frame.types.ts +5 -17
- package/src/primitives/Icon/Icon.tsx +4 -6
- package/src/primitives/Icon/Icon.types.ts +7 -14
- package/src/primitives/Text/Text.tsx +18 -8
- package/src/primitives/Text/Text.types.ts +9 -4
- package/src/primitives/Wrapper/Wrapper.tsx +1 -1
- package/src/primitives/Wrapper/Wrapper.types.ts +1 -1
- package/src/registry/icons.ts +111 -0
- package/src/registry/index.ts +3 -0
- package/src/registry/registry.ts +40 -24
- package/src/registry/types.ts +1 -1
- package/src/theme/FrameContext.tsx +7 -5
- package/src/theme/NewtoneProvider.tsx +5 -10
- package/src/theme/defaults.ts +0 -9
- package/src/theme/types.ts +53 -26
- package/src/tokens/computeTokens.ts +338 -116
- package/src/tokens/types.ts +74 -16
- package/src/tokens/useTokens.ts +16 -33
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React13, { createContext, useState, useMemo, useContext, useEffect, useCallback, useRef } from 'react';
|
|
2
|
-
import { DEFAULT_NEUTRAL_SATURATION, DEFAULT_NEUTRAL_HUE, DEFAULT_ACCENT_SATURATION, DEFAULT_ACCENT_HUE, DEFAULT_SUCCESS_SATURATION, DEFAULT_SUCCESS_HUE, DEFAULT_WARNING_SATURATION, DEFAULT_WARNING_HUE, DEFAULT_ERROR_SATURATION, DEFAULT_ERROR_HUE, getColor,
|
|
2
|
+
import { DEFAULT_NEUTRAL_SATURATION, DEFAULT_NEUTRAL_HUE, DEFAULT_ACCENT_SATURATION, DEFAULT_ACCENT_HUE, DEFAULT_SUCCESS_SATURATION, DEFAULT_SUCCESS_HUE, DEFAULT_WARNING_SATURATION, DEFAULT_WARNING_HUE, DEFAULT_ERROR_SATURATION, DEFAULT_ERROR_HUE, getColor, srgbToHex } from 'newtone';
|
|
3
3
|
import { Text, View, Pressable, TextInput as TextInput$1, ScrollView, PanResponder, Animated, StyleSheet } from 'react-native';
|
|
4
4
|
|
|
5
5
|
// src/theme/NewtoneProvider.tsx
|
|
@@ -17,16 +17,6 @@ var DEFAULT_THEME_CONFIG = {
|
|
|
17
17
|
{ hue: DEFAULT_ERROR_HUE, saturation: DEFAULT_ERROR_SATURATION }
|
|
18
18
|
]
|
|
19
19
|
},
|
|
20
|
-
themes: {
|
|
21
|
-
neutral: { paletteIndex: 0, lightModeNv: 0.95, darkModeNv: 0.1 },
|
|
22
|
-
primary: { paletteIndex: 1, lightModeNv: 0.95, darkModeNv: 0.1 },
|
|
23
|
-
secondary: { paletteIndex: 1, lightModeNv: 0.85, darkModeNv: 0.15 },
|
|
24
|
-
strong: { paletteIndex: 0, lightModeNv: 0.1, darkModeNv: 0.95 }
|
|
25
|
-
},
|
|
26
|
-
elevation: {
|
|
27
|
-
offsets: [-0.02, 0, 0.04]
|
|
28
|
-
// [sunken, default, elevated]
|
|
29
|
-
},
|
|
30
20
|
spacing: {
|
|
31
21
|
"00": 0,
|
|
32
22
|
// base * 0
|
|
@@ -190,20 +180,16 @@ var ThemeContext = createContext(null);
|
|
|
190
180
|
function NewtoneProvider({
|
|
191
181
|
config = DEFAULT_THEME_CONFIG,
|
|
192
182
|
initialMode = "light",
|
|
193
|
-
initialTheme = "neutral",
|
|
194
183
|
children
|
|
195
184
|
}) {
|
|
196
185
|
const [mode, setMode] = useState(initialMode);
|
|
197
|
-
const [theme, setTheme] = useState(initialTheme);
|
|
198
186
|
const value = useMemo(
|
|
199
187
|
() => ({
|
|
200
188
|
config,
|
|
201
189
|
mode,
|
|
202
|
-
|
|
203
|
-
setMode,
|
|
204
|
-
setTheme
|
|
190
|
+
setMode
|
|
205
191
|
}),
|
|
206
|
-
[config, mode
|
|
192
|
+
[config, mode]
|
|
207
193
|
);
|
|
208
194
|
return /* @__PURE__ */ React13.createElement(ThemeContext.Provider, { value }, /* @__PURE__ */ React13.createElement(GoogleFontLoader, { fonts: config.typography.fonts }), /* @__PURE__ */ React13.createElement(IconFontLoader, { icons: config.icons }), children);
|
|
209
195
|
}
|
|
@@ -218,19 +204,160 @@ var FrameContext = createContext(null);
|
|
|
218
204
|
function useFrameContext() {
|
|
219
205
|
return useContext(FrameContext);
|
|
220
206
|
}
|
|
207
|
+
var NEUTRAL_DEFAULTS = {
|
|
208
|
+
light: {
|
|
209
|
+
background: { elevated: 0, ground: 0.03, sunken: 0.06 },
|
|
210
|
+
text: { primary: 0.9, secondary: 0.7, tertiary: 0.5, disabled: 0.3 },
|
|
211
|
+
action: { enabled: 0.04, hovered: 0.06, pressed: 0.08 },
|
|
212
|
+
border: { enabled: 0.08, focused: 0.16, filled: 0.24 }
|
|
213
|
+
},
|
|
214
|
+
dark: {
|
|
215
|
+
background: { elevated: 0.24, ground: 0.2, sunken: 0.16 },
|
|
216
|
+
text: { primary: 1, secondary: 0.85, tertiary: 0.7, disabled: 0.55 },
|
|
217
|
+
action: { enabled: 0.04, hovered: 0.06, pressed: 0.08 },
|
|
218
|
+
border: { enabled: 0.08, focused: 0.16, filled: 0.24 }
|
|
219
|
+
}
|
|
220
|
+
};
|
|
221
|
+
var ACCENT_DEFAULTS = {
|
|
222
|
+
light: {
|
|
223
|
+
background: { elevated: 0, ground: 0.03, sunken: 0.06 },
|
|
224
|
+
text: { primary: 0.9, secondary: 0.7, tertiary: 0.5, disabled: 0.3 },
|
|
225
|
+
action: { enabled: 0.04, hovered: 0.06, pressed: 0.08 },
|
|
226
|
+
border: { enabled: 0.08, focused: 0.16, filled: 0.24 }
|
|
227
|
+
},
|
|
228
|
+
dark: {
|
|
229
|
+
background: { elevated: 0.24, ground: 0.2, sunken: 0.16 },
|
|
230
|
+
text: { primary: 1, secondary: 0.85, tertiary: 0.7, disabled: 0.55 },
|
|
231
|
+
action: { enabled: 0.04, hovered: 0.06, pressed: 0.08 },
|
|
232
|
+
border: { enabled: 0.08, focused: 0.16, filled: 0.24 }
|
|
233
|
+
}
|
|
234
|
+
};
|
|
235
|
+
var SUCCESS_DEFAULTS = {
|
|
236
|
+
light: {
|
|
237
|
+
background: { elevated: 0, ground: 0.03, sunken: 0.06 },
|
|
238
|
+
text: { primary: 0.9, secondary: 0.7, tertiary: 0.5, disabled: 0.3 },
|
|
239
|
+
action: { enabled: 0.04, hovered: 0.06, pressed: 0.08 },
|
|
240
|
+
border: { enabled: 0.08, focused: 0.16, filled: 0.24 }
|
|
241
|
+
},
|
|
242
|
+
dark: {
|
|
243
|
+
background: { elevated: 0.24, ground: 0.2, sunken: 0.16 },
|
|
244
|
+
text: { primary: 1, secondary: 0.85, tertiary: 0.7, disabled: 0.55 },
|
|
245
|
+
action: { enabled: 0.04, hovered: 0.06, pressed: 0.08 },
|
|
246
|
+
border: { enabled: 0.08, focused: 0.16, filled: 0.24 }
|
|
247
|
+
}
|
|
248
|
+
};
|
|
249
|
+
var WARNING_DEFAULTS = {
|
|
250
|
+
light: {
|
|
251
|
+
background: { elevated: 0, ground: 0.03, sunken: 0.06 },
|
|
252
|
+
text: { primary: 0.9, secondary: 0.7, tertiary: 0.5, disabled: 0.3 },
|
|
253
|
+
action: { enabled: 0.04, hovered: 0.06, pressed: 0.08 },
|
|
254
|
+
border: { enabled: 0.08, focused: 0.16, filled: 0.24 }
|
|
255
|
+
},
|
|
256
|
+
dark: {
|
|
257
|
+
background: { elevated: 0.24, ground: 0.2, sunken: 0.16 },
|
|
258
|
+
text: { primary: 1, secondary: 0.85, tertiary: 0.7, disabled: 0.55 },
|
|
259
|
+
action: { enabled: 0.04, hovered: 0.06, pressed: 0.08 },
|
|
260
|
+
border: { enabled: 0.08, focused: 0.16, filled: 0.24 }
|
|
261
|
+
}
|
|
262
|
+
};
|
|
263
|
+
var ERROR_DEFAULTS = {
|
|
264
|
+
light: {
|
|
265
|
+
background: { elevated: 0, ground: 0.03, sunken: 0.06 },
|
|
266
|
+
text: { primary: 0.9, secondary: 0.7, tertiary: 0.5, disabled: 0.3 },
|
|
267
|
+
action: { enabled: 0.04, hovered: 0.06, pressed: 0.08 },
|
|
268
|
+
border: { enabled: 0.08, focused: 0.16, filled: 0.24 }
|
|
269
|
+
},
|
|
270
|
+
dark: {
|
|
271
|
+
background: { elevated: 0.24, ground: 0.2, sunken: 0.16 },
|
|
272
|
+
text: { primary: 1, secondary: 0.85, tertiary: 0.7, disabled: 0.55 },
|
|
273
|
+
action: { enabled: 0.04, hovered: 0.06, pressed: 0.08 },
|
|
274
|
+
border: { enabled: 0.08, focused: 0.16, filled: 0.24 }
|
|
275
|
+
}
|
|
276
|
+
};
|
|
221
277
|
function fontConfigToFamily(font) {
|
|
222
278
|
const family = font.family.includes(" ") ? `"${font.family}"` : font.family;
|
|
223
279
|
return `${family}, ${font.fallback}`;
|
|
224
280
|
}
|
|
225
|
-
|
|
281
|
+
var clamp = (n) => Math.max(0, Math.min(1, n));
|
|
282
|
+
function computePaletteTokens(palette, defaults, mode, elevation, dynamicRange, elevationDelta, effectiveTextMode, autoAccentNv, neutralTextPrimary, neutralBgElevated) {
|
|
283
|
+
const modeDefaults = defaults[mode];
|
|
284
|
+
const toEngineNv = (nv) => mode === "light" ? 1 - nv : nv;
|
|
285
|
+
const textToEngineNv = (nv) => effectiveTextMode === "light" ? 1 - nv : nv;
|
|
286
|
+
const colorAt = (engineNv) => getColor(
|
|
287
|
+
palette.hue,
|
|
288
|
+
palette.saturation,
|
|
289
|
+
dynamicRange,
|
|
290
|
+
clamp(engineNv),
|
|
291
|
+
palette.desaturation,
|
|
292
|
+
palette.paletteHueGrading
|
|
293
|
+
);
|
|
294
|
+
const resolveKeyNv = (p) => mode === "dark" ? p.keyNormalizedValueDark : p.keyNormalizedValue;
|
|
295
|
+
const keyNv = resolveKeyNv(palette);
|
|
296
|
+
const fillBaseNv = keyNv ?? autoAccentNv;
|
|
297
|
+
const fillNv = clamp(fillBaseNv + elevationDelta);
|
|
298
|
+
const fill = colorAt(fillNv);
|
|
299
|
+
const hoverDir = effectiveTextMode === "light" ? -modeDefaults.action.hovered : modeDefaults.action.hovered;
|
|
300
|
+
const activeDir = effectiveTextMode === "light" ? -modeDefaults.action.pressed : modeDefaults.action.pressed;
|
|
301
|
+
const fillHover = colorAt(clamp(fillNv + hoverDir));
|
|
302
|
+
const fillActive = colorAt(clamp(fillNv + activeDir));
|
|
303
|
+
const onFill = fill.oklch.L > 0.6 ? neutralTextPrimary : neutralBgElevated;
|
|
304
|
+
const bgNormalized = elevation === 2 ? modeDefaults.background.elevated : elevation === 1 ? modeDefaults.background.ground : modeDefaults.background.sunken;
|
|
305
|
+
const bgNv = clamp(toEngineNv(bgNormalized));
|
|
306
|
+
const background = colorAt(bgNv);
|
|
307
|
+
const backgroundElevated = colorAt(clamp(toEngineNv(modeDefaults.background.elevated)));
|
|
308
|
+
const backgroundSunken = colorAt(clamp(toEngineNv(modeDefaults.background.sunken)));
|
|
309
|
+
const interactiveOffset = modeDefaults.action.enabled;
|
|
310
|
+
const interactiveNv = clamp(bgNv + (effectiveTextMode === "light" ? -interactiveOffset : interactiveOffset));
|
|
311
|
+
const backgroundInteractive = colorAt(interactiveNv);
|
|
312
|
+
const hoverShift = modeDefaults.action.hovered;
|
|
313
|
+
const activeShift = modeDefaults.action.pressed;
|
|
314
|
+
const backgroundInteractiveHover = colorAt(clamp(interactiveNv + (effectiveTextMode === "light" ? -hoverShift : hoverShift)));
|
|
315
|
+
const backgroundInteractiveActive = colorAt(clamp(interactiveNv + (effectiveTextMode === "light" ? -activeShift : activeShift)));
|
|
316
|
+
const textPrimary = colorAt(clamp(textToEngineNv(modeDefaults.text.primary) + elevationDelta));
|
|
317
|
+
const textSecondary = colorAt(clamp(textToEngineNv(modeDefaults.text.secondary) + elevationDelta));
|
|
318
|
+
const textTertiary = colorAt(clamp(textToEngineNv(modeDefaults.text.tertiary) + elevationDelta));
|
|
319
|
+
const textDisabled = colorAt(clamp(textToEngineNv(modeDefaults.text.disabled) + elevationDelta));
|
|
320
|
+
const borderOffset = modeDefaults.border.enabled;
|
|
321
|
+
const borderNv = effectiveTextMode === "light" ? bgNv - borderOffset : bgNv + borderOffset;
|
|
322
|
+
const border = colorAt(clamp(borderNv));
|
|
323
|
+
return {
|
|
324
|
+
fill,
|
|
325
|
+
fillHover,
|
|
326
|
+
fillActive,
|
|
327
|
+
onFill,
|
|
328
|
+
background,
|
|
329
|
+
backgroundElevated,
|
|
330
|
+
backgroundSunken,
|
|
331
|
+
backgroundInteractive,
|
|
332
|
+
backgroundInteractiveHover,
|
|
333
|
+
backgroundInteractiveActive,
|
|
334
|
+
textPrimary,
|
|
335
|
+
textSecondary,
|
|
336
|
+
textTertiary,
|
|
337
|
+
textDisabled,
|
|
338
|
+
border
|
|
339
|
+
};
|
|
340
|
+
}
|
|
341
|
+
function computeTokens(config, mode, elevation, spacing, radius, typography, icons, tokenOverrides) {
|
|
226
342
|
const { dynamicRange, palettes } = config;
|
|
227
|
-
const palette = palettes[
|
|
343
|
+
const palette = palettes[0];
|
|
228
344
|
if (!palette) {
|
|
229
|
-
throw new Error(
|
|
345
|
+
throw new Error("Neutral palette (index 0) not found");
|
|
230
346
|
}
|
|
231
|
-
const
|
|
232
|
-
const
|
|
233
|
-
const
|
|
347
|
+
const neutralDefaults = NEUTRAL_DEFAULTS[mode];
|
|
348
|
+
const toEngineNv = (nv) => mode === "light" ? 1 - nv : nv;
|
|
349
|
+
const bgElevatedNorm = mode === "light" ? tokenOverrides?.backgroundElevated : tokenOverrides?.backgroundElevatedDark;
|
|
350
|
+
const bgDefaultNorm = mode === "light" ? tokenOverrides?.backgroundDefault : tokenOverrides?.backgroundDefaultDark;
|
|
351
|
+
const bgSunkenNorm = mode === "light" ? tokenOverrides?.backgroundSunken : tokenOverrides?.backgroundSunkenDark;
|
|
352
|
+
const textPrimaryNorm = mode === "light" ? tokenOverrides?.textPrimaryNormalized : tokenOverrides?.textPrimaryNormalizedDark;
|
|
353
|
+
const textSecondaryNorm = mode === "light" ? tokenOverrides?.textSecondaryNormalized : tokenOverrides?.textSecondaryNormalizedDark;
|
|
354
|
+
const textTertiaryNorm = mode === "light" ? tokenOverrides?.textTertiaryNormalized : tokenOverrides?.textTertiaryNormalizedDark;
|
|
355
|
+
const textDisabledNorm = mode === "light" ? tokenOverrides?.textDisabledNormalized : tokenOverrides?.textDisabledNormalizedDark;
|
|
356
|
+
const bgNormalized = elevation === 2 ? bgElevatedNorm ?? neutralDefaults.background.elevated : elevation === 1 ? bgDefaultNorm ?? neutralDefaults.background.ground : bgSunkenNorm ?? neutralDefaults.background.sunken;
|
|
357
|
+
const backgroundNv = clamp(toEngineNv(bgNormalized));
|
|
358
|
+
const elevatedNv = clamp(toEngineNv(bgElevatedNorm ?? neutralDefaults.background.elevated));
|
|
359
|
+
const sunkenNv = clamp(toEngineNv(bgSunkenNorm ?? neutralDefaults.background.sunken));
|
|
360
|
+
const elevationDelta = backgroundNv - elevatedNv;
|
|
234
361
|
const effectiveTextMode = backgroundNv >= 0.5 ? "light" : "dark";
|
|
235
362
|
const background = getColor(
|
|
236
363
|
palette.hue,
|
|
@@ -240,7 +367,6 @@ function computeTokens(config, mode, themeMapping, elevation, elevationOffsets,
|
|
|
240
367
|
palette.desaturation,
|
|
241
368
|
palette.paletteHueGrading
|
|
242
369
|
);
|
|
243
|
-
const elevatedNv = Math.max(0, Math.min(1, baseNv + elevationOffsets[2]));
|
|
244
370
|
const backgroundElevated = getColor(
|
|
245
371
|
palette.hue,
|
|
246
372
|
palette.saturation,
|
|
@@ -249,7 +375,6 @@ function computeTokens(config, mode, themeMapping, elevation, elevationOffsets,
|
|
|
249
375
|
palette.desaturation,
|
|
250
376
|
palette.paletteHueGrading
|
|
251
377
|
);
|
|
252
|
-
const sunkenNv = Math.max(0, Math.min(1, baseNv + elevationOffsets[0]));
|
|
253
378
|
const backgroundSunken = getColor(
|
|
254
379
|
palette.hue,
|
|
255
380
|
palette.saturation,
|
|
@@ -258,8 +383,11 @@ function computeTokens(config, mode, themeMapping, elevation, elevationOffsets,
|
|
|
258
383
|
palette.desaturation,
|
|
259
384
|
palette.paletteHueGrading
|
|
260
385
|
);
|
|
261
|
-
const INTERACTIVE_COMPONENT_OFFSET =
|
|
262
|
-
const
|
|
386
|
+
const INTERACTIVE_COMPONENT_OFFSET = mode === "light" ? tokenOverrides?.interactiveComponentOffset ?? neutralDefaults.action.enabled : tokenOverrides?.interactiveComponentOffsetDark ?? neutralDefaults.action.enabled;
|
|
387
|
+
const HOVER_SHIFT = mode === "light" ? tokenOverrides?.hoverShift ?? neutralDefaults.action.hovered : tokenOverrides?.hoverShiftDark ?? neutralDefaults.action.hovered;
|
|
388
|
+
const ACTIVE_SHIFT = mode === "light" ? tokenOverrides?.activeShift ?? neutralDefaults.action.pressed : tokenOverrides?.activeShiftDark ?? neutralDefaults.action.pressed;
|
|
389
|
+
const BORDER_OFFSET = mode === "light" ? tokenOverrides?.borderOffset ?? neutralDefaults.border.enabled : tokenOverrides?.borderOffsetDark ?? neutralDefaults.border.enabled;
|
|
390
|
+
const interactiveComponentNv = clamp(backgroundNv + (effectiveTextMode === "light" ? -INTERACTIVE_COMPONENT_OFFSET : INTERACTIVE_COMPONENT_OFFSET));
|
|
263
391
|
const backgroundInteractive = getColor(
|
|
264
392
|
palette.hue,
|
|
265
393
|
palette.saturation,
|
|
@@ -268,143 +396,135 @@ function computeTokens(config, mode, themeMapping, elevation, elevationOffsets,
|
|
|
268
396
|
palette.desaturation,
|
|
269
397
|
palette.paletteHueGrading
|
|
270
398
|
);
|
|
271
|
-
const
|
|
399
|
+
const neutralHoverNv = clamp(interactiveComponentNv + (effectiveTextMode === "light" ? -HOVER_SHIFT : HOVER_SHIFT));
|
|
400
|
+
const backgroundInteractiveHover = getColor(
|
|
272
401
|
palette.hue,
|
|
273
402
|
palette.saturation,
|
|
274
403
|
dynamicRange,
|
|
275
|
-
|
|
276
|
-
effectiveTextMode,
|
|
404
|
+
neutralHoverNv,
|
|
277
405
|
palette.desaturation,
|
|
278
|
-
palette.paletteHueGrading
|
|
279
|
-
background
|
|
406
|
+
palette.paletteHueGrading
|
|
280
407
|
);
|
|
281
|
-
const
|
|
408
|
+
const neutralActiveNv = clamp(interactiveComponentNv + (effectiveTextMode === "light" ? -ACTIVE_SHIFT : ACTIVE_SHIFT));
|
|
409
|
+
const backgroundInteractiveActive = getColor(
|
|
282
410
|
palette.hue,
|
|
283
411
|
palette.saturation,
|
|
284
412
|
dynamicRange,
|
|
285
|
-
|
|
286
|
-
effectiveTextMode,
|
|
413
|
+
neutralActiveNv,
|
|
287
414
|
palette.desaturation,
|
|
288
|
-
palette.paletteHueGrading
|
|
289
|
-
background
|
|
415
|
+
palette.paletteHueGrading
|
|
290
416
|
);
|
|
291
|
-
const
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
const resolveKeyNv = (p) => mode === "dark" ? p.keyNormalizedValueDark : p.keyNormalizedValue;
|
|
296
|
-
const accentKeyNv = resolveKeyNv(accentPalette);
|
|
297
|
-
const interactive = accentKeyNv !== void 0 ? getColor(
|
|
298
|
-
accentPalette.hue,
|
|
299
|
-
accentPalette.saturation,
|
|
417
|
+
const textToEngineNv = (nv) => effectiveTextMode === "light" ? 1 - nv : nv;
|
|
418
|
+
const textPrimary = getColor(
|
|
419
|
+
palette.hue,
|
|
420
|
+
palette.saturation,
|
|
300
421
|
dynamicRange,
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
)
|
|
305
|
-
|
|
306
|
-
|
|
422
|
+
clamp(textToEngineNv(textPrimaryNorm ?? neutralDefaults.text.primary) + elevationDelta),
|
|
423
|
+
palette.desaturation,
|
|
424
|
+
palette.paletteHueGrading
|
|
425
|
+
);
|
|
426
|
+
const textSecondary = getColor(
|
|
427
|
+
palette.hue,
|
|
428
|
+
palette.saturation,
|
|
307
429
|
dynamicRange,
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
accentPalette.paletteHueGrading,
|
|
312
|
-
background
|
|
430
|
+
clamp(textToEngineNv(textSecondaryNorm ?? neutralDefaults.text.secondary) + elevationDelta),
|
|
431
|
+
palette.desaturation,
|
|
432
|
+
palette.paletteHueGrading
|
|
313
433
|
);
|
|
314
|
-
const
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
accentPalette.saturation,
|
|
434
|
+
const textTertiary = getColor(
|
|
435
|
+
palette.hue,
|
|
436
|
+
palette.saturation,
|
|
318
437
|
dynamicRange,
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
438
|
+
clamp(textToEngineNv(textTertiaryNorm ?? neutralDefaults.text.tertiary) + elevationDelta),
|
|
439
|
+
palette.desaturation,
|
|
440
|
+
palette.paletteHueGrading
|
|
322
441
|
);
|
|
323
|
-
const
|
|
324
|
-
|
|
325
|
-
|
|
442
|
+
const textDisabled = getColor(
|
|
443
|
+
palette.hue,
|
|
444
|
+
palette.saturation,
|
|
326
445
|
dynamicRange,
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
446
|
+
clamp(textToEngineNv(textDisabledNorm ?? neutralDefaults.text.disabled) + elevationDelta),
|
|
447
|
+
palette.desaturation,
|
|
448
|
+
palette.paletteHueGrading
|
|
330
449
|
);
|
|
331
|
-
const borderNv = effectiveTextMode === "light" ? backgroundNv -
|
|
450
|
+
const borderNv = effectiveTextMode === "light" ? backgroundNv - BORDER_OFFSET : backgroundNv + BORDER_OFFSET;
|
|
332
451
|
const border = getColor(
|
|
333
452
|
palette.hue,
|
|
334
453
|
palette.saturation,
|
|
335
454
|
dynamicRange,
|
|
336
|
-
|
|
455
|
+
clamp(borderNv),
|
|
337
456
|
palette.desaturation,
|
|
338
457
|
palette.paletteHueGrading
|
|
339
458
|
);
|
|
459
|
+
const autoAccentNv = clamp(textToEngineNv(textPrimaryNorm ?? neutralDefaults.text.primary));
|
|
460
|
+
const accentPalette = palettes[1];
|
|
461
|
+
if (!accentPalette) {
|
|
462
|
+
throw new Error("Accent palette (index 1) not found");
|
|
463
|
+
}
|
|
464
|
+
const accent = computePaletteTokens(
|
|
465
|
+
accentPalette,
|
|
466
|
+
ACCENT_DEFAULTS,
|
|
467
|
+
mode,
|
|
468
|
+
elevation,
|
|
469
|
+
dynamicRange,
|
|
470
|
+
elevationDelta,
|
|
471
|
+
effectiveTextMode,
|
|
472
|
+
autoAccentNv,
|
|
473
|
+
textPrimary,
|
|
474
|
+
backgroundElevated
|
|
475
|
+
);
|
|
340
476
|
const successPalette = palettes[2];
|
|
341
477
|
const warningPalette = palettes[3];
|
|
342
478
|
const errorPalette = palettes[4];
|
|
343
|
-
const
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
479
|
+
const success = successPalette ? computePaletteTokens(
|
|
480
|
+
successPalette,
|
|
481
|
+
SUCCESS_DEFAULTS,
|
|
482
|
+
mode,
|
|
483
|
+
elevation,
|
|
347
484
|
dynamicRange,
|
|
348
|
-
|
|
349
|
-
successPalette.desaturation,
|
|
350
|
-
successPalette.paletteHueGrading
|
|
351
|
-
) : getColorByContrast(
|
|
352
|
-
successPalette.hue,
|
|
353
|
-
successPalette.saturation,
|
|
354
|
-
dynamicRange,
|
|
355
|
-
4.5,
|
|
485
|
+
elevationDelta,
|
|
356
486
|
effectiveTextMode,
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
) :
|
|
361
|
-
const
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
warningKeyNv,
|
|
367
|
-
warningPalette.desaturation,
|
|
368
|
-
warningPalette.paletteHueGrading
|
|
369
|
-
) : getColorByContrast(
|
|
370
|
-
warningPalette.hue,
|
|
371
|
-
warningPalette.saturation,
|
|
487
|
+
autoAccentNv,
|
|
488
|
+
textPrimary,
|
|
489
|
+
backgroundElevated
|
|
490
|
+
) : accent;
|
|
491
|
+
const warning = warningPalette ? computePaletteTokens(
|
|
492
|
+
warningPalette,
|
|
493
|
+
WARNING_DEFAULTS,
|
|
494
|
+
mode,
|
|
495
|
+
elevation,
|
|
372
496
|
dynamicRange,
|
|
373
|
-
|
|
497
|
+
elevationDelta,
|
|
374
498
|
effectiveTextMode,
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
) :
|
|
379
|
-
const
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
errorKeyNv,
|
|
385
|
-
errorPalette.desaturation,
|
|
386
|
-
errorPalette.paletteHueGrading
|
|
387
|
-
) : getColorByContrast(
|
|
388
|
-
errorPalette.hue,
|
|
389
|
-
errorPalette.saturation,
|
|
499
|
+
autoAccentNv,
|
|
500
|
+
textPrimary,
|
|
501
|
+
backgroundElevated
|
|
502
|
+
) : accent;
|
|
503
|
+
const error = errorPalette ? computePaletteTokens(
|
|
504
|
+
errorPalette,
|
|
505
|
+
ERROR_DEFAULTS,
|
|
506
|
+
mode,
|
|
507
|
+
elevation,
|
|
390
508
|
dynamicRange,
|
|
391
|
-
|
|
509
|
+
elevationDelta,
|
|
392
510
|
effectiveTextMode,
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
) :
|
|
511
|
+
autoAccentNv,
|
|
512
|
+
textPrimary,
|
|
513
|
+
backgroundElevated
|
|
514
|
+
) : accent;
|
|
397
515
|
return {
|
|
398
516
|
background,
|
|
399
517
|
backgroundElevated,
|
|
400
518
|
backgroundSunken,
|
|
401
519
|
backgroundInteractive,
|
|
520
|
+
backgroundInteractiveHover,
|
|
521
|
+
backgroundInteractiveActive,
|
|
402
522
|
textPrimary,
|
|
403
523
|
textSecondary,
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
interactiveActive,
|
|
524
|
+
textTertiary,
|
|
525
|
+
textDisabled,
|
|
407
526
|
border,
|
|
527
|
+
accent,
|
|
408
528
|
success,
|
|
409
529
|
warning,
|
|
410
530
|
error,
|
|
@@ -430,29 +550,26 @@ function computeTokens(config, mode, themeMapping, elevation, elevationOffsets,
|
|
|
430
550
|
|
|
431
551
|
// src/tokens/useTokens.ts
|
|
432
552
|
function useTokens(elevation) {
|
|
433
|
-
const { config, mode
|
|
553
|
+
const { config, mode } = useNewtoneTheme();
|
|
434
554
|
const frameCtx = useFrameContext();
|
|
435
|
-
const resolvedTheme = frameCtx?.theme ?? providerTheme;
|
|
436
555
|
const resolvedElevation = elevation ?? frameCtx?.elevation ?? 1;
|
|
556
|
+
const canReuse = frameCtx !== null && elevation === void 0 && frameCtx.elevation === resolvedElevation;
|
|
437
557
|
return useMemo(() => {
|
|
438
|
-
|
|
558
|
+
if (canReuse) {
|
|
559
|
+
return { ...frameCtx.tokens, elevation: resolvedElevation };
|
|
560
|
+
}
|
|
439
561
|
const tokens = computeTokens(
|
|
440
562
|
config.colorSystem,
|
|
441
563
|
mode,
|
|
442
|
-
themeMapping,
|
|
443
564
|
resolvedElevation,
|
|
444
|
-
config.elevation.offsets,
|
|
445
565
|
config.spacing,
|
|
446
566
|
config.radius,
|
|
447
567
|
config.typography,
|
|
448
|
-
config.icons
|
|
568
|
+
config.icons,
|
|
569
|
+
config.tokenOverrides
|
|
449
570
|
);
|
|
450
571
|
return { ...tokens, elevation: resolvedElevation };
|
|
451
|
-
}, [config, mode,
|
|
452
|
-
}
|
|
453
|
-
function withOpacity(hexColor, opacity) {
|
|
454
|
-
const alpha = Math.round(opacity * 255).toString(16).padStart(2, "0");
|
|
455
|
-
return `${hexColor}${alpha}`;
|
|
572
|
+
}, [config, mode, resolvedElevation, canReuse, frameCtx?.tokens]);
|
|
456
573
|
}
|
|
457
574
|
function computeButtonPadding(size, hasIcon, hasText, iconPosition) {
|
|
458
575
|
const basePadding = {
|
|
@@ -502,8 +619,19 @@ function computeButtonPadding(size, hasIcon, hasText, iconPosition) {
|
|
|
502
619
|
paddingBottom: base
|
|
503
620
|
};
|
|
504
621
|
}
|
|
505
|
-
function
|
|
506
|
-
|
|
622
|
+
function getPaletteTokens(semantic, tokens) {
|
|
623
|
+
switch (semantic) {
|
|
624
|
+
case "accent":
|
|
625
|
+
return tokens.accent;
|
|
626
|
+
case "success":
|
|
627
|
+
return tokens.success;
|
|
628
|
+
case "error":
|
|
629
|
+
return tokens.error;
|
|
630
|
+
case "warning":
|
|
631
|
+
return tokens.warning;
|
|
632
|
+
default:
|
|
633
|
+
return void 0;
|
|
634
|
+
}
|
|
507
635
|
}
|
|
508
636
|
function getButtonConfig(variant, semantic, size, disabled, tokens) {
|
|
509
637
|
const sizeConfig = getSizeConfig(size, tokens);
|
|
@@ -551,10 +679,12 @@ function getSizeConfig(size, tokens) {
|
|
|
551
679
|
function getVariantColors(variant, semantic, disabled, tokens) {
|
|
552
680
|
if (disabled) {
|
|
553
681
|
const baseColors = getVariantColorsForState(variant, semantic, tokens);
|
|
682
|
+
const disabledBg = srgbToHex(tokens.backgroundSunken.srgb);
|
|
554
683
|
return {
|
|
555
684
|
...baseColors,
|
|
556
|
-
bg:
|
|
557
|
-
|
|
685
|
+
bg: disabledBg,
|
|
686
|
+
hoveredBg: disabledBg,
|
|
687
|
+
pressedBg: disabledBg,
|
|
558
688
|
textColor: srgbToHex(tokens.textSecondary.srgb),
|
|
559
689
|
iconColor: srgbToHex(tokens.textSecondary.srgb)
|
|
560
690
|
};
|
|
@@ -562,109 +692,76 @@ function getVariantColors(variant, semantic, disabled, tokens) {
|
|
|
562
692
|
return getVariantColorsForState(variant, semantic, tokens);
|
|
563
693
|
}
|
|
564
694
|
function getVariantColorsForState(variant, semantic, tokens) {
|
|
565
|
-
const
|
|
566
|
-
switch (semantic) {
|
|
567
|
-
case "accent":
|
|
568
|
-
return srgbToHex(tokens.interactive.srgb);
|
|
569
|
-
case "success":
|
|
570
|
-
return srgbToHex(tokens.success.srgb);
|
|
571
|
-
case "error":
|
|
572
|
-
return srgbToHex(tokens.error.srgb);
|
|
573
|
-
case "warning":
|
|
574
|
-
return srgbToHex(tokens.warning.srgb);
|
|
575
|
-
default:
|
|
576
|
-
return srgbToHex(tokens.textPrimary.srgb);
|
|
577
|
-
}
|
|
578
|
-
};
|
|
695
|
+
const paletteTokens = getPaletteTokens(semantic, tokens);
|
|
579
696
|
if (variant === "primary") {
|
|
580
697
|
if (semantic === "neutral") {
|
|
581
|
-
const bg = getNeutralPrimaryBg(tokens);
|
|
582
698
|
return {
|
|
583
|
-
bg,
|
|
584
|
-
|
|
585
|
-
|
|
699
|
+
bg: srgbToHex(tokens.backgroundInteractive.srgb),
|
|
700
|
+
hoveredBg: srgbToHex(tokens.backgroundInteractiveHover.srgb),
|
|
701
|
+
pressedBg: srgbToHex(tokens.backgroundInteractiveActive.srgb),
|
|
586
702
|
textColor: srgbToHex(tokens.textPrimary.srgb),
|
|
587
703
|
iconColor: srgbToHex(tokens.textPrimary.srgb),
|
|
588
704
|
borderWidth: 1,
|
|
589
705
|
borderColor: "transparent"
|
|
590
|
-
// Invisible border for consistent sizing
|
|
591
706
|
};
|
|
592
707
|
}
|
|
593
|
-
if (semantic === "accent") {
|
|
594
|
-
return {
|
|
595
|
-
bg: srgbToHex(tokens.interactive.srgb),
|
|
596
|
-
pressedBg: srgbToHex(tokens.interactiveActive.srgb),
|
|
597
|
-
textColor: srgbToHex(tokens.background.srgb),
|
|
598
|
-
// Contrast inversion
|
|
599
|
-
iconColor: srgbToHex(tokens.background.srgb),
|
|
600
|
-
borderWidth: 1,
|
|
601
|
-
borderColor: "transparent"
|
|
602
|
-
// Invisible border for consistent sizing
|
|
603
|
-
};
|
|
604
|
-
}
|
|
605
|
-
const semanticColor = getSemanticColor();
|
|
606
708
|
return {
|
|
607
|
-
bg:
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
textColor: srgbToHex(
|
|
611
|
-
|
|
612
|
-
iconColor: srgbToHex(tokens.background.srgb),
|
|
709
|
+
bg: srgbToHex(paletteTokens.fill.srgb),
|
|
710
|
+
hoveredBg: srgbToHex(paletteTokens.fillHover.srgb),
|
|
711
|
+
pressedBg: srgbToHex(paletteTokens.fillActive.srgb),
|
|
712
|
+
textColor: srgbToHex(paletteTokens.onFill.srgb),
|
|
713
|
+
iconColor: srgbToHex(paletteTokens.onFill.srgb),
|
|
613
714
|
borderWidth: 1,
|
|
614
715
|
borderColor: "transparent"
|
|
615
|
-
// Invisible border for consistent sizing
|
|
616
716
|
};
|
|
617
717
|
}
|
|
618
718
|
if (variant === "secondary") {
|
|
619
719
|
if (semantic === "neutral") {
|
|
620
720
|
return {
|
|
621
721
|
bg: "transparent",
|
|
622
|
-
|
|
722
|
+
hoveredBg: srgbToHex(tokens.backgroundInteractive.srgb),
|
|
723
|
+
pressedBg: srgbToHex(tokens.backgroundInteractiveHover.srgb),
|
|
623
724
|
textColor: srgbToHex(tokens.textPrimary.srgb),
|
|
624
725
|
iconColor: srgbToHex(tokens.textPrimary.srgb),
|
|
625
726
|
borderWidth: 1,
|
|
626
727
|
borderColor: srgbToHex(tokens.border.srgb)
|
|
627
728
|
};
|
|
628
729
|
}
|
|
629
|
-
const semanticColor = getSemanticColor();
|
|
630
730
|
return {
|
|
631
|
-
bg:
|
|
632
|
-
|
|
633
|
-
pressedBg:
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
iconColor: semanticColor,
|
|
731
|
+
bg: srgbToHex(paletteTokens.background.srgb),
|
|
732
|
+
hoveredBg: srgbToHex(paletteTokens.backgroundInteractive.srgb),
|
|
733
|
+
pressedBg: srgbToHex(paletteTokens.backgroundInteractiveHover.srgb),
|
|
734
|
+
textColor: srgbToHex(paletteTokens.fill.srgb),
|
|
735
|
+
iconColor: srgbToHex(paletteTokens.fill.srgb),
|
|
637
736
|
borderWidth: 1,
|
|
638
737
|
borderColor: "transparent"
|
|
639
|
-
// Invisible border for consistent sizing
|
|
640
738
|
};
|
|
641
739
|
}
|
|
642
740
|
if (variant === "tertiary") {
|
|
643
741
|
if (semantic === "neutral") {
|
|
644
742
|
return {
|
|
645
743
|
bg: "transparent",
|
|
646
|
-
|
|
744
|
+
hoveredBg: srgbToHex(tokens.backgroundInteractive.srgb),
|
|
745
|
+
pressedBg: srgbToHex(tokens.backgroundInteractiveHover.srgb),
|
|
647
746
|
textColor: srgbToHex(tokens.textPrimary.srgb),
|
|
648
747
|
iconColor: srgbToHex(tokens.textPrimary.srgb),
|
|
649
748
|
borderWidth: 1,
|
|
650
749
|
borderColor: "transparent"
|
|
651
|
-
// Invisible border for consistent sizing
|
|
652
750
|
};
|
|
653
751
|
}
|
|
654
|
-
const semanticColor = getSemanticColor();
|
|
655
752
|
return {
|
|
656
753
|
bg: "transparent",
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
textColor:
|
|
660
|
-
iconColor:
|
|
754
|
+
hoveredBg: srgbToHex(paletteTokens.background.srgb),
|
|
755
|
+
pressedBg: srgbToHex(paletteTokens.backgroundInteractive.srgb),
|
|
756
|
+
textColor: srgbToHex(paletteTokens.fill.srgb),
|
|
757
|
+
iconColor: srgbToHex(paletteTokens.fill.srgb),
|
|
661
758
|
borderWidth: 1,
|
|
662
759
|
borderColor: "transparent"
|
|
663
|
-
// Invisible border for consistent sizing
|
|
664
760
|
};
|
|
665
761
|
}
|
|
666
762
|
return {
|
|
667
763
|
bg: "transparent",
|
|
764
|
+
hoveredBg: "transparent",
|
|
668
765
|
pressedBg: "transparent",
|
|
669
766
|
textColor: srgbToHex(tokens.textPrimary.srgb),
|
|
670
767
|
iconColor: srgbToHex(tokens.textPrimary.srgb),
|
|
@@ -677,9 +774,7 @@ function Icon({
|
|
|
677
774
|
opticalSize,
|
|
678
775
|
fill = 0,
|
|
679
776
|
color,
|
|
680
|
-
elevation = 1,
|
|
681
777
|
style,
|
|
682
|
-
onPress,
|
|
683
778
|
// Accessibility
|
|
684
779
|
accessibilityLabel,
|
|
685
780
|
// Testing & platform
|
|
@@ -687,7 +782,7 @@ function Icon({
|
|
|
687
782
|
nativeID,
|
|
688
783
|
ref
|
|
689
784
|
}) {
|
|
690
|
-
const tokens = useTokens(
|
|
785
|
+
const tokens = useTokens();
|
|
691
786
|
const iconStyle = useMemo(() => {
|
|
692
787
|
const fontSize = size ?? tokens.typography.size.base;
|
|
693
788
|
const getOpticalSize = (size2) => {
|
|
@@ -699,7 +794,8 @@ function Icon({
|
|
|
699
794
|
const opsz = opticalSize ?? getOpticalSize(fontSize);
|
|
700
795
|
const iconColor = color ?? srgbToHex(tokens.textPrimary.srgb);
|
|
701
796
|
const fontFamily = `Material Symbols ${tokens.icons.variant.charAt(0).toUpperCase() + tokens.icons.variant.slice(1)}`;
|
|
702
|
-
const
|
|
797
|
+
const fillValue = typeof fill === "boolean" ? fill ? 1 : 0 : fill;
|
|
798
|
+
const fontVariationSettings = `'FILL' ${fillValue}, 'wght' ${tokens.icons.weight}, 'GRAD' ${tokens.icons.grade}, 'opsz' ${opsz}`;
|
|
703
799
|
return {
|
|
704
800
|
fontFamily,
|
|
705
801
|
fontSize,
|
|
@@ -725,17 +821,31 @@ function Icon({
|
|
|
725
821
|
nativeID,
|
|
726
822
|
accessibilityLabel,
|
|
727
823
|
importantForAccessibility: accessibilityLabel ? "yes" : "no-hide-descendants",
|
|
728
|
-
style: iconStyle
|
|
729
|
-
onPress
|
|
824
|
+
style: iconStyle
|
|
730
825
|
},
|
|
731
826
|
name
|
|
732
827
|
);
|
|
733
828
|
}
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
829
|
+
function resolveTextColor(color, tokens) {
|
|
830
|
+
switch (color) {
|
|
831
|
+
case "primary":
|
|
832
|
+
return srgbToHex(tokens.textPrimary.srgb);
|
|
833
|
+
case "secondary":
|
|
834
|
+
return srgbToHex(tokens.textSecondary.srgb);
|
|
835
|
+
case "tertiary":
|
|
836
|
+
return srgbToHex(tokens.textTertiary.srgb);
|
|
837
|
+
case "disabled":
|
|
838
|
+
return srgbToHex(tokens.textDisabled.srgb);
|
|
839
|
+
case "accent":
|
|
840
|
+
return srgbToHex(tokens.accent.fill.srgb);
|
|
841
|
+
case "success":
|
|
842
|
+
return srgbToHex(tokens.success.fill.srgb);
|
|
843
|
+
case "warning":
|
|
844
|
+
return srgbToHex(tokens.warning.fill.srgb);
|
|
845
|
+
case "error":
|
|
846
|
+
return srgbToHex(tokens.error.fill.srgb);
|
|
847
|
+
}
|
|
848
|
+
}
|
|
739
849
|
function Text2({
|
|
740
850
|
children,
|
|
741
851
|
size = "base",
|
|
@@ -764,7 +874,7 @@ function Text2({
|
|
|
764
874
|
// Font weight is stored as a number (e.g. 400, 600) but React Native expects a string.
|
|
765
875
|
fontWeight: String(tokens.typography.weight[weight]),
|
|
766
876
|
// Convert the theme color from internal sRGB format to a hex string (e.g. '#1a1a1a').
|
|
767
|
-
color:
|
|
877
|
+
color: resolveTextColor(color, tokens),
|
|
768
878
|
// Line height = font size × multiplier (e.g. 16px × 1.5 = 24px line height).
|
|
769
879
|
lineHeight: fontSize * tokens.typography.lineHeight[lineHeight],
|
|
770
880
|
textAlign: align
|
|
@@ -1021,7 +1131,7 @@ function Button({
|
|
|
1021
1131
|
() => computeButtonPadding(size, !!icon, !!children, iconPosition),
|
|
1022
1132
|
[size, icon, children, iconPosition]
|
|
1023
1133
|
);
|
|
1024
|
-
return /* @__PURE__ */ React13.createElement(Pressable, { disabled, ...pressableProps }, ({ pressed }) => (
|
|
1134
|
+
return /* @__PURE__ */ React13.createElement(Pressable, { disabled, ...pressableProps }, ({ pressed, hovered }) => (
|
|
1025
1135
|
// Wrapper handles layout: direction, gap, alignment (padding via style)
|
|
1026
1136
|
/* @__PURE__ */ React13.createElement(
|
|
1027
1137
|
Wrapper,
|
|
@@ -1034,7 +1144,7 @@ function Button({
|
|
|
1034
1144
|
{
|
|
1035
1145
|
...padding,
|
|
1036
1146
|
// Asymmetric horizontal padding for text optical balance
|
|
1037
|
-
backgroundColor: pressed && !disabled ? variantColors.pressedBg : variantColors.bg,
|
|
1147
|
+
backgroundColor: pressed && !disabled ? variantColors.pressedBg : hovered && !disabled ? variantColors.hoveredBg : variantColors.bg,
|
|
1038
1148
|
borderRadius: sizeTokens.borderRadius,
|
|
1039
1149
|
borderWidth: variantColors.borderWidth,
|
|
1040
1150
|
// Always 1 for consistent sizing
|
|
@@ -1252,8 +1362,7 @@ function toElevationLevel(frameElevation) {
|
|
|
1252
1362
|
}
|
|
1253
1363
|
function Frame({
|
|
1254
1364
|
children,
|
|
1255
|
-
//
|
|
1256
|
-
theme,
|
|
1365
|
+
// Elevation
|
|
1257
1366
|
elevation,
|
|
1258
1367
|
// Layout
|
|
1259
1368
|
layout,
|
|
@@ -1292,25 +1401,22 @@ function Frame({
|
|
|
1292
1401
|
// Style override
|
|
1293
1402
|
style
|
|
1294
1403
|
}) {
|
|
1295
|
-
const { config, mode
|
|
1404
|
+
const { config, mode } = useNewtoneTheme();
|
|
1296
1405
|
const parentFrameCtx = useFrameContext();
|
|
1297
|
-
const resolvedTheme = theme ?? parentFrameCtx?.theme ?? providerTheme;
|
|
1298
1406
|
const resolvedFrameElevation = elevation ?? 0;
|
|
1299
1407
|
const resolvedElevation = elevation !== void 0 ? toElevationLevel(elevation) : parentFrameCtx?.elevation ?? 1;
|
|
1300
1408
|
const tokens = useMemo(() => {
|
|
1301
|
-
const themeMapping = config.themes[resolvedTheme];
|
|
1302
1409
|
return computeTokens(
|
|
1303
1410
|
config.colorSystem,
|
|
1304
1411
|
mode,
|
|
1305
|
-
themeMapping,
|
|
1306
1412
|
resolvedElevation,
|
|
1307
|
-
config.elevation.offsets,
|
|
1308
1413
|
config.spacing,
|
|
1309
1414
|
config.radius,
|
|
1310
1415
|
config.typography,
|
|
1311
|
-
config.icons
|
|
1416
|
+
config.icons,
|
|
1417
|
+
config.tokenOverrides
|
|
1312
1418
|
);
|
|
1313
|
-
}, [config, mode,
|
|
1419
|
+
}, [config, mode, resolvedElevation]);
|
|
1314
1420
|
const styles = useMemo(
|
|
1315
1421
|
() => getFrameStyles({
|
|
1316
1422
|
tokens,
|
|
@@ -1360,8 +1466,8 @@ function Frame({
|
|
|
1360
1466
|
]
|
|
1361
1467
|
);
|
|
1362
1468
|
const contextValue = useMemo(
|
|
1363
|
-
() => ({
|
|
1364
|
-
[
|
|
1469
|
+
() => ({ elevation: resolvedElevation, tokens }),
|
|
1470
|
+
[resolvedElevation, tokens]
|
|
1365
1471
|
);
|
|
1366
1472
|
const webOverrides = [];
|
|
1367
1473
|
if (styles.gridWebStyle) {
|
|
@@ -1376,7 +1482,7 @@ function Frame({
|
|
|
1376
1482
|
const focusRingStyle = isFocusVisible && !disabled ? {
|
|
1377
1483
|
outlineWidth: 2,
|
|
1378
1484
|
outlineStyle: "solid",
|
|
1379
|
-
outlineColor: srgbToHex(tokens.
|
|
1485
|
+
outlineColor: srgbToHex(tokens.accent.fill.srgb),
|
|
1380
1486
|
outlineOffset: 2
|
|
1381
1487
|
} : void 0;
|
|
1382
1488
|
const webFocusProps = isInteractive ? focusProps : {};
|
|
@@ -1831,7 +1937,7 @@ function SelectOptionRow({
|
|
|
1831
1937
|
},
|
|
1832
1938
|
isSelected && {
|
|
1833
1939
|
fontWeight: tokens.typography.weight.semibold,
|
|
1834
|
-
color: srgbToHex(tokens.
|
|
1940
|
+
color: srgbToHex(tokens.accent.fill.srgb)
|
|
1835
1941
|
},
|
|
1836
1942
|
option.disabled && {
|
|
1837
1943
|
color: srgbToHex(tokens.textSecondary.srgb)
|
|
@@ -1846,7 +1952,7 @@ function SelectOptionRow({
|
|
|
1846
1952
|
{
|
|
1847
1953
|
name: "check",
|
|
1848
1954
|
size: fontSize,
|
|
1849
|
-
color: srgbToHex(tokens.
|
|
1955
|
+
color: srgbToHex(tokens.accent.fill.srgb)
|
|
1850
1956
|
}
|
|
1851
1957
|
))
|
|
1852
1958
|
);
|
|
@@ -1989,7 +2095,7 @@ function getToggleStyles(tokens, value, disabled) {
|
|
|
1989
2095
|
width: TRACK_WIDTH,
|
|
1990
2096
|
height: TRACK_HEIGHT,
|
|
1991
2097
|
borderRadius: TRACK_HEIGHT / 2,
|
|
1992
|
-
backgroundColor: value ? srgbToHex(tokens.
|
|
2098
|
+
backgroundColor: value ? srgbToHex(tokens.accent.fill.srgb) : srgbToHex(tokens.border.srgb),
|
|
1993
2099
|
justifyContent: "center",
|
|
1994
2100
|
paddingHorizontal: THUMB_OFFSET
|
|
1995
2101
|
},
|
|
@@ -2089,14 +2195,14 @@ function getSliderStyles(tokens, disabled) {
|
|
|
2089
2195
|
left: 0,
|
|
2090
2196
|
height: TRACK_HEIGHT2,
|
|
2091
2197
|
borderRadius: TRACK_HEIGHT2 / 2,
|
|
2092
|
-
backgroundColor: srgbToHex(tokens.
|
|
2198
|
+
backgroundColor: srgbToHex(tokens.accent.fill.srgb)
|
|
2093
2199
|
},
|
|
2094
2200
|
thumb: {
|
|
2095
2201
|
position: "absolute",
|
|
2096
2202
|
width: THUMB_SIZE2,
|
|
2097
2203
|
height: THUMB_SIZE2,
|
|
2098
2204
|
borderRadius: THUMB_SIZE2 / 2,
|
|
2099
|
-
backgroundColor: srgbToHex(tokens.
|
|
2205
|
+
backgroundColor: srgbToHex(tokens.accent.fill.srgb)
|
|
2100
2206
|
}
|
|
2101
2207
|
});
|
|
2102
2208
|
}
|
|
@@ -2471,7 +2577,7 @@ function getColorScaleSliderStyles(tokens, disabled) {
|
|
|
2471
2577
|
fontFamily: tokens.typography.fonts.default,
|
|
2472
2578
|
fontSize: tokens.typography.size.xs,
|
|
2473
2579
|
fontWeight: tokens.typography.weight.medium,
|
|
2474
|
-
color: srgbToHex(tokens.error.srgb)
|
|
2580
|
+
color: srgbToHex(tokens.error.fill.srgb)
|
|
2475
2581
|
}
|
|
2476
2582
|
});
|
|
2477
2583
|
}
|
|
@@ -2720,13 +2826,17 @@ var COMPONENTS = [
|
|
|
2720
2826
|
variants: [
|
|
2721
2827
|
{ id: "primary-md", label: "Primary", props: { variant: "primary", size: "md" } },
|
|
2722
2828
|
{ id: "secondary-md", label: "Secondary", props: { variant: "secondary", size: "md" } },
|
|
2723
|
-
{ id: "
|
|
2724
|
-
{ id: "outline-md", label: "Outline", props: { variant: "outline", size: "md" } },
|
|
2829
|
+
{ id: "tertiary-md", label: "Tertiary", props: { variant: "tertiary", size: "md" } },
|
|
2725
2830
|
{ id: "primary-sm", label: "Primary Small", props: { variant: "primary", size: "sm" } },
|
|
2726
2831
|
{ id: "primary-lg", label: "Primary Large", props: { variant: "primary", size: "lg" } },
|
|
2832
|
+
{ id: "accent-primary", label: "Accent Primary", props: { variant: "primary", size: "md", semantic: "accent" } },
|
|
2833
|
+
{ id: "accent-secondary", label: "Accent Secondary", props: { variant: "secondary", size: "md", semantic: "accent" } },
|
|
2834
|
+
{ id: "success-primary", label: "Success Primary", props: { variant: "primary", size: "md", semantic: "success" } },
|
|
2835
|
+
{ id: "error-primary", label: "Error Primary", props: { variant: "primary", size: "md", semantic: "error" } },
|
|
2836
|
+
{ id: "warning-primary", label: "Warning Primary", props: { variant: "primary", size: "md", semantic: "warning" } },
|
|
2727
2837
|
{ id: "icon-left", label: "Icon Left", props: { variant: "primary", size: "md", icon: "add" } },
|
|
2728
2838
|
{ id: "icon-right", label: "Icon Right", props: { variant: "primary", size: "md", icon: "arrow_forward", iconPosition: "right" } },
|
|
2729
|
-
{ id: "icon-only", label: "Icon Only", props: { variant: "
|
|
2839
|
+
{ id: "icon-only", label: "Icon Only", props: { variant: "tertiary", size: "md", icon: "settings" } }
|
|
2730
2840
|
],
|
|
2731
2841
|
editableProps: [
|
|
2732
2842
|
{
|
|
@@ -2736,11 +2846,23 @@ var COMPONENTS = [
|
|
|
2736
2846
|
options: [
|
|
2737
2847
|
{ label: "Primary", value: "primary" },
|
|
2738
2848
|
{ label: "Secondary", value: "secondary" },
|
|
2739
|
-
{ label: "
|
|
2740
|
-
{ label: "Outline", value: "outline" }
|
|
2849
|
+
{ label: "Tertiary", value: "tertiary" }
|
|
2741
2850
|
],
|
|
2742
2851
|
defaultValue: "primary"
|
|
2743
2852
|
},
|
|
2853
|
+
{
|
|
2854
|
+
name: "semantic",
|
|
2855
|
+
label: "Semantic",
|
|
2856
|
+
control: "select",
|
|
2857
|
+
options: [
|
|
2858
|
+
{ label: "Neutral", value: "neutral" },
|
|
2859
|
+
{ label: "Accent", value: "accent" },
|
|
2860
|
+
{ label: "Success", value: "success" },
|
|
2861
|
+
{ label: "Warning", value: "warning" },
|
|
2862
|
+
{ label: "Error", value: "error" }
|
|
2863
|
+
],
|
|
2864
|
+
defaultValue: "neutral"
|
|
2865
|
+
},
|
|
2744
2866
|
{
|
|
2745
2867
|
name: "size",
|
|
2746
2868
|
label: "Size",
|
|
@@ -3103,7 +3225,7 @@ var COMPONENTS = [
|
|
|
3103
3225
|
{ id: "subheading", label: "Subheading", props: { size: "lg", weight: "semibold" } },
|
|
3104
3226
|
{ id: "body", label: "Body", props: { size: "base" } },
|
|
3105
3227
|
{ id: "caption", label: "Caption", props: { size: "sm", color: "secondary" } },
|
|
3106
|
-
{ id: "
|
|
3228
|
+
{ id: "accent", label: "Accent", props: { color: "accent", weight: "medium" } },
|
|
3107
3229
|
{ id: "mono", label: "Monospace", props: { font: "mono", size: "sm" } }
|
|
3108
3230
|
],
|
|
3109
3231
|
editableProps: [
|
|
@@ -3141,7 +3263,12 @@ var COMPONENTS = [
|
|
|
3141
3263
|
options: [
|
|
3142
3264
|
{ label: "Primary", value: "primary" },
|
|
3143
3265
|
{ label: "Secondary", value: "secondary" },
|
|
3144
|
-
{ label: "
|
|
3266
|
+
{ label: "Tertiary", value: "tertiary" },
|
|
3267
|
+
{ label: "Disabled", value: "disabled" },
|
|
3268
|
+
{ label: "Accent", value: "accent" },
|
|
3269
|
+
{ label: "Success", value: "success" },
|
|
3270
|
+
{ label: "Warning", value: "warning" },
|
|
3271
|
+
{ label: "Error", value: "error" }
|
|
3145
3272
|
],
|
|
3146
3273
|
defaultValue: "primary"
|
|
3147
3274
|
},
|
|
@@ -3163,40 +3290,35 @@ var COMPONENTS = [
|
|
|
3163
3290
|
name: "Icon",
|
|
3164
3291
|
importName: "Icon",
|
|
3165
3292
|
categoryId: "primitives",
|
|
3166
|
-
description: "Material Symbols icon with size
|
|
3293
|
+
description: "Material Symbols icon with size and fill",
|
|
3167
3294
|
hasChildren: false,
|
|
3168
3295
|
variants: [
|
|
3169
|
-
{ id: "
|
|
3170
|
-
{ id: "settings", label: "Settings", props: { name: "settings" } },
|
|
3171
|
-
{ id: "check", label: "Check", props: { name: "check" } },
|
|
3172
|
-
{ id: "add", label: "Add", props: { name: "add" } },
|
|
3173
|
-
{ id: "delete", label: "Delete", props: { name: "delete" } },
|
|
3174
|
-
{ id: "search", label: "Search", props: { name: "search" } },
|
|
3175
|
-
{ id: "filled", label: "Filled Icon", props: { name: "favorite", fill: 1 } },
|
|
3176
|
-
{ id: "large", label: "Large Icon", props: { name: "star", size: 32 } }
|
|
3296
|
+
{ id: "default", label: "Default", props: { name: "add" } }
|
|
3177
3297
|
],
|
|
3178
3298
|
editableProps: [
|
|
3179
3299
|
{
|
|
3180
3300
|
name: "name",
|
|
3181
3301
|
label: "Icon Name",
|
|
3182
3302
|
control: "text",
|
|
3183
|
-
defaultValue: "
|
|
3303
|
+
defaultValue: "add"
|
|
3184
3304
|
},
|
|
3185
3305
|
{
|
|
3186
3306
|
name: "size",
|
|
3187
3307
|
label: "Size",
|
|
3188
|
-
control: "
|
|
3308
|
+
control: "discrete-slider",
|
|
3309
|
+
options: [
|
|
3310
|
+
{ label: "20", value: 20 },
|
|
3311
|
+
{ label: "24", value: 24 },
|
|
3312
|
+
{ label: "40", value: 40 },
|
|
3313
|
+
{ label: "48", value: 48 }
|
|
3314
|
+
],
|
|
3189
3315
|
defaultValue: 24
|
|
3190
3316
|
},
|
|
3191
3317
|
{
|
|
3192
3318
|
name: "fill",
|
|
3193
3319
|
label: "Fill",
|
|
3194
|
-
control: "
|
|
3195
|
-
|
|
3196
|
-
{ label: "Outlined", value: 0 },
|
|
3197
|
-
{ label: "Filled", value: 1 }
|
|
3198
|
-
],
|
|
3199
|
-
defaultValue: 0
|
|
3320
|
+
control: "toggle",
|
|
3321
|
+
defaultValue: false
|
|
3200
3322
|
}
|
|
3201
3323
|
]
|
|
3202
3324
|
},
|
|
@@ -3400,6 +3522,232 @@ function formatProp(name, value) {
|
|
|
3400
3522
|
return `${name}={${JSON.stringify(value)}}`;
|
|
3401
3523
|
}
|
|
3402
3524
|
|
|
3525
|
+
// src/registry/icons.ts
|
|
3526
|
+
var ICON_CATALOG = [
|
|
3527
|
+
{
|
|
3528
|
+
id: "navigation",
|
|
3529
|
+
label: "Navigation",
|
|
3530
|
+
icons: [
|
|
3531
|
+
"home",
|
|
3532
|
+
"menu",
|
|
3533
|
+
"close",
|
|
3534
|
+
"arrow_back",
|
|
3535
|
+
"arrow_forward",
|
|
3536
|
+
"arrow_upward",
|
|
3537
|
+
"arrow_downward",
|
|
3538
|
+
"chevron_left",
|
|
3539
|
+
"chevron_right",
|
|
3540
|
+
"expand_more",
|
|
3541
|
+
"expand_less",
|
|
3542
|
+
"first_page",
|
|
3543
|
+
"last_page",
|
|
3544
|
+
"more_vert",
|
|
3545
|
+
"more_horiz",
|
|
3546
|
+
"unfold_more",
|
|
3547
|
+
"unfold_less",
|
|
3548
|
+
"subdirectory_arrow_right"
|
|
3549
|
+
]
|
|
3550
|
+
},
|
|
3551
|
+
{
|
|
3552
|
+
id: "actions",
|
|
3553
|
+
label: "Actions",
|
|
3554
|
+
icons: [
|
|
3555
|
+
"search",
|
|
3556
|
+
"settings",
|
|
3557
|
+
"done",
|
|
3558
|
+
"add",
|
|
3559
|
+
"remove",
|
|
3560
|
+
"delete",
|
|
3561
|
+
"edit",
|
|
3562
|
+
"save",
|
|
3563
|
+
"refresh",
|
|
3564
|
+
"undo",
|
|
3565
|
+
"redo",
|
|
3566
|
+
"download",
|
|
3567
|
+
"upload",
|
|
3568
|
+
"share",
|
|
3569
|
+
"print",
|
|
3570
|
+
"content_copy",
|
|
3571
|
+
"content_paste",
|
|
3572
|
+
"open_in_new",
|
|
3573
|
+
"launch",
|
|
3574
|
+
"drag_indicator",
|
|
3575
|
+
"tune",
|
|
3576
|
+
"sort",
|
|
3577
|
+
"filter_list"
|
|
3578
|
+
]
|
|
3579
|
+
},
|
|
3580
|
+
{
|
|
3581
|
+
id: "communication",
|
|
3582
|
+
label: "Communication",
|
|
3583
|
+
icons: [
|
|
3584
|
+
"mail",
|
|
3585
|
+
"chat",
|
|
3586
|
+
"call",
|
|
3587
|
+
"notifications",
|
|
3588
|
+
"forum",
|
|
3589
|
+
"send",
|
|
3590
|
+
"inbox",
|
|
3591
|
+
"drafts",
|
|
3592
|
+
"mark_email_read",
|
|
3593
|
+
"contact_mail",
|
|
3594
|
+
"alternate_email",
|
|
3595
|
+
"comment",
|
|
3596
|
+
"chat_bubble",
|
|
3597
|
+
"sms",
|
|
3598
|
+
"voicemail"
|
|
3599
|
+
]
|
|
3600
|
+
},
|
|
3601
|
+
{
|
|
3602
|
+
id: "content",
|
|
3603
|
+
label: "Content",
|
|
3604
|
+
icons: [
|
|
3605
|
+
"add_circle",
|
|
3606
|
+
"remove_circle",
|
|
3607
|
+
"check_circle",
|
|
3608
|
+
"cancel",
|
|
3609
|
+
"flag",
|
|
3610
|
+
"bookmark",
|
|
3611
|
+
"star",
|
|
3612
|
+
"favorite",
|
|
3613
|
+
"thumb_up",
|
|
3614
|
+
"thumb_down",
|
|
3615
|
+
"push_pin",
|
|
3616
|
+
"link",
|
|
3617
|
+
"link_off",
|
|
3618
|
+
"bolt",
|
|
3619
|
+
"label",
|
|
3620
|
+
"inventory_2",
|
|
3621
|
+
"visibility",
|
|
3622
|
+
"visibility_off"
|
|
3623
|
+
]
|
|
3624
|
+
},
|
|
3625
|
+
{
|
|
3626
|
+
id: "media",
|
|
3627
|
+
label: "Media",
|
|
3628
|
+
icons: [
|
|
3629
|
+
"play_arrow",
|
|
3630
|
+
"pause",
|
|
3631
|
+
"stop",
|
|
3632
|
+
"skip_next",
|
|
3633
|
+
"skip_previous",
|
|
3634
|
+
"fast_forward",
|
|
3635
|
+
"fast_rewind",
|
|
3636
|
+
"replay",
|
|
3637
|
+
"shuffle",
|
|
3638
|
+
"repeat",
|
|
3639
|
+
"volume_up",
|
|
3640
|
+
"volume_off",
|
|
3641
|
+
"music_note",
|
|
3642
|
+
"image",
|
|
3643
|
+
"photo_camera",
|
|
3644
|
+
"videocam",
|
|
3645
|
+
"mic"
|
|
3646
|
+
]
|
|
3647
|
+
},
|
|
3648
|
+
{
|
|
3649
|
+
id: "file",
|
|
3650
|
+
label: "File & Folder",
|
|
3651
|
+
icons: [
|
|
3652
|
+
"folder",
|
|
3653
|
+
"folder_open",
|
|
3654
|
+
"create_new_folder",
|
|
3655
|
+
"description",
|
|
3656
|
+
"file_copy",
|
|
3657
|
+
"attach_file",
|
|
3658
|
+
"cloud",
|
|
3659
|
+
"cloud_upload",
|
|
3660
|
+
"cloud_download",
|
|
3661
|
+
"cloud_off",
|
|
3662
|
+
"storage",
|
|
3663
|
+
"snippet_folder"
|
|
3664
|
+
]
|
|
3665
|
+
},
|
|
3666
|
+
{
|
|
3667
|
+
id: "social",
|
|
3668
|
+
label: "Social & People",
|
|
3669
|
+
icons: [
|
|
3670
|
+
"person",
|
|
3671
|
+
"group",
|
|
3672
|
+
"person_add",
|
|
3673
|
+
"person_remove",
|
|
3674
|
+
"people",
|
|
3675
|
+
"face",
|
|
3676
|
+
"sentiment_satisfied",
|
|
3677
|
+
"sentiment_dissatisfied",
|
|
3678
|
+
"public",
|
|
3679
|
+
"workspace_premium",
|
|
3680
|
+
"emoji_events",
|
|
3681
|
+
"military_tech"
|
|
3682
|
+
]
|
|
3683
|
+
},
|
|
3684
|
+
{
|
|
3685
|
+
id: "alerts",
|
|
3686
|
+
label: "Alerts & Status",
|
|
3687
|
+
icons: [
|
|
3688
|
+
"error",
|
|
3689
|
+
"warning",
|
|
3690
|
+
"info",
|
|
3691
|
+
"help",
|
|
3692
|
+
"check_circle",
|
|
3693
|
+
"report",
|
|
3694
|
+
"new_releases",
|
|
3695
|
+
"notification_important",
|
|
3696
|
+
"priority_high",
|
|
3697
|
+
"verified",
|
|
3698
|
+
"shield",
|
|
3699
|
+
"security",
|
|
3700
|
+
"lock",
|
|
3701
|
+
"lock_open"
|
|
3702
|
+
]
|
|
3703
|
+
},
|
|
3704
|
+
{
|
|
3705
|
+
id: "device",
|
|
3706
|
+
label: "Device & Hardware",
|
|
3707
|
+
icons: [
|
|
3708
|
+
"phone_android",
|
|
3709
|
+
"computer",
|
|
3710
|
+
"tablet_mac",
|
|
3711
|
+
"watch",
|
|
3712
|
+
"keyboard",
|
|
3713
|
+
"mouse",
|
|
3714
|
+
"headphones",
|
|
3715
|
+
"speaker",
|
|
3716
|
+
"monitor",
|
|
3717
|
+
"devices",
|
|
3718
|
+
"memory",
|
|
3719
|
+
"battery_full",
|
|
3720
|
+
"wifi",
|
|
3721
|
+
"bluetooth",
|
|
3722
|
+
"usb",
|
|
3723
|
+
"dark_mode",
|
|
3724
|
+
"light_mode"
|
|
3725
|
+
]
|
|
3726
|
+
},
|
|
3727
|
+
{
|
|
3728
|
+
id: "editor",
|
|
3729
|
+
label: "Editor & Formatting",
|
|
3730
|
+
icons: [
|
|
3731
|
+
"format_bold",
|
|
3732
|
+
"format_italic",
|
|
3733
|
+
"format_underlined",
|
|
3734
|
+
"format_list_bulleted",
|
|
3735
|
+
"format_list_numbered",
|
|
3736
|
+
"format_quote",
|
|
3737
|
+
"format_align_left",
|
|
3738
|
+
"format_align_center",
|
|
3739
|
+
"format_align_right",
|
|
3740
|
+
"title",
|
|
3741
|
+
"text_fields",
|
|
3742
|
+
"code",
|
|
3743
|
+
"palette",
|
|
3744
|
+
"color_lens",
|
|
3745
|
+
"brush",
|
|
3746
|
+
"auto_fix_high"
|
|
3747
|
+
]
|
|
3748
|
+
}
|
|
3749
|
+
];
|
|
3750
|
+
|
|
3403
3751
|
// src/fonts/googleFonts.ts
|
|
3404
3752
|
var GOOGLE_FONTS = [
|
|
3405
3753
|
// Sans-serif
|
|
@@ -3466,6 +3814,6 @@ var SYSTEM_FONTS = [
|
|
|
3466
3814
|
}
|
|
3467
3815
|
];
|
|
3468
3816
|
|
|
3469
|
-
export { AppShell, Button, CATEGORIES, COMPONENTS, Card, ColorScaleSlider, DEFAULT_THEME_CONFIG, Frame, GOOGLE_FONTS, HueSlider, Icon, Navbar, NewtoneProvider, Popover, SYSTEM_FONTS, Select, Sidebar, Slider, Text2 as Text, TextInput, Toggle, Wrapper, buildGoogleFontsUrl, computeTokens, generateComponentCode, getCategory, getComponent, getComponentsByCategory, isOptionGroup, useFocusVisible, useFrameContext, useNewtoneTheme, usePopover, useTokens };
|
|
3817
|
+
export { ACCENT_DEFAULTS, AppShell, Button, CATEGORIES, COMPONENTS, Card, ColorScaleSlider, DEFAULT_THEME_CONFIG, ERROR_DEFAULTS, Frame, GOOGLE_FONTS, HueSlider, ICON_CATALOG, Icon, NEUTRAL_DEFAULTS, Navbar, NewtoneProvider, Popover, SUCCESS_DEFAULTS, SYSTEM_FONTS, Select, Sidebar, Slider, Text2 as Text, TextInput, Toggle, WARNING_DEFAULTS, Wrapper, buildGoogleFontsUrl, computeTokens, generateComponentCode, getCategory, getComponent, getComponentsByCategory, isOptionGroup, useFocusVisible, useFrameContext, useNewtoneTheme, usePopover, useTokens };
|
|
3470
3818
|
//# sourceMappingURL=index.js.map
|
|
3471
3819
|
//# sourceMappingURL=index.js.map
|