crew-recommendation-ui 0.0.1
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 +156 -0
- package/dist/Card-C6fF0ZrH.js +197 -0
- package/dist/Card-C6fF0ZrH.js.map +1 -0
- package/dist/dls/index.d.ts +8 -0
- package/dist/dls/index.d.ts.map +1 -0
- package/dist/dls/index.js +25 -0
- package/dist/dls/index.js.map +1 -0
- package/dist/dls/tokens/colors.d.ts +77 -0
- package/dist/dls/tokens/colors.d.ts.map +1 -0
- package/dist/dls/tokens/index.d.ts +215 -0
- package/dist/dls/tokens/index.d.ts.map +1 -0
- package/dist/dls/tokens/spacing.d.ts +46 -0
- package/dist/dls/tokens/spacing.d.ts.map +1 -0
- package/dist/dls/tokens/typography.d.ts +102 -0
- package/dist/dls/tokens/typography.d.ts.map +1 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +20 -0
- package/dist/index.js.map +1 -0
- package/dist/package.json +60 -0
- package/dist/recommendation/components/Card.d.ts +13 -0
- package/dist/recommendation/components/Card.d.ts.map +1 -0
- package/dist/recommendation/components/index.d.ts +6 -0
- package/dist/recommendation/components/index.d.ts.map +1 -0
- package/dist/recommendation/index.d.ts +9 -0
- package/dist/recommendation/index.d.ts.map +1 -0
- package/dist/recommendation/index.js +6 -0
- package/dist/recommendation/index.js.map +1 -0
- package/dist/recommendation/types.d.ts +71 -0
- package/dist/recommendation/types.d.ts.map +1 -0
- package/dist/typography-zz5GzgjI.js +245 -0
- package/dist/typography-zz5GzgjI.js.map +1 -0
- package/package.json +60 -0
- package/src/dls/index.ts +15 -0
- package/src/dls/tokens/colors.ts +94 -0
- package/src/dls/tokens/index.ts +30 -0
- package/src/dls/tokens/spacing.ts +62 -0
- package/src/dls/tokens/typography.ts +119 -0
- package/src/index.ts +25 -0
- package/src/recommendation/components/Card.tsx +191 -0
- package/src/recommendation/components/index.ts +14 -0
- package/src/recommendation/index.ts +15 -0
- package/src/recommendation/types.ts +87 -0
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
const colors = {
|
|
2
|
+
// Primary brand colors
|
|
3
|
+
primary: {
|
|
4
|
+
50: "#f0f9ff",
|
|
5
|
+
100: "#e0f2fe",
|
|
6
|
+
200: "#bae6fd",
|
|
7
|
+
300: "#7dd3fc",
|
|
8
|
+
400: "#38bdf8",
|
|
9
|
+
500: "#0ea5e9",
|
|
10
|
+
600: "#0284c7",
|
|
11
|
+
700: "#0369a1",
|
|
12
|
+
800: "#075985",
|
|
13
|
+
900: "#0c4a6e"
|
|
14
|
+
},
|
|
15
|
+
// Neutral/Gray scale
|
|
16
|
+
neutral: {
|
|
17
|
+
0: "#ffffff",
|
|
18
|
+
50: "#fafafa",
|
|
19
|
+
100: "#f4f4f5",
|
|
20
|
+
200: "#e4e4e7",
|
|
21
|
+
300: "#d4d4d8",
|
|
22
|
+
400: "#a1a1aa",
|
|
23
|
+
500: "#71717a",
|
|
24
|
+
600: "#52525b",
|
|
25
|
+
700: "#3f3f46",
|
|
26
|
+
800: "#27272a",
|
|
27
|
+
900: "#18181b",
|
|
28
|
+
950: "#09090b"
|
|
29
|
+
},
|
|
30
|
+
// Success colors
|
|
31
|
+
success: {
|
|
32
|
+
50: "#f0fdf4",
|
|
33
|
+
100: "#dcfce7",
|
|
34
|
+
500: "#22c55e",
|
|
35
|
+
600: "#16a34a",
|
|
36
|
+
700: "#15803d"
|
|
37
|
+
},
|
|
38
|
+
// Warning colors
|
|
39
|
+
warning: {
|
|
40
|
+
50: "#fffbeb",
|
|
41
|
+
100: "#fef3c7",
|
|
42
|
+
500: "#f59e0b",
|
|
43
|
+
600: "#d97706",
|
|
44
|
+
700: "#b45309"
|
|
45
|
+
},
|
|
46
|
+
// Error colors
|
|
47
|
+
error: {
|
|
48
|
+
50: "#fef2f2",
|
|
49
|
+
100: "#fee2e2",
|
|
50
|
+
500: "#ef4444",
|
|
51
|
+
600: "#dc2626",
|
|
52
|
+
700: "#b91c1c"
|
|
53
|
+
},
|
|
54
|
+
// Special colors for recommendation cards
|
|
55
|
+
card: {
|
|
56
|
+
background: {
|
|
57
|
+
light: "#ffffff",
|
|
58
|
+
dark: "#1a1a1a"
|
|
59
|
+
},
|
|
60
|
+
border: {
|
|
61
|
+
light: "#e4e4e7",
|
|
62
|
+
dark: "#3f3f46"
|
|
63
|
+
},
|
|
64
|
+
selected: {
|
|
65
|
+
light: "#e0f2fe",
|
|
66
|
+
dark: "#0c4a6e"
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
// Category-specific hue colors (for gradient backgrounds)
|
|
70
|
+
categoryHue: {
|
|
71
|
+
hotel: 220,
|
|
72
|
+
flight: 200,
|
|
73
|
+
cab: 35,
|
|
74
|
+
restaurant: 15,
|
|
75
|
+
gifting: 280,
|
|
76
|
+
default: 220
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
const spacing = {
|
|
80
|
+
// Base spacing values (in pixels)
|
|
81
|
+
0: 0,
|
|
82
|
+
0.5: 2,
|
|
83
|
+
1: 4,
|
|
84
|
+
1.5: 6,
|
|
85
|
+
2: 8,
|
|
86
|
+
2.5: 10,
|
|
87
|
+
3: 12,
|
|
88
|
+
3.5: 14,
|
|
89
|
+
4: 16,
|
|
90
|
+
5: 20,
|
|
91
|
+
6: 24,
|
|
92
|
+
7: 28,
|
|
93
|
+
8: 32,
|
|
94
|
+
9: 36,
|
|
95
|
+
10: 40,
|
|
96
|
+
11: 44,
|
|
97
|
+
12: 48,
|
|
98
|
+
14: 56,
|
|
99
|
+
16: 64,
|
|
100
|
+
20: 80,
|
|
101
|
+
24: 96,
|
|
102
|
+
28: 112,
|
|
103
|
+
32: 128
|
|
104
|
+
};
|
|
105
|
+
const semanticSpacing = {
|
|
106
|
+
// Component internal spacing
|
|
107
|
+
cardPadding: spacing[4],
|
|
108
|
+
// 16px
|
|
109
|
+
cardGap: spacing[3],
|
|
110
|
+
// 12px
|
|
111
|
+
sectionGap: spacing[6],
|
|
112
|
+
// 24px
|
|
113
|
+
// List spacing
|
|
114
|
+
listItemGap: spacing[3],
|
|
115
|
+
// 12px
|
|
116
|
+
listPadding: spacing[4],
|
|
117
|
+
// 16px
|
|
118
|
+
// Button spacing
|
|
119
|
+
buttonPaddingX: spacing[4],
|
|
120
|
+
// 16px
|
|
121
|
+
buttonPaddingY: spacing[2],
|
|
122
|
+
// 8px
|
|
123
|
+
buttonGap: spacing[2],
|
|
124
|
+
// 8px
|
|
125
|
+
// Input spacing
|
|
126
|
+
inputPaddingX: spacing[3],
|
|
127
|
+
// 12px
|
|
128
|
+
inputPaddingY: spacing[2],
|
|
129
|
+
// 8px
|
|
130
|
+
// Screen margins
|
|
131
|
+
screenMarginX: spacing[4],
|
|
132
|
+
// 16px
|
|
133
|
+
screenMarginY: spacing[4]
|
|
134
|
+
// 16px
|
|
135
|
+
};
|
|
136
|
+
const fontFamily = {
|
|
137
|
+
sans: 'Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
|
|
138
|
+
mono: 'ui-monospace, SFMono-Regular, "SF Mono", Consolas, monospace'
|
|
139
|
+
};
|
|
140
|
+
const fontSize = {
|
|
141
|
+
xs: 12,
|
|
142
|
+
sm: 14,
|
|
143
|
+
base: 16,
|
|
144
|
+
lg: 18,
|
|
145
|
+
xl: 20,
|
|
146
|
+
"2xl": 24,
|
|
147
|
+
"3xl": 30,
|
|
148
|
+
"4xl": 36,
|
|
149
|
+
"5xl": 48
|
|
150
|
+
};
|
|
151
|
+
const fontWeight = {
|
|
152
|
+
normal: "400",
|
|
153
|
+
medium: "500",
|
|
154
|
+
semibold: "600",
|
|
155
|
+
bold: "700"
|
|
156
|
+
};
|
|
157
|
+
const lineHeight = {
|
|
158
|
+
tight: 1.25,
|
|
159
|
+
snug: 1.375,
|
|
160
|
+
normal: 1.5,
|
|
161
|
+
relaxed: 1.625,
|
|
162
|
+
loose: 2
|
|
163
|
+
};
|
|
164
|
+
const letterSpacing = {
|
|
165
|
+
tighter: -0.5,
|
|
166
|
+
tight: -0.25,
|
|
167
|
+
normal: 0,
|
|
168
|
+
wide: 0.25,
|
|
169
|
+
wider: 0.5
|
|
170
|
+
};
|
|
171
|
+
const textStyles = {
|
|
172
|
+
// Headings
|
|
173
|
+
h1: {
|
|
174
|
+
fontSize: fontSize["3xl"],
|
|
175
|
+
fontWeight: fontWeight.bold,
|
|
176
|
+
lineHeight: lineHeight.tight,
|
|
177
|
+
letterSpacing: letterSpacing.tight
|
|
178
|
+
},
|
|
179
|
+
h2: {
|
|
180
|
+
fontSize: fontSize["2xl"],
|
|
181
|
+
fontWeight: fontWeight.semibold,
|
|
182
|
+
lineHeight: lineHeight.tight,
|
|
183
|
+
letterSpacing: letterSpacing.tight
|
|
184
|
+
},
|
|
185
|
+
h3: {
|
|
186
|
+
fontSize: fontSize.xl,
|
|
187
|
+
fontWeight: fontWeight.semibold,
|
|
188
|
+
lineHeight: lineHeight.snug
|
|
189
|
+
},
|
|
190
|
+
h4: {
|
|
191
|
+
fontSize: fontSize.lg,
|
|
192
|
+
fontWeight: fontWeight.medium,
|
|
193
|
+
lineHeight: lineHeight.snug
|
|
194
|
+
},
|
|
195
|
+
// Body text
|
|
196
|
+
body: {
|
|
197
|
+
fontSize: fontSize.base,
|
|
198
|
+
fontWeight: fontWeight.normal,
|
|
199
|
+
lineHeight: lineHeight.normal
|
|
200
|
+
},
|
|
201
|
+
bodySmall: {
|
|
202
|
+
fontSize: fontSize.sm,
|
|
203
|
+
fontWeight: fontWeight.normal,
|
|
204
|
+
lineHeight: lineHeight.normal
|
|
205
|
+
},
|
|
206
|
+
// Card specific
|
|
207
|
+
cardTitle: {
|
|
208
|
+
fontSize: fontSize.lg,
|
|
209
|
+
fontWeight: fontWeight.semibold,
|
|
210
|
+
lineHeight: lineHeight.snug
|
|
211
|
+
},
|
|
212
|
+
cardSubtitle: {
|
|
213
|
+
fontSize: fontSize.sm,
|
|
214
|
+
fontWeight: fontWeight.normal,
|
|
215
|
+
lineHeight: lineHeight.normal
|
|
216
|
+
},
|
|
217
|
+
cardPrice: {
|
|
218
|
+
fontSize: fontSize.xl,
|
|
219
|
+
fontWeight: fontWeight.bold,
|
|
220
|
+
lineHeight: lineHeight.tight
|
|
221
|
+
},
|
|
222
|
+
// Labels and captions
|
|
223
|
+
label: {
|
|
224
|
+
fontSize: fontSize.sm,
|
|
225
|
+
fontWeight: fontWeight.medium,
|
|
226
|
+
lineHeight: lineHeight.normal
|
|
227
|
+
},
|
|
228
|
+
caption: {
|
|
229
|
+
fontSize: fontSize.xs,
|
|
230
|
+
fontWeight: fontWeight.normal,
|
|
231
|
+
lineHeight: lineHeight.normal
|
|
232
|
+
}
|
|
233
|
+
};
|
|
234
|
+
export {
|
|
235
|
+
semanticSpacing as a,
|
|
236
|
+
fontSize as b,
|
|
237
|
+
colors as c,
|
|
238
|
+
fontWeight as d,
|
|
239
|
+
letterSpacing as e,
|
|
240
|
+
fontFamily as f,
|
|
241
|
+
lineHeight as l,
|
|
242
|
+
spacing as s,
|
|
243
|
+
textStyles as t
|
|
244
|
+
};
|
|
245
|
+
//# sourceMappingURL=typography-zz5GzgjI.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typography-zz5GzgjI.js","sources":["../src/dls/tokens/colors.ts","../src/dls/tokens/spacing.ts","../src/dls/tokens/typography.ts"],"sourcesContent":["/**\n * Color tokens for the Crew Design Language System\n * These colors are used across all recommendation cards and UI components\n */\n\nexport const colors = {\n // Primary brand colors\n primary: {\n 50: '#f0f9ff',\n 100: '#e0f2fe',\n 200: '#bae6fd',\n 300: '#7dd3fc',\n 400: '#38bdf8',\n 500: '#0ea5e9',\n 600: '#0284c7',\n 700: '#0369a1',\n 800: '#075985',\n 900: '#0c4a6e',\n },\n\n // Neutral/Gray scale\n neutral: {\n 0: '#ffffff',\n 50: '#fafafa',\n 100: '#f4f4f5',\n 200: '#e4e4e7',\n 300: '#d4d4d8',\n 400: '#a1a1aa',\n 500: '#71717a',\n 600: '#52525b',\n 700: '#3f3f46',\n 800: '#27272a',\n 900: '#18181b',\n 950: '#09090b',\n },\n\n // Success colors\n success: {\n 50: '#f0fdf4',\n 100: '#dcfce7',\n 500: '#22c55e',\n 600: '#16a34a',\n 700: '#15803d',\n },\n\n // Warning colors\n warning: {\n 50: '#fffbeb',\n 100: '#fef3c7',\n 500: '#f59e0b',\n 600: '#d97706',\n 700: '#b45309',\n },\n\n // Error colors\n error: {\n 50: '#fef2f2',\n 100: '#fee2e2',\n 500: '#ef4444',\n 600: '#dc2626',\n 700: '#b91c1c',\n },\n\n // Special colors for recommendation cards\n card: {\n background: {\n light: '#ffffff',\n dark: '#1a1a1a',\n },\n border: {\n light: '#e4e4e7',\n dark: '#3f3f46',\n },\n selected: {\n light: '#e0f2fe',\n dark: '#0c4a6e',\n },\n },\n\n // Category-specific hue colors (for gradient backgrounds)\n categoryHue: {\n hotel: 220,\n flight: 200,\n cab: 35,\n restaurant: 15,\n gifting: 280,\n default: 220,\n },\n} as const;\n\nexport type Colors = typeof colors;\n\n","/**\n * Spacing tokens for consistent layout across components\n * Based on a 4px grid system\n */\n\nexport const spacing = {\n // Base spacing values (in pixels)\n 0: 0,\n 0.5: 2,\n 1: 4,\n 1.5: 6,\n 2: 8,\n 2.5: 10,\n 3: 12,\n 3.5: 14,\n 4: 16,\n 5: 20,\n 6: 24,\n 7: 28,\n 8: 32,\n 9: 36,\n 10: 40,\n 11: 44,\n 12: 48,\n 14: 56,\n 16: 64,\n 20: 80,\n 24: 96,\n 28: 112,\n 32: 128,\n} as const;\n\n// Semantic spacing aliases\nexport const semanticSpacing = {\n // Component internal spacing\n cardPadding: spacing[4], // 16px\n cardGap: spacing[3], // 12px\n sectionGap: spacing[6], // 24px\n \n // List spacing\n listItemGap: spacing[3], // 12px\n listPadding: spacing[4], // 16px\n \n // Button spacing\n buttonPaddingX: spacing[4], // 16px\n buttonPaddingY: spacing[2], // 8px\n buttonGap: spacing[2], // 8px\n \n // Input spacing\n inputPaddingX: spacing[3], // 12px\n inputPaddingY: spacing[2], // 8px\n \n // Screen margins\n screenMarginX: spacing[4], // 16px\n screenMarginY: spacing[4], // 16px\n} as const;\n\nexport type Spacing = typeof spacing;\nexport type SemanticSpacing = typeof semanticSpacing;\n\n","/**\n * Typography tokens for consistent text styling\n */\n\nexport const fontFamily = {\n sans: 'Inter, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif',\n mono: 'ui-monospace, SFMono-Regular, \"SF Mono\", Consolas, monospace',\n} as const;\n\nexport const fontSize = {\n xs: 12,\n sm: 14,\n base: 16,\n lg: 18,\n xl: 20,\n '2xl': 24,\n '3xl': 30,\n '4xl': 36,\n '5xl': 48,\n} as const;\n\nexport const fontWeight = {\n normal: '400',\n medium: '500',\n semibold: '600',\n bold: '700',\n} as const;\n\nexport const lineHeight = {\n tight: 1.25,\n snug: 1.375,\n normal: 1.5,\n relaxed: 1.625,\n loose: 2,\n} as const;\n\nexport const letterSpacing = {\n tighter: -0.5,\n tight: -0.25,\n normal: 0,\n wide: 0.25,\n wider: 0.5,\n} as const;\n\n// Pre-defined text styles\nexport const textStyles = {\n // Headings\n h1: {\n fontSize: fontSize['3xl'],\n fontWeight: fontWeight.bold,\n lineHeight: lineHeight.tight,\n letterSpacing: letterSpacing.tight,\n },\n h2: {\n fontSize: fontSize['2xl'],\n fontWeight: fontWeight.semibold,\n lineHeight: lineHeight.tight,\n letterSpacing: letterSpacing.tight,\n },\n h3: {\n fontSize: fontSize.xl,\n fontWeight: fontWeight.semibold,\n lineHeight: lineHeight.snug,\n },\n h4: {\n fontSize: fontSize.lg,\n fontWeight: fontWeight.medium,\n lineHeight: lineHeight.snug,\n },\n\n // Body text\n body: {\n fontSize: fontSize.base,\n fontWeight: fontWeight.normal,\n lineHeight: lineHeight.normal,\n },\n bodySmall: {\n fontSize: fontSize.sm,\n fontWeight: fontWeight.normal,\n lineHeight: lineHeight.normal,\n },\n \n // Card specific\n cardTitle: {\n fontSize: fontSize.lg,\n fontWeight: fontWeight.semibold,\n lineHeight: lineHeight.snug,\n },\n cardSubtitle: {\n fontSize: fontSize.sm,\n fontWeight: fontWeight.normal,\n lineHeight: lineHeight.normal,\n },\n cardPrice: {\n fontSize: fontSize.xl,\n fontWeight: fontWeight.bold,\n lineHeight: lineHeight.tight,\n },\n \n // Labels and captions\n label: {\n fontSize: fontSize.sm,\n fontWeight: fontWeight.medium,\n lineHeight: lineHeight.normal,\n },\n caption: {\n fontSize: fontSize.xs,\n fontWeight: fontWeight.normal,\n lineHeight: lineHeight.normal,\n },\n} as const;\n\nexport type FontFamily = typeof fontFamily;\nexport type FontSize = typeof fontSize;\nexport type FontWeight = typeof fontWeight;\nexport type TextStyles = typeof textStyles;\n\n"],"names":[],"mappings":"AAKO,MAAM,SAAS;AAAA;AAAA,EAEpB,SAAS;AAAA,IACP,IAAI;AAAA,IACJ,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,EAAA;AAAA;AAAA,EAIP,SAAS;AAAA,IACP,GAAG;AAAA,IACH,IAAI;AAAA,IACJ,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,EAAA;AAAA;AAAA,EAIP,SAAS;AAAA,IACP,IAAI;AAAA,IACJ,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,EAAA;AAAA;AAAA,EAIP,SAAS;AAAA,IACP,IAAI;AAAA,IACJ,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,EAAA;AAAA;AAAA,EAIP,OAAO;AAAA,IACL,IAAI;AAA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;AAAA,IACJ,UAAU,SAAS;AAAA,IACnB,YAAY,WAAW;AAAA,IACvB,YAAY,WAAW;AAAA,EAAA;AAAA,EAEzB,WAAW;AAAA,IACT,UAAU,SAAS;AAAA,IACnB,YAAY,WAAW;AAAA,IACvB,YAAY,WAAW;AAAA,EAAA;AAAA;AAAA,EAIzB,WAAW;AAAA,IACT,UAAU,SAAS;AAAA,IACnB,YAAY,WAAW;AAAA,IACvB,YAAY,WAAW;AAAA,EAAA;AAAA,EAEzB,cAAc;AAAA,IACZ,UAAU,SAAS;AAAA,IACnB,YAAY,WAAW;AAAA,IACvB,YAAY,WAAW;AAAA,EAAA;AAAA,EAEzB,WAAW;AAAA,IACT,UAAU,SAAS;AAAA,IACnB,YAAY,WAAW;AAAA,IACvB,YAAY,WAAW;AAAA,EAAA;AAAA;AAAA,EAIzB,OAAO;AAAA,IACL,UAAU,SAAS;AAAA,IACnB,YAAY,WAAW;AAAA,IACvB,YAAY,WAAW;AAAA,EAAA;AAAA,EAEzB,SAAS;AAAA,IACP,UAAU,SAAS;AAAA,IACnB,YAAY,WAAW;AAAA,IACvB,YAAY,WAAW;AAAA,EAAA;AAE3B;"}
|
package/package.json
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "crew-recommendation-ui",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Shared UI library for recommendation listing components - DLS tokens and React components",
|
|
5
|
+
"private": false,
|
|
6
|
+
"publishConfig": {
|
|
7
|
+
"access": "public",
|
|
8
|
+
"registry": "https://registry.npmjs.org/"
|
|
9
|
+
},
|
|
10
|
+
"type": "module",
|
|
11
|
+
"main": "./dist/index.js",
|
|
12
|
+
"module": "./dist/index.js",
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"development": "./src/index.ts",
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"import": "./dist/index.js",
|
|
19
|
+
"default": "./dist/index.js"
|
|
20
|
+
},
|
|
21
|
+
"./dls": {
|
|
22
|
+
"development": "./src/dls/index.ts",
|
|
23
|
+
"types": "./dist/dls/index.d.ts",
|
|
24
|
+
"import": "./dist/dls/index.js",
|
|
25
|
+
"default": "./dist/dls/index.js"
|
|
26
|
+
},
|
|
27
|
+
"./recommendation": {
|
|
28
|
+
"development": "./src/recommendation/index.ts",
|
|
29
|
+
"types": "./dist/recommendation/index.d.ts",
|
|
30
|
+
"import": "./dist/recommendation/index.js",
|
|
31
|
+
"default": "./dist/recommendation/index.js"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"files": [
|
|
35
|
+
"dist",
|
|
36
|
+
"src"
|
|
37
|
+
],
|
|
38
|
+
"scripts": {
|
|
39
|
+
"dev": "nx vite:build --watch",
|
|
40
|
+
"build": "tsc && nx vite:build",
|
|
41
|
+
"clean": "rm -rf dist",
|
|
42
|
+
"type-check": "tsc --noEmit",
|
|
43
|
+
"lint": "eslint . --ext .ts,.tsx"
|
|
44
|
+
},
|
|
45
|
+
"peerDependencies": {
|
|
46
|
+
"react": ">=17.0.0",
|
|
47
|
+
"react-dom": ">=17.0.0"
|
|
48
|
+
},
|
|
49
|
+
"devDependencies": {
|
|
50
|
+
"@types/react": "^18.2.55",
|
|
51
|
+
"@types/react-dom": "^18.2.19",
|
|
52
|
+
"@vitejs/plugin-react": "^4.3.4",
|
|
53
|
+
"typescript": "~5.7.2",
|
|
54
|
+
"vite": "^6.3.1",
|
|
55
|
+
"vite-plugin-dts": "^4.5.0"
|
|
56
|
+
},
|
|
57
|
+
"dependencies": {
|
|
58
|
+
"clsx": "^2.1.1"
|
|
59
|
+
}
|
|
60
|
+
}
|
package/src/dls/index.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Design Language System (DLS)
|
|
3
|
+
*
|
|
4
|
+
* This module exports all design tokens and primitives
|
|
5
|
+
* for building consistent UI across platforms.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
// Export all tokens
|
|
9
|
+
export * from './tokens';
|
|
10
|
+
|
|
11
|
+
// Export components (will add primitives later)
|
|
12
|
+
// export * from './components';
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Color tokens for the Crew Design Language System
|
|
3
|
+
* These colors are used across all recommendation cards and UI components
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export const colors = {
|
|
7
|
+
// Primary brand colors
|
|
8
|
+
primary: {
|
|
9
|
+
50: '#f0f9ff',
|
|
10
|
+
100: '#e0f2fe',
|
|
11
|
+
200: '#bae6fd',
|
|
12
|
+
300: '#7dd3fc',
|
|
13
|
+
400: '#38bdf8',
|
|
14
|
+
500: '#0ea5e9',
|
|
15
|
+
600: '#0284c7',
|
|
16
|
+
700: '#0369a1',
|
|
17
|
+
800: '#075985',
|
|
18
|
+
900: '#0c4a6e',
|
|
19
|
+
},
|
|
20
|
+
|
|
21
|
+
// Neutral/Gray scale
|
|
22
|
+
neutral: {
|
|
23
|
+
0: '#ffffff',
|
|
24
|
+
50: '#fafafa',
|
|
25
|
+
100: '#f4f4f5',
|
|
26
|
+
200: '#e4e4e7',
|
|
27
|
+
300: '#d4d4d8',
|
|
28
|
+
400: '#a1a1aa',
|
|
29
|
+
500: '#71717a',
|
|
30
|
+
600: '#52525b',
|
|
31
|
+
700: '#3f3f46',
|
|
32
|
+
800: '#27272a',
|
|
33
|
+
900: '#18181b',
|
|
34
|
+
950: '#09090b',
|
|
35
|
+
},
|
|
36
|
+
|
|
37
|
+
// Success colors
|
|
38
|
+
success: {
|
|
39
|
+
50: '#f0fdf4',
|
|
40
|
+
100: '#dcfce7',
|
|
41
|
+
500: '#22c55e',
|
|
42
|
+
600: '#16a34a',
|
|
43
|
+
700: '#15803d',
|
|
44
|
+
},
|
|
45
|
+
|
|
46
|
+
// Warning colors
|
|
47
|
+
warning: {
|
|
48
|
+
50: '#fffbeb',
|
|
49
|
+
100: '#fef3c7',
|
|
50
|
+
500: '#f59e0b',
|
|
51
|
+
600: '#d97706',
|
|
52
|
+
700: '#b45309',
|
|
53
|
+
},
|
|
54
|
+
|
|
55
|
+
// Error colors
|
|
56
|
+
error: {
|
|
57
|
+
50: '#fef2f2',
|
|
58
|
+
100: '#fee2e2',
|
|
59
|
+
500: '#ef4444',
|
|
60
|
+
600: '#dc2626',
|
|
61
|
+
700: '#b91c1c',
|
|
62
|
+
},
|
|
63
|
+
|
|
64
|
+
// Special colors for recommendation cards
|
|
65
|
+
card: {
|
|
66
|
+
background: {
|
|
67
|
+
light: '#ffffff',
|
|
68
|
+
dark: '#1a1a1a',
|
|
69
|
+
},
|
|
70
|
+
border: {
|
|
71
|
+
light: '#e4e4e7',
|
|
72
|
+
dark: '#3f3f46',
|
|
73
|
+
},
|
|
74
|
+
selected: {
|
|
75
|
+
light: '#e0f2fe',
|
|
76
|
+
dark: '#0c4a6e',
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
|
|
80
|
+
// Category-specific hue colors (for gradient backgrounds)
|
|
81
|
+
categoryHue: {
|
|
82
|
+
hotel: 220,
|
|
83
|
+
flight: 200,
|
|
84
|
+
cab: 35,
|
|
85
|
+
restaurant: 15,
|
|
86
|
+
gifting: 280,
|
|
87
|
+
default: 220,
|
|
88
|
+
},
|
|
89
|
+
} as const;
|
|
90
|
+
|
|
91
|
+
export type Colors = typeof colors;
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Design Language System - Tokens
|
|
3
|
+
* Export all design tokens from a single entry point
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export * from './colors';
|
|
7
|
+
export * from './spacing';
|
|
8
|
+
export * from './typography';
|
|
9
|
+
|
|
10
|
+
// Combined tokens object for convenience
|
|
11
|
+
import { colors } from './colors';
|
|
12
|
+
import { spacing, semanticSpacing } from './spacing';
|
|
13
|
+
import { fontFamily, fontSize, fontWeight, lineHeight, letterSpacing, textStyles } from './typography';
|
|
14
|
+
|
|
15
|
+
export const tokens = {
|
|
16
|
+
colors,
|
|
17
|
+
spacing,
|
|
18
|
+
semanticSpacing,
|
|
19
|
+
fontFamily,
|
|
20
|
+
fontSize,
|
|
21
|
+
fontWeight,
|
|
22
|
+
lineHeight,
|
|
23
|
+
letterSpacing,
|
|
24
|
+
textStyles,
|
|
25
|
+
} as const;
|
|
26
|
+
|
|
27
|
+
export type Tokens = typeof tokens;
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Spacing tokens for consistent layout across components
|
|
3
|
+
* Based on a 4px grid system
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export const spacing = {
|
|
7
|
+
// Base spacing values (in pixels)
|
|
8
|
+
0: 0,
|
|
9
|
+
0.5: 2,
|
|
10
|
+
1: 4,
|
|
11
|
+
1.5: 6,
|
|
12
|
+
2: 8,
|
|
13
|
+
2.5: 10,
|
|
14
|
+
3: 12,
|
|
15
|
+
3.5: 14,
|
|
16
|
+
4: 16,
|
|
17
|
+
5: 20,
|
|
18
|
+
6: 24,
|
|
19
|
+
7: 28,
|
|
20
|
+
8: 32,
|
|
21
|
+
9: 36,
|
|
22
|
+
10: 40,
|
|
23
|
+
11: 44,
|
|
24
|
+
12: 48,
|
|
25
|
+
14: 56,
|
|
26
|
+
16: 64,
|
|
27
|
+
20: 80,
|
|
28
|
+
24: 96,
|
|
29
|
+
28: 112,
|
|
30
|
+
32: 128,
|
|
31
|
+
} as const;
|
|
32
|
+
|
|
33
|
+
// Semantic spacing aliases
|
|
34
|
+
export const semanticSpacing = {
|
|
35
|
+
// Component internal spacing
|
|
36
|
+
cardPadding: spacing[4], // 16px
|
|
37
|
+
cardGap: spacing[3], // 12px
|
|
38
|
+
sectionGap: spacing[6], // 24px
|
|
39
|
+
|
|
40
|
+
// List spacing
|
|
41
|
+
listItemGap: spacing[3], // 12px
|
|
42
|
+
listPadding: spacing[4], // 16px
|
|
43
|
+
|
|
44
|
+
// Button spacing
|
|
45
|
+
buttonPaddingX: spacing[4], // 16px
|
|
46
|
+
buttonPaddingY: spacing[2], // 8px
|
|
47
|
+
buttonGap: spacing[2], // 8px
|
|
48
|
+
|
|
49
|
+
// Input spacing
|
|
50
|
+
inputPaddingX: spacing[3], // 12px
|
|
51
|
+
inputPaddingY: spacing[2], // 8px
|
|
52
|
+
|
|
53
|
+
// Screen margins
|
|
54
|
+
screenMarginX: spacing[4], // 16px
|
|
55
|
+
screenMarginY: spacing[4], // 16px
|
|
56
|
+
} as const;
|
|
57
|
+
|
|
58
|
+
export type Spacing = typeof spacing;
|
|
59
|
+
export type SemanticSpacing = typeof semanticSpacing;
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typography tokens for consistent text styling
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export const fontFamily = {
|
|
6
|
+
sans: 'Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
|
|
7
|
+
mono: 'ui-monospace, SFMono-Regular, "SF Mono", Consolas, monospace',
|
|
8
|
+
} as const;
|
|
9
|
+
|
|
10
|
+
export const fontSize = {
|
|
11
|
+
xs: 12,
|
|
12
|
+
sm: 14,
|
|
13
|
+
base: 16,
|
|
14
|
+
lg: 18,
|
|
15
|
+
xl: 20,
|
|
16
|
+
'2xl': 24,
|
|
17
|
+
'3xl': 30,
|
|
18
|
+
'4xl': 36,
|
|
19
|
+
'5xl': 48,
|
|
20
|
+
} as const;
|
|
21
|
+
|
|
22
|
+
export const fontWeight = {
|
|
23
|
+
normal: '400',
|
|
24
|
+
medium: '500',
|
|
25
|
+
semibold: '600',
|
|
26
|
+
bold: '700',
|
|
27
|
+
} as const;
|
|
28
|
+
|
|
29
|
+
export const lineHeight = {
|
|
30
|
+
tight: 1.25,
|
|
31
|
+
snug: 1.375,
|
|
32
|
+
normal: 1.5,
|
|
33
|
+
relaxed: 1.625,
|
|
34
|
+
loose: 2,
|
|
35
|
+
} as const;
|
|
36
|
+
|
|
37
|
+
export const letterSpacing = {
|
|
38
|
+
tighter: -0.5,
|
|
39
|
+
tight: -0.25,
|
|
40
|
+
normal: 0,
|
|
41
|
+
wide: 0.25,
|
|
42
|
+
wider: 0.5,
|
|
43
|
+
} as const;
|
|
44
|
+
|
|
45
|
+
// Pre-defined text styles
|
|
46
|
+
export const textStyles = {
|
|
47
|
+
// Headings
|
|
48
|
+
h1: {
|
|
49
|
+
fontSize: fontSize['3xl'],
|
|
50
|
+
fontWeight: fontWeight.bold,
|
|
51
|
+
lineHeight: lineHeight.tight,
|
|
52
|
+
letterSpacing: letterSpacing.tight,
|
|
53
|
+
},
|
|
54
|
+
h2: {
|
|
55
|
+
fontSize: fontSize['2xl'],
|
|
56
|
+
fontWeight: fontWeight.semibold,
|
|
57
|
+
lineHeight: lineHeight.tight,
|
|
58
|
+
letterSpacing: letterSpacing.tight,
|
|
59
|
+
},
|
|
60
|
+
h3: {
|
|
61
|
+
fontSize: fontSize.xl,
|
|
62
|
+
fontWeight: fontWeight.semibold,
|
|
63
|
+
lineHeight: lineHeight.snug,
|
|
64
|
+
},
|
|
65
|
+
h4: {
|
|
66
|
+
fontSize: fontSize.lg,
|
|
67
|
+
fontWeight: fontWeight.medium,
|
|
68
|
+
lineHeight: lineHeight.snug,
|
|
69
|
+
},
|
|
70
|
+
|
|
71
|
+
// Body text
|
|
72
|
+
body: {
|
|
73
|
+
fontSize: fontSize.base,
|
|
74
|
+
fontWeight: fontWeight.normal,
|
|
75
|
+
lineHeight: lineHeight.normal,
|
|
76
|
+
},
|
|
77
|
+
bodySmall: {
|
|
78
|
+
fontSize: fontSize.sm,
|
|
79
|
+
fontWeight: fontWeight.normal,
|
|
80
|
+
lineHeight: lineHeight.normal,
|
|
81
|
+
},
|
|
82
|
+
|
|
83
|
+
// Card specific
|
|
84
|
+
cardTitle: {
|
|
85
|
+
fontSize: fontSize.lg,
|
|
86
|
+
fontWeight: fontWeight.semibold,
|
|
87
|
+
lineHeight: lineHeight.snug,
|
|
88
|
+
},
|
|
89
|
+
cardSubtitle: {
|
|
90
|
+
fontSize: fontSize.sm,
|
|
91
|
+
fontWeight: fontWeight.normal,
|
|
92
|
+
lineHeight: lineHeight.normal,
|
|
93
|
+
},
|
|
94
|
+
cardPrice: {
|
|
95
|
+
fontSize: fontSize.xl,
|
|
96
|
+
fontWeight: fontWeight.bold,
|
|
97
|
+
lineHeight: lineHeight.tight,
|
|
98
|
+
},
|
|
99
|
+
|
|
100
|
+
// Labels and captions
|
|
101
|
+
label: {
|
|
102
|
+
fontSize: fontSize.sm,
|
|
103
|
+
fontWeight: fontWeight.medium,
|
|
104
|
+
lineHeight: lineHeight.normal,
|
|
105
|
+
},
|
|
106
|
+
caption: {
|
|
107
|
+
fontSize: fontSize.xs,
|
|
108
|
+
fontWeight: fontWeight.normal,
|
|
109
|
+
lineHeight: lineHeight.normal,
|
|
110
|
+
},
|
|
111
|
+
} as const;
|
|
112
|
+
|
|
113
|
+
export type FontFamily = typeof fontFamily;
|
|
114
|
+
export type FontSize = typeof fontSize;
|
|
115
|
+
export type FontWeight = typeof fontWeight;
|
|
116
|
+
export type TextStyles = typeof textStyles;
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @crew-copilot/recommendation-ui
|
|
3
|
+
*
|
|
4
|
+
* A shared UI library for recommendation listing components
|
|
5
|
+
* that can be used across:
|
|
6
|
+
* - Web (crew-website)
|
|
7
|
+
* - Mobile App (crew-app via WebView or React Native)
|
|
8
|
+
* - Dashboard
|
|
9
|
+
*
|
|
10
|
+
* This library provides:
|
|
11
|
+
* 1. DLS (Design Language System) - tokens and primitives
|
|
12
|
+
* 2. Recommendation cards - Hotel, Flight, Cab, etc.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
// Export DLS (Design Language System)
|
|
16
|
+
export * from './dls';
|
|
17
|
+
|
|
18
|
+
// Export Recommendation components
|
|
19
|
+
export * from './recommendation';
|
|
20
|
+
|
|
21
|
+
// Version info
|
|
22
|
+
export const VERSION = '0.0.1';
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|