@newtonedev/components 0.1.12 → 0.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_COMPONENT_TEMPLATE/ComponentName.styles.d.ts +4 -3
- package/dist/_COMPONENT_TEMPLATE/ComponentName.styles.d.ts.map +1 -1
- package/dist/_COMPONENT_TEMPLATE/ComponentName.types.d.ts +1 -1
- package/dist/_COMPONENT_TEMPLATE/ComponentName.types.d.ts.map +1 -1
- package/dist/composites/actions/Button/Button.d.ts +11 -1
- package/dist/composites/actions/Button/Button.d.ts.map +1 -1
- package/dist/composites/actions/Button/Button.styles.d.ts +1 -1
- package/dist/composites/actions/Button/Button.styles.d.ts.map +1 -1
- package/dist/composites/actions/Button/Button.types.d.ts +11 -1
- package/dist/composites/actions/Button/Button.types.d.ts.map +1 -1
- package/dist/composites/branding/LogoMonogram/LogoMonogram.d.ts +10 -0
- package/dist/composites/branding/LogoMonogram/LogoMonogram.d.ts.map +1 -0
- package/dist/composites/branding/LogoMonogram/LogoMonogram.types.d.ts +35 -0
- package/dist/composites/branding/LogoMonogram/LogoMonogram.types.d.ts.map +1 -0
- package/dist/composites/branding/LogoMonogram/index.d.ts +3 -0
- package/dist/composites/branding/LogoMonogram/index.d.ts.map +1 -0
- package/dist/composites/branding/LogoWordmark/LogoWordmark.d.ts +9 -0
- package/dist/composites/branding/LogoWordmark/LogoWordmark.d.ts.map +1 -0
- package/dist/composites/branding/LogoWordmark/LogoWordmark.types.d.ts +26 -0
- package/dist/composites/branding/LogoWordmark/LogoWordmark.types.d.ts.map +1 -0
- package/dist/composites/branding/LogoWordmark/index.d.ts +3 -0
- package/dist/composites/branding/LogoWordmark/index.d.ts.map +1 -0
- package/dist/composites/display/Chip/Chip.d.ts +25 -0
- package/dist/composites/display/Chip/Chip.d.ts.map +1 -0
- package/dist/composites/display/Chip/Chip.styles.d.ts +29 -0
- package/dist/composites/display/Chip/Chip.styles.d.ts.map +1 -0
- package/dist/composites/display/Chip/Chip.types.d.ts +63 -0
- package/dist/composites/display/Chip/Chip.types.d.ts.map +1 -0
- package/dist/composites/display/Chip/index.d.ts +3 -0
- package/dist/composites/display/Chip/index.d.ts.map +1 -0
- package/dist/composites/form-controls/Select/Select.d.ts.map +1 -1
- package/dist/composites/form-controls/Select/Select.styles.d.ts +2 -2
- package/dist/composites/form-controls/Select/Select.styles.d.ts.map +1 -1
- package/dist/composites/form-controls/Select/SelectOption.d.ts.map +1 -1
- package/dist/composites/form-controls/TextInput/TextInput.d.ts.map +1 -1
- package/dist/composites/form-controls/TextInput/TextInput.styles.d.ts +2 -2
- package/dist/composites/form-controls/TextInput/TextInput.styles.d.ts.map +1 -1
- package/dist/composites/form-controls/Toggle/Toggle.d.ts.map +1 -1
- package/dist/composites/form-controls/Toggle/Toggle.styles.d.ts +2 -2
- package/dist/composites/form-controls/Toggle/Toggle.styles.d.ts.map +1 -1
- package/dist/composites/layout/AppShell/AppShell.d.ts.map +1 -1
- package/dist/composites/layout/AppShell/AppShell.styles.d.ts +2 -2
- package/dist/composites/layout/AppShell/AppShell.styles.d.ts.map +1 -1
- package/dist/composites/layout/Card/Card.d.ts.map +1 -1
- package/dist/composites/layout/Card/Card.styles.d.ts +2 -2
- package/dist/composites/layout/Card/Card.styles.d.ts.map +1 -1
- package/dist/composites/layout/Card/Card.types.d.ts +1 -1
- package/dist/composites/layout/Card/Card.types.d.ts.map +1 -1
- package/dist/composites/layout/ContentCard/ContentCard.d.ts +33 -0
- package/dist/composites/layout/ContentCard/ContentCard.d.ts.map +1 -0
- package/dist/composites/layout/ContentCard/ContentCard.styles.d.ts +10 -0
- package/dist/composites/layout/ContentCard/ContentCard.styles.d.ts.map +1 -0
- package/dist/composites/layout/ContentCard/ContentCard.types.d.ts +52 -0
- package/dist/composites/layout/ContentCard/ContentCard.types.d.ts.map +1 -0
- package/dist/composites/layout/ContentCard/index.d.ts +3 -0
- package/dist/composites/layout/ContentCard/index.d.ts.map +1 -0
- package/dist/composites/layout/Divider/Divider.d.ts +25 -0
- package/dist/composites/layout/Divider/Divider.d.ts.map +1 -0
- package/dist/composites/layout/Divider/Divider.styles.d.ts +8 -0
- package/dist/composites/layout/Divider/Divider.styles.d.ts.map +1 -0
- package/dist/composites/layout/Divider/Divider.types.d.ts +25 -0
- package/dist/composites/layout/Divider/Divider.types.d.ts.map +1 -0
- package/dist/composites/layout/Divider/index.d.ts +3 -0
- package/dist/composites/layout/Divider/index.d.ts.map +1 -0
- package/dist/composites/layout/Navbar/Navbar.d.ts.map +1 -1
- package/dist/composites/layout/Navbar/Navbar.styles.d.ts +4 -2
- package/dist/composites/layout/Navbar/Navbar.styles.d.ts.map +1 -1
- package/dist/composites/layout/Sidebar/Sidebar.d.ts.map +1 -1
- package/dist/composites/layout/Sidebar/Sidebar.styles.d.ts +4 -2
- package/dist/composites/layout/Sidebar/Sidebar.styles.d.ts.map +1 -1
- package/dist/composites/overlays/Popover/Popover.d.ts.map +1 -1
- package/dist/composites/overlays/Popover/Popover.styles.d.ts +2 -2
- package/dist/composites/overlays/Popover/Popover.styles.d.ts.map +1 -1
- package/dist/composites/range-inputs/ColorScaleSlider/ColorScaleSlider.d.ts +1 -1
- package/dist/composites/range-inputs/ColorScaleSlider/ColorScaleSlider.d.ts.map +1 -1
- package/dist/composites/range-inputs/ColorScaleSlider/ColorScaleSlider.styles.d.ts +1 -1
- package/dist/composites/range-inputs/ColorScaleSlider/ColorScaleSlider.styles.d.ts.map +1 -1
- package/dist/composites/range-inputs/ColorScaleSlider/ColorScaleSlider.types.d.ts +2 -0
- package/dist/composites/range-inputs/ColorScaleSlider/ColorScaleSlider.types.d.ts.map +1 -1
- package/dist/composites/range-inputs/HueSlider/HueSlider.d.ts +3 -4
- package/dist/composites/range-inputs/HueSlider/HueSlider.d.ts.map +1 -1
- package/dist/composites/range-inputs/HueSlider/HueSlider.styles.d.ts +3 -3
- package/dist/composites/range-inputs/HueSlider/HueSlider.styles.d.ts.map +1 -1
- package/dist/composites/range-inputs/Slider/Slider.styles.d.ts +1 -1
- package/dist/composites/range-inputs/Slider/Slider.styles.d.ts.map +1 -1
- package/dist/index.cjs +1609 -1693
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +22 -24
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1454 -1621
- package/dist/index.js.map +1 -1
- package/dist/primitives/Frame/Frame.d.ts +1 -35
- package/dist/primitives/Frame/Frame.d.ts.map +1 -1
- package/dist/primitives/Frame/Frame.styles.d.ts +13 -3
- package/dist/primitives/Frame/Frame.styles.d.ts.map +1 -1
- package/dist/primitives/Frame/Frame.types.d.ts +99 -1
- package/dist/primitives/Frame/Frame.types.d.ts.map +1 -1
- package/dist/primitives/Frame/Frame.utils.d.ts +1 -1
- package/dist/primitives/Frame/Frame.utils.d.ts.map +1 -1
- package/dist/primitives/Frame/index.d.ts +1 -1
- package/dist/primitives/Frame/index.d.ts.map +1 -1
- package/dist/primitives/Icon/Icon.d.ts.map +1 -1
- package/dist/primitives/Icon/Icon.types.d.ts +2 -2
- package/dist/primitives/Icon/Icon.types.d.ts.map +1 -1
- package/dist/primitives/Text/Text.d.ts +6 -4
- package/dist/primitives/Text/Text.d.ts.map +1 -1
- package/dist/primitives/Text/Text.spans.d.ts.map +1 -1
- package/dist/primitives/Text/Text.types.d.ts +4 -7
- 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.d.ts.map +1 -1
- package/dist/primitives/Wrapper/Wrapper.styles.d.ts +10 -2
- package/dist/primitives/Wrapper/Wrapper.styles.d.ts.map +1 -1
- package/dist/primitives/Wrapper/Wrapper.types.d.ts +31 -1
- package/dist/primitives/Wrapper/Wrapper.types.d.ts.map +1 -1
- package/package.json +3 -2
- package/src/_COMPONENT_TEMPLATE/ComponentName.styles.ts +4 -4
- package/src/_COMPONENT_TEMPLATE/ComponentName.tsx +2 -2
- package/src/_COMPONENT_TEMPLATE/ComponentName.types.ts +1 -1
- package/src/composites/actions/Button/Button.styles.ts +72 -55
- package/src/composites/actions/Button/Button.tsx +35 -14
- package/src/composites/actions/Button/Button.types.ts +13 -1
- package/src/composites/branding/LogoMonogram/LogoMonogram.tsx +29 -0
- package/src/composites/branding/LogoMonogram/LogoMonogram.types.ts +35 -0
- package/src/composites/branding/LogoMonogram/index.ts +2 -0
- package/src/composites/branding/LogoWordmark/LogoWordmark.tsx +29 -0
- package/src/composites/branding/LogoWordmark/LogoWordmark.types.ts +25 -0
- package/src/composites/branding/LogoWordmark/index.ts +2 -0
- package/src/composites/display/Chip/Chip.styles.ts +189 -0
- package/src/composites/display/Chip/Chip.tsx +97 -0
- package/src/composites/display/Chip/Chip.types.ts +74 -0
- package/src/composites/display/Chip/index.ts +2 -0
- package/src/composites/form-controls/Select/Select.styles.ts +10 -10
- package/src/composites/form-controls/Select/Select.tsx +9 -7
- package/src/composites/form-controls/Select/SelectOption.tsx +10 -8
- package/src/composites/form-controls/TextInput/TextInput.styles.ts +12 -9
- package/src/composites/form-controls/TextInput/TextInput.tsx +7 -5
- package/src/composites/form-controls/Toggle/Toggle.styles.ts +10 -7
- package/src/composites/form-controls/Toggle/Toggle.tsx +4 -3
- package/src/composites/layout/AppShell/AppShell.styles.ts +8 -4
- package/src/composites/layout/AppShell/AppShell.tsx +6 -2
- package/src/composites/layout/Card/Card.styles.ts +10 -5
- package/src/composites/layout/Card/Card.tsx +4 -3
- package/src/composites/layout/Card/Card.types.ts +1 -1
- package/src/composites/layout/ContentCard/ContentCard.styles.ts +44 -0
- package/src/composites/layout/ContentCard/ContentCard.tsx +71 -0
- package/src/composites/layout/ContentCard/ContentCard.types.ts +60 -0
- package/src/composites/layout/ContentCard/index.ts +2 -0
- package/src/composites/layout/Divider/Divider.styles.ts +30 -0
- package/src/composites/layout/Divider/Divider.tsx +46 -0
- package/src/composites/layout/Divider/Divider.types.ts +28 -0
- package/src/composites/layout/Divider/index.ts +2 -0
- package/src/composites/layout/Navbar/Navbar.styles.ts +7 -5
- package/src/composites/layout/Navbar/Navbar.tsx +4 -3
- package/src/composites/layout/Sidebar/Sidebar.styles.ts +7 -5
- package/src/composites/layout/Sidebar/Sidebar.tsx +4 -3
- package/src/composites/overlays/Popover/Popover.styles.ts +7 -5
- package/src/composites/overlays/Popover/Popover.tsx +4 -3
- package/src/composites/range-inputs/ColorScaleSlider/ColorScaleSlider.styles.ts +4 -5
- package/src/composites/range-inputs/ColorScaleSlider/ColorScaleSlider.tsx +6 -2
- package/src/composites/range-inputs/ColorScaleSlider/ColorScaleSlider.types.ts +2 -0
- package/src/composites/range-inputs/HueSlider/HueSlider.styles.ts +13 -20
- package/src/composites/range-inputs/HueSlider/HueSlider.tsx +7 -8
- package/src/composites/range-inputs/Slider/Slider.styles.ts +8 -9
- package/src/composites/range-inputs/Slider/Slider.tsx +1 -1
- package/src/index.ts +108 -61
- package/src/primitives/Frame/Frame.styles.ts +55 -11
- package/src/primitives/Frame/Frame.tsx +140 -142
- package/src/primitives/Frame/Frame.types.ts +119 -1
- package/src/primitives/Frame/Frame.utils.ts +1 -1
- package/src/primitives/Frame/index.ts +4 -0
- package/src/primitives/Icon/Icon.tsx +9 -7
- package/src/primitives/Icon/Icon.types.ts +2 -2
- package/src/primitives/Text/Text.spans.ts +9 -5
- package/src/primitives/Text/Text.tsx +33 -22
- package/src/primitives/Text/Text.types.ts +4 -7
- package/src/primitives/Wrapper/Wrapper.styles.ts +33 -1
- package/src/primitives/Wrapper/Wrapper.tsx +23 -4
- package/src/primitives/Wrapper/Wrapper.types.ts +45 -0
- package/dist/fonts/GoogleFontLoader.d.ts +0 -20
- package/dist/fonts/GoogleFontLoader.d.ts.map +0 -1
- package/dist/fonts/IconFontLoader.d.ts +0 -13
- package/dist/fonts/IconFontLoader.d.ts.map +0 -1
- package/dist/fonts/SelfHostedFontLoader.d.ts +0 -14
- package/dist/fonts/SelfHostedFontLoader.d.ts.map +0 -1
- package/dist/fonts/buildGoogleFontsUrl.d.ts +0 -2
- package/dist/fonts/buildGoogleFontsUrl.d.ts.map +0 -1
- package/dist/fonts/measureFont.d.ts +0 -19
- package/dist/fonts/measureFont.d.ts.map +0 -1
- package/dist/fonts/reportQueue.d.ts +0 -7
- package/dist/fonts/reportQueue.d.ts.map +0 -1
- package/dist/fonts/useLocalCalibration.d.ts +0 -19
- package/dist/fonts/useLocalCalibration.d.ts.map +0 -1
- package/dist/fonts/useTypographyCalibrations.d.ts +0 -11
- package/dist/fonts/useTypographyCalibrations.d.ts.map +0 -1
- package/dist/theme/FrameContext.d.ts +0 -26
- package/dist/theme/FrameContext.d.ts.map +0 -1
- package/dist/theme/NewtoneProvider.d.ts +0 -40
- package/dist/theme/NewtoneProvider.d.ts.map +0 -1
- package/dist/theme/defaults.d.ts +0 -8
- package/dist/theme/defaults.d.ts.map +0 -1
- package/dist/theme/types.d.ts +0 -156
- package/dist/theme/types.d.ts.map +0 -1
- package/dist/theme/useBreakpoint.d.ts +0 -9
- package/dist/theme/useBreakpoint.d.ts.map +0 -1
- package/dist/tokens/computeTokens.d.ts +0 -151
- package/dist/tokens/computeTokens.d.ts.map +0 -1
- package/dist/tokens/types.d.ts +0 -162
- package/dist/tokens/types.d.ts.map +0 -1
- package/dist/tokens/useTokens.d.ts +0 -26
- package/dist/tokens/useTokens.d.ts.map +0 -1
- package/src/fonts/GoogleFontLoader.tsx +0 -80
- package/src/fonts/IconFontLoader.tsx +0 -51
- package/src/fonts/SelfHostedFontLoader.tsx +0 -44
- package/src/fonts/buildGoogleFontsUrl.ts +0 -2
- package/src/fonts/measureFont.ts +0 -55
- package/src/fonts/reportQueue.ts +0 -54
- package/src/fonts/useLocalCalibration.ts +0 -97
- package/src/fonts/useTypographyCalibrations.ts +0 -15
- package/src/theme/FrameContext.tsx +0 -31
- package/src/theme/NewtoneProvider.tsx +0 -84
- package/src/theme/defaults.ts +0 -71
- package/src/theme/types.ts +0 -191
- package/src/theme/useBreakpoint.ts +0 -14
- package/src/tokens/computeTokens.ts +0 -516
- package/src/tokens/types.ts +0 -146
- package/src/tokens/useTokens.ts +0 -62
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { View, Text, TextInput, PanResponder } from 'react-native';
|
|
3
3
|
import type { SliderProps } from './Slider.types';
|
|
4
|
-
import { useTokens } from '
|
|
4
|
+
import { useTokens } from 'newtone-api';
|
|
5
5
|
import { getSliderStyles, THUMB_SIZE } from './Slider.styles';
|
|
6
6
|
|
|
7
7
|
export function Slider({
|
package/src/index.ts
CHANGED
|
@@ -1,46 +1,86 @@
|
|
|
1
|
-
//
|
|
2
|
-
export {
|
|
1
|
+
// Re-export theme engine (backward compatibility — consumers keep importing from @newtonedev/components)
|
|
2
|
+
export {
|
|
3
|
+
NewtoneProvider,
|
|
4
|
+
useNewtoneTheme,
|
|
5
|
+
useScheme,
|
|
6
|
+
FrameContext,
|
|
7
|
+
useFrameContext,
|
|
8
|
+
useBreakpoint,
|
|
9
|
+
DEFAULT_THEME_CONFIG,
|
|
10
|
+
DEFAULT_FONT_SIZES,
|
|
11
|
+
DEFAULT_LINE_HEIGHTS,
|
|
12
|
+
DEFAULT_ROLE_SCALES,
|
|
13
|
+
useTokens,
|
|
14
|
+
computeTokens,
|
|
15
|
+
computeSwatches,
|
|
16
|
+
computeColors,
|
|
17
|
+
resolveTheme,
|
|
18
|
+
PRIMARY_DEFAULTS,
|
|
19
|
+
SECONDARY_DEFAULTS,
|
|
20
|
+
TERTIARY_DEFAULTS,
|
|
21
|
+
SUCCESS_DEFAULTS,
|
|
22
|
+
WARNING_DEFAULTS,
|
|
23
|
+
ERROR_DEFAULTS,
|
|
24
|
+
DEFAULT_THEME_MAPPINGS,
|
|
25
|
+
buildGoogleFontsUrl,
|
|
26
|
+
measureAvgCharWidth,
|
|
27
|
+
useLocalCalibration,
|
|
28
|
+
useTypographyCalibrations,
|
|
29
|
+
enqueueObservation,
|
|
30
|
+
} from 'newtone-api';
|
|
3
31
|
export type {
|
|
4
32
|
ColorMode,
|
|
33
|
+
ColorGamut,
|
|
5
34
|
ElevationLevel,
|
|
6
35
|
FrameElevation,
|
|
7
36
|
ColorSystemConfig,
|
|
37
|
+
ColorSystemPaletteConfig,
|
|
8
38
|
NewtoneThemeConfig,
|
|
9
39
|
NewtoneThemeContext,
|
|
10
40
|
FontConfig,
|
|
11
41
|
FontWeights,
|
|
12
42
|
FontSlot,
|
|
13
|
-
|
|
43
|
+
TokenColor,
|
|
44
|
+
TokenName,
|
|
45
|
+
ContrastLevel,
|
|
46
|
+
PaletteId,
|
|
47
|
+
ThemeName,
|
|
48
|
+
AppearanceName,
|
|
49
|
+
ColorRef,
|
|
50
|
+
AppearanceMapping,
|
|
51
|
+
ThemeMapping,
|
|
52
|
+
ThemeMappings,
|
|
14
53
|
FontSizeScale,
|
|
15
54
|
LineHeightScale,
|
|
16
55
|
RoleSizeStep,
|
|
17
56
|
RoleScale,
|
|
18
57
|
RoleScales,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
58
|
+
BreakpointKey,
|
|
59
|
+
Breakpoints,
|
|
60
|
+
BreakpointRoleScales,
|
|
61
|
+
FontRuntimeMetrics,
|
|
62
|
+
FrameContextValue,
|
|
63
|
+
UseTokensResult,
|
|
64
|
+
PaletteDefaults,
|
|
65
|
+
ContrastLevelDefaults,
|
|
66
|
+
SwatchDefaults,
|
|
67
|
+
ResolvedTokens,
|
|
68
|
+
ResolvedSwatches,
|
|
69
|
+
PaletteColors,
|
|
70
|
+
ContrastLevelColors,
|
|
71
|
+
ElevationColors,
|
|
72
|
+
ElevationName,
|
|
73
|
+
AppearanceTokens,
|
|
74
|
+
ThemeTokens,
|
|
75
|
+
ResolvedColor,
|
|
76
|
+
DynamicRange,
|
|
77
|
+
ColorResult,
|
|
78
|
+
Srgb,
|
|
79
|
+
Oklch,
|
|
80
|
+
HexColor,
|
|
81
|
+
} from 'newtone-api';
|
|
43
82
|
|
|
83
|
+
// Primitive Components
|
|
44
84
|
export { useFocusVisible } from './primitives/useFocusVisible';
|
|
45
85
|
export type { FocusVisibleResult } from './primitives/useFocusVisible';
|
|
46
86
|
|
|
@@ -66,6 +106,40 @@ export type {
|
|
|
66
106
|
} from './primitives/Frame/Frame.types';
|
|
67
107
|
export type { ResolvedCorners } from './primitives/Frame/Frame.utils';
|
|
68
108
|
|
|
109
|
+
export { Icon } from './primitives/Icon/Icon';
|
|
110
|
+
export type { IconProps } from './primitives/Icon/Icon.types';
|
|
111
|
+
|
|
112
|
+
export { Wrapper } from './primitives/Wrapper/Wrapper';
|
|
113
|
+
export type { WrapperProps } from './primitives/Wrapper/Wrapper.types';
|
|
114
|
+
|
|
115
|
+
export { Text } from './primitives/Text';
|
|
116
|
+
export type {
|
|
117
|
+
TextProps,
|
|
118
|
+
TextSize,
|
|
119
|
+
TextWeight,
|
|
120
|
+
TextColor,
|
|
121
|
+
TextScope,
|
|
122
|
+
TextRole,
|
|
123
|
+
TextAlign,
|
|
124
|
+
TextSpanProps,
|
|
125
|
+
} from './primitives/Text';
|
|
126
|
+
|
|
127
|
+
// Composite Components
|
|
128
|
+
export { Button } from './composites/actions/Button/Button';
|
|
129
|
+
export type { ButtonProps, ButtonVariant, ButtonSemantic, ButtonSize, ButtonIconPosition } from './composites/actions/Button/Button.types';
|
|
130
|
+
|
|
131
|
+
export { Card } from './composites/layout/Card/Card';
|
|
132
|
+
export type { CardProps } from './composites/layout/Card/Card.types';
|
|
133
|
+
|
|
134
|
+
export { Chip } from './composites/display/Chip/Chip';
|
|
135
|
+
export type { ChipProps, ChipVariant, ChipSemantic, ChipSize } from './composites/display/Chip/Chip.types';
|
|
136
|
+
|
|
137
|
+
export { Divider } from './composites/layout/Divider/Divider';
|
|
138
|
+
export type { DividerProps, DividerOrientation } from './composites/layout/Divider/Divider.types';
|
|
139
|
+
|
|
140
|
+
export { ContentCard } from './composites/layout/ContentCard/ContentCard';
|
|
141
|
+
export type { ContentCardProps, ContentCardVariant } from './composites/layout/ContentCard/ContentCard.types';
|
|
142
|
+
|
|
69
143
|
export { TextInput } from './composites/form-controls/TextInput/TextInput';
|
|
70
144
|
export type { TextInputProps } from './composites/form-controls/TextInput/TextInput.types';
|
|
71
145
|
|
|
@@ -89,24 +163,6 @@ export type { HueSliderProps } from './composites/range-inputs/HueSlider/HueSlid
|
|
|
89
163
|
export { ColorScaleSlider } from './composites/range-inputs/ColorScaleSlider/ColorScaleSlider';
|
|
90
164
|
export type { ColorScaleSliderProps } from './composites/range-inputs/ColorScaleSlider/ColorScaleSlider.types';
|
|
91
165
|
|
|
92
|
-
export { Icon } from './primitives/Icon/Icon';
|
|
93
|
-
export type { IconProps } from './primitives/Icon/Icon.types';
|
|
94
|
-
|
|
95
|
-
export { Wrapper } from './primitives/Wrapper/Wrapper';
|
|
96
|
-
export type { WrapperProps } from './primitives/Wrapper/Wrapper.types';
|
|
97
|
-
|
|
98
|
-
export { Text } from './primitives/Text';
|
|
99
|
-
export type {
|
|
100
|
-
TextProps,
|
|
101
|
-
TextSize,
|
|
102
|
-
TextWeight,
|
|
103
|
-
TextColor,
|
|
104
|
-
TextScope,
|
|
105
|
-
TextRole,
|
|
106
|
-
TextAlign,
|
|
107
|
-
TextSpanProps,
|
|
108
|
-
} from './primitives/Text';
|
|
109
|
-
|
|
110
166
|
export { AppShell } from './composites/layout/AppShell/AppShell';
|
|
111
167
|
export type { AppShellProps } from './composites/layout/AppShell/AppShell.types';
|
|
112
168
|
|
|
@@ -116,6 +172,13 @@ export type { SidebarProps } from './composites/layout/Sidebar/Sidebar.types';
|
|
|
116
172
|
export { Navbar } from './composites/layout/Navbar/Navbar';
|
|
117
173
|
export type { NavbarProps } from './composites/layout/Navbar/Navbar.types';
|
|
118
174
|
|
|
175
|
+
// Branding
|
|
176
|
+
export { LogoMonogram } from './composites/branding/LogoMonogram/LogoMonogram';
|
|
177
|
+
export type { LogoMonogramProps } from './composites/branding/LogoMonogram/LogoMonogram.types';
|
|
178
|
+
|
|
179
|
+
export { LogoWordmark } from './composites/branding/LogoWordmark/LogoWordmark';
|
|
180
|
+
export type { LogoWordmarkProps } from './composites/branding/LogoWordmark/LogoWordmark.types';
|
|
181
|
+
|
|
119
182
|
// Component registry + code generation
|
|
120
183
|
export type {
|
|
121
184
|
CategoryMeta,
|
|
@@ -134,19 +197,3 @@ export {
|
|
|
134
197
|
generateComponentCode,
|
|
135
198
|
ICON_CATALOG,
|
|
136
199
|
} from './registry';
|
|
137
|
-
|
|
138
|
-
// Fonts
|
|
139
|
-
export { buildGoogleFontsUrl } from './fonts/buildGoogleFontsUrl';
|
|
140
|
-
export { measureAvgCharWidth } from './fonts/measureFont';
|
|
141
|
-
export { useLocalCalibration } from './fonts/useLocalCalibration';
|
|
142
|
-
export { useTypographyCalibrations } from './fonts/useTypographyCalibrations';
|
|
143
|
-
|
|
144
|
-
// Re-export core engine types for convenience
|
|
145
|
-
export type {
|
|
146
|
-
DynamicRange,
|
|
147
|
-
PaletteConfig,
|
|
148
|
-
ColorResult,
|
|
149
|
-
Srgb,
|
|
150
|
-
Oklch,
|
|
151
|
-
HexColor,
|
|
152
|
-
} from 'newtone';
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { ViewStyle } from 'react-native';
|
|
2
2
|
import { StyleSheet } from 'react-native';
|
|
3
|
-
import {
|
|
4
|
-
import type {
|
|
5
|
-
import type { FrameElevation } from '../../theme/types';
|
|
3
|
+
import type { ResolvedTokens, AppearanceTokens } from 'newtone-api';
|
|
4
|
+
import type { FrameElevation, ThemeName, AppearanceName } from 'newtone-api';
|
|
6
5
|
import type {
|
|
7
6
|
PaddingProp,
|
|
8
7
|
GapProp,
|
|
@@ -12,6 +11,9 @@ import type {
|
|
|
12
11
|
Justification,
|
|
13
12
|
RadiusProp,
|
|
14
13
|
LayoutMode,
|
|
14
|
+
PositionType,
|
|
15
|
+
OffsetValue,
|
|
16
|
+
OverflowMode,
|
|
15
17
|
} from './Frame.types';
|
|
16
18
|
import {
|
|
17
19
|
resolvePadding,
|
|
@@ -30,6 +32,10 @@ export interface FrameStyleInput {
|
|
|
30
32
|
readonly tokens: ResolvedTokens;
|
|
31
33
|
readonly frameElevation: FrameElevation;
|
|
32
34
|
|
|
35
|
+
// Theme / Appearance
|
|
36
|
+
readonly theme?: ThemeName;
|
|
37
|
+
readonly appearance?: AppearanceName;
|
|
38
|
+
|
|
33
39
|
// Layout
|
|
34
40
|
readonly layout?: LayoutMode;
|
|
35
41
|
readonly direction?: Direction;
|
|
@@ -54,6 +60,16 @@ export interface FrameStyleInput {
|
|
|
54
60
|
readonly minHeight?: number;
|
|
55
61
|
readonly maxHeight?: number;
|
|
56
62
|
|
|
63
|
+
// Positioning
|
|
64
|
+
readonly position?: PositionType;
|
|
65
|
+
readonly top?: OffsetValue;
|
|
66
|
+
readonly right?: OffsetValue;
|
|
67
|
+
readonly bottom?: OffsetValue;
|
|
68
|
+
readonly left?: OffsetValue;
|
|
69
|
+
readonly zIndex?: number;
|
|
70
|
+
readonly overflow?: OverflowMode;
|
|
71
|
+
readonly opacity?: number;
|
|
72
|
+
|
|
57
73
|
// Appearance
|
|
58
74
|
readonly radius?: RadiusProp;
|
|
59
75
|
readonly bordered?: boolean;
|
|
@@ -88,6 +104,8 @@ export function getFrameStyles(input: FrameStyleInput): FrameStyles {
|
|
|
88
104
|
const {
|
|
89
105
|
tokens,
|
|
90
106
|
frameElevation,
|
|
107
|
+
theme = 'primary',
|
|
108
|
+
appearance = 'main',
|
|
91
109
|
layout = 'flex',
|
|
92
110
|
direction = 'vertical',
|
|
93
111
|
wrap = false,
|
|
@@ -104,6 +122,14 @@ export function getFrameStyles(input: FrameStyleInput): FrameStyles {
|
|
|
104
122
|
maxWidth,
|
|
105
123
|
minHeight,
|
|
106
124
|
maxHeight,
|
|
125
|
+
position,
|
|
126
|
+
top,
|
|
127
|
+
right,
|
|
128
|
+
bottom,
|
|
129
|
+
left,
|
|
130
|
+
zIndex,
|
|
131
|
+
overflow,
|
|
132
|
+
opacity,
|
|
107
133
|
radius,
|
|
108
134
|
bordered = false,
|
|
109
135
|
disabled = false,
|
|
@@ -115,9 +141,12 @@ export function getFrameStyles(input: FrameStyleInput): FrameStyles {
|
|
|
115
141
|
const container: Record<string, unknown> = {};
|
|
116
142
|
|
|
117
143
|
// ── Background & foreground ──
|
|
118
|
-
//
|
|
119
|
-
|
|
120
|
-
|
|
144
|
+
// Resolve the appearance tokens for the selected theme + appearance.
|
|
145
|
+
const appearanceTokens: AppearanceTokens = tokens.colors[theme][appearance];
|
|
146
|
+
|
|
147
|
+
// Set the surface color and default text color from the resolved appearance.
|
|
148
|
+
container.backgroundColor = appearanceTokens.background;
|
|
149
|
+
container.color = appearanceTokens.fontPrimary;
|
|
121
150
|
|
|
122
151
|
// ── Layout mode ──
|
|
123
152
|
if (layout === 'flex') {
|
|
@@ -171,6 +200,15 @@ export function getFrameStyles(input: FrameStyleInput): FrameStyles {
|
|
|
171
200
|
if (minHeight !== undefined) container.minHeight = minHeight;
|
|
172
201
|
if (maxHeight !== undefined) container.maxHeight = maxHeight;
|
|
173
202
|
|
|
203
|
+
// ── Positioning ──
|
|
204
|
+
// Set CSS position mode and offsets for absolute/fixed/sticky positioning.
|
|
205
|
+
if (position) container.position = position;
|
|
206
|
+
if (top !== undefined) container.top = top;
|
|
207
|
+
if (right !== undefined) container.right = right;
|
|
208
|
+
if (bottom !== undefined) container.bottom = bottom;
|
|
209
|
+
if (left !== undefined) container.left = left;
|
|
210
|
+
if (zIndex !== undefined) container.zIndex = zIndex;
|
|
211
|
+
|
|
174
212
|
// ── Radius ──
|
|
175
213
|
// Round the corners of the Frame (e.g. for cards, buttons, pills).
|
|
176
214
|
if (radius !== undefined) {
|
|
@@ -187,11 +225,15 @@ export function getFrameStyles(input: FrameStyleInput): FrameStyles {
|
|
|
187
225
|
}
|
|
188
226
|
}
|
|
189
227
|
|
|
228
|
+
// ── Overflow ──
|
|
229
|
+
// Explicit overflow prop overrides the auto-overflow from radius.
|
|
230
|
+
if (overflow) container.overflow = overflow;
|
|
231
|
+
|
|
190
232
|
// ── Border ──
|
|
191
233
|
// Add a thin border using the theme's border color.
|
|
192
234
|
if (bordered) {
|
|
193
235
|
container.borderWidth = 1;
|
|
194
|
-
container.borderColor =
|
|
236
|
+
container.borderColor = appearanceTokens.fontTertiary;
|
|
195
237
|
}
|
|
196
238
|
|
|
197
239
|
// ── Outer shadow (elevation 2) ──
|
|
@@ -206,9 +248,11 @@ export function getFrameStyles(input: FrameStyleInput): FrameStyles {
|
|
|
206
248
|
container.elevation = 4; // Android-specific shadow depth
|
|
207
249
|
}
|
|
208
250
|
|
|
209
|
-
// ──
|
|
210
|
-
//
|
|
211
|
-
if (
|
|
251
|
+
// ── Opacity ──
|
|
252
|
+
// Explicit opacity takes precedence over the disabled fade.
|
|
253
|
+
if (opacity !== undefined) {
|
|
254
|
+
container.opacity = opacity;
|
|
255
|
+
} else if (disabled) {
|
|
212
256
|
container.opacity = 0.5;
|
|
213
257
|
}
|
|
214
258
|
|
|
@@ -216,7 +260,7 @@ export function getFrameStyles(input: FrameStyleInput): FrameStyles {
|
|
|
216
260
|
// When the user is pressing an interactive Frame, shift the background
|
|
217
261
|
// to a darker "sunken" shade to give visual feedback.
|
|
218
262
|
const pressed = StyleSheet.create({
|
|
219
|
-
s: { backgroundColor:
|
|
263
|
+
s: { backgroundColor: appearanceTokens.fontSecondary },
|
|
220
264
|
}).s;
|
|
221
265
|
|
|
222
266
|
// ── Grid web style (web-only) ──
|