Package Exports
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@bearlab/core) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@bearlab/core
The foundation package of the BearLab UI ecosystem. Provides essential utilities, icons, constants, and shared components used across all BearLab packages.
📦 Installation
npm install @bearlab/coreyarn add @bearlab/core📋 Requirements
- React >= 16.8.0
- React DOM >= 16.8.0
- TypeScript support included
🎯 What's Included
🎨 Icons Collection
A comprehensive set of optimized SVG icons for common UI interactions and states.
📊 Complete Icon Reference
| Category | Icons |
|---|---|
| Actions | IconAdd, IconDelete, IconUpdate, IconExport, IconSearch, IconCross, IconPlus, IconMinus |
| Navigation | IconArrow, IconArrowDown, IconArrowDown2, IconArrowRight |
| Status | IconTick, IconChecked, IconDisabled, IconSuccess, IconWarning, IconErrorTriangle, IconErrorCircle, IconInfo |
| Interactive | IconCopy, IconUpload, IconEyesOpen, IconEyesClose, IconPing |
| UI Controls | IconFilter, IconDots |
| Loading | IconLoading, IconLoadingSpin |
| Content | IconEmpty, IconDocument |
🔒 Permission Constants
Centralized permission management for consistent access control across your application.
import { PERMISSIONS, USER_ROLES } from "@bearlab/core";
// Example usage
function SecureComponent({ userRole, requiredPermission }) {
const hasPermission = checkUserPermission(userRole, requiredPermission);
if (!hasPermission) {
return <div>Access denied</div>;
}
return <div>Secure content</div>;
}
// Usage with permissions
<SecureComponent
userRole={USER_ROLES.ADMIN}
requiredPermission={PERMISSIONS.WRITE}
/>;📦 Bundle Size
- Icons: ~2-4KB per icon (optimized SVG)
- Constants: ~1KB total
- Tree-shakable: Only imports what you use
🛜 Browser Support
- ✅ Chrome (latest)
- ✅ Firefox (latest)
- ✅ Safari (latest)
- ✅ Edge (latest)
- ✅ iOS Safari
- ✅ Android Chrome
🤝 Contributing
To contribute to the project:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'feat: Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Create a Pull Request
📄 License and 👨💻 Author
MIT © hasanbala
Hasan Bala - @hasanbala
For more UI components, check out the @bearlab/bearlab-ui repository.
Feel free to open an issue for questions or feedback! ⭐
Made with ❤️ by the Bearlab team