noorui-rtl 0.4.7 → 0.5.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/CHANGELOG.md ADDED
@@ -0,0 +1,346 @@
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
+ ## [Unreleased]
9
+
10
+ ### To Be Fixed
11
+ - **Popover Component**: RTL positioning issues in portal-rendered components
12
+ - NotificationCenter popup appears on wrong side in RTL mode
13
+ - TimePicker & TimeRangePicker popups appear on wrong side in RTL mode
14
+ - Need to add automatic direction detection (similar to DropdownMenu pattern)
15
+
16
+ ## [0.4.6] - 2025-12-08
17
+
18
+ ### Fixed
19
+ - **Calendar Component**: Fixed form submission issue when used inside forms
20
+ - Added `type="button"` to all navigation buttons (previous month, next month, today)
21
+ - Added `type="button"` to all date selection buttons
22
+ - Prevents unintended form submissions when selecting dates or navigating months
23
+ - Resolves issue where clicking calendar buttons would trigger parent form submit handlers
24
+
25
+ ### Notes
26
+ This is a critical bugfix for forms containing Calendar components in range or single selection mode. Previously, clicking any button within the Calendar would trigger form submission, causing premature validation and unexpected behavior.
27
+
28
+ ---
29
+
30
+ ## [0.4.5] - 2025-12-07
31
+
32
+ ### Changed
33
+ - **Cozy Theme**: Removed opinionated spacing and padding rules for more flexibility
34
+ - Removed forced `margin-bottom: 1.5rem` from headings (h1, h2, h3, h4)
35
+ - Removed forced `padding: 2rem !important` from all card components
36
+ - Removed forced button padding (`padding: .75rem 1.5rem`)
37
+ - Theme now respects component-level spacing defaults
38
+ - Updated both `globals.css` and `package.css` for consistency
39
+
40
+ ### Notes
41
+ This release makes the Cozy theme less opinionated and more flexible, allowing developers to use standard component spacing without theme overrides.
42
+
43
+ ---
44
+
45
+ ## [0.4.4] - 2025-12-06
46
+
47
+ ### Fixed
48
+ - **Documentation Pages**: Fixed inconsistent section title spacing across component pages
49
+ - **number-input**: Fixed Use Cases, API Reference, and Features sections
50
+ - **date-picker**: Fixed Use Cases, Type Definition, API Reference (2x), and Features sections
51
+ - **time-picker**: Fixed Use Cases, Type Definition, API Reference (2x), and Features sections
52
+ - All sections now use standard pattern: `<section className="mb-16">` with `<h2 className="text-2xl font-bold tracking-tight mb-6">`
53
+
54
+ ### Changed
55
+ - **Component Documentation**: Standardized section spacing for consistent visual hierarchy
56
+
57
+ ### Notes
58
+ This release focuses on improving documentation consistency and visual hierarchy across all component pages.
59
+
60
+ ## [0.4.3] - 2025-12-05
61
+
62
+ ### Fixed
63
+ - **Code Quality**: Resolved all React Hooks exhaustive-deps warnings (zero warnings achieved)
64
+ - **DataTable**: Wrapped `sampleUsers` in `useMemo` and added to dependency arrays in sorting, filtering, and pagination hooks
65
+ - **useRelativeTime Hook**: Wrapped `targetDate` in `useMemo` and `getRelativeTime` in `useCallback` with proper dependencies
66
+ - **Calendar**: Wrapped calendar days generation in `useMemo` with complete dependencies including `getHijriDate`
67
+ - **Translations**: Fixed missing i18n keys across 11+ experimental component pages
68
+ - Added `rtlDemo` object with `ltr` and `rtl` keys to common.ts (EN/AR)
69
+ - Added missing example keys: `fullFeatured`, `compactMode`, `withPresets`, `customPresets`, `withoutPresets`, `inContext`
70
+ - Fixed incorrect key references: `rtl` → `rtlSupport`, `interface` → `typeDefinitions`, `sizes` → `examples.sizes`, `inContext` → `examples.inContext`
71
+ - **NotificationCenter**: Fixed PropDefinition type error by changing `defaultValue` to `default` property
72
+ - **WorkflowCanvas & WorkflowNode**: Fixed missing imports for `useDirection` and `content` from i18n
73
+ - **ThinkingIndicator**: Fixed incorrect translation key references in examples section
74
+ - **ParameterSlider**: Fixed non-existent translation key reference
75
+
76
+ ### Added
77
+ - **Website**: Added "Starters" link to main navigation (both desktop and mobile)
78
+ - **Website**: Added i18n translations for "Starters" menu item (English: "Starters", Arabic: "نماذج البداية")
79
+ - **Website**: Added /starters page to sitemap.ts for SEO (priority: 0.8, weekly updates)
80
+ - **SEO**: Added 3 OG images (bilingual, Arabic, English) at 1200×630px for social sharing
81
+ - **SEO**: Updated root layout metadata with comprehensive OpenGraph and Twitter Card metadata
82
+ - **Documentation**: Added OG image to main README.md for visual impact on GitHub
83
+ - **Documentation**: Added OG image to npm package README (packages/noorui/README.md)
84
+ - **Documentation**: Updated /starters page with Kitab Blog Starter information
85
+ - **Documentation**: Added Kitab live demo link (kitab.noorui.com) and GitHub repository
86
+ - **Documentation**: Updated README.md to include Starters page in documentation links
87
+ - **Documentation**: Updated ROADMAP.md to highlight Kitab as completed deliverable
88
+ - **Documentation**: Updated starters/README.md with full Kitab feature list
89
+ - **Code Standards**: Added ESLint disable comments for intentional img usage (component library design decision)
90
+ - NotificationCenter: Avatar display using dynamic user-provided URLs
91
+ - ListingCard: Product image display
92
+ - FileUpload: Image preview using blob URLs from FileReader
93
+
94
+ ### Changed
95
+ - **Website**: Improved visibility of /starters page through navigation integration
96
+ - **Starters Page**: Replaced placeholder "Blog Dashboard" with production-ready "Kitab - Blog Starter"
97
+ - **Starters Page**: Updated GitHub button to link to https://github.com/topics/noor-ui for broader project discovery
98
+ - **Roadmap**: Updated current status to "READY FOR PUBLIC LAUNCH" with technical pre-launch checklist completed
99
+ - **Roadmap**: Added Kitab to recent wins and next actions focused on marketing launch
100
+ - **Website**: Updated all version references from v0.4.2 to v0.4.3
101
+ - Homepage (app/page.tsx)
102
+ - English home translations (lib/i18n/en/home.ts)
103
+ - Arabic home translations (lib/i18n/ar/home.ts)
104
+ - Launch plan documentation (LAUNCH_PLAN.md - 7 references)
105
+ - Roadmap documentation (ROADMAP.md - 4 references)
106
+ - **Build Process**: Achieved zero build warnings and zero compilation errors
107
+ - **Code Quality**: Improved React performance patterns with proper memoization and callback usage
108
+
109
+ ### Notes
110
+ This release focuses on code quality improvements and documentation completeness. All 74+ components maintain full RTL/LTR support with zero build warnings. The codebase is now optimized for production use with proper React performance patterns.
111
+
112
+ ## [0.4.2] - 2025-11-29
113
+
114
+ ### Added
115
+ - **DataTable**: New `enableSorting` prop for automatic internal sort state management. No need to manage `sortBy` and `sortDirection` state yourself - perfect for simple tables
116
+ - **DataTable**: New `defaultSortBy` and `defaultSortDirection` props to set initial sort state when using `enableSorting`
117
+ - **DataTable**: New `mobileSorting` prop (default: true) to show/hide sort buttons on mobile card view
118
+ - **DataTable**: Full sorting support for mobile card view with dedicated sort buttons above cards
119
+ - **DataTable**: Pagination controls with Previous/Next buttons. Previously only showed "Page X of Y" text without navigation buttons
120
+ - **DataTable**: Automatic sorting logic handles strings (with `localeCompare`), numbers, dates, and null values
121
+ - **Documentation**: Added "Simple Sorting" example showing the new `enableSorting` feature with code samples
122
+
123
+ ### Fixed
124
+ - **DataTable**: Fixed search clear button (X icon) positioning in RTL mode. Changed from `me-1` to `end-1` for proper logical positioning
125
+ - **DataTable**: Fixed pagination chevron icons in RTL mode with `rtl:rotate-180` class so arrows point in correct reading direction
126
+ - **DataTable**: Fixed pagination not working correctly. Component now follows controlled pattern - parent slices data, DataTable displays it. Removed internal data slicing that was preventing page changes from updating content
127
+ - **DataTable Documentation**: Fixed "Complete Example" not paginating correctly by adding separate pagination state and properly slicing filtered data
128
+ - **PrayerTimes**: Fixed incorrect locale check (`locale === 'ar'`) to use direction check (`direction === 'rtl'`). Component now works with ALL RTL languages (Hebrew, Urdu, Farsi, etc.), not just Arabic
129
+ - **HijriDate**: Fixed incorrect locale check (`locale === 'ar'`) to use direction check (`direction === 'rtl'`). Component now works with ALL RTL languages (Hebrew, Urdu, Farsi, etc.), not just Arabic
130
+ - **RangeSlider**: Resolved RTL label formatting - simplified to use universal min-max format ("100 - 500") that works naturally across all languages. Numbers and ranges are international conventions that don't need language-specific formatting
131
+
132
+ ### Changed
133
+ - **DataTable**: Sorting state now cycles through: asc → desc → null (clears sort) instead of just toggling between asc/desc
134
+ - **DataTable**: Mobile table view now includes sort buttons in headers (previously desktop-only)
135
+ - **DataTable**: Documentation restructured to show simple internal sorting example before advanced external state management
136
+
137
+ ---
138
+
139
+ ## [0.4.1] - 2025-11-29
140
+
141
+ ### Added
142
+ - **Calendar**: New `showIslamicHolidays` prop for automatic Islamic holiday highlighting. When enabled with `showHijri={true}`, displays event dots on 10 major Islamic holidays including:
143
+ - Islamic New Year (Muharram 1)
144
+ - Day of Ashura (Muharram 10)
145
+ - Prophet's Birthday (Rabi' al-Awwal 12)
146
+ - Isra and Mi'raj (Rajab 27)
147
+ - Laylat al-Bara'ah (Sha'ban 15)
148
+ - Start of Ramadan (Ramadan 1)
149
+ - Laylat al-Qadr (Ramadan 27)
150
+ - Eid al-Fitr (Shawwal 1)
151
+ - Day of Arafah (Dhu al-Hijjah 9)
152
+ - Eid al-Adha (Dhu al-Hijjah 10)
153
+ - **HijriDate**: Exported `ISLAMIC_HOLIDAYS` array and `getIslamicHoliday()` function for external use
154
+ - **Documentation**: Added "Islamic Holidays" feature card and interactive example to Calendar component page
155
+ - **Documentation**: Created book-content workspace with 3 complete RTL lessons (Keyboard Shortcuts, Positioning vs Direction, Transform Animations)
156
+
157
+ ### Fixed
158
+ - **ContextMenuShortcut**: Fixed keyboard shortcuts reversing in RTL mode (e.g., "K⌘" instead of "⌘K"). Implemented nested span structure where outer span handles positioning with logical properties and inner span uses `dir="ltr"` for text direction
159
+ - **DropdownMenuShortcut**: Fixed keyboard shortcuts reversing in RTL mode with same nested span pattern
160
+ - **CommandShortcut**: Fixed keyboard shortcuts reversing in RTL mode with same nested span pattern
161
+ - **Switch**: Fixed toggle thumb sliding in wrong direction in RTL mode. Added RTL transform variants (`rtl:-translate-x-4`) for proper animation direction
162
+
163
+ ### Changed
164
+ - Updated Calendar component documentation with new Islamic holidays feature
165
+ - Updated roadmap page with completed RTL fixes and Islamic holidays enhancement
166
+ - Enhanced RTL guide page with "Lessons Learned" section featuring 3 documented patterns
167
+
168
+ ---
169
+
170
+ ## [0.4.0] - 2025-11-28
171
+
172
+ ### Added
173
+
174
+ #### New Components (8 Components)
175
+ - **ReactionPicker**: LinkedIn/Discord-style emoji reaction picker for social features. Supports compact mode (merged display) and expanded mode (separate reactions). Includes tooltip breakdowns, active state tracking, and full RTL support. Perfect for comments, posts, messages, and reviews.
176
+ - **UserBadge**: Role and status badge component with 5 variants (author, moderator, verified, admin, custom). Includes icon support and clean noorui styling. Useful for profiles, comments, leaderboards, and chat systems.
177
+ - **ContentRenderer**: Markdown/HTML content renderer with automatic RTL/LTR detection via `dir="auto"`. Features code highlighting, XSS protection, proper prose styling, and logical CSS properties for bidirectional content. Essential for user-generated content, comments, and documentation.
178
+ - **Kbd**: Keyboard shortcut display component with platform-aware symbols (⌘ on Mac, Ctrl on Windows). Supports key combinations, 3 variants (default, outline, ghost), 3 sizes, and RTL support. Perfect for search modals, toolbars, menus, and documentation.
179
+ - **Callout**: Enhanced alert/notification component with 5 types (info, warning, error, success, note). Features custom icons, title support, and RTL-aware layout. Ideal for documentation, tips, warnings, and important messages.
180
+ - **Blockquote**: Styled quote component with 3 variants (default, accent, subtle). Supports author attribution, source citations, and clickable cite URLs. Clean typography with proper spacing.
181
+ - **PullQuote**: Large emphasized quote for highlighting key text. Supports 3 alignments (left, center, right). Uses elegant serif typography with decorative quotation marks.
182
+ - **StatsCard**: Dashboard statistics display card with icon, label, value, and optional trend indicator. Clean card-based design for analytics dashboards.
183
+
184
+ #### New Hooks
185
+ - **useRelativeTime**: Hook for formatting dates as relative time strings ("2 hours ago", "منذ ساعتين"). Features auto-updates, customizable intervals, and full localization for 4 locales (en, ar, fr, ur). Handles all time ranges from seconds to years.
186
+
187
+ ### Changed
188
+ - Updated component count from 65 to 73+ components
189
+ - Expanded package exports with new UI components and hooks
190
+ - Enhanced social and content-focused capabilities
191
+
192
+ ---
193
+
194
+ ## [0.3.14] - 2025-11-23
195
+
196
+ ### Added
197
+ - **ButtonArrow**: New component for buttons with directional arrows. Uses semantic directions (`forward`/`back`) instead of physical (`left`/`right`) for automatic RTL/LTR handling. The arrow icons rotate automatically in RTL contexts using Tailwind's `rtl:rotate-180` class.
198
+ - **MarkdownEditor**: New WYSIWYG markdown editor component powered by MDXEditor. Outputs clean markdown (not HTML), making it ideal for blogs, documentation, and MDX content. Features include syntax highlighting for code blocks, tables, lists, links, blockquotes, and full RTL support.
199
+
200
+ ---
201
+
202
+ ## [0.3.13] - 2025-11-22
203
+
204
+ ### Fixed
205
+ - **RichTextEditor**: Fixed `jsx` attribute console error in Next.js 16 with Turbopack. Replaced styled-jsx with standard `dangerouslySetInnerHTML` for inline styles.
206
+
207
+ ---
208
+
209
+ ## [0.3.12] - 2025-11-22
210
+
211
+ ### Added
212
+ - **RichTextEditor**: New `dir` prop to override direction from context. Useful when editing content in a different language than the page locale (e.g., editing Arabic content on an English admin page).
213
+
214
+ ---
215
+
216
+ ## [0.3.11] - 2025-11-22
217
+
218
+ ### Added
219
+ - **DashboardShell**: New `headerActions` prop to add custom actions (like theme/language switchers) to the header.
220
+
221
+ ### Fixed
222
+ - **DashboardShell**: Accessibility warning (DialogTitle) in mobile sidebar.
223
+ - **DashboardShell**: Mobile sidebar uses `side="start"` for proper RTL support via CSS logical properties.
224
+
225
+ ---
226
+
227
+ ## [0.3.8] - 2025-11-22
228
+
229
+ ### Fixed
230
+ - **DashboardShell**: Fixed accessibility warning by adding visually hidden `SheetTitle` to mobile sidebar. This resolves the console warning about `DialogContent requires a DialogTitle`.
231
+ - **DashboardShell**: Fixed mobile sidebar RTL positioning. Changed from `side={direction === 'rtl' ? 'end' : 'start'}` to `side="start"` since CSS logical properties handle RTL automatically. The sidebar now correctly appears on the right side for RTL locales.
232
+
233
+ ---
234
+
235
+ ## [0.3.7] - 2025-11-21
236
+
237
+ ### Added
238
+ - Proper build process for npm package with tsup
239
+ - CSS output with Tailwind compilation
240
+
241
+ ### Changed
242
+ - Updated exports for proper module resolution
243
+ - Added .js extensions for ESM compatibility
244
+
245
+ ---
246
+
247
+ ## [0.3.0] - 2025-11-21
248
+
249
+ ### Added
250
+ - Complete restructuring of package build process
251
+ - Better TypeScript support and type exports
252
+
253
+ ---
254
+
255
+ ## [0.2.1] - 2025-11-20
256
+
257
+ ### Changed
258
+ - Updated package structure with complete barrel exports
259
+ - Fixed TypeScript exports in components/index.ts
260
+ - Updated homepage URL to noorui.com
261
+
262
+ ### Added
263
+ - Complete barrel export with all 74+ components
264
+ - CHANGELOG.md, CONTRIBUTING.md documentation
265
+ - Improved package files configuration
266
+
267
+ ---
268
+
269
+ ## [0.2.0] - 2025-11-20
270
+
271
+ ### Added
272
+
273
+ Major update to Noor UI with significant component additions and improvements.
274
+
275
+ **Core Components (69)**
276
+ - Form components: Form, Button, Input, Label, Textarea, Checkbox, Radio Group, Select, Switch, Slider
277
+ - Layout components: Card, Separator, Tabs, Accordion, Collapsible
278
+ - Navigation: Breadcrumb, Pagination, Command
279
+ - Feedback: Alert, Toast, Progress, Skeleton, Badge, Avatar
280
+ - Overlays: Dialog, Sheet, Popover, Tooltip, Dropdown Menu, Context Menu
281
+ - Data display: Table, DataTable, StatsCard, FeatureCard, EmptyState, ListingCard
282
+ - Advanced forms: File Upload, Rich Text Editor, Date Picker, Time Picker, Number Input
283
+ - Layout shells: Dashboard Shell
284
+ - User interface: User Menu, Notification Center, Stepper
285
+
286
+ **GCC-Specific Components (5)**
287
+ - Prayer Times with countdown and Adhan notifications
288
+ - Hijri Date with dual calendar display
289
+ - Arabic Number utilities for Arabic-Indic numerals
290
+ - Zakat Calculator with export/sharing
291
+ - Calendar with Gregorian/Hijri support
292
+
293
+ **AI/LLM Components (10)** 🧪 Experimental
294
+ - ChatMessage, StreamingText, PromptInput, ThinkingIndicator
295
+ - MessageActions, ModelSelector, ParameterSlider, TokenCounter
296
+ - ConversationHistory, WorkflowCanvas
297
+
298
+ **Features**
299
+ - Complete RTL support with logical properties
300
+ - 74+ production-ready and experimental components
301
+ - Full TypeScript support with type definitions
302
+ - Radix UI primitives for accessibility
303
+ - Tailwind CSS with design tokens
304
+ - Light/dark mode support
305
+ - Bilingual content (English/Arabic)
306
+ - WCAG AA compliant
307
+
308
+ ### Changed
309
+ - Updated package structure to include all 74+ components
310
+ - Improved TypeScript types and exports
311
+ - Enhanced documentation
312
+
313
+ ### Notes
314
+ This release includes 10 new experimental AI/LLM components. These are functional but APIs may evolve based on feedback.
315
+
316
+ ---
317
+
318
+ ## [0.1.2] - 2025-11-14
319
+
320
+ ### Added
321
+
322
+ Initial release of Noor UI - RTL-first React component library with core components.
323
+
324
+ ---
325
+
326
+ ## Format
327
+
328
+ ### [Version] - YYYY-MM-DD
329
+
330
+ #### Added
331
+ - New features or components
332
+
333
+ #### Changed
334
+ - Changes in existing functionality
335
+
336
+ #### Deprecated
337
+ - Features that will be removed in upcoming releases
338
+
339
+ #### Removed
340
+ - Features that were removed
341
+
342
+ #### Fixed
343
+ - Bug fixes
344
+
345
+ #### Security
346
+ - Security fixes or improvements
@@ -0,0 +1,316 @@
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 storybook` - Start Storybook for interactive component development
82
+ - `npm run storybook:build` - Build static Storybook
83
+ - `npm run lint` - Run ESLint
84
+ - `npm run type-check` - Run TypeScript type checking
85
+ - `npm run check:translations` - Verify translation completeness
86
+ - `npm run check:links` - Check for broken links
87
+ - `npm run check:all` - Run all checks
88
+ - `npm test` - Run tests
89
+ - `npm run test:watch` - Run tests in watch mode
90
+ - `npm run test:coverage` - Generate coverage report
91
+
92
+ ## Component Guidelines
93
+
94
+ ### Component Structure
95
+
96
+ Each component should:
97
+
98
+ 1. **Use TypeScript** with proper type definitions
99
+ 2. **Export interface** for props
100
+ 3. **Use forwardRef** for ref forwarding
101
+ 4. **Include displayName** for debugging
102
+ 5. **Support className** for customization
103
+ 6. **Use Radix UI** primitives when applicable
104
+
105
+ ```tsx
106
+ import * as React from 'react'
107
+ import { cn } from '@/lib/utils'
108
+
109
+ export interface ComponentProps
110
+ extends React.HTMLAttributes<HTMLDivElement> {
111
+ variant?: 'default' | 'special'
112
+ // Other props
113
+ }
114
+
115
+ export const Component = React.forwardRef<
116
+ HTMLDivElement,
117
+ ComponentProps
118
+ >(({ variant = 'default', className, ...props }, ref) => {
119
+ return (
120
+ <div
121
+ ref={ref}
122
+ className={cn(
123
+ 'base-styles',
124
+ variantStyles[variant],
125
+ className
126
+ )}
127
+ {...props}
128
+ />
129
+ )
130
+ })
131
+
132
+ Component.displayName = 'Component'
133
+ ```
134
+
135
+ ### Accessibility Requirements
136
+
137
+ All components must:
138
+
139
+ - Use semantic HTML elements
140
+ - Include proper ARIA labels and roles
141
+ - Support keyboard navigation
142
+ - Maintain focus management
143
+ - Provide sufficient color contrast (WCAG AA)
144
+ - Respect `prefers-reduced-motion`
145
+
146
+ ### Testing
147
+
148
+ Components should include:
149
+
150
+ - Unit tests for core functionality
151
+ - Accessibility tests (keyboard navigation, ARIA)
152
+ - RTL/LTR rendering tests
153
+ - Theme variation tests
154
+
155
+ ## RTL Guidelines
156
+
157
+ ### Critical Rules
158
+
159
+ 1. **Use logical properties only**
160
+ - `ms-*` not `ml-*` (margin-inline-start)
161
+ - `me-*` not `mr-*` (margin-inline-end)
162
+ - `ps-*` not `pl-*` (padding-inline-start)
163
+ - `pe-*` not `pr-*` (padding-inline-end)
164
+
165
+ 2. **No hardcoded directional values**
166
+ - ❌ `left-0`, `right-4`, `float-left`
167
+ - ✅ `start-0`, `end-4`, `float-start`
168
+
169
+ 3. **Test in both directions**
170
+ - Always verify components work in both LTR and RTL
171
+ - Check icon positions and text alignment
172
+ - Verify keyboard navigation (Tab order)
173
+
174
+ 4. **Use direction context**
175
+ ```tsx
176
+ import { useDirection } from '@/components/providers/direction-provider'
177
+
178
+ const { direction, locale } = useDirection()
179
+ ```
180
+
181
+ ### Common RTL Patterns
182
+
183
+ **Icons with text:**
184
+ ```tsx
185
+ <Button>
186
+ <Icon className="me-2 h-4 w-4" />
187
+ Text
188
+ </Button>
189
+ ```
190
+
191
+ **Flexbox alignment:**
192
+ ```tsx
193
+ <div className="flex items-center justify-start">
194
+ {/* Content flows correctly in both directions */}
195
+ </div>
196
+ ```
197
+
198
+ **Conditional rendering:**
199
+ ```tsx
200
+ const { direction } = useDirection()
201
+ const ArrowIcon = direction === 'rtl' ? ArrowRight : ArrowLeft
202
+ ```
203
+
204
+ ## Submitting Changes
205
+
206
+ ### Pull Request Process
207
+
208
+ 1. **Update documentation** for any changed functionality
209
+ 2. **Add tests** for new features or bug fixes
210
+ 3. **Follow the style guide** (ESLint rules)
211
+ 4. **Ensure all checks pass**:
212
+ - `npm run type-check`
213
+ - `npm run lint`
214
+ - `npm run check:all`
215
+ - `npm test`
216
+ 5. **Write clear commit messages** (see below)
217
+ 6. **Reference related issues** in PR description
218
+
219
+ ### Commit Message Format
220
+
221
+ Use conventional commits:
222
+
223
+ ```
224
+ type(scope): brief description
225
+
226
+ Longer description if needed
227
+
228
+ Fixes #123
229
+ ```
230
+
231
+ **Types:**
232
+ - `feat`: New feature
233
+ - `fix`: Bug fix
234
+ - `docs`: Documentation changes
235
+ - `style`: Code style changes (formatting)
236
+ - `refactor`: Code refactoring
237
+ - `test`: Test additions or changes
238
+ - `chore`: Build process or tooling changes
239
+
240
+ **Examples:**
241
+ ```
242
+ feat(button): add loading state with spinner
243
+
244
+ fix(tabs): correct RTL keyboard navigation direction
245
+
246
+ docs(readme): update installation instructions
247
+
248
+ test(calendar): add Hijri date conversion tests
249
+ ```
250
+
251
+ ### Review Process
252
+
253
+ 1. At least one maintainer must review the PR
254
+ 2. All CI checks must pass
255
+ 3. Documentation must be updated
256
+ 4. Breaking changes require discussion
257
+
258
+ ## Style Guide
259
+
260
+ ### TypeScript
261
+
262
+ - Use strict mode
263
+ - Prefer interfaces over types for props
264
+ - Export all public types
265
+ - Avoid `any` - use `unknown` if needed
266
+
267
+ ### React
268
+
269
+ - Use functional components
270
+ - Use hooks for state management
271
+ - Prefer composition over inheritance
272
+ - Extract complex logic into custom hooks
273
+
274
+ ### CSS/Tailwind
275
+
276
+ - Use Tailwind utility classes
277
+ - Use `cn()` utility for conditional classes
278
+ - Follow mobile-first approach
279
+ - Use design tokens from theme
280
+
281
+ ### File Naming
282
+
283
+ - Components: `kebab-case.tsx`
284
+ - Types: `kebab-case.ts`
285
+ - Utilities: `kebab-case.ts`
286
+ - Tests: `component.test.tsx`
287
+
288
+ ### Code Organization
289
+
290
+ ```
291
+ components/
292
+ ui/
293
+ component-name.tsx # Component implementation
294
+ docs/
295
+ component-name-docs.tsx # Documentation component
296
+ lib/
297
+ utils.ts # Utility functions
298
+ tokens.ts # Design tokens
299
+ hooks/
300
+ use-custom-hook.ts # Custom hooks
301
+ ```
302
+
303
+ ## Questions?
304
+
305
+ - 💬 Discord: [Join our community](https://discord.gg/gvrqU2WG)
306
+ - 💬 Open an issue for questions
307
+ - 📧 Email: info@ositaka.com
308
+ - 🐛 Report bugs via GitHub issues
309
+
310
+ ## License
311
+
312
+ By contributing, you agree that your contributions will be licensed under the MIT License.
313
+
314
+ ---
315
+
316
+ Thank you for contributing to Noor UI! 🌟
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2024 Nuno Marques
3
+ Copyright (c) 2024-2025 Nuno Marques
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal