@qumra/fanar-native 0.1.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/README.md +83 -0
- package/lib/art.d.ts +8 -0
- package/lib/art.js +29 -0
- package/lib/assets/art/avatar.png +0 -0
- package/lib/assets/art/empty.png +0 -0
- package/lib/assets/art/image-placeholder.png +0 -0
- package/lib/assets/art/plan-update.png +0 -0
- package/lib/assets/brand/app-store.png +0 -0
- package/lib/assets/brand/etisalat.png +0 -0
- package/lib/assets/brand/facebook.png +0 -0
- package/lib/assets/brand/google-play.png +0 -0
- package/lib/assets/brand/instagram.png +0 -0
- package/lib/assets/brand/orange.png +0 -0
- package/lib/assets/brand/snapchat.png +0 -0
- package/lib/assets/brand/tiktok.png +0 -0
- package/lib/assets/brand/vodafone.png +0 -0
- package/lib/assets/brand/we.png +0 -0
- package/lib/assets/brand/whatsapp.png +0 -0
- package/lib/assets/brand/x.png +0 -0
- package/lib/assets/brand/youtube.png +0 -0
- package/lib/components/Button.d.ts +28 -0
- package/lib/components/Button.js +75 -0
- package/lib/components/Disclosure.d.ts +41 -0
- package/lib/components/Disclosure.js +98 -0
- package/lib/components/Display.d.ts +88 -0
- package/lib/components/Display.js +157 -0
- package/lib/components/Drawer.d.ts +27 -0
- package/lib/components/Drawer.js +58 -0
- package/lib/components/Feedback.d.ts +43 -0
- package/lib/components/Feedback.js +136 -0
- package/lib/components/Form.d.ts +92 -0
- package/lib/components/Form.js +196 -0
- package/lib/components/Money.d.ts +29 -0
- package/lib/components/Money.js +65 -0
- package/lib/components/Nav.d.ts +29 -0
- package/lib/components/Nav.js +65 -0
- package/lib/components/NumberStepper.d.ts +16 -0
- package/lib/components/NumberStepper.js +79 -0
- package/lib/components/Overlay.d.ts +54 -0
- package/lib/components/Overlay.js +147 -0
- package/lib/components/Rating.d.ts +18 -0
- package/lib/components/Rating.js +32 -0
- package/lib/components/Shell.d.ts +54 -0
- package/lib/components/Shell.js +99 -0
- package/lib/components/Surfaces.d.ts +64 -0
- package/lib/components/Surfaces.js +122 -0
- package/lib/components/Text.d.ts +14 -0
- package/lib/components/Text.js +31 -0
- package/lib/components/currency.d.ts +251 -0
- package/lib/components/currency.js +48 -0
- package/lib/glyphs.d.ts +2 -0
- package/lib/glyphs.js +7 -0
- package/lib/i18n/content.d.ts +1 -0
- package/lib/i18n/content.js +28 -0
- package/lib/i18n/en.d.ts +1 -0
- package/lib/i18n/en.js +124 -0
- package/lib/i18n/index.d.ts +64 -0
- package/lib/i18n/index.js +91 -0
- package/lib/i18n/screens.d.ts +1 -0
- package/lib/i18n/screens.js +2025 -0
- package/lib/icons.d.ts +18 -0
- package/lib/icons.js +400 -0
- package/lib/index.d.ts +25 -0
- package/lib/index.js +25 -0
- package/lib/lib/a11y.d.ts +4 -0
- package/lib/lib/a11y.js +8 -0
- package/lib/lib/digits.d.ts +3 -0
- package/lib/lib/digits.js +22 -0
- package/lib/lib/motion.d.ts +14 -0
- package/lib/lib/motion.js +47 -0
- package/lib/lib/tone.d.ts +9 -0
- package/lib/lib/tone.js +16 -0
- package/lib/qumra/NavIcon.d.ts +14 -0
- package/lib/qumra/NavIcon.js +17 -0
- package/lib/qumra/QumraIcon.d.ts +17 -0
- package/lib/qumra/QumraIcon.js +91 -0
- package/lib/qumra/data.generated.d.ts +3 -0
- package/lib/qumra/data.generated.js +146 -0
- package/lib/qumra/types.d.ts +5 -0
- package/lib/qumra/types.js +1 -0
- package/lib/theme/context.d.ts +31 -0
- package/lib/theme/context.js +46 -0
- package/lib/theme/fonts.d.ts +9 -0
- package/lib/theme/fonts.js +36 -0
- package/lib/theme/index.d.ts +4 -0
- package/lib/theme/index.js +4 -0
- package/lib/theme/shadows.d.ts +2 -0
- package/lib/theme/shadows.js +30 -0
- package/lib/theme/theme.d.ts +52 -0
- package/lib/theme/theme.js +78 -0
- package/lib/tokens/generated.d.ts +180 -0
- package/lib/tokens/generated.js +173 -0
- package/lib/tokens/index.d.ts +1 -0
- package/lib/tokens/index.js +1 -0
- package/package.json +59 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type ColorMode, type FanarTheme } from './theme';
|
|
3
|
+
import { type FontSet } from './fonts';
|
|
4
|
+
import { type Dir, type Lang, type PhraseKey } from '../i18n';
|
|
5
|
+
export interface FanarContextValue {
|
|
6
|
+
theme: FanarTheme;
|
|
7
|
+
mode: ColorMode;
|
|
8
|
+
lang: Lang;
|
|
9
|
+
en: boolean;
|
|
10
|
+
dir: Dir;
|
|
11
|
+
t: (ar: string) => string;
|
|
12
|
+
p: (key: PhraseKey, vars?: Record<string, string | number>) => string;
|
|
13
|
+
pick: <T>(ar: T, en: T) => T;
|
|
14
|
+
}
|
|
15
|
+
export interface FanarProviderProps {
|
|
16
|
+
children: ReactNode;
|
|
17
|
+
mode?: ColorMode | 'system';
|
|
18
|
+
lang?: Lang;
|
|
19
|
+
fonts?: FontSet;
|
|
20
|
+
}
|
|
21
|
+
export declare function FanarProvider({ children, mode, lang, fonts, }: FanarProviderProps): import("react").JSX.Element;
|
|
22
|
+
export declare function useFanar(): FanarContextValue;
|
|
23
|
+
export declare function useTheme(): FanarTheme;
|
|
24
|
+
export declare function useLang(): {
|
|
25
|
+
lang: Lang;
|
|
26
|
+
en: boolean;
|
|
27
|
+
dir: Dir;
|
|
28
|
+
t: (ar: string) => string;
|
|
29
|
+
p: (key: PhraseKey, vars?: Record<string, string | number>) => string;
|
|
30
|
+
pick: <T>(ar: T, en: T) => T;
|
|
31
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createContext, useContext, useMemo } from 'react';
|
|
3
|
+
import { StyleSheet, useColorScheme, View } from 'react-native';
|
|
4
|
+
import { buildTheme } from './theme';
|
|
5
|
+
import { ALEXANDRIA } from './fonts';
|
|
6
|
+
import { phrase, translate } from '../i18n';
|
|
7
|
+
const Ctx = createContext(null);
|
|
8
|
+
export function FanarProvider({ children, mode = 'system', lang = 'ar', fonts = ALEXANDRIA, }) {
|
|
9
|
+
const scheme = useColorScheme();
|
|
10
|
+
const resolved = mode === 'system' ? (scheme === 'dark' ? 'dark' : 'light') : mode;
|
|
11
|
+
const value = useMemo(() => {
|
|
12
|
+
const en = lang === 'en';
|
|
13
|
+
return {
|
|
14
|
+
theme: buildTheme(resolved, fonts),
|
|
15
|
+
mode: resolved,
|
|
16
|
+
lang,
|
|
17
|
+
en,
|
|
18
|
+
dir: en ? 'ltr' : 'rtl',
|
|
19
|
+
t: (ar) => translate(ar, en),
|
|
20
|
+
p: (key, vars) => phrase(key, en, vars),
|
|
21
|
+
pick: (ar, enValue) => (en ? enValue : ar),
|
|
22
|
+
};
|
|
23
|
+
}, [resolved, lang, fonts]);
|
|
24
|
+
return (_jsx(Ctx.Provider, { value: value, children: _jsx(View, { style: [styles.root, { direction: value.dir }], children: children }) }));
|
|
25
|
+
}
|
|
26
|
+
const styles = StyleSheet.create({ root: { flex: 1 } });
|
|
27
|
+
const FALLBACK = {
|
|
28
|
+
theme: buildTheme('light'),
|
|
29
|
+
mode: 'light',
|
|
30
|
+
lang: 'ar',
|
|
31
|
+
en: false,
|
|
32
|
+
dir: 'rtl',
|
|
33
|
+
t: (ar) => ar,
|
|
34
|
+
p: (key, vars) => phrase(key, false, vars),
|
|
35
|
+
pick: (ar) => ar,
|
|
36
|
+
};
|
|
37
|
+
export function useFanar() {
|
|
38
|
+
return useContext(Ctx) ?? FALLBACK;
|
|
39
|
+
}
|
|
40
|
+
export function useTheme() {
|
|
41
|
+
return useFanar().theme;
|
|
42
|
+
}
|
|
43
|
+
export function useLang() {
|
|
44
|
+
const { lang, en, dir, t, p, pick } = useFanar();
|
|
45
|
+
return { lang, en, dir, t, p, pick };
|
|
46
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { TextStyle } from 'react-native';
|
|
2
|
+
export type Weight = 'extraLight' | 'light' | 'regular' | 'medium' | 'semiBold' | 'bold' | 'extraBold' | 'black';
|
|
3
|
+
export declare const WEIGHT_VALUE: Record<Weight, TextStyle['fontWeight']>;
|
|
4
|
+
export type FontSet = Partial<Record<Weight, string | undefined>>;
|
|
5
|
+
export declare const ALEXANDRIA: FontSet;
|
|
6
|
+
export declare const SYSTEM_FONT: FontSet;
|
|
7
|
+
export declare const DEFAULT_MIN_LEADING = 1.22;
|
|
8
|
+
export declare function minLeadingFor(set: FontSet): number;
|
|
9
|
+
export declare function fontFor(set: FontSet, weight: Weight): TextStyle;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export const WEIGHT_VALUE = {
|
|
2
|
+
extraLight: '200',
|
|
3
|
+
light: '300',
|
|
4
|
+
regular: '400',
|
|
5
|
+
medium: '500',
|
|
6
|
+
semiBold: '600',
|
|
7
|
+
bold: '700',
|
|
8
|
+
extraBold: '800',
|
|
9
|
+
black: '900',
|
|
10
|
+
};
|
|
11
|
+
export const ALEXANDRIA = {
|
|
12
|
+
extraLight: 'Alexandria-ExtraLight',
|
|
13
|
+
light: 'Alexandria-Light',
|
|
14
|
+
regular: 'Alexandria-Regular',
|
|
15
|
+
medium: 'Alexandria-Medium',
|
|
16
|
+
semiBold: 'Alexandria-SemiBold',
|
|
17
|
+
bold: 'Alexandria-Bold',
|
|
18
|
+
extraBold: 'Alexandria-ExtraBold',
|
|
19
|
+
black: 'Alexandria-Black',
|
|
20
|
+
};
|
|
21
|
+
export const SYSTEM_FONT = {};
|
|
22
|
+
const LINE_BOX = {
|
|
23
|
+
'Alexandria-Regular': 1.22,
|
|
24
|
+
'Zain-Regular': 1.4,
|
|
25
|
+
};
|
|
26
|
+
export const DEFAULT_MIN_LEADING = 1.22;
|
|
27
|
+
export function minLeadingFor(set) {
|
|
28
|
+
const regular = set.regular;
|
|
29
|
+
if (!regular)
|
|
30
|
+
return 1;
|
|
31
|
+
return LINE_BOX[regular] ?? DEFAULT_MIN_LEADING;
|
|
32
|
+
}
|
|
33
|
+
export function fontFor(set, weight) {
|
|
34
|
+
const fontFamily = set[weight];
|
|
35
|
+
return fontFamily ? { fontFamily, fontWeight: WEIGHT_VALUE[weight] } : { fontWeight: WEIGHT_VALUE[weight] };
|
|
36
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { FanarProvider, useFanar, useTheme, useLang, type FanarContextValue, type FanarProviderProps } from './context';
|
|
2
|
+
export { buildTheme, space, SPACE, LEADING, DURATION, type FanarTheme, type ColorMode, type SpaceStep, type Leading } from './theme';
|
|
3
|
+
export { ALEXANDRIA, SYSTEM_FONT, WEIGHT_VALUE, fontFor, type FontSet, type Weight } from './fonts';
|
|
4
|
+
export { rnShadow } from './shadows';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Platform } from 'react-native';
|
|
2
|
+
function splitColor(raw) {
|
|
3
|
+
const fn = raw.match(/^rgba?\(\s*([\d.]+)[\s,]+([\d.]+)[\s,]+([\d.]+)\s*(?:[/,]\s*([\d.]+)\s*)?\)$/);
|
|
4
|
+
if (fn) {
|
|
5
|
+
const hex = fn
|
|
6
|
+
.slice(1, 4)
|
|
7
|
+
.map((n) => Number(n).toString(16).padStart(2, '0'))
|
|
8
|
+
.join('');
|
|
9
|
+
return [`#${hex}`, fn[4] === undefined ? 1 : Number(fn[4])];
|
|
10
|
+
}
|
|
11
|
+
return [raw, 1];
|
|
12
|
+
}
|
|
13
|
+
export function rnShadow(value, tokens) {
|
|
14
|
+
if (value.includes('inset'))
|
|
15
|
+
return null;
|
|
16
|
+
const resolved = value.replace(/var\(\s*(--[\w-]+)\s*\)/g, (_, name) => tokens[name] ?? '');
|
|
17
|
+
const parts = resolved.match(/^(-?[\d.]+)(?:px)?\s+(-?[\d.]+)(?:px)?\s+([\d.]+)(?:px)?\s+(.+)$/);
|
|
18
|
+
if (!parts)
|
|
19
|
+
return null;
|
|
20
|
+
const [, x, y, blur, color] = parts;
|
|
21
|
+
const [shadowColor, opacity] = splitColor((color ?? '').trim());
|
|
22
|
+
return {
|
|
23
|
+
shadowColor,
|
|
24
|
+
shadowOpacity: opacity,
|
|
25
|
+
shadowOffset: { width: Number(x), height: Number(y) },
|
|
26
|
+
shadowRadius: Number(blur) / 2,
|
|
27
|
+
elevation: Math.max(1, Math.round(Number(blur) / 2)),
|
|
28
|
+
...Platform.select({ android: { shadowColor }, default: {} }),
|
|
29
|
+
};
|
|
30
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { ViewStyle } from 'react-native';
|
|
2
|
+
import { type ColorToken, type Radius, type Shadow, type TextSize } from '../tokens';
|
|
3
|
+
import { fontFor, type FontSet, type Weight } from './fonts';
|
|
4
|
+
export type ColorMode = 'light' | 'dark';
|
|
5
|
+
export declare const space: (steps: number) => number;
|
|
6
|
+
export declare const SPACE: {
|
|
7
|
+
readonly none: 0;
|
|
8
|
+
readonly hair: 2;
|
|
9
|
+
readonly xs: 4;
|
|
10
|
+
readonly sm: 6;
|
|
11
|
+
readonly md: 8;
|
|
12
|
+
readonly lg: 12;
|
|
13
|
+
readonly xl: 14;
|
|
14
|
+
readonly '2xl': 16;
|
|
15
|
+
readonly '3xl': 18;
|
|
16
|
+
readonly '4xl': 20;
|
|
17
|
+
readonly '5xl': 22;
|
|
18
|
+
readonly '6xl': 26;
|
|
19
|
+
};
|
|
20
|
+
export type SpaceStep = keyof typeof SPACE;
|
|
21
|
+
export declare const LEADING: {
|
|
22
|
+
readonly none: 1.22;
|
|
23
|
+
readonly tight: 1.35;
|
|
24
|
+
readonly normal: 1.6;
|
|
25
|
+
readonly relaxed: 1.75;
|
|
26
|
+
readonly input: 1.9;
|
|
27
|
+
};
|
|
28
|
+
export type Leading = keyof typeof LEADING;
|
|
29
|
+
export declare const DURATION: {
|
|
30
|
+
readonly fade: 160;
|
|
31
|
+
readonly sheet: 260;
|
|
32
|
+
readonly drawer: 320;
|
|
33
|
+
readonly savebar: 200;
|
|
34
|
+
readonly toast: 220;
|
|
35
|
+
readonly press: 90;
|
|
36
|
+
};
|
|
37
|
+
export interface FanarTheme {
|
|
38
|
+
mode: ColorMode;
|
|
39
|
+
dark: boolean;
|
|
40
|
+
color: Record<ColorToken, string>;
|
|
41
|
+
text: Record<TextSize, number>;
|
|
42
|
+
radius: Record<Radius, number>;
|
|
43
|
+
shadow: Record<Shadow, ViewStyle>;
|
|
44
|
+
space: typeof SPACE;
|
|
45
|
+
leading: typeof LEADING;
|
|
46
|
+
duration: typeof DURATION;
|
|
47
|
+
fonts: FontSet;
|
|
48
|
+
font: (weight: Weight) => ReturnType<typeof fontFor>;
|
|
49
|
+
minLeading: number;
|
|
50
|
+
colorOf: (name: ColorToken | (string & {}) | undefined, fallback: string) => string;
|
|
51
|
+
}
|
|
52
|
+
export declare function buildTheme(mode: ColorMode, fonts?: FontSet): FanarTheme;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { COLOR_SCALE, DARK_TOKENS, RADIUS_PX, SHADOW_SCALE, TEXT_PX, TOKENS, } from '../tokens';
|
|
2
|
+
import { rnShadow } from './shadows';
|
|
3
|
+
import { ALEXANDRIA, fontFor, minLeadingFor } from './fonts';
|
|
4
|
+
export const space = (steps) => steps * 4;
|
|
5
|
+
export const SPACE = {
|
|
6
|
+
none: 0,
|
|
7
|
+
hair: 2,
|
|
8
|
+
xs: 4,
|
|
9
|
+
sm: 6,
|
|
10
|
+
md: 8,
|
|
11
|
+
lg: 12,
|
|
12
|
+
xl: 14,
|
|
13
|
+
'2xl': 16,
|
|
14
|
+
'3xl': 18,
|
|
15
|
+
'4xl': 20,
|
|
16
|
+
'5xl': 22,
|
|
17
|
+
'6xl': 26,
|
|
18
|
+
};
|
|
19
|
+
export const LEADING = {
|
|
20
|
+
none: 1.22,
|
|
21
|
+
tight: 1.35,
|
|
22
|
+
normal: 1.6,
|
|
23
|
+
relaxed: 1.75,
|
|
24
|
+
input: 1.9,
|
|
25
|
+
};
|
|
26
|
+
export const DURATION = {
|
|
27
|
+
fade: 160,
|
|
28
|
+
sheet: 260,
|
|
29
|
+
drawer: 320,
|
|
30
|
+
savebar: 200,
|
|
31
|
+
toast: 220,
|
|
32
|
+
press: 90,
|
|
33
|
+
};
|
|
34
|
+
function shadowScale(tokens) {
|
|
35
|
+
const out = {};
|
|
36
|
+
for (const step of SHADOW_SCALE) {
|
|
37
|
+
const raw = tokens[`--shadow-${step}`];
|
|
38
|
+
out[step] = (raw && rnShadow(raw, tokens)) || {};
|
|
39
|
+
}
|
|
40
|
+
out.sheet = {
|
|
41
|
+
...(rnShadow('0 -14px 40px rgb(2 8 9 / 0.28)', tokens) ?? {}),
|
|
42
|
+
};
|
|
43
|
+
return out;
|
|
44
|
+
}
|
|
45
|
+
const CACHE = {};
|
|
46
|
+
export function buildTheme(mode, fonts = ALEXANDRIA) {
|
|
47
|
+
const key = `${mode}:${Object.values(fonts).join('|')}`;
|
|
48
|
+
const hit = CACHE[key];
|
|
49
|
+
if (hit)
|
|
50
|
+
return hit;
|
|
51
|
+
if (!TOKENS || !TOKENS['--color-brand'])
|
|
52
|
+
throw new Error('[fanar-native] التوكنز ما اتحمّلتش — `src/tokens/generated.ts` مش متحلّ صح. ' +
|
|
53
|
+
'شغّل `node scripts/generate-tokens.mjs`، وشوف تعليق ترتيب الامتدادات في `src/tokens/index.ts`.');
|
|
54
|
+
const dark = mode === 'dark';
|
|
55
|
+
const tokens = dark
|
|
56
|
+
? { ...TOKENS, ...DARK_TOKENS }
|
|
57
|
+
: { ...TOKENS };
|
|
58
|
+
const color = {};
|
|
59
|
+
for (const name of COLOR_SCALE)
|
|
60
|
+
color[name] = tokens[`--color-${name}`] ?? '#000000';
|
|
61
|
+
const theme = {
|
|
62
|
+
mode,
|
|
63
|
+
dark,
|
|
64
|
+
color,
|
|
65
|
+
text: { ...TEXT_PX },
|
|
66
|
+
radius: { ...RADIUS_PX },
|
|
67
|
+
shadow: shadowScale(tokens),
|
|
68
|
+
space: SPACE,
|
|
69
|
+
leading: LEADING,
|
|
70
|
+
duration: DURATION,
|
|
71
|
+
fonts,
|
|
72
|
+
font: (weight) => fontFor(fonts, weight),
|
|
73
|
+
minLeading: minLeadingFor(fonts),
|
|
74
|
+
colorOf: (name, fallback) => (name && color[name]) || (name?.startsWith('#') ? name : fallback),
|
|
75
|
+
};
|
|
76
|
+
CACHE[key] = theme;
|
|
77
|
+
return theme;
|
|
78
|
+
}
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
export declare const TEXT_SCALE: readonly ["micro", "caption", "ui", "body", "lead", "base", "h4", "h3", "h2", "h1", "display", "hero", "title", "mega"];
|
|
2
|
+
export type TextSize = (typeof TEXT_SCALE)[number];
|
|
3
|
+
export declare const RADIUS_SCALE: readonly ["mark", "xs", "sm", "field", "card", "lg", "section", "full"];
|
|
4
|
+
export type Radius = (typeof RADIUS_SCALE)[number];
|
|
5
|
+
export declare const SHADOW_SCALE: readonly ["raise", "tip", "panel", "pop", "modal", "toast", "sheet"];
|
|
6
|
+
export type Shadow = (typeof SHADOW_SCALE)[number];
|
|
7
|
+
export declare const CONTAINER_SCALE: readonly ["page", "shell", "note", "lead"];
|
|
8
|
+
export type Container = (typeof CONTAINER_SCALE)[number];
|
|
9
|
+
export declare const ANIMATE_SCALE: readonly ["qfade", "qslide", "tip", "tip-up", "drawer", "drawer-rtl", "savebar", "skeleton"];
|
|
10
|
+
export type Animation = (typeof ANIMATE_SCALE)[number];
|
|
11
|
+
export declare const COLOR_SCALE: readonly ["surface", "bg", "line", "hover", "ink", "ink2", "muted", "muted2", "border", "soft", "soft2", "brand-100", "brand-900", "brand-ink", "brand", "brand-hover", "brand-deep", "skeleton", "tint", "tint2", "mint", "amber-900", "amber", "amber-bg", "amber-ink", "amber-line", "amber-hover", "green", "green-bg", "green-bg2", "green-line", "green-solid", "violet", "violet-bg", "violet-line", "violet-solid", "red-100", "red", "red-bg", "red-line", "danger", "danger-hover", "night", "hero-body", "hero-meta", "hero-dim", "hero-text", "code-bg", "code-plain", "code-key", "code-tag", "code-attr", "code-str", "code-num", "code-note", "code-dim", "code-line", "code-chip"];
|
|
12
|
+
export type ColorToken = (typeof COLOR_SCALE)[number];
|
|
13
|
+
export declare const TOKENS: {
|
|
14
|
+
readonly '--font-sans': "\"Alexandria\", system-ui, sans-serif";
|
|
15
|
+
readonly '--color-surface': "#ffffff";
|
|
16
|
+
readonly '--color-bg': "#f7f9f9";
|
|
17
|
+
readonly '--color-line': "#edf1f1";
|
|
18
|
+
readonly '--color-hover': "#f2f6f6";
|
|
19
|
+
readonly '--color-ink': "#020809";
|
|
20
|
+
readonly '--color-ink2': "#3d4545";
|
|
21
|
+
readonly '--color-muted': "#5f6a6a";
|
|
22
|
+
readonly '--color-muted2': "#687373";
|
|
23
|
+
readonly '--color-border': "#7f8c8c";
|
|
24
|
+
readonly '--color-soft': "#eaf2f3";
|
|
25
|
+
readonly '--color-soft2': "#dceded";
|
|
26
|
+
readonly '--color-brand-100': "#a5c9cc";
|
|
27
|
+
readonly '--color-brand-900': "#0a2528";
|
|
28
|
+
readonly '--color-brand-ink': "#0f4a4e";
|
|
29
|
+
readonly '--color-brand': "#207982";
|
|
30
|
+
readonly '--color-brand-hover': "#1a646c";
|
|
31
|
+
readonly '--color-brand-deep': "#0b3b3e";
|
|
32
|
+
readonly '--color-skeleton': "#d6dcdc";
|
|
33
|
+
readonly '--color-tint': "#f4faf8";
|
|
34
|
+
readonly '--color-tint2': "#eff6f3";
|
|
35
|
+
readonly '--color-mint': "#7dd3c0";
|
|
36
|
+
readonly '--color-amber-900': "#3d2a05";
|
|
37
|
+
readonly '--color-amber': "#f8ac33";
|
|
38
|
+
readonly '--color-amber-bg': "#fef6e9";
|
|
39
|
+
readonly '--color-amber-ink': "#85570f";
|
|
40
|
+
readonly '--color-amber-line': "#fbd79a";
|
|
41
|
+
readonly '--color-amber-hover': "#de9219";
|
|
42
|
+
readonly '--color-green': "#1e7a45";
|
|
43
|
+
readonly '--color-green-bg': "#f1faf4";
|
|
44
|
+
readonly '--color-green-bg2': "#e9f6ee";
|
|
45
|
+
readonly '--color-green-line': "#bfe6ce";
|
|
46
|
+
readonly '--color-green-solid': "#1e7a45";
|
|
47
|
+
readonly '--color-violet': "#4b3e8e";
|
|
48
|
+
readonly '--color-violet-bg': "#edeaf6";
|
|
49
|
+
readonly '--color-violet-line': "#ded8ef";
|
|
50
|
+
readonly '--color-violet-solid': "#6d5eb8";
|
|
51
|
+
readonly '--color-red-100': "#f3a79e";
|
|
52
|
+
readonly '--color-red': "#8e2b20";
|
|
53
|
+
readonly '--color-red-bg': "#fdecea";
|
|
54
|
+
readonly '--color-red-line': "#f3c9c4";
|
|
55
|
+
readonly '--color-danger': "#c94134";
|
|
56
|
+
readonly '--color-danger-hover': "#a3362b";
|
|
57
|
+
readonly '--color-night': "#0b0f12";
|
|
58
|
+
readonly '--color-hero-body': "#bfd9d8";
|
|
59
|
+
readonly '--color-hero-meta': "#8fb3b2";
|
|
60
|
+
readonly '--color-hero-dim': "#5e7a79";
|
|
61
|
+
readonly '--color-hero-text': "#d7e3e2";
|
|
62
|
+
readonly '--color-code-bg': "#1f1f1f";
|
|
63
|
+
readonly '--color-code-plain': "#d4d4d4";
|
|
64
|
+
readonly '--color-code-key': "#569cd6";
|
|
65
|
+
readonly '--color-code-tag': "#4ec9b0";
|
|
66
|
+
readonly '--color-code-attr': "#9cdcfe";
|
|
67
|
+
readonly '--color-code-str': "#ce9178";
|
|
68
|
+
readonly '--color-code-num': "#b5cea8";
|
|
69
|
+
readonly '--color-code-note': "#6a9955";
|
|
70
|
+
readonly '--color-code-dim': "#858585";
|
|
71
|
+
readonly '--color-code-line': "#303031";
|
|
72
|
+
readonly '--color-code-chip': "#f4f7f7";
|
|
73
|
+
readonly '--text-micro': "11px";
|
|
74
|
+
readonly '--text-caption': "12px";
|
|
75
|
+
readonly '--text-ui': "13px";
|
|
76
|
+
readonly '--text-body': "14px";
|
|
77
|
+
readonly '--text-lead': "15px";
|
|
78
|
+
readonly '--text-base': "16px";
|
|
79
|
+
readonly '--text-base--line-height': "initial";
|
|
80
|
+
readonly '--text-h4': "17px";
|
|
81
|
+
readonly '--text-h3': "20px";
|
|
82
|
+
readonly '--text-h2': "24px";
|
|
83
|
+
readonly '--text-h1': "30px";
|
|
84
|
+
readonly '--text-display': "36px";
|
|
85
|
+
readonly '--text-hero': "44px";
|
|
86
|
+
readonly '--text-title': "40px";
|
|
87
|
+
readonly '--text-mega': "54px";
|
|
88
|
+
readonly '--container-page': "1600px";
|
|
89
|
+
readonly '--container-shell': "1600px";
|
|
90
|
+
readonly '--container-note': "340px";
|
|
91
|
+
readonly '--container-lead': "520px";
|
|
92
|
+
readonly '--radius-mark': "3px";
|
|
93
|
+
readonly '--radius-xs': "5px";
|
|
94
|
+
readonly '--radius-sm': "7px";
|
|
95
|
+
readonly '--radius-field': "9px";
|
|
96
|
+
readonly '--radius-card': "12px";
|
|
97
|
+
readonly '--radius-lg': "14px";
|
|
98
|
+
readonly '--radius-section': "18px";
|
|
99
|
+
readonly '--radius-full': "999px";
|
|
100
|
+
readonly '--shadow-raise': "0 1px 3px var(--shadow-color)";
|
|
101
|
+
readonly '--shadow-tip': "0 6px 18px var(--shadow-color)";
|
|
102
|
+
readonly '--shadow-panel': "0 10px 30px var(--shadow-color)";
|
|
103
|
+
readonly '--shadow-pop': "0 18px 44px var(--shadow-color)";
|
|
104
|
+
readonly '--shadow-modal': "0 24px 60px rgb(2 8 9 / 0.28)";
|
|
105
|
+
readonly '--shadow-toast': "0 16px 40px rgb(2 8 9 / 0.26)";
|
|
106
|
+
readonly '--shadow-sheet': "0 -14px 40px rgb(2 8 9 / 0.28), inset 0 1px 0 rgb(255 255 255 / 0.06)";
|
|
107
|
+
readonly '--shadow-color': "rgb(2 8 9 / 0.14)";
|
|
108
|
+
readonly '--animate-qfade': "qfade 0.16s ease-out";
|
|
109
|
+
readonly '--animate-qslide': "qslidein 0.22s ease-out";
|
|
110
|
+
readonly '--animate-tip': "tip-in 0.26s cubic-bezier(0.2, 0.8, 0.2, 1)";
|
|
111
|
+
readonly '--animate-tip-up': "tip-up 0.3s cubic-bezier(0.2, 0.9, 0.2, 1)";
|
|
112
|
+
readonly '--animate-drawer': "drawer-ltr 0.32s cubic-bezier(0.2, 0.9, 0.2, 1)";
|
|
113
|
+
readonly '--animate-drawer-rtl': "drawer-rtl 0.32s cubic-bezier(0.2, 0.9, 0.2, 1)";
|
|
114
|
+
readonly '--animate-savebar': "savebar-in 0.2s cubic-bezier(0.2, 0.8, 0.2, 1)";
|
|
115
|
+
readonly '--animate-skeleton': "skeleton-pulse 1.6s ease-in-out infinite";
|
|
116
|
+
readonly '--num-align': "right";
|
|
117
|
+
readonly '--num-align-far': "left";
|
|
118
|
+
readonly '--num-pad-right': "0.875rem";
|
|
119
|
+
readonly '--num-pad-left': "3.5rem";
|
|
120
|
+
readonly '--num-icon-pad-right': "2.5rem";
|
|
121
|
+
readonly '--num-icon-pad-left': "0.875rem";
|
|
122
|
+
};
|
|
123
|
+
export declare const DARK_TOKENS: {
|
|
124
|
+
readonly '--color-surface': "#101718";
|
|
125
|
+
readonly '--color-bg': "#0a0f10";
|
|
126
|
+
readonly '--color-line': "#1e2829";
|
|
127
|
+
readonly '--color-hover': "#1a2425";
|
|
128
|
+
readonly '--color-ink': "#f2f6f6";
|
|
129
|
+
readonly '--color-ink2': "#c7d1d1";
|
|
130
|
+
readonly '--color-muted': "#93a0a0";
|
|
131
|
+
readonly '--color-muted2': "#7a8787";
|
|
132
|
+
readonly '--color-border': "#5e6b6c";
|
|
133
|
+
readonly '--color-soft': "#12363a";
|
|
134
|
+
readonly '--color-soft2': "#17454a";
|
|
135
|
+
readonly '--color-brand-ink': "#7dd3c0";
|
|
136
|
+
readonly '--color-skeleton': "#2c3232";
|
|
137
|
+
readonly '--color-amber': "#f8ac33";
|
|
138
|
+
readonly '--color-amber-bg': "#2b2009";
|
|
139
|
+
readonly '--color-amber-ink': "#f5c77a";
|
|
140
|
+
readonly '--color-amber-line': "#5c4415";
|
|
141
|
+
readonly '--color-green': "#6ecf9a";
|
|
142
|
+
readonly '--color-green-bg': "#0d2119";
|
|
143
|
+
readonly '--color-green-bg2': "#102a22";
|
|
144
|
+
readonly '--color-green-line': "#245140";
|
|
145
|
+
readonly '--color-violet': "#b9aeea";
|
|
146
|
+
readonly '--color-violet-bg': "#1e1a33";
|
|
147
|
+
readonly '--color-violet-line': "#38305c";
|
|
148
|
+
readonly '--color-red': "#f3a79e";
|
|
149
|
+
readonly '--color-red-bg': "#2c1613";
|
|
150
|
+
readonly '--color-red-line': "#5c2a24";
|
|
151
|
+
readonly '--color-code-chip': "#17201f";
|
|
152
|
+
readonly '--shadow-color': "rgb(0 0 0 / 0.55)";
|
|
153
|
+
};
|
|
154
|
+
export type TokenName = keyof typeof TOKENS;
|
|
155
|
+
export declare const TEXT_PX: {
|
|
156
|
+
readonly micro: 11;
|
|
157
|
+
readonly caption: 12;
|
|
158
|
+
readonly ui: 13;
|
|
159
|
+
readonly body: 14;
|
|
160
|
+
readonly lead: 15;
|
|
161
|
+
readonly base: 16;
|
|
162
|
+
readonly h4: 17;
|
|
163
|
+
readonly h3: 20;
|
|
164
|
+
readonly h2: 24;
|
|
165
|
+
readonly h1: 30;
|
|
166
|
+
readonly display: 36;
|
|
167
|
+
readonly hero: 44;
|
|
168
|
+
readonly title: 40;
|
|
169
|
+
readonly mega: 54;
|
|
170
|
+
};
|
|
171
|
+
export declare const RADIUS_PX: {
|
|
172
|
+
readonly mark: 3;
|
|
173
|
+
readonly xs: 5;
|
|
174
|
+
readonly sm: 7;
|
|
175
|
+
readonly field: 9;
|
|
176
|
+
readonly card: 12;
|
|
177
|
+
readonly lg: 14;
|
|
178
|
+
readonly section: 18;
|
|
179
|
+
readonly full: 999;
|
|
180
|
+
};
|