fina-react-ds 1.0.5 → 1.0.6

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.
@@ -0,0 +1 @@
1
+ export declare function ModeToggle(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,26 @@
1
+ var a = Object.defineProperty;
2
+ var o = (r, t) => a(r, "name", { value: t, configurable: !0 });
3
+ import { jsxs as n, jsx as e } from "react/jsx-runtime";
4
+ import { Sun as i, Moon as l } from "lucide-react";
5
+ import { Button as s } from "./button.js";
6
+ import { DropdownMenu as m, DropdownMenuTrigger as f, DropdownMenuContent as d, DropdownMenuItem as c } from "./dropdown-menu.js";
7
+ import { useTheme as h } from "../providers/theme-provider.js";
8
+ function C() {
9
+ const { setTheme: r } = h();
10
+ return /* @__PURE__ */ n(m, { children: [
11
+ /* @__PURE__ */ e(f, { asChild: !0, children: /* @__PURE__ */ n(s, { variant: "outline", size: "icon", children: [
12
+ /* @__PURE__ */ e(i, { className: "fc:h-[1.2rem] fc:w-[1.2rem] fc:scale-100 fc:rotate-0 fc:transition-all fc:dark:scale-0 fc:dark:-rotate-90" }),
13
+ /* @__PURE__ */ e(l, { className: "fc:absolute fc:h-[1.2rem] fc:w-[1.2rem] fc:scale-0 fc:rotate-90 fc:transition-all fc:dark:scale-100 fc:dark:rotate-0" }),
14
+ /* @__PURE__ */ e("span", { className: "fc:sr-only", children: "Toggle theme" })
15
+ ] }) }),
16
+ /* @__PURE__ */ n(d, { align: "end", children: [
17
+ /* @__PURE__ */ e(c, { onClick: /* @__PURE__ */ o(() => r("light"), "onClick"), children: "Light" }),
18
+ /* @__PURE__ */ e(c, { onClick: /* @__PURE__ */ o(() => r("dark"), "onClick"), children: "Dark" }),
19
+ /* @__PURE__ */ e(c, { onClick: /* @__PURE__ */ o(() => r("system"), "onClick"), children: "System" })
20
+ ] })
21
+ ] });
22
+ }
23
+ o(C, "ModeToggle");
24
+ export {
25
+ C as ModeToggle
26
+ };
package/dist/index.d.ts CHANGED
@@ -12,6 +12,7 @@ export { DataLoader } from "./components/data-loader";
12
12
  export { DropdownMenu, DropdownMenuPortal, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, } from "./components/dropdown-menu";
13
13
  export { Input } from "./components/input";
14
14
  export { Label } from "./components/label";
15
+ export { ModeToggle } from "./components/mode-toggle";
15
16
  export { Pagination, PaginationContent, PaginationLink, PaginationItem, PaginationPrevious, PaginationNext, PaginationEllipsis, } from "./components/pagination";
16
17
  export { PasswordRulesChecker } from "./components/password-rules-checker";
17
18
  export { Popover, PopoverTrigger, PopoverContent, PopoverAnchor, } from "./components/popover";
@@ -28,3 +29,4 @@ export { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableC
28
29
  export { Tabs, TabsList, TabsTrigger, TabsContent } from "./components/tabs";
29
30
  export { Textarea } from "./components/textarea";
30
31
  export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider, } from "./components/tooltip";
32
+ export { ThemeProvider, useTheme } from "./providers/theme-provider";
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { AlertDialog as r, AlertDialogAction as t, AlertDialogCancel as a, AlertDialogContent as i, AlertDialogDescription as n, AlertDialogFooter as l, AlertDialogHeader as p, AlertDialogOverlay as d, AlertDialogPortal as g, AlertDialogTitle as b, AlertDialogTrigger as S } from "./components/alert-dialog.js";
2
- import { Alert as D, AlertDescription as m, AlertTitle as x } from "./components/alert.js";
2
+ import { Alert as m, AlertDescription as D, AlertTitle as x } from "./components/alert.js";
3
3
  import { Badge as f } from "./components/badge.js";
4
4
  import { Button as M, buttonVariants as s } from "./components/button.js";
5
5
  import { Avatar as P, AvatarFallback as c, AvatarImage as w } from "./components/avatar.js";
@@ -9,28 +9,30 @@ import { Checkbox as O } from "./components/checkbox.js";
9
9
  import { DatePicker as N } from "./components/date-picker.js";
10
10
  import { Dialog as j, DialogClose as q, DialogContent as z, DialogDescription as J, DialogFooter as K, DialogHeader as Q, DialogOverlay as U, DialogPortal as W, DialogTitle as X, DialogTrigger as Y } from "./components/dialog.js";
11
11
  import { DataLoader as _ } from "./components/data-loader.js";
12
- import { DropdownMenu as ee, DropdownMenuCheckboxItem as oe, DropdownMenuContent as re, DropdownMenuGroup as te, DropdownMenuItem as ae, DropdownMenuLabel as ie, DropdownMenuPortal as ne, DropdownMenuRadioGroup as le, DropdownMenuRadioItem as pe, DropdownMenuSeparator as de, DropdownMenuShortcut as ge, DropdownMenuSub as be, DropdownMenuSubContent as Se, DropdownMenuSubTrigger as ue, DropdownMenuTrigger as De } from "./components/dropdown-menu.js";
12
+ import { DropdownMenu as ee, DropdownMenuCheckboxItem as oe, DropdownMenuContent as re, DropdownMenuGroup as te, DropdownMenuItem as ae, DropdownMenuLabel as ie, DropdownMenuPortal as ne, DropdownMenuRadioGroup as le, DropdownMenuRadioItem as pe, DropdownMenuSeparator as de, DropdownMenuShortcut as ge, DropdownMenuSub as be, DropdownMenuSubContent as Se, DropdownMenuSubTrigger as ue, DropdownMenuTrigger as me } from "./components/dropdown-menu.js";
13
13
  import { Input as xe } from "./components/input.js";
14
14
  import { Label as fe } from "./components/label.js";
15
- import { Pagination as Me, PaginationContent as se, PaginationEllipsis as Ae, PaginationItem as Pe, PaginationLink as ce, PaginationNext as we, PaginationPrevious as he } from "./components/pagination.js";
16
- import { PasswordRulesChecker as Ie } from "./components/password-rules-checker.js";
17
- import { Popover as Be, PopoverAnchor as Fe, PopoverContent as He, PopoverTrigger as Ge } from "./components/popover.js";
18
- import { Select as Re } from "./components/select.js";
19
- import { Separator as Oe } from "./components/separator.js";
20
- import { Sheet as Ne, SheetBody as Ve, SheetClose as je, SheetContent as qe, SheetDescription as ze, SheetFooter as Je, SheetHeader as Ke, SheetTitle as Qe, SheetTrigger as Ue } from "./components/sheet.js";
21
- import { Sidebar as Xe, SidebarContent as Ye, SidebarFooter as Ze, SidebarGroup as _e, SidebarGroupAction as $e, SidebarGroupContent as eo, SidebarGroupLabel as oo, SidebarHeader as ro, SidebarInput as to, SidebarInset as ao, SidebarMenu as io, SidebarMenuAction as no, SidebarMenuBadge as lo, SidebarMenuButton as po, SidebarMenuItem as go, SidebarMenuSkeleton as bo, SidebarMenuSub as So, SidebarMenuSubButton as uo, SidebarMenuSubItem as Do, SidebarProvider as mo, SidebarRail as xo, SidebarSeparator as To, SidebarTrigger as fo, useSidebar as Co } from "./components/sidebar.js";
22
- import { SimplePagination as so } from "./components/simple-pagination.js";
23
- import { SimpleTooltip as Po } from "./components/simple-tooltip.js";
24
- import { Skeleton as wo } from "./components/skeleton.js";
25
- import { Switch as vo } from "./components/switch.js";
26
- import { Toaster as ko } from "./components/sonner.js";
27
- import { Table as Fo, TableBody as Ho, TableCaption as Go, TableCell as Lo, TableFooter as Ro, TableHead as yo, TableHeader as Oo, TableRow as Eo } from "./components/table.js";
28
- import { Tabs as Vo, TabsContent as jo, TabsList as qo, TabsTrigger as zo } from "./components/tabs.js";
29
- import { Textarea as Ko } from "./components/textarea.js";
30
- import { Tooltip as Uo, TooltipContent as Wo, TooltipProvider as Xo, TooltipTrigger as Yo } from "./components/tooltip.js";
15
+ import { ModeToggle as Me } from "./components/mode-toggle.js";
16
+ import { Pagination as Ae, PaginationContent as Pe, PaginationEllipsis as ce, PaginationItem as we, PaginationLink as he, PaginationNext as ve, PaginationPrevious as Ie } from "./components/pagination.js";
17
+ import { PasswordRulesChecker as Be } from "./components/password-rules-checker.js";
18
+ import { Popover as He, PopoverAnchor as Ge, PopoverContent as Le, PopoverTrigger as Re } from "./components/popover.js";
19
+ import { Select as Oe } from "./components/select.js";
20
+ import { Separator as Ne } from "./components/separator.js";
21
+ import { Sheet as je, SheetBody as qe, SheetClose as ze, SheetContent as Je, SheetDescription as Ke, SheetFooter as Qe, SheetHeader as Ue, SheetTitle as We, SheetTrigger as Xe } from "./components/sheet.js";
22
+ import { Sidebar as Ze, SidebarContent as _e, SidebarFooter as $e, SidebarGroup as eo, SidebarGroupAction as oo, SidebarGroupContent as ro, SidebarGroupLabel as to, SidebarHeader as ao, SidebarInput as io, SidebarInset as no, SidebarMenu as lo, SidebarMenuAction as po, SidebarMenuBadge as go, SidebarMenuButton as bo, SidebarMenuItem as So, SidebarMenuSkeleton as uo, SidebarMenuSub as mo, SidebarMenuSubButton as Do, SidebarMenuSubItem as xo, SidebarProvider as To, SidebarRail as fo, SidebarSeparator as Co, SidebarTrigger as Mo, useSidebar as so } from "./components/sidebar.js";
23
+ import { SimplePagination as Po } from "./components/simple-pagination.js";
24
+ import { SimpleTooltip as wo } from "./components/simple-tooltip.js";
25
+ import { Skeleton as vo } from "./components/skeleton.js";
26
+ import { Switch as ko } from "./components/switch.js";
27
+ import { Toaster as Fo } from "./components/sonner.js";
28
+ import { Table as Go, TableBody as Lo, TableCaption as Ro, TableCell as yo, TableFooter as Oo, TableHead as Eo, TableHeader as No, TableRow as Vo } from "./components/table.js";
29
+ import { Tabs as qo, TabsContent as zo, TabsList as Jo, TabsTrigger as Ko } from "./components/tabs.js";
30
+ import { Textarea as Uo } from "./components/textarea.js";
31
+ import { Tooltip as Xo, TooltipContent as Yo, TooltipProvider as Zo, TooltipTrigger as _o } from "./components/tooltip.js";
32
+ import { ThemeProvider as er, useTheme as or } from "./providers/theme-provider.js";
31
33
  export {
32
- D as Alert,
33
- m as AlertDescription,
34
+ m as Alert,
35
+ D as AlertDescription,
34
36
  r as AlertDialog,
35
37
  t as AlertDialogAction,
36
38
  a as AlertDialogCancel,
@@ -83,77 +85,80 @@ export {
83
85
  be as DropdownMenuSub,
84
86
  Se as DropdownMenuSubContent,
85
87
  ue as DropdownMenuSubTrigger,
86
- De as DropdownMenuTrigger,
88
+ me as DropdownMenuTrigger,
87
89
  xe as Input,
88
90
  fe as Label,
89
- Me as Pagination,
90
- se as PaginationContent,
91
- Ae as PaginationEllipsis,
92
- Pe as PaginationItem,
93
- ce as PaginationLink,
94
- we as PaginationNext,
95
- he as PaginationPrevious,
96
- Ie as PasswordRulesChecker,
97
- Be as Popover,
98
- Fe as PopoverAnchor,
99
- He as PopoverContent,
100
- Ge as PopoverTrigger,
101
- Re as Select,
102
- Oe as Separator,
103
- Ne as Sheet,
104
- Ve as SheetBody,
105
- je as SheetClose,
106
- qe as SheetContent,
107
- ze as SheetDescription,
108
- Je as SheetFooter,
109
- Ke as SheetHeader,
110
- Qe as SheetTitle,
111
- Ue as SheetTrigger,
112
- Xe as Sidebar,
113
- Ye as SidebarContent,
114
- Ze as SidebarFooter,
115
- _e as SidebarGroup,
116
- $e as SidebarGroupAction,
117
- eo as SidebarGroupContent,
118
- oo as SidebarGroupLabel,
119
- ro as SidebarHeader,
120
- to as SidebarInput,
121
- ao as SidebarInset,
122
- io as SidebarMenu,
123
- no as SidebarMenuAction,
124
- lo as SidebarMenuBadge,
125
- po as SidebarMenuButton,
126
- go as SidebarMenuItem,
127
- bo as SidebarMenuSkeleton,
128
- So as SidebarMenuSub,
129
- uo as SidebarMenuSubButton,
130
- Do as SidebarMenuSubItem,
131
- mo as SidebarProvider,
132
- xo as SidebarRail,
133
- To as SidebarSeparator,
134
- fo as SidebarTrigger,
135
- so as SimplePagination,
136
- Po as SimpleTooltip,
137
- wo as Skeleton,
138
- vo as Switch,
139
- Fo as Table,
140
- Ho as TableBody,
141
- Go as TableCaption,
142
- Lo as TableCell,
143
- Ro as TableFooter,
144
- yo as TableHead,
145
- Oo as TableHeader,
146
- Eo as TableRow,
147
- Vo as Tabs,
148
- jo as TabsContent,
149
- qo as TabsList,
150
- zo as TabsTrigger,
151
- Ko as Textarea,
152
- ko as Toaster,
153
- Uo as Tooltip,
154
- Wo as TooltipContent,
155
- Xo as TooltipProvider,
156
- Yo as TooltipTrigger,
91
+ Me as ModeToggle,
92
+ Ae as Pagination,
93
+ Pe as PaginationContent,
94
+ ce as PaginationEllipsis,
95
+ we as PaginationItem,
96
+ he as PaginationLink,
97
+ ve as PaginationNext,
98
+ Ie as PaginationPrevious,
99
+ Be as PasswordRulesChecker,
100
+ He as Popover,
101
+ Ge as PopoverAnchor,
102
+ Le as PopoverContent,
103
+ Re as PopoverTrigger,
104
+ Oe as Select,
105
+ Ne as Separator,
106
+ je as Sheet,
107
+ qe as SheetBody,
108
+ ze as SheetClose,
109
+ Je as SheetContent,
110
+ Ke as SheetDescription,
111
+ Qe as SheetFooter,
112
+ Ue as SheetHeader,
113
+ We as SheetTitle,
114
+ Xe as SheetTrigger,
115
+ Ze as Sidebar,
116
+ _e as SidebarContent,
117
+ $e as SidebarFooter,
118
+ eo as SidebarGroup,
119
+ oo as SidebarGroupAction,
120
+ ro as SidebarGroupContent,
121
+ to as SidebarGroupLabel,
122
+ ao as SidebarHeader,
123
+ io as SidebarInput,
124
+ no as SidebarInset,
125
+ lo as SidebarMenu,
126
+ po as SidebarMenuAction,
127
+ go as SidebarMenuBadge,
128
+ bo as SidebarMenuButton,
129
+ So as SidebarMenuItem,
130
+ uo as SidebarMenuSkeleton,
131
+ mo as SidebarMenuSub,
132
+ Do as SidebarMenuSubButton,
133
+ xo as SidebarMenuSubItem,
134
+ To as SidebarProvider,
135
+ fo as SidebarRail,
136
+ Co as SidebarSeparator,
137
+ Mo as SidebarTrigger,
138
+ Po as SimplePagination,
139
+ wo as SimpleTooltip,
140
+ vo as Skeleton,
141
+ ko as Switch,
142
+ Go as Table,
143
+ Lo as TableBody,
144
+ Ro as TableCaption,
145
+ yo as TableCell,
146
+ Oo as TableFooter,
147
+ Eo as TableHead,
148
+ No as TableHeader,
149
+ Vo as TableRow,
150
+ qo as Tabs,
151
+ zo as TabsContent,
152
+ Jo as TabsList,
153
+ Ko as TabsTrigger,
154
+ Uo as Textarea,
155
+ er as ThemeProvider,
156
+ Fo as Toaster,
157
+ Xo as Tooltip,
158
+ Yo as TooltipContent,
159
+ Zo as TooltipProvider,
160
+ _o as TooltipTrigger,
157
161
  s as buttonVariants,
158
- Co as useSidebar
162
+ so as useSidebar,
163
+ or as useTheme
159
164
  };
@@ -0,0 +1,13 @@
1
+ type Theme = "dark" | "light" | "system";
2
+ type ThemeProviderProps = {
3
+ children: React.ReactNode;
4
+ defaultTheme?: Theme;
5
+ storageKey?: string;
6
+ };
7
+ type ThemeProviderState = {
8
+ theme: Theme;
9
+ setTheme: (theme: Theme) => void;
10
+ };
11
+ export declare function ThemeProvider({ children, defaultTheme, storageKey, ...props }: ThemeProviderProps): import("react/jsx-runtime").JSX.Element;
12
+ export declare const useTheme: () => ThemeProviderState;
13
+ export {};
@@ -0,0 +1,45 @@
1
+ var h = Object.defineProperty;
2
+ var s = (e, r) => h(e, "name", { value: r, configurable: !0 });
3
+ import { jsx as u } from "react/jsx-runtime";
4
+ import { useState as l, useEffect as T, createContext as f, useContext as v } from "react";
5
+ const w = {
6
+ theme: "system",
7
+ setTheme: /* @__PURE__ */ s(() => null, "setTheme")
8
+ }, n = f(w);
9
+ function P({
10
+ children: e,
11
+ defaultTheme: r = "system",
12
+ storageKey: m = "vite-ui-theme",
13
+ ...i
14
+ }) {
15
+ const [o, c] = l(
16
+ () => localStorage.getItem(m) || r
17
+ );
18
+ T(() => {
19
+ const t = window.document.documentElement;
20
+ if (t.classList.remove("light", "dark"), o === "system") {
21
+ const d = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
22
+ t.classList.add(d);
23
+ return;
24
+ }
25
+ t.classList.add(o);
26
+ }, [o]);
27
+ const a = {
28
+ theme: o,
29
+ setTheme: /* @__PURE__ */ s((t) => {
30
+ localStorage.setItem(m, t), c(t);
31
+ }, "setTheme")
32
+ };
33
+ return /* @__PURE__ */ u(n.Provider, { ...i, value: a, children: e });
34
+ }
35
+ s(P, "ThemeProvider");
36
+ const S = /* @__PURE__ */ s(() => {
37
+ const e = v(n);
38
+ if (e === void 0)
39
+ throw new Error("useTheme must be used within a ThemeProvider");
40
+ return e;
41
+ }, "useTheme");
42
+ export {
43
+ P as ThemeProvider,
44
+ S as useTheme
45
+ };
@@ -392,6 +392,9 @@
392
392
  .fc\:h-12 {
393
393
  height: calc(var(--fc-spacing) * 12);
394
394
  }
395
+ .fc\:h-\[1\.2rem\] {
396
+ height: 1.2rem;
397
+ }
395
398
  .fc\:h-\[1\.15rem\] {
396
399
  height: 1.15rem;
397
400
  }
@@ -440,6 +443,9 @@
440
443
  .fc\:w-72 {
441
444
  width: calc(var(--fc-spacing) * 72);
442
445
  }
446
+ .fc\:w-\[1\.2rem\] {
447
+ width: 1.2rem;
448
+ }
443
449
  .fc\:w-\[90\%\] {
444
450
  width: 90%;
445
451
  }
@@ -512,9 +518,27 @@
512
518
  --tw-translate-y: calc(-50% - 2px);
513
519
  translate: var(--tw-translate-x) var(--tw-translate-y);
514
520
  }
521
+ .fc\:scale-0 {
522
+ --tw-scale-x: 0%;
523
+ --tw-scale-y: 0%;
524
+ --tw-scale-z: 0%;
525
+ scale: var(--tw-scale-x) var(--tw-scale-y);
526
+ }
527
+ .fc\:scale-100 {
528
+ --tw-scale-x: 100%;
529
+ --tw-scale-y: 100%;
530
+ --tw-scale-z: 100%;
531
+ scale: var(--tw-scale-x) var(--tw-scale-y);
532
+ }
533
+ .fc\:rotate-0 {
534
+ rotate: 0deg;
535
+ }
515
536
  .fc\:rotate-45 {
516
537
  rotate: 45deg;
517
538
  }
539
+ .fc\:rotate-90 {
540
+ rotate: 90deg;
541
+ }
518
542
  .fc\:animate-in {
519
543
  animation: enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);
520
544
  }
@@ -2397,6 +2421,32 @@
2397
2421
  }
2398
2422
  }
2399
2423
  }
2424
+ .fc\:dark\:scale-0 {
2425
+ &:is(.dark *) {
2426
+ --tw-scale-x: 0%;
2427
+ --tw-scale-y: 0%;
2428
+ --tw-scale-z: 0%;
2429
+ scale: var(--tw-scale-x) var(--tw-scale-y);
2430
+ }
2431
+ }
2432
+ .fc\:dark\:scale-100 {
2433
+ &:is(.dark *) {
2434
+ --tw-scale-x: 100%;
2435
+ --tw-scale-y: 100%;
2436
+ --tw-scale-z: 100%;
2437
+ scale: var(--tw-scale-x) var(--tw-scale-y);
2438
+ }
2439
+ }
2440
+ .fc\:dark\:-rotate-90 {
2441
+ &:is(.dark *) {
2442
+ rotate: calc(90deg * -1);
2443
+ }
2444
+ }
2445
+ .fc\:dark\:rotate-0 {
2446
+ &:is(.dark *) {
2447
+ rotate: 0deg;
2448
+ }
2449
+ }
2400
2450
  .fc\:dark\:bg-foreground {
2401
2451
  &:is(.dark *) {
2402
2452
  background-color: var(--foreground);
@@ -2874,6 +2924,21 @@
2874
2924
  inherits: false;
2875
2925
  initial-value: 0;
2876
2926
  }
2927
+ @property --tw-scale-x {
2928
+ syntax: "*";
2929
+ inherits: false;
2930
+ initial-value: 1;
2931
+ }
2932
+ @property --tw-scale-y {
2933
+ syntax: "*";
2934
+ inherits: false;
2935
+ initial-value: 1;
2936
+ }
2937
+ @property --tw-scale-z {
2938
+ syntax: "*";
2939
+ inherits: false;
2940
+ initial-value: 1;
2941
+ }
2877
2942
  @property --tw-space-y-reverse {
2878
2943
  syntax: "*";
2879
2944
  inherits: false;
@@ -3027,6 +3092,9 @@
3027
3092
  --tw-translate-x: 0;
3028
3093
  --tw-translate-y: 0;
3029
3094
  --tw-translate-z: 0;
3095
+ --tw-scale-x: 1;
3096
+ --tw-scale-y: 1;
3097
+ --tw-scale-z: 1;
3030
3098
  --tw-space-y-reverse: 0;
3031
3099
  --tw-space-x-reverse: 0;
3032
3100
  --tw-border-style: solid;
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "url": "https://github.com/F1na/fina-react-ds"
6
6
  },
7
7
  "private": false,
8
- "version": "1.0.5",
8
+ "version": "1.0.6",
9
9
  "type": "module",
10
10
  "files": [
11
11
  "dist"