@newtonedev/components 0.1.11 → 0.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_COMPONENT_TEMPLATE/ComponentName.styles.d.ts +3 -2
- package/dist/_COMPONENT_TEMPLATE/ComponentName.styles.d.ts.map +1 -1
- package/dist/_COMPONENT_TEMPLATE/ComponentName.types.d.ts +1 -1
- package/dist/_COMPONENT_TEMPLATE/ComponentName.types.d.ts.map +1 -1
- package/dist/composites/actions/Button/Button.styles.d.ts +1 -1
- package/dist/composites/actions/Button/Button.styles.d.ts.map +1 -1
- package/dist/composites/form-controls/Select/Select.d.ts.map +1 -1
- package/dist/composites/form-controls/Select/Select.styles.d.ts +2 -2
- package/dist/composites/form-controls/Select/Select.styles.d.ts.map +1 -1
- package/dist/composites/form-controls/Select/SelectOption.d.ts.map +1 -1
- package/dist/composites/form-controls/TextInput/TextInput.d.ts.map +1 -1
- package/dist/composites/form-controls/TextInput/TextInput.styles.d.ts +2 -2
- package/dist/composites/form-controls/TextInput/TextInput.styles.d.ts.map +1 -1
- package/dist/composites/form-controls/Toggle/Toggle.styles.d.ts +2 -2
- package/dist/composites/form-controls/Toggle/Toggle.styles.d.ts.map +1 -1
- package/dist/composites/layout/AppShell/AppShell.styles.d.ts +2 -2
- package/dist/composites/layout/AppShell/AppShell.styles.d.ts.map +1 -1
- package/dist/composites/layout/Card/Card.styles.d.ts +2 -2
- package/dist/composites/layout/Card/Card.styles.d.ts.map +1 -1
- package/dist/composites/layout/Card/Card.types.d.ts +1 -1
- package/dist/composites/layout/Card/Card.types.d.ts.map +1 -1
- package/dist/composites/layout/Navbar/Navbar.styles.d.ts +3 -2
- package/dist/composites/layout/Navbar/Navbar.styles.d.ts.map +1 -1
- package/dist/composites/layout/Sidebar/Sidebar.styles.d.ts +3 -2
- package/dist/composites/layout/Sidebar/Sidebar.styles.d.ts.map +1 -1
- package/dist/composites/overlays/Popover/Popover.styles.d.ts +2 -2
- package/dist/composites/overlays/Popover/Popover.styles.d.ts.map +1 -1
- package/dist/composites/range-inputs/ColorScaleSlider/ColorScaleSlider.d.ts +1 -1
- package/dist/composites/range-inputs/ColorScaleSlider/ColorScaleSlider.d.ts.map +1 -1
- package/dist/composites/range-inputs/ColorScaleSlider/ColorScaleSlider.styles.d.ts +2 -2
- package/dist/composites/range-inputs/ColorScaleSlider/ColorScaleSlider.styles.d.ts.map +1 -1
- package/dist/composites/range-inputs/ColorScaleSlider/ColorScaleSlider.types.d.ts +2 -0
- package/dist/composites/range-inputs/ColorScaleSlider/ColorScaleSlider.types.d.ts.map +1 -1
- package/dist/composites/range-inputs/HueSlider/HueSlider.d.ts +3 -4
- package/dist/composites/range-inputs/HueSlider/HueSlider.d.ts.map +1 -1
- package/dist/composites/range-inputs/HueSlider/HueSlider.styles.d.ts +4 -4
- package/dist/composites/range-inputs/HueSlider/HueSlider.styles.d.ts.map +1 -1
- package/dist/composites/range-inputs/Slider/Slider.d.ts.map +1 -1
- package/dist/composites/range-inputs/Slider/Slider.styles.d.ts +2 -2
- package/dist/composites/range-inputs/Slider/Slider.styles.d.ts.map +1 -1
- package/dist/index.cjs +1245 -1824
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +12 -24
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1096 -1737
- package/dist/index.js.map +1 -1
- package/dist/primitives/Frame/Frame.d.ts.map +1 -1
- package/dist/primitives/Frame/Frame.styles.d.ts +3 -2
- package/dist/primitives/Frame/Frame.styles.d.ts.map +1 -1
- package/dist/primitives/Frame/Frame.types.d.ts +1 -1
- package/dist/primitives/Frame/Frame.types.d.ts.map +1 -1
- package/dist/primitives/Frame/Frame.utils.d.ts +1 -1
- package/dist/primitives/Frame/Frame.utils.d.ts.map +1 -1
- package/dist/primitives/Icon/Icon.d.ts.map +1 -1
- package/dist/primitives/Text/Text.d.ts +1 -1
- package/dist/primitives/Text/Text.d.ts.map +1 -1
- package/dist/primitives/Text/Text.types.d.ts +1 -1
- package/dist/primitives/Text/Text.types.d.ts.map +1 -1
- package/dist/primitives/Wrapper/Wrapper.styles.d.ts +1 -1
- package/dist/primitives/Wrapper/Wrapper.styles.d.ts.map +1 -1
- package/package.json +3 -2
- package/src/_COMPONENT_TEMPLATE/ComponentName.styles.ts +4 -4
- package/src/_COMPONENT_TEMPLATE/ComponentName.tsx +2 -2
- package/src/_COMPONENT_TEMPLATE/ComponentName.types.ts +1 -1
- package/src/composites/actions/Button/Button.styles.ts +37 -36
- package/src/composites/actions/Button/Button.tsx +1 -1
- package/src/composites/form-controls/Select/Select.styles.ts +8 -8
- package/src/composites/form-controls/Select/Select.tsx +4 -5
- package/src/composites/form-controls/Select/SelectOption.tsx +7 -8
- package/src/composites/form-controls/TextInput/TextInput.styles.ts +7 -8
- package/src/composites/form-controls/TextInput/TextInput.tsx +3 -4
- package/src/composites/form-controls/Toggle/Toggle.styles.ts +6 -6
- package/src/composites/form-controls/Toggle/Toggle.tsx +2 -2
- package/src/composites/layout/AppShell/AppShell.styles.ts +3 -4
- package/src/composites/layout/AppShell/AppShell.tsx +2 -2
- package/src/composites/layout/Card/Card.styles.ts +4 -5
- package/src/composites/layout/Card/Card.tsx +2 -2
- package/src/composites/layout/Card/Card.types.ts +1 -1
- package/src/composites/layout/Navbar/Navbar.styles.ts +5 -5
- package/src/composites/layout/Navbar/Navbar.tsx +2 -2
- package/src/composites/layout/Sidebar/Sidebar.styles.ts +5 -5
- package/src/composites/layout/Sidebar/Sidebar.tsx +2 -2
- package/src/composites/overlays/Popover/Popover.styles.ts +4 -4
- package/src/composites/overlays/Popover/Popover.tsx +2 -2
- package/src/composites/range-inputs/ColorScaleSlider/ColorScaleSlider.styles.ts +5 -6
- package/src/composites/range-inputs/ColorScaleSlider/ColorScaleSlider.tsx +6 -3
- package/src/composites/range-inputs/ColorScaleSlider/ColorScaleSlider.types.ts +2 -0
- package/src/composites/range-inputs/HueSlider/HueSlider.styles.ts +14 -21
- package/src/composites/range-inputs/HueSlider/HueSlider.tsx +8 -9
- package/src/composites/range-inputs/Slider/Slider.styles.ts +9 -10
- package/src/composites/range-inputs/Slider/Slider.tsx +18 -4
- package/src/index.ts +73 -60
- package/src/primitives/Frame/Frame.styles.ts +8 -7
- package/src/primitives/Frame/Frame.tsx +9 -9
- package/src/primitives/Frame/Frame.types.ts +1 -1
- package/src/primitives/Frame/Frame.utils.ts +1 -1
- package/src/primitives/Icon/Icon.tsx +2 -3
- package/src/primitives/Text/Text.spans.ts +1 -1
- package/src/primitives/Text/Text.tsx +16 -16
- package/src/primitives/Text/Text.types.ts +1 -1
- package/src/primitives/Wrapper/Wrapper.styles.ts +1 -1
- package/src/primitives/Wrapper/Wrapper.tsx +1 -1
- package/dist/fonts/GoogleFontLoader.d.ts +0 -20
- package/dist/fonts/GoogleFontLoader.d.ts.map +0 -1
- package/dist/fonts/IconFontLoader.d.ts +0 -13
- package/dist/fonts/IconFontLoader.d.ts.map +0 -1
- package/dist/fonts/SelfHostedFontLoader.d.ts +0 -14
- package/dist/fonts/SelfHostedFontLoader.d.ts.map +0 -1
- package/dist/fonts/buildGoogleFontsUrl.d.ts +0 -2
- package/dist/fonts/buildGoogleFontsUrl.d.ts.map +0 -1
- package/dist/fonts/measureFont.d.ts +0 -19
- package/dist/fonts/measureFont.d.ts.map +0 -1
- package/dist/fonts/reportQueue.d.ts +0 -7
- package/dist/fonts/reportQueue.d.ts.map +0 -1
- package/dist/fonts/useLocalCalibration.d.ts +0 -19
- package/dist/fonts/useLocalCalibration.d.ts.map +0 -1
- package/dist/fonts/useTypographyCalibrations.d.ts +0 -11
- package/dist/fonts/useTypographyCalibrations.d.ts.map +0 -1
- package/dist/theme/FrameContext.d.ts +0 -26
- package/dist/theme/FrameContext.d.ts.map +0 -1
- package/dist/theme/NewtoneProvider.d.ts +0 -40
- package/dist/theme/NewtoneProvider.d.ts.map +0 -1
- package/dist/theme/defaults.d.ts +0 -8
- package/dist/theme/defaults.d.ts.map +0 -1
- package/dist/theme/types.d.ts +0 -156
- package/dist/theme/types.d.ts.map +0 -1
- package/dist/theme/useBreakpoint.d.ts +0 -9
- package/dist/theme/useBreakpoint.d.ts.map +0 -1
- package/dist/tokens/computeTokens.d.ts +0 -151
- package/dist/tokens/computeTokens.d.ts.map +0 -1
- package/dist/tokens/types.d.ts +0 -162
- package/dist/tokens/types.d.ts.map +0 -1
- package/dist/tokens/useTokens.d.ts +0 -26
- package/dist/tokens/useTokens.d.ts.map +0 -1
- package/src/fonts/GoogleFontLoader.tsx +0 -80
- package/src/fonts/IconFontLoader.tsx +0 -51
- package/src/fonts/SelfHostedFontLoader.tsx +0 -44
- package/src/fonts/buildGoogleFontsUrl.ts +0 -2
- package/src/fonts/measureFont.ts +0 -55
- package/src/fonts/reportQueue.ts +0 -54
- package/src/fonts/useLocalCalibration.ts +0 -97
- package/src/fonts/useTypographyCalibrations.ts +0 -15
- package/src/theme/FrameContext.tsx +0 -31
- package/src/theme/NewtoneProvider.tsx +0 -84
- package/src/theme/defaults.ts +0 -71
- package/src/theme/types.ts +0 -191
- package/src/theme/useBreakpoint.ts +0 -14
- package/src/tokens/computeTokens.ts +0 -516
- package/src/tokens/types.ts +0 -146
- package/src/tokens/useTokens.ts +0 -62
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Frame.d.ts","sourceRoot":"","sources":["../../../src/primitives/Frame/Frame.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAGvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"Frame.d.ts","sourceRoot":"","sources":["../../../src/primitives/Frame/Frame.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAGvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AA4ChD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,wBAAgB,KAAK,CAAC,EACpB,QAAQ,EAER,SAAS,EAET,MAAM,EACN,SAAS,EACT,IAAI,EACJ,OAAO,EACP,OAAO,EACP,IAAI,EAEJ,KAAK,EACL,OAAO,EAEP,OAAO,EACP,GAAG,EAEH,KAAK,EACL,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,SAAS,EAET,MAAM,EACN,QAAQ,EAER,OAAO,EACP,IAAI,EACJ,QAAgB,EAEhB,kBAAkB,EAClB,iBAAiB,EAEjB,MAAM,EACN,QAAQ,EACR,GAAG,EAEH,KAAK,GACN,EAAE,UAAU,qBAiLZ"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { ViewStyle } from 'react-native';
|
|
2
|
-
import type { ResolvedTokens } from '
|
|
3
|
-
import type { FrameElevation } from '
|
|
2
|
+
import type { ResolvedTokens, ColorGamut } from 'newtone-api';
|
|
3
|
+
import type { FrameElevation } from 'newtone-api';
|
|
4
4
|
import type { PaddingProp, GapProp, SizingMode, Direction, Alignment, Justification, RadiusProp, LayoutMode } from './Frame.types';
|
|
5
5
|
export interface FrameStyleInput {
|
|
6
6
|
readonly tokens: ResolvedTokens;
|
|
7
|
+
readonly gamut: ColorGamut;
|
|
7
8
|
readonly frameElevation: FrameElevation;
|
|
8
9
|
readonly layout?: LayoutMode;
|
|
9
10
|
readonly direction?: Direction;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Frame.styles.d.ts","sourceRoot":"","sources":["../../../src/primitives/Frame/Frame.styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"Frame.styles.d.ts","sourceRoot":"","sources":["../../../src/primitives/Frame/Frame.styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9D,OA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AAO,CAAC;IAC5B,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;CAC7B;AAID,MAAM,WAAW,WAAW;IAC1B,uCAAuC;IACvC,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAC9B,oDAAoD;IACpD,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC;IAC5B,iEAAiE;IACjE,QAAQ,CAAC,YAAY,EAAE,KAAK,CAAC,aAAa,GAAG,IAAI,CAAC;IAClD,wDAAwD;IACxD,QAAQ,CAAC,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;CACxC;AAID;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,eAAe,GAAG,WAAW,CAoKlE"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { View, ViewStyle, GestureResponderEvent } from 'react-native';
|
|
2
|
-
import type { FrameElevation } from '
|
|
2
|
+
import type { FrameElevation } from 'newtone-api';
|
|
3
3
|
/** Design system spacing tokens (represent px values at Medium preset) */
|
|
4
4
|
export type SpacingToken = '00' | '02' | '04' | '06' | '08' | '10' | '12' | '16' | '20' | '24' | '32' | '40' | '48';
|
|
5
5
|
/** A spacing value: either a design token name or a pixel number */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Frame.types.d.ts","sourceRoot":"","sources":["../../../src/primitives/Frame/Frame.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAC3E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"Frame.types.d.ts","sourceRoot":"","sources":["../../../src/primitives/Frame/Frame.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAC3E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAI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E,MAAM,CAAC;IAIpC,iFAAiF;IACjF,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAEzB,mFAAmF;IACnF,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAE3B,uDAAuD;IACvD,QAAQ,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAI/B,6CAA6C;IAC7C,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,GAAG,SAAS,EAAE,CAAC;CAC1C"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ViewStyle } from 'react-native';
|
|
2
|
-
import type { ResolvedTokens } from '
|
|
2
|
+
import type { ResolvedTokens } from 'newtone-api';
|
|
3
3
|
import type { SpacingValue, PaddingProp, GapProp, RadiusValue, RadiusProp, SizingMode, Direction, Alignment, Justification } from './Frame.types';
|
|
4
4
|
/** Convert a spacing token name (like 'md') or raw number into pixels. */
|
|
5
5
|
export declare function resolveSpacing(value: SpacingValue, tokens: ResolvedTokens): number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Frame.utils.d.ts","sourceRoot":"","sources":["../../../src/primitives/Frame/Frame.utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"Frame.utils.d.ts","sourceRoot":"","sources":["../../../src/primitives/Frame/Frame.utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,EACV,YAAY,EAGZ,WAAW,EACX,OAAO,EACP,WAAW,EACX,UAAU,EACV,UAAU,EACV,SAAS,EACT,SAAS,EACT,aAAa,EACd,MAAM,eAAe,CAAC;AAMvB,0EAA0E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,CAAC,KAAK,EAAE,SAAS,GAAG,SAAS,CAAC,YAAY,CAAC,CAE1E;AAED,gFAAgF;AAChF,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,aAAa,GAAG,SAAS,CAAC,gBAAgB,CAAC,CAExF;AAED,uFAAuF;AACvF,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,OAAO,GACf,SAAS,CAAC,eAAe,CAAC,CAM5B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../../src/primitives/Icon/Icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../../src/primitives/Icon/Icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAGvC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C;;;;;;;;;;;;GAYG;AACH,wBAAgB,IAAI,CAAC,EACnB,IAAI,EACJ,IAAI,EACJ,WAAW,EACX,IAAQ,EACR,KAAK,EACL,KAAK,EAEL,kBAAkB,EAElB,MAAM,EACN,QAAQ,EACR,GAAG,GACJ,EAAE,SAAS,qBAqEX"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { UseTokensResult } from '
|
|
2
|
+
import type { UseTokensResult } from 'newtone-api';
|
|
3
3
|
import type { TextProps, TextColor } from './Text.types';
|
|
4
4
|
/**
|
|
5
5
|
* Context to pass the active scope's weight map to span sub-components.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["../../../src/primitives/Text/Text.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsD,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["../../../src/primitives/Text/Text.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsD,MAAM,OAAO,CAAC;AAM3E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAMzD;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB;sBACT;QAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;KAAE;SACjF,CAAC;AAEhB;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,GAAG,MAAM,CAYlF;AA0BD;;;;;;;;;;;;;;;;;GAiBG;AACH,iBAAS,QAAQ,CAAC,EAChB,QAAQ,EACR,KAAc,EACd,IAAa,EACb,KAAiB,EACjB,IAAI,EAAE,YAAY,EAClB,MAAM,EAAE,cAAc,EACtB,KAAK,EACL,aAAa,EACb,SAAa,EACb,KAAK,EACL,iBAAiB,EAAE,yBAAyB,EAC5C,MAAM,EACN,QAAQ,EACR,GAAG,EACH,UAAkB,EAClB,gBAAwB,EACxB,QAAQ,GACT,EAAE,SAAS,qBAuJX;AAED,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Text as RNText, TextStyle } from 'react-native';
|
|
2
|
-
import type { ElevationLevel } from '
|
|
2
|
+
import type { ElevationLevel } from 'newtone-api';
|
|
3
3
|
/** Typography size step — selects within the current role's 3-step scale. @default 'md' */
|
|
4
4
|
export type TextSize = 'sm' | 'md' | 'lg';
|
|
5
5
|
/** Font weight slots — maps to per-scope `tokens.typography.fonts[scope].weights.*` values. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.types.d.ts","sourceRoot":"","sources":["../../../src/primitives/Text/Text.types.ts"],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,QAAQ,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC;IAC7B,0BAA0B;IAC1B,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B,kCAAkC;IAClC,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAC7B,+DAA+D;IAC/D,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,CAAC;IAC/B,sCAAsC;IACtC,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,GAAG,SAAS,SAAS,EAAE,CAAC;CACnD"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ViewStyle } from 'react-native';
|
|
2
|
-
import type { ResolvedTokens } from '
|
|
2
|
+
import type { ResolvedTokens } from 'newtone-api';
|
|
3
3
|
import type { Direction, Alignment, Justification, PaddingProp, GapProp, SizingMode } from '../Frame/Frame.types';
|
|
4
4
|
export interface WrapperStyleInput {
|
|
5
5
|
readonly tokens: ResolvedTokens;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Wrapper.styles.d.ts","sourceRoot":"","sources":["../../../src/primitives/Wrapper/Wrapper.styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"Wrapper.styles.d.ts","sourceRoot":"","sources":["../../../src/primitives/Wrapper/Wrapper.styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,EACV,SAAS,EACT,SAAS,EACT,aAAa,EACb,WAAW,EACX,OAAO,EACP,UAAU,EACX,MAAM,sBAAsB,CAAC;AAU9B,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC;IAChC,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,CAAC;IAC/B,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,CAAC;IAC3B,QAAQ,CAAC,OAAO,CAAC,EAAE,aAAa,CAAC;IACjC,QAAQ,CAAC,OAAO,CAAC,EAAE,WAAW,CAAC;IAC/B,QAAQ,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC;IAC5B,QAAQ,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC;IAC7B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,iBAAiB,GAAG,SAAS,CAoEpE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@newtonedev/components",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.13",
|
|
4
4
|
"description": "React + React Native Web component library for Newtone",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -37,8 +37,9 @@
|
|
|
37
37
|
"react-native": ">=0.70.0"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"
|
|
40
|
+
"newtone-api": "^0.0.1",
|
|
41
41
|
"newtone": "^0.1.0",
|
|
42
|
+
"@newtonedev/fonts": "^0.1.0",
|
|
42
43
|
"react-native-web": "^0.19.10"
|
|
43
44
|
},
|
|
44
45
|
"devDependencies": {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { StyleSheet } from 'react-native';
|
|
2
|
-
import {
|
|
3
|
-
import type { ResolvedTokens } from '../tokens/types';
|
|
2
|
+
import type { ResolvedTokens, ColorGamut } from 'newtone-api';
|
|
4
3
|
|
|
5
4
|
/**
|
|
6
5
|
* Pure style computation function.
|
|
@@ -8,6 +7,7 @@ import type { ResolvedTokens } from '../tokens/types';
|
|
|
8
7
|
* Rules:
|
|
9
8
|
* - Always use StyleSheet.create() — never plain JS objects
|
|
10
9
|
* - Colors from tokens only — never hardcoded hex (except shadows: '#000')
|
|
10
|
+
* - Use `[gamut]` indexing on TokenColor values (never `.srgb` or `.p3` directly)
|
|
11
11
|
* - Shadows via RN properties (shadowColor, shadowOffset, shadowOpacity, shadowRadius, elevation)
|
|
12
12
|
* NEVER use boxShadow as a CSS string
|
|
13
13
|
* - For web-only CSS (boxShadow, gridTemplateColumns, etc.):
|
|
@@ -15,11 +15,11 @@ import type { ResolvedTokens } from '../tokens/types';
|
|
|
15
15
|
* - Every section must have a plain-language inline comment explaining what
|
|
16
16
|
* the style achieves visually, not just the CSS property name
|
|
17
17
|
*/
|
|
18
|
-
export function getComponentNameStyles(tokens: ResolvedTokens) {
|
|
18
|
+
export function getComponentNameStyles(tokens: ResolvedTokens, gamut: ColorGamut) {
|
|
19
19
|
return StyleSheet.create({
|
|
20
20
|
container: {
|
|
21
21
|
// Surface color from the current theme.
|
|
22
|
-
backgroundColor:
|
|
22
|
+
backgroundColor: tokens.background[gamut],
|
|
23
23
|
// Rounded corners using the theme's medium radius.
|
|
24
24
|
borderRadius: tokens.radius.md,
|
|
25
25
|
// Inner spacing using the theme's medium spacing value.
|
|
@@ -69,7 +69,7 @@ import React, { useMemo } from 'react';
|
|
|
69
69
|
import { View } from 'react-native';
|
|
70
70
|
import type { ComponentNameProps } from './ComponentName.types';
|
|
71
71
|
import { getComponentNameStyles } from './ComponentName.styles';
|
|
72
|
-
import { useTokens } from '
|
|
72
|
+
import { useTokens } from 'newtone-api';
|
|
73
73
|
|
|
74
74
|
export function ComponentName({
|
|
75
75
|
style,
|
|
@@ -86,7 +86,7 @@ export function ComponentName({
|
|
|
86
86
|
// Wrapped in useMemo so it only recalculates when the tokens change,
|
|
87
87
|
// instead of recalculating on every render (which would be wasteful).
|
|
88
88
|
const styles = useMemo(
|
|
89
|
-
() => getComponentNameStyles(tokens),
|
|
89
|
+
() => getComponentNameStyles(tokens, tokens.gamut),
|
|
90
90
|
[tokens]
|
|
91
91
|
);
|
|
92
92
|
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type {
|
|
3
|
-
import type { PaletteTokens } from '../../../tokens/types';
|
|
1
|
+
import type { UseTokensResult } from 'newtone-api';
|
|
2
|
+
import type { PaletteTokens } from 'newtone-api';
|
|
4
3
|
import type { ButtonVariant, ButtonSemantic, ButtonSize } from './Button.types';
|
|
5
4
|
import type { TextSize } from '../../../primitives/Text/Text.types';
|
|
6
5
|
|
|
@@ -219,14 +218,15 @@ function getVariantColors(
|
|
|
219
218
|
// Disabled state overrides for all variants
|
|
220
219
|
if (disabled) {
|
|
221
220
|
const baseColors = getVariantColorsForState(variant, semantic, tokens);
|
|
222
|
-
const
|
|
221
|
+
const { gamut } = tokens;
|
|
222
|
+
const disabledBg = tokens.backgroundSunken[gamut];
|
|
223
223
|
return {
|
|
224
224
|
...baseColors,
|
|
225
225
|
bg: disabledBg,
|
|
226
226
|
hoveredBg: disabledBg,
|
|
227
227
|
pressedBg: disabledBg,
|
|
228
|
-
textColor:
|
|
229
|
-
iconColor:
|
|
228
|
+
textColor: tokens.textSecondary[gamut],
|
|
229
|
+
iconColor: tokens.textSecondary[gamut],
|
|
230
230
|
};
|
|
231
231
|
}
|
|
232
232
|
|
|
@@ -243,6 +243,7 @@ function getVariantColorsForState(
|
|
|
243
243
|
semantic: ButtonSemantic,
|
|
244
244
|
tokens: UseTokensResult
|
|
245
245
|
) {
|
|
246
|
+
const { gamut } = tokens;
|
|
246
247
|
const paletteTokens = getPaletteTokens(semantic, tokens);
|
|
247
248
|
|
|
248
249
|
// PRIMARY VARIANT: Filled background
|
|
@@ -250,11 +251,11 @@ function getVariantColorsForState(
|
|
|
250
251
|
if (semantic === 'neutral') {
|
|
251
252
|
// Neutral primary - uses backgroundInteractive tokens for consistent contrast across elevations
|
|
252
253
|
return {
|
|
253
|
-
bg:
|
|
254
|
-
hoveredBg:
|
|
255
|
-
pressedBg:
|
|
256
|
-
textColor:
|
|
257
|
-
iconColor:
|
|
254
|
+
bg: tokens.backgroundInteractive[gamut],
|
|
255
|
+
hoveredBg: tokens.backgroundInteractiveHover[gamut],
|
|
256
|
+
pressedBg: tokens.backgroundInteractiveActive[gamut],
|
|
257
|
+
textColor: tokens.textPrimary[gamut],
|
|
258
|
+
iconColor: tokens.textPrimary[gamut],
|
|
258
259
|
borderWidth: 1,
|
|
259
260
|
borderColor: 'transparent',
|
|
260
261
|
};
|
|
@@ -262,11 +263,11 @@ function getVariantColorsForState(
|
|
|
262
263
|
|
|
263
264
|
// Semantic primary (accent, success, error, warning) — uses palette fill tokens
|
|
264
265
|
return {
|
|
265
|
-
bg:
|
|
266
|
-
hoveredBg:
|
|
267
|
-
pressedBg:
|
|
268
|
-
textColor:
|
|
269
|
-
iconColor:
|
|
266
|
+
bg: paletteTokens!.fill[gamut],
|
|
267
|
+
hoveredBg: paletteTokens!.fillHover[gamut],
|
|
268
|
+
pressedBg: paletteTokens!.fillActive[gamut],
|
|
269
|
+
textColor: paletteTokens!.onFill[gamut],
|
|
270
|
+
iconColor: paletteTokens!.onFill[gamut],
|
|
270
271
|
borderWidth: 1,
|
|
271
272
|
borderColor: 'transparent',
|
|
272
273
|
};
|
|
@@ -278,22 +279,22 @@ function getVariantColorsForState(
|
|
|
278
279
|
// Shifted action scale: transparent → 01 (hover) → 02 (pressed)
|
|
279
280
|
return {
|
|
280
281
|
bg: 'transparent',
|
|
281
|
-
hoveredBg:
|
|
282
|
-
pressedBg:
|
|
283
|
-
textColor:
|
|
284
|
-
iconColor:
|
|
282
|
+
hoveredBg: tokens.backgroundInteractive[gamut],
|
|
283
|
+
pressedBg: tokens.backgroundInteractiveHover[gamut],
|
|
284
|
+
textColor: tokens.textPrimary[gamut],
|
|
285
|
+
iconColor: tokens.textPrimary[gamut],
|
|
285
286
|
borderWidth: 1,
|
|
286
|
-
borderColor:
|
|
287
|
+
borderColor: tokens.border[gamut],
|
|
287
288
|
};
|
|
288
289
|
}
|
|
289
290
|
|
|
290
291
|
// Semantic secondary — uses palette surface tokens for subtle bg
|
|
291
292
|
return {
|
|
292
|
-
bg:
|
|
293
|
-
hoveredBg:
|
|
294
|
-
pressedBg:
|
|
295
|
-
textColor:
|
|
296
|
-
iconColor:
|
|
293
|
+
bg: paletteTokens!.background[gamut],
|
|
294
|
+
hoveredBg: paletteTokens!.backgroundInteractive[gamut],
|
|
295
|
+
pressedBg: paletteTokens!.backgroundInteractiveHover[gamut],
|
|
296
|
+
textColor: paletteTokens!.fill[gamut],
|
|
297
|
+
iconColor: paletteTokens!.fill[gamut],
|
|
297
298
|
borderWidth: 1,
|
|
298
299
|
borderColor: 'transparent',
|
|
299
300
|
};
|
|
@@ -305,10 +306,10 @@ function getVariantColorsForState(
|
|
|
305
306
|
// Shifted action scale: transparent → 01 (hover) → 02 (pressed)
|
|
306
307
|
return {
|
|
307
308
|
bg: 'transparent',
|
|
308
|
-
hoveredBg:
|
|
309
|
-
pressedBg:
|
|
310
|
-
textColor:
|
|
311
|
-
iconColor:
|
|
309
|
+
hoveredBg: tokens.backgroundInteractive[gamut],
|
|
310
|
+
pressedBg: tokens.backgroundInteractiveHover[gamut],
|
|
311
|
+
textColor: tokens.textPrimary[gamut],
|
|
312
|
+
iconColor: tokens.textPrimary[gamut],
|
|
312
313
|
borderWidth: 1,
|
|
313
314
|
borderColor: 'transparent',
|
|
314
315
|
};
|
|
@@ -317,10 +318,10 @@ function getVariantColorsForState(
|
|
|
317
318
|
// Semantic tertiary — uses palette surface tokens for hover/pressed
|
|
318
319
|
return {
|
|
319
320
|
bg: 'transparent',
|
|
320
|
-
hoveredBg:
|
|
321
|
-
pressedBg:
|
|
322
|
-
textColor:
|
|
323
|
-
iconColor:
|
|
321
|
+
hoveredBg: paletteTokens!.background[gamut],
|
|
322
|
+
pressedBg: paletteTokens!.backgroundInteractive[gamut],
|
|
323
|
+
textColor: paletteTokens!.fill[gamut],
|
|
324
|
+
iconColor: paletteTokens!.fill[gamut],
|
|
324
325
|
borderWidth: 1,
|
|
325
326
|
borderColor: 'transparent',
|
|
326
327
|
};
|
|
@@ -331,8 +332,8 @@ function getVariantColorsForState(
|
|
|
331
332
|
bg: 'transparent',
|
|
332
333
|
hoveredBg: 'transparent',
|
|
333
334
|
pressedBg: 'transparent',
|
|
334
|
-
textColor:
|
|
335
|
-
iconColor:
|
|
335
|
+
textColor: tokens.textPrimary[gamut],
|
|
336
|
+
iconColor: tokens.textPrimary[gamut],
|
|
336
337
|
borderWidth: 0,
|
|
337
338
|
};
|
|
338
339
|
}
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { Pressable } from 'react-native';
|
|
3
3
|
import type { ButtonProps } from './Button.types';
|
|
4
4
|
import { getButtonConfig, computeButtonPadding } from './Button.styles';
|
|
5
|
-
import { useTokens } from '
|
|
5
|
+
import { useTokens } from 'newtone-api';
|
|
6
6
|
import { Icon } from '../../../primitives/Icon/Icon';
|
|
7
7
|
import { Text } from '../../../primitives/Text';
|
|
8
8
|
import { Wrapper } from '../../../primitives/Wrapper/Wrapper';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { StyleSheet } from 'react-native';
|
|
2
|
-
import {
|
|
3
|
-
import type { ResolvedTokens } from '../../../tokens/types';
|
|
2
|
+
import type { ResolvedTokens, ColorGamut } from 'newtone-api';
|
|
4
3
|
|
|
5
4
|
export function getSelectStyles(
|
|
6
5
|
tokens: ResolvedTokens,
|
|
6
|
+
gamut: ColorGamut,
|
|
7
7
|
disabled: boolean,
|
|
8
8
|
size: 'sm' | 'md',
|
|
9
9
|
isOpen: boolean
|
|
@@ -24,14 +24,14 @@ export function getSelectStyles(
|
|
|
24
24
|
fontFamily: tokens.typography.fonts.main.family,
|
|
25
25
|
fontSize: tokens.typography.fontSizes['04'],
|
|
26
26
|
fontWeight: tokens.typography.fonts.main.weights.medium as any,
|
|
27
|
-
color:
|
|
27
|
+
color: tokens.textSecondary[gamut],
|
|
28
28
|
},
|
|
29
29
|
trigger: {
|
|
30
30
|
flexDirection: 'row',
|
|
31
31
|
alignItems: 'center',
|
|
32
|
-
backgroundColor:
|
|
32
|
+
backgroundColor: tokens.backgroundSunken[gamut],
|
|
33
33
|
borderWidth: 1,
|
|
34
|
-
borderColor:
|
|
34
|
+
borderColor: tokens.border[gamut],
|
|
35
35
|
borderRadius: tokens.radius.md,
|
|
36
36
|
paddingVertical,
|
|
37
37
|
paddingLeft: paddingHorizontal,
|
|
@@ -43,8 +43,8 @@ export function getSelectStyles(
|
|
|
43
43
|
fontFamily: tokens.typography.fonts.main.family,
|
|
44
44
|
fontSize,
|
|
45
45
|
color: disabled
|
|
46
|
-
?
|
|
47
|
-
:
|
|
46
|
+
? tokens.textSecondary[gamut]
|
|
47
|
+
: tokens.textPrimary[gamut],
|
|
48
48
|
},
|
|
49
49
|
iconWrapper: {
|
|
50
50
|
position: 'absolute',
|
|
@@ -57,7 +57,7 @@ export function getSelectStyles(
|
|
|
57
57
|
fontFamily: tokens.typography.fonts.main.family,
|
|
58
58
|
fontSize: tokens.typography.fontSizes['01'],
|
|
59
59
|
fontWeight: tokens.typography.fonts.main.weights.medium as any,
|
|
60
|
-
color:
|
|
60
|
+
color: tokens.textSecondary[gamut],
|
|
61
61
|
textTransform: 'uppercase',
|
|
62
62
|
letterSpacing: 0.5,
|
|
63
63
|
paddingVertical: tokens.spacing['04'],
|
|
@@ -2,14 +2,13 @@ import React, { useMemo } from 'react';
|
|
|
2
2
|
import { View, Text, Pressable, ScrollView } from 'react-native';
|
|
3
3
|
import type { SelectProps, SelectOption } from './Select.types';
|
|
4
4
|
import { isOptionGroup } from './Select.types';
|
|
5
|
-
import { useTokens } from '
|
|
5
|
+
import { useTokens } from 'newtone-api';
|
|
6
6
|
import { getSelectStyles } from './Select.styles';
|
|
7
7
|
import { Icon } from '../../../primitives/Icon/Icon';
|
|
8
8
|
import { Popover } from '../../overlays/Popover/Popover';
|
|
9
9
|
import { usePopover } from '../../overlays/Popover/usePopover';
|
|
10
10
|
import { useSelect } from './useSelect';
|
|
11
11
|
import { SelectOptionRow } from './SelectOption';
|
|
12
|
-
import { srgbToHex } from 'newtone';
|
|
13
12
|
|
|
14
13
|
function flattenOptions(items: readonly (SelectOption | { readonly label: string; readonly options: readonly SelectOption[] })[]): SelectOption[] {
|
|
15
14
|
const result: SelectOption[] = [];
|
|
@@ -53,7 +52,7 @@ export function Select({
|
|
|
53
52
|
});
|
|
54
53
|
|
|
55
54
|
const styles = useMemo(
|
|
56
|
-
() => getSelectStyles(tokens, disabled, size, isOpen),
|
|
55
|
+
() => getSelectStyles(tokens, tokens.gamut, disabled, size, isOpen),
|
|
57
56
|
[tokens, disabled, size, isOpen]
|
|
58
57
|
);
|
|
59
58
|
|
|
@@ -61,8 +60,8 @@ export function Select({
|
|
|
61
60
|
const displayLabel = selectedOption?.label ?? placeholder ?? value;
|
|
62
61
|
|
|
63
62
|
const iconColor = disabled
|
|
64
|
-
?
|
|
65
|
-
:
|
|
63
|
+
? tokens.textSecondary[tokens.gamut]
|
|
64
|
+
: tokens.textPrimary[tokens.gamut];
|
|
66
65
|
|
|
67
66
|
// onKeyDown is a web-only prop supported by react-native-web but not in RN types
|
|
68
67
|
const triggerWebProps = { onKeyDown: handleKeyDown } as any;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Pressable, Text, View } from 'react-native';
|
|
3
3
|
import type { SelectOption as SelectOptionType, SelectProps } from './Select.types';
|
|
4
|
-
import { useTokens } from '
|
|
4
|
+
import { useTokens } from 'newtone-api';
|
|
5
5
|
import { Icon } from '../../../primitives/Icon/Icon';
|
|
6
|
-
import { srgbToHex } from 'newtone';
|
|
7
6
|
|
|
8
7
|
interface SelectOptionRowProps {
|
|
9
8
|
readonly option: SelectOptionType;
|
|
@@ -56,11 +55,11 @@ export function SelectOptionRow({
|
|
|
56
55
|
paddingHorizontal,
|
|
57
56
|
},
|
|
58
57
|
isSelected && {
|
|
59
|
-
backgroundColor:
|
|
58
|
+
backgroundColor: tokens.backgroundSunken[tokens.gamut],
|
|
60
59
|
},
|
|
61
60
|
isFocused &&
|
|
62
61
|
!isSelected && {
|
|
63
|
-
backgroundColor: `${
|
|
62
|
+
backgroundColor: `${tokens.border[tokens.gamut]}20`,
|
|
64
63
|
},
|
|
65
64
|
option.disabled && {
|
|
66
65
|
opacity: 0.5,
|
|
@@ -76,14 +75,14 @@ export function SelectOptionRow({
|
|
|
76
75
|
flex: 1,
|
|
77
76
|
fontFamily: tokens.typography.fonts.main.family,
|
|
78
77
|
fontSize,
|
|
79
|
-
color:
|
|
78
|
+
color: tokens.textPrimary[tokens.gamut],
|
|
80
79
|
},
|
|
81
80
|
isSelected && {
|
|
82
81
|
fontWeight: tokens.typography.fonts.main.weights.medium as any,
|
|
83
|
-
color:
|
|
82
|
+
color: tokens.accent.fill[tokens.gamut],
|
|
84
83
|
},
|
|
85
84
|
option.disabled && {
|
|
86
|
-
color:
|
|
85
|
+
color: tokens.textSecondary[tokens.gamut],
|
|
87
86
|
},
|
|
88
87
|
]}
|
|
89
88
|
numberOfLines={1}
|
|
@@ -95,7 +94,7 @@ export function SelectOptionRow({
|
|
|
95
94
|
<Icon
|
|
96
95
|
name="check"
|
|
97
96
|
size={fontSize}
|
|
98
|
-
color={
|
|
97
|
+
color={tokens.accent.fill[tokens.gamut]}
|
|
99
98
|
/>
|
|
100
99
|
</View>
|
|
101
100
|
)}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { StyleSheet } from 'react-native';
|
|
2
|
-
import {
|
|
3
|
-
import type { ResolvedTokens } from '../../../tokens/types';
|
|
2
|
+
import type { ResolvedTokens, ColorGamut } from 'newtone-api';
|
|
4
3
|
|
|
5
|
-
export function getTextInputStyles(tokens: ResolvedTokens, disabled: boolean) {
|
|
4
|
+
export function getTextInputStyles(tokens: ResolvedTokens, gamut: ColorGamut, disabled: boolean) {
|
|
6
5
|
return StyleSheet.create({
|
|
7
6
|
container: {
|
|
8
7
|
gap: tokens.spacing['04'],
|
|
@@ -11,20 +10,20 @@ export function getTextInputStyles(tokens: ResolvedTokens, disabled: boolean) {
|
|
|
11
10
|
fontFamily: tokens.typography.fonts.main.family,
|
|
12
11
|
fontSize: tokens.typography.fontSizes['04'],
|
|
13
12
|
fontWeight: tokens.typography.fonts.main.weights.medium as any,
|
|
14
|
-
color:
|
|
13
|
+
color: tokens.textSecondary[gamut],
|
|
15
14
|
},
|
|
16
15
|
input: {
|
|
17
16
|
fontFamily: tokens.typography.fonts.main.family,
|
|
18
|
-
backgroundColor:
|
|
17
|
+
backgroundColor: tokens.backgroundSunken[gamut],
|
|
19
18
|
borderWidth: 1,
|
|
20
|
-
borderColor:
|
|
19
|
+
borderColor: tokens.border[gamut],
|
|
21
20
|
borderRadius: tokens.radius.md,
|
|
22
21
|
paddingVertical: tokens.spacing['08'],
|
|
23
22
|
paddingHorizontal: tokens.spacing['12'],
|
|
24
23
|
fontSize: tokens.typography.fontSizes['05'],
|
|
25
24
|
color: disabled
|
|
26
|
-
?
|
|
27
|
-
:
|
|
25
|
+
? tokens.textSecondary[gamut]
|
|
26
|
+
: tokens.textPrimary[gamut],
|
|
28
27
|
opacity: disabled ? 0.5 : 1,
|
|
29
28
|
},
|
|
30
29
|
});
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { View, Text, TextInput as RNTextInput } from 'react-native';
|
|
3
3
|
import type { TextInputProps } from './TextInput.types';
|
|
4
|
-
import { useTokens } from '
|
|
4
|
+
import { useTokens } from 'newtone-api';
|
|
5
5
|
import { getTextInputStyles } from './TextInput.styles';
|
|
6
|
-
import { srgbToHex } from 'newtone';
|
|
7
6
|
|
|
8
7
|
export function TextInput({
|
|
9
8
|
label,
|
|
@@ -14,7 +13,7 @@ export function TextInput({
|
|
|
14
13
|
const tokens = useTokens(1);
|
|
15
14
|
|
|
16
15
|
const styles = React.useMemo(
|
|
17
|
-
() => getTextInputStyles(tokens, disabled),
|
|
16
|
+
() => getTextInputStyles(tokens, tokens.gamut, disabled),
|
|
18
17
|
[tokens, disabled]
|
|
19
18
|
);
|
|
20
19
|
|
|
@@ -24,7 +23,7 @@ export function TextInput({
|
|
|
24
23
|
<RNTextInput
|
|
25
24
|
style={styles.input}
|
|
26
25
|
editable={!disabled}
|
|
27
|
-
placeholderTextColor={
|
|
26
|
+
placeholderTextColor={tokens.textSecondary[tokens.gamut]}
|
|
28
27
|
{...textInputProps}
|
|
29
28
|
/>
|
|
30
29
|
</View>
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { StyleSheet } from 'react-native';
|
|
2
|
-
import {
|
|
3
|
-
import type { ResolvedTokens } from '../../../tokens/types';
|
|
2
|
+
import type { ResolvedTokens, ColorGamut } from 'newtone-api';
|
|
4
3
|
|
|
5
4
|
const TRACK_WIDTH = 40;
|
|
6
5
|
const TRACK_HEIGHT = 22;
|
|
@@ -9,6 +8,7 @@ const THUMB_OFFSET = 2;
|
|
|
9
8
|
|
|
10
9
|
export function getToggleStyles(
|
|
11
10
|
tokens: ResolvedTokens,
|
|
11
|
+
gamut: ColorGamut,
|
|
12
12
|
value: boolean,
|
|
13
13
|
disabled: boolean
|
|
14
14
|
) {
|
|
@@ -23,15 +23,15 @@ export function getToggleStyles(
|
|
|
23
23
|
fontFamily: tokens.typography.fonts.main.family,
|
|
24
24
|
fontSize: tokens.typography.fontSizes['04'],
|
|
25
25
|
fontWeight: tokens.typography.fonts.main.weights.medium as any,
|
|
26
|
-
color:
|
|
26
|
+
color: tokens.textSecondary[gamut],
|
|
27
27
|
},
|
|
28
28
|
track: {
|
|
29
29
|
width: TRACK_WIDTH,
|
|
30
30
|
height: TRACK_HEIGHT,
|
|
31
31
|
borderRadius: TRACK_HEIGHT / 2,
|
|
32
32
|
backgroundColor: value
|
|
33
|
-
?
|
|
34
|
-
:
|
|
33
|
+
? tokens.accent.fill[gamut]
|
|
34
|
+
: tokens.border[gamut],
|
|
35
35
|
justifyContent: 'center',
|
|
36
36
|
paddingHorizontal: THUMB_OFFSET,
|
|
37
37
|
},
|
|
@@ -39,7 +39,7 @@ export function getToggleStyles(
|
|
|
39
39
|
width: THUMB_SIZE,
|
|
40
40
|
height: THUMB_SIZE,
|
|
41
41
|
borderRadius: THUMB_SIZE / 2,
|
|
42
|
-
backgroundColor:
|
|
42
|
+
backgroundColor: tokens.background[gamut],
|
|
43
43
|
alignSelf: value ? 'flex-end' : 'flex-start',
|
|
44
44
|
},
|
|
45
45
|
});
|