@b3-crow/ui-kit 0.0.37 → 0.0.39

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 (142) hide show
  1. package/dist/components/backgrounds/Globe.d.ts.map +1 -1
  2. package/dist/components/backgrounds/Globe.js +17 -276
  3. package/dist/components/backgrounds/Globe.js.map +1 -1
  4. package/dist/components/backgrounds/GlobeRenderer.d.ts +3 -0
  5. package/dist/components/backgrounds/GlobeRenderer.d.ts.map +1 -0
  6. package/dist/components/backgrounds/GlobeRenderer.js +191 -0
  7. package/dist/components/backgrounds/GlobeRenderer.js.map +1 -0
  8. package/dist/components/cards/Card.d.ts +2 -2
  9. package/dist/components/cards/Card.d.ts.map +1 -1
  10. package/dist/components/cards/Card.js +2 -2
  11. package/dist/components/cards/Card.js.map +1 -1
  12. package/dist/components/dashboard/ChatHistorySection.d.ts +4 -0
  13. package/dist/components/dashboard/ChatHistorySection.d.ts.map +1 -0
  14. package/dist/components/dashboard/ChatHistorySection.js +121 -0
  15. package/dist/components/dashboard/ChatHistorySection.js.map +1 -0
  16. package/dist/components/dashboard/DashboardBackground.d.ts +4 -0
  17. package/dist/components/dashboard/DashboardBackground.d.ts.map +1 -0
  18. package/dist/components/dashboard/DashboardBackground.js +16 -0
  19. package/dist/components/dashboard/DashboardBackground.js.map +1 -0
  20. package/dist/components/dashboard/FilterDropdown.d.ts +14 -0
  21. package/dist/components/dashboard/FilterDropdown.d.ts.map +1 -0
  22. package/dist/components/dashboard/FilterDropdown.js +114 -0
  23. package/dist/components/dashboard/FilterDropdown.js.map +1 -0
  24. package/dist/components/dashboard/GlassPanel.d.ts +13 -0
  25. package/dist/components/dashboard/GlassPanel.d.ts.map +1 -0
  26. package/dist/components/dashboard/GlassPanel.js +20 -0
  27. package/dist/components/dashboard/GlassPanel.js.map +1 -0
  28. package/dist/components/dashboard/Header.d.ts +4 -0
  29. package/dist/components/dashboard/Header.d.ts.map +1 -0
  30. package/dist/components/dashboard/Header.js +123 -0
  31. package/dist/components/dashboard/Header.js.map +1 -0
  32. package/dist/components/dashboard/IconBadge.d.ts +22 -0
  33. package/dist/components/dashboard/IconBadge.d.ts.map +1 -0
  34. package/dist/components/dashboard/IconBadge.js +44 -0
  35. package/dist/components/dashboard/IconBadge.js.map +1 -0
  36. package/dist/components/dashboard/ListItem.d.ts +22 -0
  37. package/dist/components/dashboard/ListItem.d.ts.map +1 -0
  38. package/dist/components/dashboard/ListItem.js +25 -0
  39. package/dist/components/dashboard/ListItem.js.map +1 -0
  40. package/dist/components/dashboard/MetricsCard.d.ts +10 -0
  41. package/dist/components/dashboard/MetricsCard.d.ts.map +1 -0
  42. package/dist/components/dashboard/MetricsCard.js +41 -0
  43. package/dist/components/dashboard/MetricsCard.js.map +1 -0
  44. package/dist/components/dashboard/MobileSidebar.d.ts +4 -0
  45. package/dist/components/dashboard/MobileSidebar.d.ts.map +1 -0
  46. package/dist/components/dashboard/MobileSidebar.js +57 -0
  47. package/dist/components/dashboard/MobileSidebar.js.map +1 -0
  48. package/dist/components/dashboard/NavMenu.d.ts +8 -0
  49. package/dist/components/dashboard/NavMenu.d.ts.map +1 -0
  50. package/dist/components/dashboard/NavMenu.js +66 -0
  51. package/dist/components/dashboard/NavMenu.js.map +1 -0
  52. package/dist/components/dashboard/PatternCard.d.ts +15 -0
  53. package/dist/components/dashboard/PatternCard.d.ts.map +1 -0
  54. package/dist/components/dashboard/PatternCard.js +36 -0
  55. package/dist/components/dashboard/PatternCard.js.map +1 -0
  56. package/dist/components/dashboard/SearchInput.d.ts +30 -0
  57. package/dist/components/dashboard/SearchInput.d.ts.map +1 -0
  58. package/dist/components/dashboard/SearchInput.js +52 -0
  59. package/dist/components/dashboard/SearchInput.js.map +1 -0
  60. package/dist/components/dashboard/SectionHeader.d.ts +13 -0
  61. package/dist/components/dashboard/SectionHeader.d.ts.map +1 -0
  62. package/dist/components/dashboard/SectionHeader.js +19 -0
  63. package/dist/components/dashboard/SectionHeader.js.map +1 -0
  64. package/dist/components/dashboard/SettingsDropup.d.ts +9 -0
  65. package/dist/components/dashboard/SettingsDropup.d.ts.map +1 -0
  66. package/dist/components/dashboard/SettingsDropup.js +97 -0
  67. package/dist/components/dashboard/SettingsDropup.js.map +1 -0
  68. package/dist/components/dashboard/SettingsModal.d.ts +4 -0
  69. package/dist/components/dashboard/SettingsModal.d.ts.map +1 -0
  70. package/dist/components/dashboard/SettingsModal.js +56 -0
  71. package/dist/components/dashboard/SettingsModal.js.map +1 -0
  72. package/dist/components/dashboard/SidePanel.d.ts +12 -0
  73. package/dist/components/dashboard/SidePanel.d.ts.map +1 -0
  74. package/dist/components/dashboard/SidePanel.js +79 -0
  75. package/dist/components/dashboard/SidePanel.js.map +1 -0
  76. package/dist/components/dashboard/Sidebar.d.ts +4 -0
  77. package/dist/components/dashboard/Sidebar.d.ts.map +1 -0
  78. package/dist/components/dashboard/Sidebar.js +28 -0
  79. package/dist/components/dashboard/Sidebar.js.map +1 -0
  80. package/dist/components/dashboard/SidebarLogo.d.ts +7 -0
  81. package/dist/components/dashboard/SidebarLogo.d.ts.map +1 -0
  82. package/dist/components/dashboard/SidebarLogo.js +6 -0
  83. package/dist/components/dashboard/SidebarLogo.js.map +1 -0
  84. package/dist/components/dashboard/SourceIcon.d.ts +15 -0
  85. package/dist/components/dashboard/SourceIcon.d.ts.map +1 -0
  86. package/dist/components/dashboard/SourceIcon.js +28 -0
  87. package/dist/components/dashboard/SourceIcon.js.map +1 -0
  88. package/dist/components/dashboard/StatusBadge.d.ts +26 -0
  89. package/dist/components/dashboard/StatusBadge.d.ts.map +1 -0
  90. package/dist/components/dashboard/StatusBadge.js +42 -0
  91. package/dist/components/dashboard/StatusBadge.js.map +1 -0
  92. package/dist/components/dashboard/StatusIndicator.d.ts +16 -0
  93. package/dist/components/dashboard/StatusIndicator.d.ts.map +1 -0
  94. package/dist/components/dashboard/StatusIndicator.js +35 -0
  95. package/dist/components/dashboard/StatusIndicator.js.map +1 -0
  96. package/dist/components/dashboard/Tag.d.ts +16 -0
  97. package/dist/components/dashboard/Tag.d.ts.map +1 -0
  98. package/dist/components/dashboard/Tag.js +18 -0
  99. package/dist/components/dashboard/Tag.js.map +1 -0
  100. package/dist/components/dashboard/TipCard.d.ts +12 -0
  101. package/dist/components/dashboard/TipCard.d.ts.map +1 -0
  102. package/dist/components/dashboard/TipCard.js +17 -0
  103. package/dist/components/dashboard/TipCard.js.map +1 -0
  104. package/dist/components/dashboard/ToggleSwitch.d.ts +17 -0
  105. package/dist/components/dashboard/ToggleSwitch.d.ts.map +1 -0
  106. package/dist/components/dashboard/ToggleSwitch.js +27 -0
  107. package/dist/components/dashboard/ToggleSwitch.js.map +1 -0
  108. package/dist/components/dashboard/constants.d.ts +28 -0
  109. package/dist/components/dashboard/constants.d.ts.map +1 -0
  110. package/dist/components/dashboard/constants.js +104 -0
  111. package/dist/components/dashboard/constants.js.map +1 -0
  112. package/dist/components/dashboard/index.d.ts +27 -0
  113. package/dist/components/dashboard/index.d.ts.map +1 -0
  114. package/dist/components/dashboard/index.js +27 -0
  115. package/dist/components/dashboard/index.js.map +1 -0
  116. package/dist/components/dashboard/types.d.ts +115 -0
  117. package/dist/components/dashboard/types.d.ts.map +1 -0
  118. package/dist/components/dashboard/types.js +2 -0
  119. package/dist/components/dashboard/types.js.map +1 -0
  120. package/dist/components/index.d.ts +11 -11
  121. package/dist/components/index.d.ts.map +1 -1
  122. package/dist/components/index.js +12 -12
  123. package/dist/components/index.js.map +1 -1
  124. package/dist/components/inputs/InputField.d.ts +1 -1
  125. package/dist/components/layout/MobileSidebar.d.ts.map +1 -1
  126. package/dist/components/layout/MobileSidebar.js +4 -4
  127. package/dist/components/layout/MobileSidebar.js.map +1 -1
  128. package/dist/lib/constants.d.ts.map +1 -1
  129. package/dist/lib/constants.js +6 -0
  130. package/dist/lib/constants.js.map +1 -1
  131. package/dist/lib/types.d.ts +1 -1
  132. package/dist/lib/types.d.ts.map +1 -1
  133. package/dist/styles.css +1 -1
  134. package/package.json +44 -9
  135. package/.prettierignore +0 -28
  136. package/.templatesyncignore +0 -2
  137. package/.whitesource +0 -14
  138. package/docs/components.md +0 -265
  139. package/docs/development.md +0 -291
  140. package/docs/examples.md +0 -333
  141. package/docs/screenshot.svg +0 -57
  142. package/docs/setup.md +0 -73
package/package.json CHANGED
@@ -1,21 +1,29 @@
1
1
  {
2
2
  "name": "@b3-crow/ui-kit",
3
- "version": "0.0.37",
3
+ "version": "0.0.39",
4
4
  "description": "CROW-B3 UI Kit",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",
8
+ "sideEffects": false,
8
9
  "exports": {
9
10
  ".": {
10
11
  "types": "./dist/index.d.ts",
11
12
  "default": "./dist/index.js"
12
13
  },
14
+ "./code-block": {
15
+ "types": "./dist/components/display/CodeBlock.d.ts",
16
+ "default": "./dist/components/display/CodeBlock.js"
17
+ },
13
18
  "./styles.css": {
14
19
  "style": "./dist/styles.css",
15
20
  "default": "./dist/styles.css"
16
21
  }
17
22
  },
18
23
  "type": "module",
24
+ "files": [
25
+ "dist"
26
+ ],
19
27
  "scripts": {
20
28
  "build": "tsc && bun run build:css",
21
29
  "build:css": "tailwindcss -i src/styles.css -o dist/styles.css --minify",
@@ -24,7 +32,9 @@
24
32
  "lint:fix": "eslint src/ --fix",
25
33
  "format": "bunx prettier src/ --write",
26
34
  "prepare": "husky install",
27
- "lint-staged": "lint-staged"
35
+ "lint-staged": "lint-staged",
36
+ "storybook": "storybook dev -p 6006",
37
+ "build-storybook": "storybook build"
28
38
  },
29
39
  "repository": {
30
40
  "type": "git",
@@ -40,21 +50,35 @@
40
50
  "@antfu/eslint-config": "^6.2.0",
41
51
  "@commitlint/config-conventional": "^20.0.0",
42
52
  "@eslint-react/eslint-plugin": "^2.4.0",
53
+ "@storybook/addon-a11y": "^10.2.10",
54
+ "@storybook/addon-docs": "^10.2.10",
55
+ "@storybook/react-vite": "^10.2.10",
43
56
  "@tailwindcss/cli": "4.1.18",
44
57
  "@tailwindcss/postcss": "^4.1.17",
45
58
  "@types/node": "^22.10.5",
46
59
  "@types/react": "^19.2.7",
47
60
  "@types/react-dom": "^19.2.3",
61
+ "@types/three": "^0.182.0",
62
+ "@vitest/browser-playwright": "^4.0.18",
63
+ "@vitest/coverage-v8": "^4.0.18",
48
64
  "autoprefixer": "^10.4.22",
49
65
  "commitlint": "^20.1.0",
50
66
  "eslint-plugin-react-hooks": "^7.0.1",
51
67
  "eslint-plugin-react-refresh": "^0.4.26",
68
+ "eslint-plugin-storybook": "^10.2.10",
52
69
  "husky": "^9.1.7",
53
70
  "lint-staged": "^16.2.6",
71
+ "playwright": "^1.58.2",
54
72
  "postcss": "^8.5.6",
55
73
  "prettier": "^3.6.2",
74
+ "react-icons": "^5.5.0",
75
+ "shiki": "^3.21.0",
76
+ "storybook": "^10.2.10",
56
77
  "tailwindcss": "^4.1.17",
57
- "typescript": "^5.9.3"
78
+ "three": "^0.182.0",
79
+ "three-globe": "^2.45.0",
80
+ "typescript": "^5.9.3",
81
+ "vitest": "^4.0.18"
58
82
  },
59
83
  "lint-staged": {
60
84
  "*.{js,jsx,ts,tsx}": [
@@ -66,20 +90,31 @@
66
90
  ]
67
91
  },
68
92
  "peerDependencies": {
69
- "react": "^19.2.0",
70
- "react-dom": "^19.2.0",
71
- "next": "^15.0.0"
93
+ "react": "^19.2.4",
94
+ "react-dom": "^19.2.4",
95
+ "next": "^15.0.0",
96
+ "shiki": "^3.21.0",
97
+ "three": "^0.182.0",
98
+ "three-globe": "^2.45.0"
99
+ },
100
+ "peerDependenciesMeta": {
101
+ "shiki": {
102
+ "optional": true
103
+ },
104
+ "three": {
105
+ "optional": true
106
+ },
107
+ "three-globe": {
108
+ "optional": true
109
+ }
72
110
  },
73
111
  "dependencies": {
74
112
  "@radix-ui/react-slot": "^1.2.4",
75
113
  "class-variance-authority": "^0.7.1",
76
114
  "clsx": "^2.1.1",
77
- "cobe": "^0.6.5",
78
115
  "framer-motion": "^12.23.26",
79
116
  "lenis": "^1.2.1",
80
117
  "lucide-react": "^0.542.0",
81
- "react-icons": "^5.5.0",
82
- "shiki": "^3.21.0",
83
118
  "tailwind-merge": "^3.4.0"
84
119
  }
85
120
  }
package/.prettierignore DELETED
@@ -1,28 +0,0 @@
1
- # Dependencies
2
- node_modules/
3
-
4
- # Build outputs
5
- .next/
6
- out/
7
- dist/
8
- build/
9
-
10
- # Environment files
11
- .env*
12
-
13
- # Logs
14
- *.log
15
-
16
- # Package manager files
17
- package-lock.json
18
- yarn.lock
19
- bun.lock
20
-
21
- # IDE files
22
- .vscode/
23
- .idea/
24
-
25
- # OS files
26
- .DS_Store
27
- Thumbs.db
28
-
@@ -1,2 +0,0 @@
1
- README.md
2
- tsconfig.json
package/.whitesource DELETED
@@ -1,14 +0,0 @@
1
- {
2
- "scanSettings": {
3
- "baseBranches": []
4
- },
5
- "checkRunSettings": {
6
- "vulnerableCheckRunConclusionLevel": "failure",
7
- "displayMode": "diff",
8
- "useMendCheckNames": true
9
- },
10
- "issueSettings": {
11
- "minSeverityLevel": "LOW",
12
- "issueType": "DEPENDENCY"
13
- }
14
- }
@@ -1,265 +0,0 @@
1
- # Component Reference
2
-
3
- ## Hero Components
4
-
5
- ### AnimatedBackground
6
-
7
- Animated gradient background with blurred circles.
8
-
9
- **Props:**
10
-
11
- - None
12
-
13
- **Requirements:**
14
-
15
- - Parent container must have `position: relative`
16
- - Parent should have defined height (e.g., `minHeight: '100vh'`)
17
-
18
- **Usage:**
19
-
20
- ```tsx
21
- <section style={{ position: 'relative', minHeight: '100vh' }}>
22
- <AnimatedBackground />
23
- </section>
24
- ```
25
-
26
- ---
27
-
28
- ### HeroText
29
-
30
- Large gradient text with fade-in animation.
31
-
32
- **Props:**
33
-
34
- - `text` (required): The text to display
35
- - `gradient` (optional): Custom gradient CSS
36
-
37
- **Usage:**
38
-
39
- ```tsx
40
- <HeroText text="Your Brand" />
41
- ```
42
-
43
- ---
44
-
45
- ### Logo
46
-
47
- Animated logo component with breathing effect.
48
-
49
- **Props:**
50
-
51
- - `src` (required): Logo image source
52
- - `alt` (required): Alt text for accessibility
53
-
54
- **Usage:**
55
-
56
- ```tsx
57
- <Logo src="/your-logo.png" alt="Your Logo" />
58
- ```
59
-
60
- ---
61
-
62
- ### TypewriterText
63
-
64
- Typewriter effect text with blinking cursor.
65
-
66
- **Props:**
67
-
68
- - `text` (required): The text to animate
69
-
70
- **Usage:**
71
-
72
- ```tsx
73
- <TypewriterText text="COMING SOON" />
74
- ```
75
-
76
- ---
77
-
78
- ### Subtitle
79
-
80
- Subtitle text with fade-in animation.
81
-
82
- **Props:**
83
-
84
- - `children` (required): JSX content for the subtitle
85
-
86
- **Usage:**
87
-
88
- ```tsx
89
- <Subtitle>
90
- Your subtitle text here
91
- <br />
92
- Can be multi-line with custom formatting
93
- </Subtitle>
94
- ```
95
-
96
- ---
97
-
98
- ## UI Components
99
-
100
- ### Button
101
-
102
- Customizable button with arrow icon.
103
-
104
- **Props:**
105
-
106
- - `variant`: `"outline"` | `"solid"` (default: `"outline"`)
107
- - `href`: Optional link URL
108
- - `onClick`: Optional click handler
109
- - `showArrow`: Show/hide arrow icon (default: `true`)
110
- - `children`: Button content
111
-
112
- **Usage:**
113
-
114
- ```tsx
115
- <Button variant="outline">Try Now</Button>
116
- <Button variant="solid" href="/docs">Get Started</Button>
117
- ```
118
-
119
- ---
120
-
121
- ### Card
122
-
123
- Flexible card component for features and documentation.
124
-
125
- **Props:**
126
-
127
- - `title` (required): Card title
128
- - `description` (required): Card description
129
- - `icon`: Optional icon component
130
- - `button`: Optional button component
131
- - `layout`: `"feature"` | `"documentation"` (default: `"feature"`)
132
- - `contentAlign`: `"left"` | `"center"` (default: `"left"`)
133
- - `index`: Animation delay index
134
-
135
- **Usage:**
136
-
137
- ```tsx
138
- <Card
139
- title="Feature Title"
140
- description="Feature description"
141
- icon={<YourIcon />}
142
- layout="feature"
143
- button={<Button>Learn More</Button>}
144
- />
145
- ```
146
-
147
- ---
148
-
149
- ### Globe
150
-
151
- Interactive 3D globe with custom data points powered by the `cobe` library.
152
-
153
- **Props:**
154
-
155
- - `size`: Globe diameter in pixels (default: `500`)
156
- - `points`: Array of custom data points with label, icon, and position
157
-
158
- **Usage:**
159
-
160
- ```tsx
161
- <Globe size={600} />
162
-
163
- <Globe
164
- size={500}
165
- points={[
166
- {
167
- label: 'Data Source',
168
- icon: <BsGlobe2 />,
169
- position: { x: 50, y: 30 }
170
- }
171
- ]}
172
- />
173
- ```
174
-
175
- ---
176
-
177
- ### GradientBackground
178
-
179
- Radial gradient background effect.
180
-
181
- **Props:**
182
-
183
- - `position`: `"top"` | `"bottom"` (default: `"top"`)
184
- - `colors`: Custom color object with `start`, `middle1`, `middle2`, `middle3`
185
- - `blur`: Blur amount (default: `"150px"`)
186
- - `height`: Height of gradient (default: `"100vh"`)
187
-
188
- **Usage:**
189
-
190
- ```tsx
191
- <GradientBackground position="top" />
192
-
193
- <GradientBackground
194
- position="bottom"
195
- height="50vh"
196
- colors={{
197
- start: 'rgba(100, 50, 150, 0.9)',
198
- middle1: 'rgba(80, 40, 120, 0.7)',
199
- middle2: 'rgba(60, 30, 100, 0.6)',
200
- middle3: 'rgba(40, 20, 80, 0.4)',
201
- }}
202
- />
203
- ```
204
-
205
- ---
206
-
207
- ### SectionLabel
208
-
209
- Animated section label with bracket styling.
210
-
211
- **Props:**
212
-
213
- - `label` (required): Label text
214
- - `className`: Additional CSS classes
215
- - `animate`: Enable/disable animation (default: `true`)
216
-
217
- **Usage:**
218
-
219
- ```tsx
220
- <SectionLabel label="FEATURES" className="mb-16" />
221
- <SectionLabel label="ABOUT" animate={false} />
222
- ```
223
-
224
- ---
225
-
226
- ### InputField
227
-
228
- Customizable input field with optional submit button.
229
-
230
- **Props:**
231
-
232
- - `placeholder`: Input placeholder text
233
- - `value`: Controlled input value
234
- - `onChange`: Value change handler
235
- - `onSubmit`: Submit handler
236
- - `variant`: `"transparent"` | `"filled"` (default: `"transparent"`)
237
- - `size`: `"sm"` | `"md"` | `"lg"` (default: `"md"`)
238
- - `showButton`: Show/hide submit button (default: `true`)
239
- - `buttonPosition`: `"left"` | `"right"` (default: `"right"`)
240
-
241
- **Usage:**
242
-
243
- ```tsx
244
- <InputField
245
- placeholder="Ask CROW Anything..."
246
- onSubmit={(value) => console.log('Submitted:', value)}
247
- />
248
-
249
- <InputField
250
- value={inputValue}
251
- onChange={(value) => setInputValue(value)}
252
- size="lg"
253
- variant="filled"
254
- />
255
- ```
256
-
257
- ---
258
-
259
- ## TypeScript
260
-
261
- All components are fully typed with exported TypeScript interfaces. Import types as needed:
262
-
263
- ```tsx
264
- import type { ButtonProps, CardProps, GlobeProps } from '@b3-crow/ui-kit';
265
- ```
@@ -1,291 +0,0 @@
1
- # Development Guide
2
-
3
- ## Getting Started
4
-
5
- ### Prerequisites
6
-
7
- - [Bun](https://bun.sh) v1.3.3 or higher
8
- - Node.js v18 or higher (for compatibility)
9
- - Git
10
-
11
- ### Installation
12
-
13
- Clone the repository and install dependencies:
14
-
15
- ```bash
16
- git clone https://github.com/CROW-B3/ui-kit.git
17
- cd ui-kit
18
- bun install
19
- ```
20
-
21
- ## Project Structure
22
-
23
- ```
24
- ui-kit/
25
- ├── src/
26
- │ ├── components/ # All UI components
27
- │ ├── lib/ # Utility functions
28
- │ ├── index.ts # Main exports
29
- │ └── styles.css # Global styles
30
- ├── dist/ # Compiled output
31
- ├── docs/ # Documentation
32
- ├── package.json
33
- ├── tsconfig.json
34
- └── README.md
35
- ```
36
-
37
- ## Development Workflow
38
-
39
- ### Building
40
-
41
- Build the library for production:
42
-
43
- ```bash
44
- bun run build
45
- ```
46
-
47
- Watch mode for development:
48
-
49
- ```bash
50
- bun run build:watch
51
- ```
52
-
53
- ### Linting
54
-
55
- Run ESLint to check for code issues:
56
-
57
- ```bash
58
- bun run lint
59
- ```
60
-
61
- Auto-fix linting issues:
62
-
63
- ```bash
64
- bun run lint:fix
65
- ```
66
-
67
- ### Formatting
68
-
69
- Format code with Prettier:
70
-
71
- ```bash
72
- bun run format
73
- ```
74
-
75
- ### Pre-commit Hooks
76
-
77
- The project uses Husky for Git hooks:
78
-
79
- - **Pre-commit**: Runs lint-staged to lint and format changed files
80
- - **Commit-msg**: Validates commit messages using conventional commits
81
-
82
- Hooks are automatically installed after running `bun install`.
83
-
84
- ## Code Standards
85
-
86
- ### TypeScript
87
-
88
- - All components must be fully typed
89
- - Export component prop types
90
- - Use strict TypeScript configuration
91
- - No `any` types unless absolutely necessary
92
-
93
- ### Styling
94
-
95
- - Use Tailwind CSS utility classes
96
- - Follow dark theme design system
97
- - Use consistent spacing and sizing
98
- - Prefer composition over configuration
99
-
100
- ### Component Structure
101
-
102
- ```tsx
103
- import type { ComponentProps } from 'react';
104
-
105
- export interface YourComponentProps {
106
- // Props interface
107
- required: string;
108
- optional?: number;
109
- }
110
-
111
- export function YourComponent({ required, optional }: YourComponentProps) {
112
- // Component implementation
113
- return <div>{required}</div>;
114
- }
115
- ```
116
-
117
- ### Commit Messages
118
-
119
- Follow [Conventional Commits](https://www.conventionalcommits.org/):
120
-
121
- ```
122
- feat: add new component
123
- fix: resolve animation bug
124
- docs: update README
125
- chore: bump dependencies
126
- ```
127
-
128
- Types:
129
-
130
- - `feat`: New feature
131
- - `fix`: Bug fix
132
- - `docs`: Documentation changes
133
- - `style`: Code style changes (formatting)
134
- - `refactor`: Code refactoring
135
- - `test`: Adding/updating tests
136
- - `chore`: Maintenance tasks
137
-
138
- ## Testing
139
-
140
- ### Manual Testing
141
-
142
- Link the package locally in a test project:
143
-
144
- ```json
145
- {
146
- "dependencies": {
147
- "@b3-crow/ui-kit": "file:../ui-kit"
148
- }
149
- }
150
- ```
151
-
152
- For Next.js projects, add to `next.config.ts`:
153
-
154
- ```ts
155
- const nextConfig = {
156
- transpilePackages: ['@b3-crow/ui-kit'],
157
- };
158
- ```
159
-
160
- ### Visual Testing
161
-
162
- Test components in different scenarios:
163
-
164
- - Dark backgrounds
165
- - Light backgrounds
166
- - Different viewport sizes
167
- - Animation triggers
168
- - Scroll behavior
169
-
170
- ## Publishing
171
-
172
- ### Version Bump
173
-
174
- Update version in `package.json`:
175
-
176
- ```json
177
- {
178
- "version": "0.0.25"
179
- }
180
- ```
181
-
182
- ### Build and Publish
183
-
184
- ```bash
185
- # Build the library
186
- bun run build
187
-
188
- # Publish to npm
189
- npm publish
190
- ```
191
-
192
- ### Automated Publishing
193
-
194
- The project uses GitHub Actions for automated publishing:
195
-
196
- - Pushes to `main` trigger automatic version bumps
197
- - Releases are created automatically
198
- - Package is published to npm registry
199
-
200
- ## Contributing
201
-
202
- ### Pull Request Process
203
-
204
- 1. Fork the repository
205
- 2. Create a feature branch: `git checkout -b feat/my-feature`
206
- 3. Make your changes
207
- 4. Commit using conventional commits
208
- 5. Push to your fork
209
- 6. Open a pull request
210
-
211
- ### Code Review
212
-
213
- - All PRs require review before merging
214
- - Ensure CI passes (linting, building)
215
- - Update documentation if needed
216
- - Add examples for new components
217
-
218
- ## File Checklist
219
-
220
- When adding a new component:
221
-
222
- - [ ] Create component in `src/components/`
223
- - [ ] Export from `src/index.ts`
224
- - [ ] Add TypeScript types
225
- - [ ] Document in `docs/components.md`
226
- - [ ] Add examples in `docs/examples.md`
227
- - [ ] Test locally with a consumer project
228
- - [ ] Update version in `package.json`
229
-
230
- ## Troubleshooting
231
-
232
- ### Build Errors
233
-
234
- **TypeScript errors:**
235
-
236
- ```bash
237
- # Check TypeScript configuration
238
- cat tsconfig.json
239
-
240
- # Clean and rebuild
241
- rm -rf dist
242
- bun run build
243
- ```
244
-
245
- **Missing dependencies:**
246
-
247
- ```bash
248
- # Clean install
249
- rm -rf node_modules bun.lock
250
- bun install
251
- ```
252
-
253
- ### Import Errors
254
-
255
- **Cannot resolve module:**
256
-
257
- - Ensure component is exported in `src/index.ts`
258
- - Check `package.json` exports field
259
- - Verify build output in `dist/`
260
-
261
- **Type errors in consumer:**
262
-
263
- - Ensure `.d.ts` files are generated
264
- - Check `types` field in `package.json`
265
- - Rebuild the library
266
-
267
- ### Next.js Integration
268
-
269
- **Module not found:**
270
-
271
- - Add package to `transpilePackages` in `next.config.ts`
272
- - Clear Next.js cache: `rm -rf .next`
273
- - Reinstall dependencies
274
-
275
- **Tailwind classes not working:**
276
-
277
- - Ensure consumer project has Tailwind configured
278
- - Check PostCSS configuration
279
- - Verify Tailwind v4 is installed
280
-
281
- ## Resources
282
-
283
- - [Bun Documentation](https://bun.sh/docs)
284
- - [TypeScript Handbook](https://www.typescriptlang.org/docs/)
285
- - [Tailwind CSS v4](https://tailwindcss.com/docs)
286
- - [Framer Motion](https://www.framer.com/motion/)
287
- - [Conventional Commits](https://www.conventionalcommits.org/)
288
-
289
- ## License
290
-
291
- MIT License - see [LICENSE](../LICENSE) file for details.