@tenerife.music/ui 1.0.15 → 1.0.16
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 +1 -1
- package/dist/{colors-BZtZJBBm.d.cts → colors-BrFmCQv-.d.cts} +5 -0
- package/dist/{colors-BZtZJBBm.d.ts → colors-BrFmCQv-.d.ts} +5 -0
- package/dist/{index-CP_dmFn4.d.cts → index-DPWxsWs3.d.cts} +426 -53
- package/dist/{index-CP_dmFn4.d.ts → index-DPWxsWs3.d.ts} +426 -53
- package/dist/index.cjs +820 -508
- package/dist/index.d.cts +336 -86
- package/dist/index.d.ts +336 -86
- package/dist/index.mjs +820 -508
- package/dist/preset.cjs +28 -57
- package/dist/preset.mjs +28 -57
- package/dist/styles.css +3637 -57
- package/dist/theme/index.cjs +1305 -127
- package/dist/theme/index.d.cts +2 -2
- package/dist/theme/index.d.ts +2 -2
- package/dist/theme/index.mjs +1304 -126
- package/dist/tokens/index.cjs +434 -221
- package/dist/tokens/index.d.cts +2 -2
- package/dist/tokens/index.d.ts +2 -2
- package/dist/tokens/index.mjs +434 -221
- package/package.json +55 -56
package/dist/theme/index.cjs
CHANGED
|
@@ -1128,19 +1128,19 @@ function applyBrandOverrides(brand, mode) {
|
|
|
1128
1128
|
});
|
|
1129
1129
|
}
|
|
1130
1130
|
if (overrides.radius.componentRadius) {
|
|
1131
|
-
const { componentRadius } = overrides.radius;
|
|
1132
|
-
if (
|
|
1133
|
-
Object.entries(
|
|
1131
|
+
const { componentRadius: componentRadius2 } = overrides.radius;
|
|
1132
|
+
if (componentRadius2.button) {
|
|
1133
|
+
Object.entries(componentRadius2.button).forEach(([key, value]) => {
|
|
1134
1134
|
root.style.setProperty(`--brand-${namespace}-radius-button-${key}`, value);
|
|
1135
1135
|
});
|
|
1136
1136
|
}
|
|
1137
|
-
if (
|
|
1138
|
-
Object.entries(
|
|
1137
|
+
if (componentRadius2.card) {
|
|
1138
|
+
Object.entries(componentRadius2.card).forEach(([key, value]) => {
|
|
1139
1139
|
root.style.setProperty(`--brand-${namespace}-radius-card-${key}`, value);
|
|
1140
1140
|
});
|
|
1141
1141
|
}
|
|
1142
|
-
if (
|
|
1143
|
-
Object.entries(
|
|
1142
|
+
if (componentRadius2.input) {
|
|
1143
|
+
Object.entries(componentRadius2.input).forEach(([key, value]) => {
|
|
1144
1144
|
root.style.setProperty(`--brand-${namespace}-radius-input-${key}`, value);
|
|
1145
1145
|
});
|
|
1146
1146
|
}
|
|
@@ -1192,13 +1192,18 @@ var primaryColors = {
|
|
|
1192
1192
|
100: "210 40% 96%",
|
|
1193
1193
|
200: "217 32.6% 17.5%",
|
|
1194
1194
|
300: "216 28% 26%",
|
|
1195
|
-
400: "215 25%
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1195
|
+
400: "215 25% 30%",
|
|
1196
|
+
// Adjusted for better progression
|
|
1197
|
+
500: "215 20% 38%",
|
|
1198
|
+
// Adjusted for better progression
|
|
1199
|
+
600: "215 16% 45%",
|
|
1200
|
+
// Adjusted for better progression
|
|
1201
|
+
700: "216 12% 35%",
|
|
1202
|
+
// Rebalanced for semantic strength (L* ~35)
|
|
1203
|
+
800: "217 10% 28%",
|
|
1204
|
+
// Adjusted for proper progression
|
|
1205
|
+
900: "222 47.4% 18%",
|
|
1206
|
+
// Adjusted for better progression
|
|
1202
1207
|
950: "222 84% 4.9%"
|
|
1203
1208
|
// Darkest blue
|
|
1204
1209
|
};
|
|
@@ -1208,12 +1213,15 @@ var accentColors = {
|
|
|
1208
1213
|
200: "280 60% 85%",
|
|
1209
1214
|
300: "280 55% 75%",
|
|
1210
1215
|
400: "280 50% 65%",
|
|
1211
|
-
500: "280
|
|
1212
|
-
//
|
|
1213
|
-
600: "259 65%
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1216
|
+
500: "280 65% 72%",
|
|
1217
|
+
// Adjusted for WCAG AA contrast (4.5:1) with dark text in night mode
|
|
1218
|
+
600: "259 65% 59%",
|
|
1219
|
+
// Default accent - lightened for better contrast vs secondary (L* ~59, was 52, 15 delta from secondary-600)
|
|
1220
|
+
700: "259 60% 44%",
|
|
1221
|
+
// Active state - rebalanced for semantic strength (L* ~44, 12 delta from secondary-700)
|
|
1222
|
+
800: "259 55% 38%",
|
|
1223
|
+
// Adjusted for proper progression
|
|
1224
|
+
900: "259 50% 32%",
|
|
1217
1225
|
950: "259 45% 30%"
|
|
1218
1226
|
};
|
|
1219
1227
|
var secondaryColors = {
|
|
@@ -1222,12 +1230,15 @@ var secondaryColors = {
|
|
|
1222
1230
|
200: "173 100% 85%",
|
|
1223
1231
|
300: "173 100% 70%",
|
|
1224
1232
|
400: "173 100% 55%",
|
|
1225
|
-
500: "173 100%
|
|
1226
|
-
//
|
|
1227
|
-
600: "173 100%
|
|
1228
|
-
|
|
1233
|
+
500: "173 100% 45%",
|
|
1234
|
+
// Adjusted for better scale progression
|
|
1235
|
+
600: "173 100% 44%",
|
|
1236
|
+
// Default secondary - rebalanced for better contrast vs primary (L* ~44, was 38)
|
|
1237
|
+
700: "173 95% 32%",
|
|
1238
|
+
// Active state - rebalanced for semantic strength (L* ~32)
|
|
1229
1239
|
800: "173 90% 22%",
|
|
1230
|
-
|
|
1240
|
+
// Primary variant - darkened for dominance (L* ~22, was 26)
|
|
1241
|
+
900: "173 85% 20%",
|
|
1231
1242
|
950: "173 80% 12%"
|
|
1232
1243
|
};
|
|
1233
1244
|
var surfaceColors = {
|
|
@@ -1320,13 +1331,13 @@ var chartColors = {
|
|
|
1320
1331
|
var textColors = {
|
|
1321
1332
|
day: {
|
|
1322
1333
|
primary: "0 0% 9%",
|
|
1323
|
-
// Almost black
|
|
1334
|
+
// Almost black (neutral-900 equivalent)
|
|
1324
1335
|
secondary: "0 0% 45%",
|
|
1325
1336
|
// Medium gray
|
|
1326
1337
|
tertiary: "0 0% 65%",
|
|
1327
1338
|
// Light gray
|
|
1328
|
-
muted: "0 0%
|
|
1329
|
-
// Muted gray
|
|
1339
|
+
muted: "0 0% 42%",
|
|
1340
|
+
// Muted gray - adjusted for WCAG AA contrast (4.5:1) on surface.elevated2
|
|
1330
1341
|
inverse: "0 0% 100%"
|
|
1331
1342
|
// White (for dark backgrounds)
|
|
1332
1343
|
},
|
|
@@ -1576,6 +1587,50 @@ var tailwindThemeColors = {
|
|
|
1576
1587
|
}
|
|
1577
1588
|
};
|
|
1578
1589
|
|
|
1590
|
+
// src/tokens/motion/v2.ts
|
|
1591
|
+
var motionV2Durations = {
|
|
1592
|
+
fast: "150ms",
|
|
1593
|
+
// Quick interactions
|
|
1594
|
+
normal: "250ms",
|
|
1595
|
+
// Default transitions
|
|
1596
|
+
slow: "350ms",
|
|
1597
|
+
// Emphasized animations
|
|
1598
|
+
reduced: "0ms"
|
|
1599
|
+
// For prefers-reduced-motion
|
|
1600
|
+
};
|
|
1601
|
+
var motionV2Easings = {
|
|
1602
|
+
soft: "cubic-bezier(0.22, 1, 0.36, 1)",
|
|
1603
|
+
// Gentle, smooth
|
|
1604
|
+
standard: "cubic-bezier(0.4, 0, 0.2, 1)",
|
|
1605
|
+
// Material Design standard
|
|
1606
|
+
emphasized: "cubic-bezier(0.2, 0, 0, 1)"
|
|
1607
|
+
// Strong, decisive
|
|
1608
|
+
};
|
|
1609
|
+
var motionV2Transitions = {
|
|
1610
|
+
fast: `${motionV2Durations.fast} ${motionV2Easings.standard}`,
|
|
1611
|
+
normal: `${motionV2Durations.normal} ${motionV2Easings.standard}`,
|
|
1612
|
+
slow: `${motionV2Durations.slow} ${motionV2Easings.emphasized}`,
|
|
1613
|
+
soft: `${motionV2Durations.normal} ${motionV2Easings.soft}`,
|
|
1614
|
+
reduced: `${motionV2Durations.reduced} linear`
|
|
1615
|
+
};
|
|
1616
|
+
var motionV2CSSVariables = {
|
|
1617
|
+
// Durations
|
|
1618
|
+
"--motion-duration-fast": motionV2Durations.fast,
|
|
1619
|
+
"--motion-duration-normal": motionV2Durations.normal,
|
|
1620
|
+
"--motion-duration-slow": motionV2Durations.slow,
|
|
1621
|
+
"--motion-duration-reduced": motionV2Durations.reduced,
|
|
1622
|
+
// Easings
|
|
1623
|
+
"--motion-easing-soft": motionV2Easings.soft,
|
|
1624
|
+
"--motion-easing-standard": motionV2Easings.standard,
|
|
1625
|
+
"--motion-easing-emphasized": motionV2Easings.emphasized,
|
|
1626
|
+
// Transitions
|
|
1627
|
+
"--motion-transition-fast": motionV2Transitions.fast,
|
|
1628
|
+
"--motion-transition-normal": motionV2Transitions.normal,
|
|
1629
|
+
"--motion-transition-slow": motionV2Transitions.slow,
|
|
1630
|
+
"--motion-transition-soft": motionV2Transitions.soft,
|
|
1631
|
+
"--motion-transition-reduced": motionV2Transitions.reduced
|
|
1632
|
+
};
|
|
1633
|
+
|
|
1579
1634
|
// src/tokens/motion.ts
|
|
1580
1635
|
var durations = {
|
|
1581
1636
|
instant: "0ms",
|
|
@@ -1688,6 +1743,940 @@ var motionCSSVariables = {
|
|
|
1688
1743
|
"--transition-elastic": transitions.elastic
|
|
1689
1744
|
};
|
|
1690
1745
|
|
|
1746
|
+
// src/tokens/radius.ts
|
|
1747
|
+
var borderRadius = {
|
|
1748
|
+
// No radius
|
|
1749
|
+
none: "0",
|
|
1750
|
+
// Extra small radius
|
|
1751
|
+
xs: "0.125rem",
|
|
1752
|
+
// 2px
|
|
1753
|
+
// Small radius
|
|
1754
|
+
sm: "0.25rem",
|
|
1755
|
+
// 4px (same as sm)
|
|
1756
|
+
base: "0.25rem",
|
|
1757
|
+
// 4px (alias)
|
|
1758
|
+
// Medium radius
|
|
1759
|
+
md: "0.375rem",
|
|
1760
|
+
// 6px
|
|
1761
|
+
// Large radius
|
|
1762
|
+
lg: "0.5rem",
|
|
1763
|
+
// 8px (2 × base)
|
|
1764
|
+
// Extra large radius
|
|
1765
|
+
xl: "0.75rem",
|
|
1766
|
+
// 12px (3 × base)
|
|
1767
|
+
// 2XL radius
|
|
1768
|
+
"2xl": "1rem",
|
|
1769
|
+
// 16px (4 × base)
|
|
1770
|
+
// 3XL radius
|
|
1771
|
+
"3xl": "1.5rem",
|
|
1772
|
+
// 24px (6 × base)
|
|
1773
|
+
// Full radius (circular)
|
|
1774
|
+
full: "9999px"
|
|
1775
|
+
};
|
|
1776
|
+
var componentRadius = {
|
|
1777
|
+
// Button radius standards
|
|
1778
|
+
button: {
|
|
1779
|
+
// 4px (compact buttons)
|
|
1780
|
+
md: borderRadius.md},
|
|
1781
|
+
// Card radius standards
|
|
1782
|
+
card: {
|
|
1783
|
+
// 4px (compact cards)
|
|
1784
|
+
md: borderRadius.md},
|
|
1785
|
+
// Input/Form field radius standards
|
|
1786
|
+
input: {
|
|
1787
|
+
// 4px (compact inputs)
|
|
1788
|
+
md: borderRadius.md},
|
|
1789
|
+
// Badge/Status radius standards
|
|
1790
|
+
badge: {
|
|
1791
|
+
// 2px (compact badges)
|
|
1792
|
+
md: borderRadius.sm},
|
|
1793
|
+
// Modal/Dialog radius standards
|
|
1794
|
+
modal: {
|
|
1795
|
+
// 6px (small modals)
|
|
1796
|
+
md: borderRadius.lg},
|
|
1797
|
+
// Tooltip radius standards
|
|
1798
|
+
tooltip: {
|
|
1799
|
+
sm: borderRadius.sm},
|
|
1800
|
+
// Toast/Notification radius standards
|
|
1801
|
+
toast: {
|
|
1802
|
+
// 6px (compact toasts)
|
|
1803
|
+
md: borderRadius.lg},
|
|
1804
|
+
// Chip/Tag radius standards
|
|
1805
|
+
chip: {
|
|
1806
|
+
// 2px (compact chips)
|
|
1807
|
+
md: borderRadius.sm},
|
|
1808
|
+
// Image/Media radius standards
|
|
1809
|
+
image: {
|
|
1810
|
+
// 4px (subtle rounding)
|
|
1811
|
+
md: borderRadius.md}
|
|
1812
|
+
};
|
|
1813
|
+
var radiusCSSVariables = {
|
|
1814
|
+
// Border radius scale
|
|
1815
|
+
"--radius-none": borderRadius.none,
|
|
1816
|
+
"--radius-xs": borderRadius.xs,
|
|
1817
|
+
"--radius-sm": borderRadius.sm,
|
|
1818
|
+
"--radius-base": borderRadius.base,
|
|
1819
|
+
"--radius-md": borderRadius.md,
|
|
1820
|
+
"--radius-lg": borderRadius.lg,
|
|
1821
|
+
"--radius-xl": borderRadius.xl,
|
|
1822
|
+
"--radius-2xl": borderRadius["2xl"],
|
|
1823
|
+
"--radius-3xl": borderRadius["3xl"],
|
|
1824
|
+
"--radius-full": borderRadius.full,
|
|
1825
|
+
// Default radius variable (commonly used)
|
|
1826
|
+
"--radius": borderRadius.md,
|
|
1827
|
+
// Default to medium (6px)
|
|
1828
|
+
// Component-specific radius variables
|
|
1829
|
+
"--radius-button": componentRadius.button.md,
|
|
1830
|
+
"--radius-card": componentRadius.card.md,
|
|
1831
|
+
"--radius-input": componentRadius.input.md,
|
|
1832
|
+
"--radius-badge": componentRadius.badge.md,
|
|
1833
|
+
"--radius-modal": componentRadius.modal.md,
|
|
1834
|
+
"--radius-tooltip": componentRadius.tooltip.sm,
|
|
1835
|
+
"--radius-toast": componentRadius.toast.md,
|
|
1836
|
+
"--radius-chip": componentRadius.chip.md,
|
|
1837
|
+
"--radius-image": componentRadius.image.md
|
|
1838
|
+
};
|
|
1839
|
+
|
|
1840
|
+
// src/tokens/shadows.ts
|
|
1841
|
+
var shadowBase = {
|
|
1842
|
+
black: "0 0 0"};
|
|
1843
|
+
var shadowOpacity = {
|
|
1844
|
+
xs: "0.05",
|
|
1845
|
+
sm: "0.1",
|
|
1846
|
+
md: "0.1",
|
|
1847
|
+
lg: "0.1",
|
|
1848
|
+
xl: "0.1",
|
|
1849
|
+
"2xl": "0.25"};
|
|
1850
|
+
var elevationShadows = {
|
|
1851
|
+
none: "none",
|
|
1852
|
+
xs: `0 1px 2px 0 rgb(${shadowBase.black} / ${shadowOpacity.xs})`,
|
|
1853
|
+
sm: `0 1px 3px 0 rgb(${shadowBase.black} / ${shadowOpacity.sm}), 0 1px 2px -1px rgb(${shadowBase.black} / ${shadowOpacity.sm})`,
|
|
1854
|
+
md: `0 4px 6px -1px rgb(${shadowBase.black} / ${shadowOpacity.md}), 0 2px 4px -2px rgb(${shadowBase.black} / ${shadowOpacity.md})`,
|
|
1855
|
+
lg: `0 10px 15px -3px rgb(${shadowBase.black} / ${shadowOpacity.lg}), 0 4px 6px -4px rgb(${shadowBase.black} / ${shadowOpacity.lg})`,
|
|
1856
|
+
xl: `0 20px 25px -5px rgb(${shadowBase.black} / ${shadowOpacity.xl}), 0 8px 10px -6px rgb(${shadowBase.black} / ${shadowOpacity.xl})`,
|
|
1857
|
+
"2xl": `0 25px 50px -12px rgb(${shadowBase.black} / ${shadowOpacity["2xl"]})`
|
|
1858
|
+
};
|
|
1859
|
+
var primaryColoredShadows = {
|
|
1860
|
+
xs: "0 1px 2px 0 hsl(var(--primary-500) / 0.15)",
|
|
1861
|
+
sm: "0 2px 4px 0 hsl(var(--primary-500) / 0.2)",
|
|
1862
|
+
md: "0 4px 8px 0 hsl(var(--primary-500) / 0.3)",
|
|
1863
|
+
lg: "0 8px 16px 0 hsl(var(--primary-500) / 0.4)",
|
|
1864
|
+
xl: "0 12px 24px 0 hsl(var(--primary-500) / 0.5)",
|
|
1865
|
+
"2xl": "0 16px 32px 0 hsl(var(--primary-500) / 0.6)"
|
|
1866
|
+
};
|
|
1867
|
+
var accentColoredShadows = {
|
|
1868
|
+
xs: "0 1px 2px 0 hsl(var(--accent-500) / 0.15)",
|
|
1869
|
+
sm: "0 2px 4px 0 hsl(var(--accent-500) / 0.2)",
|
|
1870
|
+
md: "0 4px 8px 0 hsl(var(--accent-500) / 0.3)",
|
|
1871
|
+
lg: "0 8px 16px 0 hsl(var(--accent-500) / 0.4)",
|
|
1872
|
+
xl: "0 12px 24px 0 hsl(var(--accent-500) / 0.5)",
|
|
1873
|
+
"2xl": "0 16px 32px 0 hsl(var(--accent-500) / 0.6)"
|
|
1874
|
+
};
|
|
1875
|
+
var glowEffects = {
|
|
1876
|
+
// Primary glow effects
|
|
1877
|
+
"glow-primary": "0 0 20px 0 hsl(var(--primary-500) / 0.5), 0 0 40px 0 hsl(var(--primary-500) / 0.3)",
|
|
1878
|
+
"glow-primary-subtle": "0 0 8px 0 hsl(var(--primary-500) / 0.3)",
|
|
1879
|
+
"glow-primary-medium": "0 0 16px 0 hsl(var(--primary-500) / 0.5)",
|
|
1880
|
+
"glow-primary-strong": "0 0 24px 0 hsl(var(--primary-500) / 0.6)",
|
|
1881
|
+
// Accent glow effects
|
|
1882
|
+
"glow-accent": "0 0 20px 0 hsl(var(--accent-500) / 0.5), 0 0 40px 0 hsl(var(--accent-500) / 0.3)",
|
|
1883
|
+
"glow-accent-subtle": "0 0 8px 0 hsl(var(--accent-500) / 0.3)",
|
|
1884
|
+
"glow-accent-medium": "0 0 16px 0 hsl(var(--accent-500) / 0.5)",
|
|
1885
|
+
"glow-accent-strong": "0 0 24px 0 hsl(var(--accent-500) / 0.6)"
|
|
1886
|
+
};
|
|
1887
|
+
var focusRings = {
|
|
1888
|
+
default: "0 0 0 3px hsl(var(--ring) / 0.5)",
|
|
1889
|
+
primary: "0 0 0 3px hsl(var(--primary-500) / 0.3)",
|
|
1890
|
+
accent: "0 0 0 3px hsl(var(--accent-500) / 0.3)",
|
|
1891
|
+
"focus-primary": "0 0 0 3px hsl(var(--primary-500) / 0.3)",
|
|
1892
|
+
"focus-accent": "0 0 0 3px hsl(var(--accent-500) / 0.3)"
|
|
1893
|
+
};
|
|
1894
|
+
var shadowCSSVariables = {
|
|
1895
|
+
// Elevation shadows
|
|
1896
|
+
"--shadow-none": elevationShadows.none,
|
|
1897
|
+
"--shadow-xs": elevationShadows.xs,
|
|
1898
|
+
"--shadow-sm": elevationShadows.sm,
|
|
1899
|
+
"--shadow-md": elevationShadows.md,
|
|
1900
|
+
"--shadow-lg": elevationShadows.lg,
|
|
1901
|
+
"--shadow-xl": elevationShadows.xl,
|
|
1902
|
+
"--shadow-2xl": elevationShadows["2xl"],
|
|
1903
|
+
// Primary colored shadows
|
|
1904
|
+
"--shadow-primary-xs": primaryColoredShadows.xs,
|
|
1905
|
+
"--shadow-primary-sm": primaryColoredShadows.sm,
|
|
1906
|
+
"--shadow-primary-md": primaryColoredShadows.md,
|
|
1907
|
+
"--shadow-primary-lg": primaryColoredShadows.lg,
|
|
1908
|
+
"--shadow-primary-xl": primaryColoredShadows.xl,
|
|
1909
|
+
"--shadow-primary-2xl": primaryColoredShadows["2xl"],
|
|
1910
|
+
// Accent colored shadows
|
|
1911
|
+
"--shadow-accent-xs": accentColoredShadows.xs,
|
|
1912
|
+
"--shadow-accent-sm": accentColoredShadows.sm,
|
|
1913
|
+
"--shadow-accent-md": accentColoredShadows.md,
|
|
1914
|
+
"--shadow-accent-lg": accentColoredShadows.lg,
|
|
1915
|
+
"--shadow-accent-xl": accentColoredShadows.xl,
|
|
1916
|
+
"--shadow-accent-2xl": accentColoredShadows["2xl"],
|
|
1917
|
+
// Glow effects
|
|
1918
|
+
"--glow-primary": glowEffects["glow-primary"],
|
|
1919
|
+
"--glow-primary-subtle": glowEffects["glow-primary-subtle"],
|
|
1920
|
+
"--glow-primary-medium": glowEffects["glow-primary-medium"],
|
|
1921
|
+
"--glow-primary-strong": glowEffects["glow-primary-strong"],
|
|
1922
|
+
"--glow-accent": glowEffects["glow-accent"],
|
|
1923
|
+
"--glow-accent-subtle": glowEffects["glow-accent-subtle"],
|
|
1924
|
+
"--glow-accent-medium": glowEffects["glow-accent-medium"],
|
|
1925
|
+
"--glow-accent-strong": glowEffects["glow-accent-strong"],
|
|
1926
|
+
// Focus rings
|
|
1927
|
+
"--focus-ring-default": focusRings.default,
|
|
1928
|
+
"--focus-ring-primary": focusRings.primary,
|
|
1929
|
+
"--focus-ring-accent": focusRings.accent,
|
|
1930
|
+
"--focus-primary": focusRings["focus-primary"],
|
|
1931
|
+
"--focus-accent": focusRings["focus-accent"]
|
|
1932
|
+
};
|
|
1933
|
+
|
|
1934
|
+
// src/tokens/spacing.ts
|
|
1935
|
+
var spacing = {
|
|
1936
|
+
// Zero spacing
|
|
1937
|
+
0: "0",
|
|
1938
|
+
px: "1px",
|
|
1939
|
+
// Half unit (4px)
|
|
1940
|
+
0.5: "0.125rem",
|
|
1941
|
+
// 4px
|
|
1942
|
+
// Base unit multiples (8px increments)
|
|
1943
|
+
1: "0.25rem",
|
|
1944
|
+
// 4px (half unit, common)
|
|
1945
|
+
1.5: "0.375rem",
|
|
1946
|
+
// 6px (rare, for fine adjustments)
|
|
1947
|
+
2: "0.5rem",
|
|
1948
|
+
// 8px (base unit)
|
|
1949
|
+
2.5: "0.625rem",
|
|
1950
|
+
// 10px (rare)
|
|
1951
|
+
3: "0.75rem",
|
|
1952
|
+
// 12px (1.5 × base)
|
|
1953
|
+
3.5: "0.875rem",
|
|
1954
|
+
// 14px (rare)
|
|
1955
|
+
4: "1rem",
|
|
1956
|
+
// 16px (2 × base)
|
|
1957
|
+
5: "1.25rem",
|
|
1958
|
+
// 20px (2.5 × base)
|
|
1959
|
+
6: "1.5rem",
|
|
1960
|
+
// 24px (3 × base)
|
|
1961
|
+
7: "1.75rem",
|
|
1962
|
+
// 28px (3.5 × base)
|
|
1963
|
+
8: "2rem",
|
|
1964
|
+
// 32px (4 × base)
|
|
1965
|
+
9: "2.25rem",
|
|
1966
|
+
// 36px (4.5 × base)
|
|
1967
|
+
10: "2.5rem",
|
|
1968
|
+
// 40px (5 × base)
|
|
1969
|
+
11: "2.75rem",
|
|
1970
|
+
// 44px (5.5 × base)
|
|
1971
|
+
12: "3rem",
|
|
1972
|
+
// 48px (6 × base)
|
|
1973
|
+
14: "3.5rem",
|
|
1974
|
+
// 56px (7 × base)
|
|
1975
|
+
16: "4rem",
|
|
1976
|
+
// 64px (8 × base)
|
|
1977
|
+
20: "5rem",
|
|
1978
|
+
// 80px (10 × base)
|
|
1979
|
+
24: "6rem"};
|
|
1980
|
+
var semanticSpacing = {
|
|
1981
|
+
// Extra small spacing (tight, minimal)
|
|
1982
|
+
xs: spacing[1],
|
|
1983
|
+
// 4px (0.25rem)
|
|
1984
|
+
// Small spacing (compact)
|
|
1985
|
+
sm: spacing[2],
|
|
1986
|
+
// 8px (0.5rem)
|
|
1987
|
+
// Medium spacing (default)
|
|
1988
|
+
md: spacing[4],
|
|
1989
|
+
// 16px (1rem)
|
|
1990
|
+
// Large spacing (spacious)
|
|
1991
|
+
lg: spacing[6],
|
|
1992
|
+
// 24px (1.5rem)
|
|
1993
|
+
// Extra large spacing (very spacious)
|
|
1994
|
+
xl: spacing[8],
|
|
1995
|
+
// 32px (2rem)
|
|
1996
|
+
// 2XL spacing (section-level)
|
|
1997
|
+
"2xl": spacing[12],
|
|
1998
|
+
// 48px (3rem)
|
|
1999
|
+
// 3XL spacing (major sections)
|
|
2000
|
+
"3xl": spacing[16],
|
|
2001
|
+
// 64px (4rem)
|
|
2002
|
+
// 4XL spacing (page sections)
|
|
2003
|
+
"4xl": spacing[20],
|
|
2004
|
+
// 80px (5rem)
|
|
2005
|
+
// 5XL spacing (hero sections)
|
|
2006
|
+
"5xl": spacing[24],
|
|
2007
|
+
// 96px (6rem)
|
|
2008
|
+
// None (no spacing)
|
|
2009
|
+
none: spacing[0]
|
|
2010
|
+
// 0
|
|
2011
|
+
};
|
|
2012
|
+
var layoutSpacing = {
|
|
2013
|
+
// Section spacing (vertical spacing between major sections)
|
|
2014
|
+
section: {
|
|
2015
|
+
xs: spacing[6],
|
|
2016
|
+
// 24px (compact sections)
|
|
2017
|
+
sm: spacing[8],
|
|
2018
|
+
// 32px (small sections)
|
|
2019
|
+
md: spacing[12],
|
|
2020
|
+
// 48px (default sections)
|
|
2021
|
+
lg: spacing[16],
|
|
2022
|
+
// 64px (large sections)
|
|
2023
|
+
xl: spacing[20],
|
|
2024
|
+
// 80px (extra large sections)
|
|
2025
|
+
"2xl": spacing[24]
|
|
2026
|
+
// 96px (hero sections)
|
|
2027
|
+
},
|
|
2028
|
+
// Container spacing (padding inside containers)
|
|
2029
|
+
container: {
|
|
2030
|
+
xs: spacing[2],
|
|
2031
|
+
// 8px (tight containers)
|
|
2032
|
+
sm: spacing[4],
|
|
2033
|
+
// 16px (compact containers)
|
|
2034
|
+
md: spacing[6],
|
|
2035
|
+
// 24px (default containers)
|
|
2036
|
+
lg: spacing[8],
|
|
2037
|
+
// 32px (spacious containers)
|
|
2038
|
+
xl: spacing[12]
|
|
2039
|
+
// 48px (very spacious containers)
|
|
2040
|
+
},
|
|
2041
|
+
// Grid spacing (gap between grid items)
|
|
2042
|
+
grid: {
|
|
2043
|
+
xs: spacing[2],
|
|
2044
|
+
// 8px (tight grids)
|
|
2045
|
+
sm: spacing[4],
|
|
2046
|
+
// 16px (compact grids)
|
|
2047
|
+
md: spacing[6],
|
|
2048
|
+
// 24px (default grids)
|
|
2049
|
+
lg: spacing[8],
|
|
2050
|
+
// 32px (spacious grids)
|
|
2051
|
+
xl: spacing[12]
|
|
2052
|
+
// 48px (very spacious grids)
|
|
2053
|
+
},
|
|
2054
|
+
// Stack spacing (gap between stacked items)
|
|
2055
|
+
stack: {
|
|
2056
|
+
xs: spacing[1],
|
|
2057
|
+
// 4px (tight stacks)
|
|
2058
|
+
sm: spacing[2],
|
|
2059
|
+
// 8px (compact stacks)
|
|
2060
|
+
md: spacing[4],
|
|
2061
|
+
// 16px (default stacks)
|
|
2062
|
+
lg: spacing[6],
|
|
2063
|
+
// 24px (spacious stacks)
|
|
2064
|
+
xl: spacing[8]
|
|
2065
|
+
// 32px (very spacious stacks)
|
|
2066
|
+
},
|
|
2067
|
+
// Component internal spacing (padding inside components)
|
|
2068
|
+
component: {
|
|
2069
|
+
xs: spacing[1],
|
|
2070
|
+
// 4px (tight components)
|
|
2071
|
+
sm: spacing[2],
|
|
2072
|
+
// 8px (compact components)
|
|
2073
|
+
md: spacing[4],
|
|
2074
|
+
// 16px (default components)
|
|
2075
|
+
lg: spacing[6],
|
|
2076
|
+
// 24px (spacious components)
|
|
2077
|
+
xl: spacing[8]
|
|
2078
|
+
// 32px (extra spacious components)
|
|
2079
|
+
}
|
|
2080
|
+
};
|
|
2081
|
+
var spacingCSSVariables = {
|
|
2082
|
+
// Base spacing scale
|
|
2083
|
+
"--spacing-0": spacing[0],
|
|
2084
|
+
"--spacing-px": spacing.px,
|
|
2085
|
+
"--spacing-0-5": spacing[0.5],
|
|
2086
|
+
"--spacing-1": spacing[1],
|
|
2087
|
+
"--spacing-1-5": spacing[1.5],
|
|
2088
|
+
"--spacing-2": spacing[2],
|
|
2089
|
+
"--spacing-2-5": spacing[2.5],
|
|
2090
|
+
"--spacing-3": spacing[3],
|
|
2091
|
+
"--spacing-3-5": spacing[3.5],
|
|
2092
|
+
"--spacing-4": spacing[4],
|
|
2093
|
+
"--spacing-5": spacing[5],
|
|
2094
|
+
"--spacing-6": spacing[6],
|
|
2095
|
+
"--spacing-7": spacing[7],
|
|
2096
|
+
"--spacing-8": spacing[8],
|
|
2097
|
+
"--spacing-9": spacing[9],
|
|
2098
|
+
"--spacing-10": spacing[10],
|
|
2099
|
+
"--spacing-11": spacing[11],
|
|
2100
|
+
"--spacing-12": spacing[12],
|
|
2101
|
+
"--spacing-14": spacing[14],
|
|
2102
|
+
"--spacing-16": spacing[16],
|
|
2103
|
+
"--spacing-20": spacing[20],
|
|
2104
|
+
"--spacing-24": spacing[24],
|
|
2105
|
+
// Semantic spacing
|
|
2106
|
+
"--spacing-xs": semanticSpacing.xs,
|
|
2107
|
+
"--spacing-sm": semanticSpacing.sm,
|
|
2108
|
+
"--spacing-md": semanticSpacing.md,
|
|
2109
|
+
"--spacing-lg": semanticSpacing.lg,
|
|
2110
|
+
"--spacing-xl": semanticSpacing.xl,
|
|
2111
|
+
"--spacing-2xl": semanticSpacing["2xl"],
|
|
2112
|
+
"--spacing-3xl": semanticSpacing["3xl"],
|
|
2113
|
+
"--spacing-4xl": semanticSpacing["4xl"],
|
|
2114
|
+
"--spacing-5xl": semanticSpacing["5xl"],
|
|
2115
|
+
"--spacing-none": semanticSpacing.none,
|
|
2116
|
+
// Layout spacing - sections
|
|
2117
|
+
"--layout-section-xs": layoutSpacing.section.xs,
|
|
2118
|
+
"--layout-section-sm": layoutSpacing.section.sm,
|
|
2119
|
+
"--layout-section-md": layoutSpacing.section.md,
|
|
2120
|
+
"--layout-section-lg": layoutSpacing.section.lg,
|
|
2121
|
+
"--layout-section-xl": layoutSpacing.section.xl,
|
|
2122
|
+
"--layout-section-2xl": layoutSpacing.section["2xl"],
|
|
2123
|
+
// Layout spacing - containers
|
|
2124
|
+
"--layout-container-xs": layoutSpacing.container.xs,
|
|
2125
|
+
"--layout-container-sm": layoutSpacing.container.sm,
|
|
2126
|
+
"--layout-container-md": layoutSpacing.container.md,
|
|
2127
|
+
"--layout-container-lg": layoutSpacing.container.lg,
|
|
2128
|
+
"--layout-container-xl": layoutSpacing.container.xl,
|
|
2129
|
+
// Layout spacing - grids
|
|
2130
|
+
"--layout-grid-xs": layoutSpacing.grid.xs,
|
|
2131
|
+
"--layout-grid-sm": layoutSpacing.grid.sm,
|
|
2132
|
+
"--layout-grid-md": layoutSpacing.grid.md,
|
|
2133
|
+
"--layout-grid-lg": layoutSpacing.grid.lg,
|
|
2134
|
+
"--layout-grid-xl": layoutSpacing.grid.xl,
|
|
2135
|
+
// Layout spacing - stacks
|
|
2136
|
+
"--layout-stack-xs": layoutSpacing.stack.xs,
|
|
2137
|
+
"--layout-stack-sm": layoutSpacing.stack.sm,
|
|
2138
|
+
"--layout-stack-md": layoutSpacing.stack.md,
|
|
2139
|
+
"--layout-stack-lg": layoutSpacing.stack.lg,
|
|
2140
|
+
"--layout-stack-xl": layoutSpacing.stack.xl,
|
|
2141
|
+
// Layout spacing - components
|
|
2142
|
+
"--layout-component-xs": layoutSpacing.component.xs,
|
|
2143
|
+
"--layout-component-sm": layoutSpacing.component.sm,
|
|
2144
|
+
"--layout-component-md": layoutSpacing.component.md,
|
|
2145
|
+
"--layout-component-lg": layoutSpacing.component.lg,
|
|
2146
|
+
"--layout-component-xl": layoutSpacing.component.xl
|
|
2147
|
+
};
|
|
2148
|
+
|
|
2149
|
+
// src/tokens/typography.ts
|
|
2150
|
+
var fontFamily = {
|
|
2151
|
+
// Primary font - Inter (default sans)
|
|
2152
|
+
sans: [
|
|
2153
|
+
"Inter",
|
|
2154
|
+
"ui-sans-serif",
|
|
2155
|
+
"system-ui",
|
|
2156
|
+
"-apple-system",
|
|
2157
|
+
"BlinkMacSystemFont",
|
|
2158
|
+
"Segoe UI",
|
|
2159
|
+
"Roboto",
|
|
2160
|
+
"Helvetica Neue",
|
|
2161
|
+
"Arial",
|
|
2162
|
+
"Noto Sans",
|
|
2163
|
+
"sans-serif",
|
|
2164
|
+
"Apple Color Emoji",
|
|
2165
|
+
"Segoe UI Emoji",
|
|
2166
|
+
"Segoe UI Symbol",
|
|
2167
|
+
"Noto Color Emoji"
|
|
2168
|
+
],
|
|
2169
|
+
// Optional font - Satoshi
|
|
2170
|
+
satoshi: [
|
|
2171
|
+
"Satoshi",
|
|
2172
|
+
"Inter",
|
|
2173
|
+
"ui-sans-serif",
|
|
2174
|
+
"system-ui",
|
|
2175
|
+
"-apple-system",
|
|
2176
|
+
"BlinkMacSystemFont",
|
|
2177
|
+
"Segoe UI",
|
|
2178
|
+
"Roboto",
|
|
2179
|
+
"sans-serif"
|
|
2180
|
+
],
|
|
2181
|
+
// Display font - Clash Display (for headings and hero sections)
|
|
2182
|
+
display: [
|
|
2183
|
+
"Clash Display",
|
|
2184
|
+
"Inter",
|
|
2185
|
+
"ui-sans-serif",
|
|
2186
|
+
"system-ui",
|
|
2187
|
+
"-apple-system",
|
|
2188
|
+
"BlinkMacSystemFont",
|
|
2189
|
+
"Segoe UI",
|
|
2190
|
+
"Roboto",
|
|
2191
|
+
"sans-serif"
|
|
2192
|
+
],
|
|
2193
|
+
// Serif font family
|
|
2194
|
+
serif: ["ui-serif", "Georgia", "Cambria", "Times New Roman", "Times", "serif"],
|
|
2195
|
+
// Monospace font family
|
|
2196
|
+
mono: [
|
|
2197
|
+
"ui-monospace",
|
|
2198
|
+
"SFMono-Regular",
|
|
2199
|
+
"Menlo",
|
|
2200
|
+
"Monaco",
|
|
2201
|
+
"Consolas",
|
|
2202
|
+
"Liberation Mono",
|
|
2203
|
+
"Courier New",
|
|
2204
|
+
"monospace"
|
|
2205
|
+
]
|
|
2206
|
+
};
|
|
2207
|
+
var fontSize = {
|
|
2208
|
+
// text-xs: 12px base, scales from 0.75rem to 0.875rem
|
|
2209
|
+
xs: [
|
|
2210
|
+
"clamp(0.75rem, 0.7rem + 0.125vw, 0.875rem)",
|
|
2211
|
+
{ lineHeight: "1rem", letterSpacing: "0.05em" }
|
|
2212
|
+
],
|
|
2213
|
+
// text-sm: 14px base, scales from 0.875rem to 1rem
|
|
2214
|
+
sm: [
|
|
2215
|
+
"clamp(0.875rem, 0.8rem + 0.25vw, 1rem)",
|
|
2216
|
+
{ lineHeight: "1.25rem", letterSpacing: "0.025em" }
|
|
2217
|
+
],
|
|
2218
|
+
// text-base: 16px base, scales from 1rem to 1.125rem
|
|
2219
|
+
base: ["clamp(1rem, 0.95rem + 0.25vw, 1.125rem)", { lineHeight: "1.5rem", letterSpacing: "0em" }],
|
|
2220
|
+
// text-lg: 18px base, scales from 1.125rem to 1.25rem
|
|
2221
|
+
lg: [
|
|
2222
|
+
"clamp(1.125rem, 1rem + 0.5vw, 1.25rem)",
|
|
2223
|
+
{ lineHeight: "1.75rem", letterSpacing: "-0.025em" }
|
|
2224
|
+
],
|
|
2225
|
+
// text-xl: 20px base, scales from 1.25rem to 1.5rem
|
|
2226
|
+
xl: [
|
|
2227
|
+
"clamp(1.25rem, 1.1rem + 0.75vw, 1.5rem)",
|
|
2228
|
+
{ lineHeight: "1.75rem", letterSpacing: "-0.025em" }
|
|
2229
|
+
],
|
|
2230
|
+
// text-2xl: 24px base, scales from 1.5rem to 2rem
|
|
2231
|
+
"2xl": [
|
|
2232
|
+
"clamp(1.5rem, 1.25rem + 1.25vw, 2rem)",
|
|
2233
|
+
{ lineHeight: "2rem", letterSpacing: "-0.05em" }
|
|
2234
|
+
],
|
|
2235
|
+
// text-3xl: 30px base, scales from 1.875rem to 2.5rem
|
|
2236
|
+
"3xl": [
|
|
2237
|
+
"clamp(1.875rem, 1.5rem + 1.875vw, 2.5rem)",
|
|
2238
|
+
{ lineHeight: "2.25rem", letterSpacing: "-0.05em" }
|
|
2239
|
+
],
|
|
2240
|
+
// text-4xl: 36px base, scales from 2.25rem to 3rem
|
|
2241
|
+
"4xl": [
|
|
2242
|
+
"clamp(2.25rem, 1.75rem + 2.5vw, 3rem)",
|
|
2243
|
+
{ lineHeight: "2.5rem", letterSpacing: "-0.025em" }
|
|
2244
|
+
],
|
|
2245
|
+
// text-5xl: 48px base, scales from 3rem to 4rem
|
|
2246
|
+
"5xl": ["clamp(3rem, 2rem + 5vw, 4rem)", { lineHeight: "1", letterSpacing: "-0.025em" }],
|
|
2247
|
+
// text-6xl: 60px base, scales from 3.75rem to 5rem
|
|
2248
|
+
"6xl": ["clamp(3.75rem, 2.5rem + 6.25vw, 5rem)", { lineHeight: "1", letterSpacing: "-0.05em" }],
|
|
2249
|
+
// text-7xl: 72px base (optional, for hero sections)
|
|
2250
|
+
"7xl": ["clamp(4.5rem, 3rem + 7.5vw, 6rem)", { lineHeight: "1", letterSpacing: "-0.05em" }],
|
|
2251
|
+
// text-8xl: 96px base (optional, for hero sections)
|
|
2252
|
+
"8xl": ["clamp(6rem, 4rem + 10vw, 8rem)", { lineHeight: "1", letterSpacing: "-0.05em" }],
|
|
2253
|
+
// text-9xl: 128px base (optional, for hero sections)
|
|
2254
|
+
"9xl": ["clamp(8rem, 5rem + 15vw, 12rem)", { lineHeight: "1", letterSpacing: "-0.05em" }]
|
|
2255
|
+
};
|
|
2256
|
+
var fontWeight = {
|
|
2257
|
+
thin: "100",
|
|
2258
|
+
extralight: "200",
|
|
2259
|
+
light: "300",
|
|
2260
|
+
normal: "400",
|
|
2261
|
+
medium: "500",
|
|
2262
|
+
semibold: "600",
|
|
2263
|
+
bold: "700",
|
|
2264
|
+
extrabold: "800",
|
|
2265
|
+
black: "900"
|
|
2266
|
+
};
|
|
2267
|
+
var lineHeight = {
|
|
2268
|
+
none: "1",
|
|
2269
|
+
tight: "1.25",
|
|
2270
|
+
snug: "1.375",
|
|
2271
|
+
normal: "1.5",
|
|
2272
|
+
relaxed: "1.625",
|
|
2273
|
+
loose: "2"
|
|
2274
|
+
};
|
|
2275
|
+
var letterSpacing = {
|
|
2276
|
+
tighter: "-0.05em",
|
|
2277
|
+
tight: "-0.025em",
|
|
2278
|
+
normal: "0em",
|
|
2279
|
+
wide: "0.025em",
|
|
2280
|
+
wider: "0.05em",
|
|
2281
|
+
widest: "0.1em"
|
|
2282
|
+
};
|
|
2283
|
+
var typographyCSSVariables = {
|
|
2284
|
+
// Font families
|
|
2285
|
+
"--font-sans": fontFamily.sans.join(", "),
|
|
2286
|
+
"--font-satoshi": fontFamily.satoshi.join(", "),
|
|
2287
|
+
"--font-display": fontFamily.display.join(", "),
|
|
2288
|
+
"--font-serif": fontFamily.serif.join(", "),
|
|
2289
|
+
"--font-mono": fontFamily.mono.join(", "),
|
|
2290
|
+
// Font sizes (using clamp values)
|
|
2291
|
+
"--font-size-xs": fontSize.xs[0],
|
|
2292
|
+
"--font-size-sm": fontSize.sm[0],
|
|
2293
|
+
"--font-size-base": fontSize.base[0],
|
|
2294
|
+
"--font-size-lg": fontSize.lg[0],
|
|
2295
|
+
"--font-size-xl": fontSize.xl[0],
|
|
2296
|
+
"--font-size-2xl": fontSize["2xl"][0],
|
|
2297
|
+
"--font-size-3xl": fontSize["3xl"][0],
|
|
2298
|
+
"--font-size-4xl": fontSize["4xl"][0],
|
|
2299
|
+
"--font-size-5xl": fontSize["5xl"][0],
|
|
2300
|
+
"--font-size-6xl": fontSize["6xl"][0],
|
|
2301
|
+
// Font weights
|
|
2302
|
+
"--font-weight-thin": fontWeight.thin,
|
|
2303
|
+
"--font-weight-extralight": fontWeight.extralight,
|
|
2304
|
+
"--font-weight-light": fontWeight.light,
|
|
2305
|
+
"--font-weight-normal": fontWeight.normal,
|
|
2306
|
+
"--font-weight-medium": fontWeight.medium,
|
|
2307
|
+
"--font-weight-semibold": fontWeight.semibold,
|
|
2308
|
+
"--font-weight-bold": fontWeight.bold,
|
|
2309
|
+
"--font-weight-extrabold": fontWeight.extrabold,
|
|
2310
|
+
"--font-weight-black": fontWeight.black,
|
|
2311
|
+
// Line heights
|
|
2312
|
+
"--line-height-none": lineHeight.none,
|
|
2313
|
+
"--line-height-tight": lineHeight.tight,
|
|
2314
|
+
"--line-height-snug": lineHeight.snug,
|
|
2315
|
+
"--line-height-normal": lineHeight.normal,
|
|
2316
|
+
"--line-height-relaxed": lineHeight.relaxed,
|
|
2317
|
+
"--line-height-loose": lineHeight.loose,
|
|
2318
|
+
// Letter spacing
|
|
2319
|
+
"--letter-spacing-tighter": letterSpacing.tighter,
|
|
2320
|
+
"--letter-spacing-tight": letterSpacing.tight,
|
|
2321
|
+
"--letter-spacing-normal": letterSpacing.normal,
|
|
2322
|
+
"--letter-spacing-wide": letterSpacing.wide,
|
|
2323
|
+
"--letter-spacing-wider": letterSpacing.wider,
|
|
2324
|
+
"--letter-spacing-widest": letterSpacing.widest
|
|
2325
|
+
};
|
|
2326
|
+
({
|
|
2327
|
+
// Display styles (for hero sections)
|
|
2328
|
+
display: {
|
|
2329
|
+
fontSize: fontSize["6xl"][0]},
|
|
2330
|
+
// Heading styles
|
|
2331
|
+
h1: {
|
|
2332
|
+
fontSize: fontSize["5xl"][0]},
|
|
2333
|
+
h2: {
|
|
2334
|
+
fontSize: fontSize["4xl"][0]},
|
|
2335
|
+
h3: {
|
|
2336
|
+
fontSize: fontSize["3xl"][0]},
|
|
2337
|
+
h4: {
|
|
2338
|
+
fontSize: fontSize["2xl"][0]},
|
|
2339
|
+
h5: {
|
|
2340
|
+
fontSize: fontSize.xl[0]},
|
|
2341
|
+
h6: {
|
|
2342
|
+
fontSize: fontSize.lg[0]},
|
|
2343
|
+
// Body text styles
|
|
2344
|
+
body: {
|
|
2345
|
+
fontSize: fontSize.base[0]},
|
|
2346
|
+
"body-sm": {
|
|
2347
|
+
fontSize: fontSize.sm[0]},
|
|
2348
|
+
"body-xs": {
|
|
2349
|
+
fontSize: fontSize.xs[0]},
|
|
2350
|
+
// Label styles
|
|
2351
|
+
label: {
|
|
2352
|
+
fontSize: fontSize.sm[0]},
|
|
2353
|
+
"label-sm": {
|
|
2354
|
+
fontSize: fontSize.xs[0]},
|
|
2355
|
+
// Caption styles
|
|
2356
|
+
caption: {
|
|
2357
|
+
fontSize: fontSize.xs[0]}
|
|
2358
|
+
});
|
|
2359
|
+
({
|
|
2360
|
+
fontSize: {
|
|
2361
|
+
xs: [
|
|
2362
|
+
fontSize.xs[0],
|
|
2363
|
+
{ lineHeight: fontSize.xs[1].lineHeight, letterSpacing: fontSize.xs[1].letterSpacing }
|
|
2364
|
+
],
|
|
2365
|
+
sm: [
|
|
2366
|
+
fontSize.sm[0],
|
|
2367
|
+
{ lineHeight: fontSize.sm[1].lineHeight, letterSpacing: fontSize.sm[1].letterSpacing }
|
|
2368
|
+
],
|
|
2369
|
+
md: [
|
|
2370
|
+
fontSize.base[0],
|
|
2371
|
+
{ lineHeight: fontSize.base[1].lineHeight, letterSpacing: fontSize.base[1].letterSpacing }
|
|
2372
|
+
],
|
|
2373
|
+
base: [
|
|
2374
|
+
fontSize.base[0],
|
|
2375
|
+
{ lineHeight: fontSize.base[1].lineHeight, letterSpacing: fontSize.base[1].letterSpacing }
|
|
2376
|
+
],
|
|
2377
|
+
lg: [
|
|
2378
|
+
fontSize.lg[0],
|
|
2379
|
+
{ lineHeight: fontSize.lg[1].lineHeight, letterSpacing: fontSize.lg[1].letterSpacing }
|
|
2380
|
+
],
|
|
2381
|
+
xl: [
|
|
2382
|
+
fontSize.xl[0],
|
|
2383
|
+
{ lineHeight: fontSize.xl[1].lineHeight, letterSpacing: fontSize.xl[1].letterSpacing }
|
|
2384
|
+
],
|
|
2385
|
+
"2xl": [
|
|
2386
|
+
fontSize["2xl"][0],
|
|
2387
|
+
{
|
|
2388
|
+
lineHeight: fontSize["2xl"][1].lineHeight,
|
|
2389
|
+
letterSpacing: fontSize["2xl"][1].letterSpacing
|
|
2390
|
+
}
|
|
2391
|
+
],
|
|
2392
|
+
"3xl": [
|
|
2393
|
+
fontSize["3xl"][0],
|
|
2394
|
+
{
|
|
2395
|
+
lineHeight: fontSize["3xl"][1].lineHeight,
|
|
2396
|
+
letterSpacing: fontSize["3xl"][1].letterSpacing
|
|
2397
|
+
}
|
|
2398
|
+
],
|
|
2399
|
+
"4xl": [
|
|
2400
|
+
fontSize["4xl"][0],
|
|
2401
|
+
{
|
|
2402
|
+
lineHeight: fontSize["4xl"][1].lineHeight,
|
|
2403
|
+
letterSpacing: fontSize["4xl"][1].letterSpacing
|
|
2404
|
+
}
|
|
2405
|
+
],
|
|
2406
|
+
"5xl": [
|
|
2407
|
+
fontSize["5xl"][0],
|
|
2408
|
+
{
|
|
2409
|
+
lineHeight: fontSize["5xl"][1].lineHeight,
|
|
2410
|
+
letterSpacing: fontSize["5xl"][1].letterSpacing
|
|
2411
|
+
}
|
|
2412
|
+
],
|
|
2413
|
+
"6xl": [
|
|
2414
|
+
fontSize["6xl"][0],
|
|
2415
|
+
{
|
|
2416
|
+
lineHeight: fontSize["6xl"][1].lineHeight,
|
|
2417
|
+
letterSpacing: fontSize["6xl"][1].letterSpacing
|
|
2418
|
+
}
|
|
2419
|
+
],
|
|
2420
|
+
"7xl": [
|
|
2421
|
+
fontSize["7xl"][0],
|
|
2422
|
+
{
|
|
2423
|
+
lineHeight: fontSize["7xl"][1].lineHeight,
|
|
2424
|
+
letterSpacing: fontSize["7xl"][1].letterSpacing
|
|
2425
|
+
}
|
|
2426
|
+
],
|
|
2427
|
+
"8xl": [
|
|
2428
|
+
fontSize["8xl"][0],
|
|
2429
|
+
{
|
|
2430
|
+
lineHeight: fontSize["8xl"][1].lineHeight,
|
|
2431
|
+
letterSpacing: fontSize["8xl"][1].letterSpacing
|
|
2432
|
+
}
|
|
2433
|
+
],
|
|
2434
|
+
"9xl": [
|
|
2435
|
+
fontSize["9xl"][0],
|
|
2436
|
+
{
|
|
2437
|
+
lineHeight: fontSize["9xl"][1].lineHeight,
|
|
2438
|
+
letterSpacing: fontSize["9xl"][1].letterSpacing
|
|
2439
|
+
}
|
|
2440
|
+
]
|
|
2441
|
+
}});
|
|
2442
|
+
|
|
2443
|
+
// src/tokens/state-matrix.ts
|
|
2444
|
+
function getStateVariableName(component, variant, state, property) {
|
|
2445
|
+
const propertyMap = {
|
|
2446
|
+
background: "bg",
|
|
2447
|
+
text: "text",
|
|
2448
|
+
border: "border",
|
|
2449
|
+
outline: "outline",
|
|
2450
|
+
shadow: "shadow"
|
|
2451
|
+
};
|
|
2452
|
+
const propertySuffix = propertyMap[property];
|
|
2453
|
+
return `--${component}-${variant}-${state}-${propertySuffix}`;
|
|
2454
|
+
}
|
|
2455
|
+
function flattenStateMatrix(stateMatrix) {
|
|
2456
|
+
const variables = /* @__PURE__ */ new Map();
|
|
2457
|
+
for (const [componentName, componentStates] of Object.entries(stateMatrix)) {
|
|
2458
|
+
for (const [variantName, variantStates] of Object.entries(componentStates)) {
|
|
2459
|
+
for (const [state, stateProperties] of Object.entries(variantStates)) {
|
|
2460
|
+
if (stateProperties && typeof stateProperties === "object") {
|
|
2461
|
+
for (const [property, value] of Object.entries(stateProperties)) {
|
|
2462
|
+
if (value && typeof value === "string") {
|
|
2463
|
+
const varName = getStateVariableName(
|
|
2464
|
+
componentName,
|
|
2465
|
+
variantName,
|
|
2466
|
+
state,
|
|
2467
|
+
property
|
|
2468
|
+
);
|
|
2469
|
+
variables.set(varName, value);
|
|
2470
|
+
}
|
|
2471
|
+
}
|
|
2472
|
+
}
|
|
2473
|
+
}
|
|
2474
|
+
}
|
|
2475
|
+
}
|
|
2476
|
+
return variables;
|
|
2477
|
+
}
|
|
2478
|
+
|
|
2479
|
+
// src/tokens/states.ts
|
|
2480
|
+
function getButtonStateMatrix(mode, baseColors2, surfaceColors2) {
|
|
2481
|
+
const primaryBase = primaryColors[600];
|
|
2482
|
+
const primaryHover = primaryColors[700];
|
|
2483
|
+
const primaryActive = primaryColors[800];
|
|
2484
|
+
const primaryFocus = primaryColors[600];
|
|
2485
|
+
const primaryDisabledBg = primaryColors[300];
|
|
2486
|
+
const primaryDisabledText = primaryColors[400];
|
|
2487
|
+
const primaryLoading = primaryColors[600];
|
|
2488
|
+
const secondaryHover = secondaryColors[700];
|
|
2489
|
+
const secondaryActive = secondaryColors[800];
|
|
2490
|
+
const secondaryDisabledBg = secondaryColors[300];
|
|
2491
|
+
const secondaryDisabledText = secondaryColors[400];
|
|
2492
|
+
const accentHover = accentColors[700];
|
|
2493
|
+
const accentActive = accentColors[800];
|
|
2494
|
+
const accentDisabledBg = accentColors[300];
|
|
2495
|
+
const accentDisabledText = accentColors[400];
|
|
2496
|
+
const outlineHoverBg = accentColors[600];
|
|
2497
|
+
const outlineHoverText = accentColors[950];
|
|
2498
|
+
const outlineHoverBorder = accentColors[600];
|
|
2499
|
+
const outlineActiveBg = accentColors[700];
|
|
2500
|
+
const outlineActiveText = accentColors[950];
|
|
2501
|
+
const outlineActiveBorder = accentColors[700];
|
|
2502
|
+
const outlineDisabledBg = baseColors2.background;
|
|
2503
|
+
const outlineDisabledText = baseColors2.foreground;
|
|
2504
|
+
const outlineDisabledBorder = baseColors2.border;
|
|
2505
|
+
const ghostHoverBg = surfaceColors2.elevated1;
|
|
2506
|
+
const ghostHoverText = baseColors2.foreground;
|
|
2507
|
+
const ghostActiveBg = surfaceColors2.elevated2;
|
|
2508
|
+
const ghostActiveText = baseColors2.foreground;
|
|
2509
|
+
const ghostDisabledBg = "transparent";
|
|
2510
|
+
const ghostDisabledText = baseColors2.foreground;
|
|
2511
|
+
const destructiveHover = semanticColors[mode].error;
|
|
2512
|
+
const destructiveActive = semanticColors[mode].error;
|
|
2513
|
+
const destructiveDisabledBg = semanticColors[mode].error;
|
|
2514
|
+
const destructiveDisabledText = semanticColors[mode].errorForeground;
|
|
2515
|
+
return {
|
|
2516
|
+
button: {
|
|
2517
|
+
primary: {
|
|
2518
|
+
base: {
|
|
2519
|
+
background: primaryBase
|
|
2520
|
+
},
|
|
2521
|
+
hover: {
|
|
2522
|
+
background: primaryHover
|
|
2523
|
+
},
|
|
2524
|
+
active: {
|
|
2525
|
+
background: primaryActive
|
|
2526
|
+
},
|
|
2527
|
+
focus: {
|
|
2528
|
+
background: primaryFocus
|
|
2529
|
+
},
|
|
2530
|
+
disabled: {
|
|
2531
|
+
background: primaryDisabledBg,
|
|
2532
|
+
text: primaryDisabledText
|
|
2533
|
+
},
|
|
2534
|
+
loading: {
|
|
2535
|
+
background: primaryLoading
|
|
2536
|
+
}
|
|
2537
|
+
},
|
|
2538
|
+
secondary: {
|
|
2539
|
+
hover: {
|
|
2540
|
+
background: secondaryHover
|
|
2541
|
+
},
|
|
2542
|
+
active: {
|
|
2543
|
+
background: secondaryActive
|
|
2544
|
+
},
|
|
2545
|
+
disabled: {
|
|
2546
|
+
background: secondaryDisabledBg,
|
|
2547
|
+
text: secondaryDisabledText
|
|
2548
|
+
}
|
|
2549
|
+
},
|
|
2550
|
+
accent: {
|
|
2551
|
+
hover: {
|
|
2552
|
+
background: accentHover
|
|
2553
|
+
},
|
|
2554
|
+
active: {
|
|
2555
|
+
background: accentActive
|
|
2556
|
+
},
|
|
2557
|
+
disabled: {
|
|
2558
|
+
background: accentDisabledBg,
|
|
2559
|
+
text: accentDisabledText
|
|
2560
|
+
}
|
|
2561
|
+
},
|
|
2562
|
+
outline: {
|
|
2563
|
+
hover: {
|
|
2564
|
+
background: outlineHoverBg,
|
|
2565
|
+
text: outlineHoverText,
|
|
2566
|
+
border: outlineHoverBorder
|
|
2567
|
+
},
|
|
2568
|
+
active: {
|
|
2569
|
+
background: outlineActiveBg,
|
|
2570
|
+
text: outlineActiveText,
|
|
2571
|
+
border: outlineActiveBorder
|
|
2572
|
+
},
|
|
2573
|
+
disabled: {
|
|
2574
|
+
background: outlineDisabledBg,
|
|
2575
|
+
text: outlineDisabledText,
|
|
2576
|
+
border: outlineDisabledBorder
|
|
2577
|
+
}
|
|
2578
|
+
},
|
|
2579
|
+
ghost: {
|
|
2580
|
+
hover: {
|
|
2581
|
+
background: ghostHoverBg,
|
|
2582
|
+
text: ghostHoverText
|
|
2583
|
+
},
|
|
2584
|
+
active: {
|
|
2585
|
+
background: ghostActiveBg,
|
|
2586
|
+
text: ghostActiveText
|
|
2587
|
+
},
|
|
2588
|
+
disabled: {
|
|
2589
|
+
background: ghostDisabledBg,
|
|
2590
|
+
text: ghostDisabledText
|
|
2591
|
+
}
|
|
2592
|
+
},
|
|
2593
|
+
destructive: {
|
|
2594
|
+
hover: {
|
|
2595
|
+
background: destructiveHover
|
|
2596
|
+
},
|
|
2597
|
+
active: {
|
|
2598
|
+
background: destructiveActive
|
|
2599
|
+
},
|
|
2600
|
+
disabled: {
|
|
2601
|
+
background: destructiveDisabledBg,
|
|
2602
|
+
text: destructiveDisabledText
|
|
2603
|
+
}
|
|
2604
|
+
}
|
|
2605
|
+
}
|
|
2606
|
+
};
|
|
2607
|
+
}
|
|
2608
|
+
|
|
2609
|
+
// src/theme/applyStateMatrix.ts
|
|
2610
|
+
function getMergedBaseTokens(_mode) {
|
|
2611
|
+
return {
|
|
2612
|
+
baseColors,
|
|
2613
|
+
surfaceColors
|
|
2614
|
+
};
|
|
2615
|
+
}
|
|
2616
|
+
function getAllStateMatrices(mode) {
|
|
2617
|
+
const { baseColors: baseColors2, surfaceColors: surfaceColors2 } = getMergedBaseTokens();
|
|
2618
|
+
const buttonMatrix = getButtonStateMatrix(mode, baseColors2[mode], surfaceColors2[mode]);
|
|
2619
|
+
return {
|
|
2620
|
+
...buttonMatrix
|
|
2621
|
+
// Add other component matrices here as they are implemented
|
|
2622
|
+
// input: getInputStateMatrix(mode, baseColors[mode], surfaceColors[mode]),
|
|
2623
|
+
// select: getSelectStateMatrix(mode, baseColors[mode], surfaceColors[mode]),
|
|
2624
|
+
};
|
|
2625
|
+
}
|
|
2626
|
+
function updateStateMatrixFromTokens(mode) {
|
|
2627
|
+
if (typeof document === "undefined" || !document.documentElement) return;
|
|
2628
|
+
const root = document.documentElement;
|
|
2629
|
+
let stateMatrix;
|
|
2630
|
+
try {
|
|
2631
|
+
stateMatrix = getAllStateMatrices(mode);
|
|
2632
|
+
} catch (error) {
|
|
2633
|
+
console.error("[State Matrix] Failed to get state matrices:", error);
|
|
2634
|
+
return;
|
|
2635
|
+
}
|
|
2636
|
+
let variables;
|
|
2637
|
+
try {
|
|
2638
|
+
variables = flattenStateMatrix(stateMatrix);
|
|
2639
|
+
} catch (error) {
|
|
2640
|
+
console.error("[State Matrix] Failed to flatten state matrix:", error);
|
|
2641
|
+
return;
|
|
2642
|
+
}
|
|
2643
|
+
const hoverVars = {};
|
|
2644
|
+
variables.forEach((value, varName) => {
|
|
2645
|
+
try {
|
|
2646
|
+
root.style.setProperty(varName, value);
|
|
2647
|
+
if (varName.includes("hover") || varName.includes("active") || varName.includes("disabled")) {
|
|
2648
|
+
hoverVars[varName] = value;
|
|
2649
|
+
}
|
|
2650
|
+
} catch (error) {
|
|
2651
|
+
console.error(`[State Matrix] Failed to set variable ${varName}:`, error);
|
|
2652
|
+
}
|
|
2653
|
+
});
|
|
2654
|
+
if (typeof window !== "undefined") {
|
|
2655
|
+
const primaryHoverVar = root.style.getPropertyValue("--button-primary-hover-bg");
|
|
2656
|
+
const primaryHoverComputed = typeof getComputedStyle !== "undefined" ? getComputedStyle(root).getPropertyValue("--button-primary-hover-bg") : "N/A";
|
|
2657
|
+
fetch("http://127.0.0.1:7243/ingest/ff5d1e20-0815-4ca0-af82-fcbd3cfa35b1", {
|
|
2658
|
+
method: "POST",
|
|
2659
|
+
headers: { "Content-Type": "application/json" },
|
|
2660
|
+
body: JSON.stringify({
|
|
2661
|
+
location: "applyStateMatrix.ts:103",
|
|
2662
|
+
message: "State variables set check",
|
|
2663
|
+
data: {
|
|
2664
|
+
totalVars: variables.size,
|
|
2665
|
+
hoverVarsCount: Object.keys(hoverVars).length,
|
|
2666
|
+
primaryHoverVar,
|
|
2667
|
+
primaryHoverComputed,
|
|
2668
|
+
sampleHoverVars: Object.fromEntries(Object.entries(hoverVars).slice(0, 5))
|
|
2669
|
+
},
|
|
2670
|
+
timestamp: Date.now(),
|
|
2671
|
+
sessionId: "debug-session",
|
|
2672
|
+
runId: "run1",
|
|
2673
|
+
hypothesisId: "B"
|
|
2674
|
+
})
|
|
2675
|
+
}).catch(() => {
|
|
2676
|
+
});
|
|
2677
|
+
}
|
|
2678
|
+
}
|
|
2679
|
+
|
|
1691
2680
|
// src/theme/applyMode.ts
|
|
1692
2681
|
var MODE_ATTRIBUTE = "data-mode";
|
|
1693
2682
|
var THEME_ATTRIBUTE = "data-theme-name";
|
|
@@ -1781,9 +2770,30 @@ function getMergedTokens(_mode) {
|
|
|
1781
2770
|
};
|
|
1782
2771
|
}
|
|
1783
2772
|
function updateCSSVariablesFromTokens(mode) {
|
|
1784
|
-
if (typeof document === "undefined") return;
|
|
2773
|
+
if (typeof document === "undefined" || !document.documentElement) return;
|
|
1785
2774
|
const root = document.documentElement;
|
|
1786
|
-
|
|
2775
|
+
let tokens;
|
|
2776
|
+
try {
|
|
2777
|
+
tokens = getMergedTokens(mode);
|
|
2778
|
+
} catch (error) {
|
|
2779
|
+
console.error("[Theme] Failed to get merged tokens:", error);
|
|
2780
|
+
return;
|
|
2781
|
+
}
|
|
2782
|
+
const secondary800 = tokens.secondaryColors[800];
|
|
2783
|
+
fetch("http://127.0.0.1:7243/ingest/ff5d1e20-0815-4ca0-af82-fcbd3cfa35b1", {
|
|
2784
|
+
method: "POST",
|
|
2785
|
+
headers: { "Content-Type": "application/json" },
|
|
2786
|
+
body: JSON.stringify({
|
|
2787
|
+
location: "applyMode.ts:188",
|
|
2788
|
+
message: "tokens retrieved",
|
|
2789
|
+
data: { hasTokens: !!tokens, secondary800, hasSecondary800: !!secondary800 },
|
|
2790
|
+
timestamp: Date.now(),
|
|
2791
|
+
sessionId: "debug-session",
|
|
2792
|
+
runId: "run1",
|
|
2793
|
+
hypothesisId: "B"
|
|
2794
|
+
})
|
|
2795
|
+
}).catch(() => {
|
|
2796
|
+
});
|
|
1787
2797
|
const {
|
|
1788
2798
|
primaryColors: primaryColors2,
|
|
1789
2799
|
accentColors: accentColors2,
|
|
@@ -1794,99 +2804,192 @@ function updateCSSVariablesFromTokens(mode) {
|
|
|
1794
2804
|
textColors: textColors2,
|
|
1795
2805
|
chartColors: chartColors2
|
|
1796
2806
|
} = tokens;
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
root.style.setProperty("--
|
|
1872
|
-
root.style.setProperty("--
|
|
1873
|
-
root.style.setProperty("--
|
|
1874
|
-
root.style.setProperty("--
|
|
1875
|
-
|
|
1876
|
-
root.style.setProperty("--
|
|
1877
|
-
root.style.setProperty("--
|
|
1878
|
-
root.style.setProperty("--
|
|
1879
|
-
root.style.setProperty("--
|
|
1880
|
-
root.style.setProperty("--
|
|
1881
|
-
root.style.setProperty("--
|
|
1882
|
-
}
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
root.style.setProperty(
|
|
1889
|
-
|
|
2807
|
+
try {
|
|
2808
|
+
const base = baseColors2[mode];
|
|
2809
|
+
root.style.setProperty("--background", base.background);
|
|
2810
|
+
root.style.setProperty("--foreground", base.foreground);
|
|
2811
|
+
root.style.setProperty("--card", base.card);
|
|
2812
|
+
root.style.setProperty("--card-foreground", base.cardForeground);
|
|
2813
|
+
root.style.setProperty("--popover", base.popover);
|
|
2814
|
+
root.style.setProperty("--popover-foreground", base.popoverForeground);
|
|
2815
|
+
root.style.setProperty("--border", base.border);
|
|
2816
|
+
root.style.setProperty("--input", base.input);
|
|
2817
|
+
root.style.setProperty("--ring", base.ring);
|
|
2818
|
+
} catch (error) {
|
|
2819
|
+
console.error("[Theme] Failed to set base colors:", error);
|
|
2820
|
+
}
|
|
2821
|
+
try {
|
|
2822
|
+
const surface = surfaceColors2[mode];
|
|
2823
|
+
root.style.setProperty("--surface-base", surface.base);
|
|
2824
|
+
root.style.setProperty("--surface-elevated1", surface.elevated1);
|
|
2825
|
+
root.style.setProperty("--surface-elevated2", surface.elevated2);
|
|
2826
|
+
root.style.setProperty("--surface-elevated3", surface.elevated3);
|
|
2827
|
+
root.style.setProperty("--surface-overlay", surface.overlay);
|
|
2828
|
+
root.style.setProperty("--surface-glass", surface.glass);
|
|
2829
|
+
} catch (error) {
|
|
2830
|
+
console.error("[Theme] Failed to set surface colors:", error);
|
|
2831
|
+
}
|
|
2832
|
+
try {
|
|
2833
|
+
const semantic = semanticColors2[mode];
|
|
2834
|
+
root.style.setProperty("--semantic-success", semantic.success);
|
|
2835
|
+
root.style.setProperty("--semantic-success-foreground", semantic.successForeground);
|
|
2836
|
+
root.style.setProperty("--semantic-error", semantic.error);
|
|
2837
|
+
root.style.setProperty("--semantic-error-foreground", semantic.errorForeground);
|
|
2838
|
+
root.style.setProperty("--semantic-warning", semantic.warning);
|
|
2839
|
+
root.style.setProperty("--semantic-warning-foreground", semantic.warningForeground);
|
|
2840
|
+
root.style.setProperty("--semantic-info", semantic.info);
|
|
2841
|
+
root.style.setProperty("--semantic-info-foreground", semantic.infoForeground);
|
|
2842
|
+
} catch (error) {
|
|
2843
|
+
console.error("[Theme] Failed to set semantic colors:", error);
|
|
2844
|
+
}
|
|
2845
|
+
try {
|
|
2846
|
+
const text = textColors2[mode];
|
|
2847
|
+
root.style.setProperty("--text-primary", text.primary);
|
|
2848
|
+
root.style.setProperty("--text-secondary", text.secondary);
|
|
2849
|
+
root.style.setProperty("--text-tertiary", text.tertiary);
|
|
2850
|
+
root.style.setProperty("--text-muted", text.muted);
|
|
2851
|
+
root.style.setProperty("--text-inverse", text.inverse);
|
|
2852
|
+
} catch (error) {
|
|
2853
|
+
console.error("[Theme] Failed to set text colors:", error);
|
|
2854
|
+
}
|
|
2855
|
+
try {
|
|
2856
|
+
const chart = chartColors2[mode];
|
|
2857
|
+
root.style.setProperty("--chart-1", chart.chart1);
|
|
2858
|
+
root.style.setProperty("--chart-2", chart.chart2);
|
|
2859
|
+
root.style.setProperty("--chart-3", chart.chart3);
|
|
2860
|
+
root.style.setProperty("--chart-4", chart.chart4);
|
|
2861
|
+
root.style.setProperty("--chart-5", chart.chart5);
|
|
2862
|
+
} catch (error) {
|
|
2863
|
+
console.error("[Theme] Failed to set chart colors:", error);
|
|
2864
|
+
}
|
|
2865
|
+
try {
|
|
2866
|
+
root.style.setProperty("--primary-50", primaryColors2[50]);
|
|
2867
|
+
root.style.setProperty("--primary-100", primaryColors2[100]);
|
|
2868
|
+
root.style.setProperty("--primary-200", primaryColors2[200]);
|
|
2869
|
+
root.style.setProperty("--primary-300", primaryColors2[300]);
|
|
2870
|
+
root.style.setProperty("--primary-400", primaryColors2[400]);
|
|
2871
|
+
root.style.setProperty("--primary-500", primaryColors2[500]);
|
|
2872
|
+
root.style.setProperty("--primary-600", primaryColors2[600]);
|
|
2873
|
+
root.style.setProperty("--primary-700", primaryColors2[700]);
|
|
2874
|
+
root.style.setProperty("--primary-800", primaryColors2[800]);
|
|
2875
|
+
root.style.setProperty("--primary-900", primaryColors2[900]);
|
|
2876
|
+
root.style.setProperty("--primary-950", primaryColors2[950]);
|
|
2877
|
+
} catch (error) {
|
|
2878
|
+
console.error("[Theme] Failed to set primary color scale:", error);
|
|
2879
|
+
}
|
|
2880
|
+
try {
|
|
2881
|
+
root.style.setProperty("--accent-50", accentColors2[50]);
|
|
2882
|
+
root.style.setProperty("--accent-100", accentColors2[100]);
|
|
2883
|
+
root.style.setProperty("--accent-200", accentColors2[200]);
|
|
2884
|
+
root.style.setProperty("--accent-300", accentColors2[300]);
|
|
2885
|
+
root.style.setProperty("--accent-400", accentColors2[400]);
|
|
2886
|
+
root.style.setProperty("--accent-500", accentColors2[500]);
|
|
2887
|
+
root.style.setProperty("--accent-600", accentColors2[600]);
|
|
2888
|
+
root.style.setProperty("--accent-700", accentColors2[700]);
|
|
2889
|
+
root.style.setProperty("--accent-800", accentColors2[800]);
|
|
2890
|
+
root.style.setProperty("--accent-900", accentColors2[900]);
|
|
2891
|
+
root.style.setProperty("--accent-950", accentColors2[950]);
|
|
2892
|
+
} catch (error) {
|
|
2893
|
+
console.error("[Theme] Failed to set accent color scale:", error);
|
|
2894
|
+
}
|
|
2895
|
+
try {
|
|
2896
|
+
root.style.setProperty("--secondary-50", secondaryColors2[50]);
|
|
2897
|
+
root.style.setProperty("--secondary-100", secondaryColors2[100]);
|
|
2898
|
+
root.style.setProperty("--secondary-200", secondaryColors2[200]);
|
|
2899
|
+
root.style.setProperty("--secondary-300", secondaryColors2[300]);
|
|
2900
|
+
root.style.setProperty("--secondary-400", secondaryColors2[400]);
|
|
2901
|
+
root.style.setProperty("--secondary-500", secondaryColors2[500]);
|
|
2902
|
+
root.style.setProperty("--secondary-600", secondaryColors2[600]);
|
|
2903
|
+
root.style.setProperty("--secondary-700", secondaryColors2[700]);
|
|
2904
|
+
root.style.setProperty("--secondary-800", secondaryColors2[800]);
|
|
2905
|
+
root.style.setProperty("--secondary-900", secondaryColors2[900]);
|
|
2906
|
+
root.style.setProperty("--secondary-950", secondaryColors2[950]);
|
|
2907
|
+
} catch (error) {
|
|
2908
|
+
console.error("[Theme] Failed to set secondary color scale:", error);
|
|
2909
|
+
}
|
|
2910
|
+
try {
|
|
2911
|
+
if (mode === "day") {
|
|
2912
|
+
root.style.setProperty("--tm-primary", secondaryColors2[800]);
|
|
2913
|
+
root.style.setProperty("--tm-primary-foreground", "0 0% 100%");
|
|
2914
|
+
root.style.setProperty("--tm-secondary", secondaryColors2[600]);
|
|
2915
|
+
root.style.setProperty("--tm-secondary-foreground", "0 0% 100%");
|
|
2916
|
+
root.style.setProperty("--tm-accent", accentColors2[600]);
|
|
2917
|
+
root.style.setProperty("--tm-accent-foreground", "0 0% 100%");
|
|
2918
|
+
} else {
|
|
2919
|
+
root.style.setProperty("--tm-primary", accentColors2[600]);
|
|
2920
|
+
root.style.setProperty("--tm-primary-foreground", "0 0% 100%");
|
|
2921
|
+
root.style.setProperty("--tm-secondary", "240 10% 7%");
|
|
2922
|
+
root.style.setProperty("--tm-secondary-foreground", "0 0% 89.8%");
|
|
2923
|
+
root.style.setProperty("--tm-accent", "240 10% 10%");
|
|
2924
|
+
root.style.setProperty("--tm-accent-foreground", "0 0% 89.8%");
|
|
2925
|
+
}
|
|
2926
|
+
} catch (error) {
|
|
2927
|
+
console.error("[Theme] Failed to set Tenerife brand colors:", error);
|
|
2928
|
+
}
|
|
2929
|
+
try {
|
|
2930
|
+
const base = baseColors2[mode];
|
|
2931
|
+
root.style.setProperty("--muted", base.card);
|
|
2932
|
+
root.style.setProperty("--muted-foreground", base.cardForeground);
|
|
2933
|
+
} catch (error) {
|
|
2934
|
+
console.error("[Theme] Failed to set muted colors:", error);
|
|
2935
|
+
}
|
|
2936
|
+
try {
|
|
2937
|
+
const accentValue = mode === "day" ? accentColors2[600] : "240 10% 10%";
|
|
2938
|
+
const accentForegroundValue = mode === "day" ? "0 0% 100%" : "0 0% 89.8%";
|
|
2939
|
+
root.style.setProperty("--accent", accentValue);
|
|
2940
|
+
root.style.setProperty("--accent-foreground", accentForegroundValue);
|
|
2941
|
+
} catch (error) {
|
|
2942
|
+
console.error("[Theme] Failed to set accent aliases:", error);
|
|
2943
|
+
}
|
|
2944
|
+
try {
|
|
2945
|
+
const semantic = semanticColors2[mode];
|
|
2946
|
+
root.style.setProperty("--destructive", semantic.error);
|
|
2947
|
+
root.style.setProperty("--destructive-foreground", semantic.errorForeground);
|
|
2948
|
+
} catch (error) {
|
|
2949
|
+
console.error("[Theme] Failed to set destructive colors:", error);
|
|
2950
|
+
}
|
|
2951
|
+
try {
|
|
2952
|
+
Object.entries(motionCSSVariables).forEach(([key, value]) => {
|
|
2953
|
+
root.style.setProperty(key, value);
|
|
2954
|
+
});
|
|
2955
|
+
} catch (error) {
|
|
2956
|
+
console.error("[Theme] Failed to set motion CSS variables:", error);
|
|
2957
|
+
}
|
|
2958
|
+
try {
|
|
2959
|
+
Object.entries(motionV2CSSVariables).forEach(([key, value]) => {
|
|
2960
|
+
root.style.setProperty(key, value);
|
|
2961
|
+
});
|
|
2962
|
+
} catch (error) {
|
|
2963
|
+
console.error("[Theme] Failed to set motion V2 CSS variables:", error);
|
|
2964
|
+
}
|
|
2965
|
+
try {
|
|
2966
|
+
Object.entries(radiusCSSVariables).forEach(([key, value]) => {
|
|
2967
|
+
root.style.setProperty(key, value);
|
|
2968
|
+
});
|
|
2969
|
+
} catch (error) {
|
|
2970
|
+
console.error("[Theme] Failed to set radius CSS variables:", error);
|
|
2971
|
+
}
|
|
2972
|
+
try {
|
|
2973
|
+
Object.entries(shadowCSSVariables).forEach(([key, value]) => {
|
|
2974
|
+
root.style.setProperty(key, value);
|
|
2975
|
+
});
|
|
2976
|
+
} catch (error) {
|
|
2977
|
+
console.error("[Theme] Failed to set shadow CSS variables:", error);
|
|
2978
|
+
}
|
|
2979
|
+
try {
|
|
2980
|
+
Object.entries(spacingCSSVariables).forEach(([key, value]) => {
|
|
2981
|
+
root.style.setProperty(key, value);
|
|
2982
|
+
});
|
|
2983
|
+
} catch (error) {
|
|
2984
|
+
console.error("[Theme] Failed to set spacing CSS variables:", error);
|
|
2985
|
+
}
|
|
2986
|
+
try {
|
|
2987
|
+
Object.entries(typographyCSSVariables).forEach(([key, value]) => {
|
|
2988
|
+
root.style.setProperty(key, value);
|
|
2989
|
+
});
|
|
2990
|
+
} catch (error) {
|
|
2991
|
+
console.error("[Theme] Failed to set typography CSS variables:", error);
|
|
2992
|
+
}
|
|
1890
2993
|
}
|
|
1891
2994
|
async function applyDocumentTheme(mode, themeName = "default", brandId = null) {
|
|
1892
2995
|
if (typeof document === "undefined") return;
|
|
@@ -1913,6 +3016,7 @@ async function applyDocumentTheme(mode, themeName = "default", brandId = null) {
|
|
|
1913
3016
|
root.classList.remove(DARK_CLASS);
|
|
1914
3017
|
}
|
|
1915
3018
|
updateCSSVariablesFromTokens(mode);
|
|
3019
|
+
updateStateMatrixFromTokens(mode);
|
|
1916
3020
|
const tokens = getMergedTokens();
|
|
1917
3021
|
const { background, foreground } = tokens.baseColors[mode];
|
|
1918
3022
|
if (body) {
|
|
@@ -2238,7 +3342,7 @@ async function canLoadTheme(themeId) {
|
|
|
2238
3342
|
}
|
|
2239
3343
|
|
|
2240
3344
|
// src/theme/spacing.ts
|
|
2241
|
-
var
|
|
3345
|
+
var spacing2 = {
|
|
2242
3346
|
none: "0",
|
|
2243
3347
|
xs: "0.25rem",
|
|
2244
3348
|
// 4px
|
|
@@ -2259,7 +3363,7 @@ var spacing = {
|
|
|
2259
3363
|
"5xl": "5rem"
|
|
2260
3364
|
// 80px
|
|
2261
3365
|
};
|
|
2262
|
-
var
|
|
3366
|
+
var borderRadius2 = {
|
|
2263
3367
|
none: "0px",
|
|
2264
3368
|
sm: "0.125rem",
|
|
2265
3369
|
// 2px
|
|
@@ -2442,6 +3546,23 @@ function ThemeProvider({
|
|
|
2442
3546
|
}
|
|
2443
3547
|
}, [reduceMotionOverride, enableAnimationsOverride]);
|
|
2444
3548
|
React__default.default.useEffect(() => {
|
|
3549
|
+
if (typeof document !== "undefined" && document.documentElement) {
|
|
3550
|
+
const beforeApply = document.documentElement.style.getPropertyValue("--tm-primary");
|
|
3551
|
+
fetch("http://127.0.0.1:7243/ingest/ff5d1e20-0815-4ca0-af82-fcbd3cfa35b1", {
|
|
3552
|
+
method: "POST",
|
|
3553
|
+
headers: { "Content-Type": "application/json" },
|
|
3554
|
+
body: JSON.stringify({
|
|
3555
|
+
location: "ThemeProvider.tsx:281",
|
|
3556
|
+
message: "ThemeProvider useEffect before applyDocumentTheme",
|
|
3557
|
+
data: { beforeValue: beforeApply, hasValue: !!beforeApply },
|
|
3558
|
+
timestamp: Date.now(),
|
|
3559
|
+
sessionId: "debug-session",
|
|
3560
|
+
runId: "run1",
|
|
3561
|
+
hypothesisId: "C"
|
|
3562
|
+
})
|
|
3563
|
+
}).catch(() => {
|
|
3564
|
+
});
|
|
3565
|
+
}
|
|
2445
3566
|
const initialMode = getInitialMode(defaultMode, storageKey, enableSystem);
|
|
2446
3567
|
const initialTheme = getInitialTheme(defaultTheme2, themeStorageKey);
|
|
2447
3568
|
const initialBrand = getInitialBrand(defaultBrand, brandStorageKey);
|
|
@@ -2449,6 +3570,25 @@ function ThemeProvider({
|
|
|
2449
3570
|
setThemeState(initialTheme);
|
|
2450
3571
|
setBrandState(initialBrand);
|
|
2451
3572
|
applyDocumentTheme(initialMode, initialTheme, initialBrand);
|
|
3573
|
+
if (typeof document !== "undefined" && document.documentElement) {
|
|
3574
|
+
setTimeout(() => {
|
|
3575
|
+
const afterApply = document.documentElement.style.getPropertyValue("--tm-primary");
|
|
3576
|
+
fetch("http://127.0.0.1:7243/ingest/ff5d1e20-0815-4ca0-af82-fcbd3cfa35b1", {
|
|
3577
|
+
method: "POST",
|
|
3578
|
+
headers: { "Content-Type": "application/json" },
|
|
3579
|
+
body: JSON.stringify({
|
|
3580
|
+
location: "ThemeProvider.tsx:289",
|
|
3581
|
+
message: "ThemeProvider useEffect after applyDocumentTheme",
|
|
3582
|
+
data: { afterValue: afterApply, hasValue: !!afterApply },
|
|
3583
|
+
timestamp: Date.now(),
|
|
3584
|
+
sessionId: "debug-session",
|
|
3585
|
+
runId: "run1",
|
|
3586
|
+
hypothesisId: "C"
|
|
3587
|
+
})
|
|
3588
|
+
}).catch(() => {
|
|
3589
|
+
});
|
|
3590
|
+
}, 100);
|
|
3591
|
+
}
|
|
2452
3592
|
persistMode(initialMode, storageKey);
|
|
2453
3593
|
persistTheme(initialTheme, themeStorageKey);
|
|
2454
3594
|
persistBrand(initialBrand, brandStorageKey);
|
|
@@ -2477,7 +3617,45 @@ function ThemeProvider({
|
|
|
2477
3617
|
return () => mediaQuery.removeEventListener("change", handleChange);
|
|
2478
3618
|
}, [enableSystem, storageKey, setMode]);
|
|
2479
3619
|
React__default.default.useEffect(() => {
|
|
3620
|
+
if (typeof document !== "undefined" && document.documentElement) {
|
|
3621
|
+
const beforeChange = document.documentElement.style.getPropertyValue("--tm-primary");
|
|
3622
|
+
fetch("http://127.0.0.1:7243/ingest/ff5d1e20-0815-4ca0-af82-fcbd3cfa35b1", {
|
|
3623
|
+
method: "POST",
|
|
3624
|
+
headers: { "Content-Type": "application/json" },
|
|
3625
|
+
body: JSON.stringify({
|
|
3626
|
+
location: "ThemeProvider.tsx:325",
|
|
3627
|
+
message: "ThemeProvider useEffect mode/theme/brand change",
|
|
3628
|
+
data: { mode, theme, brand, beforeValue: beforeChange, hasValue: !!beforeChange },
|
|
3629
|
+
timestamp: Date.now(),
|
|
3630
|
+
sessionId: "debug-session",
|
|
3631
|
+
runId: "run1",
|
|
3632
|
+
hypothesisId: "C"
|
|
3633
|
+
})
|
|
3634
|
+
}).catch(() => {
|
|
3635
|
+
});
|
|
3636
|
+
}
|
|
2480
3637
|
applyDocumentTheme(mode, theme, brand);
|
|
3638
|
+
if (typeof document !== "undefined" && document.documentElement) {
|
|
3639
|
+
setTimeout(() => {
|
|
3640
|
+
if (typeof document !== "undefined" && document.documentElement) {
|
|
3641
|
+
const afterChange = document.documentElement.style.getPropertyValue("--tm-primary");
|
|
3642
|
+
fetch("http://127.0.0.1:7243/ingest/ff5d1e20-0815-4ca0-af82-fcbd3cfa35b1", {
|
|
3643
|
+
method: "POST",
|
|
3644
|
+
headers: { "Content-Type": "application/json" },
|
|
3645
|
+
body: JSON.stringify({
|
|
3646
|
+
location: "ThemeProvider.tsx:327",
|
|
3647
|
+
message: "ThemeProvider useEffect after applyDocumentTheme change",
|
|
3648
|
+
data: { afterValue: afterChange, hasValue: !!afterChange },
|
|
3649
|
+
timestamp: Date.now(),
|
|
3650
|
+
sessionId: "debug-session",
|
|
3651
|
+
runId: "run1",
|
|
3652
|
+
hypothesisId: "C"
|
|
3653
|
+
})
|
|
3654
|
+
}).catch(() => {
|
|
3655
|
+
});
|
|
3656
|
+
}
|
|
3657
|
+
}, 100);
|
|
3658
|
+
}
|
|
2481
3659
|
}, [mode, theme, brand]);
|
|
2482
3660
|
const value = React__default.default.useMemo(
|
|
2483
3661
|
() => ({
|
|
@@ -2600,7 +3778,7 @@ var letterSpacings = {
|
|
|
2600
3778
|
};
|
|
2601
3779
|
|
|
2602
3780
|
exports.ThemeProvider = ThemeProvider;
|
|
2603
|
-
exports.borderRadius =
|
|
3781
|
+
exports.borderRadius = borderRadius2;
|
|
2604
3782
|
exports.canLoadTheme = canLoadTheme;
|
|
2605
3783
|
exports.createMinimalThemeSchema = createMinimalThemeSchema;
|
|
2606
3784
|
exports.cssVariableColorTokens = cssVariableColorTokens;
|
|
@@ -2626,7 +3804,7 @@ exports.persistTheme = persistTheme;
|
|
|
2626
3804
|
exports.preloadThemes = preloadThemes;
|
|
2627
3805
|
exports.registerTheme = registerTheme;
|
|
2628
3806
|
exports.shadows = shadows;
|
|
2629
|
-
exports.spacing =
|
|
3807
|
+
exports.spacing = spacing2;
|
|
2630
3808
|
exports.tailwindThemeColors = tailwindThemeColors;
|
|
2631
3809
|
exports.themeExists = themeExists;
|
|
2632
3810
|
exports.themeRegistry = themeRegistry;
|