one-north-cla 0.0.0
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.
- package/README.md +144 -0
- package/dist/index.cjs.js +56 -0
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.d.ts +140 -0
- package/dist/index.es.js +10941 -0
- package/dist/index.es.js.map +1 -0
- package/dist/style.css +1 -0
- package/package.json +97 -0
package/README.md
ADDED
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
# OneNorthCLA - Component Library Architecture
|
|
2
|
+
|
|
3
|
+
A modern React component UI library built with TypeScript, Vite, and TailwindCSS.
|
|
4
|
+
|
|
5
|
+
## π€ Contributing
|
|
6
|
+
|
|
7
|
+
The following configurations have been carefully established to ensure code quality, consistency, and reliable automated checks across this repository.
|
|
8
|
+
|
|
9
|
+
**Do not modify these configurations without explicit agreement from the team lead or repository owner:**
|
|
10
|
+
|
|
11
|
+
- Husky hooks (.husky/)
|
|
12
|
+
- ESLint configuration (eslint.config.js)
|
|
13
|
+
- Prettier rules (.prettierrc / package.json)
|
|
14
|
+
- TypeScript configuration (tsconfig*.json)
|
|
15
|
+
|
|
16
|
+
Unauthorized changes may break automated checks, introduce inconsistencies, or disrupt development workflows.
|
|
17
|
+
|
|
18
|
+
1. Follow the established component patterns
|
|
19
|
+
2. Add Storybook stories for new components
|
|
20
|
+
3. Ensure TypeScript compilation passes
|
|
21
|
+
4. Update documentation as needed within the `docs/` directory
|
|
22
|
+
|
|
23
|
+
## π Quick Start
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
# Install dependencies
|
|
27
|
+
npm install
|
|
28
|
+
|
|
29
|
+
# Start development server
|
|
30
|
+
npm run dev
|
|
31
|
+
|
|
32
|
+
# Start Storybook
|
|
33
|
+
npm run storybook
|
|
34
|
+
|
|
35
|
+
# Build for production
|
|
36
|
+
npm run build
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## π Project Structure
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
OneNorthCLA/
|
|
43
|
+
βββ src/
|
|
44
|
+
β βββ components/
|
|
45
|
+
β β βββ composites/
|
|
46
|
+
β β β βββ ContentCarouselMultiple/
|
|
47
|
+
β β β βββContentPrimaryFeatureDetail/
|
|
48
|
+
β β βββ foundations/
|
|
49
|
+
β β βββ BackgroundVideo/
|
|
50
|
+
β β βββ Button/
|
|
51
|
+
β β βββ ButtonSocial/
|
|
52
|
+
β β βββ PageMargins/
|
|
53
|
+
β β βββ PlayButton/
|
|
54
|
+
β β βββ Share/
|
|
55
|
+
β β βββ TextCta/
|
|
56
|
+
β βββ lib/ # Utilities and helpers
|
|
57
|
+
β β βββ hooks/
|
|
58
|
+
β β βββ utils/
|
|
59
|
+
β βββ assets/ # Static assets
|
|
60
|
+
βββ public/ # Public assets
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## ποΈ Architecture Overview
|
|
64
|
+
|
|
65
|
+
### Component Separation
|
|
66
|
+
|
|
67
|
+
This project follows a clean architecture pattern that separates concerns:
|
|
68
|
+
|
|
69
|
+
- **Base Components** (`src/components/`): Pure React components with no Sitecore dependencies
|
|
70
|
+
- **Utilities** (`src/lib/`): Shared utilities, hooks, and the component factory
|
|
71
|
+
|
|
72
|
+
### Key Design Principles
|
|
73
|
+
|
|
74
|
+
1. **Separation of Concerns**: Base components are framework-agnostic
|
|
75
|
+
2. **Composition over Inheritance**: Components are designed to be composable
|
|
76
|
+
3. **Type Safety**: Full TypeScript support throughout the codebase
|
|
77
|
+
4. **Storybook Integration**: Comprehensive documentation and testing via Storybook
|
|
78
|
+
|
|
79
|
+
## π§© Available Components
|
|
80
|
+
|
|
81
|
+
## π οΈ Development
|
|
82
|
+
|
|
83
|
+
### Prerequisites
|
|
84
|
+
|
|
85
|
+
- Node.js 18+
|
|
86
|
+
- Any package manager
|
|
87
|
+
- Do not commit lockfile
|
|
88
|
+
|
|
89
|
+
### Scripts
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
# Development
|
|
93
|
+
npm run dev # Start Vite dev server
|
|
94
|
+
npm run storybook # Start Storybook
|
|
95
|
+
|
|
96
|
+
# Building
|
|
97
|
+
npm run build # Build for production
|
|
98
|
+
npm run build-storybook # Build Storybook
|
|
99
|
+
|
|
100
|
+
# Quality
|
|
101
|
+
npm run lint # Run ESLint
|
|
102
|
+
npm run preview # Preview production build
|
|
103
|
+
npm run type-check # Run TSC
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### Adding New Components
|
|
107
|
+
|
|
108
|
+
1. **Create Base Component**:
|
|
109
|
+
```bash
|
|
110
|
+
mkdir src/components/NewComponent
|
|
111
|
+
touch src/components/NewComponent/index.ts
|
|
112
|
+
touch src/components/NewComponent/NewComponent.tsx
|
|
113
|
+
touch src/components/NewComponent/NewComponent.stories.tsx
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
2. **Update Exports**:
|
|
117
|
+
- Add to `src/components/index.ts`
|
|
118
|
+
|
|
119
|
+
## π Documentation
|
|
120
|
+
|
|
121
|
+
- **Storybook**: Run `npm run storybook` for interactive component documentation
|
|
122
|
+
- **TypeScript**: Full type definitions for all components
|
|
123
|
+
|
|
124
|
+
## π§ Configuration
|
|
125
|
+
|
|
126
|
+
### Vite Configuration
|
|
127
|
+
- React with Fast Refresh
|
|
128
|
+
- TypeScript support
|
|
129
|
+
- SVG imports as React components
|
|
130
|
+
- Tailwind CSS integration
|
|
131
|
+
|
|
132
|
+
### ESLint Configuration
|
|
133
|
+
- TypeScript-aware linting
|
|
134
|
+
- React-specific rules
|
|
135
|
+
- Storybook integration
|
|
136
|
+
|
|
137
|
+
### Storybook Configuration
|
|
138
|
+
- Component documentation
|
|
139
|
+
- Interactive examples
|
|
140
|
+
- Preview example usage as code
|
|
141
|
+
|
|
142
|
+
## π License
|
|
143
|
+
|
|
144
|
+
This project is private and proprietary to OneNorth.
|