@nebutra/ui 0.1.0 → 0.2.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/components/index.d.ts +380 -0
- package/dist/components/index.js +2398 -0
- package/dist/components/index.js.map +1 -0
- package/dist/hooks/index.d.ts +106 -0
- package/dist/hooks/index.js +182 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/icons/index.d.ts +3 -0
- package/dist/icons/index.js +5 -0
- package/dist/icons/index.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +31 -0
- package/dist/index.js.map +1 -0
- package/dist/layout/index.d.ts +296 -0
- package/dist/layout/index.js +1303 -0
- package/dist/layout/index.js.map +1 -0
- package/dist/layouts/index.d.ts +161 -0
- package/dist/layouts/index.js +611 -0
- package/dist/layouts/index.js.map +1 -0
- package/dist/patterns/index.d.ts +363 -0
- package/dist/patterns/index.js +3004 -0
- package/dist/patterns/index.js.map +1 -0
- package/dist/primitives/index.d.ts +9588 -0
- package/dist/primitives/index.js +26779 -0
- package/dist/primitives/index.js.map +1 -0
- package/dist/styles/brand-override.css +61 -0
- package/dist/tailwind.preset.d.ts +251 -0
- package/dist/tailwind.preset.js +273 -0
- package/dist/tailwind.preset.js.map +1 -0
- package/dist/theme/index.d.ts +150 -0
- package/dist/theme/index.js +28 -0
- package/dist/theme/index.js.map +1 -0
- package/dist/typography/fonts.css +110 -0
- package/dist/typography/index.d.ts +425 -0
- package/dist/typography/index.js +374 -0
- package/dist/typography/index.js.map +1 -0
- package/dist/utils/index.d.ts +61 -0
- package/dist/utils/index.js +55 -0
- package/dist/utils/index.js.map +1 -0
- package/package.json +16 -6
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import '@lobehub/icons';
|
|
4
|
+
import '@nebutra/icons';
|
|
5
|
+
|
|
6
|
+
interface NebutraThemeProviderProps {
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
/** Force dark/light mode, or use system preference */
|
|
9
|
+
appearance?: "dark" | "light" | "auto";
|
|
10
|
+
/** Default theme mode when appearance is "auto" */
|
|
11
|
+
defaultAppearance?: "dark" | "light";
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Theme provider that wraps Lobe UI with Nebutra design tokens
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```tsx
|
|
18
|
+
* <NebutraThemeProvider appearance="auto">
|
|
19
|
+
* <App />
|
|
20
|
+
* </NebutraThemeProvider>
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
declare function NebutraThemeProvider({ children, appearance, defaultAppearance, }: NebutraThemeProviderProps): react_jsx_runtime.JSX.Element;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* @internal — Lobe UI Ant Design Token Bridge
|
|
27
|
+
*
|
|
28
|
+
* These hex color values exist ONLY to configure Lobe UI's `customTheme` prop,
|
|
29
|
+
* which requires JS-level token values (not CSS variables).
|
|
30
|
+
*
|
|
31
|
+
* ⚠️ DO NOT import these tokens in app code.
|
|
32
|
+
* App code should use CSS variables from `@nebutra/tokens/styles.css`
|
|
33
|
+
* (e.g., `var(--color-primary)`, `bg-primary`, `text-neutral-12`)
|
|
34
|
+
*
|
|
35
|
+
* Token hierarchy:
|
|
36
|
+
* @nebutra/brand → brand primitives (source data)
|
|
37
|
+
* @nebutra/tokens → runtime CSS variables (light/dark, 12-step scales)
|
|
38
|
+
* @nebutra/theme → multi-theme presets (oklch, 6 variants)
|
|
39
|
+
* @nebutra/ui/theme → THIS FILE: Lobe UI bridge (internal only)
|
|
40
|
+
*/
|
|
41
|
+
declare const colors: {
|
|
42
|
+
readonly primary: {
|
|
43
|
+
readonly 50: "#EFF6FF";
|
|
44
|
+
readonly 100: "#DBEAFE";
|
|
45
|
+
readonly 200: "#BFDBFE";
|
|
46
|
+
readonly 300: "#93C5FD";
|
|
47
|
+
readonly 400: "#60A5FA";
|
|
48
|
+
readonly 500: "#3B82F6";
|
|
49
|
+
readonly 600: "#2563EB";
|
|
50
|
+
readonly 700: "#1D4ED8";
|
|
51
|
+
readonly 800: "#1E40AF";
|
|
52
|
+
readonly 900: "#1E3A8A";
|
|
53
|
+
readonly 950: "#172554";
|
|
54
|
+
};
|
|
55
|
+
readonly secondary: {
|
|
56
|
+
readonly 50: "#FAF5FF";
|
|
57
|
+
readonly 100: "#F3E8FF";
|
|
58
|
+
readonly 200: "#E9D5FF";
|
|
59
|
+
readonly 300: "#D8B4FE";
|
|
60
|
+
readonly 400: "#C084FC";
|
|
61
|
+
readonly 500: "#A855F7";
|
|
62
|
+
readonly 600: "#9333EA";
|
|
63
|
+
readonly 700: "#7C3AED";
|
|
64
|
+
readonly 800: "#6B21A8";
|
|
65
|
+
readonly 900: "#581C87";
|
|
66
|
+
readonly 950: "#3B0764";
|
|
67
|
+
};
|
|
68
|
+
readonly neutral: {
|
|
69
|
+
readonly 50: "#F8FAFC";
|
|
70
|
+
readonly 100: "#F1F5F9";
|
|
71
|
+
readonly 200: "#E2E8F0";
|
|
72
|
+
readonly 300: "#CBD5E1";
|
|
73
|
+
readonly 400: "#94A3B8";
|
|
74
|
+
readonly 500: "#64748B";
|
|
75
|
+
readonly 600: "#475569";
|
|
76
|
+
readonly 700: "#334155";
|
|
77
|
+
readonly 800: "#1E293B";
|
|
78
|
+
readonly 900: "#0F172A";
|
|
79
|
+
readonly 950: "#020617";
|
|
80
|
+
};
|
|
81
|
+
readonly success: "#10B981";
|
|
82
|
+
readonly warning: "#F59E0B";
|
|
83
|
+
readonly error: "#EF4444";
|
|
84
|
+
readonly info: "#3B82F6";
|
|
85
|
+
};
|
|
86
|
+
declare const spacing: {
|
|
87
|
+
readonly xs: "0.25rem";
|
|
88
|
+
readonly sm: "0.5rem";
|
|
89
|
+
readonly md: "1rem";
|
|
90
|
+
readonly lg: "1.5rem";
|
|
91
|
+
readonly xl: "2rem";
|
|
92
|
+
readonly "2xl": "3rem";
|
|
93
|
+
readonly "3xl": "4rem";
|
|
94
|
+
};
|
|
95
|
+
declare const borderRadius: {
|
|
96
|
+
readonly none: "0";
|
|
97
|
+
readonly sm: "0.25rem";
|
|
98
|
+
readonly md: "0.375rem";
|
|
99
|
+
readonly lg: "0.5rem";
|
|
100
|
+
readonly xl: "0.75rem";
|
|
101
|
+
readonly "2xl": "1rem";
|
|
102
|
+
readonly full: "9999px";
|
|
103
|
+
};
|
|
104
|
+
declare const shadows: {
|
|
105
|
+
readonly sm: "0 1px 2px 0 rgb(0 0 0 / 0.05)";
|
|
106
|
+
readonly md: "0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)";
|
|
107
|
+
readonly lg: "0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)";
|
|
108
|
+
readonly xl: "0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)";
|
|
109
|
+
};
|
|
110
|
+
declare const typography: {
|
|
111
|
+
readonly fontFamily: {
|
|
112
|
+
readonly sans: "Inter, system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif";
|
|
113
|
+
readonly mono: "\"JetBrains Mono\", ui-monospace, SFMono-Regular, Menlo, Monaco, monospace";
|
|
114
|
+
};
|
|
115
|
+
readonly fontSize: {
|
|
116
|
+
readonly xs: "0.75rem";
|
|
117
|
+
readonly sm: "0.875rem";
|
|
118
|
+
readonly base: "1rem";
|
|
119
|
+
readonly lg: "1.125rem";
|
|
120
|
+
readonly xl: "1.25rem";
|
|
121
|
+
readonly "2xl": "1.5rem";
|
|
122
|
+
readonly "3xl": "1.875rem";
|
|
123
|
+
readonly "4xl": "2.25rem";
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
type NebutraTokens = {
|
|
127
|
+
colors: typeof colors;
|
|
128
|
+
spacing: typeof spacing;
|
|
129
|
+
borderRadius: typeof borderRadius;
|
|
130
|
+
shadows: typeof shadows;
|
|
131
|
+
typography: typeof typography;
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* @nebutra/ui/theme — Lobe UI theme integration
|
|
136
|
+
*
|
|
137
|
+
* Exports the NebutraThemeProvider (wraps Lobe UI with brand tokens).
|
|
138
|
+
*
|
|
139
|
+
* For runtime CSS tokens, import from @nebutra/tokens instead:
|
|
140
|
+
* import { ThemeProvider } from "@nebutra/tokens";
|
|
141
|
+
* @import "@nebutra/tokens/styles.css";
|
|
142
|
+
*/
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Theme mode type used by DesignSystemProvider / layout components.
|
|
146
|
+
* Matches next-themes convention.
|
|
147
|
+
*/
|
|
148
|
+
type ThemeMode = "light" | "dark" | "system";
|
|
149
|
+
|
|
150
|
+
export { NebutraThemeProvider, type NebutraThemeProviderProps, type NebutraTokens, type ThemeMode };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { ThemeProvider } from '@lobehub/ui';
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
// src/theme/provider.tsx
|
|
6
|
+
function NebutraThemeProvider({
|
|
7
|
+
children,
|
|
8
|
+
appearance = "auto",
|
|
9
|
+
defaultAppearance = "light"
|
|
10
|
+
}) {
|
|
11
|
+
const resolvedAppearance = appearance === "auto" ? void 0 : appearance;
|
|
12
|
+
return /* @__PURE__ */ jsx(
|
|
13
|
+
ThemeProvider,
|
|
14
|
+
{
|
|
15
|
+
...resolvedAppearance != null && { appearance: resolvedAppearance },
|
|
16
|
+
defaultAppearance,
|
|
17
|
+
customTheme: {
|
|
18
|
+
primaryColor: "blue",
|
|
19
|
+
neutralColor: "slate"
|
|
20
|
+
},
|
|
21
|
+
children
|
|
22
|
+
}
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export { NebutraThemeProvider };
|
|
27
|
+
//# sourceMappingURL=index.js.map
|
|
28
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/theme/provider.tsx"],"names":["LobeThemeProvider"],"mappings":";;;;AAoCO,SAAS,oBAAA,CAAqB;AAAA,EACnC,QAAA;AAAA,EACA,UAAA,GAAa,MAAA;AAAA,EACb,iBAAA,GAAoB;AACtB,CAAA,EAA8B;AAC5B,EAAA,MAAM,kBAAA,GAAqB,UAAA,KAAe,MAAA,GAAS,MAAA,GAAY,UAAA;AAE/D,EAAA,uBACE,GAAA;AAAA,IAACA,aAAA;AAAA,IAAA;AAAA,MACE,GAAI,kBAAA,IAAsB,IAAA,IAAQ,EAAE,YAAY,kBAAA,EAAmB;AAAA,MACpE,iBAAA;AAAA,MACA,WAAA,EAAa;AAAA,QACX,YAAA,EAAc,MAAA;AAAA,QACd,YAAA,EAAc;AAAA,OAChB;AAAA,MAEC;AAAA;AAAA,GACH;AAEJ","file":"index.js","sourcesContent":["\"use client\";\n\n/**\n * Nebutra Theme Provider — Lobe UI integration bridge\n *\n * Wraps Lobe UI's ThemeProvider with Nebutra brand tokens.\n * This provider handles Lobe UI / Ant Design theming only.\n *\n * For app-level light/dark mode switching, use:\n * import { ThemeProvider } from \"@nebutra/tokens\";\n *\n * For CSS-variable-based tokens (Tailwind, custom components), use:\n * @import \"@nebutra/tokens/styles.css\";\n */\n\nimport { ThemeProvider as LobeThemeProvider } from \"@lobehub/ui\";\nimport type { ReactNode } from \"react\";\n\nexport interface NebutraThemeProviderProps {\n children: ReactNode;\n /** Force dark/light mode, or use system preference */\n appearance?: \"dark\" | \"light\" | \"auto\";\n /** Default theme mode when appearance is \"auto\" */\n defaultAppearance?: \"dark\" | \"light\";\n}\n\n/**\n * Theme provider that wraps Lobe UI with Nebutra design tokens\n *\n * @example\n * ```tsx\n * <NebutraThemeProvider appearance=\"auto\">\n * <App />\n * </NebutraThemeProvider>\n * ```\n */\nexport function NebutraThemeProvider({\n children,\n appearance = \"auto\",\n defaultAppearance = \"light\",\n}: NebutraThemeProviderProps) {\n const resolvedAppearance = appearance === \"auto\" ? undefined : appearance;\n\n return (\n <LobeThemeProvider\n {...(resolvedAppearance != null && { appearance: resolvedAppearance })}\n defaultAppearance={defaultAppearance}\n customTheme={{\n primaryColor: \"blue\",\n neutralColor: \"slate\",\n }}\n >\n {children}\n </LobeThemeProvider>\n );\n}\n\nexport default NebutraThemeProvider;\n"]}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Font CSS Variables — SSOT for typography across Nebutra packages.
|
|
3
|
+
* "Precision Stack" — Geist × Geist Mono × Noto Sans SC
|
|
4
|
+
*
|
|
5
|
+
* Font loading strategy (Next.js apps):
|
|
6
|
+
* Each app's layout.tsx loads Latin fonts via geist/font:
|
|
7
|
+
* GeistSans → injects --font-geist-sans (variable font, 100–900)
|
|
8
|
+
* GeistMono → injects --font-geist-mono (variable font, 100–900)
|
|
9
|
+
*
|
|
10
|
+
* The CSS custom properties below reference those injected variables and
|
|
11
|
+
* fall back gracefully when font loaders are unavailable (e.g., Storybook, tests).
|
|
12
|
+
* CJK uses local/system font fallback to avoid build-time Google font fetches.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
/* ============================================
|
|
16
|
+
CSS Custom Properties (SSOT)
|
|
17
|
+
============================================ */
|
|
18
|
+
|
|
19
|
+
:root {
|
|
20
|
+
/* Primary font stack — Geist Sans (geometric precision, variable) */
|
|
21
|
+
--font-primary:
|
|
22
|
+
var(--font-geist-sans), "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui,
|
|
23
|
+
sans-serif;
|
|
24
|
+
|
|
25
|
+
/* Heading font stack — matches primary for Precision Stack */
|
|
26
|
+
--font-heading:
|
|
27
|
+
var(--font-geist-sans), "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui,
|
|
28
|
+
sans-serif;
|
|
29
|
+
|
|
30
|
+
/* Monospace — Geist Mono */
|
|
31
|
+
--font-mono:
|
|
32
|
+
var(--font-geist-mono), "Geist Mono", "Fira Code", ui-monospace, SFMono-Regular, "SF Mono",
|
|
33
|
+
Menlo, Consolas, "Liberation Mono", monospace;
|
|
34
|
+
|
|
35
|
+
/* CJK — local/system fallback, no build-time font fetch */
|
|
36
|
+
--font-cjk:
|
|
37
|
+
var(--font-cn), "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
|
|
38
|
+
|
|
39
|
+
/* Aliases for Tailwind/shadcn compatibility */
|
|
40
|
+
--font-sans: var(--font-primary);
|
|
41
|
+
--font-serif: Georgia, Cambria, "Times New Roman", Times, serif;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/* ============================================
|
|
45
|
+
Font Smoothing & Rendering
|
|
46
|
+
============================================ */
|
|
47
|
+
|
|
48
|
+
html {
|
|
49
|
+
-webkit-font-smoothing: antialiased;
|
|
50
|
+
-moz-osx-font-smoothing: grayscale;
|
|
51
|
+
text-rendering: optimizeLegibility;
|
|
52
|
+
font-feature-settings:
|
|
53
|
+
"calt" 1,
|
|
54
|
+
"liga" 1;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/* ============================================
|
|
58
|
+
Base Typography
|
|
59
|
+
============================================ */
|
|
60
|
+
|
|
61
|
+
body {
|
|
62
|
+
font-family: var(--font-sans);
|
|
63
|
+
font-size: 1rem;
|
|
64
|
+
line-height: 1.5;
|
|
65
|
+
font-weight: 400;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/* Headings */
|
|
69
|
+
h1,
|
|
70
|
+
h2,
|
|
71
|
+
h3,
|
|
72
|
+
h4,
|
|
73
|
+
h5,
|
|
74
|
+
h6 {
|
|
75
|
+
font-family: var(--font-heading);
|
|
76
|
+
font-weight: 600;
|
|
77
|
+
line-height: 1.25;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/* Code */
|
|
81
|
+
code,
|
|
82
|
+
kbd,
|
|
83
|
+
pre,
|
|
84
|
+
samp {
|
|
85
|
+
font-family: var(--font-mono);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/* ============================================
|
|
89
|
+
Font Feature Settings
|
|
90
|
+
============================================ */
|
|
91
|
+
|
|
92
|
+
/* Enable tabular figures for numbers in tables */
|
|
93
|
+
.tabular-nums {
|
|
94
|
+
font-feature-settings: "tnum" 1;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/* Enable case-sensitive forms for all-caps text */
|
|
98
|
+
.case-sensitive {
|
|
99
|
+
font-feature-settings: "case" 1;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/* ============================================
|
|
103
|
+
CJK Support
|
|
104
|
+
============================================ */
|
|
105
|
+
|
|
106
|
+
:lang(zh),
|
|
107
|
+
:lang(ja),
|
|
108
|
+
:lang(ko) {
|
|
109
|
+
font-family: var(--font-cjk);
|
|
110
|
+
}
|