@nebutra/ui 0.2.0 → 0.2.2

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.
Files changed (55) hide show
  1. package/LICENSE +21 -676
  2. package/README.md +81 -86
  3. package/dist/agent/index.d.ts +119 -0
  4. package/dist/agent/index.js +135 -0
  5. package/dist/agent/index.js.map +1 -0
  6. package/dist/canonical-CrO71UPO.d.ts +4058 -0
  7. package/dist/components/index.d.ts +51 -56
  8. package/dist/components/index.js +1467 -1160
  9. package/dist/components/index.js.map +1 -1
  10. package/dist/hooks/index.d.ts +62 -15
  11. package/dist/hooks/index.js +56 -34
  12. package/dist/hooks/index.js.map +1 -1
  13. package/dist/index-CKLIGfiU.d.ts +19 -0
  14. package/dist/index-Dg4jRJV2.d.ts +57 -0
  15. package/dist/layout/index.d.ts +5 -1
  16. package/dist/layout/index.js +427 -533
  17. package/dist/layout/index.js.map +1 -1
  18. package/dist/layouts/index.js +11 -9
  19. package/dist/layouts/index.js.map +1 -1
  20. package/dist/patterns/index.d.ts +128 -2
  21. package/dist/patterns/index.js +1478 -786
  22. package/dist/patterns/index.js.map +1 -1
  23. package/dist/primitives/canonical.d.ts +25 -0
  24. package/dist/primitives/canonical.js +11903 -0
  25. package/dist/primitives/canonical.js.map +1 -0
  26. package/dist/primitives/index.d.ts +577 -3545
  27. package/dist/primitives/index.js +8002 -6159
  28. package/dist/primitives/index.js.map +1 -1
  29. package/dist/shared/animation/css/index.d.ts +1 -0
  30. package/dist/shared/animation/css/index.js +14 -0
  31. package/dist/shared/animation/css/index.js.map +1 -0
  32. package/dist/shared/animation/index.d.ts +6 -0
  33. package/dist/shared/animation/index.js +272 -0
  34. package/dist/shared/animation/index.js.map +1 -0
  35. package/dist/shared/animation/motion/index.d.ts +4 -0
  36. package/dist/shared/animation/motion/index.js +205 -0
  37. package/dist/shared/animation/motion/index.js.map +1 -0
  38. package/dist/styles/brand-override.css +11 -11
  39. package/dist/tailwind.preset.d.ts +10 -10
  40. package/dist/tailwind.preset.js +7 -4
  41. package/dist/tailwind.preset.js.map +1 -1
  42. package/dist/theme/index.d.ts +2 -2
  43. package/dist/tokens-EAC6uPem.d.ts +302 -0
  44. package/dist/typography/fonts.css +31 -12
  45. package/dist/typography/index.d.ts +27 -27
  46. package/dist/typography/index.js +24 -4
  47. package/dist/typography/index.js.map +1 -1
  48. package/dist/utils/index.d.ts +36 -14
  49. package/dist/utils/index.js +44 -10
  50. package/dist/utils/index.js.map +1 -1
  51. package/package.json +38 -12
  52. package/src/styles/brand-override.css +61 -0
  53. package/src/styles/preset.css +29 -0
  54. package/src/styles/sources.css +27 -0
  55. package/src/typography/fonts.css +129 -0
package/package.json CHANGED
@@ -1,11 +1,13 @@
1
1
  {
2
2
  "name": "@nebutra/ui",
3
- "version": "0.2.0",
4
- "description": "Unified UI component library — Lobe UI + Radix + HeroUI + layout components",
3
+ "version": "0.2.2",
4
+ "description": "Nebutra design-system UI primitives, patterns, layouts, and token-integrated components",
5
5
  "private": false,
6
6
  "license": "MIT",
7
7
  "type": "module",
8
- "sideEffects": false,
8
+ "sideEffects": [
9
+ "**/*.css"
10
+ ],
9
11
  "exports": {
10
12
  ".": {
11
13
  "types": "./dist/index.d.ts",
@@ -27,6 +29,10 @@
27
29
  "types": "./dist/icons/index.d.ts",
28
30
  "import": "./dist/icons/index.js"
29
31
  },
32
+ "./agent": {
33
+ "types": "./dist/agent/index.d.ts",
34
+ "import": "./dist/agent/index.js"
35
+ },
30
36
  "./theme": {
31
37
  "types": "./dist/theme/index.d.ts",
32
38
  "import": "./dist/theme/index.js"
@@ -35,6 +41,10 @@
35
41
  "types": "./dist/primitives/index.d.ts",
36
42
  "import": "./dist/primitives/index.js"
37
43
  },
44
+ "./primitives/canonical": {
45
+ "types": "./dist/primitives/canonical.d.ts",
46
+ "import": "./dist/primitives/canonical.js"
47
+ },
38
48
  "./patterns": {
39
49
  "types": "./dist/patterns/index.d.ts",
40
50
  "import": "./dist/patterns/index.js"
@@ -43,11 +53,26 @@
43
53
  "types": "./dist/typography/index.d.ts",
44
54
  "import": "./dist/typography/index.js"
45
55
  },
46
- "./typography/fonts.css": "./dist/typography/fonts.css",
56
+ "./typography/fonts.css": "./src/typography/fonts.css",
57
+ "./styles/sources.css": "./src/styles/sources.css",
58
+ "./styles/preset.css": "./src/styles/preset.css",
59
+ "./styles.css": "./src/styles/preset.css",
47
60
  "./hooks": {
48
61
  "types": "./dist/hooks/index.d.ts",
49
62
  "import": "./dist/hooks/index.js"
50
63
  },
64
+ "./shared/animation": {
65
+ "types": "./dist/shared/animation/index.d.ts",
66
+ "import": "./dist/shared/animation/index.js"
67
+ },
68
+ "./shared/animation/css": {
69
+ "types": "./dist/shared/animation/css/index.d.ts",
70
+ "import": "./dist/shared/animation/css/index.js"
71
+ },
72
+ "./shared/animation/motion": {
73
+ "types": "./dist/shared/animation/motion/index.d.ts",
74
+ "import": "./dist/shared/animation/motion/index.js"
75
+ },
51
76
  "./utils": {
52
77
  "types": "./dist/utils/index.d.ts",
53
78
  "import": "./dist/utils/index.js"
@@ -59,6 +84,8 @@
59
84
  },
60
85
  "files": [
61
86
  "dist",
87
+ "src/styles",
88
+ "src/typography/fonts.css",
62
89
  "README.md"
63
90
  ],
64
91
  "dependencies": {
@@ -85,7 +112,6 @@
85
112
  "embla-carousel-react": "^8.6.0",
86
113
  "framer-motion": "^12.35.0",
87
114
  "input-otp": "^1.4.2",
88
- "motion": "^12.35.0",
89
115
  "piri": "^1.3.2",
90
116
  "react": "^19.2.4",
91
117
  "react-ascii-text": "*",
@@ -104,10 +130,10 @@
104
130
  "tailwind-merge": "^3.5.0",
105
131
  "usehooks-ts": "^3.1.1",
106
132
  "vaul": "^1.1.2",
107
- "@nebutra/brand": "0.1.0",
108
- "@nebutra/graph-model": "0.2.0",
109
- "@nebutra/icons": "0.1.0",
110
- "@nebutra/tokens": "0.1.0"
133
+ "@nebutra/brand": "0.1.2",
134
+ "@nebutra/graph-model": "0.2.2",
135
+ "@nebutra/icons": "0.1.2",
136
+ "@nebutra/tokens": "0.1.2"
111
137
  },
112
138
  "peerDependencies": {
113
139
  "@clerk/nextjs": ">=5.0.0",
@@ -134,12 +160,12 @@
134
160
  "@types/three": "^0.183.1",
135
161
  "next": "^16.2.6",
136
162
  "storybook": "^8.6.17",
137
- "@vitejs/plugin-react": "^4.3.4",
163
+ "@vitejs/plugin-react-swc": "^4.3.1",
138
164
  "tsup": "^8.5.1",
139
165
  "tsx": "^4.21.0",
140
166
  "typescript": "^5.9.3",
141
167
  "vitest": "^4.0.18",
142
- "@nebutra/design-tokens": "0.1.0"
168
+ "@nebutra/design-tokens": "0.1.2"
143
169
  },
144
170
  "homepage": "https://github.com/Nebutra/Nebutra-Sailor/tree/main/packages/design/ui#readme",
145
171
  "repository": {
@@ -161,7 +187,7 @@
161
187
  "test": "vitest run",
162
188
  "typecheck": "tsc --noEmit",
163
189
  "build:registry": "tsx scripts/build-registry.ts",
164
- "build": "NODE_OPTIONS='--max-old-space-size=6144' tsup && tsx scripts/build-registry.ts",
190
+ "build": "NODE_OPTIONS='--max-old-space-size=6144' tsup",
165
191
  "dev": "tsup --watch"
166
192
  }
167
193
  }
@@ -0,0 +1,61 @@
1
+ /**
2
+ * brand-override.css — Custom Brand Configuration (legacy scale remap)
3
+ *
4
+ * Prefer the skin surface for product chrome:
5
+ * @import "@nebutra/tokens/skins/<name>.css";
6
+ * @see packages/design/tokens/skins/README.md
7
+ *
8
+ * This file remaps the **blue scale** only (residual `bg-blue-9` call sites).
9
+ * New code should use semantic tokens (`bg-primary`, `border-border`).
10
+ *
11
+ * Drop into globals.css after tokens if you still need scale remapping:
12
+ * @import "@nebutra/ui/styles/brand-override.css";
13
+ *
14
+ * ────────────────────────────────────────────────────────────
15
+ * HOW THE CASCADE WORKS
16
+ *
17
+ * 1. You define: --your-primary-* (11 steps)
18
+ * 2. System maps: --blue-9 → --your-primary-500 (solid fill)
19
+ * --blue-3 → --your-primary-200 (component bg)
20
+ * 3. Residual blue-N utilities follow your brand; semantic CSS still wins
21
+ * for Button / Input that already use --primary.
22
+ * ────────────────────────────────────────────────────────────
23
+ */
24
+
25
+ :root {
26
+ /* ══════════════════════════════════════════════════════════
27
+ PRIMARY BRAND COLOR — replace #0033FE with your primary
28
+ ════════════════════════════════════════════════════════ */
29
+ --nebutra-blue-50: #f0f4ff; /* lightest tint — backgrounds */
30
+ --nebutra-blue-100: #dbe4ff;
31
+ --nebutra-blue-200: #bac8ff;
32
+ --nebutra-blue-300: #91a7ff;
33
+ --nebutra-blue-400: #5c7cfa;
34
+ --nebutra-blue-500: #0033fe; /* ← YOUR PRIMARY COLOR HERE */
35
+ --nebutra-blue-600: #002ad4;
36
+ --nebutra-blue-700: #0021ab;
37
+ --nebutra-blue-800: #001882;
38
+ --nebutra-blue-900: #000f59;
39
+ --nebutra-blue-950: #000830; /* darkest — text */
40
+
41
+ /* ══════════════════════════════════════════════════════════
42
+ SECONDARY ACCENT COLOR — replace #0BF1C3 with your accent
43
+ ════════════════════════════════════════════════════════ */
44
+ --nebutra-cyan-50: #e6fff8; /* lightest tint */
45
+ --nebutra-cyan-100: #b3ffec;
46
+ --nebutra-cyan-200: #80ffe0;
47
+ --nebutra-cyan-300: #4dfcd4;
48
+ --nebutra-cyan-400: #1af7c8;
49
+ --nebutra-cyan-500: #0bf1c3; /* ← YOUR ACCENT COLOR HERE */
50
+ --nebutra-cyan-600: #09c9a3;
51
+ --nebutra-cyan-700: #07a183;
52
+ --nebutra-cyan-800: #057963;
53
+ --nebutra-cyan-900: #035143;
54
+ --nebutra-cyan-950: #012923; /* darkest */
55
+
56
+ /* ══════════════════════════════════════════════════════════
57
+ OPTIONAL: Brand name tokens (used in metadata / docs only)
58
+ ════════════════════════════════════════════════════════ */
59
+ /* --brand-name: "Your Brand"; */
60
+ /* --brand-domain: "yourbrand.com"; */
61
+ }
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Full design-system CSS entry for product apps (Tailwind v4).
3
+ *
4
+ * Architecture: packages/design/ARCHITECTURE.md
5
+ *
6
+ * One import wires:
7
+ * 1. Tailwind
8
+ * 2. @nebutra/tokens (semantic CSS variables + @theme) ← skin surface
9
+ * 3. Source scan so UI CVA classes are generated
10
+ * 4. Typography CSS variables
11
+ * 5. dark variant
12
+ *
13
+ * Simple apps:
14
+ * @import "@nebutra/ui/styles/preset.css";
15
+ *
16
+ * Complex apps (fumadocs, katex first):
17
+ * @import "tailwindcss";
18
+ * @import "…third-party…";
19
+ * @import "@nebutra/tokens/styles.css";
20
+ * @import "@nebutra/ui/styles/sources.css";
21
+ */
22
+
23
+ @import "tailwindcss";
24
+ @import "@nebutra/tokens/styles.css";
25
+ @import "@nebutra/tokens/recipe.css";
26
+ @import "./sources.css";
27
+ @import "../typography/fonts.css";
28
+
29
+ @custom-variant dark (&:is(.dark *));
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Tailwind v4 source registration for @nebutra/ui (+ icons).
3
+ *
4
+ * WHY THIS FILE EXISTS
5
+ * --------------------
6
+ * UI primitives style themselves with CVA *utility class strings*, not a
7
+ * prebuilt component CSS sheet. Under Tailwind v4 those utilities only exist
8
+ * in an app’s bundle if the app’s CSS pipeline *scans* this package.
9
+ *
10
+ * Best practice: the design-system package owns the scan paths.
11
+ * Apps import this file once — they never hardcode monorepo-relative @source.
12
+ *
13
+ * Usage (after @import "tailwindcss"):
14
+ * @import "@nebutra/ui/styles/sources.css";
15
+ *
16
+ * Or use the full preset:
17
+ * @import "@nebutra/ui/styles/preset.css";
18
+ *
19
+ * Paths are relative to THIS file so resolution is stable in workspace
20
+ * and when resolved through node_modules/@nebutra/ui.
21
+ */
22
+
23
+ /* All CVA / className strings under the UI package */
24
+ @source "../**/*.{ts,tsx,js,jsx}";
25
+
26
+ /* Icon components often appear in class strings next to UI primitives */
27
+ @source "../../../icons/src/**/*.{ts,tsx,js,jsx}";
@@ -0,0 +1,129 @@
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", ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
33
+
34
+ /* CJK — local/system fallback, no build-time font fetch */
35
+ --font-cjk:
36
+ var(--font-cn), "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
37
+
38
+ /* Aliases for Tailwind/shadcn compatibility */
39
+ --font-sans: var(--font-primary);
40
+ --font-serif: Georgia, Cambria, "Times New Roman", Times, serif;
41
+ }
42
+
43
+ /* ============================================
44
+ Font Smoothing & Rendering
45
+ ============================================ */
46
+
47
+ html {
48
+ -webkit-font-smoothing: antialiased;
49
+ -moz-osx-font-smoothing: grayscale;
50
+ text-rendering: optimizeLegibility;
51
+ font-feature-settings:
52
+ "calt" 1,
53
+ "liga" 1;
54
+ /* Variable-font polish: */
55
+ /* - font-synthesis: none → forbid faux-bold / faux-italic synthesis;
56
+ variable fonts already ship every weight/style, synthesised faces
57
+ look fuzzy at sub-pixel boundaries.
58
+ - font-optical-sizing: auto → tells the engine to use the opsz axis
59
+ on fonts that ship one (Geist Sans, Geist Mono, Inter, Playfair),
60
+ so glyphs are rendered with weights tuned to their display size
61
+ instead of being scaled uniformly. */
62
+ font-synthesis: none;
63
+ font-optical-sizing: auto;
64
+ }
65
+
66
+ /* ============================================
67
+ Base Typography
68
+ ============================================ */
69
+
70
+ body {
71
+ /* Font precedence in ONE place: explicit user choice (--user-ui-font) →
72
+ active theme/DESIGN font (--font-sans) → default; the CJK stack is always
73
+ appended as a fallback so Chinese/Japanese/Korean glyphs render regardless
74
+ of the (often Latin-only) theme font. This replaces a blanket :lang(zh)
75
+ override that used to discard the theme font entirely. */
76
+ font-family: var(--user-ui-font, var(--font-sans)), var(--font-cjk);
77
+ /* An explicit user size (--user-ui-font-size) wins; otherwise the active
78
+ theme/DESIGN type-scale (--text-base); otherwise the 1rem default. This is
79
+ backward-compatible — with neither var set it resolves to exactly 1rem.
80
+ (Previously this was a hardcoded 1rem that, being unlayered, silently
81
+ overrode the app's --user-ui-font-size font-size control.) */
82
+ font-size: var(--user-ui-font-size, var(--text-base, 1rem));
83
+ line-height: 1.5;
84
+ font-weight: 400;
85
+ }
86
+
87
+ /* Headings */
88
+ h1,
89
+ h2,
90
+ h3,
91
+ h4,
92
+ h5,
93
+ h6 {
94
+ font-family: var(--font-heading), var(--font-cjk);
95
+ /* Theme/DESIGN can lighten headings via fontWeight.heading; default 600. */
96
+ font-weight: var(--font-weight-heading, 600);
97
+ line-height: 1.25;
98
+ }
99
+
100
+ /* Code */
101
+ code,
102
+ kbd,
103
+ pre,
104
+ samp {
105
+ font-family: var(--user-code-font, var(--font-mono)), var(--font-cjk);
106
+ }
107
+
108
+ /* ============================================
109
+ Font Feature Settings
110
+ ============================================ */
111
+
112
+ /* Enable tabular figures for numbers in tables */
113
+ .tabular-nums {
114
+ font-feature-settings: "tnum" 1;
115
+ }
116
+
117
+ /* Enable case-sensitive forms for all-caps text */
118
+ .case-sensitive {
119
+ font-feature-settings: "case" 1;
120
+ }
121
+
122
+ /* ============================================
123
+ CJK Support
124
+ ============================================ */
125
+
126
+ /* No blanket :lang(zh) font-family override here. The CJK stack is appended as
127
+ a fallback on the body / heading / code rules above, so the active theme or
128
+ DESIGN.md font drives Latin text on every locale while CJK glyphs still fall
129
+ back to --font-cjk. (A blanket override would discard the theme font.) */