@nebutra/ui 0.2.3 → 2.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/dist/animate-in-BlvjVh2S.d.ts +250 -0
- package/dist/{canonical-Drca5UMj.d.ts → canonical-Bf4czR2u.d.ts} +13 -250
- package/dist/chat/index.d.ts +1 -0
- package/dist/chat/index.js +3 -0
- package/dist/chat/index.js.map +1 -0
- package/dist/components/index.d.ts +58 -123
- package/dist/components/index.js +219 -104
- package/dist/components/index.js.map +1 -1
- package/dist/editorial/index.d.ts +404 -0
- package/dist/editorial/index.js +868 -0
- package/dist/editorial/index.js.map +1 -0
- package/dist/icons/index.d.ts +1 -0
- package/dist/layout/index.js +6 -5
- package/dist/layout/index.js.map +1 -1
- package/dist/layouts/index.js +4 -13
- package/dist/layouts/index.js.map +1 -1
- package/dist/patterns/index.d.ts +1 -2
- package/dist/patterns/index.js +74 -55
- package/dist/patterns/index.js.map +1 -1
- package/dist/primitives/canonical.d.ts +3 -2
- package/dist/primitives/canonical.js +118 -72
- package/dist/primitives/canonical.js.map +1 -1
- package/dist/primitives/index.d.ts +78 -4
- package/dist/primitives/index.js +777 -453
- package/dist/primitives/index.js.map +1 -1
- package/dist/tailwind.preset.d.ts +2 -2
- package/dist/tailwind.preset.js +1 -1
- package/dist/tailwind.preset.js.map +1 -1
- package/dist/typography/fonts.css +2 -2
- package/dist/typography/index.d.ts +4 -4
- package/dist/typography/index.js +1 -1
- package/dist/typography/index.js.map +1 -1
- package/dist/utils/auth-surfaces.d.ts +33 -0
- package/dist/utils/auth-surfaces.js +9 -0
- package/dist/utils/auth-surfaces.js.map +1 -0
- package/dist/utils/index.d.ts +2 -4
- package/dist/utils/index.js +6 -3
- package/dist/utils/index.js.map +1 -1
- package/package.json +25 -7
- package/src/typography/fonts.css +2 -2
|
@@ -96,7 +96,7 @@ declare const nebutraShadows: {
|
|
|
96
96
|
declare const nebutraTypography: {
|
|
97
97
|
readonly fontFamily: {
|
|
98
98
|
readonly sans: string;
|
|
99
|
-
readonly cn: "\"Noto Sans SC\", \"PingFang SC\", \"Microsoft YaHei\",
|
|
99
|
+
readonly cn: "\"Noto Sans SC\", \"PingFang SC\", \"Microsoft YaHei\", sans-serif";
|
|
100
100
|
readonly display: string;
|
|
101
101
|
readonly mono: string;
|
|
102
102
|
};
|
|
@@ -210,7 +210,7 @@ declare const nebutraPreset: {
|
|
|
210
210
|
};
|
|
211
211
|
readonly fontFamily: {
|
|
212
212
|
readonly sans: string;
|
|
213
|
-
readonly cn: "\"Noto Sans SC\", \"PingFang SC\", \"Microsoft YaHei\",
|
|
213
|
+
readonly cn: "\"Noto Sans SC\", \"PingFang SC\", \"Microsoft YaHei\", sans-serif";
|
|
214
214
|
readonly display: string;
|
|
215
215
|
readonly mono: string;
|
|
216
216
|
};
|
package/dist/tailwind.preset.js
CHANGED
|
@@ -89,7 +89,7 @@ var primitiveFontFamily = {
|
|
|
89
89
|
/** Default body/UI stack — Geist with CJK auto-fallbacks */
|
|
90
90
|
sans: '"Geist", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, system-ui, sans-serif',
|
|
91
91
|
/** Chinese body/UI stack */
|
|
92
|
-
cnSans: '"Noto Sans SC", "PingFang SC", "Microsoft YaHei",
|
|
92
|
+
cnSans: '"Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif',
|
|
93
93
|
/** Display / hero headlines */
|
|
94
94
|
display: '"Geist", "Noto Sans SC", sans-serif',
|
|
95
95
|
/** Code / monospace — Geist Mono pairs with Geist for full family coverage */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/tokens/primitive.ts","../src/tailwind.preset.ts"],"names":[],"mappings":";;;AAeO,IAAM,eAAA,GAAkB;AAAA;AAAA,EAE7B,MAAA,EAAQ,MAAA,CAAO,OAAA,CAAQ,EAAE,CAAA;AAAA,EACzB,OAAA,EAAS,MAAA,CAAO,OAAA,CAAQ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cAAA;AAAA,EACT,YAAA,EAAc,mBAAA;AAAA,EACd,SAAA,EAAW,cAAA;AAAA,EACX,YAAY,iBAAA,CAAkB,UAAA;AAAA,EAC9B,UAAU,iBAAA,CAAkB,QAAA;AAAA,EAC5B,YAAY,iBAAA,CAAkB,UAAA;AAAA,EAC9B,SAAA,EAAW;AACb;AAIA,IAAO,uBAAA,GAAQ","file":"tailwind.preset.js","sourcesContent":["/**\n * Primitive Design Tokens — Layer 1\n *\n * Raw values only. No CSS variable references, no semantic meaning.\n * These are the \"atoms\" of the design system.\n *\n * Color source: @nebutra/brand `colors` → @nebutra/design-tokens `tokens/core.json` (SSOT).\n * Typography: Geist + Geist Mono (Vercel) with Noto Sans SC + PingFang SC + Microsoft YaHei CJK fallbacks.\n * Aligned with @nebutra/design-tokens SSOT.\n */\n\nimport { colors } from \"@nebutra/brand\";\n\n// ─── Color Palette ────────────────────────────────────────────────────────────\n\nexport const primitiveColors = {\n // Nebutra Blue (云毓蓝) — technology & trust — VI: #0033FE\n blue50: colors.primary[50],\n blue100: colors.primary[100],\n blue200: colors.primary[200],\n blue300: colors.primary[300],\n blue400: colors.primary[400],\n blue500: colors.primary[500], // brand primary\n blue600: colors.primary[600],\n blue700: colors.primary[700],\n blue800: colors.primary[800],\n blue900: colors.primary[900],\n blue950: colors.primary[950],\n\n // Nebutra Cyan (云毓青) — data flow & intelligence — VI: #0BF1C3\n cyan50: colors.accent[50],\n cyan100: colors.accent[100],\n cyan200: colors.accent[200],\n cyan300: colors.accent[300],\n cyan400: colors.accent[400],\n cyan500: colors.accent[500], // brand secondary\n cyan600: colors.accent[600],\n cyan700: colors.accent[700],\n cyan800: colors.accent[800],\n cyan900: colors.accent[900],\n cyan950: colors.accent[950],\n\n // Neutral (blue-undertone gray scale)\n neutral50: colors.neutral[50],\n neutral100: colors.neutral[100],\n neutral200: colors.neutral[200],\n neutral300: colors.neutral[300],\n neutral400: colors.neutral[400],\n neutral500: colors.neutral[500],\n neutral600: colors.neutral[600],\n neutral700: colors.neutral[700],\n neutral800: colors.neutral[800],\n neutral900: colors.neutral[900],\n neutral950: colors.neutral[950], // deepest — used as dark background\n\n // Semantic raw colors — VI §Color Specifications\n // NOTE: info = brand blue (#0033FE), not sky/teal\n red500: \"#ef4444\",\n red600: \"#dc2626\",\n green500: \"#22c55e\", // VI manual specifies this exact value for success\n green600: \"#16a34a\",\n amber500: \"#f59e0b\",\n amber600: \"#d97706\",\n\n white: colors.white,\n black: colors.black,\n} as const;\n\nexport type PrimitiveColor = keyof typeof primitiveColors;\n\n// ─── Brand Gradients — VI §Brand Gradients (first-class design assets) ────────\n\nexport const primitiveGradients = {\n /** Hero sections, primary CTA buttons, logo fills — VI signature gradient */\n primary: colors.gradient.primary,\n /** Hover states, secondary gradient elements */\n reverse: colors.gradient.primaryReverse,\n /** Vertical layout dividers, page section separators */\n vertical: colors.gradient.primaryVertical,\n /** Background halos, focus glow effects, radial emphasis */\n radial: colors.gradient.primaryRadial,\n /** Dark mode card surfaces — deep brand-blue tinted */\n darkCard: \"linear-gradient(135deg, #020617 0%, #0a1628 100%)\",\n} as const;\n\nexport type PrimitiveGradient = keyof typeof primitiveGradients;\n\n// ─── Spacing Scale (px values) ────────────────────────────────────────────────\n\nexport const primitiveSpacing = {\n 0: 0,\n 1: 4,\n 2: 8,\n 3: 12,\n 4: 16,\n 5: 20,\n 6: 24,\n 8: 32,\n 10: 40,\n 12: 48,\n 14: 56,\n 16: 64,\n 20: 80,\n 24: 96,\n} as const;\n\nexport type PrimitiveSpacing = keyof typeof primitiveSpacing;\n\n// ─── Layout Containers (px) — max-width standards ────────────────────────────\n// Use `text` for text-heavy sections (hero copy, CTA), `content` for general\n// sections, and `wide` for full-bleed feature bento grids.\n\nexport const primitiveContainer = {\n /** Text-focused: hero headlines, CTA copy, FAQ — optimized for reading */\n text: 896, // ~56rem / max-w-4xl\n /** Standard content sections: pricing, architecture, blog */\n content: 1152, // ~72rem / max-w-6xl\n /** Wide sections: feature bento, testimonials, product demos */\n wide: 1400, // ~87.5rem — Vercel/Supabase standard\n} as const;\n\nexport type PrimitiveContainer = keyof typeof primitiveContainer;\n\n// ─── Sizing Scale — component heights (px) ────────────────────────────────────\n\nexport const primitiveSizing = {\n xs: 20,\n /** Geist button-specific size (24px). Larger than xs by design. */\n tiny: 24,\n sm: 32,\n md: 40,\n lg: 48,\n xl: 56,\n \"2xl\": 80,\n} as const;\n\nexport type PrimitiveSizing = keyof typeof primitiveSizing;\n\n// ─── Border Radius (px) ───────────────────────────────────────────────────────\n\nexport const primitiveRadius = {\n none: 0,\n sm: 4,\n md: 6, // Geist default — slightly more rounded than 4px\n lg: 8,\n xl: 12,\n \"2xl\": 16,\n full: 9999,\n} as const;\n\nexport type PrimitiveRadius = keyof typeof primitiveRadius;\n\n// ─── Font Sizes (px) ──────────────────────────────────────────────────────────\n\nexport const primitiveFontSize = {\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} as const;\n\nexport type PrimitiveFontSize = keyof typeof primitiveFontSize;\n\n// ─── Font Weights ─────────────────────────────────────────────────────────────\n\nexport const primitiveFontWeight = {\n light: 300,\n normal: 400,\n medium: 500,\n semibold: 600,\n bold: 700,\n} as const;\n\nexport type PrimitiveFontWeight = keyof typeof primitiveFontWeight;\n\n// ─── Font Families — VI §Typography ──────────────────────────────────────────\n// Aligned with @nebutra/design-tokens SSOT (tokens/core.json fontFamily.*).\n// EN primary: Geist (Vercel variable, 100–900)\n// EN mono: Geist Mono\n// CN primary: Noto Sans SC → PingFang SC → Microsoft YaHei → vivo Sans (print)\n\nexport const primitiveFontFamily = {\n /** Default body/UI stack — Geist with CJK auto-fallbacks */\n sans: '\"Geist\", \"Noto Sans SC\", \"PingFang SC\", \"Microsoft YaHei\", -apple-system, BlinkMacSystemFont, system-ui, sans-serif',\n /** Chinese body/UI stack */\n cnSans: '\"Noto Sans SC\", \"PingFang SC\", \"Microsoft YaHei\", \"vivo Sans\", sans-serif',\n /** Display / hero headlines */\n display: '\"Geist\", \"Noto Sans SC\", sans-serif',\n /** Heading (alias of display) */\n heading: '\"Geist\", \"Noto Sans SC\", sans-serif',\n /** Code / monospace — Geist Mono pairs with Geist for full family coverage */\n mono: '\"Geist Mono\", ui-monospace, SFMono-Regular, \"SF Mono\", Menlo, monospace',\n} as const;\n\nexport type PrimitiveFontFamily = keyof typeof primitiveFontFamily;\n\n// ─── Shadows ──────────────────────────────────────────────────────────────────\n\nexport const primitiveShadow = {\n none: \"none\",\n sm: \"0 1px 2px 0 rgb(0 0 0 / 0.05)\",\n md: \"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)\",\n lg: \"0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)\",\n xl: \"0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)\",\n /** Brand glow — blue tone for focus/highlight states */\n brandGlow: \"0 0 0 3px rgb(0 51 254 / 0.15)\",\n} as const;\n\nexport type PrimitiveShadow = keyof typeof primitiveShadow;\n\n// ─── Transition ───────────────────────────────────────────────────────────────\n\n/**\n * Primitive transition tokens — aligned with the four-rail motion scale\n * (SSOT: @nebutra/design-tokens core.json → duration.*).\n * Keys mirror semantic.json motion.duration.*; values are in ms.\n */\nexport const primitiveTransition = {\n duration: {\n micro: 100, // hover, focus, small state changes\n flow: 200, // standard state transitions (default)\n reveal: 300, // larger motion (accordion, modal, drawer)\n cinematic: 500, // hero entrance, big delight moments\n },\n easing: {\n default: \"ease-out\",\n spring: \"cubic-bezier(0.34, 1.56, 0.64, 1)\",\n inOut: \"cubic-bezier(0.4, 0, 0.2, 1)\",\n },\n} as const;\n\n// ─── Focus Ring ───────────────────────────────────────────────────────────────\n\nexport const primitiveFocusRing = {\n width: 2, // px\n offset: 2, // px — gap between element and ring\n} as const;\n","/**\n * @nebutra/ui — Tailwind CSS 4 Preset\n *\n * Consumes primitive design tokens from tokens/primitive.ts, which itself\n * sources values from @nebutra/brand → @nebutra/design-tokens (SSOT).\n *\n * Usage (Tailwind CSS 4, CSS import — the runtime token source):\n * @import \"@nebutra/tokens/styles.css\"\n *\n * Usage (legacy tailwind.config.js):\n * import { nebutraPreset } from \"@nebutra/ui/tailwind.preset\"\n * export default { presets: [nebutraPreset] }\n */\n\nimport {\n primitiveColors,\n primitiveFontFamily,\n primitiveFontSize,\n primitiveFontWeight,\n primitiveGradients,\n primitiveRadius,\n primitiveShadow,\n} from \"./tokens/primitive\";\n\n// ─── Brand Color Palette ──────────────────────────────────────────────────────\n// Source: 云毓智能 VI 手册 — these are the correct Nebutra values, NOT generic\n// blue (#3B82F6) or purple (#A855F7) which were incorrectly present before.\n\nexport const nebutraColors = {\n // 云毓蓝 (Nebutra Blue) — primary brand color — VI: #0033FE\n blue: {\n 50: primitiveColors.blue50,\n 100: primitiveColors.blue100,\n 200: primitiveColors.blue200,\n 300: primitiveColors.blue300,\n 400: primitiveColors.blue400,\n 500: primitiveColors.blue500,\n 600: primitiveColors.blue600,\n 700: primitiveColors.blue700,\n 800: primitiveColors.blue800,\n 900: primitiveColors.blue900,\n 950: primitiveColors.blue950,\n DEFAULT: primitiveColors.blue500,\n foreground: primitiveColors.white,\n },\n\n // 云毓青 (Nebutra Cyan) — secondary brand color — VI: #0BF1C3\n cyan: {\n 50: primitiveColors.cyan50,\n 100: primitiveColors.cyan100,\n 200: primitiveColors.cyan200,\n 300: primitiveColors.cyan300,\n 400: primitiveColors.cyan400,\n 500: primitiveColors.cyan500,\n 600: primitiveColors.cyan600,\n 700: primitiveColors.cyan700,\n 800: primitiveColors.cyan800,\n 900: primitiveColors.cyan900,\n 950: primitiveColors.cyan950,\n DEFAULT: primitiveColors.cyan500,\n foreground: primitiveColors.neutral900,\n },\n\n // Neutral (blue-undertone gray scale)\n neutral: {\n 50: primitiveColors.neutral50,\n 100: primitiveColors.neutral100,\n 200: primitiveColors.neutral200,\n 300: primitiveColors.neutral300,\n 400: primitiveColors.neutral400,\n 500: primitiveColors.neutral500,\n 600: primitiveColors.neutral600,\n 700: primitiveColors.neutral700,\n 800: primitiveColors.neutral800,\n 900: primitiveColors.neutral900,\n 950: primitiveColors.neutral950,\n },\n\n // Semantic colors — VI §Color Specifications\n success: primitiveColors.green500, // #22c55e — VI specifies this exact value\n warning: primitiveColors.amber500, // #f59e0b\n error: primitiveColors.red500, // #ef4444\n info: primitiveColors.blue500, // #0033FE — VI: Info = Brand Blue\n} as const;\n\n// ─── Brand Gradients ──────────────────────────────────────────────────────────\n// VI §Brand Gradients — these are first-class brand assets\n\nexport const nebutraGradients = {\n brand: primitiveGradients.primary,\n brandHover: primitiveGradients.reverse,\n section: primitiveGradients.vertical,\n glow: primitiveGradients.radial,\n darkCard: primitiveGradients.darkCard,\n} as const;\n\n// ─── Spacing ──────────────────────────────────────────────────────────────────\n\nexport const nebutraSpacing = {\n xs: \"0.25rem\", // 4px\n sm: \"0.5rem\", // 8px\n md: \"1rem\", // 16px\n lg: \"1.5rem\", // 24px\n xl: \"2rem\", // 32px\n \"2xl\": \"3rem\", // 48px\n \"3xl\": \"4rem\", // 64px\n} as const;\n\n// ─── Border Radius ────────────────────────────────────────────────────────────\n// Consumed directly from primitive tokens (px → rem conversion)\n\nexport const nebutraBorderRadius = {\n none: \"0\",\n sm: `${primitiveRadius.sm / 16}rem`, // 4px → 0.25rem\n md: `${primitiveRadius.md / 16}rem`, // 6px → 0.375rem\n lg: `${primitiveRadius.lg / 16}rem`, // 8px → 0.5rem\n xl: `${primitiveRadius.xl / 16}rem`, // 12px → 0.75rem\n \"2xl\": `${primitiveRadius[\"2xl\"] / 16}rem`, // 16px → 1rem\n full: \"9999px\",\n} as const;\n\n// ─── Shadows ──────────────────────────────────────────────────────────────────\n\nexport const nebutraShadows = {\n none: primitiveShadow.none,\n sm: primitiveShadow.sm,\n md: primitiveShadow.md,\n lg: primitiveShadow.lg,\n xl: primitiveShadow.xl,\n brandGlow: primitiveShadow.brandGlow,\n} as const;\n\n// ─── Typography — VI §Typography ─────────────────────────────────────────────\n\nfunction fontVar(variable: string, registryVariable: string, fallback: string): string {\n return `var(${variable}, var(${registryVariable}, ${fallback}))`;\n}\n\nexport const nebutraTypography = {\n fontFamily: {\n sans: fontVar(\"--font-sans\", \"--font-geist-sans\", primitiveFontFamily.sans),\n cn: primitiveFontFamily.cnSans,\n display: fontVar(\"--font-display\", \"--font-geist-sans\", primitiveFontFamily.display),\n mono: fontVar(\"--font-mono\", \"--font-geist-mono\", primitiveFontFamily.mono),\n },\n fontSize: {\n xs: `${primitiveFontSize.xs / 16}rem`, // 12px\n sm: `${primitiveFontSize.sm / 16}rem`, // 14px\n base: `${primitiveFontSize.base / 16}rem`, // 16px\n lg: `${primitiveFontSize.lg / 16}rem`, // 18px\n xl: `${primitiveFontSize.xl / 16}rem`, // 20px\n \"2xl\": `${primitiveFontSize[\"2xl\"] / 16}rem`, // 24px\n \"3xl\": `${primitiveFontSize[\"3xl\"] / 16}rem`, // 30px\n \"4xl\": `${primitiveFontSize[\"4xl\"] / 16}rem`, // 36px\n },\n fontWeight: {\n light: String(primitiveFontWeight.light),\n normal: String(primitiveFontWeight.normal),\n medium: String(primitiveFontWeight.medium),\n semibold: String(primitiveFontWeight.semibold),\n bold: String(primitiveFontWeight.bold),\n },\n} as const;\n\n// ─── Animations ───────────────────────────────────────────────────────────────\n\nexport const nebutraAnimations = {\n \"accordion-down\": \"accordion-down 0.2s ease-out\",\n \"accordion-up\": \"accordion-up 0.2s ease-out\",\n \"fade-in\": \"fade-in 0.15s ease-out\",\n \"fade-out\": \"fade-out 0.15s ease-out\",\n \"slide-in-from-top\": \"slide-in-from-top 0.3s ease-out\",\n \"slide-in-from-bottom\": \"slide-in-from-bottom 0.3s ease-out\",\n \"slide-in-from-left\": \"slide-in-from-left 0.3s ease-out\",\n \"slide-in-from-right\": \"slide-in-from-right 0.3s ease-out\",\n spin: \"spin 1s linear infinite\",\n spinner: \"spinner 0.6s linear infinite\", // Button loading state\n pulse: \"pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite\",\n bounce: \"bounce 1s infinite\",\n} as const;\n\n// ─── Full Preset ──────────────────────────────────────────────────────────────\n\nexport const nebutraPreset = {\n colors: nebutraColors,\n spacing: nebutraSpacing,\n borderRadius: nebutraBorderRadius,\n boxShadow: nebutraShadows,\n fontFamily: nebutraTypography.fontFamily,\n fontSize: nebutraTypography.fontSize,\n fontWeight: nebutraTypography.fontWeight,\n animation: nebutraAnimations,\n} as const;\n\nexport type NebutraPreset = typeof nebutraPreset;\n\nexport default nebutraPreset;\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/tokens/primitive.ts","../src/tailwind.preset.ts"],"names":[],"mappings":";;;AAeO,IAAM,eAAA,GAAkB;AAAA;AAAA,EAE7B,MAAA,EAAQ,MAAA,CAAO,OAAA,CAAQ,EAAE,CAAA;AAAA,EACzB,OAAA,EAAS,MAAA,CAAO,OAAA,CAAQ,GAAG,CAAA;AAAA,EAC3B,OAAA,EAAS,MAAA,CAAO,OAAA,CAAQ,GAAG,CAAA;AAAA,EAC3B,OAAA,EAAS,MAAA,CAAO,OAAA,CAAQ,GAAG,CAAA;AAAA,EAC3B,OAAA,EAAS,MAAA,CAAO,OAAA,CAAQ,GAAG,CAAA;AAAA,EAC3B,OAAA,EAAS,MAAA,CAAO,OAAA,CAAQ,GAAG,CAAA;AAAA;AAAA,EAC3B,OAAA,EAAS,MAAA,CAAO,OAAA,CAAQ,GAAG,CAAA;AAAA,EAC3B,OAAA,EAAS,MAAA,CAAO,OAAA,CAAQ,GAAG,CAAA;AAAA,EAC3B,OAAA,EAAS,MAAA,CAAO,OAAA,CAAQ,GAAG,CAAA;AAAA,EAC3B,OAAA,EAAS,MAAA,CAAO,OAAA,CAAQ,GAAG,CAAA;AAAA,EAC3B,OAAA,EAAS,MAAA,CAAO,OAAA,CAAQ,GAAG,CAAA;AAAA;AAAA,EAG3B,MAAA,EAAQ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AAA,EAAU,MAAA,CAAO,mBAAA,CAAoB,QAAQ,CAAA;AAAA,IAC7C,IAAA,EAAM,MAAA,CAAO,mBAAA,CAAoB,IAAI;AAAA;AAEzC;AAIO,IAAM,iBAAA,GAAoB;AAAA,EAC/B,gBAAA,EAAkB,8BAAA;AAAA,EAClB,cAAA,EAAgB,4BAAA;AAAA,EAChB,SAAA,EAAW,wBAAA;AAAA,EACX,UAAA,EAAY,yBAAA;AAAA,EACZ,mBAAA,EAAqB,iCAAA;AAAA,EACrB,sBAAA,EAAwB,oCAAA;AAAA,EACxB,oBAAA,EAAsB,kCAAA;AAAA,EACtB,qBAAA,EAAuB,mCAAA;AAAA,EACvB,IAAA,EAAM,yBAAA;AAAA,EACN,OAAA,EAAS,8BAAA;AAAA;AAAA,EACT,KAAA,EAAO,gDAAA;AAAA,EACP,MAAA,EAAQ;AACV;AAIO,IAAM,aAAA,GAAgB;AAAA,EAC3B,MAAA,EAAQ,aAAA;AAAA,EACR,OAAA,EAAS,cAAA;AAAA,EACT,YAAA,EAAc,mBAAA;AAAA,EACd,SAAA,EAAW,cAAA;AAAA,EACX,YAAY,iBAAA,CAAkB,UAAA;AAAA,EAC9B,UAAU,iBAAA,CAAkB,QAAA;AAAA,EAC5B,YAAY,iBAAA,CAAkB,UAAA;AAAA,EAC9B,SAAA,EAAW;AACb;AAIA,IAAO,uBAAA,GAAQ","file":"tailwind.preset.js","sourcesContent":["/**\n * Primitive Design Tokens — Layer 1\n *\n * Raw values only. No CSS variable references, no semantic meaning.\n * These are the \"atoms\" of the design system.\n *\n * Color source: @nebutra/brand `colors` → @nebutra/design-tokens `tokens/core.json` (SSOT).\n * Typography: Geist + Geist Mono (Vercel) with Noto Sans SC + PingFang SC + Microsoft YaHei CJK fallbacks.\n * Aligned with @nebutra/design-tokens SSOT.\n */\n\nimport { colors } from \"@nebutra/brand\";\n\n// ─── Color Palette ────────────────────────────────────────────────────────────\n\nexport const primitiveColors = {\n // Nebutra Blue (云毓蓝) — technology & trust — VI: #0033FE\n blue50: colors.primary[50],\n blue100: colors.primary[100],\n blue200: colors.primary[200],\n blue300: colors.primary[300],\n blue400: colors.primary[400],\n blue500: colors.primary[500], // brand primary\n blue600: colors.primary[600],\n blue700: colors.primary[700],\n blue800: colors.primary[800],\n blue900: colors.primary[900],\n blue950: colors.primary[950],\n\n // Nebutra Cyan (云毓青) — data flow & intelligence — VI: #0BF1C3\n cyan50: colors.accent[50],\n cyan100: colors.accent[100],\n cyan200: colors.accent[200],\n cyan300: colors.accent[300],\n cyan400: colors.accent[400],\n cyan500: colors.accent[500], // brand secondary\n cyan600: colors.accent[600],\n cyan700: colors.accent[700],\n cyan800: colors.accent[800],\n cyan900: colors.accent[900],\n cyan950: colors.accent[950],\n\n // Neutral (blue-undertone gray scale)\n neutral50: colors.neutral[50],\n neutral100: colors.neutral[100],\n neutral200: colors.neutral[200],\n neutral300: colors.neutral[300],\n neutral400: colors.neutral[400],\n neutral500: colors.neutral[500],\n neutral600: colors.neutral[600],\n neutral700: colors.neutral[700],\n neutral800: colors.neutral[800],\n neutral900: colors.neutral[900],\n neutral950: colors.neutral[950], // deepest — used as dark background\n\n // Semantic raw colors — VI §Color Specifications\n // NOTE: info = brand blue (#0033FE), not sky/teal\n red500: \"#ef4444\",\n red600: \"#dc2626\",\n green500: \"#22c55e\", // VI manual specifies this exact value for success\n green600: \"#16a34a\",\n amber500: \"#f59e0b\",\n amber600: \"#d97706\",\n\n white: colors.white,\n black: colors.black,\n} as const;\n\nexport type PrimitiveColor = keyof typeof primitiveColors;\n\n// ─── Brand Gradients — VI §Brand Gradients (first-class design assets) ────────\n\nexport const primitiveGradients = {\n /** Hero sections, primary CTA buttons, logo fills — VI signature gradient */\n primary: colors.gradient.primary,\n /** Hover states, secondary gradient elements */\n reverse: colors.gradient.primaryReverse,\n /** Vertical layout dividers, page section separators */\n vertical: colors.gradient.primaryVertical,\n /** Background halos, focus glow effects, radial emphasis */\n radial: colors.gradient.primaryRadial,\n /** Dark mode card surfaces — deep brand-blue tinted */\n darkCard: \"linear-gradient(135deg, #020617 0%, #0a1628 100%)\",\n} as const;\n\nexport type PrimitiveGradient = keyof typeof primitiveGradients;\n\n// ─── Spacing Scale (px values) ────────────────────────────────────────────────\n\nexport const primitiveSpacing = {\n 0: 0,\n 1: 4,\n 2: 8,\n 3: 12,\n 4: 16,\n 5: 20,\n 6: 24,\n 8: 32,\n 10: 40,\n 12: 48,\n 14: 56,\n 16: 64,\n 20: 80,\n 24: 96,\n} as const;\n\nexport type PrimitiveSpacing = keyof typeof primitiveSpacing;\n\n// ─── Layout Containers (px) — max-width standards ────────────────────────────\n// Use `text` for text-heavy sections (hero copy, CTA), `content` for general\n// sections, and `wide` for full-bleed feature bento grids.\n\nexport const primitiveContainer = {\n /** Text-focused: hero headlines, CTA copy, FAQ — optimized for reading */\n text: 896, // ~56rem / max-w-4xl\n /** Standard content sections: pricing, architecture, blog */\n content: 1152, // ~72rem / max-w-6xl\n /** Wide sections: feature bento, testimonials, product demos */\n wide: 1400, // ~87.5rem — Vercel/Supabase standard\n} as const;\n\nexport type PrimitiveContainer = keyof typeof primitiveContainer;\n\n// ─── Sizing Scale — component heights (px) ────────────────────────────────────\n\nexport const primitiveSizing = {\n xs: 20,\n /** Geist button-specific size (24px). Larger than xs by design. */\n tiny: 24,\n sm: 32,\n md: 40,\n lg: 48,\n xl: 56,\n \"2xl\": 80,\n} as const;\n\nexport type PrimitiveSizing = keyof typeof primitiveSizing;\n\n// ─── Border Radius (px) ───────────────────────────────────────────────────────\n\nexport const primitiveRadius = {\n none: 0,\n sm: 4,\n md: 6, // Geist default — slightly more rounded than 4px\n lg: 8,\n xl: 12,\n \"2xl\": 16,\n full: 9999,\n} as const;\n\nexport type PrimitiveRadius = keyof typeof primitiveRadius;\n\n// ─── Font Sizes (px) ──────────────────────────────────────────────────────────\n\nexport const primitiveFontSize = {\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} as const;\n\nexport type PrimitiveFontSize = keyof typeof primitiveFontSize;\n\n// ─── Font Weights ─────────────────────────────────────────────────────────────\n\nexport const primitiveFontWeight = {\n light: 300,\n normal: 400,\n medium: 500,\n semibold: 600,\n bold: 700,\n} as const;\n\nexport type PrimitiveFontWeight = keyof typeof primitiveFontWeight;\n\n// ─── Font Families — VI §Typography ──────────────────────────────────────────\n// Aligned with @nebutra/design-tokens SSOT (tokens/core.json fontFamily.*).\n// EN primary: Geist (Vercel variable, 100–900)\n// EN mono: Geist Mono\n// CN primary: Noto Sans SC → PingFang SC → Microsoft YaHei\n\nexport const primitiveFontFamily = {\n /** Default body/UI stack — Geist with CJK auto-fallbacks */\n sans: '\"Geist\", \"Noto Sans SC\", \"PingFang SC\", \"Microsoft YaHei\", -apple-system, BlinkMacSystemFont, system-ui, sans-serif',\n /** Chinese body/UI stack */\n cnSans: '\"Noto Sans SC\", \"PingFang SC\", \"Microsoft YaHei\", sans-serif',\n /** Display / hero headlines */\n display: '\"Geist\", \"Noto Sans SC\", sans-serif',\n /** Heading (alias of display) */\n heading: '\"Geist\", \"Noto Sans SC\", sans-serif',\n /** Code / monospace — Geist Mono pairs with Geist for full family coverage */\n mono: '\"Geist Mono\", ui-monospace, SFMono-Regular, \"SF Mono\", Menlo, monospace',\n} as const;\n\nexport type PrimitiveFontFamily = keyof typeof primitiveFontFamily;\n\n// ─── Shadows ──────────────────────────────────────────────────────────────────\n\nexport const primitiveShadow = {\n none: \"none\",\n sm: \"0 1px 2px 0 rgb(0 0 0 / 0.05)\",\n md: \"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)\",\n lg: \"0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)\",\n xl: \"0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)\",\n /** Brand glow — blue tone for focus/highlight states */\n brandGlow: \"0 0 0 3px rgb(0 51 254 / 0.15)\",\n} as const;\n\nexport type PrimitiveShadow = keyof typeof primitiveShadow;\n\n// ─── Transition ───────────────────────────────────────────────────────────────\n\n/**\n * Primitive transition tokens — aligned with the four-rail motion scale\n * (SSOT: @nebutra/design-tokens core.json → duration.*).\n * Keys mirror semantic.json motion.duration.*; values are in ms.\n */\nexport const primitiveTransition = {\n duration: {\n micro: 100, // hover, focus, small state changes\n flow: 200, // standard state transitions (default)\n reveal: 300, // larger motion (accordion, modal, drawer)\n cinematic: 500, // hero entrance, big delight moments\n },\n easing: {\n default: \"var(--ease-brand)\",\n spring: \"cubic-bezier(0.34, 1.56, 0.64, 1)\",\n inOut: \"cubic-bezier(0.4, 0, 0.2, 1)\",\n },\n} as const;\n\n// ─── Focus Ring ───────────────────────────────────────────────────────────────\n\nexport const primitiveFocusRing = {\n width: 2, // px\n offset: 2, // px — gap between element and ring\n} as const;\n","/**\n * @nebutra/ui — Tailwind CSS 4 Preset\n *\n * Consumes primitive design tokens from tokens/primitive.ts, which itself\n * sources values from @nebutra/brand → @nebutra/design-tokens (SSOT).\n *\n * Usage (Tailwind CSS 4, CSS import — the runtime token source):\n * @import \"@nebutra/tokens/styles.css\"\n *\n * Usage (legacy tailwind.config.js):\n * import { nebutraPreset } from \"@nebutra/ui/tailwind.preset\"\n * export default { presets: [nebutraPreset] }\n */\n\nimport {\n primitiveColors,\n primitiveFontFamily,\n primitiveFontSize,\n primitiveFontWeight,\n primitiveGradients,\n primitiveRadius,\n primitiveShadow,\n} from \"./tokens/primitive\";\n\n// ─── Brand Color Palette ──────────────────────────────────────────────────────\n// Source: 云毓智能 VI 手册 — these are the correct Nebutra values, NOT generic\n// blue (#3B82F6) or purple (#A855F7) which were incorrectly present before.\n\nexport const nebutraColors = {\n // 云毓蓝 (Nebutra Blue) — primary brand color — VI: #0033FE\n blue: {\n 50: primitiveColors.blue50,\n 100: primitiveColors.blue100,\n 200: primitiveColors.blue200,\n 300: primitiveColors.blue300,\n 400: primitiveColors.blue400,\n 500: primitiveColors.blue500,\n 600: primitiveColors.blue600,\n 700: primitiveColors.blue700,\n 800: primitiveColors.blue800,\n 900: primitiveColors.blue900,\n 950: primitiveColors.blue950,\n DEFAULT: primitiveColors.blue500,\n foreground: primitiveColors.white,\n },\n\n // 云毓青 (Nebutra Cyan) — secondary brand color — VI: #0BF1C3\n cyan: {\n 50: primitiveColors.cyan50,\n 100: primitiveColors.cyan100,\n 200: primitiveColors.cyan200,\n 300: primitiveColors.cyan300,\n 400: primitiveColors.cyan400,\n 500: primitiveColors.cyan500,\n 600: primitiveColors.cyan600,\n 700: primitiveColors.cyan700,\n 800: primitiveColors.cyan800,\n 900: primitiveColors.cyan900,\n 950: primitiveColors.cyan950,\n DEFAULT: primitiveColors.cyan500,\n foreground: primitiveColors.neutral900,\n },\n\n // Neutral (blue-undertone gray scale)\n neutral: {\n 50: primitiveColors.neutral50,\n 100: primitiveColors.neutral100,\n 200: primitiveColors.neutral200,\n 300: primitiveColors.neutral300,\n 400: primitiveColors.neutral400,\n 500: primitiveColors.neutral500,\n 600: primitiveColors.neutral600,\n 700: primitiveColors.neutral700,\n 800: primitiveColors.neutral800,\n 900: primitiveColors.neutral900,\n 950: primitiveColors.neutral950,\n },\n\n // Semantic colors — VI §Color Specifications\n success: primitiveColors.green500, // #22c55e — VI specifies this exact value\n warning: primitiveColors.amber500, // #f59e0b\n error: primitiveColors.red500, // #ef4444\n info: primitiveColors.blue500, // #0033FE — VI: Info = Brand Blue\n} as const;\n\n// ─── Brand Gradients ──────────────────────────────────────────────────────────\n// VI §Brand Gradients — these are first-class brand assets\n\nexport const nebutraGradients = {\n brand: primitiveGradients.primary,\n brandHover: primitiveGradients.reverse,\n section: primitiveGradients.vertical,\n glow: primitiveGradients.radial,\n darkCard: primitiveGradients.darkCard,\n} as const;\n\n// ─── Spacing ──────────────────────────────────────────────────────────────────\n\nexport const nebutraSpacing = {\n xs: \"0.25rem\", // 4px\n sm: \"0.5rem\", // 8px\n md: \"1rem\", // 16px\n lg: \"1.5rem\", // 24px\n xl: \"2rem\", // 32px\n \"2xl\": \"3rem\", // 48px\n \"3xl\": \"4rem\", // 64px\n} as const;\n\n// ─── Border Radius ────────────────────────────────────────────────────────────\n// Consumed directly from primitive tokens (px → rem conversion)\n\nexport const nebutraBorderRadius = {\n none: \"0\",\n sm: `${primitiveRadius.sm / 16}rem`, // 4px → 0.25rem\n md: `${primitiveRadius.md / 16}rem`, // 6px → 0.375rem\n lg: `${primitiveRadius.lg / 16}rem`, // 8px → 0.5rem\n xl: `${primitiveRadius.xl / 16}rem`, // 12px → 0.75rem\n \"2xl\": `${primitiveRadius[\"2xl\"] / 16}rem`, // 16px → 1rem\n full: \"9999px\",\n} as const;\n\n// ─── Shadows ──────────────────────────────────────────────────────────────────\n\nexport const nebutraShadows = {\n none: primitiveShadow.none,\n sm: primitiveShadow.sm,\n md: primitiveShadow.md,\n lg: primitiveShadow.lg,\n xl: primitiveShadow.xl,\n brandGlow: primitiveShadow.brandGlow,\n} as const;\n\n// ─── Typography — VI §Typography ─────────────────────────────────────────────\n\nfunction fontVar(variable: string, registryVariable: string, fallback: string): string {\n return `var(${variable}, var(${registryVariable}, ${fallback}))`;\n}\n\nexport const nebutraTypography = {\n fontFamily: {\n sans: fontVar(\"--font-sans\", \"--font-geist-sans\", primitiveFontFamily.sans),\n cn: primitiveFontFamily.cnSans,\n display: fontVar(\"--font-display\", \"--font-geist-sans\", primitiveFontFamily.display),\n mono: fontVar(\"--font-mono\", \"--font-geist-mono\", primitiveFontFamily.mono),\n },\n fontSize: {\n xs: `${primitiveFontSize.xs / 16}rem`, // 12px\n sm: `${primitiveFontSize.sm / 16}rem`, // 14px\n base: `${primitiveFontSize.base / 16}rem`, // 16px\n lg: `${primitiveFontSize.lg / 16}rem`, // 18px\n xl: `${primitiveFontSize.xl / 16}rem`, // 20px\n \"2xl\": `${primitiveFontSize[\"2xl\"] / 16}rem`, // 24px\n \"3xl\": `${primitiveFontSize[\"3xl\"] / 16}rem`, // 30px\n \"4xl\": `${primitiveFontSize[\"4xl\"] / 16}rem`, // 36px\n },\n fontWeight: {\n light: String(primitiveFontWeight.light),\n normal: String(primitiveFontWeight.normal),\n medium: String(primitiveFontWeight.medium),\n semibold: String(primitiveFontWeight.semibold),\n bold: String(primitiveFontWeight.bold),\n },\n} as const;\n\n// ─── Animations ───────────────────────────────────────────────────────────────\n\nexport const nebutraAnimations = {\n \"accordion-down\": \"accordion-down 0.2s ease-out\",\n \"accordion-up\": \"accordion-up 0.2s ease-out\",\n \"fade-in\": \"fade-in 0.15s ease-out\",\n \"fade-out\": \"fade-out 0.15s ease-out\",\n \"slide-in-from-top\": \"slide-in-from-top 0.3s ease-out\",\n \"slide-in-from-bottom\": \"slide-in-from-bottom 0.3s ease-out\",\n \"slide-in-from-left\": \"slide-in-from-left 0.3s ease-out\",\n \"slide-in-from-right\": \"slide-in-from-right 0.3s ease-out\",\n spin: \"spin 1s linear infinite\",\n spinner: \"spinner 0.6s linear infinite\", // Button loading state\n pulse: \"pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite\",\n bounce: \"bounce 1s infinite\",\n} as const;\n\n// ─── Full Preset ──────────────────────────────────────────────────────────────\n\nexport const nebutraPreset = {\n colors: nebutraColors,\n spacing: nebutraSpacing,\n borderRadius: nebutraBorderRadius,\n boxShadow: nebutraShadows,\n fontFamily: nebutraTypography.fontFamily,\n fontSize: nebutraTypography.fontSize,\n fontWeight: nebutraTypography.fontWeight,\n animation: nebutraAnimations,\n} as const;\n\nexport type NebutraPreset = typeof nebutraPreset;\n\nexport default nebutraPreset;\n"]}
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
* Font loading (Next.js apps): each app's layout.tsx applies the loader classes
|
|
7
7
|
* GeistSans → --font-geist-sans (variable, 100–900) Latin + numerals
|
|
8
8
|
* GeistMono → --font-geist-mono (variable, 100–900) code
|
|
9
|
-
* cjkFontClassName → --font-
|
|
9
|
+
* cjkFontClassName → --font-noto-sans-sc (@nebutra/fonts/next/cjk) CJK
|
|
10
10
|
* and the token stacks reference those variables in that order, so Geist keeps
|
|
11
|
-
* Latin and only CJK falls through to
|
|
11
|
+
* Latin and only CJK falls through to Noto Sans SC.
|
|
12
12
|
*
|
|
13
13
|
* IMPORT ORDER MATTERS: this file must come AFTER @nebutra/tokens/styles.css
|
|
14
14
|
* (see ../styles/preset.css). It used to re-declare --font-sans / --font-heading /
|
|
@@ -124,10 +124,10 @@ declare const FONT_FAMILY_MONO = "var(--font-mono, var(--font-geist-mono, \"Geis
|
|
|
124
124
|
/**
|
|
125
125
|
* CJK (Chinese/Japanese/Korean) fallback stack
|
|
126
126
|
*
|
|
127
|
-
*
|
|
127
|
+
* Noto Sans SC is the primary Chinese font.
|
|
128
128
|
* Provides consistent rendering for Chinese, Japanese, and Korean text.
|
|
129
129
|
*/
|
|
130
|
-
declare const FONT_FAMILY_CJK = "\"
|
|
130
|
+
declare const FONT_FAMILY_CJK = "\"Noto Sans SC\", \"Source Han Sans SC\", \"Source Han Sans\", \"Noto Sans CJK SC\", \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", sans-serif";
|
|
131
131
|
/**
|
|
132
132
|
* Complete font stacks with CJK fallback
|
|
133
133
|
*/
|
|
@@ -139,9 +139,9 @@ declare const fontFamilies: {
|
|
|
139
139
|
/** Code and monospace */
|
|
140
140
|
readonly mono: "var(--font-mono, var(--font-geist-mono, \"Geist Mono\", ui-monospace, SFMono-Regular, \"SF Mono\", Menlo, monospace))";
|
|
141
141
|
/** CJK-specific fallback */
|
|
142
|
-
readonly cjk: "\"
|
|
142
|
+
readonly cjk: "\"Noto Sans SC\", \"Source Han Sans SC\", \"Source Han Sans\", \"Noto Sans CJK SC\", \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", sans-serif";
|
|
143
143
|
/** Primary with CJK fallback for multilingual content */
|
|
144
|
-
readonly primaryCJK: "var(--font-sans, var(--font-geist-sans, \"Geist\", \"Noto Sans SC\", \"PingFang SC\", \"Microsoft YaHei\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif)), \"
|
|
144
|
+
readonly primaryCJK: "var(--font-sans, var(--font-geist-sans, \"Geist\", \"Noto Sans SC\", \"PingFang SC\", \"Microsoft YaHei\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif)), \"Noto Sans SC\", \"Source Han Sans SC\", \"Source Han Sans\", \"Noto Sans CJK SC\", \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", sans-serif";
|
|
145
145
|
/** System font stack (fast fallback, no web fonts) */
|
|
146
146
|
readonly system: "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif";
|
|
147
147
|
};
|
package/dist/typography/index.js
CHANGED
|
@@ -140,7 +140,7 @@ All fonts are free for commercial use. See individual license files for details.
|
|
|
140
140
|
var FONT_FAMILY_PRIMARY = 'var(--font-sans, var(--font-geist-sans, "Geist", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif))';
|
|
141
141
|
var FONT_FAMILY_HEADING = 'var(--font-heading, var(--font-geist-sans, "Geist", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif))';
|
|
142
142
|
var FONT_FAMILY_MONO = 'var(--font-mono, var(--font-geist-mono, "Geist Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace))';
|
|
143
|
-
var FONT_FAMILY_CJK = '"
|
|
143
|
+
var FONT_FAMILY_CJK = '"Noto Sans SC", "Source Han Sans SC", "Source Han Sans", "Noto Sans CJK SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif';
|
|
144
144
|
var fontFamilies = {
|
|
145
145
|
/** Primary UI and body text */
|
|
146
146
|
primary: FONT_FAMILY_P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B,eAAe,aAAA,CAAc;AAAA,GAC/B;AAAA;AAAA,EAGA,QAAA,EAAU;AAAA,IACR,YAAY,YAAA,CAAa,OAAA;AAAA,IACzB,UAAU,SAAA,CAAU,EAAA;AAAA,IACpB,YAAY,WAAA,CAAY,QAAA;AAAA,IACxB,YAAY,WAAA,CAAY,MAAA;AAAA,IACxB,eAAe,aAAA,CAAc,MAAA;AAAA,IAC7B,aAAA,EAAe;AAAA;AAEnB;AAcO,IAAM,cAAA,GAAiB;AAAA;AAAA,EAE5B,OAAA,EAAS,oCAAA;AAAA;AAAA,EAGT,EAAA,EAAI,qCAAA;AAAA;AAAA,EAGJ,EAAA,EAAI,sCAAA;AAAA;AAAA,EAGJ,EAAA,EAAI,wCAAA;AAAA;AAAA,EAGJ,IAAA,EAAM;AACR","file":"index.js","sourcesContent":["/**\n * Font Configuration and Loading Utilities\n *\n * Handles web font loading, preloading, and performance optimization.\n */\n\n// ============================================\n// Font Definitions\n// ============================================\n\n/**\n * Font configuration object\n */\nexport interface FontConfig {\n /** Font family name */\n family: string;\n /** Font weights to load */\n weights: number[];\n /** Include italic variants */\n italic?: boolean;\n /** Font display strategy */\n display?: \"auto\" | \"block\" | \"swap\" | \"fallback\" | \"optional\";\n /** Is this a variable font */\n variable?: boolean;\n /** Google Fonts URL parameter name */\n googleFontsParam?: string;\n /** Self-hosted font URL */\n selfHostUrl?: string;\n /** Font license */\n license: \"OFL\" | \"Apache-2.0\" | \"Ubuntu\" | \"MIT\" | \"Other\";\n /** Source URL for license */\n licenseUrl?: string;\n}\n\n/**\n * Registered fonts for the design system\n */\nexport const fonts: Record<string, FontConfig> = {\n geistSans: {\n family: \"Geist\",\n weights: [300, 400, 500, 600, 700],\n italic: false,\n display: \"swap\",\n variable: true,\n license: \"OFL\",\n licenseUrl: \"https://github.com/vercel/geist-font/blob/main/LICENSE.txt\",\n },\n\n geistMono: {\n family: \"Geist Mono\",\n weights: [400, 500, 600, 700],\n italic: false,\n display: \"swap\",\n variable: true,\n license: \"OFL\",\n licenseUrl: \"https://github.com/vercel/geist-font/blob/main/LICENSE.txt\",\n },\n\n inter: {\n family: \"Inter\",\n weights: [300, 400, 500, 600, 700],\n italic: false,\n display: \"swap\",\n variable: true,\n googleFontsParam: \"Inter:wght@300;400;500;600;700\",\n license: \"OFL\",\n licenseUrl: \"https://github.com/rsms/inter/blob/master/LICENSE.txt\",\n },\n\n publicSans: {\n family: \"Public Sans\",\n weights: [300, 400, 500, 600, 700],\n italic: true,\n display: \"swap\",\n variable: true,\n googleFontsParam: \"Public+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400;1,500\",\n license: \"OFL\",\n licenseUrl: \"https://github.com/uswds/public-sans/blob/develop/LICENSE.md\",\n },\n\n jetbrainsMono: {\n family: \"JetBrains Mono\",\n weights: [400, 500, 700],\n italic: false,\n display: \"swap\",\n variable: true,\n googleFontsParam: \"JetBrains+Mono:wght@400;500;700\",\n license: \"OFL\",\n licenseUrl: \"https://github.com/JetBrains/JetBrainsMono/blob/master/OFL.txt\",\n },\n\n sourceHanSans: {\n family: \"Noto Sans SC\",\n weights: [400, 500, 700],\n italic: false,\n display: \"swap\",\n variable: false,\n googleFontsParam: \"Noto+Sans+SC:wght@400;500;700\",\n license: \"OFL\",\n licenseUrl: \"https://github.com/adobe-fonts/source-han-sans/blob/master/LICENSE.txt\",\n },\n};\n\n// ============================================\n// Google Fonts URL Builder\n// ============================================\n\n/**\n * Generate Google Fonts URL for specified fonts\n */\nexport function getGoogleFontsUrl(fontKeys: (keyof typeof fonts)[]): string {\n const families = fontKeys\n .map((key) => fonts[key]?.googleFontsParam)\n .filter(Boolean)\n .join(\"&family=\");\n\n if (!families) return \"\";\n\n return `https://fonts.googleapis.com/css2?family=${families}&display=swap`;\n}\n\n/**\n * Default fonts to load\n */\nexport const defaultFonts: (keyof typeof fonts)[] = [\"geistSans\", \"geistMono\"];\n\n/**\n * Fonts for CJK (Chinese) support\n */\nexport const cjkFonts: (keyof typeof fonts)[] = [\"sourceHanSans\"];\n\n/**\n * All fonts including CJK\n */\nexport const allFonts: (keyof typeof fonts)[] = [...defaultFonts, ...cjkFonts];\n\n// ============================================\n// Font Loading Utilities\n// ============================================\n\n/**\n * Generate preload link elements for critical fonts\n */\nexport function getFontPreloadLinks(fontKeys: (keyof typeof fonts)[]): string[] {\n return fontKeys\n .map((key) => {\n const font = fonts[key];\n if (!font) return \"\";\n\n const url = getGoogleFontsUrl([key]);\n return `<link rel=\"preload\" href=\"${url}\" as=\"style\" crossorigin>`;\n })\n .filter(Boolean);\n}\n\n/**\n * Generate link element for Google Fonts\n */\nexport function getGoogleFontsLink(fontKeys: (keyof typeof fonts)[]): string {\n const url = getGoogleFontsUrl(fontKeys);\n if (!url) return \"\";\n\n return `<link rel=\"stylesheet\" href=\"${url}\">`;\n}\n\n/**\n * Check if fonts are loaded\n */\nexport async function areFontsLoaded(fontFamilies: string[]): Promise<boolean> {\n if (typeof document === \"undefined\") return false;\n\n try {\n await Promise.all(fontFamilies.map((family) => document.fonts.load(`16px \"${family}\"`)));\n return true;\n } catch {\n return false;\n }\n}\n\n/**\n * Wait for fonts to load with timeout\n */\nexport async function waitForFonts(fontFamilies: string[], timeout = 3000): Promise<boolean> {\n if (typeof document === \"undefined\") return false;\n\n return new Promise((resolve) => {\n const timer = setTimeout(() => resolve(false), timeout);\n\n areFontsLoaded(fontFamilies).then((loaded) => {\n clearTimeout(timer);\n resolve(loaded);\n });\n });\n}\n\n// ============================================\n// CSS-in-JS Helpers\n// ============================================\n\n/**\n * Font smoothing CSS for crisp text rendering\n */\nexport const fontSmoothing = {\n WebkitFontSmoothing: \"antialiased\",\n MozOsxFontSmoothing: \"grayscale\",\n textRendering: \"optimizeLegibility\",\n} as const;\n\n/**\n * Font feature settings for Geist\n */\nexport const fontFeatureSettings = {\n /** Enable common ligatures and contextual alternates */\n normal: '\"calt\" 1, \"liga\" 1',\n /** Enable tabular figures for aligned numbers */\n tabular: '\"tnum\" 1, \"calt\" 1',\n /** Enable case-sensitive forms */\n case: '\"case\" 1',\n /** Enable stylistic set 01 (alternate digits) */\n ss01: '\"ss01\" 1',\n /** Enable stylistic set 02 (alternate a) */\n ss02: '\"ss02\" 1',\n} as const;\n\n// ============================================\n// License Information\n// ============================================\n\n/**\n * Get license information for all used fonts\n */\nexport function getFontLicenses(): Array<{\n family: string;\n license: string;\n url?: string | undefined;\n}> {\n return Object.values(fonts).map((font) => ({\n family: font.family,\n license: font.license,\n url: font.licenseUrl,\n }));\n}\n\n/**\n * Font license compliance notice\n */\nexport const fontLicenseNotice = `\nFonts used in this project are licensed under open-source licenses:\n\n- Inter: SIL Open Font License 1.1\n- Public Sans: SIL Open Font License 1.1\n- Geist: SIL Open Font License 1.1\n- Geist Mono: SIL Open Font License 1.1\n- JetBrains Mono: SIL Open Font License 1.1\n- Noto Sans SC (Source Han Sans): SIL Open Font License 1.1\n\nAll fonts are free for commercial use. See individual license files for details.\n`.trim();\n","/**\n * Typography Tokens\n *\n * Centralized typography configuration for the entire design system.\n * All font-related values should come from here.\n */\n\n// ============================================\n// Font Families\n// ============================================\n\n/**\n * Primary font stack - Used for body text and UI.\n *\n * Token-first so next/font's generated face wins when available; the literal\n * family stack remains as a standalone fallback for docs/tests.\n */\nexport const FONT_FAMILY_PRIMARY =\n 'var(--font-sans, var(--font-geist-sans, \"Geist\", \"Noto Sans SC\", \"PingFang SC\", \"Microsoft YaHei\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif))';\n\n/**\n * Heading font stack - Used for titles and emphasis\n *\n * Geist Sans is the primary display typeface.\n */\nexport const FONT_FAMILY_HEADING =\n 'var(--font-heading, var(--font-geist-sans, \"Geist\", \"Noto Sans SC\", \"PingFang SC\", \"Microsoft YaHei\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif))';\n\n/**\n * Monospace font stack - Used for code and technical content\n */\nexport const FONT_FAMILY_MONO =\n 'var(--font-mono, var(--font-geist-mono, \"Geist Mono\", ui-monospace, SFMono-Regular, \"SF Mono\", Menlo, monospace))';\n\n/**\n * CJK (Chinese/Japanese/Korean) fallback stack\n *\n * vivo Sans is the primary Chinese font.\n * Provides consistent rendering for Chinese, Japanese, and Korean text.\n */\nexport const FONT_FAMILY_CJK =\n '\"vivo Sans\", \"Source Han Sans SC\", \"Source Han Sans\", \"Noto Sans CJK SC\", \"Noto Sans SC\", \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", sans-serif';\n\n/**\n * Complete font stacks with CJK fallback\n */\nexport const fontFamilies = {\n /** Primary UI and body text */\n primary: FONT_FAMILY_PRIMARY,\n\n /** Headings and titles */\n heading: FONT_FAMILY_HEADING,\n\n /** Code and monospace */\n mono: FONT_FAMILY_MONO,\n\n /** CJK-specific fallback */\n cjk: FONT_FAMILY_CJK,\n\n /** Primary with CJK fallback for multilingual content */\n primaryCJK: `${FONT_FAMILY_PRIMARY}, ${FONT_FAMILY_CJK}`,\n\n /** System font stack (fast fallback, no web fonts) */\n system: '-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif',\n} as const;\n\n// ============================================\n// Type Scale\n// ============================================\n\n/**\n * Font size scale using rem units for accessibility\n *\n * Base: 16px = 1rem\n * Each step follows a modular scale (~1.25 ratio)\n */\nexport const fontSizes = {\n /** 12px - Micro text, badges */\n xs: \"0.75rem\",\n\n /** 14px - Small text, captions, labels */\n sm: \"0.875rem\",\n\n /** 16px - Base body text */\n base: \"1rem\",\n\n /** 18px - Lead text, larger body */\n lg: \"1.125rem\",\n\n /** 20px - Small headings, subtitles */\n xl: \"1.25rem\",\n\n /** 24px - H4 equivalent */\n \"2xl\": \"1.5rem\",\n\n /** 30px - H3 equivalent */\n \"3xl\": \"1.875rem\",\n\n /** 36px - H2 equivalent */\n \"4xl\": \"2.25rem\",\n\n /** 48px - H1 equivalent */\n \"5xl\": \"3rem\",\n\n /** 60px - Display/Hero text */\n \"6xl\": \"3.75rem\",\n\n /** 72px - Large display */\n \"7xl\": \"4.5rem\",\n\n /** 96px - Extra large display */\n \"8xl\": \"6rem\",\n} as const;\n\n/**\n * Font size in pixels (for cases where rem isn't suitable)\n */\nexport const fontSizesPx = {\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 \"6xl\": 60,\n \"7xl\": 72,\n \"8xl\": 96,\n} as const;\n\n// ============================================\n// Line Heights\n// ============================================\n\n/**\n * Line height scale\n *\n * Using unitless values for better inheritance.\n */\nexport const lineHeights = {\n /** 1 - Single line, icons */\n none: 1,\n\n /** 1.25 - Tight, for large headings */\n tight: 1.25,\n\n /** 1.375 - Slightly snug */\n snug: 1.375,\n\n /** 1.5 - Normal body text */\n normal: 1.5,\n\n /** 1.625 - Relaxed reading */\n relaxed: 1.625,\n\n /** 1.75 - Loose, for small text */\n loose: 1.75,\n\n /** 2 - Double spaced */\n double: 2,\n} as const;\n\n// ============================================\n// Font Weights\n// ============================================\n\n/**\n * Font weight scale\n *\n * Inter and Public Sans support all these weights.\n * Variable fonts can use any value 100-900.\n */\nexport const fontWeights = {\n /** 100 - Thin (if available) */\n thin: 100,\n\n /** 200 - Extra light */\n extralight: 200,\n\n /** 300 - Light */\n light: 300,\n\n /** 400 - Regular/Normal */\n normal: 400,\n\n /** 500 - Medium */\n medium: 500,\n\n /** 600 - Semibold */\n semibold: 600,\n\n /** 700 - Bold */\n bold: 700,\n\n /** 800 - Extra bold */\n extrabold: 800,\n\n /** 900 - Black */\n black: 900,\n} as const;\n\n// ============================================\n// Letter Spacing (Tracking)\n// ============================================\n\n/**\n * Letter spacing scale\n *\n * Negative values for tight headlines, positive for small caps.\n */\nexport const letterSpacing = {\n /** -0.05em - Very tight, large display only */\n tighter: \"-0.05em\",\n\n /** -0.025em - Slightly tight, headings */\n tight: \"-0.025em\",\n\n /** 0 - Normal */\n normal: \"0\",\n\n /** 0.025em - Slightly wide */\n wide: \"0.025em\",\n\n /** 0.05em - Wide, for small caps */\n wider: \"0.05em\",\n\n /** 0.1em - Very wide, all caps */\n widest: \"0.1em\",\n} as const;\n\n// ============================================\n// Combined Type Styles\n// ============================================\n\n/**\n * Pre-defined typography presets\n *\n * These combine font-family, size, weight, and line-height\n * for common use cases.\n */\nexport const typeStyles = {\n /** Hero/Display - Large marketing headlines */\n display: {\n fontFamily: fontFamilies.heading,\n fontSize: fontSizes[\"6xl\"],\n fontWeight: fontWeights.bold,\n lineHeight: lineHeights.tight,\n letterSpacing: letterSpacing.tight,\n },\n\n /** H1 - Page titles */\n h1: {\n fontFamily: fontFamilies.heading,\n fontSize: fontSizes[\"5xl\"],\n fontWeight: fontWeights.bold,\n lineHeight: lineHeights.tight,\n letterSpacing: letterSpacing.tight,\n },\n\n /** H2 - Section titles */\n h2: {\n fontFamily: fontFamilies.heading,\n fontSize: fontSizes[\"4xl\"],\n fontWeight: fontWeights.bold,\n lineHeight: lineHeights.tight,\n letterSpacing: letterSpacing.tight,\n },\n\n /** H3 - Subsection titles */\n h3: {\n fontFamily: fontFamilies.heading,\n fontSize: fontSizes[\"3xl\"],\n fontWeight: fontWeights.semibold,\n lineHeight: lineHeights.snug,\n letterSpacing: letterSpacing.normal,\n },\n\n /** H4 - Card titles, small sections */\n h4: {\n fontFamily: fontFamilies.heading,\n fontSize: fontSizes[\"2xl\"],\n fontWeight: fontWeights.semibold,\n lineHeight: lineHeights.snug,\n letterSpacing: letterSpacing.normal,\n },\n\n /** H5 - Widget titles */\n h5: {\n fontFamily: fontFamilies.heading,\n fontSize: fontSizes.xl,\n fontWeight: fontWeights.semibold,\n lineHeight: lineHeights.normal,\n letterSpacing: letterSpacing.normal,\n },\n\n /** H6 - Smallest heading */\n h6: {\n fontFamily: fontFamilies.heading,\n fontSize: fontSizes.lg,\n fontWeight: fontWeights.semibold,\n lineHeight: lineHeights.normal,\n letterSpacing: letterSpacing.normal,\n },\n\n /** Body - Default paragraph text */\n body: {\n fontFamily: fontFamilies.primary,\n fontSize: fontSizes.base,\n fontWeight: fontWeights.normal,\n lineHeight: lineHeights.normal,\n letterSpacing: letterSpacing.normal,\n },\n\n /** Body Large - Lead paragraphs */\n bodyLarge: {\n fontFamily: fontFamilies.primary,\n fontSize: fontSizes.lg,\n fontWeight: fontWeights.normal,\n lineHeight: lineHeights.relaxed,\n letterSpacing: letterSpacing.normal,\n },\n\n /** Body Small - Secondary text */\n bodySmall: {\n fontFamily: fontFamilies.primary,\n fontSize: fontSizes.sm,\n fontWeight: fontWeights.normal,\n lineHeight: lineHeights.normal,\n letterSpacing: letterSpacing.normal,\n },\n\n /** Caption - Image captions, timestamps */\n caption: {\n fontFamily: fontFamilies.primary,\n fontSize: fontSizes.xs,\n fontWeight: fontWeights.normal,\n lineHeight: lineHeights.normal,\n letterSpacing: letterSpacing.wide,\n },\n\n /** Label - Form labels, UI labels */\n label: {\n fontFamily: fontFamilies.primary,\n fontSize: fontSizes.sm,\n fontWeight: fontWeights.medium,\n lineHeight: lineHeights.tight,\n letterSpacing: letterSpacing.normal,\n },\n\n /** Button - Button text */\n button: {\n fontFamily: fontFamilies.primary,\n fontSize: fontSizes.sm,\n fontWeight: fontWeights.medium,\n lineHeight: lineHeights.tight,\n letterSpacing: letterSpacing.wide,\n },\n\n /** Code - Inline code */\n code: {\n fontFamily: fontFamilies.mono,\n fontSize: fontSizes.sm,\n fontWeight: fontWeights.normal,\n lineHeight: lineHeights.normal,\n letterSpacing: letterSpacing.normal,\n },\n\n /** Code Block - Code blocks */\n codeBlock: {\n fontFamily: fontFamilies.mono,\n fontSize: fontSizes.sm,\n fontWeight: fontWeights.normal,\n lineHeight: lineHeights.relaxed,\n letterSpacing: letterSpacing.normal,\n },\n\n /** Overline - Small caps labels */\n overline: {\n fontFamily: fontFamilies.primary,\n fontSize: fontSizes.xs,\n fontWeight: fontWeights.semibold,\n lineHeight: lineHeights.normal,\n letterSpacing: letterSpacing.widest,\n textTransform: \"uppercase\" as const,\n },\n} as const;\n\nexport type TypeStyle = keyof typeof typeStyles;\n\n// ============================================\n// Responsive Typography\n// ============================================\n\n/**\n * Fluid typography clamp values\n *\n * Format: clamp(min, preferred, max)\n * Uses viewport width for smooth scaling.\n */\nexport const fluidFontSizes = {\n /** Display: 36px to 72px */\n display: \"clamp(2.25rem, 5vw + 1rem, 4.5rem)\",\n\n /** H1: 30px to 48px */\n h1: \"clamp(1.875rem, 4vw + 0.5rem, 3rem)\",\n\n /** H2: 24px to 36px */\n h2: \"clamp(1.5rem, 3vw + 0.5rem, 2.25rem)\",\n\n /** H3: 20px to 30px */\n h3: \"clamp(1.25rem, 2vw + 0.5rem, 1.875rem)\",\n\n /** Body: 14px to 18px */\n body: \"clamp(0.875rem, 1vw + 0.5rem, 1.125rem)\",\n} as const;\n\n// ============================================\n// Type Exports\n// ============================================\n\nexport type FontFamily = keyof typeof fontFamilies;\nexport type FontSize = keyof typeof fontSizes;\nexport type LineHeight = keyof typeof lineHeights;\nexport type FontWeight = keyof typeof fontWeights;\nexport type LetterSpacing = keyof typeof letterSpacing;\n"]}
|
|
1
|
+
{"version":3,"sources":["../../src/typography/fonts.ts","../../src/typography/tokens.ts"],"names":["fontFamilies"],"mappings":";AAqCO,IAAM,KAAA,GAAoC;AAAA,EAC/C,SAAA,EAAW;AAAA,IACT,MAAA,EAAQ,OAAA;AAAA,IACR,SAAS,CAAC,GAAA,EAAK,GAAA,EAAK,GAAA,EAAK,KAAK,GAAG,CAAA;AAAA,IACjC,MAAA,EAAQ,KAAA;AAAA,IACR,OAAA,EAAS,MAAA;AAAA,IACT,QAAA,EAAU,IAAA;AAAA,IACV,OAAA,EAAS,KAAA;AAAA,IACT,UAAA,EAAY;AAAA,GACd;AAAA,EAEA,SAAA,EAAW;AAAA,IACT,MAAA,EAAQ,YAAA;AAAA,IACR,OAAA,EAAS,CAAC,GAAA,EAAK,GAAA,EAAK,KAAK,GAAG,CAAA;AAAA,IAC5B,MAAA,EAAQ,KAAA;AAAA,IACR,OA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,CAAc;AAAA,GAC/B;AAAA;AAAA,EAGA,MAAA,EAAQ;AAAA,IACN,YAAY,YAAA,CAAa,OAAA;AAAA,IACzB,UAAU,SAAA,CAAU,EAAA;AAAA,IACpB,YAAY,WAAA,CAAY,MAAA;AAAA,IACxB,YAAY,WAAA,CAAY,KAAA;AAAA,IACxB,eAAe,aAAA,CAAc;AAAA,GAC/B;AAAA;AAAA,EAGA,IAAA,EAAM;AAAA,IACJ,YAAY,YAAA,CAAa,IAAA;AAAA,IACzB,UAAU,SAAA,CAAU,EAAA;AAAA,IACpB,YAAY,WAAA,CAAY,MAAA;AAAA,IACxB,YAAY,WAAA,CAAY,MAAA;AAAA,IACxB,eAAe,aAAA,CAAc;AAAA,GAC/B;AAAA;AAAA,EAGA,SAAA,EAAW;AAAA,IACT,YAAY,YAAA,CAAa,IAAA;AAAA,IACzB,UAAU,SAAA,CAAU,EAAA;AAAA,IACpB,YAAY,WAAA,CAAY,MAAA;AAAA,IACxB,YAAY,WAAA,CAAY,OAAA;AAAA,IACxB,eAAe,aAAA,CAAc;AAAA,GAC/B;AAAA;AAAA,EAGA,QAAA,EAAU;AAAA,IACR,YAAY,YAAA,CAAa,OAAA;AAAA,IACzB,UAAU,SAAA,CAAU,EAAA;AAAA,IACpB,YAAY,WAAA,CAAY,QAAA;AAAA,IACxB,YAAY,WAAA,CAAY,MAAA;AAAA,IACxB,eAAe,aAAA,CAAc,MAAA;AAAA,IAC7B,aAAA,EAAe;AAAA;AAEnB;AAcO,IAAM,cAAA,GAAiB;AAAA;AAAA,EAE5B,OAAA,EAAS,oCAAA;AAAA;AAAA,EAGT,EAAA,EAAI,qCAAA;AAAA;AAAA,EAGJ,EAAA,EAAI,sCAAA;AAAA;AAAA,EAGJ,EAAA,EAAI,wCAAA;AAAA;AAAA,EAGJ,IAAA,EAAM;AACR","file":"index.js","sourcesContent":["/**\n * Font Configuration and Loading Utilities\n *\n * Handles web font loading, preloading, and performance optimization.\n */\n\n// ============================================\n// Font Definitions\n// ============================================\n\n/**\n * Font configuration object\n */\nexport interface FontConfig {\n /** Font family name */\n family: string;\n /** Font weights to load */\n weights: number[];\n /** Include italic variants */\n italic?: boolean;\n /** Font display strategy */\n display?: \"auto\" | \"block\" | \"swap\" | \"fallback\" | \"optional\";\n /** Is this a variable font */\n variable?: boolean;\n /** Google Fonts URL parameter name */\n googleFontsParam?: string;\n /** Self-hosted font URL */\n selfHostUrl?: string;\n /** Font license */\n license: \"OFL\" | \"Apache-2.0\" | \"Ubuntu\" | \"MIT\" | \"Other\";\n /** Source URL for license */\n licenseUrl?: string;\n}\n\n/**\n * Registered fonts for the design system\n */\nexport const fonts: Record<string, FontConfig> = {\n geistSans: {\n family: \"Geist\",\n weights: [300, 400, 500, 600, 700],\n italic: false,\n display: \"swap\",\n variable: true,\n license: \"OFL\",\n licenseUrl: \"https://github.com/vercel/geist-font/blob/main/LICENSE.txt\",\n },\n\n geistMono: {\n family: \"Geist Mono\",\n weights: [400, 500, 600, 700],\n italic: false,\n display: \"swap\",\n variable: true,\n license: \"OFL\",\n licenseUrl: \"https://github.com/vercel/geist-font/blob/main/LICENSE.txt\",\n },\n\n inter: {\n family: \"Inter\",\n weights: [300, 400, 500, 600, 700],\n italic: false,\n display: \"swap\",\n variable: true,\n googleFontsParam: \"Inter:wght@300;400;500;600;700\",\n license: \"OFL\",\n licenseUrl: \"https://github.com/rsms/inter/blob/master/LICENSE.txt\",\n },\n\n publicSans: {\n family: \"Public Sans\",\n weights: [300, 400, 500, 600, 700],\n italic: true,\n display: \"swap\",\n variable: true,\n googleFontsParam: \"Public+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400;1,500\",\n license: \"OFL\",\n licenseUrl: \"https://github.com/uswds/public-sans/blob/develop/LICENSE.md\",\n },\n\n jetbrainsMono: {\n family: \"JetBrains Mono\",\n weights: [400, 500, 700],\n italic: false,\n display: \"swap\",\n variable: true,\n googleFontsParam: \"JetBrains+Mono:wght@400;500;700\",\n license: \"OFL\",\n licenseUrl: \"https://github.com/JetBrains/JetBrainsMono/blob/master/OFL.txt\",\n },\n\n sourceHanSans: {\n family: \"Noto Sans SC\",\n weights: [400, 500, 700],\n italic: false,\n display: \"swap\",\n variable: false,\n googleFontsParam: \"Noto+Sans+SC:wght@400;500;700\",\n license: \"OFL\",\n licenseUrl: \"https://github.com/adobe-fonts/source-han-sans/blob/master/LICENSE.txt\",\n },\n};\n\n// ============================================\n// Google Fonts URL Builder\n// ============================================\n\n/**\n * Generate Google Fonts URL for specified fonts\n */\nexport function getGoogleFontsUrl(fontKeys: (keyof typeof fonts)[]): string {\n const families = fontKeys\n .map((key) => fonts[key]?.googleFontsParam)\n .filter(Boolean)\n .join(\"&family=\");\n\n if (!families) return \"\";\n\n return `https://fonts.googleapis.com/css2?family=${families}&display=swap`;\n}\n\n/**\n * Default fonts to load\n */\nexport const defaultFonts: (keyof typeof fonts)[] = [\"geistSans\", \"geistMono\"];\n\n/**\n * Fonts for CJK (Chinese) support\n */\nexport const cjkFonts: (keyof typeof fonts)[] = [\"sourceHanSans\"];\n\n/**\n * All fonts including CJK\n */\nexport const allFonts: (keyof typeof fonts)[] = [...defaultFonts, ...cjkFonts];\n\n// ============================================\n// Font Loading Utilities\n// ============================================\n\n/**\n * Generate preload link elements for critical fonts\n */\nexport function getFontPreloadLinks(fontKeys: (keyof typeof fonts)[]): string[] {\n return fontKeys\n .map((key) => {\n const font = fonts[key];\n if (!font) return \"\";\n\n const url = getGoogleFontsUrl([key]);\n return `<link rel=\"preload\" href=\"${url}\" as=\"style\" crossorigin>`;\n })\n .filter(Boolean);\n}\n\n/**\n * Generate link element for Google Fonts\n */\nexport function getGoogleFontsLink(fontKeys: (keyof typeof fonts)[]): string {\n const url = getGoogleFontsUrl(fontKeys);\n if (!url) return \"\";\n\n return `<link rel=\"stylesheet\" href=\"${url}\">`;\n}\n\n/**\n * Check if fonts are loaded\n */\nexport async function areFontsLoaded(fontFamilies: string[]): Promise<boolean> {\n if (typeof document === \"undefined\") return false;\n\n try {\n await Promise.all(fontFamilies.map((family) => document.fonts.load(`16px \"${family}\"`)));\n return true;\n } catch {\n return false;\n }\n}\n\n/**\n * Wait for fonts to load with timeout\n */\nexport async function waitForFonts(fontFamilies: string[], timeout = 3000): Promise<boolean> {\n if (typeof document === \"undefined\") return false;\n\n return new Promise((resolve) => {\n const timer = setTimeout(() => resolve(false), timeout);\n\n areFontsLoaded(fontFamilies).then((loaded) => {\n clearTimeout(timer);\n resolve(loaded);\n });\n });\n}\n\n// ============================================\n// CSS-in-JS Helpers\n// ============================================\n\n/**\n * Font smoothing CSS for crisp text rendering\n */\nexport const fontSmoothing = {\n WebkitFontSmoothing: \"antialiased\",\n MozOsxFontSmoothing: \"grayscale\",\n textRendering: \"optimizeLegibility\",\n} as const;\n\n/**\n * Font feature settings for Geist\n */\nexport const fontFeatureSettings = {\n /** Enable common ligatures and contextual alternates */\n normal: '\"calt\" 1, \"liga\" 1',\n /** Enable tabular figures for aligned numbers */\n tabular: '\"tnum\" 1, \"calt\" 1',\n /** Enable case-sensitive forms */\n case: '\"case\" 1',\n /** Enable stylistic set 01 (alternate digits) */\n ss01: '\"ss01\" 1',\n /** Enable stylistic set 02 (alternate a) */\n ss02: '\"ss02\" 1',\n} as const;\n\n// ============================================\n// License Information\n// ============================================\n\n/**\n * Get license information for all used fonts\n */\nexport function getFontLicenses(): Array<{\n family: string;\n license: string;\n url?: string | undefined;\n}> {\n return Object.values(fonts).map((font) => ({\n family: font.family,\n license: font.license,\n url: font.licenseUrl,\n }));\n}\n\n/**\n * Font license compliance notice\n */\nexport const fontLicenseNotice = `\nFonts used in this project are licensed under open-source licenses:\n\n- Inter: SIL Open Font License 1.1\n- Public Sans: SIL Open Font License 1.1\n- Geist: SIL Open Font License 1.1\n- Geist Mono: SIL Open Font License 1.1\n- JetBrains Mono: SIL Open Font License 1.1\n- Noto Sans SC (Source Han Sans): SIL Open Font License 1.1\n\nAll fonts are free for commercial use. See individual license files for details.\n`.trim();\n","/**\n * Typography Tokens\n *\n * Centralized typography configuration for the entire design system.\n * All font-related values should come from here.\n */\n\n// ============================================\n// Font Families\n// ============================================\n\n/**\n * Primary font stack - Used for body text and UI.\n *\n * Token-first so next/font's generated face wins when available; the literal\n * family stack remains as a standalone fallback for docs/tests.\n */\nexport const FONT_FAMILY_PRIMARY =\n 'var(--font-sans, var(--font-geist-sans, \"Geist\", \"Noto Sans SC\", \"PingFang SC\", \"Microsoft YaHei\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif))';\n\n/**\n * Heading font stack - Used for titles and emphasis\n *\n * Geist Sans is the primary display typeface.\n */\nexport const FONT_FAMILY_HEADING =\n 'var(--font-heading, var(--font-geist-sans, \"Geist\", \"Noto Sans SC\", \"PingFang SC\", \"Microsoft YaHei\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif))';\n\n/**\n * Monospace font stack - Used for code and technical content\n */\nexport const FONT_FAMILY_MONO =\n 'var(--font-mono, var(--font-geist-mono, \"Geist Mono\", ui-monospace, SFMono-Regular, \"SF Mono\", Menlo, monospace))';\n\n/**\n * CJK (Chinese/Japanese/Korean) fallback stack\n *\n * Noto Sans SC is the primary Chinese font.\n * Provides consistent rendering for Chinese, Japanese, and Korean text.\n */\nexport const FONT_FAMILY_CJK =\n '\"Noto Sans SC\", \"Source Han Sans SC\", \"Source Han Sans\", \"Noto Sans CJK SC\", \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", sans-serif';\n\n/**\n * Complete font stacks with CJK fallback\n */\nexport const fontFamilies = {\n /** Primary UI and body text */\n primary: FONT_FAMILY_PRIMARY,\n\n /** Headings and titles */\n heading: FONT_FAMILY_HEADING,\n\n /** Code and monospace */\n mono: FONT_FAMILY_MONO,\n\n /** CJK-specific fallback */\n cjk: FONT_FAMILY_CJK,\n\n /** Primary with CJK fallback for multilingual content */\n primaryCJK: `${FONT_FAMILY_PRIMARY}, ${FONT_FAMILY_CJK}`,\n\n /** System font stack (fast fallback, no web fonts) */\n system: '-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif',\n} as const;\n\n// ============================================\n// Type Scale\n// ============================================\n\n/**\n * Font size scale using rem units for accessibility\n *\n * Base: 16px = 1rem\n * Each step follows a modular scale (~1.25 ratio)\n */\nexport const fontSizes = {\n /** 12px - Micro text, badges */\n xs: \"0.75rem\",\n\n /** 14px - Small text, captions, labels */\n sm: \"0.875rem\",\n\n /** 16px - Base body text */\n base: \"1rem\",\n\n /** 18px - Lead text, larger body */\n lg: \"1.125rem\",\n\n /** 20px - Small headings, subtitles */\n xl: \"1.25rem\",\n\n /** 24px - H4 equivalent */\n \"2xl\": \"1.5rem\",\n\n /** 30px - H3 equivalent */\n \"3xl\": \"1.875rem\",\n\n /** 36px - H2 equivalent */\n \"4xl\": \"2.25rem\",\n\n /** 48px - H1 equivalent */\n \"5xl\": \"3rem\",\n\n /** 60px - Display/Hero text */\n \"6xl\": \"3.75rem\",\n\n /** 72px - Large display */\n \"7xl\": \"4.5rem\",\n\n /** 96px - Extra large display */\n \"8xl\": \"6rem\",\n} as const;\n\n/**\n * Font size in pixels (for cases where rem isn't suitable)\n */\nexport const fontSizesPx = {\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 \"6xl\": 60,\n \"7xl\": 72,\n \"8xl\": 96,\n} as const;\n\n// ============================================\n// Line Heights\n// ============================================\n\n/**\n * Line height scale\n *\n * Using unitless values for better inheritance.\n */\nexport const lineHeights = {\n /** 1 - Single line, icons */\n none: 1,\n\n /** 1.25 - Tight, for large headings */\n tight: 1.25,\n\n /** 1.375 - Slightly snug */\n snug: 1.375,\n\n /** 1.5 - Normal body text */\n normal: 1.5,\n\n /** 1.625 - Relaxed reading */\n relaxed: 1.625,\n\n /** 1.75 - Loose, for small text */\n loose: 1.75,\n\n /** 2 - Double spaced */\n double: 2,\n} as const;\n\n// ============================================\n// Font Weights\n// ============================================\n\n/**\n * Font weight scale\n *\n * Inter and Public Sans support all these weights.\n * Variable fonts can use any value 100-900.\n */\nexport const fontWeights = {\n /** 100 - Thin (if available) */\n thin: 100,\n\n /** 200 - Extra light */\n extralight: 200,\n\n /** 300 - Light */\n light: 300,\n\n /** 400 - Regular/Normal */\n normal: 400,\n\n /** 500 - Medium */\n medium: 500,\n\n /** 600 - Semibold */\n semibold: 600,\n\n /** 700 - Bold */\n bold: 700,\n\n /** 800 - Extra bold */\n extrabold: 800,\n\n /** 900 - Black */\n black: 900,\n} as const;\n\n// ============================================\n// Letter Spacing (Tracking)\n// ============================================\n\n/**\n * Letter spacing scale\n *\n * Negative values for tight headlines, positive for small caps.\n */\nexport const letterSpacing = {\n /** -0.05em - Very tight, large display only */\n tighter: \"-0.05em\",\n\n /** -0.025em - Slightly tight, headings */\n tight: \"-0.025em\",\n\n /** 0 - Normal */\n normal: \"0\",\n\n /** 0.025em - Slightly wide */\n wide: \"0.025em\",\n\n /** 0.05em - Wide, for small caps */\n wider: \"0.05em\",\n\n /** 0.1em - Very wide, all caps */\n widest: \"0.1em\",\n} as const;\n\n// ============================================\n// Combined Type Styles\n// ============================================\n\n/**\n * Pre-defined typography presets\n *\n * These combine font-family, size, weight, and line-height\n * for common use cases.\n */\nexport const typeStyles = {\n /** Hero/Display - Large marketing headlines */\n display: {\n fontFamily: fontFamilies.heading,\n fontSize: fontSizes[\"6xl\"],\n fontWeight: fontWeights.bold,\n lineHeight: lineHeights.tight,\n letterSpacing: letterSpacing.tight,\n },\n\n /** H1 - Page titles */\n h1: {\n fontFamily: fontFamilies.heading,\n fontSize: fontSizes[\"5xl\"],\n fontWeight: fontWeights.bold,\n lineHeight: lineHeights.tight,\n letterSpacing: letterSpacing.tight,\n },\n\n /** H2 - Section titles */\n h2: {\n fontFamily: fontFamilies.heading,\n fontSize: fontSizes[\"4xl\"],\n fontWeight: fontWeights.bold,\n lineHeight: lineHeights.tight,\n letterSpacing: letterSpacing.tight,\n },\n\n /** H3 - Subsection titles */\n h3: {\n fontFamily: fontFamilies.heading,\n fontSize: fontSizes[\"3xl\"],\n fontWeight: fontWeights.semibold,\n lineHeight: lineHeights.snug,\n letterSpacing: letterSpacing.normal,\n },\n\n /** H4 - Card titles, small sections */\n h4: {\n fontFamily: fontFamilies.heading,\n fontSize: fontSizes[\"2xl\"],\n fontWeight: fontWeights.semibold,\n lineHeight: lineHeights.snug,\n letterSpacing: letterSpacing.normal,\n },\n\n /** H5 - Widget titles */\n h5: {\n fontFamily: fontFamilies.heading,\n fontSize: fontSizes.xl,\n fontWeight: fontWeights.semibold,\n lineHeight: lineHeights.normal,\n letterSpacing: letterSpacing.normal,\n },\n\n /** H6 - Smallest heading */\n h6: {\n fontFamily: fontFamilies.heading,\n fontSize: fontSizes.lg,\n fontWeight: fontWeights.semibold,\n lineHeight: lineHeights.normal,\n letterSpacing: letterSpacing.normal,\n },\n\n /** Body - Default paragraph text */\n body: {\n fontFamily: fontFamilies.primary,\n fontSize: fontSizes.base,\n fontWeight: fontWeights.normal,\n lineHeight: lineHeights.normal,\n letterSpacing: letterSpacing.normal,\n },\n\n /** Body Large - Lead paragraphs */\n bodyLarge: {\n fontFamily: fontFamilies.primary,\n fontSize: fontSizes.lg,\n fontWeight: fontWeights.normal,\n lineHeight: lineHeights.relaxed,\n letterSpacing: letterSpacing.normal,\n },\n\n /** Body Small - Secondary text */\n bodySmall: {\n fontFamily: fontFamilies.primary,\n fontSize: fontSizes.sm,\n fontWeight: fontWeights.normal,\n lineHeight: lineHeights.normal,\n letterSpacing: letterSpacing.normal,\n },\n\n /** Caption - Image captions, timestamps */\n caption: {\n fontFamily: fontFamilies.primary,\n fontSize: fontSizes.xs,\n fontWeight: fontWeights.normal,\n lineHeight: lineHeights.normal,\n letterSpacing: letterSpacing.wide,\n },\n\n /** Label - Form labels, UI labels */\n label: {\n fontFamily: fontFamilies.primary,\n fontSize: fontSizes.sm,\n fontWeight: fontWeights.medium,\n lineHeight: lineHeights.tight,\n letterSpacing: letterSpacing.normal,\n },\n\n /** Button - Button text */\n button: {\n fontFamily: fontFamilies.primary,\n fontSize: fontSizes.sm,\n fontWeight: fontWeights.medium,\n lineHeight: lineHeights.tight,\n letterSpacing: letterSpacing.wide,\n },\n\n /** Code - Inline code */\n code: {\n fontFamily: fontFamilies.mono,\n fontSize: fontSizes.sm,\n fontWeight: fontWeights.normal,\n lineHeight: lineHeights.normal,\n letterSpacing: letterSpacing.normal,\n },\n\n /** Code Block - Code blocks */\n codeBlock: {\n fontFamily: fontFamilies.mono,\n fontSize: fontSizes.sm,\n fontWeight: fontWeights.normal,\n lineHeight: lineHeights.relaxed,\n letterSpacing: letterSpacing.normal,\n },\n\n /** Overline - Small caps labels */\n overline: {\n fontFamily: fontFamilies.primary,\n fontSize: fontSizes.xs,\n fontWeight: fontWeights.semibold,\n lineHeight: lineHeights.normal,\n letterSpacing: letterSpacing.widest,\n textTransform: \"uppercase\" as const,\n },\n} as const;\n\nexport type TypeStyle = keyof typeof typeStyles;\n\n// ============================================\n// Responsive Typography\n// ============================================\n\n/**\n * Fluid typography clamp values\n *\n * Format: clamp(min, preferred, max)\n * Uses viewport width for smooth scaling.\n */\nexport const fluidFontSizes = {\n /** Display: 36px to 72px */\n display: \"clamp(2.25rem, 5vw + 1rem, 4.5rem)\",\n\n /** H1: 30px to 48px */\n h1: \"clamp(1.875rem, 4vw + 0.5rem, 3rem)\",\n\n /** H2: 24px to 36px */\n h2: \"clamp(1.5rem, 3vw + 0.5rem, 2.25rem)\",\n\n /** H3: 20px to 30px */\n h3: \"clamp(1.25rem, 2vw + 0.5rem, 1.875rem)\",\n\n /** Body: 14px to 18px */\n body: \"clamp(0.875rem, 1vw + 0.5rem, 1.125rem)\",\n} as const;\n\n// ============================================\n// Type Exports\n// ============================================\n\nexport type FontFamily = keyof typeof fontFamilies;\nexport type FontSize = keyof typeof fontSizes;\nexport type LineHeight = keyof typeof lineHeights;\nexport type FontWeight = keyof typeof fontWeights;\nexport type LetterSpacing = keyof typeof letterSpacing;\n"]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auth surface layout contracts — **server-safe pure strings**.
|
|
3
|
+
*
|
|
4
|
+
* Consumed by RSC AuthSplitLayout. Built as `utils/auth-surfaces` without a
|
|
5
|
+
* `"use client"` stamp (see packages/design/ui/tsup.config.ts SERVER_ONLY).
|
|
6
|
+
* Prefer `import { … } from "@nebutra/ui/utils/auth-surfaces"` in server
|
|
7
|
+
* layouts so a future utils barrel regression cannot client-proxy these again.
|
|
8
|
+
*
|
|
9
|
+
* ## Width (root cause)
|
|
10
|
+
* Do NOT use `w-full max-w-sm|xs` alone inside a flex/grid shell. Percentage
|
|
11
|
+
* width resolves against the full right pane (~64vw); if max-width is ever
|
|
12
|
+
* soft-failed (token miss, cascade, min-width:auto content), the column
|
|
13
|
+
* expands to the pane. Force the used width with min() + min-w-0 + shrink-0.
|
|
14
|
+
*
|
|
15
|
+
* 360px matches the Neon / Clerk login-card band (not page-form 24rem).
|
|
16
|
+
*
|
|
17
|
+
* ## No card chrome on split shell
|
|
18
|
+
* Do NOT wrap the credentials column in border / rounded-2xl / shadow card.
|
|
19
|
+
* Split already has a marketing panel + white form pane; a nested card is
|
|
20
|
+
* double framing. Fields sit on the pane like Neon console login.
|
|
21
|
+
*
|
|
22
|
+
* ## OAuth
|
|
23
|
+
* Always a 2-column compact grid — never full-width stacked bars, never
|
|
24
|
+
* "stack when only two providers". Buttons fill the *cell*, not the pane.
|
|
25
|
+
*/
|
|
26
|
+
declare const AUTH_FORM_COLUMN_CLASS = "relative mx-auto min-w-0 w-[min(100%,360px)] shrink-0";
|
|
27
|
+
declare const AUTH_PRIMARY_CTA_CLASS = "h-11 w-full";
|
|
28
|
+
/** Compact OAuth: always 2 columns, tight gap. */
|
|
29
|
+
declare const AUTH_OAUTH_GRID_CLASS = "grid grid-cols-2 gap-2";
|
|
30
|
+
/** Compact OAuth chip — fills grid cell only. */
|
|
31
|
+
declare const AUTH_OAUTH_BUTTON_CLASS = "h-9 w-full justify-center gap-2 border-border bg-background px-2.5 text-sm font-medium text-foreground shadow-none hover:bg-muted";
|
|
32
|
+
|
|
33
|
+
export { AUTH_FORM_COLUMN_CLASS, AUTH_OAUTH_BUTTON_CLASS, AUTH_OAUTH_GRID_CLASS, AUTH_PRIMARY_CTA_CLASS };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// src/utils/auth-surfaces.ts
|
|
2
|
+
var AUTH_FORM_COLUMN_CLASS = "relative mx-auto min-w-0 w-[min(100%,360px)] shrink-0";
|
|
3
|
+
var AUTH_PRIMARY_CTA_CLASS = "h-11 w-full";
|
|
4
|
+
var AUTH_OAUTH_GRID_CLASS = "grid grid-cols-2 gap-2";
|
|
5
|
+
var AUTH_OAUTH_BUTTON_CLASS = "h-9 w-full justify-center gap-2 border-border bg-background px-2.5 text-sm font-medium text-foreground shadow-none hover:bg-muted";
|
|
6
|
+
|
|
7
|
+
export { AUTH_FORM_COLUMN_CLASS, AUTH_OAUTH_BUTTON_CLASS, AUTH_OAUTH_GRID_CLASS, AUTH_PRIMARY_CTA_CLASS };
|
|
8
|
+
//# sourceMappingURL=auth-surfaces.js.map
|
|
9
|
+
//# sourceMappingURL=auth-surfaces.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/utils/auth-surfaces.ts"],"names":[],"mappings":";AAyBO,IAAM,sBAAA,GAAyB;AAE/B,IAAM,sBAAA,GAAyB;AAG/B,IAAM,qBAAA,GAAwB;AAG9B,IAAM,uBAAA,GACX","file":"auth-surfaces.js","sourcesContent":["/**\n * Auth surface layout contracts — **server-safe pure strings**.\n *\n * Consumed by RSC AuthSplitLayout. Built as `utils/auth-surfaces` without a\n * `\"use client\"` stamp (see packages/design/ui/tsup.config.ts SERVER_ONLY).\n * Prefer `import { … } from \"@nebutra/ui/utils/auth-surfaces\"` in server\n * layouts so a future utils barrel regression cannot client-proxy these again.\n *\n * ## Width (root cause)\n * Do NOT use `w-full max-w-sm|xs` alone inside a flex/grid shell. Percentage\n * width resolves against the full right pane (~64vw); if max-width is ever\n * soft-failed (token miss, cascade, min-width:auto content), the column\n * expands to the pane. Force the used width with min() + min-w-0 + shrink-0.\n *\n * 360px matches the Neon / Clerk login-card band (not page-form 24rem).\n *\n * ## No card chrome on split shell\n * Do NOT wrap the credentials column in border / rounded-2xl / shadow card.\n * Split already has a marketing panel + white form pane; a nested card is\n * double framing. Fields sit on the pane like Neon console login.\n *\n * ## OAuth\n * Always a 2-column compact grid — never full-width stacked bars, never\n * \"stack when only two providers\". Buttons fill the *cell*, not the pane.\n */\nexport const AUTH_FORM_COLUMN_CLASS = \"relative mx-auto min-w-0 w-[min(100%,360px)] shrink-0\";\n\nexport const AUTH_PRIMARY_CTA_CLASS = \"h-11 w-full\";\n\n/** Compact OAuth: always 2 columns, tight gap. */\nexport const AUTH_OAUTH_GRID_CLASS = \"grid grid-cols-2 gap-2\";\n\n/** Compact OAuth chip — fills grid cell only. */\nexport const AUTH_OAUTH_BUTTON_CLASS =\n \"h-9 w-full justify-center gap-2 border-border bg-background px-2.5 text-sm font-medium text-foreground shadow-none hover:bg-muted\";\n"]}
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { AUTH_FORM_COLUMN_CLASS, AUTH_OAUTH_BUTTON_CLASS, AUTH_OAUTH_GRID_CLASS, AUTH_PRIMARY_CTA_CLASS } from './auth-surfaces.js';
|
|
1
2
|
import { ClassValue } from 'clsx';
|
|
2
3
|
import * as React from 'react';
|
|
3
4
|
|
|
@@ -89,10 +90,7 @@ declare function getBrandTertiary(): string;
|
|
|
89
90
|
/**
|
|
90
91
|
* Utility Functions
|
|
91
92
|
*/
|
|
92
|
-
/**
|
|
93
|
-
* Merge class names — canonical implementation from ./cn.ts
|
|
94
|
-
* Uses twMerge(clsx(...)) to correctly resolve Tailwind class conflicts.
|
|
95
|
-
*/
|
|
93
|
+
/** Auth split-shell + primary CTA contracts (width + ink CTA pairing). */
|
|
96
94
|
|
|
97
95
|
/**
|
|
98
96
|
* Breakpoint values (matches Primer)
|
package/dist/utils/index.js
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
"use client";
|
|
2
1
|
import { clsx } from 'clsx';
|
|
3
2
|
import { twMerge } from 'tailwind-merge';
|
|
4
3
|
|
|
5
|
-
// src/utils/
|
|
4
|
+
// src/utils/auth-surfaces.ts
|
|
5
|
+
var AUTH_FORM_COLUMN_CLASS = "relative mx-auto min-w-0 w-[min(100%,360px)] shrink-0";
|
|
6
|
+
var AUTH_PRIMARY_CTA_CLASS = "h-11 w-full";
|
|
7
|
+
var AUTH_OAUTH_GRID_CLASS = "grid grid-cols-2 gap-2";
|
|
8
|
+
var AUTH_OAUTH_BUTTON_CLASS = "h-9 w-full justify-center gap-2 border-border bg-background px-2.5 text-sm font-medium text-foreground shadow-none hover:bg-muted";
|
|
6
9
|
function cn(...inputs) {
|
|
7
10
|
return twMerge(clsx(inputs));
|
|
8
11
|
}
|
|
@@ -93,6 +96,6 @@ function isBreakpointUp(breakpoint) {
|
|
|
93
96
|
return window.innerWidth >= BREAKPOINTS[breakpoint];
|
|
94
97
|
}
|
|
95
98
|
|
|
96
|
-
export { BRAND_FALLBACK, BREAKPOINTS, asPlainStyle, cn, getBrandAccent, getBrandMark, getBrandMarkForeground, getBrandPrimary, getBrandTertiary, getProductPrimary, isBreakpointUp, readCssVar, withHtmlProps };
|
|
99
|
+
export { AUTH_FORM_COLUMN_CLASS, AUTH_OAUTH_BUTTON_CLASS, AUTH_OAUTH_GRID_CLASS, AUTH_PRIMARY_CTA_CLASS, BRAND_FALLBACK, BREAKPOINTS, asPlainStyle, cn, getBrandAccent, getBrandMark, getBrandMarkForeground, getBrandPrimary, getBrandTertiary, getProductPrimary, isBreakpointUp, readCssVar, withHtmlProps };
|
|
97
100
|
//# sourceMappingURL=index.js.map
|
|
98
101
|
//# sourceMappingURL=index.js.map
|
package/dist/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/cn.ts","../../src/utils/primitive-props.ts","../../src/utils/brand-colors.ts","../../src/utils/index.ts"],"names":[],"mappings":";;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC1C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC7B;;;ACGO,SAAS,aAAa,KAAA,EAAqC;AAChE,EAAA,IAAI,SAAS,IAAA,IAAQ,OAAO,KAAA,KAAU,UAAA,SAAmB,EAAC;AAC1D,EAAA,OAAO,KAAA;AACT;AA0CO,SAAS,cAEd,SAAA,EAGA;AACA,EAAA,OAAO,SAAA;AACT;;;AC1CO,IAAM,cAAA,GAAiB;AAAA;AAAA,EAE5B,OAAA,EAAS,SAAA;AAAA,EACT,MAAA,EAAQ,SAAA;AAAA,EACR,QAAA,EAAU,SAAA;AAAA,EACV,WAAA,EAAa,SAAA;AAAA,EACb,QAAA,EAAU,SAAA;AAAA;AAAA,EAEV,cAAA,EAAgB,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAKhB,SAAA,EAAW,SAAA;AAAA,EACX,mBAAA,EAAqB;AACvB;AAKO,SAAS,UAAA,CAAW,MAAc,QAAA,EAA0B;AACjE,EAAA,IAAI,OAAO,MAAA,KAAW,WAAA,IAAe,OAAO,aAAa,WAAA,EAAa;AACpE,IAAA,OAAO,QAAA;AAAA,EACT;AACA,EAAA,MAAM,KAAA,GAAQ,iBAAiB,QAAA,CAAS,eAAe,EAAE,gBAAA,CAAiB,IAAI,EAAE,IAAA,EAAK;AACrF,EAAA,OAAO,KAAA,IAAS,QAAA;AAClB;AAGA,SAAS,UAAA,CAAW,OAAe,QAAA,EAA0B;AAC3D,EAAA,MAAM,CAAA,GAAI,KAAA,CAAM,IAAA,EAAK,IAAK,QAAA;AAC1B,EAAA,IACE,EAAE,UAAA,CAAW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AAS,cAAA,GAAyB;AACvC,EAAA,OAAO,aAAA,CAAc,gBAAA,EAAkB,cAAA,CAAe,MAAM,CAAA;AAC9D;AAEO,SAAS,gBAAA,GAA2B;AACzC,EAAA,OAAO,aAAA,CAAc,kBAAA,EAAoB,cAAA,CAAe,QAAQ,CAAA;AAClE;;;AChGO,IAAM,WAAA,GAAc;AAAA,EACzB,EAAA,EAAI,CAAA;AAAA,EACJ,EAAA,EAAI,GAAA;AAAA,EACJ,EAAA,EAAI,GAAA;AAAA,EACJ,EAAA,EAAI,IAAA;AAAA,EACJ,EAAA,EAAI;AACN;AAOO,SAAS,eAAe,UAAA,EAAiC;AAC9D,EAAA,IAAI,OAAO,MAAA,KAAW,WAAA,EAAa,OAAO,IAAA;AAC1C,EAAA,OAAO,MAAA,CAAO,UAAA,IAAc,WAAA,CAAY,UAAU,CAAA;AACpD","file":"index.js","sourcesContent":["import { type ClassValue, clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","import type * as React from \"react\";\n\n/**\n * Base UI (and some Radix peers) type `style` as CSSProperties | state-function.\n * Token merge helpers only need the plain object branch — drop functions so DTS\n * builds stay green across monorepo and standalone package mirrors.\n * Returns `{}` (never undefined) so spreads stay exactOptionalPropertyTypes-safe.\n */\nexport function asPlainStyle(style: unknown): React.CSSProperties {\n if (style == null || typeof style === \"function\") return {};\n return style as React.CSSProperties;\n}\n\nexport type PrimitiveProps<T> = React.PropsWithChildren<T & { className?: string | undefined }>;\n\nexport type PrimitiveComponent<TElement, TProps> = React.ForwardRefExoticComponent<\n PrimitiveProps<TProps> & React.RefAttributes<TElement>\n>;\n\n/**\n * Resolve the HTMLElement type for a given intrinsic element tag.\n */\ntype ElementForTag<E extends keyof React.JSX.IntrinsicElements> = E extends \"button\"\n ? HTMLButtonElement\n : E extends \"span\"\n ? HTMLSpanElement\n : E extends \"img\"\n ? HTMLImageElement\n : E extends \"label\"\n ? HTMLLabelElement\n : E extends \"input\"\n ? HTMLInputElement\n : E extends \"a\"\n ? HTMLAnchorElement\n : E extends \"p\"\n ? HTMLParagraphElement\n : E extends \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\"\n ? HTMLHeadingElement\n : HTMLElement;\n\n/**\n * Workaround for Radix UI types not resolving HTML element props (className,\n * children, etc.) with React 19 + exactOptionalPropertyTypes.\n *\n * The optional second type parameter `Extra` allows preserving Radix-specific\n * props (e.g. `asChild`, `align`, `sideOffset`) that are not standard HTML attrs.\n *\n * Usage:\n * const Header = withHtmlProps<\"h3\">(AccordionPrimitive.Header);\n * const Trigger = withHtmlProps<\"button\", { asChild?: boolean }>(DialogPrimitive.Trigger);\n * const Content = withHtmlProps<\"div\", { align?: string; sideOffset?: number }>(PopoverPrimitive.Content);\n */\n\nexport function withHtmlProps<E extends keyof React.JSX.IntrinsicElements, Extra = object>(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n Component: any,\n): React.ForwardRefExoticComponent<\n React.ComponentPropsWithoutRef<E> & Extra & React.RefAttributes<ElementForTag<E>>\n> {\n return Component;\n}\n","/**\n * Runtime color resolution for APIs that cannot consume CSS variables\n * (Canvas, WebGL, some animation libs).\n *\n * Layers (do not mix):\n * - Product action / CTA: getProductPrimary() → semantic `--primary` (roles.action)\n * - Brand mark / AI badge / logo tint: getBrandMark() → `--brand-mark` (roles.brand)\n * - VI lock (print / legal assets): getBrandPrimary() → `--brand-primary` hex\n *\n * Prefer CSS / Tailwind in components:\n * - `bg-primary` for CTAs\n * - `bg-brand-mark` / `text-brand-mark` for Logo/AI badge (see recipe.css)\n *\n * @see packages/design/ARCHITECTURE.md\n * @see packages/design/tokens/recipe.css\n */\n\n/** SSR fallbacks when document is unavailable */\nexport const BRAND_FALLBACK = {\n /** VI 云毓蓝 — identity only */\n primary: \"#0033FE\",\n accent: \"#0BF1C3\",\n tertiary: \"#5c7cfa\",\n primaryDark: \"#002ad4\",\n backDark: \"#000830\",\n /** Soft product action (matches themes/light --primary ≈ #254bfa) */\n productPrimary: \"#254bfa\",\n /**\n * Brand mark fallback (= product action when factory brand has action≡brand).\n * Skins may diverge (e.g. Linear purple action + indigo mark).\n */\n brandMark: \"#254bfa\",\n brandMarkForeground: \"#ffffff\",\n} as const;\n\n/**\n * Read a CSS variable from :root and return its trimmed value.\n */\nexport function readCssVar(name: string, fallback: string): string {\n if (typeof window === \"undefined\" || typeof document === \"undefined\") {\n return fallback;\n }\n const value = getComputedStyle(document.documentElement).getPropertyValue(name).trim();\n return value || fallback;\n}\n\n/** Turn HSL channel triple or full color into a CSS color string. */\nfunction asCssColor(value: string, fallback: string): string {\n const v = value.trim() || fallback;\n if (\n v.startsWith(\"#\") ||\n v.startsWith(\"rgb\") ||\n v.startsWith(\"hsl\") ||\n v.startsWith(\"oklch\") ||\n v.startsWith(\"color(\")\n ) {\n return v;\n }\n // shadcn-style \"228 85% 56%\"\n return `hsl(${v})`;\n}\n\n/**\n * Product action color — follows the active skin (`--primary`).\n * Use for shaders/canvas that must match buttons/CTAs.\n */\nexport function getProductPrimary(): string {\n return asCssColor(readCssVar(\"--primary\", \"228 85% 56%\"), BRAND_FALLBACK.productPrimary);\n}\n\n/** VI lock color — legal / print lockups only (not product chrome). */\nexport function getBrandPrimary(): string {\n return asCssVarColor(\"--brand-primary\", BRAND_FALLBACK.primary);\n}\n\n/**\n * Product brand-mark (roles.brand) — Logo tile, AI badge, identity chips.\n * Never use for default CTA (that is getProductPrimary / --primary).\n */\nexport function getBrandMark(): string {\n const raw = readCssVar(\"--brand-mark\", \"228 85% 56%\");\n // Factory recipe defaults `--brand-mark: var(--primary)` — resolve to action color.\n if (/var\\(\\s*--primary\\s*\\)/u.test(raw)) {\n return getProductPrimary();\n }\n return asCssColor(raw, BRAND_FALLBACK.brandMark);\n}\n\n/** Foreground on brand-mark surfaces. */\nexport function getBrandMarkForeground(): string {\n const raw = readCssVar(\"--brand-mark-foreground\", \"0 0% 100%\");\n if (/var\\(\\s*--primary-foreground\\s*\\)/u.test(raw)) {\n return asCssColor(\n readCssVar(\"--primary-foreground\", \"0 0% 100%\"),\n BRAND_FALLBACK.brandMarkForeground,\n );\n }\n return asCssColor(raw, BRAND_FALLBACK.brandMarkForeground);\n}\n\nfunction asCssVarColor(name: string, fallback: string): string {\n return asCssColor(readCssVar(name, fallback), fallback);\n}\n\nexport function getBrandAccent(): string {\n return asCssVarColor(\"--brand-accent\", BRAND_FALLBACK.accent);\n}\n\nexport function getBrandTertiary(): string {\n return asCssVarColor(\"--brand-tertiary\", BRAND_FALLBACK.tertiary);\n}\n","/**\n * Utility Functions\n */\n\n/**\n * Merge class names — canonical implementation from ./cn.ts\n * Uses twMerge(clsx(...)) to correctly resolve Tailwind class conflicts.\n */\nexport { cn } from \"./cn\";\nexport { asPlainStyle, withHtmlProps, type PrimitiveProps, type PrimitiveComponent } from \"./primitive-props\";\n\n/**\n * Breakpoint values (matches Primer)\n */\nexport const BREAKPOINTS = {\n xs: 0,\n sm: 544,\n md: 768,\n lg: 1012,\n xl: 1280,\n} as const;\n\nexport type Breakpoint = keyof typeof BREAKPOINTS;\n\n/**\n * Check if viewport is at or above breakpoint\n */\nexport function isBreakpointUp(breakpoint: Breakpoint): boolean {\n if (typeof window === \"undefined\") return true;\n return window.innerWidth >= BREAKPOINTS[breakpoint];\n}\n\nexport {\n BRAND_FALLBACK,\n getBrandAccent,\n getBrandMark,\n getBrandMarkForeground,\n getBrandPrimary,\n getBrandTertiary,\n getProductPrimary,\n readCssVar,\n} from \"./brand-colors\";\n"]}
|
|
1
|
+
{"version":3,"sources":["../../src/utils/auth-surfaces.ts","../../src/utils/cn.ts","../../src/utils/primitive-props.ts","../../src/utils/brand-colors.ts","../../src/utils/index.ts"],"names":[],"mappings":";;;;AAyBO,IAAM,sBAAA,GAAyB;AAE/B,IAAM,sBAAA,GAAyB;AAG/B,IAAM,qBAAA,GAAwB;AAG9B,IAAM,uBAAA,GACX;AC/BK,SAAS,MAAM,MA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AM,WAAA,GAAc;AAAA,EACzB,EAAA,EAAI,CAAA;AAAA,EACJ,EAAA,EAAI,GAAA;AAAA,EACJ,EAAA,EAAI,GAAA;AAAA,EACJ,EAAA,EAAI,IAAA;AAAA,EACJ,EAAA,EAAI;AACN;AAOO,SAAS,eAAe,UAAA,EAAiC;AAC9D,EAAA,IAAI,OAAO,MAAA,KAAW,WAAA,EAAa,OAAO,IAAA;AAC1C,EAAA,OAAO,MAAA,CAAO,UAAA,IAAc,WAAA,CAAY,UAAU,CAAA;AACpD","file":"index.js","sourcesContent":["/**\n * Auth surface layout contracts — **server-safe pure strings**.\n *\n * Consumed by RSC AuthSplitLayout. Built as `utils/auth-surfaces` without a\n * `\"use client\"` stamp (see packages/design/ui/tsup.config.ts SERVER_ONLY).\n * Prefer `import { … } from \"@nebutra/ui/utils/auth-surfaces\"` in server\n * layouts so a future utils barrel regression cannot client-proxy these again.\n *\n * ## Width (root cause)\n * Do NOT use `w-full max-w-sm|xs` alone inside a flex/grid shell. Percentage\n * width resolves against the full right pane (~64vw); if max-width is ever\n * soft-failed (token miss, cascade, min-width:auto content), the column\n * expands to the pane. Force the used width with min() + min-w-0 + shrink-0.\n *\n * 360px matches the Neon / Clerk login-card band (not page-form 24rem).\n *\n * ## No card chrome on split shell\n * Do NOT wrap the credentials column in border / rounded-2xl / shadow card.\n * Split already has a marketing panel + white form pane; a nested card is\n * double framing. Fields sit on the pane like Neon console login.\n *\n * ## OAuth\n * Always a 2-column compact grid — never full-width stacked bars, never\n * \"stack when only two providers\". Buttons fill the *cell*, not the pane.\n */\nexport const AUTH_FORM_COLUMN_CLASS = \"relative mx-auto min-w-0 w-[min(100%,360px)] shrink-0\";\n\nexport const AUTH_PRIMARY_CTA_CLASS = \"h-11 w-full\";\n\n/** Compact OAuth: always 2 columns, tight gap. */\nexport const AUTH_OAUTH_GRID_CLASS = \"grid grid-cols-2 gap-2\";\n\n/** Compact OAuth chip — fills grid cell only. */\nexport const AUTH_OAUTH_BUTTON_CLASS =\n \"h-9 w-full justify-center gap-2 border-border bg-background px-2.5 text-sm font-medium text-foreground shadow-none hover:bg-muted\";\n","import { type ClassValue, clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","import type * as React from \"react\";\n\n/**\n * Base UI (and some Radix peers) type `style` as CSSProperties | state-function.\n * Token merge helpers only need the plain object branch — drop functions so DTS\n * builds stay green across monorepo and standalone package mirrors.\n * Returns `{}` (never undefined) so spreads stay exactOptionalPropertyTypes-safe.\n */\nexport function asPlainStyle(style: unknown): React.CSSProperties {\n if (style == null || typeof style === \"function\") return {};\n return style as React.CSSProperties;\n}\n\nexport type PrimitiveProps<T> = React.PropsWithChildren<T & { className?: string | undefined }>;\n\nexport type PrimitiveComponent<TElement, TProps> = React.ForwardRefExoticComponent<\n PrimitiveProps<TProps> & React.RefAttributes<TElement>\n>;\n\n/**\n * Resolve the HTMLElement type for a given intrinsic element tag.\n */\ntype ElementForTag<E extends keyof React.JSX.IntrinsicElements> = E extends \"button\"\n ? HTMLButtonElement\n : E extends \"span\"\n ? HTMLSpanElement\n : E extends \"img\"\n ? HTMLImageElement\n : E extends \"label\"\n ? HTMLLabelElement\n : E extends \"input\"\n ? HTMLInputElement\n : E extends \"a\"\n ? HTMLAnchorElement\n : E extends \"p\"\n ? HTMLParagraphElement\n : E extends \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\"\n ? HTMLHeadingElement\n : HTMLElement;\n\n/**\n * Workaround for Radix UI types not resolving HTML element props (className,\n * children, etc.) with React 19 + exactOptionalPropertyTypes.\n *\n * The optional second type parameter `Extra` allows preserving Radix-specific\n * props (e.g. `asChild`, `align`, `sideOffset`) that are not standard HTML attrs.\n *\n * Usage:\n * const Header = withHtmlProps<\"h3\">(AccordionPrimitive.Header);\n * const Trigger = withHtmlProps<\"button\", { asChild?: boolean }>(DialogPrimitive.Trigger);\n * const Content = withHtmlProps<\"div\", { align?: string; sideOffset?: number }>(PopoverPrimitive.Content);\n */\n\nexport function withHtmlProps<E extends keyof React.JSX.IntrinsicElements, Extra = object>(\n // biome-ignore lint/suspicious/noExplicitAny: polymorphic render — the element type is only known at the call site, and naming it here makes the emitted declaration a union of every intrinsic tag\n Component: any,\n): React.ForwardRefExoticComponent<\n React.ComponentPropsWithoutRef<E> & Extra & React.RefAttributes<ElementForTag<E>>\n> {\n return Component;\n}\n","/**\n * Runtime color resolution for APIs that cannot consume CSS variables\n * (Canvas, WebGL, some animation libs).\n *\n * Layers (do not mix):\n * - Product action / CTA: getProductPrimary() → semantic `--primary` (roles.action)\n * - Brand mark / AI badge / logo tint: getBrandMark() → `--brand-mark` (roles.brand)\n * - VI lock (print / legal assets): getBrandPrimary() → `--brand-primary` hex\n *\n * Prefer CSS / Tailwind in components:\n * - `bg-primary` for CTAs\n * - `bg-brand-mark` / `text-brand-mark` for Logo/AI badge (see recipe.css)\n *\n * @see packages/design/ARCHITECTURE.md\n * @see packages/design/tokens/recipe.css\n */\n\n/** SSR fallbacks when document is unavailable */\nexport const BRAND_FALLBACK = {\n /** VI 云毓蓝 — identity only */\n primary: \"#0033FE\",\n accent: \"#0BF1C3\",\n tertiary: \"#5c7cfa\",\n primaryDark: \"#002ad4\",\n backDark: \"#000830\",\n /** Soft product action (matches themes/light --primary ≈ #254bfa) */\n productPrimary: \"#254bfa\",\n /**\n * Brand mark fallback (= product action when factory brand has action≡brand).\n * Skins may diverge (e.g. Linear purple action + indigo mark).\n */\n brandMark: \"#254bfa\",\n brandMarkForeground: \"#ffffff\",\n} as const;\n\n/**\n * Read a CSS variable from :root and return its trimmed value.\n */\nexport function readCssVar(name: string, fallback: string): string {\n if (typeof window === \"undefined\" || typeof document === \"undefined\") {\n return fallback;\n }\n const value = getComputedStyle(document.documentElement).getPropertyValue(name).trim();\n return value || fallback;\n}\n\n/** Turn HSL channel triple or full color into a CSS color string. */\nfunction asCssColor(value: string, fallback: string): string {\n const v = value.trim() || fallback;\n if (\n v.startsWith(\"#\") ||\n v.startsWith(\"rgb\") ||\n v.startsWith(\"hsl\") ||\n v.startsWith(\"oklch\") ||\n v.startsWith(\"color(\")\n ) {\n return v;\n }\n // shadcn-style \"228 85% 56%\"\n return `hsl(${v})`;\n}\n\n/**\n * Product action color — follows the active skin (`--primary`).\n * Use for shaders/canvas that must match buttons/CTAs.\n */\nexport function getProductPrimary(): string {\n return asCssColor(readCssVar(\"--primary\", \"228 85% 56%\"), BRAND_FALLBACK.productPrimary);\n}\n\n/** VI lock color — legal / print lockups only (not product chrome). */\nexport function getBrandPrimary(): string {\n return asCssVarColor(\"--brand-primary\", BRAND_FALLBACK.primary);\n}\n\n/**\n * Product brand-mark (roles.brand) — Logo tile, AI badge, identity chips.\n * Never use for default CTA (that is getProductPrimary / --primary).\n */\nexport function getBrandMark(): string {\n const raw = readCssVar(\"--brand-mark\", \"228 85% 56%\");\n // Factory recipe defaults `--brand-mark: var(--primary)` — resolve to action color.\n if (/var\\(\\s*--primary\\s*\\)/u.test(raw)) {\n return getProductPrimary();\n }\n return asCssColor(raw, BRAND_FALLBACK.brandMark);\n}\n\n/** Foreground on brand-mark surfaces. */\nexport function getBrandMarkForeground(): string {\n const raw = readCssVar(\"--brand-mark-foreground\", \"0 0% 100%\");\n if (/var\\(\\s*--primary-foreground\\s*\\)/u.test(raw)) {\n return asCssColor(\n readCssVar(\"--primary-foreground\", \"0 0% 100%\"),\n BRAND_FALLBACK.brandMarkForeground,\n );\n }\n return asCssColor(raw, BRAND_FALLBACK.brandMarkForeground);\n}\n\nfunction asCssVarColor(name: string, fallback: string): string {\n return asCssColor(readCssVar(name, fallback), fallback);\n}\n\nexport function getBrandAccent(): string {\n return asCssVarColor(\"--brand-accent\", BRAND_FALLBACK.accent);\n}\n\nexport function getBrandTertiary(): string {\n return asCssVarColor(\"--brand-tertiary\", BRAND_FALLBACK.tertiary);\n}\n","/**\n * Utility Functions\n */\n\n/** Auth split-shell + primary CTA contracts (width + ink CTA pairing). */\nexport {\n AUTH_FORM_COLUMN_CLASS,\n AUTH_OAUTH_BUTTON_CLASS,\n AUTH_OAUTH_GRID_CLASS,\n AUTH_PRIMARY_CTA_CLASS,\n} from \"./auth-surfaces\";\n/**\n * Merge class names — canonical implementation from ./cn.ts\n * Uses twMerge(clsx(...)) to correctly resolve Tailwind class conflicts.\n */\nexport { cn } from \"./cn\";\nexport {\n asPlainStyle,\n type PrimitiveComponent,\n type PrimitiveProps,\n withHtmlProps,\n} from \"./primitive-props\";\n\n/**\n * Breakpoint values (matches Primer)\n */\nexport const BREAKPOINTS = {\n xs: 0,\n sm: 544,\n md: 768,\n lg: 1012,\n xl: 1280,\n} as const;\n\nexport type Breakpoint = keyof typeof BREAKPOINTS;\n\n/**\n * Check if viewport is at or above breakpoint\n */\nexport function isBreakpointUp(breakpoint: Breakpoint): boolean {\n if (typeof window === \"undefined\") return true;\n return window.innerWidth >= BREAKPOINTS[breakpoint];\n}\n\nexport {\n BRAND_FALLBACK,\n getBrandAccent,\n getBrandMark,\n getBrandMarkForeground,\n getBrandPrimary,\n getBrandTertiary,\n getProductPrimary,\n readCssVar,\n} from \"./brand-colors\";\n"]}
|
package/package.json
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nebutra/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Nebutra design-system UI primitives, patterns, layouts, and token-integrated components",
|
|
5
5
|
"private": false,
|
|
6
|
+
"nebutra": {
|
|
7
|
+
"status": "foundation",
|
|
8
|
+
"graph": "core",
|
|
9
|
+
"productionReady": false
|
|
10
|
+
},
|
|
6
11
|
"license": "MIT",
|
|
7
12
|
"type": "module",
|
|
8
13
|
"sideEffects": [
|
|
@@ -17,6 +22,10 @@
|
|
|
17
22
|
"types": "./dist/components/index.d.ts",
|
|
18
23
|
"import": "./dist/components/index.js"
|
|
19
24
|
},
|
|
25
|
+
"./chat": {
|
|
26
|
+
"types": "./dist/chat/index.d.ts",
|
|
27
|
+
"import": "./dist/chat/index.js"
|
|
28
|
+
},
|
|
20
29
|
"./layout": {
|
|
21
30
|
"types": "./dist/layout/index.d.ts",
|
|
22
31
|
"import": "./dist/layout/index.js"
|
|
@@ -37,6 +46,10 @@
|
|
|
37
46
|
"types": "./dist/theme/index.d.ts",
|
|
38
47
|
"import": "./dist/theme/index.js"
|
|
39
48
|
},
|
|
49
|
+
"./editorial": {
|
|
50
|
+
"types": "./dist/editorial/index.d.ts",
|
|
51
|
+
"import": "./dist/editorial/index.js"
|
|
52
|
+
},
|
|
40
53
|
"./primitives": {
|
|
41
54
|
"types": "./dist/primitives/index.d.ts",
|
|
42
55
|
"import": "./dist/primitives/index.js"
|
|
@@ -77,6 +90,10 @@
|
|
|
77
90
|
"types": "./dist/utils/index.d.ts",
|
|
78
91
|
"import": "./dist/utils/index.js"
|
|
79
92
|
},
|
|
93
|
+
"./utils/auth-surfaces": {
|
|
94
|
+
"types": "./dist/utils/auth-surfaces.d.ts",
|
|
95
|
+
"import": "./dist/utils/auth-surfaces.js"
|
|
96
|
+
},
|
|
80
97
|
"./tailwind.preset": {
|
|
81
98
|
"types": "./dist/tailwind.preset.d.ts",
|
|
82
99
|
"import": "./dist/tailwind.preset.js"
|
|
@@ -117,6 +134,7 @@
|
|
|
117
134
|
"piri": "^1.3.2",
|
|
118
135
|
"react": "^19.2.4",
|
|
119
136
|
"react-ascii-text": "*",
|
|
137
|
+
"react-day-picker": "^10.0.1",
|
|
120
138
|
"react-dom": "^19.2.4",
|
|
121
139
|
"react-hook-form": "^7.71.2",
|
|
122
140
|
"react-markdown": "^10.1.0",
|
|
@@ -132,10 +150,10 @@
|
|
|
132
150
|
"tailwind-merge": "^3.5.0",
|
|
133
151
|
"usehooks-ts": "^3.1.1",
|
|
134
152
|
"vaul": "^1.1.2",
|
|
135
|
-
"@nebutra/
|
|
136
|
-
"@nebutra/
|
|
137
|
-
"@nebutra/
|
|
138
|
-
"@nebutra/
|
|
153
|
+
"@nebutra/brand": "2.0.0",
|
|
154
|
+
"@nebutra/graph-model": "2.0.0",
|
|
155
|
+
"@nebutra/icons": "2.0.0",
|
|
156
|
+
"@nebutra/tokens": "2.0.0"
|
|
139
157
|
},
|
|
140
158
|
"peerDependencies": {
|
|
141
159
|
"@clerk/nextjs": ">=5.0.0",
|
|
@@ -171,6 +189,7 @@
|
|
|
171
189
|
"@types/three": "^0.183.1",
|
|
172
190
|
"@vitejs/plugin-react-swc": "^4.3.1",
|
|
173
191
|
"driver.js": "^1.4.0",
|
|
192
|
+
"jsdom": "^29.1.1",
|
|
174
193
|
"next": "^16.2.6",
|
|
175
194
|
"next-intl": "^4.12.0",
|
|
176
195
|
"storybook": "^8.6.17",
|
|
@@ -178,8 +197,7 @@
|
|
|
178
197
|
"tsx": "^4.21.0",
|
|
179
198
|
"typescript": "^5.9.3",
|
|
180
199
|
"vitest": "^4.0.18",
|
|
181
|
-
"
|
|
182
|
-
"@nebutra/design-tokens": "0.1.2"
|
|
200
|
+
"@nebutra/design-tokens": "2.0.0"
|
|
183
201
|
},
|
|
184
202
|
"homepage": "https://github.com/Nebutra/Nebutra-Sailor/tree/main/packages/design/ui#readme",
|
|
185
203
|
"repository": {
|
package/src/typography/fonts.css
CHANGED
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
* Font loading (Next.js apps): each app's layout.tsx applies the loader classes
|
|
7
7
|
* GeistSans → --font-geist-sans (variable, 100–900) Latin + numerals
|
|
8
8
|
* GeistMono → --font-geist-mono (variable, 100–900) code
|
|
9
|
-
* cjkFontClassName → --font-
|
|
9
|
+
* cjkFontClassName → --font-noto-sans-sc (@nebutra/fonts/next/cjk) CJK
|
|
10
10
|
* and the token stacks reference those variables in that order, so Geist keeps
|
|
11
|
-
* Latin and only CJK falls through to
|
|
11
|
+
* Latin and only CJK falls through to Noto Sans SC.
|
|
12
12
|
*
|
|
13
13
|
* IMPORT ORDER MATTERS: this file must come AFTER @nebutra/tokens/styles.css
|
|
14
14
|
* (see ../styles/preset.css). It used to re-declare --font-sans / --font-heading /
|