noorui-rtl 0.4.6 → 0.4.7

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2024-2025 Nuno Marques
3
+ Copyright (c) 2024 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
package/README.md CHANGED
@@ -1,336 +1,107 @@
1
- # Noor UI
1
+ # Noor UI
2
2
 
3
- > نور - "Light" in Arabic
4
-
5
- [![npm version](https://badge.fury.io/js/noorui-rtl.svg)](https://www.npmjs.com/package/noorui-rtl)
3
+ [![npm version](https://img.shields.io/npm/v/noorui-rtl.svg)](https://www.npmjs.com/package/noorui-rtl)
6
4
  [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
5
+ [![Storybook](https://img.shields.io/badge/Storybook-Interactive-FF4785?logo=storybook&logoColor=white)](https://storybook.noorui.com)
7
6
 
8
7
  ![Noor UI - Beautiful RTL-first React components for bilingual applications](https://raw.githubusercontent.com/ositaka/noor-ui/main/public/noorui--og-image--bilingual.png)
9
8
 
10
9
  Beautiful RTL-first React components for bilingual applications. Built with Radix UI, Tailwind CSS, and full Arabic/English support.
11
10
 
12
- **[Documentation](https://noorui.com)** · **[Examples](https://noorui.com/examples)** · **[npm](https://www.npmjs.com/package/noorui-rtl)**
13
-
14
- ## ✨ Features
11
+ ## Features
15
12
 
16
- - 🌍 **RTL-First**: Perfect Arabic/Persian support with logical properties
17
- - 🎨 **74+ Components**: Complete UI toolkit for modern applications
18
- - ♿ **Accessible**: WCAG AA compliant with full keyboard navigation
19
- - 🎯 **TypeScript**: Full type safety and IntelliSense support
20
- - 🎭 **Themeable**: Light/dark mode with customizable design tokens
21
- - 🕌 **GCC-Specific**: Prayer times, Hijri calendar, Arabic numbers, Zakat calculator
22
- - **Modern Stack**: Next.js 15, React 19, Tailwind CSS, Radix UI
23
- - 📦 **Tree-shakeable**: Only bundle what you use
13
+ **RTL-First Design** - Built from the ground up with RTL languages in mind
14
+ 🌍 **Bilingual Support** - Seamless English/Arabic language switching
15
+ ♿ **Accessible** - WCAG 2.1 compliant components
16
+ 🎨 **Themeable** - Multiple built-in themes with easy customization
17
+ 📦 **Tree-shakeable** - Import only what you need
18
+ **TypeScript** - Full type safety out of the box
19
+ 🕌 **GCC-Specific** - Components for Gulf region markets (Prayer Times, Hijri Calendar, Zakat Calculator)
24
20
 
25
- ## 📦 Installation
21
+ ## Installation
26
22
 
27
23
  ```bash
28
24
  npm install noorui-rtl
29
- # or
30
- yarn add noorui-rtl
31
- # or
32
- pnpm add noorui-rtl
33
- ```
34
-
35
- ## 🚀 Quick Start
36
-
37
- ### 1. Install the package
38
-
39
- ```bash
40
- npm install noorui-rtl
41
- ```
42
-
43
- ### 2. Import the CSS
44
-
45
- **Option A: Pre-compiled CSS (Recommended - No Tailwind setup needed)**
46
-
47
- Import the pre-compiled CSS in your root layout or app entry point:
48
-
49
- ```tsx
50
- // app/layout.tsx or _app.tsx
51
- import 'noorui-rtl/dist/styles.css'
52
- ```
53
-
54
- This includes all component styles, CSS variables, theme definitions, and RTL support. **No Tailwind configuration required!**
55
-
56
- **Option B: Tailwind Configuration (For custom Tailwind setups)**
57
-
58
- If you're already using Tailwind and want to customize the configuration:
59
-
60
- 1. Update your `tailwind.config.ts`:
61
-
62
- ```typescript
63
- import type { Config } from 'tailwindcss'
64
-
65
- const config: Config = {
66
- content: [
67
- './app/**/*.{js,ts,jsx,tsx,mdx}',
68
- './components/**/*.{js,ts,jsx,tsx,mdx}',
69
- // Add noorui-rtl components
70
- './node_modules/noorui-rtl/**/*.{js,ts,jsx,tsx}',
71
- ],
72
- theme: {
73
- extend: {},
74
- },
75
- plugins: [],
76
- }
77
-
78
- export default config
79
- ```
80
-
81
- 2. Add CSS variables to `globals.css`:
82
-
83
- ```css
84
- @tailwind base;
85
- @tailwind components;
86
- @tailwind utilities;
87
-
88
- @layer base {
89
- :root {
90
- --background: 0 0% 100%;
91
- --foreground: 222.2 84% 4.9%;
92
- --card: 0 0% 100%;
93
- --card-foreground: 222.2 84% 4.9%;
94
- --popover: 0 0% 100%;
95
- --popover-foreground: 222.2 84% 4.9%;
96
- --primary: 222.2 47.4% 11.2%;
97
- --primary-foreground: 210 40% 98%;
98
- --secondary: 210 40% 96.1%;
99
- --secondary-foreground: 222.2 47.4% 11.2%;
100
- --muted: 210 40% 96.1%;
101
- --muted-foreground: 215.4 16.3% 46.9%;
102
- --accent: 210 40% 96.1%;
103
- --accent-foreground: 222.2 47.4% 11.2%;
104
- --destructive: 0 84.2% 60.2%;
105
- --destructive-foreground: 210 40% 98%;
106
- --border: 214.3 31.8% 91.4%;
107
- --input: 214.3 31.8% 91.4%;
108
- --ring: 222.2 84% 4.9%;
109
- --radius: 0.5rem;
110
- }
111
-
112
- .dark {
113
- --background: 222.2 84% 4.9%;
114
- --foreground: 210 40% 98%;
115
- /* ... rest of dark mode variables */
116
- }
117
- }
118
- ```
119
-
120
- ### 3. Wrap your app with providers
121
-
122
- Add the theme and direction providers to enable all features:
123
-
124
- ```tsx
125
- import { ThemeProvider } from 'next-themes'
126
- import { DirectionProvider, DesignSystemProvider } from 'noorui-rtl'
127
-
128
- export default function RootLayout({ children }) {
129
- return (
130
- <html>
131
- <body>
132
- <ThemeProvider attribute="class" enableSystem={true}>
133
- <DirectionProvider>
134
- <DesignSystemProvider defaultTheme="cozy">
135
- {children}
136
- </DesignSystemProvider>
137
- </DirectionProvider>
138
- </ThemeProvider>
139
- </body>
140
- </html>
141
- )
142
- }
143
- ```
144
-
145
- **What each provider does:**
146
- - **`ThemeProvider`** (next-themes): Light/Dark mode with system preference support
147
- - **`DirectionProvider`**: RTL/LTR direction and locale switching (ar/en)
148
- - **`DesignSystemProvider`**: Design theme variants (minimal/futuristic/cozy/artistic)
149
-
150
- **Switching themes programmatically:**
151
-
152
- ```tsx
153
- import { useDesignSystem } from 'noorui-rtl'
154
- import { useTheme } from 'next-themes'
155
- import { useDirection } from 'noorui-rtl'
156
-
157
- function Settings() {
158
- const { designTheme, setDesignTheme } = useDesignSystem()
159
- const { theme, setTheme } = useTheme()
160
- const { direction, setDirection } = useDirection()
161
-
162
- return (
163
- <div>
164
- {/* Design theme */}
165
- <select value={designTheme} onChange={(e) => setDesignTheme(e.target.value)}>
166
- <option value="minimal">Minimal</option>
167
- <option value="futuristic">Futuristic</option>
168
- <option value="cozy">Cozy</option>
169
- <option value="artistic">Artistic</option>
170
- </select>
171
-
172
- {/* Light/Dark mode */}
173
- <button onClick={() => setTheme(theme === 'dark' ? 'light' : 'dark')}>
174
- Toggle {theme === 'dark' ? 'Light' : 'Dark'} Mode
175
- </button>
176
-
177
- {/* Direction */}
178
- <button onClick={() => setDirection(direction === 'rtl' ? 'ltr' : 'rtl')}>
179
- Switch to {direction === 'rtl' ? 'LTR' : 'RTL'}
180
- </button>
181
- </div>
182
- )
183
- }
184
- ```
185
-
186
- ### 4. Start using components
187
-
188
- ```tsx
189
- import { Button, Card, CardHeader, CardTitle, CardContent } from 'noorui-rtl'
190
-
191
- export default function App() {
192
- return (
193
- <Card>
194
- <CardHeader>
195
- <CardTitle>Welcome to Noor UI</CardTitle>
196
- </CardHeader>
197
- <CardContent>
198
- <Button>Get Started</Button>
199
- </CardContent>
200
- </Card>
201
- )
202
- }
203
25
  ```
204
26
 
205
- ## 📚 Components
206
-
207
- ### Core UI (54 components)
208
-
209
- **Forms**: Button, Input, Label, Textarea, Checkbox, Radio, Select, Switch, Slider, Form
210
-
211
- **Layout**: Card, Separator, Tabs, Accordion, Collapsible
212
-
213
- **Navigation**: Breadcrumb, Pagination, Command
214
-
215
- **Feedback**: Alert, Toast, Progress, Skeleton, Badge, Avatar, Loading Spinner
216
-
217
- **Overlays**: Dialog, Sheet, Popover, Tooltip, Dropdown Menu, Context Menu
218
-
219
- **Data**: Table, DataTable, Stats Card, Feature Card, Empty State, Listing Card
220
-
221
- **Advanced**: File Upload, Rich Text Editor, Date Picker, Time Picker, Number Input, Dashboard Shell, User Menu, Notification Center, Stepper
222
-
223
- ### GCC-Specific (5 components)
224
-
225
- - **Prayer Times**: Display Islamic prayer times with countdown and Adhan notifications
226
- - **Hijri Date**: Dual Gregorian/Hijri calendar display
227
- - **Arabic Number**: Arabic-Indic numeral utilities and SAR currency formatting
228
- - **Zakat Calculator**: Calculate Islamic Zakat with export/sharing
229
- - **Calendar**: Date picker with Hijri support and event markers
230
-
231
- ### AI/LLM Components (10 experimental) 🧪
232
-
233
- Chat Message, Streaming Text, Prompt Input, Thinking Indicator, Message Actions, Model Selector, Parameter Slider, Token Counter, Conversation History, Workflow Canvas
234
-
235
- > Note: AI/LLM components are functional but APIs may evolve based on feedback.
236
-
237
- ## 🎨 RTL Support
238
-
239
- All components support RTL out of the box:
27
+ ## Quick Start
240
28
 
241
29
  ```tsx
242
- 'use client'
243
-
244
- import { useState } from 'react'
245
- import { Button, Tabs, TabsList, TabsTrigger } from 'noorui-rtl'
246
-
247
- export default function App() {
248
- const [direction, setDirection] = useState<'ltr' | 'rtl'>('ltr')
249
-
250
- return (
251
- <div dir={direction}>
252
- <Button onClick={() => setDirection(d => d === 'ltr' ? 'rtl' : 'ltr')}>
253
- Toggle Direction
254
- </Button>
255
-
256
- <Tabs defaultValue="tab1">
257
- <TabsList>
258
- <TabsTrigger value="tab1">Tab 1</TabsTrigger>
259
- <TabsTrigger value="tab2">Tab 2</TabsTrigger>
260
- </TabsList>
261
- </Tabs>
262
- </div>
263
- )
264
- }
265
- ```
266
-
267
- Components automatically adapt to text direction using logical properties.
268
-
269
- ## 🔧 Usage with Providers
270
-
271
- For advanced features like direction context:
272
-
273
- ```tsx
274
- import { DirectionProvider, useDirection } from 'noorui-rtl'
30
+ import { NoorProvider } from 'noorui-rtl';
31
+ import 'noorui-rtl/styles.css';
275
32
 
276
33
  function App() {
277
34
  return (
278
- <DirectionProvider>
35
+ <NoorProvider locale="ar" direction="rtl">
279
36
  <YourApp />
280
- </DirectionProvider>
281
- )
282
- }
283
-
284
- function YourComponent() {
285
- const { direction, setDirection, locale } = useDirection()
286
-
287
- return (
288
- <button onClick={() => setDirection(direction === 'ltr' ? 'rtl' : 'ltr')}>
289
- Current: {direction}
290
- </button>
291
- )
37
+ </NoorProvider>
38
+ );
292
39
  }
293
40
  ```
294
41
 
295
- ## 📖 Documentation
296
-
297
- Full documentation, examples, and guides available at **[noorui.com](https://noorui.com)**
298
-
299
- - [Getting Started](https://noorui.com/getting-started)
300
- - [Components](https://noorui.com/components)
301
- - [RTL Guide](https://noorui.com/rtl-guide)
302
- - [Examples](https://noorui.com/examples)
303
- - [Starters](https://noorui.com/starters)
304
- - [Design Tokens](https://noorui.com/tokens)
305
-
306
- ## 🤝 Contributing
307
-
308
- Contributions are welcome! Please read our [Contributing Guide](https://github.com/ositaka/noor-ui/blob/main/CONTRIBUTING.md).
309
-
310
- ## 📄 License
311
-
312
- MIT License - see [LICENSE](https://github.com/ositaka/noor-ui/blob/main/LICENSE)
313
-
314
- ## 🙏 Credits
315
-
316
- Built with:
317
- - [Radix UI](https://www.radix-ui.com/) - Accessible component primitives
318
- - [Tailwind CSS](https://tailwindcss.com/) - Utility-first CSS framework
319
- - [Lucide React](https://lucide.dev/) - Beautiful icons
320
- - [Next.js](https://nextjs.org/) - React framework
321
-
322
- ## 💬 Support
323
-
324
- - 💬 Discord: [Join our community](https://discord.gg/gvrqU2WG)
325
- - 📧 Email: info@ositaka.com
326
- - 🐛 Issues: [GitHub Issues](https://github.com/ositaka/noor-ui/issues)
327
- - 💬 Discussions: [GitHub Discussions](https://github.com/ositaka/noor-ui/discussions)
328
- - 🌐 Website: [noorui.com](https://noorui.com)
329
-
330
- ## 🌟 Show Your Support
331
-
332
- If you find Noor UI helpful, please give it a ⭐️ on [GitHub](https://github.com/ositaka/noor-ui)!
42
+ ## Documentation
43
+
44
+ - **[Documentation](https://noorui.com)** - Full documentation and guides
45
+ - **[Storybook](https://storybook.noorui.com)** - Interactive component playground with 749 stories
46
+ - **[Examples](https://noorui.com/examples)** - Real-world usage examples
47
+
48
+ ## Components
49
+
50
+ ### Core Components
51
+ - Button, Card, Badge, Avatar, Separator, Label, Input
52
+ - Alert, Toast, Dialog, Sheet, Popover, Tooltip
53
+ - Select, Checkbox, Radio Group, Switch, Slider
54
+ - Tabs, Accordion, Collapsible
55
+ - Table, Data Table, Pagination
56
+ - Command Menu, Dropdown Menu, Context Menu
57
+
58
+ ### Advanced Components
59
+ - Dashboard Shell
60
+ - User Menu
61
+ - Notification Center
62
+ - Stepper
63
+ - File Upload
64
+ - Rich Text Editor
65
+ - Date Picker, Time Picker
66
+ - Number Input
67
+
68
+ ### GCC-Specific Components
69
+ - Prayer Times
70
+ - Hijri Date
71
+ - Arabic Number
72
+ - Zakat Calculator
73
+
74
+ ### AI/LLM Components
75
+ - Chat Message
76
+ - Prompt Input
77
+ - Thinking Indicator
78
+ - Message Actions
79
+ - Model Selector
80
+ - Parameter Slider
81
+ - Token Counter
82
+ - Conversation History
83
+ - Workflow Canvas
84
+ - Workflow Node
85
+
86
+ ## Requirements
87
+
88
+ - React 18+
89
+ - Tailwind CSS 3.4+
90
+ - Node.js 18+
91
+
92
+ ## License
93
+
94
+ MIT © [Nuno Marques](https://ositaka.com)
95
+
96
+ ## Links
97
+
98
+ - 🌐 [Website](https://noorui.com)
99
+ - 📚 [Documentation](https://noorui.com/documentation)
100
+ - 📖 [Storybook](https://storybook.noorui.com) - Interactive component showcase
101
+ - 💬 [Discord Community](https://discord.gg/gvrqU2WG)
102
+ - 🐛 [Issues](https://github.com/ositaka/noor-ui/issues)
103
+ - 💬 [Discussions](https://github.com/ositaka/noor-ui/discussions)
333
104
 
334
105
  ---
335
106
 
336
- **Built with ❤️ for the GCC market by [Nuno Marques](https://ositaka.com)**
107
+ Made with ❤️ for the bilingual web