noorui-rtl 0.6.1 → 0.7.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 +21 -12
- package/README.md +79 -0
- package/dist/index.d.mts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +31 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +31 -3
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/styles/globals.css +131 -119
- package/styles/package.css +131 -119
package/CHANGELOG.md
CHANGED
|
@@ -13,17 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
13
13
|
- TimePicker & TimeRangePicker popups appear on wrong side in RTL mode
|
|
14
14
|
- Need to add automatic direction detection (similar to DropdownMenu pattern)
|
|
15
15
|
|
|
16
|
-
## [0.
|
|
17
|
-
|
|
18
|
-
### Fixed
|
|
19
|
-
- **README**: Updated `@theme` block to include semantic status tokens (`success`, `warning`, `info`), font families, and correct `:root` color values
|
|
20
|
-
- **README**: Fixed version claim from "Next.js 15, React 19" to "React 18+, Next.js 14+, Tailwind CSS 4.1+" to match actual peer dependencies
|
|
21
|
-
- **MIGRATION_GUIDE**: Removed stale reference to copying `tailwind.config.ts` (deleted in v0.6.0)
|
|
22
|
-
- **CHANGELOG**: Added missing v0.6.0 entry documenting the Tailwind v4 migration
|
|
23
|
-
|
|
24
|
-
---
|
|
25
|
-
|
|
26
|
-
## [0.6.0] - 2026-02-07
|
|
16
|
+
## [0.7.0] - 2026-02-07
|
|
27
17
|
|
|
28
18
|
### Breaking Changes
|
|
29
19
|
- **Tailwind CSS v4.1+ required**: Migrated from Tailwind v3 to v4.1 CSS-first configuration
|
|
@@ -31,23 +21,42 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
31
21
|
- Consumers using Option B (custom Tailwind setup) must update to Tailwind v4.1+ and use `@tailwindcss/postcss`
|
|
32
22
|
- PostCSS config must use `@tailwindcss/postcss` instead of the old `tailwindcss` plugin
|
|
33
23
|
- Option A (pre-compiled CSS via `import 'noorui-rtl/dist/styles.css'`) continues to work without changes
|
|
24
|
+
- **Theme classes now use `--color-*` variables**: Custom themes must use `--color-primary: hsl(...)` format
|
|
34
25
|
|
|
35
26
|
### Added
|
|
27
|
+
- **Custom Themes**: Theme system is now extensible — consumers can create custom themes by defining CSS classes that override design token variables
|
|
28
|
+
- New `BuiltInTheme` type exported for referencing the 4 built-in themes
|
|
29
|
+
- `Theme` type widened to accept any string while preserving autocomplete for built-in names
|
|
30
|
+
- `DesignSystemProvider` now accepts any theme name (no longer restricted to hardcoded list)
|
|
31
|
+
- Dynamic `theme-*` class removal replaces hardcoded class list for forward compatibility
|
|
36
32
|
- **Semantic status tokens**: `success`, `warning`, `info` (+ foreground variants) for consistent feedback colors across Alert, Callout, Toast, and Stats components
|
|
37
33
|
- **`tailwindcss` peer dependency**: Declared `tailwindcss: ">=4.1.0"` (optional) so package managers can warn about incompatible versions
|
|
38
34
|
- **Font family tokens**: `--font-sans`, `--font-arabic`, `--font-mono` registered in `@theme` for Tailwind utility generation
|
|
39
35
|
- **Shadow and animation tokens**: Full shadow scale (`sm` through `2xl`) and component animations registered in `@theme`
|
|
36
|
+
- **Documentation**: New "Custom Themes" section in README with step-by-step guide, CSS example, and variables reference
|
|
37
|
+
- **Documentation**: New "Creating Custom Themes" section on website Themes page with i18n support (EN + AR)
|
|
40
38
|
|
|
41
39
|
### Changed
|
|
42
40
|
- **CSS architecture**: Replaced `@layer base` with `@theme` blocks for design token registration
|
|
43
41
|
- **Dark mode**: Now uses `@custom-variant dark (&:where(.dark, .dark *))` instead of Tailwind v3 `darkMode: 'class'`
|
|
44
42
|
- **PostCSS**: Switched from `tailwindcss` + `autoprefixer` to `@tailwindcss/postcss` only
|
|
43
|
+
- **Theme classes**: Use `--color-*` and `--radius-lg/md/sm` for proper scoping
|
|
44
|
+
- **`useThemeTokens` hook**: Now reads `--color-*` variables
|
|
45
|
+
- **Types**: `themeConfig` now typed as `Record<BuiltInTheme, ...>` instead of `Record<Theme, ...>` for type safety with custom themes
|
|
46
|
+
- **Theme Switcher Components**: Updated to use `BuiltInTheme` type and dynamic class removal
|
|
47
|
+
|
|
48
|
+
### Fixed
|
|
49
|
+
- **Theme card previews**: Show correct per-theme colors and radius
|
|
50
|
+
- **i18n**: ~50 hardcoded English strings replaced with EN/AR translations
|
|
51
|
+
- **README**: Updated `@theme` block to include semantic status tokens, font families, and correct `:root` color values
|
|
52
|
+
- **README**: Fixed version claim from "Next.js 15, React 19" to "React 18+, Next.js 14+, Tailwind CSS 4.1+" to match actual peer dependencies
|
|
53
|
+
- **MIGRATION_GUIDE**: Removed stale reference to copying `tailwind.config.ts` (deleted in v0.6.0)
|
|
45
54
|
|
|
46
55
|
### Removed
|
|
47
56
|
- **`tailwind.config.ts`**: Deleted — all configuration is now CSS-first via `@theme` and `@custom-variant`
|
|
48
57
|
|
|
49
58
|
### Notes
|
|
50
|
-
This is a
|
|
59
|
+
This is a significant release covering the Tailwind v3 → v4 migration, `--color-*` variable refactoring, custom themes system, and i18n improvements. Consumers using Option A (pre-compiled CSS) are unaffected by the breaking changes. See the updated README for the new CSS-first setup instructions.
|
|
51
60
|
|
|
52
61
|
---
|
|
53
62
|
|
package/README.md
CHANGED
|
@@ -309,6 +309,85 @@ export default function App() {
|
|
|
309
309
|
|
|
310
310
|
Components automatically adapt to text direction using logical properties.
|
|
311
311
|
|
|
312
|
+
## 🎨 Custom Themes
|
|
313
|
+
|
|
314
|
+
The theme system is powered by CSS custom properties. You can create your own themes by defining a CSS class that overrides these variables.
|
|
315
|
+
|
|
316
|
+
### 1. Define your theme CSS
|
|
317
|
+
|
|
318
|
+
Add a `.theme-yourname` class to your `globals.css` with light and dark mode variants:
|
|
319
|
+
|
|
320
|
+
```css
|
|
321
|
+
/* Light mode */
|
|
322
|
+
.theme-ocean {
|
|
323
|
+
--color-background: hsl(200 20% 98%);
|
|
324
|
+
--color-foreground: hsl(210 40% 10%);
|
|
325
|
+
--color-primary: hsl(200 80% 50%);
|
|
326
|
+
--color-primary-foreground: hsl(0 0% 100%);
|
|
327
|
+
--color-secondary: hsl(180 60% 45%);
|
|
328
|
+
--color-secondary-foreground: hsl(180 100% 10%);
|
|
329
|
+
--color-muted: hsl(200 20% 94%);
|
|
330
|
+
--color-muted-foreground: hsl(200 10% 40%);
|
|
331
|
+
--color-accent: hsl(200 20% 94%);
|
|
332
|
+
--color-accent-foreground: hsl(210 40% 10%);
|
|
333
|
+
--color-card: hsl(0 0% 100%);
|
|
334
|
+
--color-card-foreground: hsl(210 40% 10%);
|
|
335
|
+
--color-popover: hsl(0 0% 100%);
|
|
336
|
+
--color-popover-foreground: hsl(210 40% 10%);
|
|
337
|
+
--color-border: hsl(200 20% 88%);
|
|
338
|
+
--color-input: hsl(200 20% 88%);
|
|
339
|
+
--color-ring: hsl(200 80% 50%);
|
|
340
|
+
--color-destructive: hsl(0 84% 60%);
|
|
341
|
+
--color-destructive-foreground: hsl(0 0% 100%);
|
|
342
|
+
--radius: 0.75rem;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
/* Dark mode */
|
|
346
|
+
.dark .theme-ocean,
|
|
347
|
+
.theme-ocean.dark {
|
|
348
|
+
--color-background: hsl(210 40% 8%);
|
|
349
|
+
--color-foreground: hsl(200 20% 95%);
|
|
350
|
+
--color-primary: hsl(200 80% 60%);
|
|
351
|
+
--color-primary-foreground: hsl(210 40% 8%);
|
|
352
|
+
--color-card: hsl(210 35% 12%);
|
|
353
|
+
--color-card-foreground: hsl(200 20% 95%);
|
|
354
|
+
--color-border: hsl(210 30% 20%);
|
|
355
|
+
--color-input: hsl(210 30% 20%);
|
|
356
|
+
}
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
See `styles/globals.css` in the package for all 4 built-in themes as a reference.
|
|
360
|
+
|
|
361
|
+
### 2. Use your theme
|
|
362
|
+
|
|
363
|
+
Pass your custom theme name to the `DesignSystemProvider`:
|
|
364
|
+
|
|
365
|
+
```tsx
|
|
366
|
+
<DesignSystemProvider defaultTheme="ocean">
|
|
367
|
+
{children}
|
|
368
|
+
</DesignSystemProvider>
|
|
369
|
+
```
|
|
370
|
+
|
|
371
|
+
The provider accepts any string as a theme name and applies the corresponding `.theme-{name}` CSS class to `<html>`.
|
|
372
|
+
|
|
373
|
+
### CSS Variables Reference
|
|
374
|
+
|
|
375
|
+
| Variable | Description |
|
|
376
|
+
|----------|-------------|
|
|
377
|
+
| `--color-background` / `--color-foreground` | Page background and text |
|
|
378
|
+
| `--color-primary` / `--color-primary-foreground` | Brand/accent color and its contrast |
|
|
379
|
+
| `--color-secondary` / `--color-secondary-foreground` | Secondary accent |
|
|
380
|
+
| `--color-muted` / `--color-muted-foreground` | Muted backgrounds and subdued text |
|
|
381
|
+
| `--color-accent` / `--color-accent-foreground` | Hover/active states |
|
|
382
|
+
| `--color-card` / `--color-card-foreground` | Card surfaces |
|
|
383
|
+
| `--color-popover` / `--color-popover-foreground` | Popover/dropdown surfaces |
|
|
384
|
+
| `--color-border` / `--color-input` / `--color-ring` | Borders, inputs, focus rings |
|
|
385
|
+
| `--color-destructive` / `--color-destructive-foreground` | Destructive actions |
|
|
386
|
+
| `--color-success` / `--color-warning` / `--color-info` | Semantic status colors (optional) |
|
|
387
|
+
| `--radius` | Base border radius |
|
|
388
|
+
|
|
389
|
+
Color values use `hsl()` format (e.g., `hsl(200 80% 50%)`). The `--color-*` prefix matches Tailwind v4's theme variable naming, so utilities like `bg-primary` resolve correctly even on nested theme elements.
|
|
390
|
+
|
|
312
391
|
## 🔧 Usage with Providers
|
|
313
392
|
|
|
314
393
|
For advanced features like direction context:
|
package/dist/index.d.mts
CHANGED
|
@@ -26,7 +26,8 @@ import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
|
26
26
|
import { Node, Edge, OnNodesChange, OnEdgesChange, OnConnect, BackgroundVariant, FitViewOptions, DefaultEdgeOptions, NodeProps } from '@xyflow/react';
|
|
27
27
|
import { ClassValue } from 'clsx';
|
|
28
28
|
|
|
29
|
-
type
|
|
29
|
+
type BuiltInTheme = 'minimal' | 'futuristic' | 'cozy' | 'artistic';
|
|
30
|
+
type Theme = BuiltInTheme | (string & {});
|
|
30
31
|
type Direction = 'ltr' | 'rtl';
|
|
31
32
|
|
|
32
33
|
interface DirectionContextType {
|
|
@@ -1914,4 +1915,4 @@ declare function useRelativeTime(date: Date | string, locale?: string, options?:
|
|
|
1914
1915
|
*/
|
|
1915
1916
|
declare function cn(...inputs: ClassValue[]): string;
|
|
1916
1917
|
|
|
1917
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertTitle, ArabicNumber, Avatar, AvatarFallback, AvatarImage, Badge, type BadgeProps, Blockquote, type BlockquoteProps, Breadcrumb, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, ButtonArrow, type ButtonArrowProps, type ButtonProps, Calendar, Callout, type CalloutProps, type CalloutType, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, ChatMessage, Checkbox, ClientProviders, Collapsible, CollapsibleContent, CollapsibleTrigger, type ColumnDef, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ContentRenderer, type ContentRendererProps, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, ConversationHistory, DashboardShell, DataTable, type DataTableProps, DatePicker, DesignSystemProvider, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DirectionProvider, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, ErrorCallout, FeatureCard, FileUpload, Form, FormDescription, FormField, FormItem, FormLabel, FormMessage, type FormProps, HijriDate, InfoCallout, Input, type InputProps, Kbd, type KbdProps, Label, ListingCard, LoadingSpinner, MessageActions, ModelSelector, NotificationCenter, NumberInput, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, ParameterSlider, Popover, PopoverContent, PopoverTrigger, PrayerTimes, Progress, PromptInput, PullQuote, type PullQuoteProps, RadioGroup, RadioGroupItem, RangeSlider, type Reaction, ReactionPicker, type ReactionPickerProps, RichTextEditor, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Skeleton, Slider, type SortDirection, StatsCard, type StatsCardProps, type Step, Stepper, type StepperProps, StreamingText, SuccessCallout, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, ThinkingIndicator, TimePicker, Toast, ToastAction, ToastClose, ToastDescription, ToastProvider, ToastTitle, ToastViewport, Toaster, TokenCounter, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, UserBadge, type UserBadgeProps, type UserBadgeVariant, UserMenu, WarningCallout, WorkflowCanvas, WorkflowNode, ZakatCalculator, badgeVariants, buttonVariants, cn, useDesignSystem, useDirection, useRelativeTime, workflowNodeTypes };
|
|
1918
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertTitle, ArabicNumber, Avatar, AvatarFallback, AvatarImage, Badge, type BadgeProps, Blockquote, type BlockquoteProps, Breadcrumb, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, type BuiltInTheme, Button, ButtonArrow, type ButtonArrowProps, type ButtonProps, Calendar, Callout, type CalloutProps, type CalloutType, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, ChatMessage, Checkbox, ClientProviders, Collapsible, CollapsibleContent, CollapsibleTrigger, type ColumnDef, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ContentRenderer, type ContentRendererProps, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, ConversationHistory, DashboardShell, DataTable, type DataTableProps, DatePicker, DesignSystemProvider, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DirectionProvider, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, ErrorCallout, FeatureCard, FileUpload, Form, FormDescription, FormField, FormItem, FormLabel, FormMessage, type FormProps, HijriDate, InfoCallout, Input, type InputProps, Kbd, type KbdProps, Label, ListingCard, LoadingSpinner, MessageActions, ModelSelector, NotificationCenter, NumberInput, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, ParameterSlider, Popover, PopoverContent, PopoverTrigger, PrayerTimes, Progress, PromptInput, PullQuote, type PullQuoteProps, RadioGroup, RadioGroupItem, RangeSlider, type Reaction, ReactionPicker, type ReactionPickerProps, RichTextEditor, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Skeleton, Slider, type SortDirection, StatsCard, type StatsCardProps, type Step, Stepper, type StepperProps, StreamingText, SuccessCallout, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, type Theme, ThinkingIndicator, TimePicker, Toast, ToastAction, ToastClose, ToastDescription, ToastProvider, ToastTitle, ToastViewport, Toaster, TokenCounter, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, UserBadge, type UserBadgeProps, type UserBadgeVariant, UserMenu, WarningCallout, WorkflowCanvas, WorkflowNode, ZakatCalculator, badgeVariants, buttonVariants, cn, useDesignSystem, useDirection, useRelativeTime, workflowNodeTypes };
|
package/dist/index.d.ts
CHANGED
|
@@ -26,7 +26,8 @@ import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
|
26
26
|
import { Node, Edge, OnNodesChange, OnEdgesChange, OnConnect, BackgroundVariant, FitViewOptions, DefaultEdgeOptions, NodeProps } from '@xyflow/react';
|
|
27
27
|
import { ClassValue } from 'clsx';
|
|
28
28
|
|
|
29
|
-
type
|
|
29
|
+
type BuiltInTheme = 'minimal' | 'futuristic' | 'cozy' | 'artistic';
|
|
30
|
+
type Theme = BuiltInTheme | (string & {});
|
|
30
31
|
type Direction = 'ltr' | 'rtl';
|
|
31
32
|
|
|
32
33
|
interface DirectionContextType {
|
|
@@ -1914,4 +1915,4 @@ declare function useRelativeTime(date: Date | string, locale?: string, options?:
|
|
|
1914
1915
|
*/
|
|
1915
1916
|
declare function cn(...inputs: ClassValue[]): string;
|
|
1916
1917
|
|
|
1917
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertTitle, ArabicNumber, Avatar, AvatarFallback, AvatarImage, Badge, type BadgeProps, Blockquote, type BlockquoteProps, Breadcrumb, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, ButtonArrow, type ButtonArrowProps, type ButtonProps, Calendar, Callout, type CalloutProps, type CalloutType, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, ChatMessage, Checkbox, ClientProviders, Collapsible, CollapsibleContent, CollapsibleTrigger, type ColumnDef, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ContentRenderer, type ContentRendererProps, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, ConversationHistory, DashboardShell, DataTable, type DataTableProps, DatePicker, DesignSystemProvider, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DirectionProvider, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, ErrorCallout, FeatureCard, FileUpload, Form, FormDescription, FormField, FormItem, FormLabel, FormMessage, type FormProps, HijriDate, InfoCallout, Input, type InputProps, Kbd, type KbdProps, Label, ListingCard, LoadingSpinner, MessageActions, ModelSelector, NotificationCenter, NumberInput, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, ParameterSlider, Popover, PopoverContent, PopoverTrigger, PrayerTimes, Progress, PromptInput, PullQuote, type PullQuoteProps, RadioGroup, RadioGroupItem, RangeSlider, type Reaction, ReactionPicker, type ReactionPickerProps, RichTextEditor, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Skeleton, Slider, type SortDirection, StatsCard, type StatsCardProps, type Step, Stepper, type StepperProps, StreamingText, SuccessCallout, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, ThinkingIndicator, TimePicker, Toast, ToastAction, ToastClose, ToastDescription, ToastProvider, ToastTitle, ToastViewport, Toaster, TokenCounter, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, UserBadge, type UserBadgeProps, type UserBadgeVariant, UserMenu, WarningCallout, WorkflowCanvas, WorkflowNode, ZakatCalculator, badgeVariants, buttonVariants, cn, useDesignSystem, useDirection, useRelativeTime, workflowNodeTypes };
|
|
1918
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertTitle, ArabicNumber, Avatar, AvatarFallback, AvatarImage, Badge, type BadgeProps, Blockquote, type BlockquoteProps, Breadcrumb, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, type BuiltInTheme, Button, ButtonArrow, type ButtonArrowProps, type ButtonProps, Calendar, Callout, type CalloutProps, type CalloutType, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, ChatMessage, Checkbox, ClientProviders, Collapsible, CollapsibleContent, CollapsibleTrigger, type ColumnDef, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ContentRenderer, type ContentRendererProps, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, ConversationHistory, DashboardShell, DataTable, type DataTableProps, DatePicker, DesignSystemProvider, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DirectionProvider, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, ErrorCallout, FeatureCard, FileUpload, Form, FormDescription, FormField, FormItem, FormLabel, FormMessage, type FormProps, HijriDate, InfoCallout, Input, type InputProps, Kbd, type KbdProps, Label, ListingCard, LoadingSpinner, MessageActions, ModelSelector, NotificationCenter, NumberInput, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, ParameterSlider, Popover, PopoverContent, PopoverTrigger, PrayerTimes, Progress, PromptInput, PullQuote, type PullQuoteProps, RadioGroup, RadioGroupItem, RangeSlider, type Reaction, ReactionPicker, type ReactionPickerProps, RichTextEditor, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Skeleton, Slider, type SortDirection, StatsCard, type StatsCardProps, type Step, Stepper, type StepperProps, StreamingText, SuccessCallout, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, type Theme, ThinkingIndicator, TimePicker, Toast, ToastAction, ToastClose, ToastDescription, ToastProvider, ToastTitle, ToastViewport, Toaster, TokenCounter, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, UserBadge, type UserBadgeProps, type UserBadgeVariant, UserMenu, WarningCallout, WorkflowCanvas, WorkflowNode, ZakatCalculator, badgeVariants, buttonVariants, cn, useDesignSystem, useDirection, useRelativeTime, workflowNodeTypes };
|
package/dist/index.js
CHANGED
|
@@ -151,13 +151,13 @@ function DesignSystemProviderInner({ children, defaultTheme = "minimal" }) {
|
|
|
151
151
|
const [designTheme, setDesignThemeState] = React74__namespace.useState(defaultTheme);
|
|
152
152
|
React74__namespace.useEffect(() => {
|
|
153
153
|
const themeParam = searchParams.get("theme");
|
|
154
|
-
if (themeParam
|
|
154
|
+
if (themeParam) {
|
|
155
155
|
setDesignThemeState(themeParam);
|
|
156
156
|
applyThemeToDocument(themeParam);
|
|
157
157
|
} else {
|
|
158
158
|
try {
|
|
159
159
|
const stored = localStorage.getItem("design-theme");
|
|
160
|
-
if (stored
|
|
160
|
+
if (stored) {
|
|
161
161
|
setDesignThemeState(stored);
|
|
162
162
|
applyThemeToDocument(stored);
|
|
163
163
|
}
|
|
@@ -183,7 +183,9 @@ function DesignSystemProvider({ children, defaultTheme }) {
|
|
|
183
183
|
function applyThemeToDocument(theme) {
|
|
184
184
|
if (typeof document === "undefined") return;
|
|
185
185
|
const root = document.documentElement;
|
|
186
|
-
root.classList.
|
|
186
|
+
root.classList.forEach((cls) => {
|
|
187
|
+
if (cls.startsWith("theme-")) root.classList.remove(cls);
|
|
188
|
+
});
|
|
187
189
|
root.classList.add(`theme-${theme}`);
|
|
188
190
|
try {
|
|
189
191
|
localStorage.setItem("design-theme", theme);
|
|
@@ -3841,6 +3843,19 @@ var themes = {
|
|
|
3841
3843
|
viaSwitcher: "Via Theme Switcher",
|
|
3842
3844
|
switcherText: "Use the floating button in the bottom-right corner (palette icon) to switch themes. The URL will update automatically and the theme persists across pages.",
|
|
3843
3845
|
programmatically: "Programmatically"
|
|
3846
|
+
},
|
|
3847
|
+
customThemes: {
|
|
3848
|
+
title: "Creating Custom Themes",
|
|
3849
|
+
description: "Create your own theme by defining a CSS class that overrides the design token variables.",
|
|
3850
|
+
step1Title: "Step 1: Define Your Theme CSS",
|
|
3851
|
+
step1Description: "Add a new theme class to your globals.css. Override the color variables for both light and dark modes.",
|
|
3852
|
+
step2Title: "Step 2: Use Your Theme",
|
|
3853
|
+
step2Description: "Pass your custom theme name to the DesignSystemProvider.",
|
|
3854
|
+
variablesTitle: "CSS Variables Reference",
|
|
3855
|
+
variablesDescription: "These are the variables you can override in your custom theme.",
|
|
3856
|
+
required: "Required",
|
|
3857
|
+
optional: "Optional",
|
|
3858
|
+
tip: "Tip: Visit the Design Tokens page to see the live values of all variables for the current theme \u2014 great for using as a starting point."
|
|
3844
3859
|
}
|
|
3845
3860
|
},
|
|
3846
3861
|
tokens: {
|
|
@@ -12301,6 +12316,19 @@ var themes2 = {
|
|
|
12301
12316
|
viaSwitcher: "\u0639\u0628\u0631 \u0645\u0628\u062F\u0644 \u0627\u0644\u0633\u0645\u0627\u062A",
|
|
12302
12317
|
switcherText: "\u0627\u0633\u062A\u062E\u062F\u0645 \u0627\u0644\u0632\u0631 \u0627\u0644\u0639\u0627\u0626\u0645 \u0641\u064A \u0627\u0644\u0632\u0627\u0648\u064A\u0629 \u0627\u0644\u0633\u0641\u0644\u064A\u0629 \u0627\u0644\u064A\u0645\u0646\u0649 (\u0623\u064A\u0642\u0648\u0646\u0629 \u0627\u0644\u0644\u0648\u062D\u0629) \u0644\u062A\u0628\u062F\u064A\u0644 \u0627\u0644\u0633\u0645\u0627\u062A. \u0633\u064A\u062A\u0645 \u062A\u062D\u062F\u064A\u062B \u0639\u0646\u0648\u0627\u0646 URL \u062A\u0644\u0642\u0627\u0626\u064A\u0627\u064B \u0648\u0633\u062A\u0633\u062A\u0645\u0631 \u0627\u0644\u0633\u0645\u0629 \u0639\u0628\u0631 \u0627\u0644\u0635\u0641\u062D\u0627\u062A.",
|
|
12303
12318
|
programmatically: "\u0628\u0631\u0645\u062C\u064A\u0627\u064B"
|
|
12319
|
+
},
|
|
12320
|
+
customThemes: {
|
|
12321
|
+
title: "\u0625\u0646\u0634\u0627\u0621 \u0633\u0645\u0627\u062A \u0645\u062E\u0635\u0635\u0629",
|
|
12322
|
+
description: "\u0623\u0646\u0634\u0626 \u0633\u0645\u062A\u0643 \u0627\u0644\u062E\u0627\u0635\u0629 \u0645\u0646 \u062E\u0644\u0627\u0644 \u062A\u0639\u0631\u064A\u0641 \u0641\u0626\u0629 CSS \u062A\u062A\u062C\u0627\u0648\u0632 \u0645\u062A\u063A\u064A\u0631\u0627\u062A \u0631\u0645\u0648\u0632 \u0627\u0644\u062A\u0635\u0645\u064A\u0645.",
|
|
12323
|
+
step1Title: "\u0627\u0644\u062E\u0637\u0648\u0629 1: \u062A\u0639\u0631\u064A\u0641 CSS \u0644\u0644\u0633\u0645\u0629",
|
|
12324
|
+
step1Description: "\u0623\u0636\u0641 \u0641\u0626\u0629 \u0633\u0645\u0629 \u062C\u062F\u064A\u062F\u0629 \u0625\u0644\u0649 \u0645\u0644\u0641 globals.css. \u062A\u062C\u0627\u0648\u0632 \u0645\u062A\u063A\u064A\u0631\u0627\u062A \u0627\u0644\u0623\u0644\u0648\u0627\u0646 \u0644\u0643\u0644 \u0645\u0646 \u0627\u0644\u0648\u0636\u0639 \u0627\u0644\u0641\u0627\u062A\u062D \u0648\u0627\u0644\u062F\u0627\u0643\u0646.",
|
|
12325
|
+
step2Title: "\u0627\u0644\u062E\u0637\u0648\u0629 2: \u0627\u0633\u062A\u062E\u062F\u0627\u0645 \u0627\u0644\u0633\u0645\u0629",
|
|
12326
|
+
step2Description: "\u0645\u0631\u0631 \u0627\u0633\u0645 \u0633\u0645\u062A\u0643 \u0627\u0644\u0645\u062E\u0635\u0635\u0629 \u0625\u0644\u0649 DesignSystemProvider.",
|
|
12327
|
+
variablesTitle: "\u0645\u0631\u062C\u0639 \u0645\u062A\u063A\u064A\u0631\u0627\u062A CSS",
|
|
12328
|
+
variablesDescription: "\u0647\u0630\u0647 \u0647\u064A \u0627\u0644\u0645\u062A\u063A\u064A\u0631\u0627\u062A \u0627\u0644\u062A\u064A \u064A\u0645\u0643\u0646\u0643 \u062A\u062C\u0627\u0648\u0632\u0647\u0627 \u0641\u064A \u0633\u0645\u062A\u0643 \u0627\u0644\u0645\u062E\u0635\u0635\u0629.",
|
|
12329
|
+
required: "\u0645\u0637\u0644\u0648\u0628",
|
|
12330
|
+
optional: "\u0627\u062E\u062A\u064A\u0627\u0631\u064A",
|
|
12331
|
+
tip: "\u0646\u0635\u064A\u062D\u0629: \u0642\u0645 \u0628\u0632\u064A\u0627\u0631\u0629 \u0635\u0641\u062D\u0629 \u0631\u0645\u0648\u0632 \u0627\u0644\u062A\u0635\u0645\u064A\u0645 \u0644\u0631\u0624\u064A\u0629 \u0627\u0644\u0642\u064A\u0645 \u0627\u0644\u062D\u064A\u0629 \u0644\u062C\u0645\u064A\u0639 \u0627\u0644\u0645\u062A\u063A\u064A\u0631\u0627\u062A \u0644\u0644\u0633\u0645\u0629 \u0627\u0644\u062D\u0627\u0644\u064A\u0629 \u2014 \u0631\u0627\u0626\u0639\u0629 \u0643\u0646\u0642\u0637\u0629 \u0628\u062F\u0627\u064A\u0629."
|
|
12304
12332
|
}
|
|
12305
12333
|
},
|
|
12306
12334
|
tokens: {
|