noorui-rtl 0.2.2 → 0.2.4
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 +99 -0
- package/CONTRIBUTING.md +313 -0
- package/README.md +172 -627
- package/components/index.ts +0 -5
- package/components/providers/client-providers.tsx +2 -2
- package/components/providers/design-system-provider.tsx +1 -1
- package/components/providers/direction-provider.tsx +1 -1
- package/components/ui/accordion.tsx +1 -1
- package/components/ui/alert.tsx +1 -1
- package/components/ui/arabic-number.tsx +2 -2
- package/components/ui/avatar.tsx +1 -1
- package/components/ui/badge.tsx +1 -1
- package/components/ui/breadcrumb.tsx +1 -1
- package/components/ui/button.tsx +2 -2
- package/components/ui/calendar.tsx +4 -4
- package/components/ui/card.tsx +1 -1
- package/components/ui/chat-message.tsx +5 -5
- package/components/ui/checkbox.tsx +1 -1
- package/components/ui/command.tsx +2 -2
- package/components/ui/context-menu.tsx +1 -1
- package/components/ui/conversation-history.tsx +7 -7
- package/components/ui/dashboard-shell.tsx +9 -9
- package/components/ui/data-table.tsx +7 -7
- package/components/ui/date-picker.tsx +6 -6
- package/components/ui/dialog.tsx +1 -1
- package/components/ui/dropdown-menu.tsx +1 -1
- package/components/ui/empty-state.tsx +1 -1
- package/components/ui/feature-card.tsx +2 -2
- package/components/ui/file-upload.tsx +4 -4
- package/components/ui/form.tsx +2 -2
- package/components/ui/hijri-date.tsx +4 -4
- package/components/ui/input.tsx +1 -1
- package/components/ui/label.tsx +1 -1
- package/components/ui/listing-card.tsx +4 -4
- package/components/ui/loading-spinner.tsx +1 -1
- package/components/ui/message-actions.tsx +4 -4
- package/components/ui/model-selector.tsx +5 -5
- package/components/ui/notification-center.tsx +7 -7
- package/components/ui/number-input.tsx +3 -3
- package/components/ui/pagination.tsx +2 -2
- package/components/ui/parameter-slider.tsx +8 -8
- package/components/ui/popover.tsx +1 -1
- package/components/ui/prayer-times.tsx +6 -6
- package/components/ui/progress.tsx +1 -1
- package/components/ui/prompt-input.tsx +4 -4
- package/components/ui/radio-group.tsx +1 -1
- package/components/ui/rich-text-editor.tsx +2 -2
- package/components/ui/scroll-area.tsx +1 -1
- package/components/ui/select.tsx +2 -2
- package/components/ui/separator.tsx +1 -1
- package/components/ui/sheet.tsx +1 -1
- package/components/ui/skeleton.tsx +1 -1
- package/components/ui/slider.tsx +1 -1
- package/components/ui/stepper.tsx +3 -3
- package/components/ui/streaming-text.tsx +1 -1
- package/components/ui/switch.tsx +1 -1
- package/components/ui/table.tsx +1 -1
- package/components/ui/tabs.tsx +2 -2
- package/components/ui/textarea.tsx +1 -1
- package/components/ui/thinking-indicator.tsx +3 -3
- package/components/ui/time-picker.tsx +8 -8
- package/components/ui/toast.tsx +1 -1
- package/components/ui/toaster.tsx +2 -2
- package/components/ui/token-counter.tsx +6 -6
- package/components/ui/tooltip.tsx +1 -1
- package/components/ui/user-menu.tsx +4 -4
- package/components/ui/workflow-canvas.tsx +1 -1
- package/components/ui/workflow-node.tsx +3 -3
- package/components/ui/workflow-nodes.tsx +1 -1
- package/components/ui/zakat-calculator.tsx +10 -10
- package/hooks/use-toast.ts +1 -1
- package/lib/i18n/ar/themes.ts +10 -0
- package/lib/i18n/en/themes.ts +10 -0
- package/package.json +8 -3
- package/styles/globals.css +10 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to Noor UI will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [0.2.1] - 2025-11-20
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
- Updated package structure with complete barrel exports
|
|
12
|
+
- Fixed TypeScript exports in components/index.ts
|
|
13
|
+
- Updated homepage URL to noorui.com
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
- Complete barrel export with all 64 components
|
|
17
|
+
- CHANGELOG.md, CONTRIBUTING.md documentation
|
|
18
|
+
- Improved package files configuration
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## [0.2.0] - 2025-11-20
|
|
23
|
+
|
|
24
|
+
### Added
|
|
25
|
+
|
|
26
|
+
Major update to Noor UI with significant component additions and improvements.
|
|
27
|
+
|
|
28
|
+
**Core Components (54)**
|
|
29
|
+
- Form components: Form, Button, Input, Label, Textarea, Checkbox, Radio Group, Select, Switch, Slider
|
|
30
|
+
- Layout components: Card, Separator, Tabs, Accordion, Collapsible
|
|
31
|
+
- Navigation: Breadcrumb, Pagination, Command
|
|
32
|
+
- Feedback: Alert, Toast, Progress, Skeleton, Badge, Avatar
|
|
33
|
+
- Overlays: Dialog, Sheet, Popover, Tooltip, Dropdown Menu, Context Menu
|
|
34
|
+
- Data display: Table, DataTable, StatsCard, FeatureCard, EmptyState, ListingCard
|
|
35
|
+
- Advanced forms: File Upload, Rich Text Editor, Date Picker, Time Picker, Number Input
|
|
36
|
+
- Layout shells: Dashboard Shell
|
|
37
|
+
- User interface: User Menu, Notification Center, Stepper
|
|
38
|
+
|
|
39
|
+
**GCC-Specific Components (5)**
|
|
40
|
+
- Prayer Times with countdown and Adhan notifications
|
|
41
|
+
- Hijri Date with dual calendar display
|
|
42
|
+
- Arabic Number utilities for Arabic-Indic numerals
|
|
43
|
+
- Zakat Calculator with export/sharing
|
|
44
|
+
- Calendar with Gregorian/Hijri support
|
|
45
|
+
|
|
46
|
+
**AI/LLM Components (10)** 🧪 Experimental
|
|
47
|
+
- ChatMessage, StreamingText, PromptInput, ThinkingIndicator
|
|
48
|
+
- MessageActions, ModelSelector, ParameterSlider, TokenCounter
|
|
49
|
+
- ConversationHistory, WorkflowCanvas
|
|
50
|
+
|
|
51
|
+
**Features**
|
|
52
|
+
- Complete RTL support with logical properties
|
|
53
|
+
- 64 production-ready and experimental components
|
|
54
|
+
- Full TypeScript support with type definitions
|
|
55
|
+
- Radix UI primitives for accessibility
|
|
56
|
+
- Tailwind CSS with design tokens
|
|
57
|
+
- Light/dark mode support
|
|
58
|
+
- Bilingual content (English/Arabic)
|
|
59
|
+
- WCAG AA compliant
|
|
60
|
+
|
|
61
|
+
### Changed
|
|
62
|
+
- Updated package structure to include all 64 components
|
|
63
|
+
- Improved TypeScript types and exports
|
|
64
|
+
- Enhanced documentation
|
|
65
|
+
|
|
66
|
+
### Notes
|
|
67
|
+
This release includes 10 new experimental AI/LLM components. These are functional but APIs may evolve based on feedback.
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## [0.1.2] - 2025-11-14
|
|
72
|
+
|
|
73
|
+
### Added
|
|
74
|
+
|
|
75
|
+
Initial release of Noor UI - RTL-first React component library with core components.
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## Format
|
|
80
|
+
|
|
81
|
+
### [Version] - YYYY-MM-DD
|
|
82
|
+
|
|
83
|
+
#### Added
|
|
84
|
+
- New features or components
|
|
85
|
+
|
|
86
|
+
#### Changed
|
|
87
|
+
- Changes in existing functionality
|
|
88
|
+
|
|
89
|
+
#### Deprecated
|
|
90
|
+
- Features that will be removed in upcoming releases
|
|
91
|
+
|
|
92
|
+
#### Removed
|
|
93
|
+
- Features that were removed
|
|
94
|
+
|
|
95
|
+
#### Fixed
|
|
96
|
+
- Bug fixes
|
|
97
|
+
|
|
98
|
+
#### Security
|
|
99
|
+
- Security fixes or improvements
|
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
# Contributing to Noor UI
|
|
2
|
+
|
|
3
|
+
Thank you for considering contributing to Noor UI! This document outlines how you can help improve this RTL-first component library.
|
|
4
|
+
|
|
5
|
+
## Table of Contents
|
|
6
|
+
|
|
7
|
+
- [Code of Conduct](#code-of-conduct)
|
|
8
|
+
- [How Can I Contribute?](#how-can-i-contribute)
|
|
9
|
+
- [Development Setup](#development-setup)
|
|
10
|
+
- [Component Guidelines](#component-guidelines)
|
|
11
|
+
- [RTL Guidelines](#rtl-guidelines)
|
|
12
|
+
- [Submitting Changes](#submitting-changes)
|
|
13
|
+
- [Style Guide](#style-guide)
|
|
14
|
+
|
|
15
|
+
## Code of Conduct
|
|
16
|
+
|
|
17
|
+
This project adheres to a code of conduct that all contributors are expected to follow:
|
|
18
|
+
|
|
19
|
+
- Be respectful and inclusive
|
|
20
|
+
- Welcome newcomers and help them get started
|
|
21
|
+
- Focus on what is best for the community
|
|
22
|
+
- Show empathy towards other community members
|
|
23
|
+
|
|
24
|
+
## How Can I Contribute?
|
|
25
|
+
|
|
26
|
+
### Reporting Bugs
|
|
27
|
+
|
|
28
|
+
Before creating bug reports, please check existing issues to avoid duplicates. When creating a bug report, include:
|
|
29
|
+
|
|
30
|
+
- **Clear title and description**
|
|
31
|
+
- **Steps to reproduce** the issue
|
|
32
|
+
- **Expected behavior** vs actual behavior
|
|
33
|
+
- **Screenshots or code samples** if applicable
|
|
34
|
+
- **Environment details** (OS, browser, Node version)
|
|
35
|
+
|
|
36
|
+
### Suggesting Enhancements
|
|
37
|
+
|
|
38
|
+
Enhancement suggestions are welcome! Please provide:
|
|
39
|
+
|
|
40
|
+
- **Clear use case** for the feature
|
|
41
|
+
- **Proposed API or implementation** if possible
|
|
42
|
+
- **Examples** from other libraries (if relevant)
|
|
43
|
+
- **RTL considerations** for the feature
|
|
44
|
+
|
|
45
|
+
### Contributing Code
|
|
46
|
+
|
|
47
|
+
1. **Fork the repository** and create a branch from `main`
|
|
48
|
+
2. **Make your changes** following the style guide
|
|
49
|
+
3. **Add tests** for new functionality
|
|
50
|
+
4. **Update documentation** as needed
|
|
51
|
+
5. **Ensure all tests pass** and there are no linting errors
|
|
52
|
+
6. **Submit a pull request** with a clear description
|
|
53
|
+
|
|
54
|
+
## Development Setup
|
|
55
|
+
|
|
56
|
+
### Prerequisites
|
|
57
|
+
|
|
58
|
+
- Node.js 20+
|
|
59
|
+
- npm or yarn
|
|
60
|
+
- Git
|
|
61
|
+
|
|
62
|
+
### Installation
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
# Clone your fork
|
|
66
|
+
git clone https://github.com/YOUR_USERNAME/noor-ui.git
|
|
67
|
+
cd noor-ui
|
|
68
|
+
|
|
69
|
+
# Install dependencies
|
|
70
|
+
npm install
|
|
71
|
+
|
|
72
|
+
# Start development server
|
|
73
|
+
npm run dev
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Available Scripts
|
|
77
|
+
|
|
78
|
+
- `npm run dev` - Start development server (documentation site)
|
|
79
|
+
- `npm run build` - Build for production (includes checks)
|
|
80
|
+
- `npm run build:skip-checks` - Build without running checks
|
|
81
|
+
- `npm run lint` - Run ESLint
|
|
82
|
+
- `npm run type-check` - Run TypeScript type checking
|
|
83
|
+
- `npm run check:translations` - Verify translation completeness
|
|
84
|
+
- `npm run check:links` - Check for broken links
|
|
85
|
+
- `npm run check:all` - Run all checks
|
|
86
|
+
- `npm test` - Run tests
|
|
87
|
+
- `npm run test:watch` - Run tests in watch mode
|
|
88
|
+
- `npm run test:coverage` - Generate coverage report
|
|
89
|
+
|
|
90
|
+
## Component Guidelines
|
|
91
|
+
|
|
92
|
+
### Component Structure
|
|
93
|
+
|
|
94
|
+
Each component should:
|
|
95
|
+
|
|
96
|
+
1. **Use TypeScript** with proper type definitions
|
|
97
|
+
2. **Export interface** for props
|
|
98
|
+
3. **Use forwardRef** for ref forwarding
|
|
99
|
+
4. **Include displayName** for debugging
|
|
100
|
+
5. **Support className** for customization
|
|
101
|
+
6. **Use Radix UI** primitives when applicable
|
|
102
|
+
|
|
103
|
+
```tsx
|
|
104
|
+
import * as React from 'react'
|
|
105
|
+
import { cn } from '@/lib/utils'
|
|
106
|
+
|
|
107
|
+
export interface ComponentProps
|
|
108
|
+
extends React.HTMLAttributes<HTMLDivElement> {
|
|
109
|
+
variant?: 'default' | 'special'
|
|
110
|
+
// Other props
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export const Component = React.forwardRef<
|
|
114
|
+
HTMLDivElement,
|
|
115
|
+
ComponentProps
|
|
116
|
+
>(({ variant = 'default', className, ...props }, ref) => {
|
|
117
|
+
return (
|
|
118
|
+
<div
|
|
119
|
+
ref={ref}
|
|
120
|
+
className={cn(
|
|
121
|
+
'base-styles',
|
|
122
|
+
variantStyles[variant],
|
|
123
|
+
className
|
|
124
|
+
)}
|
|
125
|
+
{...props}
|
|
126
|
+
/>
|
|
127
|
+
)
|
|
128
|
+
})
|
|
129
|
+
|
|
130
|
+
Component.displayName = 'Component'
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### Accessibility Requirements
|
|
134
|
+
|
|
135
|
+
All components must:
|
|
136
|
+
|
|
137
|
+
- Use semantic HTML elements
|
|
138
|
+
- Include proper ARIA labels and roles
|
|
139
|
+
- Support keyboard navigation
|
|
140
|
+
- Maintain focus management
|
|
141
|
+
- Provide sufficient color contrast (WCAG AA)
|
|
142
|
+
- Respect `prefers-reduced-motion`
|
|
143
|
+
|
|
144
|
+
### Testing
|
|
145
|
+
|
|
146
|
+
Components should include:
|
|
147
|
+
|
|
148
|
+
- Unit tests for core functionality
|
|
149
|
+
- Accessibility tests (keyboard navigation, ARIA)
|
|
150
|
+
- RTL/LTR rendering tests
|
|
151
|
+
- Theme variation tests
|
|
152
|
+
|
|
153
|
+
## RTL Guidelines
|
|
154
|
+
|
|
155
|
+
### Critical Rules
|
|
156
|
+
|
|
157
|
+
1. **Use logical properties only**
|
|
158
|
+
- `ms-*` not `ml-*` (margin-inline-start)
|
|
159
|
+
- `me-*` not `mr-*` (margin-inline-end)
|
|
160
|
+
- `ps-*` not `pl-*` (padding-inline-start)
|
|
161
|
+
- `pe-*` not `pr-*` (padding-inline-end)
|
|
162
|
+
|
|
163
|
+
2. **No hardcoded directional values**
|
|
164
|
+
- ❌ `left-0`, `right-4`, `float-left`
|
|
165
|
+
- ✅ `start-0`, `end-4`, `float-start`
|
|
166
|
+
|
|
167
|
+
3. **Test in both directions**
|
|
168
|
+
- Always verify components work in both LTR and RTL
|
|
169
|
+
- Check icon positions and text alignment
|
|
170
|
+
- Verify keyboard navigation (Tab order)
|
|
171
|
+
|
|
172
|
+
4. **Use direction context**
|
|
173
|
+
```tsx
|
|
174
|
+
import { useDirection } from '@/components/providers/direction-provider'
|
|
175
|
+
|
|
176
|
+
const { direction, locale } = useDirection()
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### Common RTL Patterns
|
|
180
|
+
|
|
181
|
+
**Icons with text:**
|
|
182
|
+
```tsx
|
|
183
|
+
<Button>
|
|
184
|
+
<Icon className="me-2 h-4 w-4" />
|
|
185
|
+
Text
|
|
186
|
+
</Button>
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
**Flexbox alignment:**
|
|
190
|
+
```tsx
|
|
191
|
+
<div className="flex items-center justify-start">
|
|
192
|
+
{/* Content flows correctly in both directions */}
|
|
193
|
+
</div>
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
**Conditional rendering:**
|
|
197
|
+
```tsx
|
|
198
|
+
const { direction } = useDirection()
|
|
199
|
+
const ArrowIcon = direction === 'rtl' ? ArrowRight : ArrowLeft
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
## Submitting Changes
|
|
203
|
+
|
|
204
|
+
### Pull Request Process
|
|
205
|
+
|
|
206
|
+
1. **Update documentation** for any changed functionality
|
|
207
|
+
2. **Add tests** for new features or bug fixes
|
|
208
|
+
3. **Follow the style guide** (ESLint rules)
|
|
209
|
+
4. **Ensure all checks pass**:
|
|
210
|
+
- `npm run type-check`
|
|
211
|
+
- `npm run lint`
|
|
212
|
+
- `npm run check:all`
|
|
213
|
+
- `npm test`
|
|
214
|
+
5. **Write clear commit messages** (see below)
|
|
215
|
+
6. **Reference related issues** in PR description
|
|
216
|
+
|
|
217
|
+
### Commit Message Format
|
|
218
|
+
|
|
219
|
+
Use conventional commits:
|
|
220
|
+
|
|
221
|
+
```
|
|
222
|
+
type(scope): brief description
|
|
223
|
+
|
|
224
|
+
Longer description if needed
|
|
225
|
+
|
|
226
|
+
Fixes #123
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
**Types:**
|
|
230
|
+
- `feat`: New feature
|
|
231
|
+
- `fix`: Bug fix
|
|
232
|
+
- `docs`: Documentation changes
|
|
233
|
+
- `style`: Code style changes (formatting)
|
|
234
|
+
- `refactor`: Code refactoring
|
|
235
|
+
- `test`: Test additions or changes
|
|
236
|
+
- `chore`: Build process or tooling changes
|
|
237
|
+
|
|
238
|
+
**Examples:**
|
|
239
|
+
```
|
|
240
|
+
feat(button): add loading state with spinner
|
|
241
|
+
|
|
242
|
+
fix(tabs): correct RTL keyboard navigation direction
|
|
243
|
+
|
|
244
|
+
docs(readme): update installation instructions
|
|
245
|
+
|
|
246
|
+
test(calendar): add Hijri date conversion tests
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
### Review Process
|
|
250
|
+
|
|
251
|
+
1. At least one maintainer must review the PR
|
|
252
|
+
2. All CI checks must pass
|
|
253
|
+
3. Documentation must be updated
|
|
254
|
+
4. Breaking changes require discussion
|
|
255
|
+
|
|
256
|
+
## Style Guide
|
|
257
|
+
|
|
258
|
+
### TypeScript
|
|
259
|
+
|
|
260
|
+
- Use strict mode
|
|
261
|
+
- Prefer interfaces over types for props
|
|
262
|
+
- Export all public types
|
|
263
|
+
- Avoid `any` - use `unknown` if needed
|
|
264
|
+
|
|
265
|
+
### React
|
|
266
|
+
|
|
267
|
+
- Use functional components
|
|
268
|
+
- Use hooks for state management
|
|
269
|
+
- Prefer composition over inheritance
|
|
270
|
+
- Extract complex logic into custom hooks
|
|
271
|
+
|
|
272
|
+
### CSS/Tailwind
|
|
273
|
+
|
|
274
|
+
- Use Tailwind utility classes
|
|
275
|
+
- Use `cn()` utility for conditional classes
|
|
276
|
+
- Follow mobile-first approach
|
|
277
|
+
- Use design tokens from theme
|
|
278
|
+
|
|
279
|
+
### File Naming
|
|
280
|
+
|
|
281
|
+
- Components: `kebab-case.tsx`
|
|
282
|
+
- Types: `kebab-case.ts`
|
|
283
|
+
- Utilities: `kebab-case.ts`
|
|
284
|
+
- Tests: `component.test.tsx`
|
|
285
|
+
|
|
286
|
+
### Code Organization
|
|
287
|
+
|
|
288
|
+
```
|
|
289
|
+
components/
|
|
290
|
+
ui/
|
|
291
|
+
component-name.tsx # Component implementation
|
|
292
|
+
docs/
|
|
293
|
+
component-name-docs.tsx # Documentation component
|
|
294
|
+
lib/
|
|
295
|
+
utils.ts # Utility functions
|
|
296
|
+
tokens.ts # Design tokens
|
|
297
|
+
hooks/
|
|
298
|
+
use-custom-hook.ts # Custom hooks
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
## Questions?
|
|
302
|
+
|
|
303
|
+
- 💬 Open an issue for questions
|
|
304
|
+
- 📧 Email: info@ositaka.com
|
|
305
|
+
- 🐛 Report bugs via GitHub issues
|
|
306
|
+
|
|
307
|
+
## License
|
|
308
|
+
|
|
309
|
+
By contributing, you agree that your contributions will be licensed under the MIT License.
|
|
310
|
+
|
|
311
|
+
---
|
|
312
|
+
|
|
313
|
+
Thank you for contributing to Noor UI! 🌟
|