@newtonedev/components 0.1.2 → 0.1.4
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/Popover/Popover.d.ts.map +1 -1
- package/dist/Popover/Popover.styles.d.ts +64 -1
- package/dist/Popover/Popover.styles.d.ts.map +1 -1
- package/dist/Select/Select.d.ts.map +1 -1
- package/dist/_COMPONENT_TEMPLATE/ComponentName.d.ts +70 -0
- package/dist/_COMPONENT_TEMPLATE/ComponentName.d.ts.map +1 -0
- package/dist/_COMPONENT_TEMPLATE/ComponentName.styles.d.ts +22 -0
- package/dist/_COMPONENT_TEMPLATE/ComponentName.styles.d.ts.map +1 -0
- package/dist/_COMPONENT_TEMPLATE/ComponentName.types.d.ts +45 -0
- package/dist/_COMPONENT_TEMPLATE/ComponentName.types.d.ts.map +1 -0
- package/dist/_COMPONENT_TEMPLATE/index.d.ts +3 -0
- package/dist/_COMPONENT_TEMPLATE/index.d.ts.map +1 -0
- package/dist/fonts/GoogleFontLoader.d.ts.map +1 -1
- package/dist/fonts/IconFontLoader.d.ts.map +1 -1
- package/dist/index.cjs +371 -74
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +11 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +370 -76
- package/dist/index.js.map +1 -1
- package/dist/{Frame → primitives/Frame}/Frame.d.ts +1 -1
- package/dist/primitives/Frame/Frame.d.ts.map +1 -0
- package/dist/{Frame → primitives/Frame}/Frame.styles.d.ts +11 -2
- package/dist/primitives/Frame/Frame.styles.d.ts.map +1 -0
- package/dist/primitives/Frame/Frame.types.d.ts +240 -0
- package/dist/primitives/Frame/Frame.types.d.ts.map +1 -0
- package/dist/{Frame → primitives/Frame}/Frame.utils.d.ts +12 -12
- package/dist/primitives/Frame/Frame.utils.d.ts.map +1 -0
- package/dist/primitives/Frame/index.d.ts.map +1 -0
- package/dist/primitives/Icon/Icon.d.ts +17 -0
- package/dist/primitives/Icon/Icon.d.ts.map +1 -0
- package/dist/primitives/Icon/Icon.types.d.ts +55 -0
- package/dist/primitives/Icon/Icon.types.d.ts.map +1 -0
- package/dist/primitives/Icon/index.d.ts +3 -0
- package/dist/primitives/Icon/index.d.ts.map +1 -0
- package/dist/primitives/Text/Text.d.ts +17 -0
- package/dist/primitives/Text/Text.d.ts.map +1 -0
- package/dist/primitives/Text/Text.types.d.ts +85 -0
- package/dist/primitives/Text/Text.types.d.ts.map +1 -0
- package/dist/primitives/Text/index.d.ts +3 -0
- package/dist/primitives/Text/index.d.ts.map +1 -0
- package/dist/primitives/Wrapper/Wrapper.d.ts +29 -0
- package/dist/primitives/Wrapper/Wrapper.d.ts.map +1 -0
- package/dist/primitives/Wrapper/Wrapper.styles.d.ts +28 -0
- package/dist/primitives/Wrapper/Wrapper.styles.d.ts.map +1 -0
- package/dist/primitives/Wrapper/Wrapper.types.d.ts +113 -0
- package/dist/primitives/Wrapper/Wrapper.types.d.ts.map +1 -0
- package/dist/primitives/Wrapper/index.d.ts +3 -0
- package/dist/primitives/Wrapper/index.d.ts.map +1 -0
- package/dist/primitives/index.d.ts +12 -0
- package/dist/primitives/index.d.ts.map +1 -0
- package/dist/primitives/useFocusVisible.d.ts +29 -0
- package/dist/primitives/useFocusVisible.d.ts.map +1 -0
- package/dist/theme/defaults.d.ts.map +1 -1
- package/dist/theme/types.d.ts +13 -6
- package/dist/theme/types.d.ts.map +1 -1
- package/dist/tokens/computeTokens.d.ts +13 -6
- package/dist/tokens/computeTokens.d.ts.map +1 -1
- package/dist/tokens/types.d.ts +16 -7
- package/dist/tokens/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/Button/Button.styles.ts +9 -9
- package/src/Button/Button.tsx +1 -1
- package/src/Card/Card.styles.ts +1 -1
- package/src/ColorScaleSlider/ColorScaleSlider.styles.ts +1 -1
- package/src/HueSlider/HueSlider.styles.ts +1 -1
- package/src/Popover/Popover.styles.ts +5 -1
- package/src/Popover/Popover.tsx +3 -1
- package/src/Select/Select.styles.ts +9 -9
- package/src/Select/Select.tsx +2 -3
- package/src/Select/SelectOption.tsx +6 -6
- package/src/Slider/Slider.styles.ts +1 -1
- package/src/TextInput/TextInput.styles.ts +3 -3
- package/src/Toggle/Toggle.styles.ts +1 -1
- package/src/_COMPONENT_TEMPLATE/ComponentName.styles.ts +29 -0
- package/src/_COMPONENT_TEMPLATE/ComponentName.tsx +106 -0
- package/src/_COMPONENT_TEMPLATE/ComponentName.types.ts +86 -0
- package/src/_COMPONENT_TEMPLATE/index.ts +2 -0
- package/src/fonts/GoogleFontLoader.tsx +2 -0
- package/src/fonts/IconFontLoader.tsx +2 -0
- package/src/index.ts +22 -5
- package/src/{Frame → primitives/Frame}/Frame.styles.ts +46 -9
- package/src/{Frame → primitives/Frame}/Frame.tsx +90 -16
- package/src/primitives/Frame/Frame.types.ts +315 -0
- package/src/{Frame → primitives/Frame}/Frame.utils.ts +56 -20
- package/src/primitives/Icon/Icon.tsx +89 -0
- package/src/primitives/Icon/Icon.types.ts +70 -0
- package/src/primitives/Icon/index.ts +2 -0
- package/src/primitives/Text/Text.tsx +90 -0
- package/src/primitives/Text/Text.types.ts +108 -0
- package/src/primitives/Text/index.ts +10 -0
- package/src/primitives/Wrapper/Wrapper.styles.ts +113 -0
- package/src/primitives/Wrapper/Wrapper.tsx +104 -0
- package/src/primitives/Wrapper/Wrapper.types.ts +149 -0
- package/src/primitives/Wrapper/index.ts +2 -0
- package/src/primitives/index.ts +46 -0
- package/src/primitives/useFocusVisible.ts +102 -0
- package/src/theme/defaults.ts +13 -6
- package/src/theme/types.ts +13 -6
- package/src/tokens/computeTokens.ts +1 -1
- package/src/tokens/types.ts +16 -7
- package/dist/Frame/Frame.d.ts.map +0 -1
- package/dist/Frame/Frame.styles.d.ts.map +0 -1
- package/dist/Frame/Frame.types.d.ts +0 -115
- package/dist/Frame/Frame.types.d.ts.map +0 -1
- package/dist/Frame/Frame.utils.d.ts.map +0 -1
- package/dist/Frame/index.d.ts.map +0 -1
- package/dist/Icon/Icon.d.ts +0 -36
- package/dist/Icon/Icon.d.ts.map +0 -1
- package/src/Frame/Frame.types.ts +0 -181
- package/src/Icon/Icon.tsx +0 -76
- /package/dist/{Frame → primitives/Frame}/index.d.ts +0 -0
- /package/src/{Frame → primitives/Frame}/index.ts +0 -0
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import type { View, ViewStyle } from 'react-native';
|
|
2
|
+
import type { Direction, Alignment, Justification, PaddingProp, GapProp, SizingMode } from '../Frame/Frame.types';
|
|
3
|
+
/**
|
|
4
|
+
* Props for Wrapper — a lightweight, invisible layout container.
|
|
5
|
+
*
|
|
6
|
+
* Same layout API as Frame (direction, spacing, alignment, sizing) but
|
|
7
|
+
* with zero appearance: no background, border, shadow, radius, theme
|
|
8
|
+
* context, or interactivity. Always renders a plain `<View>`.
|
|
9
|
+
*
|
|
10
|
+
* Use Wrapper for structural layout. Use Frame when you need visual
|
|
11
|
+
* appearance or theme/elevation context.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* // Horizontal row with spacing
|
|
16
|
+
* <Wrapper direction="horizontal" gap="md" align="center">
|
|
17
|
+
* <Button onPress={() => {}}>Save</Button>
|
|
18
|
+
* <Button variant="ghost" onPress={() => {}}>Cancel</Button>
|
|
19
|
+
* </Wrapper>
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```tsx
|
|
24
|
+
* // Padded vertical stack
|
|
25
|
+
* <Wrapper padding={{ x: 'lg', y: 'md' }} gap="sm">
|
|
26
|
+
* <Text>First item</Text>
|
|
27
|
+
* <Text>Second item</Text>
|
|
28
|
+
* </Wrapper>
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```tsx
|
|
33
|
+
* // Full-width centered container
|
|
34
|
+
* <Wrapper width="fill" align="center" justify="center">
|
|
35
|
+
* <Text>Centered content</Text>
|
|
36
|
+
* </Wrapper>
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
export interface WrapperProps {
|
|
40
|
+
/**
|
|
41
|
+
* Child elements. Must be React Native elements (View, Text, etc.).
|
|
42
|
+
* Unlike Frame, raw strings are NOT auto-wrapped in `<Text>`.
|
|
43
|
+
*/
|
|
44
|
+
readonly children?: React.ReactNode;
|
|
45
|
+
/** Flex direction. @default 'vertical' */
|
|
46
|
+
readonly direction?: Direction;
|
|
47
|
+
/** Enable flex wrap. @default false */
|
|
48
|
+
readonly wrap?: boolean;
|
|
49
|
+
/** Reverse flex direction. @default false */
|
|
50
|
+
readonly reverse?: boolean;
|
|
51
|
+
/** Cross-axis alignment of children. */
|
|
52
|
+
readonly align?: Alignment;
|
|
53
|
+
/** Main-axis justification of children. */
|
|
54
|
+
readonly justify?: Justification;
|
|
55
|
+
/**
|
|
56
|
+
* Padding inside the wrapper.
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```tsx
|
|
60
|
+
* <Wrapper padding="md" /> // uniform token
|
|
61
|
+
* <Wrapper padding={16} /> // uniform px
|
|
62
|
+
* <Wrapper padding={{ x: 'lg', y: 'sm' }} /> // axis shorthand
|
|
63
|
+
* <Wrapper padding={{ top: 8, bottom: 16 }} /> // per-side
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
66
|
+
readonly padding?: PaddingProp;
|
|
67
|
+
/**
|
|
68
|
+
* Gap between children.
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* ```tsx
|
|
72
|
+
* <Wrapper gap="md" /> // uniform token
|
|
73
|
+
* <Wrapper gap={12} /> // uniform px
|
|
74
|
+
* <Wrapper gap={{ row: 'sm', column: 'lg' }} /> // per-axis
|
|
75
|
+
* ```
|
|
76
|
+
*/
|
|
77
|
+
readonly gap?: GapProp;
|
|
78
|
+
/**
|
|
79
|
+
* Width sizing: `'hug'` (shrink to content), `'fill'` (expand), or fixed px.
|
|
80
|
+
* @example
|
|
81
|
+
* ```tsx
|
|
82
|
+
* <Wrapper width="fill" /> // expand to fill parent
|
|
83
|
+
* <Wrapper width={300} /> // fixed 300px
|
|
84
|
+
* ```
|
|
85
|
+
*/
|
|
86
|
+
readonly width?: SizingMode;
|
|
87
|
+
/**
|
|
88
|
+
* Height sizing: `'hug'` (shrink to content), `'fill'` (expand), or fixed px.
|
|
89
|
+
* @example
|
|
90
|
+
* ```tsx
|
|
91
|
+
* <Wrapper height="fill" /> // expand to fill parent
|
|
92
|
+
* <Wrapper height={200} /> // fixed 200px
|
|
93
|
+
* ```
|
|
94
|
+
*/
|
|
95
|
+
readonly height?: SizingMode;
|
|
96
|
+
/** Minimum width in pixels. */
|
|
97
|
+
readonly minWidth?: number;
|
|
98
|
+
/** Maximum width in pixels. */
|
|
99
|
+
readonly maxWidth?: number;
|
|
100
|
+
/** Minimum height in pixels. */
|
|
101
|
+
readonly minHeight?: number;
|
|
102
|
+
/** Maximum height in pixels. */
|
|
103
|
+
readonly maxHeight?: number;
|
|
104
|
+
/** Test identifier — maps to `data-testid` on web. Used by testing libraries. */
|
|
105
|
+
readonly testID?: string;
|
|
106
|
+
/** DOM id — maps to `id` attribute on web. Used for anchors and scroll targets. */
|
|
107
|
+
readonly nativeID?: string;
|
|
108
|
+
/** Ref to the underlying View element. */
|
|
109
|
+
readonly ref?: React.Ref<View>;
|
|
110
|
+
/** Custom style overrides (applied last). */
|
|
111
|
+
readonly style?: ViewStyle | ViewStyle[];
|
|
112
|
+
}
|
|
113
|
+
//# sourceMappingURL=Wrapper.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Wrapper.types.d.ts","sourceRoot":"","sources":["../../../src/primitives/Wrapper/Wrapper.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,KAAK,EACV,SAAS,EACT,SAAS,EACT,aAAa,EACb,WAAW,EACX,OAAO,EACP,UAAU,EACX,MAAM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,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAI/B,6CAA6C;IAC7C,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,GAAG,SAAS,EAAE,CAAC;CAC1C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/primitives/Wrapper/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,YAAY,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { useFocusVisible } from './useFocusVisible';
|
|
2
|
+
export type { FocusVisibleResult } from './useFocusVisible';
|
|
3
|
+
export { Frame } from './Frame';
|
|
4
|
+
export type { FrameProps, SpacingToken, SpacingValue, SpacingSides, SpacingAxes, PaddingProp, GapAxes, GapProp, RadiusToken, RadiusValue, RadiusCorners, RadiusProp, SizingMode, LayoutMode, Direction, Alignment, Justification, } from './Frame';
|
|
5
|
+
export type { ResolvedCorners } from './Frame/Frame.utils';
|
|
6
|
+
export { Icon } from './Icon';
|
|
7
|
+
export type { IconProps } from './Icon';
|
|
8
|
+
export { Wrapper } from './Wrapper';
|
|
9
|
+
export type { WrapperProps } from './Wrapper';
|
|
10
|
+
export { Text } from './Text';
|
|
11
|
+
export type { TextProps, TextSize, TextWeight, TextColor, TextFont, TextLineHeight, TextAlign, } from './Text';
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/primitives/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,YAAY,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAG5D,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,YAAY,EACV,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,WAAW,EACX,OAAO,EACP,OAAO,EACP,WAAW,EACX,WAAW,EACX,aAAa,EACb,UAAU,EACV,UAAU,EACV,UAAU,EACV,SAAS,EACT,SAAS,EACT,aAAa,GACd,MAAM,SAAS,CAAC;AACjB,YAAY,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAG3D,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,YAAY,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAGxC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAG9C,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,YAAY,EACV,SAAS,EACT,QAAQ,EACR,UAAU,EACV,SAAS,EACT,QAAQ,EACR,cAAc,EACd,SAAS,GACV,MAAM,QAAQ,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useFocusVisible — Keyboard-only focus detection hook.
|
|
3
|
+
*
|
|
4
|
+
* Tracks whether the user's last input was keyboard (Tab, arrows, etc.)
|
|
5
|
+
* or pointer (mouse, touch). When an element receives focus after a
|
|
6
|
+
* keyboard event, `isFocusVisible` is true — matching the browser's
|
|
7
|
+
* native `:focus-visible` pseudo-class behavior.
|
|
8
|
+
*
|
|
9
|
+
* This is the same approach used by the `:focus-visible` polyfill.
|
|
10
|
+
* On native platforms, the document listeners are skipped (guarded by
|
|
11
|
+
* `typeof document`), and the hook returns false for `isFocusVisible`.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* const { isFocusVisible, focusProps } = useFocusVisible();
|
|
16
|
+
*
|
|
17
|
+
* <Pressable {...focusProps} style={isFocusVisible ? focusRingStyle : undefined}>
|
|
18
|
+
* <Text>Keyboard-focusable</Text>
|
|
19
|
+
* </Pressable>
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export interface FocusVisibleResult {
|
|
23
|
+
/** True when the element is focused AND focus was keyboard-initiated. */
|
|
24
|
+
readonly isFocusVisible: boolean;
|
|
25
|
+
/** Spread these onto the interactive element (web-only, ignored on native). */
|
|
26
|
+
readonly focusProps: Record<string, unknown>;
|
|
27
|
+
}
|
|
28
|
+
export declare function useFocusVisible(): FocusVisibleResult;
|
|
29
|
+
//# sourceMappingURL=useFocusVisible.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFocusVisible.d.ts","sourceRoot":"","sources":["../../src/primitives/useFocusVisible.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAiDH,MAAM,WAAW,kBAAkB;IACjC,yEAAyE;IACzE,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;IACjC,+EAA+E;IAC/E,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC9C;AAED,wBAAgB,eAAe,IAAI,kBAAkB,CAyBpD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../src/theme/defaults.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAclD;;;GAGG;AACH,eAAO,MAAM,oBAAoB,EAAE,
|
|
1
|
+
{"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../src/theme/defaults.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAclD;;;GAGG;AACH,eAAO,MAAM,oBAAoB,EAAE,kBAiFlC,CAAC"}
|
package/dist/theme/types.d.ts
CHANGED
|
@@ -58,12 +58,19 @@ export interface NewtoneThemeConfig {
|
|
|
58
58
|
readonly offsets: readonly [number, number, number];
|
|
59
59
|
};
|
|
60
60
|
readonly spacing: {
|
|
61
|
-
readonly
|
|
62
|
-
readonly
|
|
63
|
-
readonly
|
|
64
|
-
readonly
|
|
65
|
-
readonly
|
|
66
|
-
readonly
|
|
61
|
+
readonly '00': number;
|
|
62
|
+
readonly '02': number;
|
|
63
|
+
readonly '04': number;
|
|
64
|
+
readonly '06': number;
|
|
65
|
+
readonly '08': number;
|
|
66
|
+
readonly '10': number;
|
|
67
|
+
readonly '12': number;
|
|
68
|
+
readonly '16': number;
|
|
69
|
+
readonly '20': number;
|
|
70
|
+
readonly '24': number;
|
|
71
|
+
readonly '32': number;
|
|
72
|
+
readonly '40': number;
|
|
73
|
+
readonly '48': number;
|
|
67
74
|
};
|
|
68
75
|
readonly radius: {
|
|
69
76
|
readonly none: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/theme/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE3D;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC;AAEzC;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;IAC9C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,CAAC;AAEvE;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAEvC;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC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ColorMode, themeMapping: ThemeMapping, elevation: ElevationLevel, elevationOffsets: readonly [number, number, number], spacing: {
|
|
38
|
-
readonly
|
|
39
|
-
readonly
|
|
40
|
-
readonly
|
|
41
|
-
readonly
|
|
42
|
-
readonly
|
|
43
|
-
readonly
|
|
38
|
+
readonly '00': number;
|
|
39
|
+
readonly '02': number;
|
|
40
|
+
readonly '04': number;
|
|
41
|
+
readonly '06': number;
|
|
42
|
+
readonly '08': number;
|
|
43
|
+
readonly '10': number;
|
|
44
|
+
readonly '12': number;
|
|
45
|
+
readonly '16': number;
|
|
46
|
+
readonly '20': number;
|
|
47
|
+
readonly '24': number;
|
|
48
|
+
readonly '32': number;
|
|
49
|
+
readonly '40': number;
|
|
50
|
+
readonly '48': number;
|
|
44
51
|
}, radius: {
|
|
45
52
|
readonly none: number;
|
|
46
53
|
readonly sm: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"computeTokens.d.ts","sourceRoot":"","sources":["../../src/tokens/computeTokens.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAE,YAAY,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC7G,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAU9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,iBAAiB,EACzB,IAAI,EAAE,SAAS,EACf,YAAY,EAAE,YAAY,EAC1B,SAAS,EAAE,cAAc,EACzB,gBAAgB,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EACnD,OAAO,EAAE;IAAE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAA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C,MAAM,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;IACzD,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;CAC7B,GACA,cAAc,CA+MhB"}
|
package/dist/tokens/types.d.ts
CHANGED
|
@@ -27,14 +27,23 @@ export interface ResolvedTokens {
|
|
|
27
27
|
readonly warning: ColorResult;
|
|
28
28
|
/** Error/destructive state color (from error palette, index 4) */
|
|
29
29
|
readonly error: ColorResult;
|
|
30
|
-
/** Spacing tokens for paddings, gaps, and margins
|
|
30
|
+
/** Spacing tokens for paddings, gaps, and margins.
|
|
31
|
+
* Token names represent pixel values at Medium (8px) spacing preset.
|
|
32
|
+
* Actual values scale based on the selected spacing preset. */
|
|
31
33
|
readonly spacing: {
|
|
32
|
-
readonly
|
|
33
|
-
readonly
|
|
34
|
-
readonly
|
|
35
|
-
readonly
|
|
36
|
-
readonly
|
|
37
|
-
readonly
|
|
34
|
+
readonly '00': number;
|
|
35
|
+
readonly '02': number;
|
|
36
|
+
readonly '04': number;
|
|
37
|
+
readonly '06': number;
|
|
38
|
+
readonly '08': number;
|
|
39
|
+
readonly '10': number;
|
|
40
|
+
readonly '12': number;
|
|
41
|
+
readonly '16': number;
|
|
42
|
+
readonly '20': number;
|
|
43
|
+
readonly '24': number;
|
|
44
|
+
readonly '32': number;
|
|
45
|
+
readonly '40': number;
|
|
46
|
+
readonly '48': number;
|
|
38
47
|
};
|
|
39
48
|
/** Border radius tokens for component roundness */
|
|
40
49
|
readonly radius: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/tokens/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,+CAA+C;IAC/C,QAAQ,CAAC,UAAU,EAAE,WAAW,CAAC;IACj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AE,CAAC,EAAE,GAAG,CAAC,GAAG,GAAG,CAAC;KAC/B,CAAC;CACH"}
|
package/package.json
CHANGED
|
@@ -9,27 +9,27 @@ import type { ButtonVariant, ButtonSize } from './Button.types';
|
|
|
9
9
|
function getSizeConfig(tokens: ResolvedTokens) {
|
|
10
10
|
return {
|
|
11
11
|
sm: {
|
|
12
|
-
paddingVertical: tokens.spacing
|
|
13
|
-
paddingHorizontal: tokens.spacing
|
|
12
|
+
paddingVertical: tokens.spacing['04'],
|
|
13
|
+
paddingHorizontal: tokens.spacing['12'],
|
|
14
14
|
fontSize: tokens.typography.size.sm,
|
|
15
15
|
borderRadius: tokens.radius.sm,
|
|
16
|
-
gap: tokens.spacing
|
|
16
|
+
gap: tokens.spacing['04'],
|
|
17
17
|
iconSize: tokens.typography.size.sm,
|
|
18
18
|
},
|
|
19
19
|
md: {
|
|
20
|
-
paddingVertical: tokens.spacing
|
|
21
|
-
paddingHorizontal: tokens.spacing
|
|
20
|
+
paddingVertical: tokens.spacing['08'],
|
|
21
|
+
paddingHorizontal: tokens.spacing['16'],
|
|
22
22
|
fontSize: tokens.typography.size.base,
|
|
23
23
|
borderRadius: tokens.radius.md,
|
|
24
|
-
gap: tokens.spacing
|
|
24
|
+
gap: tokens.spacing['08'],
|
|
25
25
|
iconSize: tokens.typography.size.base,
|
|
26
26
|
},
|
|
27
27
|
lg: {
|
|
28
|
-
paddingVertical: tokens.spacing
|
|
29
|
-
paddingHorizontal: tokens.spacing
|
|
28
|
+
paddingVertical: tokens.spacing['12'],
|
|
29
|
+
paddingHorizontal: tokens.spacing['24'],
|
|
30
30
|
fontSize: tokens.typography.size.base,
|
|
31
31
|
borderRadius: tokens.radius.lg,
|
|
32
|
-
gap: tokens.spacing
|
|
32
|
+
gap: tokens.spacing['08'],
|
|
33
33
|
iconSize: tokens.typography.size.base,
|
|
34
34
|
},
|
|
35
35
|
};
|
package/src/Button/Button.tsx
CHANGED
|
@@ -3,7 +3,7 @@ import { Pressable, Text } from 'react-native';
|
|
|
3
3
|
import type { ButtonProps } from './Button.types';
|
|
4
4
|
import { useTokens } from '../tokens/useTokens';
|
|
5
5
|
import { getButtonStyles } from './Button.styles';
|
|
6
|
-
import { Icon } from '../Icon/Icon';
|
|
6
|
+
import { Icon } from '../primitives/Icon/Icon';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Button component with support for multiple variants, sizes, and optional icons.
|
package/src/Card/Card.styles.ts
CHANGED
|
@@ -9,7 +9,7 @@ export function getCardStyles(tokens: ResolvedTokens, disabled: boolean) {
|
|
|
9
9
|
borderWidth: 1,
|
|
10
10
|
borderColor: srgbToHex(tokens.border.srgb),
|
|
11
11
|
borderRadius: tokens.radius.lg,
|
|
12
|
-
padding: tokens.spacing
|
|
12
|
+
padding: tokens.spacing['16'],
|
|
13
13
|
opacity: disabled ? 0.5 : 1,
|
|
14
14
|
},
|
|
15
15
|
});
|
|
@@ -8,7 +8,7 @@ export const THUMB_SIZE = 18;
|
|
|
8
8
|
export function getColorScaleSliderStyles(tokens: ResolvedTokens, disabled: boolean) {
|
|
9
9
|
return StyleSheet.create({
|
|
10
10
|
container: {
|
|
11
|
-
gap: tokens.spacing
|
|
11
|
+
gap: tokens.spacing['04'],
|
|
12
12
|
opacity: disabled ? 0.5 : 1,
|
|
13
13
|
},
|
|
14
14
|
labelRow: {
|
|
@@ -32,7 +32,7 @@ export function buildHueSegments(min: number, max: number): string[] {
|
|
|
32
32
|
export function getHueSliderStyles(tokens: ResolvedTokens, disabled: boolean) {
|
|
33
33
|
return StyleSheet.create({
|
|
34
34
|
container: {
|
|
35
|
-
gap: tokens.spacing
|
|
35
|
+
gap: tokens.spacing['04'],
|
|
36
36
|
opacity: disabled ? 0.5 : 1,
|
|
37
37
|
},
|
|
38
38
|
labelRow: {
|
|
@@ -33,7 +33,11 @@ export function getPopoverStyles(
|
|
|
33
33
|
maxHeight,
|
|
34
34
|
zIndex: 1000,
|
|
35
35
|
overflow: 'hidden',
|
|
36
|
-
|
|
36
|
+
shadowColor: '#000',
|
|
37
|
+
shadowOffset: { width: 0, height: 4 },
|
|
38
|
+
shadowOpacity: 0.15,
|
|
39
|
+
shadowRadius: 12,
|
|
40
|
+
elevation: 8,
|
|
37
41
|
},
|
|
38
42
|
});
|
|
39
43
|
}
|
package/src/Popover/Popover.tsx
CHANGED
|
@@ -42,9 +42,11 @@ export function Popover({
|
|
|
42
42
|
};
|
|
43
43
|
}, [isOpen, onClose]);
|
|
44
44
|
|
|
45
|
-
// Click-outside: capture phase so RNW Pressable can't swallow the event
|
|
45
|
+
// Click-outside: capture phase so RNW Pressable can't swallow the event.
|
|
46
|
+
// Web-only: on native, document is undefined (click-outside needs a portal/Modal rearchitecture).
|
|
46
47
|
useEffect(() => {
|
|
47
48
|
if (!isOpen) return;
|
|
49
|
+
if (typeof document === 'undefined') return;
|
|
48
50
|
const handleMouseDown = (e: MouseEvent) => {
|
|
49
51
|
const node = containerRef.current as unknown as HTMLElement;
|
|
50
52
|
if (node && !node.contains(e.target as Node)) {
|
|
@@ -11,13 +11,13 @@ export function getSelectStyles(
|
|
|
11
11
|
const isSm = size === 'sm';
|
|
12
12
|
const fontSize = isSm ? tokens.typography.size.sm : tokens.typography.size.base;
|
|
13
13
|
const iconSize = fontSize + 2;
|
|
14
|
-
const iconSpace = iconSize + tokens.spacing
|
|
15
|
-
const paddingVertical = isSm ? tokens.spacing
|
|
16
|
-
const paddingHorizontal = isSm ? tokens.spacing
|
|
14
|
+
const iconSpace = iconSize + tokens.spacing['08'];
|
|
15
|
+
const paddingVertical = isSm ? tokens.spacing['04'] : tokens.spacing['08'];
|
|
16
|
+
const paddingHorizontal = isSm ? tokens.spacing['08'] : tokens.spacing['12'];
|
|
17
17
|
|
|
18
18
|
return StyleSheet.create({
|
|
19
19
|
container: {
|
|
20
|
-
gap: tokens.spacing
|
|
20
|
+
gap: tokens.spacing['04'],
|
|
21
21
|
zIndex: isOpen ? 999 : 0,
|
|
22
22
|
},
|
|
23
23
|
label: {
|
|
@@ -35,7 +35,7 @@ export function getSelectStyles(
|
|
|
35
35
|
borderRadius: tokens.radius.md,
|
|
36
36
|
paddingVertical,
|
|
37
37
|
paddingLeft: paddingHorizontal,
|
|
38
|
-
paddingRight: iconSpace + (isSm ? tokens.spacing
|
|
38
|
+
paddingRight: iconSpace + (isSm ? tokens.spacing['04'] : tokens.spacing['08']),
|
|
39
39
|
opacity: disabled ? 0.5 : 1,
|
|
40
40
|
},
|
|
41
41
|
triggerText: {
|
|
@@ -48,7 +48,7 @@ export function getSelectStyles(
|
|
|
48
48
|
},
|
|
49
49
|
iconWrapper: {
|
|
50
50
|
position: 'absolute',
|
|
51
|
-
right: isSm ? tokens.spacing
|
|
51
|
+
right: isSm ? tokens.spacing['04'] : tokens.spacing['08'],
|
|
52
52
|
top: 0,
|
|
53
53
|
bottom: 0,
|
|
54
54
|
justifyContent: 'center',
|
|
@@ -60,9 +60,9 @@ export function getSelectStyles(
|
|
|
60
60
|
color: srgbToHex(tokens.textSecondary.srgb),
|
|
61
61
|
textTransform: 'uppercase',
|
|
62
62
|
letterSpacing: 0.5,
|
|
63
|
-
paddingVertical: tokens.spacing
|
|
64
|
-
paddingHorizontal: isSm ? tokens.spacing
|
|
65
|
-
paddingTop: tokens.spacing
|
|
63
|
+
paddingVertical: tokens.spacing['04'],
|
|
64
|
+
paddingHorizontal: isSm ? tokens.spacing['08'] : tokens.spacing['12'],
|
|
65
|
+
paddingTop: tokens.spacing['08'],
|
|
66
66
|
},
|
|
67
67
|
});
|
|
68
68
|
}
|
package/src/Select/Select.tsx
CHANGED
|
@@ -4,7 +4,7 @@ import type { SelectProps, SelectOption } from './Select.types';
|
|
|
4
4
|
import { isOptionGroup } from './Select.types';
|
|
5
5
|
import { useTokens } from '../tokens/useTokens';
|
|
6
6
|
import { getSelectStyles } from './Select.styles';
|
|
7
|
-
import { Icon } from '../Icon/Icon';
|
|
7
|
+
import { Icon } from '../primitives/Icon/Icon';
|
|
8
8
|
import { Popover } from '../Popover/Popover';
|
|
9
9
|
import { usePopover } from '../Popover/usePopover';
|
|
10
10
|
import { useSelect } from './useSelect';
|
|
@@ -72,8 +72,7 @@ export function Select({
|
|
|
72
72
|
onPress={disabled ? undefined : toggle}
|
|
73
73
|
disabled={disabled}
|
|
74
74
|
role="combobox"
|
|
75
|
-
|
|
76
|
-
aria-haspopup={'listbox' as any}
|
|
75
|
+
accessibilityState={{ expanded: isOpen }}
|
|
77
76
|
{...triggerWebProps}
|
|
78
77
|
style={styles.trigger}
|
|
79
78
|
>
|
|
@@ -2,7 +2,7 @@ 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
4
|
import { useTokens } from '../tokens/useTokens';
|
|
5
|
-
import { Icon } from '../Icon/Icon';
|
|
5
|
+
import { Icon } from '../primitives/Icon/Icon';
|
|
6
6
|
import { srgbToHex } from 'newtone';
|
|
7
7
|
|
|
8
8
|
interface SelectOptionRowProps {
|
|
@@ -24,8 +24,8 @@ export function SelectOptionRow({
|
|
|
24
24
|
}: SelectOptionRowProps) {
|
|
25
25
|
const tokens = useTokens(1);
|
|
26
26
|
|
|
27
|
-
const paddingVertical = size === 'sm' ? tokens.spacing
|
|
28
|
-
const paddingHorizontal = size === 'sm' ? tokens.spacing
|
|
27
|
+
const paddingVertical = size === 'sm' ? tokens.spacing['04'] : tokens.spacing['08'];
|
|
28
|
+
const paddingHorizontal = size === 'sm' ? tokens.spacing['08'] : tokens.spacing['12'];
|
|
29
29
|
const fontSize = size === 'sm' ? tokens.typography.size.sm : tokens.typography.size.base;
|
|
30
30
|
|
|
31
31
|
if (renderOption) {
|
|
@@ -34,7 +34,7 @@ export function SelectOptionRow({
|
|
|
34
34
|
onPress={option.disabled ? undefined : onSelect}
|
|
35
35
|
disabled={option.disabled}
|
|
36
36
|
role="option"
|
|
37
|
-
|
|
37
|
+
accessibilityState={{ selected: isSelected }}
|
|
38
38
|
>
|
|
39
39
|
{renderOption(option, { isSelected, isFocused })}
|
|
40
40
|
</Pressable>
|
|
@@ -46,7 +46,7 @@ export function SelectOptionRow({
|
|
|
46
46
|
onPress={option.disabled ? undefined : onSelect}
|
|
47
47
|
disabled={option.disabled}
|
|
48
48
|
role="option"
|
|
49
|
-
|
|
49
|
+
accessibilityState={{ selected: isSelected }}
|
|
50
50
|
style={({ pressed }) => [
|
|
51
51
|
{
|
|
52
52
|
flexDirection: 'row' as const,
|
|
@@ -91,7 +91,7 @@ export function SelectOptionRow({
|
|
|
91
91
|
{option.label}
|
|
92
92
|
</Text>
|
|
93
93
|
{isSelected && (
|
|
94
|
-
<View style={{ marginLeft: tokens.spacing
|
|
94
|
+
<View style={{ marginLeft: tokens.spacing['08'] }}>
|
|
95
95
|
<Icon
|
|
96
96
|
name="check"
|
|
97
97
|
size={fontSize}
|
|
@@ -5,7 +5,7 @@ import type { ResolvedTokens } from '../tokens/types';
|
|
|
5
5
|
export function getTextInputStyles(tokens: ResolvedTokens, disabled: boolean) {
|
|
6
6
|
return StyleSheet.create({
|
|
7
7
|
container: {
|
|
8
|
-
gap: tokens.spacing
|
|
8
|
+
gap: tokens.spacing['04'],
|
|
9
9
|
},
|
|
10
10
|
label: {
|
|
11
11
|
fontFamily: tokens.typography.fonts.default,
|
|
@@ -19,8 +19,8 @@ export function getTextInputStyles(tokens: ResolvedTokens, disabled: boolean) {
|
|
|
19
19
|
borderWidth: 1,
|
|
20
20
|
borderColor: srgbToHex(tokens.border.srgb),
|
|
21
21
|
borderRadius: tokens.radius.md,
|
|
22
|
-
paddingVertical: tokens.spacing
|
|
23
|
-
paddingHorizontal: tokens.spacing
|
|
22
|
+
paddingVertical: tokens.spacing['08'],
|
|
23
|
+
paddingHorizontal: tokens.spacing['12'],
|
|
24
24
|
fontSize: tokens.typography.size.base,
|
|
25
25
|
color: disabled
|
|
26
26
|
? srgbToHex(tokens.textSecondary.srgb)
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { StyleSheet } from 'react-native';
|
|
2
|
+
import { srgbToHex } from 'newtone';
|
|
3
|
+
import type { ResolvedTokens } from '../tokens/types';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Pure style computation function.
|
|
7
|
+
*
|
|
8
|
+
* Rules:
|
|
9
|
+
* - Always use StyleSheet.create() — never plain JS objects
|
|
10
|
+
* - Colors from tokens only — never hardcoded hex (except shadows: '#000')
|
|
11
|
+
* - Shadows via RN properties (shadowColor, shadowOffset, shadowOpacity, shadowRadius, elevation)
|
|
12
|
+
* NEVER use boxShadow as a CSS string
|
|
13
|
+
* - For web-only CSS (boxShadow, gridTemplateColumns, etc.):
|
|
14
|
+
* return as a separate property and apply via web overrides pattern (see Frame.styles.ts)
|
|
15
|
+
* - Every section must have a plain-language inline comment explaining what
|
|
16
|
+
* the style achieves visually, not just the CSS property name
|
|
17
|
+
*/
|
|
18
|
+
export function getComponentNameStyles(tokens: ResolvedTokens) {
|
|
19
|
+
return StyleSheet.create({
|
|
20
|
+
container: {
|
|
21
|
+
// Surface color from the current theme.
|
|
22
|
+
backgroundColor: srgbToHex(tokens.background.srgb),
|
|
23
|
+
// Rounded corners using the theme's medium radius.
|
|
24
|
+
borderRadius: tokens.radius.md,
|
|
25
|
+
// Inner spacing using the theme's medium spacing value.
|
|
26
|
+
padding: tokens.spacing['12'],
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
}
|