Skip to content

Commit 40bf388

Browse files
committed
update readme, button, dialog
Signed-off-by: Richard Castro <[email protected]>
1 parent 4c81a9c commit 40bf388

File tree

5 files changed

+849
-152
lines changed

5 files changed

+849
-152
lines changed

README.md

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,102 @@
11
# tailscale-ui-components
22

33
Tailscale UI component library used by tailscale/corp/adminhttp/panel and tailscale/tailscale/client/web React projects. Not maintained for external use.
4+
5+
## Development Setup
6+
7+
### Prerequisites
8+
9+
Ensure you have the following tools installed:
10+
11+
- **Node.js 22.14.0** (use `nvm` to manage Node versions)
12+
```bash
13+
nvm use 22.14.0
14+
```
15+
- **Yarn 1.22.19** (package manager)
16+
```bash
17+
npm install -g [email protected]
18+
```
19+
20+
### Getting Started
21+
22+
1. **Clone the repository**
23+
```bash
24+
git clone https://github.com/tailscale/tailscale-ui-components.git
25+
cd tailscale-ui-components
26+
```
27+
28+
2. **Install dependencies**
29+
```bash
30+
yarn install
31+
```
32+
33+
3. **Start Storybook for development**
34+
```bash
35+
yarn storybook
36+
```
37+
This will start Storybook on `http://localhost:6006` (or the next available port)
38+
39+
### Available Scripts
40+
41+
- `yarn storybook` - Start Storybook development server
42+
- `yarn build-storybook` - Build Storybook for production
43+
- `yarn build` - Build the component library for production
44+
- `yarn test` - Run tests with Vitest
45+
46+
### Environment Compatibility
47+
48+
This project has been tested and works with:
49+
- **Node.js 22.14.0** (recommended for team consistency)
50+
51+
### Package Management
52+
53+
This project uses **Yarn v1** as the package manager. The `yarn.lock` file should be committed, and `package-lock.json` should be ignored/removed if present.
54+
55+
### Component Development
56+
57+
Components are located in `src/components/` and follow these patterns:
58+
59+
1. **OSS-ready structure** with proper style mappings
60+
2. **Comprehensive TypeScript types** and exported constants
61+
3. **Accessibility features** with proper ARIA attributes
62+
4. **Storybook stories** for documentation and testing
63+
64+
Example component structure:
65+
```
66+
src/components/button/
67+
├── button.tsx # Main component
68+
├── button.stories.tsx # Storybook stories
69+
└── index.ts # Barrel export
70+
```
71+
72+
### Styling Guidelines
73+
74+
- Use the `.button`, `.input`, and other base CSS classes from `src/tailwind.css`
75+
- Follow the established design tokens and color system
76+
- Ensure components have rounded corners and consistent spacing
77+
- Support both light and dark themes
78+
79+
### Contributing
80+
81+
When adding or modifying components:
82+
83+
1. Ensure TypeScript strict mode compliance
84+
2. Add comprehensive Storybook stories
85+
3. Include proper accessibility attributes
86+
4. Follow the established component patterns
87+
5. Export components from `src/index.ts`
88+
89+
### Troubleshooting
90+
91+
**Node.js Version Issues:**
92+
If you encounter build errors, ensure you're using Node.js 22.14.0:
93+
```bash
94+
node --version # Should output v22.14.0
95+
```
96+
97+
**Package Manager Issues:**
98+
If dependencies fail to install, try:
99+
```bash
100+
rm -rf node_modules yarn.lock
101+
yarn install
102+
```

0 commit comments

Comments
 (0)