@ekoru/ui 0.1.4 โ 0.1.5
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/CHANGELOG.md +8 -0
- package/README.md +174 -121
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
ADDED
package/README.md
CHANGED
|
@@ -1,32 +1,41 @@
|
|
|
1
1
|
# @ekoru/ui
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
> Internal design system and React component library for the Ekoru ecosystem.
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/@ekoru/ui)
|
|
6
6
|
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
[](https://codecov.io/gh/Ignaciofabian93/ekoru-ui)
|
|
7
8
|
|
|
8
9
|
## ๐ฑ About
|
|
9
10
|
|
|
10
|
-
Ekoru UI is
|
|
11
|
+
Ekoru UI is an internal design system built specifically for Ekoru's product ecosystem. It ensures consistent branding, user experience, and maintainability across all Ekoru platforms with sustainability-focused components and design patterns.
|
|
12
|
+
|
|
13
|
+
### Used In
|
|
14
|
+
|
|
15
|
+
- **[www.ekoru.cl](https://www.ekoru.cl)** - Marketing and informational website
|
|
16
|
+
- **[app.ekoru.cl](https://app.ekoru.cl)** - E-commerce platform (in development)
|
|
17
|
+
- **[admin.ekoru.cl](https://admin.ekoru.cl)** - Admin dashboard (in development)
|
|
18
|
+
- Future Ekoru products
|
|
11
19
|
|
|
12
20
|
## โจ Features
|
|
13
21
|
|
|
14
|
-
- ๐จ **
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
22
|
+
- ๐จ **Ekoru Branding** - Custom design system with Ekoru's sustainable aesthetic
|
|
23
|
+
- ๐ **Sustainability-focused** - Components like Environmental Impact Modal, Product Impact Cards
|
|
24
|
+
- โฟ **Accessible** - WCAG 2.1 compliant
|
|
25
|
+
- ๐ฏ **TypeScript** - Full type safety
|
|
26
|
+
- ๐ญ **Customizable** - Built on Tailwind CSS
|
|
27
|
+
- ๐ฆ **Tree-shakeable** - Optimized bundle size
|
|
19
28
|
- ๐งช **Well tested** - Comprehensive test coverage
|
|
20
|
-
- ๐ **Documented** - Storybook
|
|
29
|
+
- ๐ **Documented** - Storybook for all components
|
|
30
|
+
|
|
31
|
+
## ๐จ Note for External Developers
|
|
32
|
+
|
|
33
|
+
This library is **internal to Ekoru** and contains branding-specific components and styling. While it's published as open source, it's designed specifically for Ekoru products and may not be suitable for external projects.
|
|
21
34
|
|
|
22
35
|
## ๐ฆ Installation
|
|
23
36
|
|
|
24
37
|
```bash
|
|
25
|
-
npm install @ekoru/ui
|
|
26
|
-
# or
|
|
27
38
|
pnpm add @ekoru/ui
|
|
28
|
-
# or
|
|
29
|
-
yarn add @ekoru/ui
|
|
30
39
|
```
|
|
31
40
|
|
|
32
41
|
## ๐ Quick Start
|
|
@@ -38,7 +47,7 @@ import '@ekoru/ui/styles';
|
|
|
38
47
|
export default function App() {
|
|
39
48
|
return (
|
|
40
49
|
<Button variant="primary" onClick={() => console.log('clicked')}>
|
|
41
|
-
|
|
50
|
+
Shop Sustainable
|
|
42
51
|
</Button>
|
|
43
52
|
);
|
|
44
53
|
}
|
|
@@ -48,34 +57,60 @@ export default function App() {
|
|
|
48
57
|
|
|
49
58
|
### Importing Styles
|
|
50
59
|
|
|
51
|
-
|
|
60
|
+
Import styles in your root file:
|
|
52
61
|
|
|
53
62
|
```tsx
|
|
54
|
-
// app.tsx or
|
|
63
|
+
// app.tsx or layout.tsx
|
|
55
64
|
import '@ekoru/ui/styles';
|
|
56
65
|
```
|
|
57
66
|
|
|
58
|
-
###
|
|
67
|
+
### Basic Example
|
|
59
68
|
|
|
60
69
|
```tsx
|
|
61
|
-
import { Button, Card, Input } from '@ekoru/ui';
|
|
70
|
+
import { Button, Card, Input, ProductCard } from '@ekoru/ui';
|
|
62
71
|
|
|
63
|
-
function
|
|
72
|
+
function CheckoutPage() {
|
|
64
73
|
return (
|
|
65
|
-
<
|
|
66
|
-
<
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
74
|
+
<div>
|
|
75
|
+
<ProductCard
|
|
76
|
+
name="Eco Water Bottle"
|
|
77
|
+
price={25000}
|
|
78
|
+
image="/products/bottle.jpg"
|
|
79
|
+
environmentalImpact={{
|
|
80
|
+
co2Saved: 2.5,
|
|
81
|
+
waterSaved: 150,
|
|
82
|
+
treesPlanted: 1,
|
|
83
|
+
}}
|
|
84
|
+
/>
|
|
85
|
+
<Card>
|
|
86
|
+
<Input label="Email" placeholder="your@email.com" />
|
|
87
|
+
<Button variant="primary" size="lg" fullWidth>
|
|
88
|
+
Complete Purchase
|
|
89
|
+
</Button>
|
|
90
|
+
</Card>
|
|
91
|
+
</div>
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Using with Next.js
|
|
97
|
+
|
|
98
|
+
```tsx
|
|
99
|
+
// Next.js App Router (app/layout.tsx)
|
|
100
|
+
import '@ekoru/ui/styles';
|
|
101
|
+
|
|
102
|
+
export default function RootLayout({ children }) {
|
|
103
|
+
return (
|
|
104
|
+
<html lang="es">
|
|
105
|
+
<body>{children}</body>
|
|
106
|
+
</html>
|
|
72
107
|
);
|
|
73
108
|
}
|
|
74
109
|
```
|
|
75
110
|
|
|
76
111
|
### Customizing Theme
|
|
77
112
|
|
|
78
|
-
|
|
113
|
+
Extend the Ekoru theme in your Tailwind config:
|
|
79
114
|
|
|
80
115
|
```js
|
|
81
116
|
// tailwind.config.js
|
|
@@ -87,54 +122,53 @@ module.exports = {
|
|
|
87
122
|
theme: {
|
|
88
123
|
extend: {
|
|
89
124
|
colors: {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
},
|
|
125
|
+
// Ekoru brand colors are already included
|
|
126
|
+
// Add custom extensions if needed
|
|
93
127
|
},
|
|
94
128
|
},
|
|
95
129
|
},
|
|
96
130
|
};
|
|
97
131
|
```
|
|
98
132
|
|
|
99
|
-
## ๐จ
|
|
133
|
+
## ๐จ Component Categories
|
|
100
134
|
|
|
101
|
-
###
|
|
135
|
+
### Core Components
|
|
102
136
|
|
|
103
|
-
|
|
137
|
+
General-purpose UI components used across all platforms.
|
|
104
138
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
139
|
+
- **Button** - Primary actions with variants
|
|
140
|
+
- **Input** - Form inputs with validation
|
|
141
|
+
- **Card** - Content containers
|
|
142
|
+
- **Modal** - Dialogs and overlays
|
|
143
|
+
- **Select** - Dropdown selections
|
|
144
|
+
- **Textarea** - Multi-line text inputs
|
|
145
|
+
- **Checkbox** - Boolean inputs
|
|
110
146
|
|
|
111
|
-
|
|
147
|
+
### Ekoru-Specific Components
|
|
112
148
|
|
|
113
|
-
|
|
149
|
+
Custom components for Ekoru's unique features.
|
|
114
150
|
|
|
115
|
-
|
|
151
|
+
- **ProductCard** - E-commerce product display with impact metrics
|
|
152
|
+
- **EnvironmentalImpactModal** - Sustainability impact visualization
|
|
153
|
+
- **HeroCarousel** - Homepage banner carousel
|
|
116
154
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
-
|
|
120
|
-
-
|
|
121
|
-
- Checkbox
|
|
122
|
-
- Radio
|
|
123
|
-
- Toast
|
|
124
|
-
- And many more...
|
|
155
|
+
### Layout Components
|
|
156
|
+
|
|
157
|
+
- **Navbar** - Navigation headers
|
|
158
|
+
- **Footer** - Page footers
|
|
125
159
|
|
|
126
160
|
## ๐ ๏ธ Development
|
|
127
161
|
|
|
128
162
|
### Prerequisites
|
|
129
163
|
|
|
130
|
-
- Node.js >=
|
|
131
|
-
- pnpm >=
|
|
164
|
+
- Node.js >= 20
|
|
165
|
+
- pnpm >= 9
|
|
132
166
|
|
|
133
167
|
### Setup
|
|
134
168
|
|
|
135
169
|
```bash
|
|
136
170
|
# Clone the repository
|
|
137
|
-
git clone https://github.com/
|
|
171
|
+
git clone https://github.com/Ignaciofabian93/ekoru-ui.git
|
|
138
172
|
cd ekoru-ui
|
|
139
173
|
|
|
140
174
|
# Install dependencies
|
|
@@ -146,10 +180,7 @@ pnpm storybook
|
|
|
146
180
|
# Run tests
|
|
147
181
|
pnpm test
|
|
148
182
|
|
|
149
|
-
#
|
|
150
|
-
pnpm test:watch
|
|
151
|
-
|
|
152
|
-
# Build the library
|
|
183
|
+
# Build
|
|
153
184
|
pnpm build
|
|
154
185
|
```
|
|
155
186
|
|
|
@@ -158,94 +189,117 @@ pnpm build
|
|
|
158
189
|
```
|
|
159
190
|
ekoru-ui/
|
|
160
191
|
โโโ src/
|
|
161
|
-
โ โโโ components/
|
|
162
|
-
โ โโโ
|
|
163
|
-
โ โโโ
|
|
164
|
-
โ โโโ
|
|
165
|
-
โโโ
|
|
166
|
-
โโโ
|
|
167
|
-
โโโ
|
|
192
|
+
โ โโโ components/ # React components
|
|
193
|
+
โ โ โโโ Button/
|
|
194
|
+
โ โ โโโ ProductCard/
|
|
195
|
+
โ โ โโโ ...
|
|
196
|
+
โ โโโ utils/ # Utilities
|
|
197
|
+
โ โโโ styles/ # Global styles
|
|
198
|
+
โ โโโ index.ts # Main export
|
|
199
|
+
โโโ test/ # Test setup
|
|
200
|
+
โโโ .storybook/ # Storybook config
|
|
201
|
+
โโโ .changeset/ # Changesets
|
|
168
202
|
```
|
|
169
203
|
|
|
170
|
-
###
|
|
204
|
+
### Scripts
|
|
171
205
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
206
|
+
| Command | Description |
|
|
207
|
+
| -------------------- | ------------------------ |
|
|
208
|
+
| `pnpm dev` | Start development mode |
|
|
209
|
+
| `pnpm build` | Build for production |
|
|
210
|
+
| `pnpm test` | Run tests |
|
|
211
|
+
| `pnpm test:watch` | Run tests in watch mode |
|
|
212
|
+
| `pnpm test:coverage` | Generate coverage report |
|
|
213
|
+
| `pnpm storybook` | Start Storybook |
|
|
214
|
+
| `pnpm lint` | Lint code |
|
|
215
|
+
| `pnpm type-check` | Check TypeScript types |
|
|
216
|
+
| `pnpm changeset` | Create a changeset |
|
|
177
217
|
|
|
178
|
-
|
|
218
|
+
## ๐ Release Workflow
|
|
179
219
|
|
|
180
|
-
|
|
181
|
-
// src/components/MyComponent/MyComponent.tsx
|
|
182
|
-
import { cn } from '@/utils/cn';
|
|
183
|
-
|
|
184
|
-
export interface MyComponentProps {
|
|
185
|
-
className?: string;
|
|
186
|
-
children: React.ReactNode;
|
|
187
|
-
}
|
|
220
|
+
We use [Changesets](https://github.com/changesets/changesets) for automated versioning and publishing.
|
|
188
221
|
|
|
189
|
-
|
|
190
|
-
return <div className={cn('my-component', className)}>{children}</div>;
|
|
191
|
-
};
|
|
192
|
-
```
|
|
222
|
+
### Making Changes
|
|
193
223
|
|
|
194
|
-
|
|
224
|
+
1. Create a feature branch
|
|
195
225
|
|
|
196
226
|
```bash
|
|
197
|
-
|
|
198
|
-
|
|
227
|
+
git checkout -b feature/new-component
|
|
228
|
+
```
|
|
199
229
|
|
|
200
|
-
|
|
201
|
-
pnpm test:watch
|
|
230
|
+
2. Make your changes
|
|
202
231
|
|
|
203
|
-
|
|
204
|
-
pnpm test:coverage
|
|
232
|
+
3. Create a changeset
|
|
205
233
|
|
|
206
|
-
|
|
207
|
-
pnpm
|
|
234
|
+
```bash
|
|
235
|
+
pnpm changeset
|
|
208
236
|
```
|
|
209
237
|
|
|
210
|
-
|
|
238
|
+
- Select change type: `patch` / `minor` / `major`
|
|
239
|
+
- Write a clear description
|
|
240
|
+
|
|
241
|
+
4. Commit and push
|
|
211
242
|
|
|
212
243
|
```bash
|
|
213
|
-
|
|
214
|
-
|
|
244
|
+
git add .
|
|
245
|
+
git commit -m "feat: add ProductCard component"
|
|
246
|
+
git push
|
|
247
|
+
```
|
|
215
248
|
|
|
216
|
-
|
|
217
|
-
|
|
249
|
+
5. GitHub Actions will:
|
|
250
|
+
- Run tests and builds
|
|
251
|
+
- Create a Version PR when merged to `main`
|
|
252
|
+
- Auto-publish to npm when Version PR is merged
|
|
218
253
|
|
|
219
|
-
|
|
220
|
-
pnpm type-check
|
|
221
|
-
```
|
|
254
|
+
๐ **See [CHANGESETS.md](./docs/CHANGESETS.md) for detailed workflow guide**
|
|
222
255
|
|
|
223
256
|
## ๐ค Contributing
|
|
224
257
|
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
### Development Workflow
|
|
258
|
+
This is an internal project for Ekoru team members. If you're part of the team:
|
|
228
259
|
|
|
229
260
|
1. Fork the repository
|
|
230
|
-
2. Create a feature branch
|
|
261
|
+
2. Create a feature branch
|
|
231
262
|
3. Make your changes
|
|
232
263
|
4. Run tests: `pnpm test`
|
|
233
264
|
5. Create a changeset: `pnpm changeset`
|
|
234
|
-
6.
|
|
235
|
-
7. Push to your fork: `git push origin feature/my-feature`
|
|
236
|
-
8. Open a Pull Request
|
|
265
|
+
6. Open a Pull Request
|
|
237
266
|
|
|
238
|
-
|
|
267
|
+
### Contribution Guidelines
|
|
239
268
|
|
|
240
|
-
|
|
269
|
+
- Write tests for new components
|
|
270
|
+
- Update Storybook stories
|
|
271
|
+
- Follow the existing code style
|
|
272
|
+
- Keep components accessible (WCAG 2.1)
|
|
273
|
+
- Use TypeScript strictly
|
|
274
|
+
- Document props and usage
|
|
241
275
|
|
|
242
|
-
|
|
276
|
+
## ๐ Documentation
|
|
277
|
+
|
|
278
|
+
- **Storybook**: Component documentation and playground
|
|
279
|
+
- **Changesets**: [CHANGESETS.md](./CHANGESETS.md) - Release workflow guide
|
|
280
|
+
- **TypeScript**: Full type definitions included
|
|
281
|
+
|
|
282
|
+
## ๐งช Testing
|
|
243
283
|
|
|
244
284
|
```bash
|
|
245
|
-
|
|
285
|
+
# Run all tests
|
|
286
|
+
pnpm test
|
|
287
|
+
|
|
288
|
+
# Watch mode
|
|
289
|
+
pnpm test:watch
|
|
290
|
+
|
|
291
|
+
# Coverage report
|
|
292
|
+
pnpm test:coverage
|
|
293
|
+
|
|
294
|
+
# UI mode
|
|
295
|
+
pnpm test:ui
|
|
246
296
|
```
|
|
247
297
|
|
|
248
|
-
|
|
298
|
+
We use:
|
|
299
|
+
|
|
300
|
+
- **Vitest** for unit testing
|
|
301
|
+
- **React Testing Library** for component testing
|
|
302
|
+
- **Codecov** for coverage tracking
|
|
249
303
|
|
|
250
304
|
## ๐ License
|
|
251
305
|
|
|
@@ -253,20 +307,19 @@ MIT ยฉ [Ekoru](https://ekoru.cl)
|
|
|
253
307
|
|
|
254
308
|
## ๐ Links
|
|
255
309
|
|
|
256
|
-
- [
|
|
257
|
-
- [
|
|
258
|
-
- [
|
|
259
|
-
- [
|
|
310
|
+
- [GitHub Repository](https://github.com/Ignaciofabian93/ekoru-ui)
|
|
311
|
+
- [npm Package](https://www.npmjs.com/package/@ekoru/ui)
|
|
312
|
+
- [Ekoru Website](https://www.ekoru.cl)
|
|
313
|
+
- [Ekoru Platform](https://app.ekoru.cl)
|
|
260
314
|
|
|
261
|
-
##
|
|
315
|
+
## ๐ Internal Support
|
|
262
316
|
|
|
263
|
-
|
|
317
|
+
For Ekoru team members:
|
|
264
318
|
|
|
265
|
-
-
|
|
266
|
-
-
|
|
267
|
-
-
|
|
268
|
-
- ๐ค Contributing to the codebase
|
|
319
|
+
- Slack: `#ekoru-ui` channel
|
|
320
|
+
- Issues: [GitHub Issues](https://github.com/Ignaciofabian93/ekoru-ui/issues)
|
|
321
|
+
- Lead: Ignacio Rodriguez (ignaciorodriguez@ekoru.cl)
|
|
269
322
|
|
|
270
323
|
---
|
|
271
324
|
|
|
272
|
-
|
|
325
|
+
Built with ๐ by the Ekoru team for a sustainable future.
|
package/dist/index.d.mts
CHANGED
|
@@ -195,8 +195,8 @@ declare function Modal({ isOpen, onClose, children, title, size, showCloseButton
|
|
|
195
195
|
|
|
196
196
|
interface NavbarProps {
|
|
197
197
|
brand?: React__default.ReactNode;
|
|
198
|
-
navigationIcons?:
|
|
199
|
-
navigationLinks?:
|
|
198
|
+
navigationIcons?: React__default.ReactNode;
|
|
199
|
+
navigationLinks?: React__default.ReactNode;
|
|
200
200
|
searchPlaceholder?: string;
|
|
201
201
|
onSearch?: (query: string) => void;
|
|
202
202
|
mobileMenuContent?: React__default.ReactNode;
|
package/dist/index.d.ts
CHANGED
|
@@ -195,8 +195,8 @@ declare function Modal({ isOpen, onClose, children, title, size, showCloseButton
|
|
|
195
195
|
|
|
196
196
|
interface NavbarProps {
|
|
197
197
|
brand?: React__default.ReactNode;
|
|
198
|
-
navigationIcons?:
|
|
199
|
-
navigationLinks?:
|
|
198
|
+
navigationIcons?: React__default.ReactNode;
|
|
199
|
+
navigationLinks?: React__default.ReactNode;
|
|
200
200
|
searchPlaceholder?: string;
|
|
201
201
|
onSearch?: (query: string) => void;
|
|
202
202
|
mobileMenuContent?: React__default.ReactNode;
|