@vetc-miniapp/ui-react 0.0.22 → 0.0.24
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 +375 -56
- package/package.json +17 -5
- package/src/dist/ui-react/index.js +1 -1
- package/src/ui-react/components/avatar/Avatar.tsx +88 -0
- package/src/ui-react/components/avatar/index.ts +2 -0
- package/src/ui-react/components/bottom-sheet/BottomSheet.tsx +149 -0
- package/src/ui-react/components/bottom-sheet/index.ts +2 -0
- package/src/ui-react/components/button/Button.tsx +246 -0
- package/src/ui-react/components/button/index.ts +2 -0
- package/src/ui-react/components/button-group/ButtonGroup.tsx +108 -0
- package/src/ui-react/components/button-group/index.ts +2 -0
- package/src/ui-react/components/card/Card.tsx +77 -0
- package/src/ui-react/components/card/index.ts +2 -0
- package/src/ui-react/components/checkbox/Checkbox.tsx +232 -0
- package/src/ui-react/components/checkbox/index.ts +2 -0
- package/src/ui-react/components/chip/Chip.tsx +137 -0
- package/src/ui-react/components/chip/index.ts +2 -0
- package/src/ui-react/components/dialog/Dialog.tsx +135 -0
- package/src/ui-react/components/dialog/index.ts +2 -0
- package/src/ui-react/components/divider/Divider.tsx +54 -0
- package/src/ui-react/components/divider/index.ts +2 -0
- package/src/ui-react/components/input/Input.tsx +195 -0
- package/src/ui-react/components/input/index.ts +2 -0
- package/src/ui-react/components/list/List.tsx +180 -0
- package/src/ui-react/components/list/index.ts +2 -0
- package/src/ui-react/components/loading/Loading.tsx +121 -0
- package/src/ui-react/components/loading/index.ts +2 -0
- package/src/ui-react/components/modal/Modal.tsx +116 -0
- package/src/ui-react/components/modal/index.ts +2 -0
- package/src/ui-react/components/navigation-bar/NavigationBar.tsx +188 -0
- package/src/ui-react/components/navigation-bar/index.ts +2 -0
- package/src/ui-react/components/radio/Radio.tsx +216 -0
- package/src/ui-react/components/radio/index.ts +2 -0
- package/src/ui-react/components/select/Select.tsx +109 -0
- package/src/ui-react/components/select/index.ts +2 -0
- package/src/ui-react/components/switch/Switch.tsx +164 -0
- package/src/ui-react/components/switch/index.ts +2 -0
- package/src/ui-react/components/tab-bar/TabBar.tsx +137 -0
- package/src/ui-react/components/tab-bar/index.ts +2 -0
- package/src/ui-react/components/textarea/Textarea.tsx +109 -0
- package/src/ui-react/components/textarea/index.ts +2 -0
- package/src/ui-react/components/toast/Toast.ts +98 -0
- package/src/ui-react/components/toast/index.ts +2 -0
- package/src/ui-react/components/typography/Typography.tsx +201 -0
- package/src/ui-react/components/typography/index.ts +2 -0
- package/src/ui-react/hooks/use-did-show.js +1 -0
- package/src/ui-react/hooks/use-tap-app-bar.js +26 -0
- package/src/ui-react/hooks/use-tap-app-bar.ts +34 -0
- package/src/ui-react/index.js +1 -0
- package/src/ui-react/index.ts +79 -3
- package/src/ui-react/styles/VETCProvider.tsx +152 -0
- package/src/ui-react/styles/tokens.css +427 -0
- package/src/ui-react/tokens/colors.ts +91 -0
- package/src/ui-react/tokens/index.ts +3 -0
- package/src/ui-react/tokens/spacing.ts +59 -0
- package/src/ui-react/tokens/typography.ts +63 -0
- package/src/ui-react/tokens_vetc.json +1517 -0
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* VETC Design System — Color Tokens
|
|
3
|
+
* Resolved from tokens_vetc.json
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
// ─── Global palette ───────────────────────────────────────────────────────────
|
|
7
|
+
export const colorGlobal = {
|
|
8
|
+
white: '#ffffff',
|
|
9
|
+
black: '#000000',
|
|
10
|
+
|
|
11
|
+
// Blue
|
|
12
|
+
blue02: '#f4fbff', blue05: '#e4f4ff', blue10: '#cae9ff',
|
|
13
|
+
blue15: '#afddff', blue20: '#95d1ff', blue25: '#7ac4fb',
|
|
14
|
+
blue30: '#60b6f4', blue35: '#45a8eb', blue40: '#2b99df',
|
|
15
|
+
blue45: '#108ad1', blue50: '#007ac1', blue60: '#005c9e',
|
|
16
|
+
blue70: '#004179', blue80: '#002853', blue90: '#00122a',
|
|
17
|
+
|
|
18
|
+
// Green (Brand)
|
|
19
|
+
green02: '#f2fef2', green05: '#dffbdf', green10: '#bff4bf',
|
|
20
|
+
green15: '#9feca7', green20: '#82e194', green25: '#68d583',
|
|
21
|
+
green30: '#50c775', green35: '#39b669', green40: '#25a45e',
|
|
22
|
+
green45: '#23965b', green50: '#208758', green60: '#1b6b4d',
|
|
23
|
+
green70: '#15503f', green80: '#0f342d', green90: '#081a18',
|
|
24
|
+
|
|
25
|
+
// Gray
|
|
26
|
+
gray02: '#f9fafa', gray05: '#f1f1f2', gray10: '#e3e4e6',
|
|
27
|
+
gray15: '#d4d6d9', gray20: '#c6c8cc', gray25: '#b8babf',
|
|
28
|
+
gray30: '#abacb2', gray35: '#9d9ea5', gray40: '#8f9098',
|
|
29
|
+
gray45: '#82828a', gray50: '#74747d', gray60: '#5e5d64',
|
|
30
|
+
gray70: '#47464b', gray80: '#2f2f32', gray90: '#181719',
|
|
31
|
+
|
|
32
|
+
// Red
|
|
33
|
+
red02: '#fff6f9', red05: '#ffe7f0', red10: '#ffd0de',
|
|
34
|
+
red15: '#ffb8cc', red20: '#ffa1b8', red25: '#ff89a3',
|
|
35
|
+
red30: '#fb718d', red35: '#f55c78', red40: '#ee4b62',
|
|
36
|
+
red45: '#e53b4d', red50: '#da2c39', red60: '#b4211f',
|
|
37
|
+
red70: '#852419', red80: '#571f12', red90: '#2b130a',
|
|
38
|
+
|
|
39
|
+
// Orange
|
|
40
|
+
orange02: '#fffbf0', orange05: '#fff3da', orange10: '#ffe3b4',
|
|
41
|
+
orange15: '#ffd08f', orange20: '#ffbb69', orange25: '#ffa447',
|
|
42
|
+
orange30: '#ff8c2f', orange35: '#ef7720', orange40: '#dd6e1d',
|
|
43
|
+
orange45: '#cb651b', orange50: '#b85c18', orange60: '#934913',
|
|
44
|
+
orange70: '#6f370f', orange80: '#4a250a', orange90: '#251205',
|
|
45
|
+
|
|
46
|
+
// Yellow
|
|
47
|
+
yellow02: '#fff8e7', yellow05: '#ffefbc', yellow10: '#ffe374',
|
|
48
|
+
yellow15: '#ffd62b', yellow20: '#f9c600', yellow25: '#e9b900',
|
|
49
|
+
yellow30: '#daaa00', yellow35: '#ca9b00', yellow40: '#bb8b00',
|
|
50
|
+
yellow45: '#ab7b00', yellow50: '#9c6b00', yellow60: '#7c4b00',
|
|
51
|
+
yellow70: '#5d2f00', yellow80: '#3e1800', yellow90: '#1f0700',
|
|
52
|
+
} as const;
|
|
53
|
+
|
|
54
|
+
// ─── Semantic alias tokens ─────────────────────────────────────────────────────
|
|
55
|
+
export const colorAlias = {
|
|
56
|
+
brand: colorGlobal.green40, // #25a45e
|
|
57
|
+
brandDark: colorGlobal.green50, // #208758
|
|
58
|
+
brandLight: colorGlobal.green05, // #dffbdf
|
|
59
|
+
|
|
60
|
+
positive: colorGlobal.green50, // #208758
|
|
61
|
+
positiveVariant: colorGlobal.green05, // #dffbdf
|
|
62
|
+
onPositive: colorGlobal.white,
|
|
63
|
+
onPositiveVariant: colorGlobal.green60,
|
|
64
|
+
|
|
65
|
+
negative: colorGlobal.red50, // #da2c39
|
|
66
|
+
onNegative: colorGlobal.white,
|
|
67
|
+
|
|
68
|
+
warning: colorGlobal.orange30, // #ff8c2f
|
|
69
|
+
onWarning: colorGlobal.white,
|
|
70
|
+
|
|
71
|
+
outline: colorGlobal.gray50, // #74747d
|
|
72
|
+
outlineVariant: colorGlobal.gray10, // #e3e4e6
|
|
73
|
+
outlineInverse: colorGlobal.gray40,
|
|
74
|
+
|
|
75
|
+
theme: colorGlobal.white,
|
|
76
|
+
themeVariant: colorGlobal.gray05, // #f1f1f2
|
|
77
|
+
inverseTheme: colorGlobal.gray90,
|
|
78
|
+
|
|
79
|
+
primaryOnTheme: colorGlobal.gray90, // #181719
|
|
80
|
+
secondaryOnTheme: colorGlobal.gray60, // #5e5d64
|
|
81
|
+
primaryOnInverseTheme: colorGlobal.white,
|
|
82
|
+
secondaryOnInverseTheme:colorGlobal.gray20,
|
|
83
|
+
|
|
84
|
+
disabledBackground: colorGlobal.gray10, // #e3e4e6
|
|
85
|
+
disabledContent: colorGlobal.gray30, // #abacb2
|
|
86
|
+
disabledOutline: colorGlobal.gray20,
|
|
87
|
+
|
|
88
|
+
overlay: 'rgba(0, 0, 0, 0.4)',
|
|
89
|
+
overlayVariant: 'rgba(0, 0, 0, 0.16)',
|
|
90
|
+
skeleton: 'rgba(0, 0, 0, 0.1)',
|
|
91
|
+
} as const;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* VETC Design System — Spacing & Sizing Tokens
|
|
3
|
+
* Base unit: 4px
|
|
4
|
+
*/
|
|
5
|
+
export const spacing = {
|
|
6
|
+
0: '0px',
|
|
7
|
+
1: '1px',
|
|
8
|
+
2: '2px',
|
|
9
|
+
4: '4px',
|
|
10
|
+
6: '6px',
|
|
11
|
+
8: '8px',
|
|
12
|
+
10: '10px',
|
|
13
|
+
12: '12px',
|
|
14
|
+
14: '14px',
|
|
15
|
+
16: '16px',
|
|
16
|
+
20: '20px',
|
|
17
|
+
24: '24px',
|
|
18
|
+
32: '32px',
|
|
19
|
+
40: '40px',
|
|
20
|
+
48: '48px',
|
|
21
|
+
56: '56px',
|
|
22
|
+
64: '64px',
|
|
23
|
+
72: '72px',
|
|
24
|
+
80: '80px',
|
|
25
|
+
} as const;
|
|
26
|
+
|
|
27
|
+
export const borderRadius = {
|
|
28
|
+
none: '0px',
|
|
29
|
+
xs: '4px',
|
|
30
|
+
sm: '6px',
|
|
31
|
+
md: '8px',
|
|
32
|
+
lg: '12px',
|
|
33
|
+
xl: '16px',
|
|
34
|
+
'2xl': '24px',
|
|
35
|
+
pill: '1000px',
|
|
36
|
+
} as const;
|
|
37
|
+
|
|
38
|
+
/** Component height standards from Figma */
|
|
39
|
+
export const componentHeight = {
|
|
40
|
+
buttonLg: '48px',
|
|
41
|
+
buttonSm: '32px',
|
|
42
|
+
input: '48px',
|
|
43
|
+
navBar: '56px',
|
|
44
|
+
bottomNav: '56px',
|
|
45
|
+
tabBar: '56px',
|
|
46
|
+
listItem: '56px',
|
|
47
|
+
chip: '32px',
|
|
48
|
+
chipSm: '24px',
|
|
49
|
+
iconStd: '24px',
|
|
50
|
+
iconSm: '20px',
|
|
51
|
+
} as const;
|
|
52
|
+
|
|
53
|
+
/** Shadow tokens */
|
|
54
|
+
export const shadow = {
|
|
55
|
+
none: 'none',
|
|
56
|
+
sm: '0 1px 4px rgba(0, 0, 0, 0.08)',
|
|
57
|
+
md: '0 2px 8px rgba(0, 0, 0, 0.12)',
|
|
58
|
+
lg: '0 4px 16px rgba(0, 0, 0, 0.16)',
|
|
59
|
+
} as const;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* VETC Design System — Typography Tokens
|
|
3
|
+
* From Figma: Tasco DLS Mini App — Typography page
|
|
4
|
+
* Font weights: Regular=400, Medium=500, SemiBold=600, Bold=700
|
|
5
|
+
* Font sizes: 2XS=10 / XS=12 / SM=14 / Base=16 / LG=20 / XL=24 / 2XL=28 / 3XL=32 / 4XL=36
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
export const fontFamily = {
|
|
9
|
+
primary: '"Roboto", system-ui, -apple-system, sans-serif',
|
|
10
|
+
} as const;
|
|
11
|
+
|
|
12
|
+
export const fontWeight = {
|
|
13
|
+
regular: 400,
|
|
14
|
+
medium: 500,
|
|
15
|
+
semibold: 600,
|
|
16
|
+
bold: 700,
|
|
17
|
+
black: 900,
|
|
18
|
+
} as const;
|
|
19
|
+
|
|
20
|
+
/** Font sizes from Figma Typography scale */
|
|
21
|
+
export const fontSize = {
|
|
22
|
+
'2xs': '10px', // 2X-Small
|
|
23
|
+
xs: '12px', // X-Small
|
|
24
|
+
sm: '14px', // Small
|
|
25
|
+
base: '16px', // Base
|
|
26
|
+
lg: '20px', // Large
|
|
27
|
+
xl: '24px', // X-Large
|
|
28
|
+
'2xl': '28px', // 2X-Large
|
|
29
|
+
'3xl': '32px', // 3X-Large
|
|
30
|
+
'4xl': '36px', // 4X-Large
|
|
31
|
+
} as const;
|
|
32
|
+
|
|
33
|
+
/** Line heights from Figma (pixel ratios per size) */
|
|
34
|
+
export const lineHeight = {
|
|
35
|
+
tight: '120%', // display: 36→44 ≈ 122%
|
|
36
|
+
normal: '140%', // heading: 20→28 = 140%
|
|
37
|
+
relaxed: '150%', // body/label: 16→24 = 150%
|
|
38
|
+
} as const;
|
|
39
|
+
|
|
40
|
+
export const letterSpacing = {
|
|
41
|
+
none: '0',
|
|
42
|
+
sm: '0.1px',
|
|
43
|
+
md: '0.25px',
|
|
44
|
+
lg: '0.5px',
|
|
45
|
+
} as const;
|
|
46
|
+
|
|
47
|
+
/** Typography style presets — Figma: Display=bold(700), Headline/Title/Label=semibold(600), Body=regular(400) */
|
|
48
|
+
export const textStyle = {
|
|
49
|
+
display4xl: { fontSize: fontSize['4xl'], fontWeight: fontWeight.bold, lineHeight: lineHeight.tight },
|
|
50
|
+
display3xl: { fontSize: fontSize['3xl'], fontWeight: fontWeight.bold, lineHeight: lineHeight.tight },
|
|
51
|
+
display2xl: { fontSize: fontSize['2xl'], fontWeight: fontWeight.bold, lineHeight: lineHeight.tight },
|
|
52
|
+
headlineXl: { fontSize: fontSize.xl, fontWeight: fontWeight.bold, lineHeight: lineHeight.normal },
|
|
53
|
+
headlineLg: { fontSize: fontSize.lg, fontWeight: fontWeight.semibold, lineHeight: lineHeight.normal },
|
|
54
|
+
titleBase: { fontSize: fontSize.base, fontWeight: fontWeight.semibold, lineHeight: lineHeight.relaxed, letterSpacing: letterSpacing.sm },
|
|
55
|
+
titleSm: { fontSize: fontSize.sm, fontWeight: fontWeight.semibold, lineHeight: lineHeight.relaxed, letterSpacing: letterSpacing.sm },
|
|
56
|
+
labelBase: { fontSize: fontSize.base, fontWeight: fontWeight.semibold, lineHeight: lineHeight.relaxed },
|
|
57
|
+
labelSm: { fontSize: fontSize.sm, fontWeight: fontWeight.semibold, lineHeight: lineHeight.relaxed, letterSpacing: letterSpacing.lg },
|
|
58
|
+
labelXs: { fontSize: fontSize.xs, fontWeight: fontWeight.semibold, lineHeight: lineHeight.relaxed, letterSpacing: letterSpacing.lg },
|
|
59
|
+
bodyBase: { fontSize: fontSize.base, fontWeight: fontWeight.regular, lineHeight: lineHeight.relaxed, letterSpacing: letterSpacing.sm },
|
|
60
|
+
bodySm: { fontSize: fontSize.sm, fontWeight: fontWeight.regular, lineHeight: lineHeight.relaxed, letterSpacing: letterSpacing.md },
|
|
61
|
+
bodyXs: { fontSize: fontSize.xs, fontWeight: fontWeight.regular, lineHeight: lineHeight.relaxed, letterSpacing: letterSpacing.lg },
|
|
62
|
+
body2xs: { fontSize: fontSize['2xs'], fontWeight: fontWeight.regular, lineHeight: lineHeight.relaxed, letterSpacing: letterSpacing.lg },
|
|
63
|
+
} as const;
|