A shared UI component library for the Ticketing project ecosystem, providing reusable React components across multiple applications.
This component library serves as the central source of truth for shared UI components used throughout the Ticketing project. It enables consistent design patterns, reduces code duplication, and ensures a unified user experience across all applications in the project.
The Ticketing project consists of multiple applications that consume components from this library:
- browse-app - StubHub home page and sign in flow
- vg-browse - viagogo cobrand for home page
- my-account-app - Razor-based support center
- component-library - The shared component library
- Bundler: tsup for fast TypeScript/JavaScript bundling
- Output Formats: CommonJS (
dist/index.js) and ES Modules (dist/index.mjs) - External Dependencies: React and React DOM are marked as peer dependencies
- Package Name:
@ben-windsurf/component-library - Version: 1.0.0
- Main Entry:
dist/index.js - Module Entry:
dist/index.mjs
A customizable search input component with the following features:
- Theme Support: Configurable theme color (default:
#6f42c1) - Icon Integration: Accepts a search icon prop
- Placeholder Text: Customizable placeholder (default: "Search events, artists, teams, and more")
- Styling: Includes CSS with CSS custom properties for theming
Usage Example:
import { SearchBar } from '@ben-windsurf/component-library';
<SearchBar
themeColor="#684cbc"
searchIcon={searchIconSrc}
placeholder="Search for tickets..."
/>npm run build- Build the library for productionnpm run dev- Build in watch mode for developmentnpm run clean- Remove the dist directory
- Create a new component directory in
src/components/ - Follow the existing structure:
src/components/YourComponent/ ├── YourComponent.js ├── YourComponent.css └── index.js - Export the component in
src/index.js - Run
npm run buildto generate the distribution files
Other applications in the Ticketing project can consume this library by:
-
Local Development: Link the package locally
cd component-library npm link cd ../your-app npm link @ben-windsurf/component-library
-
Production: Install from npm registry (when published)
npm install @ben-windsurf/component-library
// Import specific components
import { SearchBar } from '@ben-windsurf/component-library';
// Use in your React components
function App() {
return (
<div>
<SearchBar themeColor="#1c74cc" />
</div>
);
}The component library follows the established design system with these brand colors:
- Primary:
#684cbc - Secondary:
#1c74cc - Tertiary:
#647484 - Facebook Blue:
#38569e
Components are designed with:
- 8px border radius for consistent rounded corners
- Responsive design principles
- Accessibility best practices
When contributing to the component library:
- Ensure components are reusable and configurable
- Include proper TypeScript types (when applicable)
- Add CSS custom properties for theming
- Test components across different consuming applications
- Update this README when adding new components
The library generates the following build artifacts in the dist/ directory:
index.js- CommonJS bundleindex.mjs- ES Module bundleindex.js.map- Source map for debuggingindex.mjs.map- ES Module source map
These files are automatically generated and should not be manually edited.