@ezpg/app-ui 0.2.0 → 0.3.0
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/CHANGELOG.md +6 -0
- package/lib/module/blocks/claim-row/claim-row.js +1 -1
- package/lib/module/blocks/claim-row/claim-row.js.map +1 -1
- package/lib/module/blocks/copy-variant-picker/copy-variant-picker.js +1 -1
- package/lib/module/blocks/copy-variant-picker/copy-variant-picker.js.map +1 -1
- package/lib/module/blocks/generation-progress/generation-progress.js +4 -4
- package/lib/module/blocks/generation-progress/generation-progress.js.map +1 -1
- package/lib/module/blocks/image-grid/image-grid.js +2 -2
- package/lib/module/blocks/image-grid/image-grid.js.map +1 -1
- package/lib/module/blocks/invoice-row/invoice-row.js +3 -3
- package/lib/module/blocks/invoice-row/invoice-row.js.map +1 -1
- package/lib/module/blocks/order-card/order-card.js +1 -1
- package/lib/module/blocks/order-card/order-card.js.map +1 -1
- package/lib/module/blocks/plan-card/plan-card.js +1 -1
- package/lib/module/blocks/plan-card/plan-card.js.map +1 -1
- package/lib/module/blocks/sales-chart/sales-chart.js +1 -1
- package/lib/module/blocks/sales-chart/sales-chart.js.map +1 -1
- package/lib/module/blocks/service-state-banner/service-state-banner.js +1 -1
- package/lib/module/blocks/service-state-banner/service-state-banner.js.map +1 -1
- package/lib/module/blocks/stat-card/stat-card.js +1 -1
- package/lib/module/blocks/stat-card/stat-card.js.map +1 -1
- package/lib/module/components/button/button.js +3 -3
- package/lib/module/components/button/button.js.map +1 -1
- package/lib/module/components/dialog/dialog.js +2 -2
- package/lib/module/components/dialog/dialog.js.map +1 -1
- package/lib/module/components/field/field.js +5 -5
- package/lib/module/components/field/field.js.map +1 -1
- package/lib/module/components/price/price.js +1 -1
- package/lib/module/components/price/price.js.map +1 -1
- package/lib/module/components/status-badge/status-badge.js +1 -1
- package/lib/module/components/status-badge/status-badge.js.map +1 -1
- package/lib/module/components/text/text.js +2 -2
- package/lib/module/components/text/text.js.map +1 -1
- package/lib/module/components/toast/toast.js +1 -1
- package/lib/module/components/toast/toast.js.map +1 -1
- package/lib/module/theme/base.js +108 -0
- package/lib/module/theme/base.js.map +1 -0
- package/lib/module/theme/tokens.js +10 -114
- package/lib/module/theme/tokens.js.map +1 -1
- package/lib/typescript/src/components/button/button.d.ts +1 -1
- package/lib/typescript/src/components/button/button.d.ts.map +1 -1
- package/lib/typescript/src/components/dialog/dialog.d.ts +2 -2
- package/lib/typescript/src/components/dialog/dialog.d.ts.map +1 -1
- package/lib/typescript/src/components/status-badge/status-badge.d.ts +1 -1
- package/lib/typescript/src/components/status-badge/status-badge.d.ts.map +1 -1
- package/lib/typescript/src/components/text/text.d.ts +1 -1
- package/lib/typescript/src/components/text/text.d.ts.map +1 -1
- package/lib/typescript/src/components/toast/toast.d.ts +1 -1
- package/lib/typescript/src/components/toast/toast.d.ts.map +1 -1
- package/lib/typescript/src/theme/base.d.ts +106 -0
- package/lib/typescript/src/theme/base.d.ts.map +1 -0
- package/lib/typescript/src/theme/tokens.d.ts.map +1 -1
- package/lib/typescript/src/types/index.d.ts +2 -2
- package/lib/typescript/src/types/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/blocks/claim-row/claim-row.tsx +1 -1
- package/src/blocks/copy-variant-picker/copy-variant-picker.tsx +1 -1
- package/src/blocks/generation-progress/generation-progress.tsx +4 -4
- package/src/blocks/image-grid/image-grid.tsx +2 -2
- package/src/blocks/invoice-row/invoice-row.tsx +3 -3
- package/src/blocks/order-card/order-card.tsx +1 -1
- package/src/blocks/plan-card/plan-card.tsx +1 -1
- package/src/blocks/sales-chart/sales-chart.tsx +1 -1
- package/src/blocks/service-state-banner/service-state-banner.tsx +1 -1
- package/src/blocks/stat-card/stat-card.tsx +1 -1
- package/src/components/button/button.tsx +3 -3
- package/src/components/dialog/dialog.tsx +3 -3
- package/src/components/field/field.tsx +5 -5
- package/src/components/price/price.tsx +1 -1
- package/src/components/status-badge/status-badge.tsx +2 -2
- package/src/components/text/text.tsx +2 -2
- package/src/components/toast/toast.tsx +2 -2
- package/src/theme/base.ts +113 -0
- package/src/theme/tokens.ts +20 -82
- package/src/types/index.ts +2 -2
|
@@ -80,7 +80,7 @@ export function CopyVariantPicker({
|
|
|
80
80
|
<Text weight="semibold">{label}</Text>
|
|
81
81
|
{conflict ? (
|
|
82
82
|
<View style={s.conflict} accessibilityLiveRegion="polite">
|
|
83
|
-
<Text tone="
|
|
83
|
+
<Text tone="danger">다른 기기에서 먼저 수정했어요.</Text>
|
|
84
84
|
{onReload ? (
|
|
85
85
|
<Button
|
|
86
86
|
size="sm"
|
|
@@ -106,8 +106,8 @@ export function GenerationProgress({
|
|
|
106
106
|
<View style={s.dot}>
|
|
107
107
|
<AlertGlyph
|
|
108
108
|
filled
|
|
109
|
-
color={t.colors.
|
|
110
|
-
onColor={t.colors.
|
|
109
|
+
color={t.colors.danger}
|
|
110
|
+
onColor={t.colors.dangerForeground}
|
|
111
111
|
size={DOT}
|
|
112
112
|
/>
|
|
113
113
|
</View>
|
|
@@ -143,7 +143,7 @@ export function GenerationProgress({
|
|
|
143
143
|
style={s.label}
|
|
144
144
|
tone={
|
|
145
145
|
state === 'failed'
|
|
146
|
-
? '
|
|
146
|
+
? 'danger'
|
|
147
147
|
: state === 'pending'
|
|
148
148
|
? 'muted'
|
|
149
149
|
: 'default'
|
|
@@ -161,7 +161,7 @@ export function GenerationProgress({
|
|
|
161
161
|
})}
|
|
162
162
|
</View>
|
|
163
163
|
{status === 'failed' && errorText ? (
|
|
164
|
-
<Text tone="
|
|
164
|
+
<Text tone="danger" accessibilityLiveRegion="polite">
|
|
165
165
|
{errorText}
|
|
166
166
|
</Text>
|
|
167
167
|
) : null}
|
|
@@ -46,7 +46,7 @@ const useStyles = makeStyles((t) => ({
|
|
|
46
46
|
},
|
|
47
47
|
dim: { backgroundColor: `${t.colors.background}B3` },
|
|
48
48
|
light: { gap: 2, backgroundColor: `${t.colors.background}D9` },
|
|
49
|
-
failed: { fontSize: 12, lineHeight: 16, color: t.colors.
|
|
49
|
+
failed: { fontSize: 12, lineHeight: 16, color: t.colors.danger },
|
|
50
50
|
cover: {
|
|
51
51
|
position: 'absolute',
|
|
52
52
|
left: 0,
|
|
@@ -248,7 +248,7 @@ export function ImageGrid({
|
|
|
248
248
|
onPress={() => onRetry?.(item.id)}
|
|
249
249
|
style={[s.fill, s.light]}
|
|
250
250
|
>
|
|
251
|
-
<RetryGlyph color={t.colors.
|
|
251
|
+
<RetryGlyph color={t.colors.danger} size={22} />
|
|
252
252
|
<Text weight="bold" style={s.failed}>
|
|
253
253
|
실패
|
|
254
254
|
</Text>
|
|
@@ -74,11 +74,11 @@ export function InvoiceRow({
|
|
|
74
74
|
<View style={s.row}>
|
|
75
75
|
<AlertGlyph
|
|
76
76
|
filled
|
|
77
|
-
color={t.colors.
|
|
78
|
-
onColor={t.colors.
|
|
77
|
+
color={t.colors.danger}
|
|
78
|
+
onColor={t.colors.dangerForeground}
|
|
79
79
|
size={t.iconSize.md}
|
|
80
80
|
/>
|
|
81
|
-
<Text weight="bold" tone="
|
|
81
|
+
<Text weight="bold" tone="danger" style={[s.head, s.grow]}>
|
|
82
82
|
결제 실패
|
|
83
83
|
</Text>
|
|
84
84
|
<Text weight="bold" style={s.head}>
|
|
@@ -92,7 +92,7 @@ export function SalesChart({
|
|
|
92
92
|
{rate !== null ? (
|
|
93
93
|
<Text
|
|
94
94
|
weight="bold"
|
|
95
|
-
tone={up ? '
|
|
95
|
+
tone={up ? 'danger' : 'default'}
|
|
96
96
|
style={!up && s.down}
|
|
97
97
|
accessibilityLabel={`직전 기간보다 ${Math.abs(rate).toFixed(1)}% ${up ? '증가' : '감소'}`}
|
|
98
98
|
>
|
|
@@ -49,7 +49,7 @@ export function ServiceStateBanner({
|
|
|
49
49
|
const severe =
|
|
50
50
|
state === 'suspended' || state === 'closed' || state === 'stopped';
|
|
51
51
|
const [bg, fg] = severe
|
|
52
|
-
? [t.colors.
|
|
52
|
+
? [t.colors.danger, t.colors.dangerForeground]
|
|
53
53
|
: [t.colors.warning, t.colors.warningForeground];
|
|
54
54
|
return (
|
|
55
55
|
<View
|
|
@@ -57,7 +57,7 @@ export function StatCard({
|
|
|
57
57
|
{hasChange ? (
|
|
58
58
|
<Text
|
|
59
59
|
weight="bold"
|
|
60
|
-
tone={flat ? 'muted' : up ? '
|
|
60
|
+
tone={flat ? 'muted' : up ? 'danger' : 'default'}
|
|
61
61
|
style={!flat && !up && s.down}
|
|
62
62
|
>
|
|
63
63
|
{flat ? '변동 없음' : `${up ? '▲' : '▼'} ${rate}`}
|
|
@@ -9,7 +9,7 @@ import { useTheme } from '../../theme/theme-provider';
|
|
|
9
9
|
import { makeStyles } from '../../utils/styles';
|
|
10
10
|
|
|
11
11
|
export type ButtonVariant =
|
|
12
|
-
'solid' | 'secondary' | 'outline' | 'ghost' | '
|
|
12
|
+
'solid' | 'secondary' | 'outline' | 'ghost' | 'danger';
|
|
13
13
|
export type ButtonSize = 'sm' | 'md' | 'lg';
|
|
14
14
|
|
|
15
15
|
export type ButtonProps = Omit<
|
|
@@ -53,7 +53,7 @@ const useStyles = makeStyles((t) => ({
|
|
|
53
53
|
borderColor: t.colors.input,
|
|
54
54
|
},
|
|
55
55
|
ghost: { backgroundColor: 'transparent' },
|
|
56
|
-
|
|
56
|
+
danger: { backgroundColor: t.colors.danger },
|
|
57
57
|
label: { fontFamily: t.fontFamily, fontWeight: '600' },
|
|
58
58
|
smLabel: { fontSize: 14, lineHeight: 20 },
|
|
59
59
|
mdLabel: {
|
|
@@ -82,7 +82,7 @@ export function Button({
|
|
|
82
82
|
secondary: t.colors.foreground,
|
|
83
83
|
outline: t.colors.foreground,
|
|
84
84
|
ghost: t.colors.foreground,
|
|
85
|
-
|
|
85
|
+
danger: t.colors.dangerForeground,
|
|
86
86
|
}[variant];
|
|
87
87
|
const icon = { color, size: size === 'sm' ? t.iconSize.sm : t.iconSize.md };
|
|
88
88
|
|
|
@@ -12,7 +12,7 @@ export type DialogProps = {
|
|
|
12
12
|
onConfirm: () => void;
|
|
13
13
|
confirmLabel?: string;
|
|
14
14
|
cancelLabel?: string;
|
|
15
|
-
|
|
15
|
+
danger?: boolean;
|
|
16
16
|
loading?: boolean;
|
|
17
17
|
dismissible?: boolean;
|
|
18
18
|
};
|
|
@@ -50,7 +50,7 @@ export function Dialog({
|
|
|
50
50
|
onConfirm,
|
|
51
51
|
confirmLabel = '확인',
|
|
52
52
|
cancelLabel = '취소',
|
|
53
|
-
|
|
53
|
+
danger = false,
|
|
54
54
|
loading = false,
|
|
55
55
|
dismissible = true,
|
|
56
56
|
}: DialogProps) {
|
|
@@ -108,7 +108,7 @@ export function Dialog({
|
|
|
108
108
|
{cancelLabel}
|
|
109
109
|
</Button>
|
|
110
110
|
<Button
|
|
111
|
-
variant={
|
|
111
|
+
variant={danger ? 'danger' : 'solid'}
|
|
112
112
|
style={s.action}
|
|
113
113
|
loading={loading}
|
|
114
114
|
onPress={onConfirm}
|
|
@@ -51,7 +51,7 @@ const useStyles = makeStyles((t) => ({
|
|
|
51
51
|
invalid: {
|
|
52
52
|
borderWidth: 2,
|
|
53
53
|
paddingHorizontal: t.space[4] - 1,
|
|
54
|
-
borderColor: t.colors.
|
|
54
|
+
borderColor: t.colors.danger,
|
|
55
55
|
},
|
|
56
56
|
disabled: { opacity: t.opacity.disabled, backgroundColor: t.colors.muted },
|
|
57
57
|
input: {
|
|
@@ -67,9 +67,9 @@ const useStyles = makeStyles((t) => ({
|
|
|
67
67
|
fontSize: 13,
|
|
68
68
|
lineHeight: 18,
|
|
69
69
|
paddingLeft: t.space[1],
|
|
70
|
-
color: t.colors.
|
|
70
|
+
color: t.colors.danger,
|
|
71
71
|
},
|
|
72
|
-
errorLabel: { color: t.colors.
|
|
72
|
+
errorLabel: { color: t.colors.danger },
|
|
73
73
|
warned: {
|
|
74
74
|
borderWidth: 2,
|
|
75
75
|
paddingHorizontal: t.space[4] - 1,
|
|
@@ -159,8 +159,8 @@ export function Field({
|
|
|
159
159
|
{error ? (
|
|
160
160
|
<AlertGlyph
|
|
161
161
|
filled
|
|
162
|
-
color={t.colors.
|
|
163
|
-
onColor={t.colors.
|
|
162
|
+
color={t.colors.danger}
|
|
163
|
+
onColor={t.colors.dangerForeground}
|
|
164
164
|
size={t.iconSize.md}
|
|
165
165
|
/>
|
|
166
166
|
) : trailing ? (
|
|
@@ -3,7 +3,7 @@ import { useTheme } from '../../theme/theme-provider';
|
|
|
3
3
|
import { makeStyles } from '../../utils/styles';
|
|
4
4
|
|
|
5
5
|
export type StatusBadgeTone =
|
|
6
|
-
'neutral' | 'info' | 'success' | 'warning' | '
|
|
6
|
+
'neutral' | 'info' | 'success' | 'warning' | 'danger';
|
|
7
7
|
|
|
8
8
|
export type StatusBadgeProps = {
|
|
9
9
|
tone?: StatusBadgeTone;
|
|
@@ -37,7 +37,7 @@ export function StatusBadge({
|
|
|
37
37
|
info: [t.colors.info, t.colors.infoForeground],
|
|
38
38
|
success: [t.colors.success, t.colors.successForeground],
|
|
39
39
|
warning: [t.colors.warning, t.colors.warningForeground],
|
|
40
|
-
|
|
40
|
+
danger: [t.colors.danger, t.colors.dangerForeground],
|
|
41
41
|
}[tone];
|
|
42
42
|
return (
|
|
43
43
|
<View style={[s.base, { backgroundColor: bg }, style]}>
|
|
@@ -4,7 +4,7 @@ import type { TypographyVariant } from '../../types';
|
|
|
4
4
|
import { useTheme } from '../../theme/theme-provider';
|
|
5
5
|
import { makeStyles } from '../../utils/styles';
|
|
6
6
|
|
|
7
|
-
export type TextTone = 'default' | 'muted' | '
|
|
7
|
+
export type TextTone = 'default' | 'muted' | 'danger' | 'success';
|
|
8
8
|
|
|
9
9
|
export type TextProps = RNTextProps & {
|
|
10
10
|
ref?: Ref<ComponentRef<typeof RNText>>;
|
|
@@ -23,7 +23,7 @@ const useStyles = makeStyles((t) => ({
|
|
|
23
23
|
display: t.typography.display,
|
|
24
24
|
default: { color: t.colors.foreground },
|
|
25
25
|
muted: { color: t.colors.mutedForeground },
|
|
26
|
-
|
|
26
|
+
danger: { color: t.colors.danger },
|
|
27
27
|
success: { color: t.colors.success },
|
|
28
28
|
font: { fontFamily: t.fontFamily },
|
|
29
29
|
regular: { fontWeight: '400' },
|
|
@@ -21,7 +21,7 @@ import { useReducedMotion } from '../../internal/use-reduced-motion';
|
|
|
21
21
|
import { useTheme } from '../../theme/theme-provider';
|
|
22
22
|
import { makeStyles } from '../../utils/styles';
|
|
23
23
|
|
|
24
|
-
export type ToastTone = 'neutral' | 'success' | '
|
|
24
|
+
export type ToastTone = 'neutral' | 'success' | 'danger';
|
|
25
25
|
|
|
26
26
|
export type ToastOptions = {
|
|
27
27
|
message: string;
|
|
@@ -183,7 +183,7 @@ function ToastHostInner({ store }: { store: ToastStore }) {
|
|
|
183
183
|
const [bg, fg] = {
|
|
184
184
|
neutral: [t.colors.foreground, t.colors.background],
|
|
185
185
|
success: [t.colors.success, t.colors.successForeground],
|
|
186
|
-
|
|
186
|
+
danger: [t.colors.danger, t.colors.dangerForeground],
|
|
187
187
|
}[current.tone];
|
|
188
188
|
const actionColor =
|
|
189
189
|
current.tone !== 'neutral'
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
export const semantic = {
|
|
2
|
+
light: {
|
|
3
|
+
background: '#ffffff',
|
|
4
|
+
foreground: '#0a0a0a',
|
|
5
|
+
muted: '#f5f5f5',
|
|
6
|
+
mutedForeground: '#737373',
|
|
7
|
+
border: '#e5e5e5',
|
|
8
|
+
input: '#d4d4d4',
|
|
9
|
+
ring: '#a3a3a3',
|
|
10
|
+
primary: '#171717',
|
|
11
|
+
primaryForeground: '#fafafa',
|
|
12
|
+
danger: '#dc2626',
|
|
13
|
+
dangerForeground: '#ffffff',
|
|
14
|
+
success: '#15803d',
|
|
15
|
+
successForeground: '#ffffff',
|
|
16
|
+
warning: '#f59e0b',
|
|
17
|
+
warningForeground: '#0a0a0a',
|
|
18
|
+
info: '#2563eb',
|
|
19
|
+
infoForeground: '#ffffff',
|
|
20
|
+
},
|
|
21
|
+
dark: {
|
|
22
|
+
background: '#0a0a0a',
|
|
23
|
+
foreground: '#fafafa',
|
|
24
|
+
muted: '#262626',
|
|
25
|
+
mutedForeground: '#a3a3a3',
|
|
26
|
+
border: '#262626',
|
|
27
|
+
input: '#404040',
|
|
28
|
+
ring: '#737373',
|
|
29
|
+
primary: '#fafafa',
|
|
30
|
+
primaryForeground: '#171717',
|
|
31
|
+
danger: '#f87171',
|
|
32
|
+
dangerForeground: '#0a0a0a',
|
|
33
|
+
success: '#4ade80',
|
|
34
|
+
successForeground: '#0a0a0a',
|
|
35
|
+
warning: '#fbbf24',
|
|
36
|
+
warningForeground: '#0a0a0a',
|
|
37
|
+
info: '#60a5fa',
|
|
38
|
+
infoForeground: '#0a0a0a',
|
|
39
|
+
},
|
|
40
|
+
} as const;
|
|
41
|
+
|
|
42
|
+
export const space = {
|
|
43
|
+
'0': 0,
|
|
44
|
+
'1': 4,
|
|
45
|
+
'2': 8,
|
|
46
|
+
'3': 12,
|
|
47
|
+
'4': 16,
|
|
48
|
+
'5': 20,
|
|
49
|
+
'6': 24,
|
|
50
|
+
'8': 32,
|
|
51
|
+
'10': 40,
|
|
52
|
+
'12': 48,
|
|
53
|
+
'16': 64,
|
|
54
|
+
} as const;
|
|
55
|
+
|
|
56
|
+
export const radius = {
|
|
57
|
+
sm: 6,
|
|
58
|
+
md: 8,
|
|
59
|
+
lg: 12,
|
|
60
|
+
full: 9999,
|
|
61
|
+
} as const;
|
|
62
|
+
|
|
63
|
+
export const typography = {
|
|
64
|
+
caption: {
|
|
65
|
+
fontSize: 12,
|
|
66
|
+
lineHeight: 16,
|
|
67
|
+
fontWeight: '400',
|
|
68
|
+
},
|
|
69
|
+
body: {
|
|
70
|
+
fontSize: 15,
|
|
71
|
+
lineHeight: 22,
|
|
72
|
+
fontWeight: '400',
|
|
73
|
+
},
|
|
74
|
+
bodyLg: {
|
|
75
|
+
fontSize: 17,
|
|
76
|
+
lineHeight: 24,
|
|
77
|
+
fontWeight: '400',
|
|
78
|
+
},
|
|
79
|
+
title: {
|
|
80
|
+
fontSize: 20,
|
|
81
|
+
lineHeight: 28,
|
|
82
|
+
fontWeight: '600',
|
|
83
|
+
},
|
|
84
|
+
display: {
|
|
85
|
+
fontSize: 28,
|
|
86
|
+
lineHeight: 34,
|
|
87
|
+
fontWeight: '700',
|
|
88
|
+
},
|
|
89
|
+
} as const;
|
|
90
|
+
|
|
91
|
+
export const shadow = {
|
|
92
|
+
sm: '0px 1px 2px rgba(0, 0, 0, 0.08)',
|
|
93
|
+
md: '0px 4px 12px rgba(0, 0, 0, 0.12)',
|
|
94
|
+
} as const;
|
|
95
|
+
|
|
96
|
+
export const motion = {
|
|
97
|
+
duration: 200,
|
|
98
|
+
} as const;
|
|
99
|
+
|
|
100
|
+
export const opacity = {
|
|
101
|
+
pressed: 0.8,
|
|
102
|
+
disabled: 0.5,
|
|
103
|
+
} as const;
|
|
104
|
+
|
|
105
|
+
export const iconSize = {
|
|
106
|
+
sm: 16,
|
|
107
|
+
md: 20,
|
|
108
|
+
} as const;
|
|
109
|
+
|
|
110
|
+
export const touch = {
|
|
111
|
+
ios: 44,
|
|
112
|
+
android: 48,
|
|
113
|
+
} as const;
|
package/src/theme/tokens.ts
CHANGED
|
@@ -1,90 +1,28 @@
|
|
|
1
1
|
import { Platform } from 'react-native';
|
|
2
2
|
import type { ColorScheme, ThemeColors, ThemeTokens } from '../types';
|
|
3
|
+
import {
|
|
4
|
+
iconSize,
|
|
5
|
+
motion,
|
|
6
|
+
opacity,
|
|
7
|
+
radius,
|
|
8
|
+
semantic,
|
|
9
|
+
shadow,
|
|
10
|
+
space,
|
|
11
|
+
touch,
|
|
12
|
+
typography,
|
|
13
|
+
} from './base';
|
|
3
14
|
|
|
4
|
-
const
|
|
5
|
-
50: '#fafafa',
|
|
6
|
-
100: '#f5f5f5',
|
|
7
|
-
200: '#e5e5e5',
|
|
8
|
-
300: '#d4d4d4',
|
|
9
|
-
400: '#a3a3a3',
|
|
10
|
-
500: '#737373',
|
|
11
|
-
700: '#404040',
|
|
12
|
-
800: '#262626',
|
|
13
|
-
900: '#171717',
|
|
14
|
-
950: '#0a0a0a',
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export const colors: Record<ColorScheme, ThemeColors> = {
|
|
18
|
-
light: {
|
|
19
|
-
background: '#ffffff',
|
|
20
|
-
foreground: neutral[950],
|
|
21
|
-
muted: neutral[100],
|
|
22
|
-
mutedForeground: neutral[500],
|
|
23
|
-
border: neutral[200],
|
|
24
|
-
input: neutral[300],
|
|
25
|
-
ring: neutral[400],
|
|
26
|
-
primary: neutral[900],
|
|
27
|
-
primaryForeground: neutral[50],
|
|
28
|
-
destructive: '#dc2626',
|
|
29
|
-
destructiveForeground: '#ffffff',
|
|
30
|
-
success: '#15803d',
|
|
31
|
-
successForeground: '#ffffff',
|
|
32
|
-
warning: '#f59e0b',
|
|
33
|
-
warningForeground: neutral[950],
|
|
34
|
-
info: '#2563eb',
|
|
35
|
-
infoForeground: '#ffffff',
|
|
36
|
-
},
|
|
37
|
-
dark: {
|
|
38
|
-
background: neutral[950],
|
|
39
|
-
foreground: neutral[50],
|
|
40
|
-
muted: neutral[800],
|
|
41
|
-
mutedForeground: neutral[400],
|
|
42
|
-
border: neutral[800],
|
|
43
|
-
input: neutral[700],
|
|
44
|
-
ring: neutral[500],
|
|
45
|
-
primary: neutral[50],
|
|
46
|
-
primaryForeground: neutral[900],
|
|
47
|
-
destructive: '#f87171',
|
|
48
|
-
destructiveForeground: neutral[950],
|
|
49
|
-
success: '#4ade80',
|
|
50
|
-
successForeground: neutral[950],
|
|
51
|
-
warning: '#fbbf24',
|
|
52
|
-
warningForeground: neutral[950],
|
|
53
|
-
info: '#60a5fa',
|
|
54
|
-
infoForeground: neutral[950],
|
|
55
|
-
},
|
|
56
|
-
};
|
|
15
|
+
export const colors: Record<ColorScheme, ThemeColors> = semantic;
|
|
57
16
|
|
|
58
17
|
export const tokens: ThemeTokens = {
|
|
59
|
-
space
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
2: 8,
|
|
63
|
-
3: 12,
|
|
64
|
-
4: 16,
|
|
65
|
-
5: 20,
|
|
66
|
-
6: 24,
|
|
67
|
-
8: 32,
|
|
68
|
-
10: 40,
|
|
69
|
-
12: 48,
|
|
70
|
-
16: 64,
|
|
71
|
-
},
|
|
72
|
-
radius: { sm: 6, md: 8, lg: 12, full: 9999 },
|
|
73
|
-
typography: {
|
|
74
|
-
caption: { fontSize: 12, lineHeight: 16, fontWeight: '400' },
|
|
75
|
-
body: { fontSize: 15, lineHeight: 22, fontWeight: '400' },
|
|
76
|
-
bodyLg: { fontSize: 17, lineHeight: 24, fontWeight: '400' },
|
|
77
|
-
title: { fontSize: 20, lineHeight: 28, fontWeight: '600' },
|
|
78
|
-
display: { fontSize: 28, lineHeight: 34, fontWeight: '700' },
|
|
79
|
-
},
|
|
18
|
+
space,
|
|
19
|
+
radius,
|
|
20
|
+
typography,
|
|
80
21
|
fontFamily: undefined,
|
|
81
22
|
maxFontScale: 1.3,
|
|
82
|
-
shadow
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
opacity: { pressed: 0.8, disabled: 0.5 },
|
|
88
|
-
iconSize: { sm: 16, md: 20 },
|
|
89
|
-
minTouchSize: Platform.OS === 'ios' ? 44 : 48,
|
|
23
|
+
shadow,
|
|
24
|
+
motion,
|
|
25
|
+
opacity,
|
|
26
|
+
iconSize,
|
|
27
|
+
minTouchSize: Platform.OS === 'ios' ? touch.ios : touch.android,
|
|
90
28
|
};
|
package/src/types/index.ts
CHANGED
|
@@ -12,8 +12,8 @@ export type ThemeColors = {
|
|
|
12
12
|
ring: string;
|
|
13
13
|
primary: string;
|
|
14
14
|
primaryForeground: string;
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
danger: string;
|
|
16
|
+
dangerForeground: string;
|
|
17
17
|
success: string;
|
|
18
18
|
successForeground: string;
|
|
19
19
|
warning: string;
|