@wealthx/shadcn 0.0.1 → 1.0.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/.turbo/turbo-build.log +160 -0
- package/CHANGELOG.md +13 -0
- package/CHANGES.md +345 -0
- package/dist/chunk-2WZVSBAY.mjs +232 -0
- package/dist/chunk-2Y7YJKPE.mjs +47 -0
- package/dist/chunk-3U7SD3MS.mjs +55 -0
- package/dist/chunk-3VQNJ235.mjs +114 -0
- package/dist/chunk-55CEW76V.mjs +35 -0
- package/dist/chunk-6AFMNC42.mjs +146 -0
- package/dist/chunk-6OJF6XRN.mjs +117 -0
- package/dist/chunk-7LDIMXGM.mjs +181 -0
- package/dist/chunk-AMJ23O53.mjs +122 -0
- package/dist/chunk-BBJBJSXQ.mjs +44 -0
- package/dist/chunk-BGP2N52Z.mjs +126 -0
- package/dist/chunk-BMFN37JH.mjs +41 -0
- package/dist/chunk-CGOKTPXU.mjs +79 -0
- package/dist/chunk-CZ3BW5GL.mjs +81 -0
- package/dist/chunk-DBHJ5KC3.mjs +55 -0
- package/dist/chunk-DDPA2XXS.mjs +97 -0
- package/dist/chunk-DS2AMHN2.mjs +30 -0
- package/dist/chunk-E3K6O4FZ.mjs +57 -0
- package/dist/chunk-FWCSY2DS.mjs +37 -0
- package/dist/chunk-GPRJQ24C.mjs +28 -0
- package/dist/chunk-HS7TFG7V.mjs +24 -0
- package/dist/chunk-HUVTPUV2.mjs +256 -0
- package/dist/chunk-IAOOZCUY.mjs +90 -0
- package/dist/chunk-JF4PHPD5.mjs +111 -0
- package/dist/chunk-JU2RUWHF.mjs +123 -0
- package/dist/chunk-KKHTJNMM.mjs +86 -0
- package/dist/chunk-MJIEMGRD.mjs +266 -0
- package/dist/chunk-MKFL5MNH.mjs +372 -0
- package/dist/chunk-MQ72DIBH.mjs +105 -0
- package/dist/chunk-NGYG2EA6.mjs +148 -0
- package/dist/chunk-NWZ46DJL.mjs +213 -0
- package/dist/chunk-OXQQNQZI.mjs +75 -0
- package/dist/chunk-PMKODV6M.mjs +161 -0
- package/dist/chunk-QOJ2DQD6.mjs +57 -0
- package/dist/chunk-RL772EH7.mjs +126 -0
- package/dist/chunk-SLWCCURD.mjs +99 -0
- package/dist/chunk-V7CNWJT3.mjs +10 -0
- package/dist/chunk-VG6UF6UT.mjs +68 -0
- package/dist/chunk-VYMHBV6D.mjs +123 -0
- package/dist/chunk-VZ2NR7L3.mjs +195 -0
- package/dist/chunk-YN5SYTOO.mjs +117 -0
- package/dist/chunk-Z3MK2KKZ.mjs +83 -0
- package/dist/chunk-ZN2QKLF6.mjs +187 -0
- package/dist/chunk-ZZV5JVNW.mjs +34 -0
- package/dist/components/ui/accordion.js +142 -0
- package/dist/components/ui/accordion.mjs +14 -0
- package/dist/components/ui/alert-dialog.js +413 -0
- package/dist/components/ui/alert-dialog.mjs +34 -0
- package/dist/components/ui/alert.js +134 -0
- package/dist/components/ui/alert.mjs +12 -0
- package/dist/components/ui/avatar.js +173 -0
- package/dist/components/ui/avatar.mjs +18 -0
- package/dist/components/ui/badge.js +163 -0
- package/dist/components/ui/badge.mjs +11 -0
- package/dist/components/ui/button.js +198 -0
- package/dist/components/ui/button.mjs +11 -0
- package/dist/components/ui/calendar.js +408 -0
- package/dist/components/ui/calendar.mjs +12 -0
- package/dist/components/ui/card.js +156 -0
- package/dist/components/ui/card.mjs +20 -0
- package/dist/components/ui/checkbox.js +166 -0
- package/dist/components/ui/checkbox.mjs +11 -0
- package/dist/components/ui/chip.js +199 -0
- package/dist/components/ui/chip.mjs +10 -0
- package/dist/components/ui/data-table.js +925 -0
- package/dist/components/ui/data-table.mjs +29 -0
- package/dist/components/ui/date-picker.js +561 -0
- package/dist/components/ui/date-picker.mjs +15 -0
- package/dist/components/ui/dialog.js +378 -0
- package/dist/components/ui/dialog.mjs +30 -0
- package/dist/components/ui/drawer.js +213 -0
- package/dist/components/ui/drawer.mjs +28 -0
- package/dist/components/ui/dropdown-menu.js +338 -0
- package/dist/components/ui/dropdown-menu.mjs +38 -0
- package/dist/components/ui/empty.js +173 -0
- package/dist/components/ui/empty.mjs +18 -0
- package/dist/components/ui/field.js +359 -0
- package/dist/components/ui/field.mjs +28 -0
- package/dist/components/ui/input-group.js +406 -0
- package/dist/components/ui/input-group.mjs +22 -0
- package/dist/components/ui/input-otp.js +149 -0
- package/dist/components/ui/input-otp.mjs +14 -0
- package/dist/components/ui/input.js +81 -0
- package/dist/components/ui/input.mjs +8 -0
- package/dist/components/ui/label.js +85 -0
- package/dist/components/ui/label.mjs +8 -0
- package/dist/components/ui/pagination.js +333 -0
- package/dist/components/ui/pagination.mjs +22 -0
- package/dist/components/ui/popover.js +167 -0
- package/dist/components/ui/popover.mjs +22 -0
- package/dist/components/ui/progress.js +97 -0
- package/dist/components/ui/progress.mjs +8 -0
- package/dist/components/ui/radio-group.js +178 -0
- package/dist/components/ui/radio-group.mjs +12 -0
- package/dist/components/ui/select.js +262 -0
- package/dist/components/ui/select.mjs +28 -0
- package/dist/components/ui/separator.js +86 -0
- package/dist/components/ui/separator.mjs +8 -0
- package/dist/components/ui/sheet.js +227 -0
- package/dist/components/ui/sheet.mjs +26 -0
- package/dist/components/ui/skeleton.js +75 -0
- package/dist/components/ui/skeleton.mjs +8 -0
- package/dist/components/ui/sonner.js +86 -0
- package/dist/components/ui/sonner.mjs +7 -0
- package/dist/components/ui/spinner.js +93 -0
- package/dist/components/ui/spinner.mjs +10 -0
- package/dist/components/ui/switch.js +178 -0
- package/dist/components/ui/switch.mjs +11 -0
- package/dist/components/ui/table.js +184 -0
- package/dist/components/ui/table.mjs +22 -0
- package/dist/components/ui/tabs.js +181 -0
- package/dist/components/ui/tabs.mjs +16 -0
- package/dist/components/ui/textarea.js +79 -0
- package/dist/components/ui/textarea.mjs +8 -0
- package/dist/components/ui/toggle-group.js +184 -0
- package/dist/components/ui/toggle-group.mjs +12 -0
- package/dist/components/ui/toggle.js +108 -0
- package/dist/components/ui/toggle.mjs +11 -0
- package/dist/components/ui/tooltip.js +140 -0
- package/dist/components/ui/tooltip.mjs +16 -0
- package/dist/index.js +4409 -0
- package/dist/index.mjs +462 -0
- package/dist/lib/colors.js +84 -0
- package/dist/lib/colors.mjs +13 -0
- package/dist/lib/theme-provider.js +150 -0
- package/dist/lib/theme-provider.mjs +13 -0
- package/dist/lib/typography.js +157 -0
- package/dist/lib/typography.mjs +25 -0
- package/dist/lib/utils.js +34 -0
- package/dist/lib/utils.mjs +7 -0
- package/dist/styles.css +2 -0
- package/package.json +228 -11
- package/scripts/build-css.ts +15 -9
- package/src/components/index.tsx +443 -0
- package/src/components/ui/accordion.tsx +99 -0
- package/src/components/ui/alert-dialog.tsx +239 -0
- package/src/components/ui/alert.tsx +81 -0
- package/src/components/ui/avatar.tsx +130 -0
- package/src/components/ui/badge.tsx +57 -0
- package/src/components/ui/button.tsx +69 -37
- package/src/components/ui/calendar.tsx +252 -0
- package/src/components/ui/card.tsx +106 -0
- package/src/components/ui/checkbox.tsx +111 -0
- package/src/components/ui/chip.tsx +65 -0
- package/src/components/ui/data-table.tsx +490 -0
- package/src/components/ui/date-picker.tsx +133 -0
- package/src/components/ui/dialog.tsx +195 -0
- package/src/components/ui/drawer.tsx +169 -0
- package/src/components/ui/dropdown-menu.tsx +315 -0
- package/src/components/ui/empty.tsx +128 -0
- package/src/components/ui/field.tsx +273 -0
- package/src/components/ui/input-group.tsx +190 -0
- package/src/components/ui/input-otp.tsx +90 -0
- package/src/components/ui/input.tsx +28 -0
- package/src/components/ui/label.tsx +24 -0
- package/src/components/ui/pagination.tsx +148 -0
- package/src/components/ui/popover.tsx +112 -0
- package/src/components/ui/progress.tsx +40 -0
- package/src/components/ui/radio-group.tsx +129 -0
- package/src/components/ui/select.tsx +201 -0
- package/src/components/ui/separator.tsx +26 -0
- package/src/components/ui/sheet.tsx +182 -0
- package/src/components/ui/skeleton.tsx +22 -0
- package/src/components/ui/sonner.tsx +48 -0
- package/src/components/ui/spinner.tsx +41 -0
- package/src/components/ui/switch.tsx +126 -0
- package/src/components/ui/table.tsx +143 -0
- package/src/components/ui/tabs.tsx +119 -0
- package/src/components/ui/textarea.tsx +28 -0
- package/src/components/ui/toggle-group.tsx +94 -0
- package/src/components/ui/toggle.tsx +59 -0
- package/src/components/ui/tooltip.tsx +80 -0
- package/src/index.ts +15 -3
- package/src/lib/colors.ts +74 -0
- package/src/lib/slot.tsx +68 -0
- package/src/lib/theme-provider.tsx +134 -0
- package/src/lib/typography.ts +153 -0
- package/src/lib/utils.ts +1 -1
- package/src/styles/globals.css +377 -107
- package/src/styles/styles-css.ts +1 -1
- package/tsup.config.ts +48 -2
- package/src/provider/ShadcnProvider.tsx +0 -89
- package/src/provider/index.ts +0 -2
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
// WealthX Design System — Typography (rem-based, Figtree)
|
|
2
|
+
//
|
|
3
|
+
// Ported from packages/ui/src/theme/typography.ts.
|
|
4
|
+
// Font updated: Proxima Nova → Figtree (WealthX shadcn design system).
|
|
5
|
+
// Base: 16px (1rem). All values match Figma design spec.
|
|
6
|
+
//
|
|
7
|
+
// Usage:
|
|
8
|
+
// import { TYPOGRAPHY, getTypographyCssVars } from "@wealthx/shadcn/typography"
|
|
9
|
+
//
|
|
10
|
+
// CSS classes (applied via globals.css @layer utilities):
|
|
11
|
+
// .text-display-large, .text-display-medium, .text-display-small
|
|
12
|
+
// .text-h1 … .text-h6
|
|
13
|
+
// .text-body-large, .text-body-medium, .text-body-small
|
|
14
|
+
// .text-label-large, .text-label-medium, .text-label-small
|
|
15
|
+
// .text-caption, .text-overline, .text-code
|
|
16
|
+
|
|
17
|
+
export const FONT_FAMILY_SANS =
|
|
18
|
+
'"Figtree", ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"';
|
|
19
|
+
|
|
20
|
+
export interface TypographyStyle {
|
|
21
|
+
fontWeight: number;
|
|
22
|
+
fontSize: string;
|
|
23
|
+
lineHeight: string;
|
|
24
|
+
letterSpacing?: string;
|
|
25
|
+
textTransform?: "uppercase" | "none";
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function style(
|
|
29
|
+
weight: number,
|
|
30
|
+
size: string,
|
|
31
|
+
lineHeight: string,
|
|
32
|
+
extra?: Partial<Pick<TypographyStyle, "letterSpacing" | "textTransform">>,
|
|
33
|
+
): TypographyStyle {
|
|
34
|
+
return { fontWeight: weight, fontSize: size, lineHeight, ...extra };
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** Display — hero and major titles */
|
|
38
|
+
export const TYPOGRAPHY_DISPLAY = {
|
|
39
|
+
large: style(700, "4rem", "4.5rem", { letterSpacing: "-0.03125rem" }),
|
|
40
|
+
medium: style(700, "3rem", "3.5rem"),
|
|
41
|
+
small: style(600, "2.125rem", "2.625rem"),
|
|
42
|
+
} as const;
|
|
43
|
+
|
|
44
|
+
/** Headings H1–H6 */
|
|
45
|
+
export const TYPOGRAPHY_HEADING = {
|
|
46
|
+
h1: style(700, "2rem", "2.5rem"),
|
|
47
|
+
h2: style(600, "1.75rem", "2.25rem"),
|
|
48
|
+
h3: style(600, "1.5rem", "2rem"),
|
|
49
|
+
h4: style(600, "1.3125rem", "1.75rem"),
|
|
50
|
+
h5: style(600, "1.125rem", "1.5rem"),
|
|
51
|
+
h6: style(600, "1rem", "1.375rem"),
|
|
52
|
+
} as const;
|
|
53
|
+
|
|
54
|
+
/** Body text */
|
|
55
|
+
export const TYPOGRAPHY_BODY = {
|
|
56
|
+
large: style(400, "1.125rem", "1.75rem"),
|
|
57
|
+
medium: style(400, "1rem", "1.5rem"),
|
|
58
|
+
small: style(400, "0.875rem", "1.25rem"),
|
|
59
|
+
} as const;
|
|
60
|
+
|
|
61
|
+
/** Labels — buttons, form labels, badges */
|
|
62
|
+
export const TYPOGRAPHY_LABEL = {
|
|
63
|
+
large: style(600, "1rem", "1.25rem"),
|
|
64
|
+
medium: style(600, "0.875rem", "1.125rem"),
|
|
65
|
+
small: style(600, "0.75rem", "1rem", { letterSpacing: "0.03125rem" }),
|
|
66
|
+
} as const;
|
|
67
|
+
|
|
68
|
+
/** Utility — caption, overline, code */
|
|
69
|
+
export const TYPOGRAPHY_UTILITY = {
|
|
70
|
+
caption: style(400, "0.75rem", "1rem"),
|
|
71
|
+
overline: style(600, "0.625rem", "0.875rem", {
|
|
72
|
+
letterSpacing: "0.09375rem",
|
|
73
|
+
textTransform: "uppercase",
|
|
74
|
+
}),
|
|
75
|
+
code: style(400, "0.875rem", "1.25rem"),
|
|
76
|
+
} as const;
|
|
77
|
+
|
|
78
|
+
export const TYPOGRAPHY = {
|
|
79
|
+
display: TYPOGRAPHY_DISPLAY,
|
|
80
|
+
heading: TYPOGRAPHY_HEADING,
|
|
81
|
+
body: TYPOGRAPHY_BODY,
|
|
82
|
+
label: TYPOGRAPHY_LABEL,
|
|
83
|
+
utility: TYPOGRAPHY_UTILITY,
|
|
84
|
+
} as const;
|
|
85
|
+
|
|
86
|
+
/** Responsive overrides — Desktop (default), Tablet (≤1024px), Mobile (≤768px) */
|
|
87
|
+
export const TYPOGRAPHY_RESPONSIVE = {
|
|
88
|
+
tablet: {
|
|
89
|
+
"display-large": style(700, "3.6rem", "4.05rem", {
|
|
90
|
+
letterSpacing: "-0.03125rem",
|
|
91
|
+
}),
|
|
92
|
+
"display-medium": style(700, "2.7rem", "3.15rem"),
|
|
93
|
+
"display-small": style(600, "1.9125rem", "2.3625rem"),
|
|
94
|
+
},
|
|
95
|
+
mobile: {
|
|
96
|
+
"display-large": style(700, "2.5rem", "2.8125rem", {
|
|
97
|
+
letterSpacing: "-0.03125rem",
|
|
98
|
+
}),
|
|
99
|
+
"display-medium": style(700, "2rem", "2.334rem"),
|
|
100
|
+
h1: style(700, "1.75rem", "2.1875rem"),
|
|
101
|
+
h2: style(600, "1.5rem", "1.93rem"),
|
|
102
|
+
},
|
|
103
|
+
} as const;
|
|
104
|
+
|
|
105
|
+
/** Build all typography CSS variables as a flat Record for :root injection */
|
|
106
|
+
export function getTypographyCssVars(
|
|
107
|
+
fontFamily = FONT_FAMILY_SANS,
|
|
108
|
+
): Record<string, string> {
|
|
109
|
+
const vars: Record<string, string> = {};
|
|
110
|
+
|
|
111
|
+
// Font family
|
|
112
|
+
vars["--font-family-sans"] = fontFamily;
|
|
113
|
+
|
|
114
|
+
const allGroups: [string, Record<string, TypographyStyle>][] = [
|
|
115
|
+
[
|
|
116
|
+
"display",
|
|
117
|
+
TYPOGRAPHY_DISPLAY as unknown as Record<string, TypographyStyle>,
|
|
118
|
+
],
|
|
119
|
+
["", TYPOGRAPHY_HEADING as unknown as Record<string, TypographyStyle>],
|
|
120
|
+
["body", TYPOGRAPHY_BODY as unknown as Record<string, TypographyStyle>],
|
|
121
|
+
["label", TYPOGRAPHY_LABEL as unknown as Record<string, TypographyStyle>],
|
|
122
|
+
["", TYPOGRAPHY_UTILITY as unknown as Record<string, TypographyStyle>],
|
|
123
|
+
];
|
|
124
|
+
|
|
125
|
+
for (const [prefix, group] of allGroups) {
|
|
126
|
+
for (const [key, s] of Object.entries(group)) {
|
|
127
|
+
const token = prefix ? `${prefix}-${key}` : key;
|
|
128
|
+
vars[`--typography-${token}-size`] = s.fontSize;
|
|
129
|
+
vars[`--typography-${token}-leading`] = s.lineHeight;
|
|
130
|
+
vars[`--typography-${token}-weight`] = String(s.fontWeight);
|
|
131
|
+
if (s.letterSpacing)
|
|
132
|
+
vars[`--typography-${token}-tracking`] = s.letterSpacing;
|
|
133
|
+
if (s.textTransform)
|
|
134
|
+
vars[`--typography-${token}-transform`] = s.textTransform;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
return vars;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/** Build responsive CSS variable overrides for a given breakpoint */
|
|
142
|
+
export function getResponsiveTypographyCssVars(
|
|
143
|
+
breakpoint: "tablet" | "mobile",
|
|
144
|
+
): Record<string, string> {
|
|
145
|
+
const vars: Record<string, string> = {};
|
|
146
|
+
for (const [key, s] of Object.entries(TYPOGRAPHY_RESPONSIVE[breakpoint])) {
|
|
147
|
+
vars[`--typography-${key}-size`] = s.fontSize;
|
|
148
|
+
vars[`--typography-${key}-leading`] = s.lineHeight;
|
|
149
|
+
vars[`--typography-${key}-weight`] = String(s.fontWeight);
|
|
150
|
+
if (s.letterSpacing) vars[`--typography-${key}-tracking`] = s.letterSpacing;
|
|
151
|
+
}
|
|
152
|
+
return vars;
|
|
153
|
+
}
|