@situaction/traquiste-mobile 1.0.0-next.3 → 1.0.0-next.5

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/package.json CHANGED
@@ -1,15 +1,11 @@
1
1
  {
2
2
  "name": "@situaction/traquiste-mobile",
3
- "version": "1.0.0-next.3",
3
+ "version": "1.0.0-next.5",
4
4
  "description": "React Native UI component library for Traquiste",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
7
7
  "files": [
8
- "build",
9
- "src",
10
- "!build/**/*.stories.*",
11
- "!src/**/*.stories.*",
12
- "!src/**/__tests__"
8
+ "build"
13
9
  ],
14
10
  "scripts": {
15
11
  "build": "expo-module build",
File without changes
@@ -1,128 +0,0 @@
1
- /**
2
- * Button component for Traq[UI]ste Mobile.
3
- * Supports four variants, four sizes and three content layouts.
4
- */
5
- import React, { useState } from 'react';
6
- import { Pressable, Text } from 'react-native';
7
- import type { StyleProp, ViewStyle } from 'react-native';
8
- import { useTheme } from '../../context/ThemeContext';
9
-
10
- export type ButtonVariant = 'primary' | 'tertiary' | 'ghost' | 'destructive';
11
- export type ButtonSize = 'S' | 'M' | 'L' | 'XL';
12
- export type ButtonContent = 'icon-only' | 'icon-only-rounded' | 'icon-both';
13
-
14
- export interface ButtonProps {
15
- /** Button visual variant */
16
- variant?: ButtonVariant;
17
- /** Button size */
18
- size?: ButtonSize;
19
- /** Content layout */
20
- content?: ButtonContent;
21
- /** Label text — required when content is 'icon-both' */
22
- label?: string;
23
- /** Left icon component (Phosphor icon) */
24
- iconLeft?: React.ReactElement;
25
- /** Right icon component (Phosphor icon) */
26
- iconRight?: React.ReactElement;
27
- /** Disabled state */
28
- disabled?: boolean;
29
- /** Press handler */
30
- onPress?: () => void;
31
- /** Additional container styles */
32
- style?: StyleProp<ViewStyle>;
33
- }
34
-
35
- // --- Size tokens (static, theme-independent) ---
36
-
37
- const SIZE_TOKENS = {
38
- S: { height: 36, paddingVertical: 10, paddingHorizontal: 10, gap: 8, borderRadius: 8, iconSize: 16, fontSize: 12, lineHeight: 16 },
39
- M: { height: 40, paddingVertical: 10, paddingHorizontal: 16, gap: 4, borderRadius: 8, iconSize: 18, fontSize: 14, lineHeight: 20 },
40
- L: { height: 48, paddingVertical: 12, paddingHorizontal: 12, gap: 10, borderRadius: 8, iconSize: 20, fontSize: 16, lineHeight: 24 },
41
- XL: { height: 60, paddingVertical: 16, paddingHorizontal: 32, gap: 12, borderRadius: 8, iconSize: 24, fontSize: 18, lineHeight: 26 },
42
- } as const;
43
-
44
- // --- Component ---
45
-
46
- export function Button({
47
- variant = 'primary',
48
- size = 'M',
49
- content = 'icon-both',
50
- label,
51
- iconLeft,
52
- iconRight,
53
- disabled = false,
54
- onPress,
55
- style,
56
- }: ButtonProps) {
57
- const [pressed, setPressed] = useState(false);
58
- const { colors } = useTheme();
59
-
60
- const sizeTokens = SIZE_TOKENS[size];
61
- const state = disabled ? 'disabled' : pressed ? 'pressed' : 'default';
62
- const colorTokens = colors.button[variant][state];
63
-
64
- const isIconOnly = content === 'icon-only' || content === 'icon-only-rounded';
65
- const borderRadius = content === 'icon-only-rounded' ? 9999 : sizeTokens.borderRadius;
66
- const hasBorder = colorTokens.border !== 'transparent';
67
-
68
- const containerStyle: ViewStyle = {
69
- height: sizeTokens.height,
70
- paddingVertical: isIconOnly ? undefined : sizeTokens.paddingVertical,
71
- paddingHorizontal: isIconOnly ? undefined : sizeTokens.paddingHorizontal,
72
- width: isIconOnly ? sizeTokens.height : undefined,
73
- borderRadius,
74
- gap: sizeTokens.gap,
75
- backgroundColor: colorTokens.background,
76
- borderWidth: hasBorder ? 1 : undefined,
77
- borderColor: hasBorder ? colorTokens.border : undefined,
78
- alignItems: 'center',
79
- justifyContent: 'center',
80
- flexDirection: 'row',
81
- };
82
-
83
- const textStyle = {
84
- color: colorTokens.text,
85
- fontSize: sizeTokens.fontSize,
86
- lineHeight: sizeTokens.lineHeight,
87
- fontFamily: 'Urbanist',
88
- fontWeight: '500' as const,
89
- };
90
-
91
- // Clone icon elements to inject size and color from active theme state
92
- const cloneIcon = (icon: React.ReactElement | undefined) => {
93
- if (!icon) return null;
94
- return React.cloneElement(icon, {
95
- size: sizeTokens.iconSize,
96
- color: colorTokens.icon,
97
- ...(icon.props as Record<string, unknown>),
98
- } as object);
99
- };
100
-
101
- if (isIconOnly) {
102
- return (
103
- <Pressable
104
- pointerEvents={disabled ? 'none' : 'auto'}
105
- onPressIn={() => setPressed(true)}
106
- onPressOut={() => setPressed(false)}
107
- onPress={disabled ? undefined : onPress}
108
- style={[containerStyle, style]}
109
- >
110
- {cloneIcon(iconLeft)}
111
- </Pressable>
112
- );
113
- }
114
-
115
- return (
116
- <Pressable
117
- pointerEvents={disabled ? 'none' : 'auto'}
118
- onPressIn={() => setPressed(true)}
119
- onPressOut={() => setPressed(false)}
120
- onPress={disabled ? undefined : onPress}
121
- style={[containerStyle, style]}
122
- >
123
- {cloneIcon(iconLeft)}
124
- {label != null && <Text style={textStyle}>{label}</Text>}
125
- {cloneIcon(iconRight)}
126
- </Pressable>
127
- );
128
- }
@@ -1,2 +0,0 @@
1
- export { Button } from './Button';
2
- export type { ButtonProps, ButtonVariant, ButtonSize, ButtonContent } from './Button';
@@ -1,67 +0,0 @@
1
- /**
2
- * ButtonAction component — bare icon-only pressable with no background or border.
3
- * Extends Button size range with XS and XXL sizes.
4
- */
5
- import React from 'react';
6
- import { Pressable } from 'react-native';
7
- import type { StyleProp, ViewStyle } from 'react-native';
8
- import { useTheme } from '../../context/ThemeContext';
9
-
10
- export type ButtonActionSize = 'XS' | 'S' | 'M' | 'L' | 'XL' | 'XXL';
11
-
12
- export interface ButtonActionProps {
13
- /** Icon component (Phosphor Duotone) */
14
- icon: React.ReactElement;
15
- /** Icon size */
16
- size?: ButtonActionSize;
17
- /** Disabled state */
18
- disabled?: boolean;
19
- /** Press handler */
20
- onPress?: () => void;
21
- /** Additional container styles */
22
- style?: StyleProp<ViewStyle>;
23
- }
24
-
25
- const ICON_SIZE: Record<ButtonActionSize, number> = {
26
- XS: 12,
27
- S: 16,
28
- M: 20,
29
- L: 24,
30
- XL: 28,
31
- XXL: 32,
32
- };
33
-
34
- export function ButtonAction({
35
- icon,
36
- size = 'M',
37
- disabled = false,
38
- onPress,
39
- style,
40
- }: ButtonActionProps) {
41
- const { colors } = useTheme();
42
- const iconPx = ICON_SIZE[size];
43
-
44
- const containerStyle: ViewStyle = {
45
- width: iconPx,
46
- height: iconPx,
47
- opacity: disabled ? 0.5 : 1,
48
- alignItems: 'center',
49
- justifyContent: 'center',
50
- };
51
-
52
- const clonedIcon = React.cloneElement(icon, {
53
- size: iconPx,
54
- color: colors.text.primary,
55
- ...(icon.props as Record<string, unknown>),
56
- } as object);
57
-
58
- return (
59
- <Pressable
60
- pointerEvents={disabled ? 'none' : 'auto'}
61
- onPress={disabled ? undefined : onPress}
62
- style={[containerStyle, style]}
63
- >
64
- {clonedIcon}
65
- </Pressable>
66
- );
67
- }
@@ -1,2 +0,0 @@
1
- export { ButtonAction } from './ButtonAction';
2
- export type { ButtonActionProps, ButtonActionSize } from './ButtonAction';
@@ -1,40 +0,0 @@
1
- /**
2
- * ButtonMap component — icon-only-rounded Button wrapper for map UI.
3
- * Applies a specific cartography shadow (Below/Minimal).
4
- */
5
- import React from 'react';
6
- import type { StyleProp, ViewStyle } from 'react-native';
7
- import { Button } from '../Button';
8
-
9
- export interface ButtonMapProps {
10
- /** Icon component (Phosphor Duotone) */
11
- icon: React.ReactElement;
12
- /** Disabled state */
13
- disabled?: boolean;
14
- /** Press handler */
15
- onPress?: () => void;
16
- /** Additional container styles */
17
- style?: StyleProp<ViewStyle>;
18
- }
19
-
20
- const shadowStyle: ViewStyle = {
21
- shadowColor: '#0f0f0f0d',
22
- shadowOffset: { width: 0, height: 4 },
23
- shadowRadius: 5,
24
- shadowOpacity: 1,
25
- elevation: 3,
26
- };
27
-
28
- export function ButtonMap({ icon, disabled, onPress, style }: ButtonMapProps) {
29
- return (
30
- <Button
31
- variant="tertiary"
32
- content="icon-only-rounded"
33
- size="S"
34
- iconLeft={icon}
35
- disabled={disabled}
36
- onPress={onPress}
37
- style={[shadowStyle, style]}
38
- />
39
- );
40
- }
@@ -1,2 +0,0 @@
1
- export { ButtonMap } from './ButtonMap';
2
- export type { ButtonMapProps } from './ButtonMap';
@@ -1,97 +0,0 @@
1
- /**
2
- * ButtonMenu component — icon-only toggle button for navigation/menu bars.
3
- * Supports default, active and disabled states with an optional notification dot.
4
- */
5
- import React, {ReactElement, useState } from 'react';
6
- import { Pressable, View } from 'react-native';
7
- import type { StyleProp, ViewStyle } from 'react-native';
8
- import { useTheme } from '../../context/ThemeContext';
9
-
10
- export type ButtonMenuState = 'default' | 'active' | 'disabled';
11
-
12
- export interface ButtonMenuProps {
13
- /** Icon component (Phosphor Duotone icon) */
14
- icon: ReactElement;
15
- /** Toggle state */
16
- state?: ButtonMenuState;
17
- /** Show notification dot */
18
- notif?: boolean;
19
- /** Press handler */
20
- onPress?: () => void;
21
- /** Additional container styles */
22
- style?: StyleProp<ViewStyle>;
23
- }
24
-
25
- const BACKGROUND: Record<ButtonMenuState, string> = {
26
- default: 'transparent',
27
- active: '#d1c3a033',
28
- disabled: '#0f0f0f0d',
29
- };
30
-
31
- const BORDER_COLOR: Record<ButtonMenuState, string | undefined> = {
32
- default: undefined,
33
- active: '#afafad80',
34
- disabled: undefined,
35
- };
36
-
37
- const PRESSED_BACKGROUND = '#d1c3a066';
38
- const ICON_SIZE = 28;
39
- const NOTIF_DOT = 8;
40
-
41
- export function ButtonMenu({
42
- icon,
43
- state = 'default',
44
- notif = false,
45
- onPress,
46
- style,
47
- }: ButtonMenuProps) {
48
- const [pressed, setPressed] = useState(false);
49
- const { colors } = useTheme();
50
-
51
- const isDisabled = state === 'disabled';
52
- const background = pressed && !isDisabled ? PRESSED_BACKGROUND : BACKGROUND[state];
53
- const borderColor = BORDER_COLOR[state];
54
-
55
- const containerStyle: ViewStyle = {
56
- width: 48,
57
- height: 48,
58
- padding: 10,
59
- borderRadius: 8,
60
- backgroundColor: background,
61
- borderWidth: borderColor != null ? 1 : undefined,
62
- borderColor: borderColor ?? undefined,
63
- alignItems: 'center',
64
- justifyContent: 'center',
65
- };
66
-
67
- const clonedIcon = React.cloneElement(icon, {
68
- size: ICON_SIZE,
69
- color: isDisabled ? colors.text.disabled : undefined,
70
- ...(icon.props as Record<string, unknown>),
71
- } as object);
72
-
73
- return (
74
- <Pressable
75
- pointerEvents={isDisabled ? 'none' : 'auto'}
76
- onPressIn={() => setPressed(true)}
77
- onPressOut={() => setPressed(false)}
78
- onPress={isDisabled ? undefined : onPress}
79
- style={[containerStyle, style]}
80
- >
81
- {clonedIcon}
82
- {notif && (
83
- <View
84
- style={{
85
- position: 'absolute',
86
- top: 6,
87
- left: 34,
88
- width: NOTIF_DOT,
89
- height: NOTIF_DOT,
90
- borderRadius: 9999,
91
- backgroundColor: '#ff4747',
92
- }}
93
- />
94
- )}
95
- </Pressable>
96
- );
97
- }
@@ -1,2 +0,0 @@
1
- export { ButtonMenu } from './ButtonMenu';
2
- export type { ButtonMenuProps, ButtonMenuState } from './ButtonMenu';
@@ -1,124 +0,0 @@
1
- /**
2
- * FilterChip component — pill-shaped selection chip for filters.
3
- * Supports icon-only and icon+text layouts with controlled selection state.
4
- */
5
- import React, { useState } from 'react';
6
- import { Pressable, Text, View } from 'react-native';
7
- import type { StyleProp, ViewStyle } from 'react-native';
8
- import { useTheme } from '../../context/ThemeContext';
9
-
10
- export type FilterChipState = 'default' | 'pressed' | 'selected' | 'disabled';
11
- export type FilterChipType = 'icon' | 'icon-text';
12
-
13
- export interface FilterChipProps {
14
- /** Content layout */
15
- type?: FilterChipType;
16
- /** Controlled selection state */
17
- selected?: boolean;
18
- /** Disabled state */
19
- disabled?: boolean;
20
- /** Label text — required when type is icon-text */
21
- label?: string;
22
- /** Left icon (Phosphor Duotone) */
23
- iconLeft?: React.ReactElement;
24
- /** Right icon — typically a caret or close icon */
25
- iconRight?: React.ReactElement;
26
- /** Press handler */
27
- onPress?: () => void;
28
- /** Additional container styles */
29
- style?: StyleProp<ViewStyle>;
30
- }
31
-
32
- // --- State color tokens (hardcoded per spec) ---
33
-
34
- interface StateTokens {
35
- background: string;
36
- text: string;
37
- icon: string;
38
- borderColor: string;
39
- borderWidth: number;
40
- }
41
-
42
- const STATE_TOKENS: Record<FilterChipState, StateTokens> = {
43
- default: { background: 'transparent', text: '#28242e', icon: '#28242e', borderColor: '#afafad80', borderWidth: 1 },
44
- pressed: { background: '#d1c3a066', text: '#28242e', icon: '#28242e', borderColor: '#afafad80', borderWidth: 1 },
45
- selected: { background: 'transparent', text: '#28242e', icon: '#28242e', borderColor: '#28242e', borderWidth: 2 },
46
- disabled: { background: '#0f0f0f0d', text: '#0f0f0f99', icon: '#0f0f0f99', borderColor: '#0f0f0f1a', borderWidth: 1 },
47
- };
48
-
49
- const ICON_LEFT_SIZE = 20;
50
- const ICON_RIGHT_SIZE = 16;
51
-
52
- // --- Component ---
53
-
54
- export function FilterChip({
55
- type = 'icon-text',
56
- selected = false,
57
- disabled = false,
58
- label,
59
- iconLeft,
60
- iconRight,
61
- onPress,
62
- style,
63
- }: FilterChipProps) {
64
- const [internalPressed, setInternalPressed] = useState(false);
65
- useTheme(); // consumed for future theme-aware tokens
66
-
67
- const resolvedState: FilterChipState = disabled
68
- ? 'disabled'
69
- : internalPressed
70
- ? 'pressed'
71
- : selected
72
- ? 'selected'
73
- : 'default';
74
-
75
- const tokens = STATE_TOKENS[resolvedState];
76
- const isIconOnly = type === 'icon';
77
-
78
- const chipStyle: ViewStyle = {
79
- height: 32,
80
- borderRadius: 100,
81
- paddingVertical: 6,
82
- paddingHorizontal: isIconOnly ? 6 : 12,
83
- flexDirection: 'row',
84
- alignItems: 'center',
85
- gap: isIconOnly ? 0 : 4,
86
- backgroundColor: tokens.background,
87
- borderWidth: tokens.borderWidth,
88
- borderColor: tokens.borderColor,
89
- alignSelf: 'flex-start',
90
- };
91
-
92
- const textStyle = {
93
- color: tokens.text,
94
- fontSize: 14,
95
- lineHeight: 20,
96
- fontFamily: 'Urbanist',
97
- fontWeight: '500' as const,
98
- };
99
-
100
- const cloneIcon = (icon: React.ReactElement | undefined, size: number) => {
101
- if (!icon) return null;
102
- return React.cloneElement(icon, {
103
- size,
104
- color: tokens.icon,
105
- ...(icon.props as Record<string, unknown>),
106
- } as object);
107
- };
108
-
109
- return (
110
- <Pressable
111
- pointerEvents={disabled ? 'none' : 'auto'}
112
- onPressIn={() => setInternalPressed(true)}
113
- onPressOut={() => setInternalPressed(false)}
114
- onPress={disabled ? undefined : onPress}
115
- style={[{ paddingVertical: 6 }, style]}
116
- >
117
- <View style={chipStyle}>
118
- {cloneIcon(iconLeft, ICON_LEFT_SIZE)}
119
- {!isIconOnly && label != null && <Text style={textStyle}>{label}</Text>}
120
- {cloneIcon(iconRight, ICON_RIGHT_SIZE)}
121
- </View>
122
- </Pressable>
123
- );
124
- }
@@ -1,2 +0,0 @@
1
- export { FilterChip } from './FilterChip';
2
- export type { FilterChipProps, FilterChipState, FilterChipType } from './FilterChip';
@@ -1,2 +0,0 @@
1
- // Color design tokens — add tokens here as the design system grows
2
- export const colors = {} as const;
@@ -1,84 +0,0 @@
1
- /**
2
- * Theme system for Traq[UI]ste Mobile.
3
- * Provides ThemeProvider and useTheme hook.
4
- * Consumer apps inject their own light/dark tokens via ThemeProvider props.
5
- */
6
-
7
- import React, {
8
- createContext,
9
- useContext,
10
- useMemo,
11
- type ReactNode,
12
- } from 'react';
13
- import { useColorScheme } from 'react-native';
14
-
15
- import { lightTokens } from '../theme/tokens/light';
16
- import { darkTokens } from '../theme/tokens/dark';
17
- import type { ColorSchemeTokens } from '../theme/type';
18
-
19
- // ---------------------------------------------------------------------------
20
- // Context
21
- // ---------------------------------------------------------------------------
22
-
23
- interface ThemeContextValue {
24
- /** Resolved tokens for the active color scheme */
25
- colors: ColorSchemeTokens;
26
- /** Active color scheme */
27
- colorScheme: 'light' | 'dark';
28
- }
29
-
30
- const DEFAULT_VALUE: ThemeContextValue = {
31
- colors: lightTokens,
32
- colorScheme: 'light',
33
- };
34
-
35
- const ThemeContext = createContext<ThemeContextValue>(DEFAULT_VALUE);
36
-
37
- // ---------------------------------------------------------------------------
38
- // Provider
39
- // ---------------------------------------------------------------------------
40
-
41
- interface ThemeProviderProps {
42
- /** Light tokens — defaults to GDM light */
43
- light?: ColorSchemeTokens;
44
- /** Dark tokens — defaults to GDM dark */
45
- dark?: ColorSchemeTokens;
46
- /** Force a color scheme — defaults to system preference */
47
- colorScheme?: 'light' | 'dark';
48
- children: ReactNode;
49
- }
50
-
51
- export function ThemeProvider({
52
- light = lightTokens,
53
- dark = darkTokens,
54
- colorScheme: forcedScheme,
55
- children,
56
- }: ThemeProviderProps) {
57
- const systemScheme = useColorScheme();
58
- const colorScheme: 'light' | 'dark' =
59
- forcedScheme ?? (systemScheme === 'dark' ? 'dark' : 'light');
60
-
61
- const value = useMemo<ThemeContextValue>(
62
- () => ({
63
- colors: colorScheme === 'dark' ? dark : light,
64
- colorScheme,
65
- }),
66
- [light, dark, colorScheme],
67
- );
68
-
69
- return (
70
- <ThemeContext.Provider value={value}>{children}</ThemeContext.Provider>
71
- );
72
- }
73
-
74
- // ---------------------------------------------------------------------------
75
- // Hook
76
- // ---------------------------------------------------------------------------
77
-
78
- /**
79
- * Returns resolved color tokens for the active theme and color scheme.
80
- * Falls back to light tokens when used outside a ThemeProvider.
81
- */
82
- export function useTheme(): ThemeContextValue {
83
- return useContext(ThemeContext);
84
- }
package/src/index.ts DELETED
@@ -1,23 +0,0 @@
1
- // Public API — re-export all components, types, and utilities from this file
2
-
3
- // Theme
4
- export { ThemeProvider, useTheme } from './context/ThemeContext'
5
- export { lightTokens } from './theme/tokens/light'
6
- export { darkTokens } from './theme/tokens/dark'
7
- export type {
8
- ColorMode,
9
- ColorSchemeTokens,
10
- ColorTheme,
11
- BackgroundTokens,
12
- TextTokens,
13
- BorderTokens,
14
- ShadowTokens,
15
- StatusTokens,
16
- ButtonTokens,
17
- InteractiveVariantTokens,
18
- InteractiveStateTokens,
19
- } from './theme/type'
20
-
21
- // Components
22
- export { Button } from './components/Button'
23
- export type { ButtonProps, ButtonVariant, ButtonSize, ButtonContent } from './components/Button'
@@ -1,20 +0,0 @@
1
- // Provider + hook
2
- export { ThemeProvider, useTheme } from '../context/ThemeContext';
3
-
4
- // Base tokens (useful for consumer apps building their own theme)
5
- export { lightTokens } from './tokens/light';
6
- export { darkTokens } from './tokens/dark';
7
-
8
- // Types
9
- export type {
10
- ColorTheme,
11
- ColorSchemeTokens,
12
- BackgroundTokens,
13
- TextTokens,
14
- BorderTokens,
15
- ShadowTokens,
16
- StatusTokens,
17
- ButtonTokens,
18
- InteractiveVariantTokens,
19
- InteractiveStateTokens,
20
- } from './type';
@@ -1,160 +0,0 @@
1
- /**
2
- * Base dark tokens.
3
- * These are the default dark values — themes override what they need.
4
- * Tim: add new component tokens at the bottom when creating a new component.
5
- */
6
-
7
- import type { ColorSchemeTokens } from '../type';
8
-
9
- export const darkTokens: ColorSchemeTokens = {
10
- // -------------------------------------------------------------------------
11
- // Globals
12
- // -------------------------------------------------------------------------
13
-
14
- background: {
15
- primary: '#28242e',
16
- secondary: '#2f2b37',
17
- tertiary: '#3e3f4e',
18
- overlay: '#0f0f0f99',
19
- menu: '#2f2b37',
20
- },
21
-
22
- text: {
23
- primary: '#ffffff',
24
- secondary: '#d7d7e0',
25
- tertiary: '#8b8da5',
26
- disabled: '#ffffff4d',
27
- onColor: '#ffffff',
28
- },
29
-
30
- border: {
31
- default: '#ffffff33',
32
- strong: '#ffffff4d',
33
- disabled: '#ffffff1a',
34
- window: '#ffffff33',
35
- },
36
-
37
- shadow: {
38
- minimal: '#0f0f0f1a',
39
- lowest: '#0f0f0f33',
40
- },
41
-
42
- // -------------------------------------------------------------------------
43
- // Status
44
- // -------------------------------------------------------------------------
45
-
46
- error: {
47
- default: '#ff6464',
48
- light: '#4b0404',
49
- dark: '#ff9d9d',
50
- },
51
-
52
- success: {
53
- default: '#45c85a',
54
- light: '#092a10',
55
- dark: '#91e49e',
56
- },
57
-
58
- warning: {
59
- default: '#eeb721',
60
- light: '#3f1c09',
61
- dark: '#f4cf50',
62
- },
63
-
64
- info: {
65
- default: '#d7d7e0',
66
- light: '#3e3f4e',
67
- dark: '#f7f7f8',
68
- },
69
-
70
- // -------------------------------------------------------------------------
71
- // Button
72
- // -------------------------------------------------------------------------
73
-
74
- button: {
75
- primary: {
76
- default: {
77
- background: '#ffffff',
78
- text: '#28242e',
79
- icon: '#28242e',
80
- border: 'transparent',
81
- },
82
- pressed: {
83
- background: '#d1d1d1',
84
- text: '#28242e',
85
- icon: '#28242e',
86
- border: 'transparent',
87
- },
88
- disabled: {
89
- background: '#ffffff1a',
90
- text: '#ffffff4d',
91
- icon: '#ffffff4d',
92
- border: 'transparent',
93
- },
94
- },
95
- tertiary: {
96
- default: {
97
- background: 'transparent',
98
- text: '#ffffff',
99
- icon: '#ffffff',
100
- border: '#ffffff33',
101
- },
102
- pressed: {
103
- background: '#ffffff1a',
104
- text: '#ffffff',
105
- icon: '#ffffff',
106
- border: '#ffffff33',
107
- },
108
- disabled: {
109
- background: '#ffffff0d',
110
- text: '#ffffff4d',
111
- icon: '#ffffff4d',
112
- border: '#ffffff1a',
113
- },
114
- },
115
- ghost: {
116
- default: {
117
- background: 'transparent',
118
- text: '#ffffff',
119
- icon: '#ffffff',
120
- border: 'transparent',
121
- },
122
- pressed: {
123
- background: '#ffffff1a',
124
- text: '#ffffff',
125
- icon: '#ffffff',
126
- border: 'transparent',
127
- },
128
- disabled: {
129
- background: 'transparent',
130
- text: '#ffffff4d',
131
- icon: '#ffffff4d',
132
- border: 'transparent',
133
- },
134
- },
135
- destructive: {
136
- default: {
137
- background: '#ff4747',
138
- text: '#ffffff',
139
- icon: '#ffffff',
140
- border: 'transparent',
141
- },
142
- pressed: {
143
- background: '#c80d0d',
144
- text: '#ffffff',
145
- icon: '#ffffff',
146
- border: 'transparent',
147
- },
148
- disabled: {
149
- background: '#ffffff0d',
150
- text: '#ffffff4d',
151
- icon: '#ffffff4d',
152
- border: 'transparent',
153
- },
154
- },
155
- },
156
-
157
- // -------------------------------------------------------------------------
158
- // Add new component tokens below
159
- // -------------------------------------------------------------------------
160
- };
@@ -1,166 +0,0 @@
1
- /**
2
- * Base light tokens.
3
- * These are the default light values — themes override what they need.
4
- * Tim: add new component tokens at the bottom when creating a new component.
5
- */
6
-
7
- import type { ColorSchemeTokens } from '../type';
8
-
9
- export const lightTokens: ColorSchemeTokens = {
10
- // -------------------------------------------------------------------------
11
- // Globals
12
- // -------------------------------------------------------------------------
13
-
14
- background: {
15
- primary: '#ffffff',
16
- secondary: '#f8f6f0',
17
- tertiary: '#e8e4da',
18
- overlay: '#0f0f0f80',
19
- menu: '#f8f6f0',
20
- },
21
-
22
- text: {
23
- primary: '#28242e',
24
- secondary: '#47475d',
25
- tertiary: '#6d6f8a',
26
- disabled: '#0f0f0f99',
27
- onColor: '#ffffff',
28
- },
29
-
30
- border: {
31
- default: '#afafad80',
32
- strong: '#afafadcc',
33
- disabled: '#0f0f0f1a',
34
- window: '#afafad80',
35
- },
36
-
37
- shadow: {
38
- minimal: '#0f0f0f0d',
39
- lowest: '#0f0f0f1a',
40
- },
41
-
42
- // -------------------------------------------------------------------------
43
- // Status
44
- // -------------------------------------------------------------------------
45
-
46
- error: {
47
- default: '#ff4747',
48
- light: '#fff1f1',
49
- dark: '#c80d0d',
50
- },
51
-
52
- success: {
53
- default: '#33b449',
54
- light: '#f1fcf3',
55
- dark: '#20752f',
56
- },
57
-
58
- warning: {
59
- default: '#de9f14',
60
- light: '#fdfae9',
61
- dark: '#99570f',
62
- },
63
-
64
- info: {
65
- default: '#28242e',
66
- light: '#f7f7f8',
67
- dark: '#1a1720',
68
- },
69
-
70
- // -------------------------------------------------------------------------
71
- // Button
72
- // -------------------------------------------------------------------------
73
-
74
- button: {
75
- primary: {
76
- default: {
77
- background: '#28242e',
78
- text: '#ffffff',
79
- icon: '#ffffff',
80
- border: 'transparent',
81
- },
82
- pressed: {
83
- background: '#3e3f4e',
84
- text: '#ffffff',
85
- icon: '#ffffff',
86
- border: 'transparent',
87
- },
88
- disabled: {
89
- background: '#0f0f0f0d',
90
- text: '#0f0f0f99',
91
- icon: '#0f0f0f99',
92
- border: 'transparent',
93
- },
94
- },
95
- tertiary: {
96
- default: {
97
- background: 'transparent',
98
- text: '#28242e',
99
- icon: '#28242e',
100
- border: '#afafad80',
101
- },
102
- pressed: {
103
- background: '#d1c3a066',
104
- text: '#28242e',
105
- icon: '#28242e',
106
- border: '#afafad80',
107
- },
108
- disabled: {
109
- background: '#0f0f0f0d',
110
- text: '#0f0f0f99',
111
- icon: '#0f0f0f99',
112
- border: '#0f0f0f1a',
113
- },
114
- },
115
- ghost: {
116
- default: {
117
- background: 'transparent',
118
- text: '#28242e',
119
- icon: '#28242e',
120
- border: 'transparent',
121
- },
122
- pressed: {
123
- background: '#d1c3a066',
124
- text: '#28242e',
125
- icon: '#28242e',
126
- border: 'transparent',
127
- },
128
- disabled: {
129
- background: 'transparent',
130
- text: '#0f0f0f66',
131
- icon: '#0f0f0f66',
132
- border: 'transparent',
133
- },
134
- },
135
- destructive: {
136
- default: {
137
- background: '#ff4747',
138
- text: '#ffffff',
139
- icon: '#ffffff',
140
- border: 'transparent',
141
- },
142
- pressed: {
143
- background: '#c80d0d',
144
- text: '#ffffff',
145
- icon: '#ffffff',
146
- border: 'transparent',
147
- },
148
- disabled: {
149
- background: '#0f0f0f0d',
150
- text: '#0f0f0f99',
151
- icon: '#0f0f0f99',
152
- border: 'transparent',
153
- },
154
- },
155
- },
156
-
157
- // -------------------------------------------------------------------------
158
- // Add new component tokens below
159
- // Example:
160
- // checkbox: {
161
- // default: { background: '...', border: '...', icon: '...' },
162
- // checked: { background: '...', border: '...', icon: '...' },
163
- // disabled: { background: '...', border: '...', icon: '...' },
164
- // },
165
- // -------------------------------------------------------------------------
166
- };
package/src/theme/type.ts DELETED
@@ -1,122 +0,0 @@
1
- /**
2
- * Color theme contract for Traq[UI]ste Mobile.
3
- * Every theme must implement this interface.
4
- * Add a new section here when Tim creates a new component.
5
- */
6
-
7
- // ---------------------------------------------------------------------------
8
- // Color mode
9
- // ---------------------------------------------------------------------------
10
-
11
- export type ColorMode = 'light' | 'dark';
12
-
13
- // ---------------------------------------------------------------------------
14
- // Shared primitives
15
- // ---------------------------------------------------------------------------
16
-
17
- export interface InteractiveStateTokens {
18
- /** Container background */
19
- background: string;
20
- /** Label / text color */
21
- text: string;
22
- /** Icon tint */
23
- icon: string;
24
- /** Border — use 'transparent' when no border */
25
- border: string;
26
- }
27
-
28
- export interface InteractiveVariantTokens {
29
- default: InteractiveStateTokens;
30
- pressed: InteractiveStateTokens;
31
- disabled: InteractiveStateTokens;
32
- }
33
-
34
- export interface StatusTokens {
35
- /** Primary status color */
36
- default: string;
37
- /** Light tint — backgrounds */
38
- light: string;
39
- /** Dark variant — text on light bg */
40
- dark: string;
41
- }
42
-
43
- // ---------------------------------------------------------------------------
44
- // Global tokens
45
- // ---------------------------------------------------------------------------
46
-
47
- export interface BackgroundTokens {
48
- primary: string;
49
- secondary: string;
50
- tertiary: string;
51
- overlay: string;
52
- menu: string;
53
- }
54
-
55
- export interface TextTokens {
56
- primary: string;
57
- secondary: string;
58
- tertiary: string;
59
- disabled: string;
60
- onColor: string;
61
- }
62
-
63
- export interface BorderTokens {
64
- default: string;
65
- strong: string;
66
- disabled: string;
67
- window: string;
68
- }
69
-
70
- export interface ShadowTokens {
71
- minimal: string;
72
- lowest: string;
73
- }
74
-
75
- // ---------------------------------------------------------------------------
76
- // Component tokens
77
- // Add a new interface below when Tim creates a new component
78
- // ---------------------------------------------------------------------------
79
-
80
- export interface ButtonTokens {
81
- primary: InteractiveVariantTokens;
82
- tertiary: InteractiveVariantTokens;
83
- ghost: InteractiveVariantTokens;
84
- destructive: InteractiveVariantTokens;
85
- }
86
-
87
- // export interface CheckboxTokens { ... } ← next component goes here
88
- // export interface InputTokens { ... }
89
- // export interface TagTokens { ... }
90
-
91
- // ---------------------------------------------------------------------------
92
- // Full scheme (light or dark)
93
- // ---------------------------------------------------------------------------
94
-
95
- export interface ColorSchemeTokens {
96
- // globals
97
- background: BackgroundTokens;
98
- text: TextTokens;
99
- border: BorderTokens;
100
- shadow: ShadowTokens;
101
-
102
- // status
103
- error: StatusTokens;
104
- success: StatusTokens;
105
- warning: StatusTokens;
106
- info: StatusTokens;
107
-
108
- // components — add new ones here when Tim creates them
109
- button: ButtonTokens;
110
- // checkbox: CheckboxTokens;
111
- // input: InputTokens;
112
- // tag: TagTokens;
113
- }
114
-
115
- // ---------------------------------------------------------------------------
116
- // Theme (light + dark)
117
- // ---------------------------------------------------------------------------
118
-
119
- export interface ColorTheme {
120
- light: ColorSchemeTokens;
121
- dark: ColorSchemeTokens;
122
- }
File without changes
File without changes