@appcorp/shadcn 1.0.10

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.
Files changed (78) hide show
  1. package/README.md +138 -0
  2. package/app/layout.d.ts +7 -0
  3. package/app/layout.js +18 -0
  4. package/app/page.d.ts +2 -0
  5. package/app/page.js +16 -0
  6. package/components/badge.d.ts +9 -0
  7. package/components/badge.js +82 -0
  8. package/components/button.d.ts +10 -0
  9. package/components/button.js +91 -0
  10. package/components/card.d.ts +9 -0
  11. package/components/card.js +94 -0
  12. package/components/carousel.d.ts +19 -0
  13. package/components/carousel.js +168 -0
  14. package/components/checkbox.d.ts +9 -0
  15. package/components/checkbox.js +87 -0
  16. package/components/combobox.d.ts +70 -0
  17. package/components/combobox.js +315 -0
  18. package/components/command.d.ts +18 -0
  19. package/components/command.js +115 -0
  20. package/components/context-menu.d.ts +25 -0
  21. package/components/context-menu.js +148 -0
  22. package/components/dialog.d.ts +15 -0
  23. package/components/dialog.js +118 -0
  24. package/components/drawer.d.ts +13 -0
  25. package/components/drawer.js +115 -0
  26. package/components/dropdown-menu.d.ts +25 -0
  27. package/components/dropdown-menu.js +148 -0
  28. package/components/enhanced-dropzone.d.ts +21 -0
  29. package/components/enhanced-dropzone.js +187 -0
  30. package/components/enhanced-table-footer-action.d.ts +35 -0
  31. package/components/enhanced-table-footer-action.js +110 -0
  32. package/components/enhanced-table-footer-page.d.ts +34 -0
  33. package/components/enhanced-table-footer-page.js +132 -0
  34. package/components/enhanced-table-footer-pagination.d.ts +38 -0
  35. package/components/enhanced-table-footer-pagination.js +116 -0
  36. package/components/enhanced-table-header-action.d.ts +7 -0
  37. package/components/enhanced-table-header-action.js +21 -0
  38. package/components/enhanced-table-header-search.d.ts +12 -0
  39. package/components/enhanced-table-header-search.js +17 -0
  40. package/components/enhanced-table.d.ts +87 -0
  41. package/components/enhanced-table.js +221 -0
  42. package/components/form.d.ts +24 -0
  43. package/components/form.js +125 -0
  44. package/components/input.d.ts +8 -0
  45. package/components/input.js +86 -0
  46. package/components/label.d.ts +7 -0
  47. package/components/label.js +68 -0
  48. package/components/popover.d.ts +7 -0
  49. package/components/popover.js +82 -0
  50. package/components/select.d.ts +15 -0
  51. package/components/select.js +127 -0
  52. package/components/separator.d.ts +4 -0
  53. package/components/separator.js +66 -0
  54. package/components/shadcn-io/color-picker/index.d.ts +43 -0
  55. package/components/shadcn-io/color-picker/index.js +304 -0
  56. package/components/shadcn-io/copy-button/index.d.ts +16 -0
  57. package/components/shadcn-io/copy-button/index.js +121 -0
  58. package/components/shadcn-io/dropzone/index.d.ts +19 -0
  59. package/components/shadcn-io/dropzone/index.js +131 -0
  60. package/components/shadcn-io/gantt/index.d.ts +145 -0
  61. package/components/shadcn-io/gantt/index.js +767 -0
  62. package/components/shadcn-io/table/index.d.ts +60 -0
  63. package/components/shadcn-io/table/index.js +138 -0
  64. package/components/sonner.d.ts +4 -0
  65. package/components/sonner.js +54 -0
  66. package/components/switch.d.ts +9 -0
  67. package/components/switch.js +89 -0
  68. package/components/table.d.ts +10 -0
  69. package/components/table.js +101 -0
  70. package/components/textarea.d.ts +8 -0
  71. package/components/textarea.js +86 -0
  72. package/lib/themes.d.ts +147 -0
  73. package/lib/themes.js +150 -0
  74. package/lib/toast-utils.d.ts +44 -0
  75. package/lib/toast-utils.js +212 -0
  76. package/lib/utils.d.ts +2 -0
  77. package/lib/utils.js +12 -0
  78. package/package.json +101 -0
@@ -0,0 +1,147 @@
1
+ export declare const themes: {
2
+ readonly light: {
3
+ readonly name: "light";
4
+ readonly displayName: "Light";
5
+ readonly colors: {
6
+ readonly background: "oklch(1 0 0)";
7
+ readonly foreground: "oklch(0.145 0 0)";
8
+ readonly card: "oklch(1 0 0)";
9
+ readonly "card-foreground": "oklch(0.145 0 0)";
10
+ readonly popover: "oklch(1 0 0)";
11
+ readonly "popover-foreground": "oklch(0.145 0 0)";
12
+ readonly primary: "oklch(0.205 0 0)";
13
+ readonly "primary-foreground": "oklch(0.985 0 0)";
14
+ readonly secondary: "oklch(0.97 0 0)";
15
+ readonly "secondary-foreground": "oklch(0.205 0 0)";
16
+ readonly muted: "oklch(0.97 0 0)";
17
+ readonly "muted-foreground": "oklch(0.556 0 0)";
18
+ readonly accent: "oklch(0.97 0 0)";
19
+ readonly "accent-foreground": "oklch(0.205 0 0)";
20
+ readonly destructive: "oklch(0.577 0.245 27.325)";
21
+ readonly border: "oklch(0.922 0 0)";
22
+ readonly input: "oklch(0.922 0 0)";
23
+ readonly ring: "oklch(0.708 0 0)";
24
+ };
25
+ };
26
+ readonly dark: {
27
+ readonly name: "dark";
28
+ readonly displayName: "Dark";
29
+ readonly colors: {
30
+ readonly background: "oklch(0.145 0 0)";
31
+ readonly foreground: "oklch(0.985 0 0)";
32
+ readonly card: "oklch(0.205 0 0)";
33
+ readonly "card-foreground": "oklch(0.985 0 0)";
34
+ readonly popover: "oklch(0.205 0 0)";
35
+ readonly "popover-foreground": "oklch(0.985 0 0)";
36
+ readonly primary: "oklch(0.922 0 0)";
37
+ readonly "primary-foreground": "oklch(0.205 0 0)";
38
+ readonly secondary: "oklch(0.269 0 0)";
39
+ readonly "secondary-foreground": "oklch(0.985 0 0)";
40
+ readonly muted: "oklch(0.269 0 0)";
41
+ readonly "muted-foreground": "oklch(0.708 0 0)";
42
+ readonly accent: "oklch(0.269 0 0)";
43
+ readonly "accent-foreground": "oklch(0.985 0 0)";
44
+ readonly destructive: "oklch(0.704 0.191 22.216)";
45
+ readonly border: "oklch(1 0 0 / 10%)";
46
+ readonly input: "oklch(1 0 0 / 15%)";
47
+ readonly ring: "oklch(0.556 0 0)";
48
+ };
49
+ };
50
+ readonly blue: {
51
+ readonly name: "blue";
52
+ readonly displayName: "Blue";
53
+ readonly colors: {
54
+ readonly background: "oklch(0.99 0.005 246.049)";
55
+ readonly foreground: "oklch(0.15 0.02 247.858)";
56
+ readonly card: "oklch(0.99 0.005 246.049)";
57
+ readonly "card-foreground": "oklch(0.15 0.02 247.858)";
58
+ readonly popover: "oklch(0.99 0.005 246.049)";
59
+ readonly "popover-foreground": "oklch(0.15 0.02 247.858)";
60
+ readonly primary: "oklch(0.492 0.215 265.75)";
61
+ readonly "primary-foreground": "oklch(0.985 0.003 106.423)";
62
+ readonly secondary: "oklch(0.956 0.013 253.559)";
63
+ readonly "secondary-foreground": "oklch(0.15 0.02 247.858)";
64
+ readonly muted: "oklch(0.956 0.013 253.559)";
65
+ readonly "muted-foreground": "oklch(0.533 0.015 252.096)";
66
+ readonly accent: "oklch(0.956 0.013 253.559)";
67
+ readonly "accent-foreground": "oklch(0.15 0.02 247.858)";
68
+ readonly destructive: "oklch(0.577 0.245 27.325)";
69
+ readonly border: "oklch(0.898 0.013 252.096)";
70
+ readonly input: "oklch(0.898 0.013 252.096)";
71
+ readonly ring: "oklch(0.492 0.215 265.75)";
72
+ };
73
+ };
74
+ readonly green: {
75
+ readonly name: "green";
76
+ readonly displayName: "Green";
77
+ readonly colors: {
78
+ readonly background: "oklch(0.99 0.01 142.425)";
79
+ readonly foreground: "oklch(0.15 0.025 142.425)";
80
+ readonly card: "oklch(0.99 0.01 142.425)";
81
+ readonly "card-foreground": "oklch(0.15 0.025 142.425)";
82
+ readonly popover: "oklch(0.99 0.01 142.425)";
83
+ readonly "popover-foreground": "oklch(0.15 0.025 142.425)";
84
+ readonly primary: "oklch(0.4 0.177 150.861)";
85
+ readonly "primary-foreground": "oklch(0.985 0.007 106.423)";
86
+ readonly secondary: "oklch(0.956 0.02 142.425)";
87
+ readonly "secondary-foreground": "oklch(0.15 0.025 142.425)";
88
+ readonly muted: "oklch(0.956 0.02 142.425)";
89
+ readonly "muted-foreground": "oklch(0.533 0.022 142.425)";
90
+ readonly accent: "oklch(0.956 0.02 142.425)";
91
+ readonly "accent-foreground": "oklch(0.15 0.025 142.425)";
92
+ readonly destructive: "oklch(0.577 0.245 27.325)";
93
+ readonly border: "oklch(0.898 0.02 142.425)";
94
+ readonly input: "oklch(0.898 0.02 142.425)";
95
+ readonly ring: "oklch(0.4 0.177 150.861)";
96
+ };
97
+ };
98
+ readonly purple: {
99
+ readonly name: "purple";
100
+ readonly displayName: "Purple";
101
+ readonly colors: {
102
+ readonly background: "oklch(0.99 0.008 285.257)";
103
+ readonly foreground: "oklch(0.15 0.025 285.257)";
104
+ readonly card: "oklch(0.99 0.008 285.257)";
105
+ readonly "card-foreground": "oklch(0.15 0.025 285.257)";
106
+ readonly popover: "oklch(0.99 0.008 285.257)";
107
+ readonly "popover-foreground": "oklch(0.15 0.025 285.257)";
108
+ readonly primary: "oklch(0.45 0.224 293.334)";
109
+ readonly "primary-foreground": "oklch(0.985 0.003 106.423)";
110
+ readonly secondary: "oklch(0.956 0.015 285.257)";
111
+ readonly "secondary-foreground": "oklch(0.15 0.025 285.257)";
112
+ readonly muted: "oklch(0.956 0.015 285.257)";
113
+ readonly "muted-foreground": "oklch(0.533 0.025 285.257)";
114
+ readonly accent: "oklch(0.956 0.015 285.257)";
115
+ readonly "accent-foreground": "oklch(0.15 0.025 285.257)";
116
+ readonly destructive: "oklch(0.577 0.245 27.325)";
117
+ readonly border: "oklch(0.898 0.015 285.257)";
118
+ readonly input: "oklch(0.898 0.015 285.257)";
119
+ readonly ring: "oklch(0.45 0.224 293.334)";
120
+ };
121
+ };
122
+ readonly orange: {
123
+ readonly name: "orange";
124
+ readonly displayName: "Orange";
125
+ readonly colors: {
126
+ readonly background: "oklch(0.99 0.01 70.67)";
127
+ readonly foreground: "oklch(0.15 0.025 70.67)";
128
+ readonly card: "oklch(0.99 0.01 70.67)";
129
+ readonly "card-foreground": "oklch(0.15 0.025 70.67)";
130
+ readonly popover: "oklch(0.99 0.01 70.67)";
131
+ readonly "popover-foreground": "oklch(0.15 0.025 70.67)";
132
+ readonly primary: "oklch(0.5 0.207 60.234)";
133
+ readonly "primary-foreground": "oklch(0.985 0.005 106.423)";
134
+ readonly secondary: "oklch(0.956 0.02 70.67)";
135
+ readonly "secondary-foreground": "oklch(0.15 0.025 70.67)";
136
+ readonly muted: "oklch(0.956 0.02 70.67)";
137
+ readonly "muted-foreground": "oklch(0.533 0.025 70.67)";
138
+ readonly accent: "oklch(0.956 0.02 70.67)";
139
+ readonly "accent-foreground": "oklch(0.15 0.025 70.67)";
140
+ readonly destructive: "oklch(0.577 0.245 27.325)";
141
+ readonly border: "oklch(0.898 0.02 70.67)";
142
+ readonly input: "oklch(0.898 0.02 70.67)";
143
+ readonly ring: "oklch(0.5 0.207 60.234)";
144
+ };
145
+ };
146
+ };
147
+ export type ThemeName = keyof typeof themes;
package/lib/themes.js ADDED
@@ -0,0 +1,150 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.themes = void 0;
4
+ // Theme configurations for multiple color schemes
5
+ exports.themes = {
6
+ light: {
7
+ name: "light",
8
+ displayName: "Light",
9
+ colors: {
10
+ background: "oklch(1 0 0)",
11
+ foreground: "oklch(0.145 0 0)",
12
+ card: "oklch(1 0 0)",
13
+ "card-foreground": "oklch(0.145 0 0)",
14
+ popover: "oklch(1 0 0)",
15
+ "popover-foreground": "oklch(0.145 0 0)",
16
+ primary: "oklch(0.205 0 0)",
17
+ "primary-foreground": "oklch(0.985 0 0)",
18
+ secondary: "oklch(0.97 0 0)",
19
+ "secondary-foreground": "oklch(0.205 0 0)",
20
+ muted: "oklch(0.97 0 0)",
21
+ "muted-foreground": "oklch(0.556 0 0)",
22
+ accent: "oklch(0.97 0 0)",
23
+ "accent-foreground": "oklch(0.205 0 0)",
24
+ destructive: "oklch(0.577 0.245 27.325)",
25
+ border: "oklch(0.922 0 0)",
26
+ input: "oklch(0.922 0 0)",
27
+ ring: "oklch(0.708 0 0)",
28
+ },
29
+ },
30
+ dark: {
31
+ name: "dark",
32
+ displayName: "Dark",
33
+ colors: {
34
+ background: "oklch(0.145 0 0)",
35
+ foreground: "oklch(0.985 0 0)",
36
+ card: "oklch(0.205 0 0)",
37
+ "card-foreground": "oklch(0.985 0 0)",
38
+ popover: "oklch(0.205 0 0)",
39
+ "popover-foreground": "oklch(0.985 0 0)",
40
+ primary: "oklch(0.922 0 0)",
41
+ "primary-foreground": "oklch(0.205 0 0)",
42
+ secondary: "oklch(0.269 0 0)",
43
+ "secondary-foreground": "oklch(0.985 0 0)",
44
+ muted: "oklch(0.269 0 0)",
45
+ "muted-foreground": "oklch(0.708 0 0)",
46
+ accent: "oklch(0.269 0 0)",
47
+ "accent-foreground": "oklch(0.985 0 0)",
48
+ destructive: "oklch(0.704 0.191 22.216)",
49
+ border: "oklch(1 0 0 / 10%)",
50
+ input: "oklch(1 0 0 / 15%)",
51
+ ring: "oklch(0.556 0 0)",
52
+ },
53
+ },
54
+ blue: {
55
+ name: "blue",
56
+ displayName: "Blue",
57
+ colors: {
58
+ background: "oklch(0.99 0.005 246.049)",
59
+ foreground: "oklch(0.15 0.02 247.858)",
60
+ card: "oklch(0.99 0.005 246.049)",
61
+ "card-foreground": "oklch(0.15 0.02 247.858)",
62
+ popover: "oklch(0.99 0.005 246.049)",
63
+ "popover-foreground": "oklch(0.15 0.02 247.858)",
64
+ primary: "oklch(0.492 0.215 265.75)",
65
+ "primary-foreground": "oklch(0.985 0.003 106.423)",
66
+ secondary: "oklch(0.956 0.013 253.559)",
67
+ "secondary-foreground": "oklch(0.15 0.02 247.858)",
68
+ muted: "oklch(0.956 0.013 253.559)",
69
+ "muted-foreground": "oklch(0.533 0.015 252.096)",
70
+ accent: "oklch(0.956 0.013 253.559)",
71
+ "accent-foreground": "oklch(0.15 0.02 247.858)",
72
+ destructive: "oklch(0.577 0.245 27.325)",
73
+ border: "oklch(0.898 0.013 252.096)",
74
+ input: "oklch(0.898 0.013 252.096)",
75
+ ring: "oklch(0.492 0.215 265.75)",
76
+ },
77
+ },
78
+ green: {
79
+ name: "green",
80
+ displayName: "Green",
81
+ colors: {
82
+ background: "oklch(0.99 0.01 142.425)",
83
+ foreground: "oklch(0.15 0.025 142.425)",
84
+ card: "oklch(0.99 0.01 142.425)",
85
+ "card-foreground": "oklch(0.15 0.025 142.425)",
86
+ popover: "oklch(0.99 0.01 142.425)",
87
+ "popover-foreground": "oklch(0.15 0.025 142.425)",
88
+ primary: "oklch(0.4 0.177 150.861)",
89
+ "primary-foreground": "oklch(0.985 0.007 106.423)",
90
+ secondary: "oklch(0.956 0.02 142.425)",
91
+ "secondary-foreground": "oklch(0.15 0.025 142.425)",
92
+ muted: "oklch(0.956 0.02 142.425)",
93
+ "muted-foreground": "oklch(0.533 0.022 142.425)",
94
+ accent: "oklch(0.956 0.02 142.425)",
95
+ "accent-foreground": "oklch(0.15 0.025 142.425)",
96
+ destructive: "oklch(0.577 0.245 27.325)",
97
+ border: "oklch(0.898 0.02 142.425)",
98
+ input: "oklch(0.898 0.02 142.425)",
99
+ ring: "oklch(0.4 0.177 150.861)",
100
+ },
101
+ },
102
+ purple: {
103
+ name: "purple",
104
+ displayName: "Purple",
105
+ colors: {
106
+ background: "oklch(0.99 0.008 285.257)",
107
+ foreground: "oklch(0.15 0.025 285.257)",
108
+ card: "oklch(0.99 0.008 285.257)",
109
+ "card-foreground": "oklch(0.15 0.025 285.257)",
110
+ popover: "oklch(0.99 0.008 285.257)",
111
+ "popover-foreground": "oklch(0.15 0.025 285.257)",
112
+ primary: "oklch(0.45 0.224 293.334)",
113
+ "primary-foreground": "oklch(0.985 0.003 106.423)",
114
+ secondary: "oklch(0.956 0.015 285.257)",
115
+ "secondary-foreground": "oklch(0.15 0.025 285.257)",
116
+ muted: "oklch(0.956 0.015 285.257)",
117
+ "muted-foreground": "oklch(0.533 0.025 285.257)",
118
+ accent: "oklch(0.956 0.015 285.257)",
119
+ "accent-foreground": "oklch(0.15 0.025 285.257)",
120
+ destructive: "oklch(0.577 0.245 27.325)",
121
+ border: "oklch(0.898 0.015 285.257)",
122
+ input: "oklch(0.898 0.015 285.257)",
123
+ ring: "oklch(0.45 0.224 293.334)",
124
+ },
125
+ },
126
+ orange: {
127
+ name: "orange",
128
+ displayName: "Orange",
129
+ colors: {
130
+ background: "oklch(0.99 0.01 70.67)",
131
+ foreground: "oklch(0.15 0.025 70.67)",
132
+ card: "oklch(0.99 0.01 70.67)",
133
+ "card-foreground": "oklch(0.15 0.025 70.67)",
134
+ popover: "oklch(0.99 0.01 70.67)",
135
+ "popover-foreground": "oklch(0.15 0.025 70.67)",
136
+ primary: "oklch(0.5 0.207 60.234)",
137
+ "primary-foreground": "oklch(0.985 0.005 106.423)",
138
+ secondary: "oklch(0.956 0.02 70.67)",
139
+ "secondary-foreground": "oklch(0.15 0.025 70.67)",
140
+ muted: "oklch(0.956 0.02 70.67)",
141
+ "muted-foreground": "oklch(0.533 0.025 70.67)",
142
+ accent: "oklch(0.956 0.02 70.67)",
143
+ "accent-foreground": "oklch(0.15 0.025 70.67)",
144
+ destructive: "oklch(0.577 0.245 27.325)",
145
+ border: "oklch(0.898 0.02 70.67)",
146
+ input: "oklch(0.898 0.02 70.67)",
147
+ ring: "oklch(0.5 0.207 60.234)",
148
+ },
149
+ },
150
+ };
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Shared Toast Utilities
3
+ *
4
+ * Theme-aware toast notification system using Sonner with comprehensive
5
+ * styling, icons, and theme integration for consistent user experience
6
+ * across all modules.
7
+ *
8
+ * Features:
9
+ * - Theme-aware styling (light/dark/system)
10
+ * - Lucide React icons for each toast type
11
+ * - Consistent styling with shadcn/ui components
12
+ * - TypeScript support with proper interfaces
13
+ * - Convenience functions for common use cases
14
+ */
15
+ export declare enum TOAST_VARIANT {
16
+ ERROR = "error",
17
+ INFO = "info",
18
+ SUCCESS = "success",
19
+ WARNING = "warning"
20
+ }
21
+ interface ToastConfig {
22
+ action?: {
23
+ label: string;
24
+ onClick: () => void;
25
+ };
26
+ description: string;
27
+ duration?: number;
28
+ theme?: "light" | "dark" | "system";
29
+ title?: string;
30
+ variant: TOAST_VARIANT;
31
+ }
32
+ export declare const generateToast: ({ variant, title, description, duration, action, }: ToastConfig) => string | number;
33
+ export declare const generateThemeToast: ({ variant, title, description, duration, action, theme, }: ToastConfig & {
34
+ theme?: "light" | "dark" | "system";
35
+ }) => string | number;
36
+ export declare const showSuccessToast: (description: string, title?: string) => void;
37
+ export declare const showErrorToast: (description: string, title?: string) => void;
38
+ export declare const showWarningToast: (description: string, title?: string) => void;
39
+ export declare const showInfoToast: (description: string, title?: string) => void;
40
+ export declare const showThemeSuccessToast: (description: string, title?: string, theme?: "light" | "dark" | "system") => void;
41
+ export declare const showThemeErrorToast: (description: string, title?: string, theme?: "light" | "dark" | "system") => void;
42
+ export declare const showThemeWarningToast: (description: string, title?: string, theme?: "light" | "dark" | "system") => void;
43
+ export declare const showThemeInfoToast: (description: string, title?: string, theme?: "light" | "dark" | "system") => void;
44
+ export {};
@@ -0,0 +1,212 @@
1
+ "use strict";
2
+ /**
3
+ * Shared Toast Utilities
4
+ *
5
+ * Theme-aware toast notification system using Sonner with comprehensive
6
+ * styling, icons, and theme integration for consistent user experience
7
+ * across all modules.
8
+ *
9
+ * Features:
10
+ * - Theme-aware styling (light/dark/system)
11
+ * - Lucide React icons for each toast type
12
+ * - Consistent styling with shadcn/ui components
13
+ * - TypeScript support with proper interfaces
14
+ * - Convenience functions for common use cases
15
+ */
16
+ var __assign = (this && this.__assign) || function () {
17
+ __assign = Object.assign || function(t) {
18
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
19
+ s = arguments[i];
20
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
21
+ t[p] = s[p];
22
+ }
23
+ return t;
24
+ };
25
+ return __assign.apply(this, arguments);
26
+ };
27
+ var __importDefault = (this && this.__importDefault) || function (mod) {
28
+ return (mod && mod.__esModule) ? mod : { "default": mod };
29
+ };
30
+ var _a;
31
+ Object.defineProperty(exports, "__esModule", { value: true });
32
+ exports.showThemeInfoToast = exports.showThemeWarningToast = exports.showThemeErrorToast = exports.showThemeSuccessToast = exports.showInfoToast = exports.showWarningToast = exports.showErrorToast = exports.showSuccessToast = exports.generateThemeToast = exports.generateToast = exports.TOAST_VARIANT = void 0;
33
+ var react_1 = __importDefault(require("react"));
34
+ var sonner_1 = require("sonner");
35
+ var lucide_react_1 = require("lucide-react");
36
+ // Theme-aware toast styling
37
+ var THEME_TOAST_STYLES = {
38
+ light: {
39
+ className: "bg-background text-foreground border-border shadow-lg",
40
+ style: {
41
+ backgroundColor: "hsl(var(--background))",
42
+ color: "hsl(var(--foreground))",
43
+ borderColor: "hsl(var(--border))",
44
+ },
45
+ },
46
+ dark: {
47
+ className: "bg-popover text-popover-foreground border-border shadow-lg",
48
+ style: {
49
+ backgroundColor: "hsl(var(--popover))",
50
+ color: "hsl(var(--popover-foreground))",
51
+ borderColor: "hsl(var(--border))",
52
+ },
53
+ },
54
+ };
55
+ // Toast types matching the previous Vista notification types
56
+ var TOAST_VARIANT;
57
+ (function (TOAST_VARIANT) {
58
+ TOAST_VARIANT["ERROR"] = "error";
59
+ TOAST_VARIANT["INFO"] = "info";
60
+ TOAST_VARIANT["SUCCESS"] = "success";
61
+ TOAST_VARIANT["WARNING"] = "warning";
62
+ })(TOAST_VARIANT || (exports.TOAST_VARIANT = TOAST_VARIANT = {}));
63
+ // Icon mapping for each variant using object notation
64
+ var TOAST_ICON_MAP = (_a = {},
65
+ _a[TOAST_VARIANT.ERROR] = lucide_react_1.AlertCircle,
66
+ _a[TOAST_VARIANT.INFO] = lucide_react_1.Info,
67
+ _a[TOAST_VARIANT.SUCCESS] = lucide_react_1.CheckCircle,
68
+ _a[TOAST_VARIANT.WARNING] = lucide_react_1.AlertTriangle,
69
+ _a);
70
+ var getToastIcon = function (variant) {
71
+ return TOAST_ICON_MAP[variant] || lucide_react_1.Info;
72
+ };
73
+ // Create icon element helper
74
+ var createIconElement = function (variant) {
75
+ var Icon = getToastIcon(variant);
76
+ return react_1.default.createElement(Icon, { className: "h-4 w-4" });
77
+ };
78
+ // Enhanced theme-aware toast function
79
+ var generateToast = function (_a) {
80
+ var _b;
81
+ var variant = _a.variant, title = _a.title, description = _a.description, _c = _a.duration, duration = _c === void 0 ? 4000 : _c, action = _a.action;
82
+ var iconElement = createIconElement(variant);
83
+ var toastOptions = __assign({ description: description, duration: duration, icon: iconElement, className: "group-[.toaster]:bg-popover group-[.toaster]:text-popover-foreground group-[.toaster]:border-border", style: {
84
+ minWidth: "320px",
85
+ maxWidth: "420px",
86
+ } }, (action && {
87
+ action: {
88
+ label: action.label,
89
+ onClick: action.onClick,
90
+ },
91
+ }));
92
+ // Toast method mapping using object notation
93
+ var TOAST_METHOD_MAP = (_b = {},
94
+ _b[TOAST_VARIANT.SUCCESS] = function () {
95
+ return sonner_1.toast.success(title || "Success", toastOptions);
96
+ },
97
+ _b[TOAST_VARIANT.ERROR] = function () { return sonner_1.toast.error(title || "Error", toastOptions); },
98
+ _b[TOAST_VARIANT.WARNING] = function () {
99
+ return sonner_1.toast.warning(title || "Warning", toastOptions);
100
+ },
101
+ _b[TOAST_VARIANT.INFO] = function () {
102
+ return sonner_1.toast.info(title || "Information", toastOptions);
103
+ },
104
+ _b);
105
+ var toastMethod = TOAST_METHOD_MAP[variant];
106
+ return toastMethod
107
+ ? toastMethod()
108
+ : (0, sonner_1.toast)(title || description, toastOptions);
109
+ };
110
+ exports.generateToast = generateToast;
111
+ // Theme-aware toast generation function
112
+ var generateThemeToast = function (_a) {
113
+ var _b;
114
+ var variant = _a.variant, title = _a.title, description = _a.description, _c = _a.duration, duration = _c === void 0 ? 4000 : _c, action = _a.action, _d = _a.theme, theme = _d === void 0 ? "system" : _d;
115
+ var iconElement = createIconElement(variant);
116
+ // Apply theme-specific styling
117
+ var themeStyle = theme === "dark" ? THEME_TOAST_STYLES.dark : THEME_TOAST_STYLES.light;
118
+ var toastOptions = __assign({ description: description, duration: duration, icon: iconElement, className: "".concat(themeStyle.className, " toast-theme-").concat(theme), style: __assign(__assign({}, themeStyle.style), { minWidth: "320px", maxWidth: "420px" }) }, (action && {
119
+ action: {
120
+ label: action.label,
121
+ onClick: action.onClick,
122
+ },
123
+ }));
124
+ // Toast method mapping using object notation
125
+ var TOAST_METHOD_MAP = (_b = {},
126
+ _b[TOAST_VARIANT.ERROR] = function () { return sonner_1.toast.error(title || "Error", toastOptions); },
127
+ _b[TOAST_VARIANT.INFO] = function () {
128
+ return sonner_1.toast.info(title || "Information", toastOptions);
129
+ },
130
+ _b[TOAST_VARIANT.SUCCESS] = function () {
131
+ return sonner_1.toast.success(title || "Success", toastOptions);
132
+ },
133
+ _b[TOAST_VARIANT.WARNING] = function () {
134
+ return sonner_1.toast.warning(title || "Warning", toastOptions);
135
+ },
136
+ _b);
137
+ var toastMethod = TOAST_METHOD_MAP[variant];
138
+ return toastMethod
139
+ ? toastMethod()
140
+ : (0, sonner_1.toast)(title || description, toastOptions);
141
+ };
142
+ exports.generateThemeToast = generateThemeToast;
143
+ // Convenience functions for each toast type
144
+ var showSuccessToast = function (description, title) {
145
+ (0, exports.generateToast)({
146
+ variant: TOAST_VARIANT.SUCCESS,
147
+ title: title,
148
+ description: description,
149
+ });
150
+ };
151
+ exports.showSuccessToast = showSuccessToast;
152
+ var showErrorToast = function (description, title) {
153
+ (0, exports.generateToast)({
154
+ variant: TOAST_VARIANT.ERROR,
155
+ title: title,
156
+ description: description,
157
+ });
158
+ };
159
+ exports.showErrorToast = showErrorToast;
160
+ var showWarningToast = function (description, title) {
161
+ (0, exports.generateToast)({
162
+ variant: TOAST_VARIANT.WARNING,
163
+ title: title,
164
+ description: description,
165
+ });
166
+ };
167
+ exports.showWarningToast = showWarningToast;
168
+ var showInfoToast = function (description, title) {
169
+ (0, exports.generateToast)({
170
+ variant: TOAST_VARIANT.INFO,
171
+ title: title,
172
+ description: description,
173
+ });
174
+ };
175
+ exports.showInfoToast = showInfoToast;
176
+ // Theme-aware convenience functions
177
+ var showThemeSuccessToast = function (description, title, theme) {
178
+ (0, exports.generateThemeToast)({
179
+ variant: TOAST_VARIANT.SUCCESS,
180
+ title: title,
181
+ description: description,
182
+ theme: theme,
183
+ });
184
+ };
185
+ exports.showThemeSuccessToast = showThemeSuccessToast;
186
+ var showThemeErrorToast = function (description, title, theme) {
187
+ (0, exports.generateThemeToast)({
188
+ variant: TOAST_VARIANT.ERROR,
189
+ title: title,
190
+ description: description,
191
+ theme: theme,
192
+ });
193
+ };
194
+ exports.showThemeErrorToast = showThemeErrorToast;
195
+ var showThemeWarningToast = function (description, title, theme) {
196
+ (0, exports.generateThemeToast)({
197
+ variant: TOAST_VARIANT.WARNING,
198
+ title: title,
199
+ description: description,
200
+ theme: theme,
201
+ });
202
+ };
203
+ exports.showThemeWarningToast = showThemeWarningToast;
204
+ var showThemeInfoToast = function (description, title, theme) {
205
+ (0, exports.generateThemeToast)({
206
+ variant: TOAST_VARIANT.INFO,
207
+ title: title,
208
+ description: description,
209
+ theme: theme,
210
+ });
211
+ };
212
+ exports.showThemeInfoToast = showThemeInfoToast;
package/lib/utils.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ import { type ClassValue } from "clsx";
2
+ export declare function cn(...inputs: ClassValue[]): string;
package/lib/utils.js ADDED
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.cn = cn;
4
+ var clsx_1 = require("clsx");
5
+ var tailwind_merge_1 = require("tailwind-merge");
6
+ function cn() {
7
+ var inputs = [];
8
+ for (var _i = 0; _i < arguments.length; _i++) {
9
+ inputs[_i] = arguments[_i];
10
+ }
11
+ return (0, tailwind_merge_1.twMerge)((0, clsx_1.clsx)(inputs));
12
+ }
package/package.json ADDED
@@ -0,0 +1,101 @@
1
+ {
2
+ "name": "@appcorp/shadcn",
3
+ "version": "1.0.10",
4
+ "scripts": {
5
+ "build:next": "next build",
6
+ "build:storybook": "storybook build -c .storybook -o .out",
7
+ "build:ts": "tsc --project tsconfig.build.json",
8
+ "build": "yarn clean && yarn build:ts && cp package.json lib && cp README.md lib && cp yarn.lock lib",
9
+ "clean": "yarn rimraf ./lib",
10
+ "copy:deploy:files": "cp favicon.ico ./.out/ && cp assets/react-pakistan.jpeg ./.out/",
11
+ "deploy:storybook:ci": "concurrently \"yarn storybook:ghpages:ci\" \"sleep 15 && rm ./*out*/favicon.ico && yarn copy:deploy:files\"",
12
+ "deploy:storybook": "concurrently \"yarn storybook:ghpages\" \"sleep 15 && rm ./*out*/favicon.ico && yarn copy:deploy:files\"",
13
+ "dev": "next dev",
14
+ "extract": "yarn build:storybook && npx sb extract ./.out && cp ./.out/stories.json . && rm -rf ./.out",
15
+ "format:check": "prettier --check \"**/*.{js,jsx,ts,tsx,json,css,md}\"",
16
+ "format": "prettier --write \"**/*.{js,jsx,ts,tsx,json,css,md}\"",
17
+ "generate:sitemap": "scripts/generate-sitemap.sh",
18
+ "lint": "next lint",
19
+ "major": "npm version major",
20
+ "minor": "npm version minor",
21
+ "patch": "npm version patch",
22
+ "prepare": "husky",
23
+ "publish:npm": "yarn build && cd lib/ && npm publish --access public && cd ..",
24
+ "start": "next start",
25
+ "storybook": "storybook dev -p 6006",
26
+ "test:watch": "jest --watch",
27
+ "test": "jest",
28
+ "upgrade": "ncu -u"
29
+ },
30
+ "repository": "https://github.com/app-corp/shadcn",
31
+ "author": "Taimoor Khan <taimoor.m.k@live.com>",
32
+ "license": "MIT",
33
+ "devDependencies": {
34
+ "@commitlint/cli": "^20.1.0",
35
+ "@commitlint/config-conventional": "^20.0.0",
36
+ "@dnd-kit/core": "^6.3.1",
37
+ "@dnd-kit/modifiers": "^9.0.0",
38
+ "@eslint/eslintrc": "^3.3.1",
39
+ "@eslint/js": "^9.37.0",
40
+ "@radix-ui/react-checkbox": "^1.3.3",
41
+ "@radix-ui/react-context-menu": "^2.2.16",
42
+ "@radix-ui/react-dropdown-menu": "^2.1.16",
43
+ "@radix-ui/react-label": "^2.1.7",
44
+ "@radix-ui/react-popover": "^1.1.15",
45
+ "@radix-ui/react-select": "^2.2.6",
46
+ "@radix-ui/react-separator": "^1.1.7",
47
+ "@radix-ui/react-slot": "^1.2.3",
48
+ "@radix-ui/react-switch": "^1.2.6",
49
+ "@storybook/addon-docs": "^9.1.11",
50
+ "@storybook/addon-onboarding": "^9.1.11",
51
+ "@storybook/nextjs": "^9.1.12",
52
+ "@tailwindcss/postcss": "^4.1.14",
53
+ "@tanstack/react-table": "^8.21.3",
54
+ "@testing-library/dom": "^10.4.1",
55
+ "@testing-library/jest-dom": "^6.9.1",
56
+ "@testing-library/react": "^16.3.0",
57
+ "@testing-library/user-event": "^14.6.1",
58
+ "@types/jest": "^30.0.0",
59
+ "@types/lodash.throttle": "^4",
60
+ "@types/node": "^24.7.2",
61
+ "@types/react": "^19",
62
+ "@types/react-dom": "^19",
63
+ "@uidotdev/usehooks": "^2.4.1",
64
+ "autoprefixer": "^10.4.21",
65
+ "class-variance-authority": "^0.7.1",
66
+ "clsx": "^2.1.1",
67
+ "cmdk": "^1.1.1",
68
+ "color": "^5.0.2",
69
+ "date-fns": "^4.1.0",
70
+ "embla-carousel-react": "^8.6.0",
71
+ "eslint": "^9.37.0",
72
+ "eslint-config-next": "^15.5.5",
73
+ "eslint-config-prettier": "^10.1.8",
74
+ "husky": "^9.1.7",
75
+ "jest": "^30.2.0",
76
+ "jest-environment-jsdom": "^30.2.0",
77
+ "jotai": "^2.15.0",
78
+ "lint-staged": "^16.2.4",
79
+ "lodash.throttle": "^4.1.1",
80
+ "lucide-react": "^0.546.0",
81
+ "motion": "^12.23.24",
82
+ "next": "^15.5.6",
83
+ "next-themes": "^0.4.6",
84
+ "postcss": "^8.5.6",
85
+ "prettier": "^3.6.2",
86
+ "radix-ui": "^1.4.3",
87
+ "react": "^19.2.0",
88
+ "react-dom": "^19.2.0",
89
+ "react-dropzone": "^14.3.8",
90
+ "react-hook-form": "^7.65.0",
91
+ "rimraf": "^6.0.1",
92
+ "sonner": "^2.0.7",
93
+ "storybook": "^9.1.11",
94
+ "tailwind-merge": "^3.3.1",
95
+ "tailwindcss": "3",
96
+ "ts-node": "^10.9.2",
97
+ "typescript": "^5.9.3",
98
+ "vaul": "^1.1.2"
99
+ },
100
+ "packageManager": "yarn@4.10.3"
101
+ }