noorui-rtl 0.4.7 → 0.5.1

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,382 @@
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.5.1] - 2026-01-12
17
+
18
+ ### Improved
19
+ - **Theme System**: Enhanced CSS custom properties for all themes
20
+ - Improved color consistency across light and dark modes
21
+ - Refined semantic color tokens (background, foreground, card, muted, accent)
22
+ - Better border and input colors for improved visual hierarchy
23
+ - More accurate HSL values for smoother theme transitions
24
+
25
+ - **Design Tokens Page**: Added live theme visualization
26
+ - New hook (`useThemeTokens`) to read and display live CSS custom properties
27
+ - Real-time color swatches that update when switching themes or toggling dark mode
28
+ - Added "CSS Setup" section showing the exact CSS code for the current theme
29
+ - Removed static base color scales to reduce noise and focus on semantic tokens
30
+ - Users can now copy the exact CSS needed to implement any theme
31
+
32
+ ### Notes
33
+ This release improves the theme system's visual consistency and makes it easier for developers to understand and implement themes. The Design Tokens page now serves as a live reference for the current theme's CSS variables.
34
+
35
+ ---
36
+
37
+ ## [0.5.0] - 2026-01-12
38
+
39
+ ### Added
40
+ - **ButtonArrow Component**: Added 'external' direction variant for external links
41
+ - New diagonal arrow icon (↗) using ArrowUpRight from lucide-react
42
+ - Automatic horizontal mirroring in RTL mode (↗ becomes ↖)
43
+ - Proper RTL support using `scale-x-[-1]` transform
44
+ - Works seamlessly with all button variants (primary, secondary, outline, ghost, link)
45
+ - Updated documentation and Storybook with external link examples
46
+
47
+ ### Notes
48
+ This release enhances the ButtonArrow component to support external links with semantic directional arrows that automatically mirror in RTL layouts. The 'external' direction complements the existing 'forward' and 'back' directions.
49
+
50
+ ---
51
+
52
+ ## [0.4.6] - 2025-12-08
53
+
54
+ ### Fixed
55
+ - **Calendar Component**: Fixed form submission issue when used inside forms
56
+ - Added `type="button"` to all navigation buttons (previous month, next month, today)
57
+ - Added `type="button"` to all date selection buttons
58
+ - Prevents unintended form submissions when selecting dates or navigating months
59
+ - Resolves issue where clicking calendar buttons would trigger parent form submit handlers
60
+
61
+ ### Notes
62
+ 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.
63
+
64
+ ---
65
+
66
+ ## [0.4.5] - 2025-12-07
67
+
68
+ ### Changed
69
+ - **Cozy Theme**: Removed opinionated spacing and padding rules for more flexibility
70
+ - Removed forced `margin-bottom: 1.5rem` from headings (h1, h2, h3, h4)
71
+ - Removed forced `padding: 2rem !important` from all card components
72
+ - Removed forced button padding (`padding: .75rem 1.5rem`)
73
+ - Theme now respects component-level spacing defaults
74
+ - Updated both `globals.css` and `package.css` for consistency
75
+
76
+ ### Notes
77
+ This release makes the Cozy theme less opinionated and more flexible, allowing developers to use standard component spacing without theme overrides.
78
+
79
+ ---
80
+
81
+ ## [0.4.4] - 2025-12-06
82
+
83
+ ### Fixed
84
+ - **Documentation Pages**: Fixed inconsistent section title spacing across component pages
85
+ - **number-input**: Fixed Use Cases, API Reference, and Features sections
86
+ - **date-picker**: Fixed Use Cases, Type Definition, API Reference (2x), and Features sections
87
+ - **time-picker**: Fixed Use Cases, Type Definition, API Reference (2x), and Features sections
88
+ - All sections now use standard pattern: `<section className="mb-16">` with `<h2 className="text-2xl font-bold tracking-tight mb-6">`
89
+
90
+ ### Changed
91
+ - **Component Documentation**: Standardized section spacing for consistent visual hierarchy
92
+
93
+ ### Notes
94
+ This release focuses on improving documentation consistency and visual hierarchy across all component pages.
95
+
96
+ ## [0.4.3] - 2025-12-05
97
+
98
+ ### Fixed
99
+ - **Code Quality**: Resolved all React Hooks exhaustive-deps warnings (zero warnings achieved)
100
+ - **DataTable**: Wrapped `sampleUsers` in `useMemo` and added to dependency arrays in sorting, filtering, and pagination hooks
101
+ - **useRelativeTime Hook**: Wrapped `targetDate` in `useMemo` and `getRelativeTime` in `useCallback` with proper dependencies
102
+ - **Calendar**: Wrapped calendar days generation in `useMemo` with complete dependencies including `getHijriDate`
103
+ - **Translations**: Fixed missing i18n keys across 11+ experimental component pages
104
+ - Added `rtlDemo` object with `ltr` and `rtl` keys to common.ts (EN/AR)
105
+ - Added missing example keys: `fullFeatured`, `compactMode`, `withPresets`, `customPresets`, `withoutPresets`, `inContext`
106
+ - Fixed incorrect key references: `rtl` → `rtlSupport`, `interface` → `typeDefinitions`, `sizes` → `examples.sizes`, `inContext` → `examples.inContext`
107
+ - **NotificationCenter**: Fixed PropDefinition type error by changing `defaultValue` to `default` property
108
+ - **WorkflowCanvas & WorkflowNode**: Fixed missing imports for `useDirection` and `content` from i18n
109
+ - **ThinkingIndicator**: Fixed incorrect translation key references in examples section
110
+ - **ParameterSlider**: Fixed non-existent translation key reference
111
+
112
+ ### Added
113
+ - **Website**: Added "Starters" link to main navigation (both desktop and mobile)
114
+ - **Website**: Added i18n translations for "Starters" menu item (English: "Starters", Arabic: "نماذج البداية")
115
+ - **Website**: Added /starters page to sitemap.ts for SEO (priority: 0.8, weekly updates)
116
+ - **SEO**: Added 3 OG images (bilingual, Arabic, English) at 1200×630px for social sharing
117
+ - **SEO**: Updated root layout metadata with comprehensive OpenGraph and Twitter Card metadata
118
+ - **Documentation**: Added OG image to main README.md for visual impact on GitHub
119
+ - **Documentation**: Added OG image to npm package README (packages/noorui/README.md)
120
+ - **Documentation**: Updated /starters page with Kitab Blog Starter information
121
+ - **Documentation**: Added Kitab live demo link (kitab.noorui.com) and GitHub repository
122
+ - **Documentation**: Updated README.md to include Starters page in documentation links
123
+ - **Documentation**: Updated ROADMAP.md to highlight Kitab as completed deliverable
124
+ - **Documentation**: Updated starters/README.md with full Kitab feature list
125
+ - **Code Standards**: Added ESLint disable comments for intentional img usage (component library design decision)
126
+ - NotificationCenter: Avatar display using dynamic user-provided URLs
127
+ - ListingCard: Product image display
128
+ - FileUpload: Image preview using blob URLs from FileReader
129
+
130
+ ### Changed
131
+ - **Website**: Improved visibility of /starters page through navigation integration
132
+ - **Starters Page**: Replaced placeholder "Blog Dashboard" with production-ready "Kitab - Blog Starter"
133
+ - **Starters Page**: Updated GitHub button to link to https://github.com/topics/noor-ui for broader project discovery
134
+ - **Roadmap**: Updated current status to "READY FOR PUBLIC LAUNCH" with technical pre-launch checklist completed
135
+ - **Roadmap**: Added Kitab to recent wins and next actions focused on marketing launch
136
+ - **Website**: Updated all version references from v0.4.2 to v0.4.3
137
+ - Homepage (app/page.tsx)
138
+ - English home translations (lib/i18n/en/home.ts)
139
+ - Arabic home translations (lib/i18n/ar/home.ts)
140
+ - Launch plan documentation (LAUNCH_PLAN.md - 7 references)
141
+ - Roadmap documentation (ROADMAP.md - 4 references)
142
+ - **Build Process**: Achieved zero build warnings and zero compilation errors
143
+ - **Code Quality**: Improved React performance patterns with proper memoization and callback usage
144
+
145
+ ### Notes
146
+ 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.
147
+
148
+ ## [0.4.2] - 2025-11-29
149
+
150
+ ### Added
151
+ - **DataTable**: New `enableSorting` prop for automatic internal sort state management. No need to manage `sortBy` and `sortDirection` state yourself - perfect for simple tables
152
+ - **DataTable**: New `defaultSortBy` and `defaultSortDirection` props to set initial sort state when using `enableSorting`
153
+ - **DataTable**: New `mobileSorting` prop (default: true) to show/hide sort buttons on mobile card view
154
+ - **DataTable**: Full sorting support for mobile card view with dedicated sort buttons above cards
155
+ - **DataTable**: Pagination controls with Previous/Next buttons. Previously only showed "Page X of Y" text without navigation buttons
156
+ - **DataTable**: Automatic sorting logic handles strings (with `localeCompare`), numbers, dates, and null values
157
+ - **Documentation**: Added "Simple Sorting" example showing the new `enableSorting` feature with code samples
158
+
159
+ ### Fixed
160
+ - **DataTable**: Fixed search clear button (X icon) positioning in RTL mode. Changed from `me-1` to `end-1` for proper logical positioning
161
+ - **DataTable**: Fixed pagination chevron icons in RTL mode with `rtl:rotate-180` class so arrows point in correct reading direction
162
+ - **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
163
+ - **DataTable Documentation**: Fixed "Complete Example" not paginating correctly by adding separate pagination state and properly slicing filtered data
164
+ - **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
165
+ - **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
166
+ - **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
167
+
168
+ ### Changed
169
+ - **DataTable**: Sorting state now cycles through: asc → desc → null (clears sort) instead of just toggling between asc/desc
170
+ - **DataTable**: Mobile table view now includes sort buttons in headers (previously desktop-only)
171
+ - **DataTable**: Documentation restructured to show simple internal sorting example before advanced external state management
172
+
173
+ ---
174
+
175
+ ## [0.4.1] - 2025-11-29
176
+
177
+ ### Added
178
+ - **Calendar**: New `showIslamicHolidays` prop for automatic Islamic holiday highlighting. When enabled with `showHijri={true}`, displays event dots on 10 major Islamic holidays including:
179
+ - Islamic New Year (Muharram 1)
180
+ - Day of Ashura (Muharram 10)
181
+ - Prophet's Birthday (Rabi' al-Awwal 12)
182
+ - Isra and Mi'raj (Rajab 27)
183
+ - Laylat al-Bara'ah (Sha'ban 15)
184
+ - Start of Ramadan (Ramadan 1)
185
+ - Laylat al-Qadr (Ramadan 27)
186
+ - Eid al-Fitr (Shawwal 1)
187
+ - Day of Arafah (Dhu al-Hijjah 9)
188
+ - Eid al-Adha (Dhu al-Hijjah 10)
189
+ - **HijriDate**: Exported `ISLAMIC_HOLIDAYS` array and `getIslamicHoliday()` function for external use
190
+ - **Documentation**: Added "Islamic Holidays" feature card and interactive example to Calendar component page
191
+ - **Documentation**: Created book-content workspace with 3 complete RTL lessons (Keyboard Shortcuts, Positioning vs Direction, Transform Animations)
192
+
193
+ ### Fixed
194
+ - **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
195
+ - **DropdownMenuShortcut**: Fixed keyboard shortcuts reversing in RTL mode with same nested span pattern
196
+ - **CommandShortcut**: Fixed keyboard shortcuts reversing in RTL mode with same nested span pattern
197
+ - **Switch**: Fixed toggle thumb sliding in wrong direction in RTL mode. Added RTL transform variants (`rtl:-translate-x-4`) for proper animation direction
198
+
199
+ ### Changed
200
+ - Updated Calendar component documentation with new Islamic holidays feature
201
+ - Updated roadmap page with completed RTL fixes and Islamic holidays enhancement
202
+ - Enhanced RTL guide page with "Lessons Learned" section featuring 3 documented patterns
203
+
204
+ ---
205
+
206
+ ## [0.4.0] - 2025-11-28
207
+
208
+ ### Added
209
+
210
+ #### New Components (8 Components)
211
+ - **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.
212
+ - **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.
213
+ - **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.
214
+ - **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.
215
+ - **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.
216
+ - **Blockquote**: Styled quote component with 3 variants (default, accent, subtle). Supports author attribution, source citations, and clickable cite URLs. Clean typography with proper spacing.
217
+ - **PullQuote**: Large emphasized quote for highlighting key text. Supports 3 alignments (left, center, right). Uses elegant serif typography with decorative quotation marks.
218
+ - **StatsCard**: Dashboard statistics display card with icon, label, value, and optional trend indicator. Clean card-based design for analytics dashboards.
219
+
220
+ #### New Hooks
221
+ - **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.
222
+
223
+ ### Changed
224
+ - Updated component count from 65 to 73+ components
225
+ - Expanded package exports with new UI components and hooks
226
+ - Enhanced social and content-focused capabilities
227
+
228
+ ---
229
+
230
+ ## [0.3.14] - 2025-11-23
231
+
232
+ ### Added
233
+ - **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.
234
+ - **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.
235
+
236
+ ---
237
+
238
+ ## [0.3.13] - 2025-11-22
239
+
240
+ ### Fixed
241
+ - **RichTextEditor**: Fixed `jsx` attribute console error in Next.js 16 with Turbopack. Replaced styled-jsx with standard `dangerouslySetInnerHTML` for inline styles.
242
+
243
+ ---
244
+
245
+ ## [0.3.12] - 2025-11-22
246
+
247
+ ### Added
248
+ - **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).
249
+
250
+ ---
251
+
252
+ ## [0.3.11] - 2025-11-22
253
+
254
+ ### Added
255
+ - **DashboardShell**: New `headerActions` prop to add custom actions (like theme/language switchers) to the header.
256
+
257
+ ### Fixed
258
+ - **DashboardShell**: Accessibility warning (DialogTitle) in mobile sidebar.
259
+ - **DashboardShell**: Mobile sidebar uses `side="start"` for proper RTL support via CSS logical properties.
260
+
261
+ ---
262
+
263
+ ## [0.3.8] - 2025-11-22
264
+
265
+ ### Fixed
266
+ - **DashboardShell**: Fixed accessibility warning by adding visually hidden `SheetTitle` to mobile sidebar. This resolves the console warning about `DialogContent requires a DialogTitle`.
267
+ - **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.
268
+
269
+ ---
270
+
271
+ ## [0.3.7] - 2025-11-21
272
+
273
+ ### Added
274
+ - Proper build process for npm package with tsup
275
+ - CSS output with Tailwind compilation
276
+
277
+ ### Changed
278
+ - Updated exports for proper module resolution
279
+ - Added .js extensions for ESM compatibility
280
+
281
+ ---
282
+
283
+ ## [0.3.0] - 2025-11-21
284
+
285
+ ### Added
286
+ - Complete restructuring of package build process
287
+ - Better TypeScript support and type exports
288
+
289
+ ---
290
+
291
+ ## [0.2.1] - 2025-11-20
292
+
293
+ ### Changed
294
+ - Updated package structure with complete barrel exports
295
+ - Fixed TypeScript exports in components/index.ts
296
+ - Updated homepage URL to noorui.com
297
+
298
+ ### Added
299
+ - Complete barrel export with all 74+ components
300
+ - CHANGELOG.md, CONTRIBUTING.md documentation
301
+ - Improved package files configuration
302
+
303
+ ---
304
+
305
+ ## [0.2.0] - 2025-11-20
306
+
307
+ ### Added
308
+
309
+ Major update to Noor UI with significant component additions and improvements.
310
+
311
+ **Core Components (69)**
312
+ - Form components: Form, Button, Input, Label, Textarea, Checkbox, Radio Group, Select, Switch, Slider
313
+ - Layout components: Card, Separator, Tabs, Accordion, Collapsible
314
+ - Navigation: Breadcrumb, Pagination, Command
315
+ - Feedback: Alert, Toast, Progress, Skeleton, Badge, Avatar
316
+ - Overlays: Dialog, Sheet, Popover, Tooltip, Dropdown Menu, Context Menu
317
+ - Data display: Table, DataTable, StatsCard, FeatureCard, EmptyState, ListingCard
318
+ - Advanced forms: File Upload, Rich Text Editor, Date Picker, Time Picker, Number Input
319
+ - Layout shells: Dashboard Shell
320
+ - User interface: User Menu, Notification Center, Stepper
321
+
322
+ **GCC-Specific Components (5)**
323
+ - Prayer Times with countdown and Adhan notifications
324
+ - Hijri Date with dual calendar display
325
+ - Arabic Number utilities for Arabic-Indic numerals
326
+ - Zakat Calculator with export/sharing
327
+ - Calendar with Gregorian/Hijri support
328
+
329
+ **AI/LLM Components (10)** 🧪 Experimental
330
+ - ChatMessage, StreamingText, PromptInput, ThinkingIndicator
331
+ - MessageActions, ModelSelector, ParameterSlider, TokenCounter
332
+ - ConversationHistory, WorkflowCanvas
333
+
334
+ **Features**
335
+ - Complete RTL support with logical properties
336
+ - 74+ production-ready and experimental components
337
+ - Full TypeScript support with type definitions
338
+ - Radix UI primitives for accessibility
339
+ - Tailwind CSS with design tokens
340
+ - Light/dark mode support
341
+ - Bilingual content (English/Arabic)
342
+ - WCAG AA compliant
343
+
344
+ ### Changed
345
+ - Updated package structure to include all 74+ components
346
+ - Improved TypeScript types and exports
347
+ - Enhanced documentation
348
+
349
+ ### Notes
350
+ This release includes 10 new experimental AI/LLM components. These are functional but APIs may evolve based on feedback.
351
+
352
+ ---
353
+
354
+ ## [0.1.2] - 2025-11-14
355
+
356
+ ### Added
357
+
358
+ Initial release of Noor UI - RTL-first React component library with core components.
359
+
360
+ ---
361
+
362
+ ## Format
363
+
364
+ ### [Version] - YYYY-MM-DD
365
+
366
+ #### Added
367
+ - New features or components
368
+
369
+ #### Changed
370
+ - Changes in existing functionality
371
+
372
+ #### Deprecated
373
+ - Features that will be removed in upcoming releases
374
+
375
+ #### Removed
376
+ - Features that were removed
377
+
378
+ #### Fixed
379
+ - Bug fixes
380
+
381
+ #### Security
382
+ - 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! 🌟