@calimero-network/mero-design 0.0.0-bootstrap.0 → 1.0.0-rc.32
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/LICENSE +21 -0
- package/README.md +301 -1
- package/dist/index.d.mts +2065 -0
- package/dist/index.d.ts +2065 -0
- package/dist/index.js +39564 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +39446 -0
- package/dist/index.mjs.map +1 -0
- package/dist/styles.css +37 -0
- package/package.json +59 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Calimero Ltd
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,303 @@
|
|
|
1
1
|
# @calimero-network/mero-design
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> Formerly `@calimero-network/mero-ui` (up to 1.5.2). Replace `@calimero-network/mero-ui` with `@calimero-network/mero-design` in your imports and `package.json`; the components are the same.
|
|
4
|
+
|
|
5
|
+
A comprehensive React UI component library built for the Calimero design system. This package provides a complete set of accessible, customizable components with built-in dark theme support.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @calimero-network/mero-design
|
|
11
|
+
# or
|
|
12
|
+
yarn add @calimero-network/mero-design
|
|
13
|
+
# or
|
|
14
|
+
pnpm add @calimero-network/mero-design
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Quick Start
|
|
18
|
+
|
|
19
|
+
### 1. Import CSS Variables
|
|
20
|
+
|
|
21
|
+
**Important**: You must import the CSS variables for proper styling. Choose one of the following methods:
|
|
22
|
+
|
|
23
|
+
#### Option A: Import CSS file directly
|
|
24
|
+
|
|
25
|
+
```css
|
|
26
|
+
/* In your main CSS file */
|
|
27
|
+
@import "@calimero-network/mero-design/styles.css";
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
#### Option B: Import in HTML
|
|
31
|
+
|
|
32
|
+
```html
|
|
33
|
+
<link
|
|
34
|
+
rel="stylesheet"
|
|
35
|
+
href="node_modules/@calimero-network/mero-design/dist/styles.css"
|
|
36
|
+
/>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
#### Option C: Programmatic injection
|
|
40
|
+
|
|
41
|
+
```javascript
|
|
42
|
+
import { cssVariables } from "@calimero-network/mero-design";
|
|
43
|
+
|
|
44
|
+
// Inject CSS variables into your document
|
|
45
|
+
const style = document.createElement("style");
|
|
46
|
+
style.textContent = cssVariables;
|
|
47
|
+
document.head.appendChild(style);
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### 2. Import and use components
|
|
51
|
+
|
|
52
|
+
```jsx
|
|
53
|
+
import React from "react";
|
|
54
|
+
import { Button, Card, Text, Input } from "@calimero-network/mero-design";
|
|
55
|
+
|
|
56
|
+
function App() {
|
|
57
|
+
return (
|
|
58
|
+
<div>
|
|
59
|
+
<Card>
|
|
60
|
+
<Text size="lg" weight="bold">
|
|
61
|
+
Welcome to Calimero UI
|
|
62
|
+
</Text>
|
|
63
|
+
<Input placeholder="Enter your name" />
|
|
64
|
+
<Button variant="primary">Get Started</Button>
|
|
65
|
+
</Card>
|
|
66
|
+
</div>
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export default App;
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Available Components
|
|
74
|
+
|
|
75
|
+
### Layout & Structure
|
|
76
|
+
|
|
77
|
+
- **Box** - Flexible container component
|
|
78
|
+
- **Flex** - Flexbox container
|
|
79
|
+
- **Stack** - Vertical/horizontal stack layout
|
|
80
|
+
- **Grid** & **GridItem** - CSS Grid layout system
|
|
81
|
+
- **Center** - Center content horizontally and vertically
|
|
82
|
+
- **Spacer** - Add spacing between elements
|
|
83
|
+
- **Layout** - Main layout wrapper
|
|
84
|
+
- **Container** - Responsive container
|
|
85
|
+
- **AuthLayout** - Authentication page layout
|
|
86
|
+
|
|
87
|
+
### Navigation
|
|
88
|
+
|
|
89
|
+
- **Navbar** - Top navigation bar
|
|
90
|
+
- **Sidebar** - Side navigation panel
|
|
91
|
+
- **Breadcrumbs** - Navigation breadcrumbs
|
|
92
|
+
- **Menu** - Dropdown and context menus
|
|
93
|
+
- **Tabs** - Tab navigation
|
|
94
|
+
- **Accordion** - Collapsible content sections
|
|
95
|
+
- **CommandPalette** - Command search interface
|
|
96
|
+
|
|
97
|
+
### Forms & Input
|
|
98
|
+
|
|
99
|
+
- **Input** - Text input field
|
|
100
|
+
- **Textarea** - Multi-line text input
|
|
101
|
+
- **NumberInput** - Numeric input with controls
|
|
102
|
+
- **Select** - Dropdown selection
|
|
103
|
+
- **Checkbox** - Checkbox input
|
|
104
|
+
- **Radio** & **RadioGroup** - Radio button inputs
|
|
105
|
+
- **Switch** - Toggle switch
|
|
106
|
+
- **DatePicker** - Date selection
|
|
107
|
+
- **TimePicker** - Time selection
|
|
108
|
+
- **FileUpload** - File upload component
|
|
109
|
+
- **SearchInput** - Search input with suggestions
|
|
110
|
+
- **TagInput** - Tag input with autocomplete
|
|
111
|
+
- **RichTextEditor** - Rich text editing with Tiptap. Render HTML from another member through `sanitizeRichTextHtml(html)`, never raw: it keeps only what the editor can produce.
|
|
112
|
+
- **Form** - Form wrapper with validation
|
|
113
|
+
- **BuildWizard** - Multi-step form wizard
|
|
114
|
+
|
|
115
|
+
### Data Display
|
|
116
|
+
|
|
117
|
+
- **Table** - Data tables with sorting and filtering
|
|
118
|
+
- **DataTable** - Advanced data table
|
|
119
|
+
- **EditableTable** - Editable data table
|
|
120
|
+
- **TreeTable** - Hierarchical data table
|
|
121
|
+
- **List** - List display component
|
|
122
|
+
- **Tree** - Tree view component
|
|
123
|
+
- **Calendar** - Calendar component
|
|
124
|
+
- **Timeline** - Timeline display
|
|
125
|
+
- **StatCard** - Statistics display card
|
|
126
|
+
- **MetricCard** - Metrics with charts
|
|
127
|
+
- **TrendIndicator** - Trend visualization
|
|
128
|
+
- **EmptyState** - Empty state displays
|
|
129
|
+
- **Skeleton** - Loading placeholders
|
|
130
|
+
|
|
131
|
+
### Feedback & Status
|
|
132
|
+
|
|
133
|
+
- **Alert** - Alert messages
|
|
134
|
+
- **Banner** - Banner notifications
|
|
135
|
+
- **Toast** - Toast notifications
|
|
136
|
+
- **NotificationCenter** - Notification management
|
|
137
|
+
- **Badge** - Status badges
|
|
138
|
+
- **Progress** - Progress indicators
|
|
139
|
+
- **Loader** - Loading spinners
|
|
140
|
+
- **Spinner** - Loading spinner
|
|
141
|
+
- **Modal** - Modal dialogs
|
|
142
|
+
- **Popover** - Popover content
|
|
143
|
+
- **Tooltip** - Tooltip overlays
|
|
144
|
+
|
|
145
|
+
### Media & Content
|
|
146
|
+
|
|
147
|
+
- **Avatar** - User avatar display
|
|
148
|
+
- **Image** - Image component
|
|
149
|
+
- **Icon** - Icon component
|
|
150
|
+
- **Divider** - Visual separators
|
|
151
|
+
- **FilePreview** - File preview component
|
|
152
|
+
|
|
153
|
+
### Typography
|
|
154
|
+
|
|
155
|
+
- **Text** - Text component with variants
|
|
156
|
+
- **Heading** - Heading components
|
|
157
|
+
- **Code** - Code display
|
|
158
|
+
- **Link** - Link component
|
|
159
|
+
|
|
160
|
+
### Utility
|
|
161
|
+
|
|
162
|
+
- **Tag** - Tag component
|
|
163
|
+
- **CopyToClipboard** - Copy to clipboard utility
|
|
164
|
+
- **SearchHighlight** - Search result highlighting
|
|
165
|
+
|
|
166
|
+
## Design Tokens
|
|
167
|
+
|
|
168
|
+
The package includes comprehensive design tokens for consistent styling:
|
|
169
|
+
|
|
170
|
+
### Colors
|
|
171
|
+
|
|
172
|
+
```javascript
|
|
173
|
+
import { colors } from "@calimero-network/mero-design";
|
|
174
|
+
|
|
175
|
+
// Brand colors
|
|
176
|
+
colors.brand[600]; // Primary brand color
|
|
177
|
+
colors.brand[700]; // Darker brand color
|
|
178
|
+
|
|
179
|
+
// Neutral colors
|
|
180
|
+
colors.neutral[200]; // Light gray
|
|
181
|
+
colors.neutral[800]; // Dark gray
|
|
182
|
+
|
|
183
|
+
// Semantic colors
|
|
184
|
+
colors.semantic.success; // Success green
|
|
185
|
+
colors.semantic.error; // Error red
|
|
186
|
+
colors.semantic.warning; // Warning orange
|
|
187
|
+
colors.semantic.info; // Info blue
|
|
188
|
+
|
|
189
|
+
// Background colors
|
|
190
|
+
colors.background.primary; // Primary background
|
|
191
|
+
colors.background.secondary; // Secondary background
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
### Spacing
|
|
195
|
+
|
|
196
|
+
```javascript
|
|
197
|
+
import { spacing } from "@calimero-network/mero-design";
|
|
198
|
+
|
|
199
|
+
spacing[2]; // 0.5rem
|
|
200
|
+
spacing[4]; // 1rem
|
|
201
|
+
spacing[6]; // 1.5rem
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
### Typography
|
|
205
|
+
|
|
206
|
+
```javascript
|
|
207
|
+
import { fonts } from "@calimero-network/mero-design";
|
|
208
|
+
|
|
209
|
+
fonts.body; // Main body font
|
|
210
|
+
fonts.heading; // Heading font
|
|
211
|
+
fonts.secondary; // Secondary font
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
### Border Radius
|
|
215
|
+
|
|
216
|
+
```javascript
|
|
217
|
+
import { radius } from "@calimero-network/mero-design";
|
|
218
|
+
|
|
219
|
+
radius.sm; // 8px
|
|
220
|
+
radius.md; // 12px
|
|
221
|
+
radius.lg; // 16px
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
## CSS Variables
|
|
225
|
+
|
|
226
|
+
All design tokens are available as CSS variables:
|
|
227
|
+
|
|
228
|
+
```css
|
|
229
|
+
.my-component {
|
|
230
|
+
background-color: var(--color-background-primary);
|
|
231
|
+
color: var(--color-neutral-200);
|
|
232
|
+
font-family: var(--font-body);
|
|
233
|
+
border-radius: var(--radius-md);
|
|
234
|
+
padding: var(--space-4);
|
|
235
|
+
border: 1px solid var(--color-neutral-600);
|
|
236
|
+
}
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
### Available CSS Variables
|
|
240
|
+
|
|
241
|
+
#### Colors
|
|
242
|
+
|
|
243
|
+
- `--color-neutral-200` to `--color-neutral-900`
|
|
244
|
+
- `--color-brand-100`, `--color-brand-600` to `--color-brand-900`
|
|
245
|
+
- `--color-background-primary`, `--color-background-secondary`, `--color-background-tertiary`
|
|
246
|
+
- `--color-semantic-success`, `--color-semantic-warning`, `--color-semantic-error`, `--color-semantic-info`
|
|
247
|
+
|
|
248
|
+
#### Spacing
|
|
249
|
+
|
|
250
|
+
- `--space-2`, `--space-3`, `--space-4`, `--space-6`
|
|
251
|
+
|
|
252
|
+
#### Border Radius
|
|
253
|
+
|
|
254
|
+
- `--radius-sm`, `--radius-md`, `--radius-lg`
|
|
255
|
+
|
|
256
|
+
#### Fonts
|
|
257
|
+
|
|
258
|
+
- `--font-body`, `--font-heading`, `--font-secondary`
|
|
259
|
+
|
|
260
|
+
## Theming
|
|
261
|
+
|
|
262
|
+
The design system is built with a dark theme as the default. All components automatically use the appropriate colors and styling for the dark theme. The CSS variables ensure consistent theming across all components.
|
|
263
|
+
|
|
264
|
+
## TypeScript Support
|
|
265
|
+
|
|
266
|
+
Full TypeScript support is included with comprehensive type definitions for all components and their props.
|
|
267
|
+
|
|
268
|
+
```typescript
|
|
269
|
+
import { Button, ButtonProps } from '@calimero-network/mero-design';
|
|
270
|
+
|
|
271
|
+
const MyButton: React.FC<ButtonProps> = ({ variant, children, ...props }) => {
|
|
272
|
+
return <Button variant={variant} {...props}>{children}</Button>;
|
|
273
|
+
};
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
## Accessibility
|
|
277
|
+
|
|
278
|
+
All components are built with accessibility in mind, including:
|
|
279
|
+
|
|
280
|
+
- Proper ARIA attributes
|
|
281
|
+
- Keyboard navigation support
|
|
282
|
+
- Screen reader compatibility
|
|
283
|
+
- Focus management
|
|
284
|
+
- Color contrast compliance
|
|
285
|
+
|
|
286
|
+
## Browser Support
|
|
287
|
+
|
|
288
|
+
- Chrome (latest)
|
|
289
|
+
- Firefox (latest)
|
|
290
|
+
- Safari (latest)
|
|
291
|
+
- Edge (latest)
|
|
292
|
+
|
|
293
|
+
## Contributing
|
|
294
|
+
|
|
295
|
+
This package is part of the Calimero design system. For contributing guidelines and development setup, please refer to the main design system repository.
|
|
296
|
+
|
|
297
|
+
## License
|
|
298
|
+
|
|
299
|
+
This package is part of the Calimero project. Please refer to the main project for licensing information.
|
|
300
|
+
|
|
301
|
+
## Changelog
|
|
302
|
+
|
|
303
|
+
See [CHANGELOG.md](./CHANGELOG.md) for a detailed list of changes and updates.
|