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 +1 -1
- package/README.md +81 -310
- package/dist/index.d.mts +31 -1885
- package/dist/index.d.ts +31 -1885
- package/dist/index.js +45 -24016
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +42 -23788
- package/dist/index.mjs.map +1 -1
- package/package.json +40 -86
- package/CHANGELOG.md +0 -346
- package/CONTRIBUTING.md +0 -314
- package/dist/styles.css +0 -3
- package/styles/globals.css +0 -338
- package/styles/package.css +0 -343
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -1,336 +1,107 @@
|
|
|
1
|
-
# Noor UI
|
|
1
|
+
# Noor UI
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
[](https://www.npmjs.com/package/noorui-rtl)
|
|
3
|
+
[](https://www.npmjs.com/package/noorui-rtl)
|
|
6
4
|
[](https://opensource.org/licenses/MIT)
|
|
5
|
+
[](https://storybook.noorui.com)
|
|
7
6
|
|
|
8
7
|

|
|
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
|
-
|
|
13
|
-
|
|
14
|
-
## ✨ Features
|
|
11
|
+
## Features
|
|
15
12
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
-
|
|
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
|
-
##
|
|
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
|
-
##
|
|
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
|
-
|
|
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
|
-
<
|
|
35
|
+
<NoorProvider locale="ar" direction="rtl">
|
|
279
36
|
<YourApp />
|
|
280
|
-
</
|
|
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
|
-
##
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
- [
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
-
|
|
318
|
-
-
|
|
319
|
-
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
-
|
|
325
|
-
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
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
|
-
|
|
107
|
+
Made with ❤️ for the bilingual web
|