pillardash-ui-react 0.1.131 → 0.1.137

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 (236) hide show
  1. package/README.md +54 -46
  2. package/dist/cjs/_virtual/_commonjsHelpers.js +2 -0
  3. package/dist/cjs/_virtual/_commonjsHelpers.js.map +1 -0
  4. package/dist/cjs/_virtual/index.js +2 -0
  5. package/dist/cjs/_virtual/index.js.map +1 -0
  6. package/dist/cjs/_virtual/index2.js +2 -0
  7. package/dist/cjs/_virtual/index2.js.map +1 -0
  8. package/dist/cjs/components/Alert/Alert.js +2 -0
  9. package/dist/cjs/components/Alert/Alert.js.map +1 -0
  10. package/dist/cjs/components/Alert/AlertContext.js +2 -0
  11. package/dist/cjs/components/Alert/AlertContext.js.map +1 -0
  12. package/dist/cjs/components/Alert/ConfirmDialog.js +2 -0
  13. package/dist/cjs/components/Alert/ConfirmDialog.js.map +1 -0
  14. package/dist/cjs/components/Alert/ConfirmationAlert.js +2 -0
  15. package/dist/cjs/components/Alert/ConfirmationAlert.js.map +1 -0
  16. package/dist/cjs/components/Badge/Badge.js +2 -0
  17. package/dist/cjs/components/Badge/Badge.js.map +1 -0
  18. package/dist/cjs/components/Breadcrumb/Breadcrumb.js +2 -0
  19. package/dist/cjs/components/Breadcrumb/Breadcrumb.js.map +1 -0
  20. package/dist/cjs/components/Button/Button.js +2 -0
  21. package/dist/cjs/components/Button/Button.js.map +1 -0
  22. package/dist/cjs/components/Button/ExportButton.js +2 -0
  23. package/dist/cjs/components/Button/ExportButton.js.map +1 -0
  24. package/dist/cjs/components/Cards/Card.js +2 -0
  25. package/dist/cjs/components/Cards/Card.js.map +1 -0
  26. package/dist/cjs/components/Cards/EmptyStateCard.js +2 -0
  27. package/dist/cjs/components/Cards/EmptyStateCard.js.map +1 -0
  28. package/dist/cjs/components/Document/FileView.js +2 -0
  29. package/dist/cjs/components/Document/FileView.js.map +1 -0
  30. package/dist/cjs/components/Form/CheckBox/CheckBox.js +2 -0
  31. package/dist/cjs/components/Form/CheckBox/CheckBox.js.map +1 -0
  32. package/dist/cjs/components/Form/FileUpload/FileUpload.js +2 -0
  33. package/dist/cjs/components/Form/FileUpload/FileUpload.js.map +1 -0
  34. package/dist/cjs/components/Form/Input/DateTimePicker.js +2 -0
  35. package/dist/cjs/components/Form/Input/DateTimePicker.js.map +1 -0
  36. package/dist/cjs/components/Form/Input/Input.js +2 -0
  37. package/dist/cjs/components/Form/Input/Input.js.map +1 -0
  38. package/dist/cjs/components/Form/Input/InputWithPrefix.js +2 -0
  39. package/dist/cjs/components/Form/Input/InputWithPrefix.js.map +1 -0
  40. package/dist/cjs/components/Form/Input/TagInput.js +2 -0
  41. package/dist/cjs/components/Form/Input/TagInput.js.map +1 -0
  42. package/dist/cjs/components/Form/Search/Search.js +2 -0
  43. package/dist/cjs/components/Form/Search/Search.js.map +1 -0
  44. package/dist/cjs/components/Form/Select/Select.js +2 -0
  45. package/dist/cjs/components/Form/Select/Select.js.map +1 -0
  46. package/dist/cjs/components/Form/Select/SelectButton.js +2 -0
  47. package/dist/cjs/components/Form/Select/SelectButton.js.map +1 -0
  48. package/dist/cjs/components/Form/TextEditor/TextEditor.js +2 -0
  49. package/dist/cjs/components/Form/TextEditor/TextEditor.js.map +1 -0
  50. package/dist/cjs/components/Loading/Loading.js +2 -0
  51. package/dist/cjs/components/Loading/Loading.js.map +1 -0
  52. package/dist/cjs/components/Modal/Modal.js +2 -0
  53. package/dist/cjs/components/Modal/Modal.js.map +1 -0
  54. package/dist/cjs/components/SkeletonLoader/SkeletonLoader.js +2 -0
  55. package/dist/cjs/components/SkeletonLoader/SkeletonLoader.js.map +1 -0
  56. package/dist/cjs/components/SkeletonLoader/index.js +2 -0
  57. package/dist/cjs/components/SkeletonLoader/index.js.map +1 -0
  58. package/dist/cjs/components/Table/Pagination.js +2 -0
  59. package/dist/cjs/components/Table/Pagination.js.map +1 -0
  60. package/dist/cjs/components/Table/Table.js +2 -0
  61. package/dist/cjs/components/Table/Table.js.map +1 -0
  62. package/dist/cjs/components/Table/TableDropdown.js +2 -0
  63. package/dist/cjs/components/Table/TableDropdown.js.map +1 -0
  64. package/dist/cjs/components/Table/TableSkeleton.js +2 -0
  65. package/dist/cjs/components/Table/TableSkeleton.js.map +1 -0
  66. package/dist/cjs/components/Tooltip/Tooltip.js +2 -0
  67. package/dist/cjs/components/Tooltip/Tooltip.js.map +1 -0
  68. package/dist/cjs/index.js +2 -0
  69. package/dist/cjs/index.js.map +1 -0
  70. package/dist/cjs/node_modules/@tiptap/core/dist/index.js +2 -0
  71. package/dist/cjs/node_modules/@tiptap/core/dist/index.js.map +1 -0
  72. package/dist/cjs/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.js +2 -0
  73. package/dist/cjs/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.js.map +1 -0
  74. package/dist/cjs/node_modules/@tiptap/extension-bold/dist/index.js +2 -0
  75. package/dist/cjs/node_modules/@tiptap/extension-bold/dist/index.js.map +1 -0
  76. package/dist/cjs/node_modules/@tiptap/extension-bullet-list/dist/index.js +2 -0
  77. package/dist/cjs/node_modules/@tiptap/extension-bullet-list/dist/index.js.map +1 -0
  78. package/dist/cjs/node_modules/@tiptap/extension-code/dist/index.js +2 -0
  79. package/dist/cjs/node_modules/@tiptap/extension-code/dist/index.js.map +1 -0
  80. package/dist/cjs/node_modules/@tiptap/extension-code-block/dist/index.js +2 -0
  81. package/dist/cjs/node_modules/@tiptap/extension-code-block/dist/index.js.map +1 -0
  82. package/dist/cjs/node_modules/@tiptap/extension-document/dist/index.js +2 -0
  83. package/dist/cjs/node_modules/@tiptap/extension-document/dist/index.js.map +1 -0
  84. package/dist/cjs/node_modules/@tiptap/extension-heading/dist/index.js +2 -0
  85. package/dist/cjs/node_modules/@tiptap/extension-heading/dist/index.js.map +1 -0
  86. package/dist/cjs/node_modules/@tiptap/extension-italic/dist/index.js +2 -0
  87. package/dist/cjs/node_modules/@tiptap/extension-italic/dist/index.js.map +1 -0
  88. package/dist/cjs/node_modules/@tiptap/extension-list/dist/index.js +2 -0
  89. package/dist/cjs/node_modules/@tiptap/extension-list/dist/index.js.map +1 -0
  90. package/dist/cjs/node_modules/@tiptap/extension-list-item/dist/index.js +2 -0
  91. package/dist/cjs/node_modules/@tiptap/extension-list-item/dist/index.js.map +1 -0
  92. package/dist/cjs/node_modules/@tiptap/extension-ordered-list/dist/index.js +2 -0
  93. package/dist/cjs/node_modules/@tiptap/extension-ordered-list/dist/index.js.map +1 -0
  94. package/dist/cjs/node_modules/@tiptap/extension-paragraph/dist/index.js +2 -0
  95. package/dist/cjs/node_modules/@tiptap/extension-paragraph/dist/index.js.map +1 -0
  96. package/dist/cjs/node_modules/@tiptap/extension-strike/dist/index.js +2 -0
  97. package/dist/cjs/node_modules/@tiptap/extension-strike/dist/index.js.map +1 -0
  98. package/dist/cjs/node_modules/@tiptap/extension-text/dist/index.js +2 -0
  99. package/dist/cjs/node_modules/@tiptap/extension-text/dist/index.js.map +1 -0
  100. package/dist/cjs/node_modules/classnames/index.js +7 -0
  101. package/dist/cjs/node_modules/classnames/index.js.map +1 -0
  102. package/dist/cjs/node_modules/orderedmap/dist/index.js +2 -0
  103. package/dist/cjs/node_modules/orderedmap/dist/index.js.map +1 -0
  104. package/dist/cjs/node_modules/prosemirror-commands/dist/index.js +2 -0
  105. package/dist/cjs/node_modules/prosemirror-commands/dist/index.js.map +1 -0
  106. package/dist/cjs/node_modules/prosemirror-model/dist/index.js +2 -0
  107. package/dist/cjs/node_modules/prosemirror-model/dist/index.js.map +1 -0
  108. package/dist/cjs/node_modules/prosemirror-schema-list/dist/index.js +2 -0
  109. package/dist/cjs/node_modules/prosemirror-schema-list/dist/index.js.map +1 -0
  110. package/dist/cjs/node_modules/prosemirror-state/dist/index.js +2 -0
  111. package/dist/cjs/node_modules/prosemirror-state/dist/index.js.map +1 -0
  112. package/dist/cjs/node_modules/prosemirror-transform/dist/index.js +2 -0
  113. package/dist/cjs/node_modules/prosemirror-transform/dist/index.js.map +1 -0
  114. package/dist/cjs/node_modules/tslib/tslib.es6.js +2 -0
  115. package/dist/cjs/node_modules/tslib/tslib.es6.js.map +1 -0
  116. package/dist/esm/_virtual/_commonjsHelpers.mjs +2 -0
  117. package/dist/esm/_virtual/_commonjsHelpers.mjs.map +1 -0
  118. package/dist/esm/_virtual/index.mjs +2 -0
  119. package/dist/esm/_virtual/index.mjs.map +1 -0
  120. package/dist/esm/_virtual/index2.mjs +2 -0
  121. package/dist/esm/_virtual/index2.mjs.map +1 -0
  122. package/dist/esm/components/Alert/Alert.mjs +2 -0
  123. package/dist/esm/components/Alert/Alert.mjs.map +1 -0
  124. package/dist/esm/components/Alert/AlertContext.mjs +2 -0
  125. package/dist/esm/components/Alert/AlertContext.mjs.map +1 -0
  126. package/dist/esm/components/Alert/ConfirmDialog.mjs +2 -0
  127. package/dist/esm/components/Alert/ConfirmDialog.mjs.map +1 -0
  128. package/dist/esm/components/Alert/ConfirmationAlert.mjs +2 -0
  129. package/dist/esm/components/Alert/ConfirmationAlert.mjs.map +1 -0
  130. package/dist/esm/components/Badge/Badge.mjs +2 -0
  131. package/dist/esm/components/Badge/Badge.mjs.map +1 -0
  132. package/dist/esm/components/Breadcrumb/Breadcrumb.mjs +2 -0
  133. package/dist/esm/components/Breadcrumb/Breadcrumb.mjs.map +1 -0
  134. package/dist/esm/components/Button/Button.mjs +2 -0
  135. package/dist/esm/components/Button/Button.mjs.map +1 -0
  136. package/dist/esm/components/Button/ExportButton.mjs +2 -0
  137. package/dist/esm/components/Button/ExportButton.mjs.map +1 -0
  138. package/dist/esm/components/Cards/Card.mjs +2 -0
  139. package/dist/esm/components/Cards/Card.mjs.map +1 -0
  140. package/dist/esm/components/Cards/EmptyStateCard.mjs +2 -0
  141. package/dist/esm/components/Cards/EmptyStateCard.mjs.map +1 -0
  142. package/dist/esm/components/Document/FileView.mjs +2 -0
  143. package/dist/esm/components/Document/FileView.mjs.map +1 -0
  144. package/dist/esm/components/Form/CheckBox/CheckBox.mjs +2 -0
  145. package/dist/esm/components/Form/CheckBox/CheckBox.mjs.map +1 -0
  146. package/dist/esm/components/Form/FileUpload/FileUpload.mjs +2 -0
  147. package/dist/esm/components/Form/FileUpload/FileUpload.mjs.map +1 -0
  148. package/dist/esm/components/Form/Input/DateTimePicker.mjs +2 -0
  149. package/dist/esm/components/Form/Input/DateTimePicker.mjs.map +1 -0
  150. package/dist/esm/components/Form/Input/Input.mjs +2 -0
  151. package/dist/esm/components/Form/Input/Input.mjs.map +1 -0
  152. package/dist/esm/components/Form/Input/InputWithPrefix.mjs +2 -0
  153. package/dist/esm/components/Form/Input/InputWithPrefix.mjs.map +1 -0
  154. package/dist/esm/components/Form/Input/TagInput.mjs +2 -0
  155. package/dist/esm/components/Form/Input/TagInput.mjs.map +1 -0
  156. package/dist/esm/components/Form/Search/Search.mjs +2 -0
  157. package/dist/esm/components/Form/Search/Search.mjs.map +1 -0
  158. package/dist/esm/components/Form/Select/Select.mjs +2 -0
  159. package/dist/esm/components/Form/Select/Select.mjs.map +1 -0
  160. package/dist/esm/components/Form/Select/SelectButton.mjs +2 -0
  161. package/dist/esm/components/Form/Select/SelectButton.mjs.map +1 -0
  162. package/dist/esm/components/Form/TextEditor/TextEditor.mjs +2 -0
  163. package/dist/esm/components/Form/TextEditor/TextEditor.mjs.map +1 -0
  164. package/dist/esm/components/Loading/Loading.mjs +2 -0
  165. package/dist/esm/components/Loading/Loading.mjs.map +1 -0
  166. package/dist/esm/components/Modal/Modal.mjs +2 -0
  167. package/dist/esm/components/Modal/Modal.mjs.map +1 -0
  168. package/dist/esm/components/SkeletonLoader/SkeletonLoader.mjs +2 -0
  169. package/dist/esm/components/SkeletonLoader/SkeletonLoader.mjs.map +1 -0
  170. package/dist/esm/components/SkeletonLoader/index.mjs +2 -0
  171. package/dist/esm/components/SkeletonLoader/index.mjs.map +1 -0
  172. package/dist/esm/components/Table/Pagination.mjs +2 -0
  173. package/dist/esm/components/Table/Pagination.mjs.map +1 -0
  174. package/dist/esm/components/Table/Table.mjs +2 -0
  175. package/dist/esm/components/Table/Table.mjs.map +1 -0
  176. package/dist/esm/components/Table/TableDropdown.mjs +2 -0
  177. package/dist/esm/components/Table/TableDropdown.mjs.map +1 -0
  178. package/dist/esm/components/Table/TableSkeleton.mjs +2 -0
  179. package/dist/esm/components/Table/TableSkeleton.mjs.map +1 -0
  180. package/dist/esm/components/Tooltip/Tooltip.mjs +2 -0
  181. package/dist/esm/components/Tooltip/Tooltip.mjs.map +1 -0
  182. package/dist/esm/index.mjs +2 -0
  183. package/dist/esm/index.mjs.map +1 -0
  184. package/dist/esm/node_modules/@tiptap/core/dist/index.mjs +2 -0
  185. package/dist/esm/node_modules/@tiptap/core/dist/index.mjs.map +1 -0
  186. package/dist/esm/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.mjs +2 -0
  187. package/dist/esm/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.mjs.map +1 -0
  188. package/dist/esm/node_modules/@tiptap/extension-bold/dist/index.mjs +2 -0
  189. package/dist/esm/node_modules/@tiptap/extension-bold/dist/index.mjs.map +1 -0
  190. package/dist/esm/node_modules/@tiptap/extension-bullet-list/dist/index.mjs +2 -0
  191. package/dist/esm/node_modules/@tiptap/extension-bullet-list/dist/index.mjs.map +1 -0
  192. package/dist/esm/node_modules/@tiptap/extension-code/dist/index.mjs +2 -0
  193. package/dist/esm/node_modules/@tiptap/extension-code/dist/index.mjs.map +1 -0
  194. package/dist/esm/node_modules/@tiptap/extension-code-block/dist/index.mjs +2 -0
  195. package/dist/esm/node_modules/@tiptap/extension-code-block/dist/index.mjs.map +1 -0
  196. package/dist/esm/node_modules/@tiptap/extension-document/dist/index.mjs +2 -0
  197. package/dist/esm/node_modules/@tiptap/extension-document/dist/index.mjs.map +1 -0
  198. package/dist/esm/node_modules/@tiptap/extension-heading/dist/index.mjs +2 -0
  199. package/dist/esm/node_modules/@tiptap/extension-heading/dist/index.mjs.map +1 -0
  200. package/dist/esm/node_modules/@tiptap/extension-italic/dist/index.mjs +2 -0
  201. package/dist/esm/node_modules/@tiptap/extension-italic/dist/index.mjs.map +1 -0
  202. package/dist/esm/node_modules/@tiptap/extension-list/dist/index.mjs +2 -0
  203. package/dist/esm/node_modules/@tiptap/extension-list/dist/index.mjs.map +1 -0
  204. package/dist/esm/node_modules/@tiptap/extension-list-item/dist/index.mjs +2 -0
  205. package/dist/esm/node_modules/@tiptap/extension-list-item/dist/index.mjs.map +1 -0
  206. package/dist/esm/node_modules/@tiptap/extension-ordered-list/dist/index.mjs +2 -0
  207. package/dist/esm/node_modules/@tiptap/extension-ordered-list/dist/index.mjs.map +1 -0
  208. package/dist/esm/node_modules/@tiptap/extension-paragraph/dist/index.mjs +2 -0
  209. package/dist/esm/node_modules/@tiptap/extension-paragraph/dist/index.mjs.map +1 -0
  210. package/dist/esm/node_modules/@tiptap/extension-strike/dist/index.mjs +2 -0
  211. package/dist/esm/node_modules/@tiptap/extension-strike/dist/index.mjs.map +1 -0
  212. package/dist/esm/node_modules/@tiptap/extension-text/dist/index.mjs +2 -0
  213. package/dist/esm/node_modules/@tiptap/extension-text/dist/index.mjs.map +1 -0
  214. package/dist/esm/node_modules/classnames/index.mjs +7 -0
  215. package/dist/esm/node_modules/classnames/index.mjs.map +1 -0
  216. package/dist/esm/node_modules/orderedmap/dist/index.mjs +2 -0
  217. package/dist/esm/node_modules/orderedmap/dist/index.mjs.map +1 -0
  218. package/dist/esm/node_modules/prosemirror-commands/dist/index.mjs +2 -0
  219. package/dist/esm/node_modules/prosemirror-commands/dist/index.mjs.map +1 -0
  220. package/dist/esm/node_modules/prosemirror-model/dist/index.mjs +2 -0
  221. package/dist/esm/node_modules/prosemirror-model/dist/index.mjs.map +1 -0
  222. package/dist/esm/node_modules/prosemirror-schema-list/dist/index.mjs +2 -0
  223. package/dist/esm/node_modules/prosemirror-schema-list/dist/index.mjs.map +1 -0
  224. package/dist/esm/node_modules/prosemirror-state/dist/index.mjs +2 -0
  225. package/dist/esm/node_modules/prosemirror-state/dist/index.mjs.map +1 -0
  226. package/dist/esm/node_modules/prosemirror-transform/dist/index.mjs +2 -0
  227. package/dist/esm/node_modules/prosemirror-transform/dist/index.mjs.map +1 -0
  228. package/dist/esm/node_modules/tslib/tslib.es6.mjs +2 -0
  229. package/dist/esm/node_modules/tslib/tslib.es6.mjs.map +1 -0
  230. package/dist/index.d.ts +1 -1
  231. package/dist/styles.css +1 -0
  232. package/package.json +63 -17
  233. package/dist/index.js +0 -51
  234. package/dist/index.js.map +0 -1
  235. package/dist/index.mjs +0 -51
  236. package/dist/index.mjs.map +0 -1
package/README.md CHANGED
@@ -18,6 +18,29 @@ npm install pillardash-ui-react
18
18
  yarn add pillardash-ui-react
19
19
  ```
20
20
 
21
+ ## Quick Start
22
+
23
+ Import the package stylesheet once in your app entry file (for example, `main.tsx`, `index.tsx`, or `app.tsx`):
24
+
25
+ ```tsx
26
+ import "pillardash-ui-react/styles.css";
27
+ ```
28
+
29
+ Then use components normally:
30
+
31
+ ```tsx
32
+ import { Button, Input } from "pillardash-ui-react";
33
+
34
+ function Example() {
35
+ return (
36
+ <div>
37
+ <Input label="Email" placeholder="Enter your email" />
38
+ <Button variant="primary">Submit</Button>
39
+ </div>
40
+ );
41
+ }
42
+ ```
43
+
21
44
  ## Peer Dependencies
22
45
 
23
46
  This library requires:
@@ -48,55 +71,38 @@ This library requires:
48
71
  - `Alert` - Contextual notification messages
49
72
  - `Loading` - Animated loading indicators
50
73
 
51
- ## Usage
52
-
53
- ```tsx
54
- import { Button, Input } from 'pillardash-ui-react';
74
+ ## Theming
55
75
 
56
- function Example() {
57
- return (
58
- <div>
59
- <Input
60
- label="Email"
61
- placeholder="Enter your email"
62
- />
63
- <Button variant="primary">
64
- Submit
65
- </Button>
66
- </div>
67
- );
76
+ You can customize core brand colors with CSS variables (no Tailwind config required):
77
+
78
+ ```css
79
+ :root {
80
+ --pd-primary: 14 138 116;
81
+ --pd-primary-50: 240 253 250;
82
+ --pd-primary-100: 204 251 241;
83
+ --pd-primary-400: 45 212 191;
84
+ --pd-primary-500: 20 184 166;
85
+ --pd-primary-600: 13 148 136;
86
+ --pd-primary-700: 15 118 110;
87
+ --pd-primary-800: 17 94 89;
88
+ --pd-primary-900: 19 78 74;
89
+ --pd-secondary: 14 138 170;
90
+ --pd-dark: 31 41 55;
68
91
  }
69
92
  ```
70
93
 
71
- ## Theming
72
-
73
- Customize the look and feel by wrapping your app with the `ThemeProvider`:
94
+ Each variable uses `R G B` channel values so alpha utilities continue to work.
74
95
 
75
- ```tsx
76
- import { ThemeProvider } from 'pillardash-ui-react';
96
+ ## Optional Tailwind Integration
77
97
 
78
- function App() {
79
- return (
80
- <ThemeProvider
81
- theme={{
82
- colors: {
83
- primary: '#0E8A74',
84
- secondary: '#0E8AAA'
85
- }
86
- }}
87
- >
88
- {/* Your app */}
89
- </ThemeProvider>
90
- );
91
- }
92
- ```
98
+ If your app uses Tailwind, you can still extend or override styles in your own config. This package no longer requires adding `node_modules/pillardash-ui-react` to `content` for default usage.
93
99
 
94
100
  ## TypeScript Support
95
101
 
96
102
  All components include TypeScript definitions. Import prop types for extended customization:
97
103
 
98
104
  ```tsx
99
- import { Button, type ButtonProps } from 'pillardash-ui-react';
105
+ import { Button, type ButtonProps } from "pillardash-ui-react";
100
106
 
101
107
  const CustomButton = (props: ButtonProps) => (
102
108
  <Button {...props} className="custom-class" />
@@ -119,16 +125,25 @@ MIT © [Osai Technologies](https://osaitech.dev)
119
125
 
120
126
  ```tsx
121
127
  <Button
122
- variant="primary" | "secondary" | "outline"
123
- size="sm" | "md" | "lg"
128
+ variant="primary" | "secondary" | "dark" | "neutral" | "danger" | "default"
129
+ size="xs" | "sm" | "md" | "lg"
124
130
  loading={boolean}
125
131
  disabled={boolean}
132
+ outline={boolean}
133
+ icon={ReactNode}
134
+ iconPosition="left" | "right"
126
135
  onClick={() => void}
127
136
  >
128
137
  Click me
129
138
  </Button>
130
139
  ```
131
140
 
141
+ > **Note:** `TextEditor` and `ExportButton` require `lucide-react` and `@tiptap/*` packages. Install them only if you use those components:
142
+ >
143
+ > ```bash
144
+ > npm install lucide-react @tiptap/react @tiptap/starter-kit @tiptap/extension-link @tiptap/extension-underline @tiptap/extension-image
145
+ > ```
146
+
132
147
  ### Input
133
148
 
134
149
  ```tsx
@@ -161,10 +176,3 @@ MIT © [Osai Technologies](https://osaitech.dev)
161
176
  3. Run Storybook: `npm run storybook`
162
177
  4. Build the library: `npm run build`
163
178
 
164
- ## Testing
165
-
166
- ```bash
167
- npm test
168
- # or
169
- npm run test:watch
170
- ```
@@ -0,0 +1,2 @@
1
+ "use strict";exports.getDefaultExportFromCjs=function(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t};
2
+ //# sourceMappingURL=_commonjsHelpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_commonjsHelpers.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ "use strict";var e=require("./_commonjsHelpers.js"),r=require("../node_modules/classnames/index.js").__require(),s=e.getDefaultExportFromCjs(r);module.exports=s;
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ "use strict";exports.__module={exports:{}};
2
+ //# sourceMappingURL=index2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index2.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ "use strict";var e=require("react/jsx-runtime"),r=require("react"),o=require("lucide-react");module.exports=function(t){var l=t.message,s=t.description,n=t.type,a=void 0===n?"info":n,c=t.duration,i=void 0===c?5e3:c,u=t.onClose,d=r.useState(!0),x=d[0],b=d[1],m=r.useState(100),g=m[0],C=m[1],f={success:{icon:e.jsx(o.CheckCircle,{className:"h-5 w-5"}),bgColor:"bg-green-50",borderColor:"border-green-300",textColor:"text-green-800",iconColor:"text-green-500",progressColor:"bg-green-500"},error:{icon:e.jsx(o.AlertCircle,{className:"h-5 w-5"}),bgColor:"bg-rose-50",borderColor:"border-rose-300",textColor:"text-rose-800",iconColor:"text-rose-500",progressColor:"bg-rose-500"},info:{icon:e.jsx(o.Info,{className:"h-5 w-5"}),bgColor:"bg-blue-50",borderColor:"border-blue-300",textColor:"text-blue-800",iconColor:"text-blue-500",progressColor:"bg-blue-500"},warning:{icon:e.jsx(o.AlertTriangle,{className:"h-5 w-5"}),bgColor:"bg-amber-50 ",borderColor:"border-amber-300 ",textColor:"text-amber-800",iconColor:"text-amber-500",progressColor:"bg-amber-500"}};r.useEffect((function(){var e=setTimeout((function(){b(!1),setTimeout((function(){null==u||u()}),300)}),i),r=setInterval((function(){C((function(e){var r=e-100/(i/100);return r<=0?0:r}))}),100);return function(){clearTimeout(e),clearInterval(r)}}),[i,u]);var h=f[a],v=h.icon,j=h.bgColor,N=h.borderColor,p=h.textColor,w=h.iconColor,y=h.progressColor;return e.jsx("div",{className:"fixed right-4 top-4 z-50 transform transition-all duration-300 ".concat(x?"translate-x-0 opacity-100":"translate-x-full opacity-0"),children:e.jsxs("div",{className:"flex w-72 rounded-lg border shadow-lg md:w-96 ".concat(N," ").concat(j," p-4"),children:[e.jsx("div",{className:"flex-shrink-0 ".concat(w),children:v}),e.jsxs("div",{className:"ml-3 w-full",children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsx("div",{className:"text-md font-semibold ".concat(p),children:l}),e.jsx("button",{onClick:function(){b(!1),setTimeout((function(){null==u||u()}),300)},className:"text-gray-600 hover:text-gray-600 focus:outline-none",children:e.jsx(o.X,{className:"h-4 w-4"})})]}),s&&e.jsx("p",{className:"mt-1 text-sm ".concat(p," opacity-80"),children:s}),e.jsx("div",{className:"mt-2 h-1 w-full rounded-full bg-gray-200",children:e.jsx("div",{className:"".concat(y," h-1 rounded-full transition-all duration-100 ease-linear"),style:{width:"".concat(g,"%")}})})]})]})})};
2
+ //# sourceMappingURL=Alert.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Alert.js","sources":["../../../../src/components/Alert/Alert.tsx"],"sourcesContent":["import React, {ReactNode, useEffect, useState} from \"react\";\n\nimport { AlertCircle, AlertTriangle, CheckCircle, Info, X } from \"lucide-react\";\n\nexport type AlertType = \"success\" | \"error\" | \"info\" | \"warning\";\n\nexport interface AlertProps {\n message: ReactNode;\n description?: string;\n type?: AlertType;\n duration?: number;\n onClose?: () => void;\n}\n\nconst Alert: React.FC<AlertProps> = ({\n message,\n description,\n type = \"info\",\n duration = 5000,\n onClose,\n}) => {\n const [isVisible, setIsVisible] = useState(true);\n const [progress, setProgress] = useState(100);\n\n // Configure colors based on type\n const config = {\n success: {\n icon: <CheckCircle className='h-5 w-5' />,\n bgColor: \"bg-green-50\",\n borderColor: \"border-green-300\",\n textColor: \"text-green-800\",\n iconColor: \"text-green-500\",\n progressColor: \"bg-green-500\",\n },\n error: {\n icon: <AlertCircle className='h-5 w-5' />,\n bgColor: \"bg-rose-50\",\n borderColor: \"border-rose-300\",\n textColor: \"text-rose-800\",\n iconColor: \"text-rose-500\",\n progressColor: \"bg-rose-500\",\n },\n info: {\n icon: <Info className='h-5 w-5' />,\n bgColor: \"bg-blue-50\",\n borderColor: \"border-blue-300\",\n textColor: \"text-blue-800\",\n iconColor: \"text-blue-500\",\n progressColor: \"bg-blue-500\",\n },\n warning: {\n icon: <AlertTriangle className='h-5 w-5' />,\n bgColor: \"bg-amber-50 \",\n borderColor: \"border-amber-300 \",\n textColor: \"text-amber-800\",\n iconColor: \"text-amber-500\",\n progressColor: \"bg-amber-500\",\n },\n };\n\n useEffect(() => {\n const timer = setTimeout(() => {\n setIsVisible(false);\n setTimeout(() => {\n onClose?.();\n }, 300);\n }, duration);\n\n // Progress bar animation\n const interval = setInterval(() => {\n setProgress((prev) => {\n const newProgress = prev - 100 / (duration / 100);\n return newProgress <= 0 ? 0 : newProgress;\n });\n }, 100);\n\n return () => {\n clearTimeout(timer);\n clearInterval(interval);\n };\n }, [duration, onClose]);\n\n const handleClose = () => {\n setIsVisible(false);\n setTimeout(() => {\n onClose?.();\n }, 300);\n };\n\n const { icon, bgColor, borderColor, textColor, iconColor, progressColor } = config[type];\n\n return (\n <div\n className={`fixed right-4 top-4 z-50 transform transition-all duration-300 ${\n isVisible ? \"translate-x-0 opacity-100\" : \"translate-x-full opacity-0\"\n }`}\n >\n <div\n className={`flex w-72 rounded-lg border shadow-lg md:w-96 ${borderColor} ${bgColor} p-4`}\n >\n <div className={`flex-shrink-0 ${iconColor}`}>{icon}</div>\n <div className='ml-3 w-full'>\n <div className='flex items-start justify-between'>\n <div className={`text-md font-semibold ${textColor}`}>{message}</div>\n <button\n onClick={handleClose}\n className='text-gray-600 hover:text-gray-600 focus:outline-none'\n >\n <X className='h-4 w-4' />\n </button>\n </div>\n {description && (\n <p className={`mt-1 text-sm ${textColor} opacity-80`}>{description}</p>\n )}\n <div className='mt-2 h-1 w-full rounded-full bg-gray-200'>\n <div\n className={`${progressColor} h-1 rounded-full transition-all duration-100 ease-linear`}\n style={{ width: `${progress}%` }}\n />\n </div>\n </div>\n </div>\n </div>\n );\n};\n\nexport default Alert;\n"],"names":["_a","message","description","_b","type","_c","duration","onClose","_d","useState","isVisible","setIsVisible","_e","progress","setProgress","config","success","icon","_jsx","CheckCircle","className","bgColor","borderColor","textColor","iconColor","progressColor","error","AlertCircle","info","Info","warning","AlertTriangle","useEffect","timer","setTimeout","interval","setInterval","prev","newProgress","clearTimeout","clearInterval","_f","concat","children","_jsxs","onClick","X","style","width"],"mappings":"4GAcoC,SAACA,OACjCC,EAAOD,EAAAC,QACPC,EAAWF,EAAAE,YACXC,EAAAH,EAAAI,KAAAA,OAAI,IAAAD,EAAG,SACPE,EAAAL,EAAAM,SAAAA,OAAQ,IAAAD,EAAG,IAAIA,EACfE,EAAOP,EAAAO,QAEDC,EAA4BC,EAAAA,UAAS,GAApCC,EAASF,EAAA,GAAEG,EAAYH,EAAA,G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KAAAoB,OAAIrB,EAAO,QAAMsB,SAAA,CAExFzB,EAAAA,IAAA,MAAA,CAAKE,UAAW,iBAAAsB,OAAiBlB,GAAWmB,SAAG1B,IAC/C2B,OAAA,MAAA,CAAKxB,UAAU,cAAauB,SAAA,CACxBC,EAAAA,KAAA,MAAA,CAAKxB,UAAU,mCAAkCuB,SAAA,CAC7CzB,EAAAA,IAAA,MAAA,CAAKE,UAAW,yBAAAsB,OAAyBnB,GAAWoB,SAAG1C,IACvDiB,EAAAA,IAAA,SAAA,CACI2B,QAvBJ,WAChBlC,GAAa,GACbuB,YAAW,WACP3B,SAAAA,GACJ,GAAG,IACP,EAmBwBa,UAAU,uDAAsDuB,SAEhEzB,EAAAA,IAAC4B,EAAAA,EAAC,CAAC1B,UAAU,iBAGpBlB,GACGgB,MAAA,IAAA,CAAGE,UAAW,gBAAAsB,OAAgBnB,EAAS,eAAaoB,SAAGzC,IAE3DgB,EAAAA,IAAA,MAAA,CAAKE,UAAU,2CAA0CuB,SACrDzB,EAAAA,IAAA,MAAA,CACIE,UAAW,GAAAsB,OAAGjB,EAAa,6DAC3BsB,MAAO,CAAEC,MAAO,GAAAN,OAAG7B,EAAQ,iBAOvD"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../node_modules/tslib/tslib.es6.js"),r=require("react/jsx-runtime"),n=require("react"),t=require("./Alert.js"),o=require("./ConfirmDialog.js"),i=null,s=n.createContext(void 0),u={success:function(e,r){i?i.success(e,r):console.warn("AlertProvider not mounted yet")},error:function(e,r){i?i.error(e,r):console.warn("AlertProvider not mounted yet")},info:function(e,r){i?i.info(e,r):console.warn("AlertProvider not mounted yet")},warning:function(e,r){i?i.warning(e,r):console.warn("AlertProvider not mounted yet")},show:function(e){i?i.showAlert(e):console.warn("AlertProvider not mounted yet")},confirm:function(r,n){return e.__awaiter(void 0,void 0,void 0,(function(){return e.__generator(this,(function(e){return i?[2,i.confirm(r,n)]:(console.warn("AlertProvider not mounted yet"),[2,!1])}))}))}};exports.AlertContext=s,exports.AlertProvider=function(u){var a=u.children,c=n.useState([]),l=c[0],d=c[1],f=n.useState(null),v=f[0],m=f[1],w=n.useCallback((function(e){d((function(r){return r.filter((function(r){return r.id!==e}))}))}),[]),p=n.useCallback((function(r){var n=Math.random().toString(36).substring(2,9),t=e.__assign(e.__assign({},r),{id:n,onClose:function(){return w(n)}});d((function(r){return e.__spreadArray(e.__spreadArray([],r,!0),[t],!1)}))}),[w]),x=n.useCallback((function(e){return function(r,n){p({message:r,description:n,type:e})}}),[p]),_=n.useCallback((function(e,r){return void 0===r&&(r={}),new Promise((function(n){m({isOpen:!0,message:e,options:r,resolve:n})}))}),[]),g=n.useCallback((function(e){v&&(v.resolve(e),m(null))}),[v]),A={showAlert:p,success:x("success"),error:x("error"),info:x("info"),warning:x("warning"),confirm:_};return i=A,r.jsxs(s.Provider,{value:A,children:[a,r.jsx("div",{className:"fixed right-4 top-4 z-50 space-y-2 w-full max-w-xs",children:l.map((function(n,o){return r.jsx("div",{style:{transform:"translateY(".concat(10*o,"px)"),zIndex:50-o},children:r.jsx(t,e.__assign({},n))},n.id)}))}),v&&r.jsx(o,e.__assign({isOpen:v.isOpen,message:v.message,onConfirm:function(){return g(!0)},onCancel:function(){return g(!1)}},v.options))]})},exports.default=u,exports.useAlert=function(){var e=n.useContext(s);if(void 0===e)throw new Error("useAlert must be used within a AlertProvider");return e};
2
+ //# sourceMappingURL=AlertContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AlertContext.js","sources":["../../../../src/components/Alert/AlertContext.tsx"],"sourcesContent":["import React, { createContext, useCallback, useContext, useState } from \"react\";\nimport Alert, { AlertProps, AlertType } from \"./Alert\";\nimport ConfirmDialog from \"./ConfirmDialog\";\n\nexport interface AlertContextProps {\n showAlert: (props: Omit<AlertProps, \"onClose\">) => void;\n success: (message: string, description?: string) => void;\n error: (message: string, description?: string) => void;\n info: (message: string, description?: string) => void;\n warning: (message: string, description?: string) => void;\n confirm: (message: string, options?: ConfirmOptions) => Promise<boolean>;\n}\n\nexport interface ConfirmOptions {\n title?: string;\n description?: string;\n confirmText?: string;\n cancelText?: string;\n type?: AlertType;\n}\n\ninterface ConfirmState {\n isOpen: boolean;\n message: string;\n options: ConfirmOptions;\n resolve: (value: boolean) => void;\n}\n\nlet globalAlertRef: AlertContextProps | null = null;\n\nexport const AlertContext = createContext<AlertContextProps | undefined>(\n undefined,\n);\n\nexport interface AlertItem extends AlertProps {\n id: string;\n}\n\nexport const AlertProvider: React.FC<{ children: React.ReactNode }> = ({\n children,\n}) => {\n const [alerts, setAlerts] = useState<AlertItem[]>([]);\n const [confirmState, setConfirmState] = useState<ConfirmState | null>(null);\n\n const removeAlert = useCallback((id: string) => {\n setAlerts((prevAlerts) => prevAlerts.filter((toast) => toast.id !== id));\n }, []);\n\n const showAlert = useCallback(\n (props: Omit<AlertProps, \"onClose\">) => {\n const id = Math.random().toString(36).substring(2, 9);\n const newAlert: AlertItem = {\n ...props,\n id,\n onClose: () => removeAlert(id),\n };\n setAlerts((prevAlerts) => [...prevAlerts, newAlert]);\n },\n [removeAlert],\n );\n\n const createAlertFn = useCallback(\n (type: AlertType) => (message: string, description?: string) => {\n showAlert({ message, description, type });\n },\n [showAlert],\n );\n\n const confirm = useCallback(\n (message: string, options: ConfirmOptions = {}): Promise<boolean> => {\n return new Promise((resolve) => {\n setConfirmState({\n isOpen: true,\n message,\n options,\n resolve,\n });\n });\n },\n [],\n );\n\n const handleConfirmClose = useCallback(\n (result: boolean) => {\n if (confirmState) {\n confirmState.resolve(result);\n setConfirmState(null);\n }\n },\n [confirmState],\n );\n\n const contextValue = {\n showAlert,\n success: createAlertFn(\"success\"),\n error: createAlertFn(\"error\"),\n info: createAlertFn(\"info\"),\n warning: createAlertFn(\"warning\"),\n confirm,\n };\n\n // Set the global reference when provider mounts\n globalAlertRef = contextValue;\n\n return (\n <AlertContext.Provider value={contextValue}>\n {children}\n <div className=\"fixed right-4 top-4 z-50 space-y-2 w-full max-w-xs\">\n {alerts.map((alert, index) => (\n <div\n key={alert.id}\n style={{\n transform: `translateY(${index * 10}px)`,\n zIndex: 50 - index,\n }}\n >\n <Alert {...alert} />\n </div>\n ))}\n </div>\n {confirmState && (\n <ConfirmDialog\n isOpen={confirmState.isOpen}\n message={confirmState.message}\n onConfirm={() => handleConfirmClose(true)}\n onCancel={() => handleConfirmClose(false)}\n {...confirmState.options}\n />\n )}\n </AlertContext.Provider>\n );\n};\n\nexport const useAlert = (): AlertContextProps => {\n const context = useContext(AlertContext);\n if (context === undefined) {\n throw new Error(\"useAlert must be used within a AlertProvider\");\n }\n return context;\n};\n\n// Export a global alert function that can be used anywhere\nconst alert = {\n success: (message: string, description?: string) => {\n if (!globalAlertRef) {\n console.warn(\"AlertProvider not mounted yet\");\n return;\n }\n globalAlertRef.success(message, description);\n },\n error: (message: string, description?: string) => {\n if (!globalAlertRef) {\n console.warn(\"AlertProvider not mounted yet\");\n return;\n }\n globalAlertRef.error(message, description);\n },\n info: (message: string, description?: string) => {\n if (!globalAlertRef) {\n console.warn(\"AlertProvider not mounted yet\");\n return;\n }\n globalAlertRef.info(message, description);\n },\n warning: (message: string, description?: string) => {\n if (!globalAlertRef) {\n console.warn(\"AlertProvider not mounted yet\");\n return;\n }\n globalAlertRef.warning(message, description);\n },\n show: (props: Omit<AlertProps, \"onClose\">) => {\n if (!globalAlertRef) {\n console.warn(\"AlertProvider not mounted yet\");\n return;\n }\n globalAlertRef.showAlert(props);\n },\n confirm: async (\n message: string,\n options?: ConfirmOptions,\n ): Promise<boolean> => {\n if (!globalAlertRef) {\n console.warn(\"AlertProvider not mounted yet\");\n return false;\n }\n return globalAlertRef.confirm(message, options);\n },\n};\n\nexport default alert;\n"],"names":["globalAlertRef","AlertContext","createContext","undefined","alert","success","message","description","console","warn","error","info","warning","show","props","showAlert","confirm","options","__awaiter","_a","children","_b","useState","alerts","setAlerts","_c","confirmState","setConfirmState","removeAlert","useCallback","id","prevAlerts","filter","toast","Math","random","toString","substring","newAlert","__assign","onClose","__spreadArray","createAlertFn","type","Promise","resolve","isOpen","handleConfirmClose","result","contextValue","_jsxs","Provider","value","_jsx","className","map","index","style","transform","concat","zIndex","Alert","ConfirmDialog","onConfirm","onCancel","context","useContext","Error"],"mappings":"qOA4BIA,EAA2C,KAElCC,EAAeC,EAAAA,mBAC1BC,GA+GIC,EAAQ,CACZC,QAAS,SAACC,EAAiBC,GACpBP,EAILA,EAAeK,QAAQC,EAASC,GAH9BC,QAAQC,KAAK,gCAIjB,EACAC,MAAO,SAACJ,EAAiBC,GAClBP,EAILA,EAAeU,MAAMJ,EAASC,GAH5BC,QAAQC,KAAK,gCAIjB,EACAE,KAAM,SAACL,EAAiBC,GACjBP,EAILA,EAAeW,KAAKL,EAASC,GAH3BC,QAAQC,KAAK,gCAIjB,EACAG,QAAS,SAACN,EAAiBC,GACpBP,EAILA,EAAeY,QAAQN,EAASC,GAH9BC,QAAQC,KAAK,gCAIjB,EACAI,KAAM,SAACC,GACAd,EAILA,EAAee,UAAUD,GAHvBN,QAAQC,KAAK,gCAIjB,EACAO,QAAS,SACPV,EACAW,GAAwB,OAAAC,EAAAA,eAAA,OAAA,OAAA,GAAA,kDAExB,OAAKlB,EAIL,CAAA,EAAOA,EAAegB,QAAQV,EAASW,KAHrCT,QAAQC,KAAK,iCACb,CAAA,GAAO,MAGV,GAAA,gDArJmE,SAACU,GACrE,IAAAC,EAAQD,EAAAC,SAEFC,EAAsBC,EAAAA,SAAsB,IAA3CC,EAAMF,EAAA,GAAEG,EAASH,EAAA,GAClBI,EAAkCH,EAAAA,SAA8B,MAA/DI,EAAYD,EAAA,GAAEE,EAAeF,EAAA,GAE9BG,EAAcC,eAAY,SAACC,GAC/BN,GAAU,SAACO,GAAe,OAAAA,EAAWC,QAAO,SAACC,GAAU,OAAAA,EAAMH,KAAOA,CAAb,GAA7B,GAC5B,GAAG,IAEGf,EAAYc,eAChB,SAACf,GACC,IAAMgB,EAAKI,KAA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EAAAA,SAAA,CACZO,OAAQpB,EAAaoB,OACrBxC,QAASoB,EAAapB,QACtByD,UAAW,WAAM,OAAAhB,GAAmB,EAAnB,EACjBiB,SAAU,WAAM,OAAAjB,GAAmB,EAAnB,GACZrB,EAAaT,YAK3B,qCAEwB,WACtB,IAAMgD,EAAUC,EAAAA,WAAWjE,GAC3B,QAAgBE,IAAZ8D,EACF,MAAM,IAAIE,MAAM,gDAElB,OAAOF,CACT"}
@@ -0,0 +1,2 @@
1
+ "use strict";var e=require("react/jsx-runtime"),o=require("lucide-react");module.exports=function(s){var r=s.isOpen,n=s.message,i=s.title,t=void 0===i?"Confirm Action":i,l=s.description,c=s.confirmText,a=void 0===c?"Confirm":c,d=s.cancelText,m=void 0===d?"Cancel":d,x=s.type,u=void 0===x?"warning":x,g=s.onConfirm,f=s.onCancel;if(!r)return null;var b={success:{icon:e.jsx(o.CheckCircle,{className:"h-6 w-6"}),iconColor:"text-green-500",buttonColor:"bg-green-600 hover:bg-green-700"},error:{icon:e.jsx(o.AlertCircle,{className:"h-6 w-6"}),iconColor:"text-rose-500",buttonColor:"bg-rose-600 hover:bg-rose-700"},info:{icon:e.jsx(o.Info,{className:"h-6 w-6"}),iconColor:"text-blue-500",buttonColor:"bg-blue-600 hover:bg-blue-700"},warning:{icon:e.jsx(o.AlertTriangle,{className:"h-6 w-6"}),iconColor:"text-amber-500",buttonColor:"bg-amber-600 hover:bg-amber-700"}}[u],h=b.icon,v=b.iconColor,j=b.buttonColor;return e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[e.jsx("div",{className:"absolute inset-0 bg-black bg-opacity-50 transition-opacity",onClick:f}),e.jsxs("div",{className:"relative bg-white rounded-lg shadow-xl max-w-md w-full mx-4 transform transition-all",children:[e.jsx("div",{className:"p-6",children:e.jsxs("div",{className:"flex items-start",children:[e.jsx("div",{className:"flex-shrink-0 ".concat(v),children:h}),e.jsxs("div",{className:"ml-4 flex-1",children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:t}),e.jsxs("div",{className:"mt-2 text-sm text-gray-600",children:[e.jsx("p",{children:n}),l&&e.jsx("p",{className:"mt-2",children:l})]})]})]})}),e.jsxs("div",{className:"bg-gray-50 px-6 py-4 flex flex-col-reverse sm:flex-row sm:justify-end gap-3 rounded-b-lg",children:[e.jsx("button",{onClick:f,className:"px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-500 transition-colors",children:m}),e.jsx("button",{onClick:g,className:"px-4 py-2 text-sm font-medium text-white rounded-md focus:outline-none focus:ring-2 focus:ring-offset-2 transition-colors ".concat(j),children:a})]})]})]})};
2
+ //# sourceMappingURL=ConfirmDialog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConfirmDialog.js","sources":["../../../../src/components/Alert/ConfirmDialog.tsx"],"sourcesContent":["import React from \"react\";\nimport { AlertCircle, AlertTriangle, CheckCircle, Info } from \"lucide-react\";\nimport { AlertType } from \"./Alert\";\n\ninterface ConfirmDialogProps {\n isOpen: boolean;\n message: string;\n title?: string;\n description?: string;\n confirmText?: string;\n cancelText?: string;\n type?: AlertType;\n onConfirm: () => void;\n onCancel: () => void;\n}\n\nconst ConfirmDialog: React.FC<ConfirmDialogProps> = ({\n isOpen,\n message,\n title = \"Confirm Action\",\n description,\n confirmText = \"Confirm\",\n cancelText = \"Cancel\",\n type = \"warning\",\n onConfirm,\n onCancel,\n}) => {\n if (!isOpen) return null;\n\n const config = {\n success: {\n icon: <CheckCircle className=\"h-6 w-6\" />,\n iconColor: \"text-green-500\",\n buttonColor: \"bg-green-600 hover:bg-green-700\",\n },\n error: {\n icon: <AlertCircle className=\"h-6 w-6\" />,\n iconColor: \"text-rose-500\",\n buttonColor: \"bg-rose-600 hover:bg-rose-700\",\n },\n info: {\n icon: <Info className=\"h-6 w-6\" />,\n iconColor: \"text-blue-500\",\n buttonColor: \"bg-blue-600 hover:bg-blue-700\",\n },\n warning: {\n icon: <AlertTriangle className=\"h-6 w-6\" />,\n iconColor: \"text-amber-500\",\n buttonColor: \"bg-amber-600 hover:bg-amber-700\",\n },\n };\n\n const { icon, iconColor, buttonColor } = config[type];\n\n return (\n <div className=\"fixed inset-0 z-50 flex items-center justify-center\">\n {/* Backdrop */}\n <div\n className=\"absolute inset-0 bg-black bg-opacity-50 transition-opacity\"\n onClick={onCancel}\n />\n\n {/* Dialog */}\n <div className=\"relative bg-white rounded-lg shadow-xl max-w-md w-full mx-4 transform transition-all\">\n <div className=\"p-6\">\n <div className=\"flex items-start\">\n <div className={`flex-shrink-0 ${iconColor}`}>{icon}</div>\n <div className=\"ml-4 flex-1\">\n <h3 className=\"text-lg font-semibold text-gray-900\">{title}</h3>\n <div className=\"mt-2 text-sm text-gray-600\">\n <p>{message}</p>\n {description && <p className=\"mt-2\">{description}</p>}\n </div>\n </div>\n </div>\n </div>\n\n {/* Actions */}\n <div className=\"bg-gray-50 px-6 py-4 flex flex-col-reverse sm:flex-row sm:justify-end gap-3 rounded-b-lg\">\n <button\n onClick={onCancel}\n className=\"px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-500 transition-colors\"\n >\n {cancelText}\n </button>\n <button\n onClick={onConfirm}\n className={`px-4 py-2 text-sm font-medium text-white rounded-md focus:outline-none focus:ring-2 focus:ring-offset-2 transition-colors ${buttonColor}`}\n >\n {confirmText}\n </button>\n </div>\n </div>\n </div>\n );\n};\n\nexport default ConfirmDialog;\n"],"names":["_a","isOpen","message","_b","title","description","_c","confirmText","_d","cancelText","_e","type","onConfirm","onCancel","_f","success","icon","_jsx","CheckCircle","className","iconColor","buttonColor","error","AlertCircle","info","Info","warning","AlertTriangle","_jsxs","onClick","children","concat"],"mappings":"yFAgBoD,SAACA,GACnD,IAAAC,WACAC,YACAC,EAAAH,EAAAI,MAAAA,OAAK,IAAAD,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AAA,CAAGE,UAAU,gBAAQd,eAO7CuB,EAAAA,KAAA,MAAA,CAAKT,UAAU,2FAA0FW,SAAA,CACvGb,EAAAA,IAAA,SAAA,CACEY,QAAShB,EACTM,UAAU,oMAAmMW,SAE5MrB,IAEHQ,EAAAA,IAAA,SAAA,CACEY,QAASjB,EACTO,UAAW,6HAAAY,OAA6HV,GAAaS,SAEpJvB,YAMb"}
@@ -0,0 +1,2 @@
1
+ "use strict";require("../../node_modules/tslib/tslib.es6.js");var e=require("react/jsx-runtime"),n=require("react"),o=require("lucide-react"),t=require("../Button/Button.js");require("../Button/ExportButton.js");module.exports=function(i){var r=i.isOpen,s=i.onConfirm,l=i.onCancel,c=i.title,a=i.message,u=i.confirmText,d=void 0===u?"Confirm":u,f=i.cancelText,m=void 0===f?"Cancel":f,g=i.type,b=void 0===g?"default":g,x=i.showIcon,v=void 0===x||x,y=i.showCloseButton,h=void 0===y||y,j=i.closeOnOverlayClick,w=void 0===j||j,p=i.closeOnEscape,C=void 0===p||p,B=i.isLoading,N=void 0!==B&&B,k=i.className,E=void 0===k?"":k,q=i.overlayClassName,z=void 0===q?"":q,T=i.maxWidth,O=void 0===T?"sm":T,I=n.useRef(null),L=n.useRef(null),R=n.useRef(null);n.useEffect((function(){return r?(R.current=document.activeElement,setTimeout((function(){var e,n,o;"danger"===b?null===(n=null===(e=I.current)||void 0===e?void 0:e.querySelector("[data-cancel-button]"))||void 0===n||n.focus():null===(o=L.current)||void 0===o||o.focus()}),100),document.body.style.overflow="hidden"):(document.body.style.overflow="unset",R.current&&R.current.focus()),function(){document.body.style.overflow="unset"}}),[r,b]),n.useEffect((function(){var e=function(e){"Escape"===e.key&&C&&!N&&l()};return r&&document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}}),[r,C,l,N]);var X=function(){N||l()},A={default:{icon:o.Info,iconColor:"text-blue-600",iconBg:"bg-blue-100",confirmButton:"bg-blue-600 hover:bg-blue-700 focus:ring-blue-500"},danger:{icon:o.XCircle,iconColor:"text-red-600",iconBg:"bg-red-100",confirmButton:"bg-red-600 hover:bg-red-700 focus:ring-red-500"},warning:{icon:o.AlertTriangle,iconColor:"text-yellow-600",iconBg:"bg-yellow-100",confirmButton:"bg-yellow-600 hover:bg-yellow-700 focus:ring-yellow-500"},success:{icon:o.CheckCircle,iconColor:"text-green-600",iconBg:"bg-green-100",confirmButton:"bg-green-600 hover:bg-green-700 focus:ring-green-500"},info:{icon:o.Info,iconColor:"text-blue-600",iconBg:"bg-blue-100",confirmButton:"bg-blue-600 hover:bg-blue-700 focus:ring-blue-500"}}[b],P=A.icon;return r?e.jsxs("div",{className:"fixed inset-0 z-50 ".concat(z),role:"dialog","aria-modal":"true","aria-labelledby":c?"confirmation-title":void 0,"aria-describedby":"confirmation-message",children:[e.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm transition-opacity duration-300",onClick:function(e){e.target===e.currentTarget&&w&&!N&&l()}}),e.jsx("div",{className:"fixed inset-0 flex items-center justify-center p-4",children:e.jsxs("div",{ref:I,className:"relative w-full ".concat({sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg"}[O]," animate-in fade-in-0 zoom-in-95 slide-in-from-bottom-4 transform rounded-2xl bg-white shadow-2xl transition-all duration-300 ease-out ").concat(E," "),onClick:function(e){return e.stopPropagation()},children:[h&&e.jsx("button",{onClick:X,disabled:N,className:"absolute right-4 top-4 flex h-8 w-8 items-center justify-center rounded-full text-gray-400 transition-colors duration-200 hover:bg-gray-100 hover:text-gray-600 focus:outline-none focus:ring-2 focus:ring-gray-500 focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50","aria-label":"Close",children:e.jsx(o.X,{size:20})}),e.jsxs("div",{className:"p-6",children:[e.jsxs("div",{className:"flex flex-col items-center justify-center space-y-4",children:[v&&e.jsx("div",{className:"h-12 w-12 flex-shrink-0 rounded-full ".concat(A.iconBg," flex items-center justify-center"),children:e.jsx(P,{size:24,className:A.iconColor})}),e.jsxs("div",{className:"min-w-0 flex-1 justify-center",children:[c&&e.jsx("h3",{id:"confirmation-title",className:"mb-1 text-center text-lg font-semibold text-gray-900",children:c}),e.jsx("p",{id:"confirmation-message",className:"leading-relaxed text-gray-600",children:a})]})]}),e.jsxs("div",{className:"flex ".concat("justify-center"," mt-6 space-x-3"),children:[e.jsx(t,{variant:"neutral",outline:!0,size:"sm","data-cancel-button":"",onClick:X,disabled:N,children:m}),e.jsx("button",{ref:L,onClick:function(){N||s()},disabled:N,className:"flex min-w-[80px] items-center justify-center rounded-xl px-4 py-2 text-sm font-medium text-white transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 ".concat(A.confirmButton," "),children:N?e.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-white border-t-transparent"}):d})]})]})]})})]}):null};
2
+ //# sourceMappingURL=ConfirmationAlert.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConfirmationAlert.js","sources":["../../../../src/components/Alert/ConfirmationAlert.tsx"],"sourcesContent":["import React, { useEffect, useRef } from \"react\";\n\nimport { AlertTriangle, CheckCircle, Info, X, XCircle } from \"lucide-react\";\nimport { Button } from \"../Button\";\n\nexport type ConfirmationType = \"default\" | \"danger\" | \"warning\" | \"success\" | \"info\";\n\nexport interface ConfirmationPopupProps {\n isOpen: boolean;\n onConfirm: () => void;\n onCancel: () => void;\n title?: string;\n message?: string;\n confirmText?: string;\n cancelText?: string;\n type?: ConfirmationType;\n showIcon?: boolean;\n showCloseButton?: boolean;\n closeOnOverlayClick?: boolean;\n closeOnEscape?: boolean;\n isLoading?: boolean;\n className?: string;\n overlayClassName?: string;\n maxWidth?: \"sm\" | \"md\" | \"lg\";\n}\n\nconst ConfirmationAlert: React.FC<ConfirmationPopupProps> = ({\n isOpen,\n onConfirm,\n onCancel,\n title,\n message,\n confirmText = \"Confirm\",\n cancelText = \"Cancel\",\n type = \"default\",\n showIcon = true,\n showCloseButton = true,\n closeOnOverlayClick = true,\n closeOnEscape = true,\n isLoading = false,\n className = \"\",\n overlayClassName = \"\",\n maxWidth = \"sm\",\n}) => {\n const popupRef = useRef<HTMLDivElement>(null);\n const confirmButtonRef = useRef<HTMLButtonElement>(null);\n const previousFocusRef = useRef<HTMLElement | null>(null);\n\n useEffect(() => {\n if (isOpen) {\n // Store the previously focused element\n previousFocusRef.current = document.activeElement as HTMLElement;\n\n // Focus the confirm button for keyboard navigation\n setTimeout(() => {\n if (type === \"danger\") {\n // For danger actions, focus cancel button first for safety\n popupRef.current\n ?.querySelector<HTMLButtonElement>(\"[data-cancel-button]\")\n ?.focus();\n } else {\n confirmButtonRef.current?.focus();\n }\n }, 100);\n\n // Prevent body scroll\n document.body.style.overflow = \"hidden\";\n } else {\n // Restore body scroll\n document.body.style.overflow = \"unset\";\n\n // Restore focus to previously focused element\n if (previousFocusRef.current) {\n previousFocusRef.current.focus();\n }\n }\n\n return () => {\n document.body.style.overflow = \"unset\";\n };\n }, [isOpen, type]);\n\n useEffect(() => {\n const handleEscape = (event: KeyboardEvent) => {\n if (event.key === \"Escape\" && closeOnEscape && !isLoading) {\n onCancel();\n }\n };\n\n if (isOpen) {\n document.addEventListener(\"keydown\", handleEscape);\n }\n\n return () => {\n document.removeEventListener(\"keydown\", handleEscape);\n };\n }, [isOpen, closeOnEscape, onCancel, isLoading]);\n\n const handleOverlayClick = (event: React.MouseEvent) => {\n if (event.target === event.currentTarget && closeOnOverlayClick && !isLoading) {\n onCancel();\n }\n };\n\n const handleConfirm = () => {\n if (!isLoading) {\n onConfirm();\n }\n };\n\n const handleCancel = () => {\n if (!isLoading) {\n onCancel();\n }\n };\n\n const getTypeStyles = () => {\n const typeMap = {\n default: {\n icon: Info,\n iconColor: \"text-blue-600\",\n iconBg: \"bg-blue-100\",\n confirmButton: \"bg-blue-600 hover:bg-blue-700 focus:ring-blue-500\",\n },\n danger: {\n icon: XCircle,\n iconColor: \"text-red-600\",\n iconBg: \"bg-red-100\",\n confirmButton: \"bg-red-600 hover:bg-red-700 focus:ring-red-500\",\n },\n warning: {\n icon: AlertTriangle,\n iconColor: \"text-yellow-600\",\n iconBg: \"bg-yellow-100\",\n confirmButton: \"bg-yellow-600 hover:bg-yellow-700 focus:ring-yellow-500\",\n },\n success: {\n icon: CheckCircle,\n iconColor: \"text-green-600\",\n iconBg: \"bg-green-100\",\n confirmButton: \"bg-green-600 hover:bg-green-700 focus:ring-green-500\",\n },\n info: {\n icon: Info,\n iconColor: \"text-blue-600\",\n iconBg: \"bg-blue-100\",\n confirmButton: \"bg-blue-600 hover:bg-blue-700 focus:ring-blue-500\",\n },\n };\n return typeMap[type];\n };\n\n const getMaxWidthClass = () => {\n const widthMap = {\n sm: \"max-w-sm\",\n md: \"max-w-md\",\n lg: \"max-w-lg\",\n };\n return widthMap[maxWidth];\n };\n\n const typeStyles = getTypeStyles();\n const IconComponent = typeStyles.icon;\n\n if (!isOpen) return null;\n\n return (\n <div\n className={`fixed inset-0 z-50 ${overlayClassName}`}\n role='dialog'\n aria-modal='true'\n aria-labelledby={title ? \"confirmation-title\" : undefined}\n aria-describedby='confirmation-message'\n >\n {/* Backdrop */}\n <div\n className='fixed inset-0 bg-black/50 backdrop-blur-sm transition-opacity duration-300'\n onClick={handleOverlayClick}\n />\n\n {/* Popup Container */}\n <div className='fixed inset-0 flex items-center justify-center p-4'>\n {/* Popup Content */}\n <div\n ref={popupRef}\n className={`relative w-full ${getMaxWidthClass()} animate-in fade-in-0 zoom-in-95 slide-in-from-bottom-4 transform rounded-2xl bg-white shadow-2xl transition-all duration-300 ease-out ${className} `}\n onClick={(e) => e.stopPropagation()}\n >\n {/* Close Button */}\n {showCloseButton && (\n <button\n onClick={handleCancel}\n disabled={isLoading}\n className='absolute right-4 top-4 flex h-8 w-8 items-center justify-center rounded-full text-gray-400 transition-colors duration-200 hover:bg-gray-100 hover:text-gray-600 focus:outline-none focus:ring-2 focus:ring-gray-500 focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50'\n aria-label='Close'\n >\n <X size={20} />\n </button>\n )}\n\n {/* Content */}\n <div className='p-6'>\n <div className='flex flex-col items-center justify-center space-y-4'>\n {/* Icon */}\n {showIcon && (\n <div\n className={`h-12 w-12 flex-shrink-0 rounded-full ${typeStyles.iconBg} flex items-center justify-center`}\n >\n <IconComponent size={24} className={typeStyles.iconColor} />\n </div>\n )}\n\n {/* Text Content */}\n <div className='min-w-0 flex-1 justify-center'>\n {title && (\n <h3\n id='confirmation-title'\n className='mb-1 text-center text-lg font-semibold text-gray-900'\n >\n {title}\n </h3>\n )}\n <p\n id='confirmation-message'\n className='leading-relaxed text-gray-600'\n >\n {message}\n </p>\n </div>\n </div>\n\n {/* Action Buttons */}\n <div\n className={`flex ${showIcon ? \"justify-center\" : \"justify-center\"} mt-6 space-x-3`}\n >\n <Button\n variant='neutral'\n outline\n size='sm'\n data-cancel-button=''\n onClick={handleCancel}\n disabled={isLoading}\n >\n {cancelText}\n </Button>\n\n <button\n ref={confirmButtonRef}\n onClick={handleConfirm}\n disabled={isLoading}\n className={`flex min-w-[80px] items-center justify-center rounded-xl px-4 py-2 text-sm font-medium text-white transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 ${typeStyles.confirmButton} `}\n >\n {isLoading ? (\n <div className='h-4 w-4 animate-spin rounded-full border-2 border-white border-t-transparent' />\n ) : (\n confirmText\n )}\n </button>\n </div>\n </div>\n </div>\n </div>\n </div>\n );\n};\n\nexport default ConfirmationAlert;\n\n// Hook for easier usage\nexport const useConfirmation = () => {\n const [confirmationState, setConfirmationState] = React.useState<{\n isOpen: boolean;\n config: Partial<ConfirmationPopupProps>;\n resolve?: (value: boolean) => void;\n }>({\n isOpen: false,\n config: {},\n });\n\n const confirm = (\n config: Omit<ConfirmationPopupProps, \"isOpen\" | \"onConfirm\" | \"onCancel\">\n ): Promise<boolean> => {\n return new Promise((resolve) => {\n setConfirmationState({\n isOpen: true,\n config,\n resolve,\n });\n });\n };\n\n const handleConfirm = () => {\n setConfirmationState((prev) => ({ ...prev, isOpen: false }));\n confirmationState.resolve?.(true);\n };\n\n const handleCancel = () => {\n setConfirmationState((prev) => ({ ...prev, isOpen: false }));\n confirmationState.resolve?.(false);\n };\n\n const ConfirmationDialog = () => (\n <ConfirmationAlert\n {...confirmationState.config}\n isOpen={confirmationState.isOpen}\n onConfirm={handleConfirm}\n onCancel={handleCancel}\n />\n );\n\n return { confirm, ConfirmationDialog };\n};\n\n// Example usage component\nexport const ConfirmationExample: React.FC = () => {\n const [isOpen, setIsOpen] = React.useState(false);\n const [type, setType] = React.useState<ConfirmationType>(\"default\");\n const [isLoading, setIsLoading] = React.useState(false);\n const { confirm, ConfirmationDialog } = useConfirmation();\n\n const handleDirectConfirmation = async (confirmationType: ConfirmationType) => {\n setType(confirmationType);\n setIsOpen(true);\n };\n\n const handleHookConfirmation = async (confirmationType: ConfirmationType) => {\n const configs: Record<ConfirmationType, Partial<ConfirmationPopupProps>> = {\n default: {\n title: \"Confirm Action\",\n message: \"Are you sure you want to continue with this action?\",\n type: \"default\",\n },\n danger: {\n title: \"Delete Item\",\n message:\n \"This action cannot be undone. Are you sure you want to delete this item permanently?\",\n confirmText: \"Delete\",\n type: \"danger\",\n },\n warning: {\n title: \"Warning\",\n message: \"This action may have unintended consequences. Do you want to proceed?\",\n confirmText: \"Proceed\",\n type: \"warning\",\n },\n success: {\n title: \"Success Action\",\n message: \"Everything looks good! Would you like to save these changes?\",\n confirmText: \"Save\",\n type: \"success\",\n },\n info: {\n title: \"Information\",\n message: \"This will update your preferences. Continue?\",\n confirmText: \"Update\",\n type: \"info\",\n },\n };\n\n const result = await confirm(configs[confirmationType]);\n alert(`User ${result ? \"confirmed\" : \"cancelled\"} the action`);\n };\n\n const handleConfirm = async () => {\n setIsLoading(true);\n // Simulate API call\n await new Promise((resolve) => setTimeout(resolve, 2000));\n setIsLoading(false);\n setIsOpen(false);\n alert(\"Action confirmed!\");\n };\n\n const handleCancel = () => {\n setIsOpen(false);\n alert(\"Action cancelled!\");\n };\n\n return (\n <div className='space-y-6 p-8'>\n <div>\n <h2 className='mb-4 text-2xl font-bold text-gray-900'>\n Confirmation Popup Examples\n </h2>\n\n <div className='space-y-4'>\n <div>\n <h3 className='mb-3 text-lg font-semibold text-gray-800'>\n Direct Component Usage\n </h3>\n <div className='flex flex-wrap gap-3'>\n {(\n [\n \"default\",\n \"danger\",\n \"warning\",\n \"success\",\n \"info\",\n ] as ConfirmationType[]\n ).map((confirmationType) => (\n <button\n key={confirmationType}\n onClick={() => handleDirectConfirmation(confirmationType)}\n className={`rounded-lg px-4 py-2 font-medium capitalize text-white transition-colors duration-200 ${\n confirmationType === \"default\"\n ? \"bg-blue-600 hover:bg-blue-700\"\n : confirmationType === \"danger\"\n ? \"bg-red-600 hover:bg-red-700\"\n : confirmationType === \"warning\"\n ? \"bg-yellow-600 hover:bg-yellow-700\"\n : confirmationType === \"success\"\n ? \"bg-green-600 hover:bg-green-700\"\n : \"bg-blue-600 hover:bg-blue-700\"\n }`}\n >\n {confirmationType} Popup\n </button>\n ))}\n </div>\n </div>\n\n <div>\n <h3 className='mb-3 text-lg font-semibold text-gray-800'>\n Hook Usage (Recommended)\n </h3>\n <div className='flex flex-wrap gap-3'>\n {(\n [\n \"default\",\n \"danger\",\n \"warning\",\n \"success\",\n \"info\",\n ] as ConfirmationType[]\n ).map((confirmationType) => (\n <button\n key={`hook-${confirmationType}`}\n onClick={() => handleHookConfirmation(confirmationType)}\n className={`rounded-lg px-4 py-2 font-medium capitalize text-white transition-colors duration-200 ${\n confirmationType === \"default\"\n ? \"bg-blue-500 hover:bg-blue-600\"\n : confirmationType === \"danger\"\n ? \"bg-red-500 hover:bg-red-600\"\n : confirmationType === \"warning\"\n ? \"bg-yellow-500 hover:bg-yellow-600\"\n : confirmationType === \"success\"\n ? \"bg-green-500 hover:bg-green-600\"\n : \"bg-blue-500 hover:bg-blue-600\"\n }`}\n >\n Hook {confirmationType}\n </button>\n ))}\n </div>\n </div>\n </div>\n </div>\n\n {/* Direct Component */}\n <ConfirmationAlert\n isOpen={isOpen}\n onConfirm={handleConfirm}\n onCancel={handleCancel}\n title='Confirm Action'\n message='Are you sure you want to continue? This action cannot be undone.'\n confirmText='Yes, Continue'\n cancelText='Cancel'\n type={type}\n isLoading={isLoading}\n />\n\n {/* Hook Component */}\n <ConfirmationDialog />\n </div>\n );\n};\n"],"names":["_a","isOpen","onConfirm","onCancel","title","message","_b","confirmText","_c","cancelText","_d","type","_e","showIcon","_f","showCloseButton","_g","closeOnOverlayClick","_h","closeOnEscape","_j","isLoading","_k","className","_l","overlayClassName","_m","maxWidth","popupRef","useRef","confirmButtonRef","previousFocusRef","useEffect","current","document","activeElement","setTimeout","querySelector","focus","body","style","overflow","handleEscape","event","key","addEventListener","removeEventListener","handleCancel","typeStyles","default","icon","Info","iconColor","iconBg","confirmButton","danger","XCircle","warning","AlertTriangle","success","CheckCircle","info","IconComponent","_jsxs","concat","role","undefined","children","_jsx","onClick","target","currentTarget","ref","sm","md","lg","e","stopPropagation","disabled","X","size","id","Button","variant","outline"],"mappings":"mOA0B4D,SAACA,GACzD,IAAAC,WACAC,cACAC,aACAC,UACAC,YACAC,EAAAN,EAAAO,YAAAA,OAAW,IAAAD,EAAG,UAASA,EACvBE,EAAAR,EAAAS,WAAAA,OAAU,IAAAD,EAAG,WACbE,EAAAV,EAAAW,KAAAA,OAAI,IAAAD,EAAG,UAASA,EAChBE,aAAAC,cAAeD,EACfE,EAAAd,EAAAe,gBAAAA,OAAe,IAAAD,GAAOA,EACtBE,wBAAAC,cAA0BD,EAC1BE,EAAAlB,EAAAmB,cAAAA,OAAa,IAAAD,KACbE,EAAApB,EAAAqB,UAAAA,OAAS,IAAAD,GAAQA,EACjBE,cAAAC,aAAY,GAAED,EACdE,EAAAxB,EAAAyB,iBAAAA,OAAgB,IAAAD,EAAG,KACnBE,EAAA1B,EAAA2B,SAAAA,OAAQ,IAAAD,EAAG,KAAIA,EAETE,EAAWC,EAAAA,OAAuB,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AM,CACHC,QAAQ,UACRC,SAAO,EACPJ,KAAK,KAAI,qBACU,GACnBX,QAAStB,EACT+B,SAAUzD,EAAS8C,SAElB1D,IAGL2D,EAAAA,IAAA,SAAA,CACII,IAAK1C,EACLuC,QAhJN,WACbhD,GACDnB,GAER,EA6I4B4E,SAAUzD,EACVE,UAAW,wOAAAyC,OAAwOhB,EAAWM,cAAa,KAAGa,SAE7Q9C,EACG+C,EAAAA,IAAA,MAAA,CAAK7C,UAAU,iFAAiF,kBAzF5G,IAoGxB"}
@@ -0,0 +1,2 @@
1
+ "use strict";var e=require("react/jsx-runtime");module.exports=function(r){var t=r.children,n=r.variant,o=void 0===n?"default":n,i=r.size,l=void 0===i?"md":i,a=r.className,s=void 0===a?"":a,d=r.onClick,g=["inline-flex items-center font-medium rounded-full transition-colors duration-200",{default:"bg-gray-100 text-gray-800 hover:bg-gray-200",secondary:"bg-blue-100 text-blue-800 hover:bg-blue-200",success:"bg-green-100 text-green-800 hover:bg-green-200",warning:"bg-yellow-100 text-yellow-800 hover:bg-yellow-200",error:"bg-red-100 text-red-800 hover:bg-red-200",info:"bg-cyan-100 text-cyan-800 hover:bg-cyan-200"}[o],{sm:"px-2 py-0.5 text-xs",md:"px-2.5 py-1 text-sm",lg:"px-3 py-1.5 text-base"}[l],d?"cursor-pointer":"",s].filter(Boolean).join(" ");return e.jsx("span",{className:g,onClick:d,role:d?"button":void 0,tabIndex:d?0:void 0,onKeyDown:d?function(e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),d())}:void 0,children:t})};
2
+ //# sourceMappingURL=Badge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Badge.js","sources":["../../../../src/components/Badge/Badge.tsx"],"sourcesContent":["import React from \"react\";\n\nexport type BadgeVariant = \"default\" | \"secondary\" | \"success\" | \"warning\" | \"error\" | \"info\";\nexport interface BadgeProps {\n children: React.ReactNode;\n variant?: BadgeVariant;\n size?: \"sm\" | \"md\" | \"lg\";\n className?: string;\n onClick?: () => void;\n}\n\nconst Badge: React.FC<BadgeProps> = ({\n children,\n variant = \"default\",\n size = \"md\",\n className = \"\",\n onClick,\n}) => {\n const baseClasses =\n \"inline-flex items-center font-medium rounded-full transition-colors duration-200\";\n\n const variantClasses = {\n default: \"bg-gray-100 text-gray-800 hover:bg-gray-200\",\n secondary: \"bg-blue-100 text-blue-800 hover:bg-blue-200\",\n success: \"bg-green-100 text-green-800 hover:bg-green-200\",\n warning: \"bg-yellow-100 text-yellow-800 hover:bg-yellow-200\",\n error: \"bg-red-100 text-red-800 hover:bg-red-200\",\n info: \"bg-cyan-100 text-cyan-800 hover:bg-cyan-200\",\n };\n\n const sizeClasses = {\n sm: \"px-2 py-0.5 text-xs\",\n md: \"px-2.5 py-1 text-sm\",\n lg: \"px-3 py-1.5 text-base\",\n };\n\n const classes = [\n baseClasses,\n variantClasses[variant],\n sizeClasses[size],\n onClick ? \"cursor-pointer\" : \"\",\n className,\n ]\n .filter(Boolean)\n .join(\" \");\n\n return (\n <span\n className={classes}\n onClick={onClick}\n role={onClick ? \"button\" : undefined}\n tabIndex={onClick ? 0 : undefined}\n onKeyDown={\n onClick\n ? (e) => {\n if (e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n onClick();\n }\n }\n : undefined\n }\n >\n {children}\n </span>\n );\n};\n\nexport default Badge;\n"],"names":["_a","children","_b","variant","_c","size","_d","className","onClick","classes","default","secondary","success","warning","error","info","sm","md","lg","filter","Boolean","join","_jsx","role","undefined","tabIndex","onKeyDown","e","key","preventDefault"],"mappings":"+DAWoC,SAACA,OACjCC,EAAQD,EAAAC,SACRC,EAAAF,EAAAG,QAAAA,aAAU,UAASD,EACnBE,EAAAJ,EAAAK,KAAAA,aAAO,KAAID,EACXE,EAAAN,EAAAO,UAAAA,aAAY,GAAED,EACdE,EAAOR,EAAAQ,QAoBDC,EAAU,CAjBZ,mFAEmB,CACnBC,QAAS,8CACTC,UAAW,8CACXC,QAAS,iDACTC,QAAS,oDACTC,MAAO,2CACPC,KAAM,+CAWSZ,GARC,CAChBa,GAAI,sBACJC,GAAI,sBACJC,GAAI,yBAMQb,GACZG,EAAU,iBAAmB,GAC7BD,GAECY,OAAOC,SACPC,KAAK,KAEV,OACIC,EAAAA,IAAA,OAAA,CACIf,UAAWE,EACXD,QAASA,EACTe,KAAMf,EAAU,cAAWgB,EAC3BC,SAAUjB,EAAU,OAAIgB,EACxBE,UACIlB,EACM,SAACmB,GACiB,UAAVA,EAAEC,KAA6B,MAAVD,EAAEC,MACvBD,EAAEE,iBACFrB,IAER,OACAgB,EAASvB,SAGlBA,GAGb"}
@@ -0,0 +1,2 @@
1
+ "use strict";var e=require("react/jsx-runtime"),r=require("lucide-react");module.exports=function(s){var a=s.items,i=void 0===a?[]:a,t=s.onBackClick,c=s.showBackButton,n=void 0===c||c,o=s.separator,l=void 0===o?" / ":o,x=s.className,d=void 0===x?"":x;return e.jsxs("div",{className:"flex gap-2 ".concat(d),children:[n&&e.jsx("div",{onClick:t,className:"cursor-pointer",children:e.jsx(r.ChevronLeft,{className:"text-gray-500 transition-colors hover:text-gray-700"})}),e.jsx("p",{className:"text-gray-400",children:i.map((function(r,s){return e.jsxs("span",{children:[r.isActive?e.jsx("span",{className:"text-primary",children:r.label}):e.jsx("span",{className:r.onClick?"cursor-pointer transition-colors hover:text-gray-600":"",onClick:r.onClick,children:r.label}),s<i.length-1&&l]},s)}))})]})};
2
+ //# sourceMappingURL=Breadcrumb.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Breadcrumb.js","sources":["../../../../src/components/Breadcrumb/Breadcrumb.tsx"],"sourcesContent":["import React, { FC } from \"react\";\n\nimport { ChevronLeft } from \"lucide-react\";\n\nexport type BreadcrumbItem = {\n label: string;\n href?: string;\n isActive?: boolean;\n onClick?: () => void;\n};\n\nexport interface BreadcrumbProps {\n items: BreadcrumbItem[];\n showBackButton?: boolean;\n onBackClick?: () => void;\n separator?: string;\n backButtonLabel?: string;\n className?: string;\n}\n\nconst Breadcrumb: FC<BreadcrumbProps> = ({\n items = [],\n onBackClick,\n showBackButton = true,\n separator = \" / \",\n className = \"\",\n}) => {\n return (\n <div className={`flex gap-2 ${className}`}>\n {showBackButton && (\n <div onClick={onBackClick} className='cursor-pointer'>\n <ChevronLeft className='text-gray-500 transition-colors hover:text-gray-700' />\n </div>\n )}\n <p className='text-gray-400'>\n {items.map((item, index) => (\n <span key={index}>\n {item.isActive ? (\n <span className='text-primary'>{item.label}</span>\n ) : (\n <span\n className={\n item.onClick\n ? \"cursor-pointer transition-colors hover:text-gray-600\"\n : \"\"\n }\n onClick={item.onClick}\n >\n {item.label}\n </span>\n )}\n {index < items.length - 1 && separator}\n </span>\n ))}\n </p>\n </div>\n );\n};\n\nexport default Breadcrumb;\n"],"names":["_a","_b","items","onBackClick","_c","showBackButton","_d","separator","_e","className","_jsxs","children","_jsx","onClick","ChevronLeft","map","item","index","isActive","label","length"],"mappings":"yFAoBwC,SAACA,GACrC,IAAAC,EAAAD,EAAAE,MAAAA,OAAK,IAAAD,EAAG,GAAEA,EACVE,EAAWH,EAAAG,YACXC,EAAAJ,EAAAK,eAAAA,OAAc,IAAAD,GAAOA,EACrBE,EAAAN,EAAAO,UAAAA,OAAS,IAAAD,EAAG,MAAKA,EACjBE,EAAAR,EAAAS,UAAAA,OAAS,IAAAD,EAAG,GAAEA,EAEd,OACIE,EAAAA,KAAA,MAAA,CAAKD,UAAW,qBAAcA,GAAWE,SAAA,CACpCN,GACGO,EAAAA,IAAA,MAAA,CAAKC,QAASV,EAAaM,UAAU,iBAAgBE,SACjDC,EAAAA,IAACE,EAAAA,YAAW,CAACL,UAAU,0DAG/BG,EAAAA,IAAA,IAAA,CAAGH,UAAU,gBAAeE,SACvBT,EAAMa,KAAI,SAACC,EAAMC,GAAU,OACxBP,EAAAA,KAAA,OAAA,CAAAC,SAAA,CACKK,EAAKE,SACFN,EAAAA,IAAA,OAAA,CAAMH,UAAU,eAAcE,SAAEK,EAAKG,QAErCP,EAAAA,IAAA,OAAA,CACIH,UACIO,EAAKH,QACC,uDACA,GAEVA,QAASG,EAAKH,QAAOF,SAEpBK,EAAKG,QAGbF,EAAQf,EAAMkB,OAAS,GAAKb,IAftBU,EADa,QAsB5C"}
@@ -0,0 +1,2 @@
1
+ "use strict";var r=require("react/jsx-runtime"),e=require("../../_virtual/index.js");module.exports=function(t){var o=t.children,i=t.onClick,a=t.type,d=void 0===a?"button":a,s=t.size,n=void 0===s?"md":s,l=t.variant,b=void 0===l?"primary":l,h=t.disabled,g=void 0!==h&&h,x=t.className,y=t.icon,m=t.loading,c=void 0!==m&&m,p=t.outline,v=void 0!==p&&p,u=t.iconPosition,w=void 0===u?"left":u,f=e("animate-spin -ml-1 mr-3",{"h-4 w-4":"xs"===n||"sm"===n,"h-5 w-5":"md"===n,"h-6 w-6":"lg"===n},"primary"===b?"text-white":"text-primary"),j=e("rounded-xl text-sm transition-all font-semibold duration-300 inline-flex items-center justify-center ease-in-out",{xs:"px-3 py-1 text-sm",sm:"px-5 py-2 text-sm",md:"px-6 py-3 text-md",lg:"px-8 py-4 text-lg"}[n],{primary:{solid:"bg-primary text-white hover:bg-primary-700 border border-primary",outline:"bg-transparent text-primary hover:bg-primary hover:text-white border border-primary"},secondary:{solid:"bg-secondary text-white hover:bg-white hover:text-secondary border border-secondary",outline:"bg-transparent text-secondary hover:bg-secondary hover:text-white border border-secondary"},dark:{solid:"bg-dark text-white hover:bg-primary hover:border-primary border border-dark",outline:"bg-transparent text-dark hover:bg-dark hover:text-white border border-dark"},neutral:{solid:"bg-white text-gray-700 hover:bg-gray-300 hover:text-white border border-gray-300",outline:"bg-transparent text-gray-700 hover:bg-gray-200 border border-gray-300"},danger:{solid:"bg-red-600 text-white hover:bg-red-200 hover:text-white border border-red-300",outline:"bg-transparent text-red-600 hover:bg-red-200 border border-red-300"},default:{solid:"bg-white text-gray-700 hover:bg-gray-300 hover:text-white border border-gray-300",outline:"bg-transparent text-gray-700 hover:bg-gray-200 border border-gray-300"}}[b][v?"outline":"solid"],g?"opacity-50 cursor-not-allowed":"hover:shadow-lg",x,{"flex-row-reverse":"right"===w}),k="left"===w?"mr-2":"ml-2";return r.jsx("button",{type:d,onClick:i,disabled:g,className:j,children:c?r.jsxs(r.Fragment,{children:[r.jsxs("svg",{className:f,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[r.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),r.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),o]}):r.jsxs(r.Fragment,{children:[y&&r.jsx("span",{className:k,children:y}),o]})})};
2
+ //# sourceMappingURL=Button.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Button.js","sources":["../../../../src/components/Button/Button.tsx"],"sourcesContent":["import { FC, ReactNode } from \"react\";\nimport classNames from \"classnames\";\n\nexport interface ButtonProps {\n /** The content of the button */\n children: ReactNode;\n\n /** Click handler function */\n onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;\n\n /** HTML button type attribute */\n type?: \"button\" | \"submit\" | \"reset\";\n\n /** Size of the button */\n size?: \"xs\" | \"sm\" | \"md\" | \"lg\";\n\n /** Visual style variant */\n variant?: \"primary\" | \"secondary\" | \"dark\" | \"neutral\" | \"danger\" | \"default\";\n\n /** Disabled state of the button */\n disabled?: boolean;\n\n /** Additional CSS classes */\n className?: string;\n\n /** Optional icon to display before text */\n icon?: ReactNode;\n\n /** Loading state - shows spinner */\n loading?: boolean;\n\n /** Outline style instead of solid */\n outline?: boolean;\n\n /** Position of the icon relative to text */\n iconPosition?: \"left\" | \"right\";\n}\n\nconst Button: FC<ButtonProps> = ({\n children,\n onClick,\n type = \"button\",\n size = \"md\",\n variant = \"primary\",\n disabled = false,\n className,\n icon,\n loading = false,\n outline = false,\n iconPosition = \"left\",\n}) => {\n const baseClasses =\n \"rounded-xl text-sm transition-all font-semibold duration-300 inline-flex items-center justify-center ease-in-out\";\n const sizeClasses = {\n xs: \"px-3 py-1 text-sm\",\n sm: \"px-5 py-2 text-sm\",\n md: \"px-6 py-3 text-md\",\n lg: \"px-8 py-4 text-lg\",\n };\n\n const variantClasses = {\n primary: {\n solid: \"bg-primary text-white hover:bg-primary-700 border border-primary\",\n outline:\n \"bg-transparent text-primary hover:bg-primary hover:text-white border border-primary\",\n },\n secondary: {\n solid:\n \"bg-secondary text-white hover:bg-white hover:text-secondary border border-secondary\",\n outline:\n \"bg-transparent text-secondary hover:bg-secondary hover:text-white border border-secondary\",\n },\n dark: {\n solid:\n \"bg-dark text-white hover:bg-primary hover:border-primary border border-dark\",\n outline:\n \"bg-transparent text-dark hover:bg-dark hover:text-white border border-dark\",\n },\n neutral: {\n solid:\n \"bg-white text-gray-700 hover:bg-gray-300 hover:text-white border border-gray-300\",\n outline:\n \"bg-transparent text-gray-700 hover:bg-gray-200 border border-gray-300\",\n },\n danger: {\n solid:\n \"bg-red-600 text-white hover:bg-red-200 hover:text-white border border-red-300\",\n outline:\n \"bg-transparent text-red-600 hover:bg-red-200 border border-red-300\",\n },\n default: {\n solid:\n \"bg-white text-gray-700 hover:bg-gray-300 hover:text-white border border-gray-300\",\n outline:\n \"bg-transparent text-gray-700 hover:bg-gray-200 border border-gray-300\",\n },\n };\n\n const spinnerClasses = classNames(\n \"animate-spin -ml-1 mr-3\",\n {\n \"h-4 w-4\": size === \"xs\" || size === \"sm\",\n \"h-5 w-5\": size === \"md\",\n \"h-6 w-6\": size === \"lg\",\n },\n variant === \"primary\" ? \"text-white\" : \"text-primary\",\n );\n\n const classes = classNames(\n baseClasses,\n sizeClasses[size],\n variantClasses[variant][outline ? \"outline\" : \"solid\"],\n disabled ? \"opacity-50 cursor-not-allowed\" : \"hover:shadow-lg\",\n className,\n {\n \"flex-row-reverse\": iconPosition === \"right\",\n },\n );\n\n const iconSpacingClass = iconPosition === \"left\" ? \"mr-2\" : \"ml-2\";\n\n return (\n <button\n type={type}\n onClick={onClick}\n disabled={disabled}\n className={classes}\n >\n {loading ? (\n <>\n <svg\n className={spinnerClasses}\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n >\n <circle\n className=\"opacity-25\"\n cx=\"12\"\n cy=\"12\"\n r=\"10\"\n stroke=\"currentColor\"\n strokeWidth=\"4\"\n ></circle>\n <path\n className=\"opacity-75\"\n fill=\"currentColor\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"\n ></path>\n </svg>\n {children}\n </>\n ) : (\n <>\n {icon && <span className={iconSpacingClass}>{icon}</span>}\n {children}\n </>\n )}\n </button>\n );\n};\n\n/**\n * A customizable button component with multiple variants, sizes, and states.\n *\n * @example\n * <Button\n * variant=\"primary\"\n * size=\"large\"\n * onClick={() => console.log('Clicked!')}\n * >\n * Click Me\n * </Button>\n *\n * @param {ButtonProps} props - The component props\n * @returns {JSX.Element} A styled button element\n */\nexport default Button;\n"],"names":["_a","children","onClick","_b","type","_c","size","_d","variant","_e","disabled","className","icon","_f","loading","_g","outline","_h","iconPosition","spinnerClasses","classNames","classes","xs","sm","md","lg","primary","solid","secondary","dark","neutral","danger","default","iconSpacingClass","_jsx","_jsxs","_Fragment","xmlns","fill","viewBox","cx","cy","r","stroke","strokeWidth","d"],"mappings":"oGAsCgC,SAACA,OAC/BC,EAAQD,EAAAC,SACRC,EAAOF,EAAAE,QACPC,EAAAH,EAAAI,KAAAA,OAAI,IAAAD,EAAG,SAAQA,EACfE,EAAAL,EAAAM,KAAAA,OAAI,IAAAD,EAAG,KAAIA,EACXE,EAAAP,EAAAQ,QAAAA,OAAO,IAAAD,EAAG,UAASA,EACnBE,EAAAT,EAAAU,SAAAA,cAAgBD,EAChBE,EAASX,EAAAW,UACTC,EAAIZ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AA,CAAMvB,UAAWsB,EAAgBhC,SAAGW,IAC5CX,MAKX"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("react/jsx-runtime"),r=require("react"),n=require("lucide-react");exports.ExportFormatEnum=void 0,(e=exports.ExportFormatEnum||(exports.ExportFormatEnum={}))[e.PDF=0]="PDF",e[e.CSV=1]="CSV",e[e.EXCEL=2]="EXCEL",e[e.JSON=3]="JSON",exports.default=function(){var e=r.useState(!1),o=e[0],s=e[1],a=r.useRef(null),i=function(e){s(!1)};return r.useEffect((function(){var e=function(e){a.current&&!a.current.contains(e.target)&&s(!1)};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}}),[]),t.jsxs("div",{className:"relative inline-block",ref:a,children:[t.jsxs("div",{className:"flex",children:[t.jsxs("button",{className:"flex items-center rounded-l-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none",onClick:function(){return i(exports.ExportFormatEnum.PDF)},children:[t.jsx(n.Download,{className:"mr-2 h-4 w-4"}),"Export"]}),t.jsx("button",{className:"rounded-r-md border border-l-0 border-gray-300 bg-white px-2 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none",onClick:function(){s(!o)},children:t.jsx(n.ChevronDown,{className:"h-4 w-4"})})]}),o&&t.jsx("div",{className:"absolute right-0 z-10 mt-1 w-48 origin-top-right rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none",children:t.jsxs("div",{className:"py-1",children:[t.jsxs("button",{onClick:function(){return i(exports.ExportFormatEnum.PDF)},className:"flex w-full items-center px-4 py-2 text-left text-sm text-gray-700 hover:bg-gray-100",children:[t.jsx(n.FileText,{className:"mr-2 h-4 w-4"}),"PDF Document"]}),t.jsxs("button",{onClick:function(){return i(exports.ExportFormatEnum.CSV)},className:"flex w-full items-center px-4 py-2 text-left text-sm text-gray-700 hover:bg-gray-100",children:[t.jsx(n.FileSpreadsheet,{className:"mr-2 h-4 w-4"}),"CSV Spreadsheet"]}),t.jsxs("button",{onClick:function(){return i(exports.ExportFormatEnum.EXCEL)},className:"flex w-full items-center px-4 py-2 text-left text-sm text-gray-700 hover:bg-gray-100",children:[t.jsx(n.FileSpreadsheet,{className:"mr-2 h-4 w-4"}),"Excel Spreadsheet"]})]})})]})};
2
+ //# sourceMappingURL=ExportButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExportButton.js","sources":["../../../../src/components/Button/ExportButton.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from \"react\";\n\nimport { ChevronDown, Download, FileSpreadsheet, FileText } from \"lucide-react\";\n\nexport enum ExportFormatEnum {\n PDF,\n CSV,\n EXCEL,\n JSON,\n}\nexport default function ExportButton() {\n const [isOpen, setIsOpen] = useState(false);\n const dropdownRef = useRef<HTMLDivElement>(null);\n\n const toggleDropdown = () => {\n setIsOpen(!isOpen);\n };\n\n const handleExport = (format: ExportFormatEnum) => {\n setIsOpen(false);\n };\n\n // Close dropdown when clicking outside\n useEffect(() => {\n const handleClickOutside = (event: MouseEvent) => {\n if (dropdownRef.current && !dropdownRef.current.contains(event.target as Node)) {\n setIsOpen(false);\n }\n };\n\n document.addEventListener(\"mousedown\", handleClickOutside);\n return () => {\n document.removeEventListener(\"mousedown\", handleClickOutside);\n };\n }, []);\n\n return (\n <div className='relative inline-block' ref={dropdownRef}>\n <div className='flex'>\n <button\n className='flex items-center rounded-l-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none'\n onClick={() => handleExport(ExportFormatEnum.PDF)}\n >\n <Download className='mr-2 h-4 w-4' />\n Export\n </button>\n <button\n className='rounded-r-md border border-l-0 border-gray-300 bg-white px-2 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none'\n onClick={toggleDropdown}\n >\n <ChevronDown className='h-4 w-4' />\n </button>\n </div>\n\n {isOpen && (\n <div className='absolute right-0 z-10 mt-1 w-48 origin-top-right rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none'>\n <div className='py-1'>\n <button\n onClick={() => handleExport(ExportFormatEnum.PDF)}\n className='flex w-full items-center px-4 py-2 text-left text-sm text-gray-700 hover:bg-gray-100'\n >\n <FileText className='mr-2 h-4 w-4' />\n PDF Document\n </button>\n <button\n onClick={() => handleExport(ExportFormatEnum.CSV)}\n className='flex w-full items-center px-4 py-2 text-left text-sm text-gray-700 hover:bg-gray-100'\n >\n <FileSpreadsheet className='mr-2 h-4 w-4' />\n CSV Spreadsheet\n </button>\n <button\n onClick={() => handleExport(ExportFormatEnum.EXCEL)}\n className='flex w-full items-center px-4 py-2 text-left text-sm text-gray-700 hover:bg-gray-100'\n >\n <FileSpreadsheet className='mr-2 h-4 w-4' />\n Excel Spreadsheet\n </button>\n {/*<button*/}\n {/* onClick={() => handleExport(ExportFormatEnum.JSON)}*/}\n {/* className=\"flex items-center px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 w-full text-left\"*/}\n {/*>*/}\n {/* <File className=\"w-4 h-4 mr-2\" />*/}\n {/* JSON File*/}\n {/*</button>*/}\n </div>\n </div>\n )}\n </div>\n );\n}\n"],"names":["ExportFormatEnum","_a","useState","isOpen","setIsOpen","dropdownRef","useRef","handleExport","format","useEffect","handleClickOutside","event","current","contains","target","document","addEventListener","removeEventListener","_jsxs","className","ref","children","onClick","PDF","_jsx","Download","ChevronDown","FileText","CSV","FileSpreadsheet","EXCEL"],"mappings":"wEAIYA,8EAAAA,QAAAA,sBAAAA,GAAAA,EAAAA,QAAAA,mBAAAA,yBAAgB,CAAA,IACxBA,EAAA,IAAA,GAAA,MACAA,EAAAA,EAAA,IAAA,GAAA,MACAA,EAAAA,EAAA,MAAA,GAAA,QACAA,EAAAA,EAAA,KAAA,GAAA,uBAEU,WACJ,IAAAC,EAAsBC,EAAAA,UAAS,GAA9BC,EAAMF,EAAA,GAAEG,EAASH,EAAA,GAClBI,EAAcC,EAAAA,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 @@
1
+ "use strict";var n=require("react/jsx-runtime");module.exports=function(e){var r=e.children,o=e.className,t=void 0===o?"":o,a=e.glass,l=void 0!==a&&a,i="".concat("\n w-full\n rounded-2xl\n shadow-xl\n transition-all\n duration-300\n ease-out\n hover:-translate-y-0.5\n p-5\n relative\n z-0\n "," ").concat(l?"\n backdrop-blur-xl\n bg-white/20\n border\n border-white/30\n shadow-lg\n hover:shadow-xl\n hover:bg-white/30\n before:absolute\n before:inset-0\n before:rounded-2xl\n before:bg-gradient-to-br\n before:from-white/10\n before:to-transparent\n before:pointer-events-none\n ":"\n backdrop-blur-2xl\n bg-white\n "," ").concat(t);return n.jsx("div",{className:i,children:r})};
2
+ //# sourceMappingURL=Card.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Card.js","sources":["../../../../src/components/Cards/Card.tsx"],"sourcesContent":["import { ReactNode } from \"react\";\n\ninterface CardProps {\n children: ReactNode;\n className?: string;\n glass?: boolean;\n}\n\nconst Card = ({ children, className = \"\", glass = false }: CardProps) => {\n const baseClasses = `\n w-full\n rounded-2xl\n shadow-xl\n transition-all\n duration-300\n ease-out\n hover:-translate-y-0.5\n p-5\n relative\n z-0\n `;\n\n const glassClasses = `\n backdrop-blur-xl\n bg-white/20\n border\n border-white/30\n shadow-lg\n hover:shadow-xl\n hover:bg-white/30\n before:absolute\n before:inset-0\n before:rounded-2xl\n before:bg-gradient-to-br\n before:from-white/10\n before:to-transparent\n before:pointer-events-none\n `;\n\n const solidClasses = `\n backdrop-blur-2xl\n bg-white\n `;\n\n const combinedClasses = `${baseClasses} ${glass ? glassClasses : solidClasses} ${className}`;\n\n return (\n <div className={combinedClasses}>\n {children}\n </div>\n );\n};\n\nexport default Card;\n"],"names":["_a","children","_b","className","_c","glass","combinedClasses","concat","_jsx"],"mappings":"+DAQa,SAACA,GAAE,IAAAC,EAAQD,EAAAC,SAAEC,EAAAF,EAAAG,UAAAA,OAAS,IAAAD,EAAG,GAAEA,EAAEE,EAAAJ,EAAAK,MAAAA,OAAK,IAAAD,GAAQA,EAoC7CE,EAAkB,GAAAC,OAnCJ,6MAmCkB,KAAAA,OAAIF,EAtBrB,wXAiBA,sDAKwD,KAAAE,OAAIJ,GAEjF,OACIK,EAAAA,WAAKL,UAAWG,EAAeL,SAC1BA,GAGb"}
@@ -0,0 +1,2 @@
1
+ "use strict";var e=require("react/jsx-runtime"),t=require("../Button/Button.js");require("../Button/ExportButton.js"),module.exports=function(i){var r=i.title,s=void 0===r?"No Record Found":r,c=i.onClick,n=i.btnText,a=i.description,l=void 0===a?"":a,o=i.className,d=void 0===o?"":o,x=i.icon;return e.jsx("div",{className:"my-2 flex min-h-[320px] w-full flex-col items-center justify-center rounded-lg bg-gray-50 p-8 text-center ".concat(d," "),"aria-live":"polite",children:e.jsxs("div",{className:"max-w-md space-y-4",children:[x&&e.jsx("div",{className:"mx-auto h-16 w-16 text-gray-300",children:x}),e.jsx("h2",{className:"text-xl font-medium text-gray-900",children:s}),l&&e.jsx("p",{className:"text-gray-500",children:l}),n&&c&&e.jsx("div",{className:"mt-6",children:e.jsx(t,{onClick:c,size:"md",children:n})})]})})};
2
+ //# sourceMappingURL=EmptyStateCard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EmptyStateCard.js","sources":["../../../../src/components/Cards/EmptyStateCard.tsx"],"sourcesContent":["import { ReactNode } from \"react\";\nimport {Button} from \"../Button\";\n\nexport interface EmptyStateProps {\n title?: string;\n description?: string;\n btnText?: string;\n onClick?: () => void;\n icon?: ReactNode;\n className?: string;\n}\nexport default function EmptyStateCard({\n title = \"No Record Found\",\n onClick,\n btnText,\n description = \"\",\n className = \"\",\n icon,\n}: EmptyStateProps) {\n return (\n <div\n className={`my-2 flex min-h-[320px] w-full flex-col items-center justify-center rounded-lg bg-gray-50 p-8 text-center ${className} `}\n aria-live='polite' // For screen readers\n >\n <div className={`max-w-md space-y-4`}>\n {icon && <div className='mx-auto h-16 w-16 text-gray-300'>{icon}</div>}\n\n <h2 className='text-xl font-medium text-gray-900'>{title}</h2>\n\n {description && <p className='text-gray-500'>{description}</p>}\n\n {btnText && onClick && (\n <div className='mt-6'>\n <Button onClick={onClick} size='md'>\n {btnText}\n </Button>\n </div>\n )}\n </div>\n </div>\n );\n}\n"],"names":["_a","_b","title","onClick","btnText","_c","description","_d","className","icon","_jsx","concat","children","_jsxs","Button","size"],"mappings":"qIAWc,SAAyBA,OACnCC,EAAAD,EAAAE,MAAAA,OAAK,IAAAD,EAAG,kBAAiBA,EACzBE,EAAOH,EAAAG,QACPC,EAAOJ,EAAAI,QACPC,EAAAL,EAAAM,YAAAA,OAAW,IAAAD,EAAG,GAAEA,EAChBE,EAAAP,EAAAQ,UAAAA,OAAS,IAAAD,EAAG,GAAEA,EACdE,EAAIT,EAAAS,KAEJ,OACIC,EAAAA,IAAA,MAAA,CACIF,UAAW,6GAAAG,OAA6GH,EAAS,KAAG,YAC1H,SAEVI,SAAAC,EAAAA,KAAA,MAAA,CAAKL,UAAW,qBAAoBI,SAAA,CAC/BH,GAAQC,EAAAA,IAAA,MAAA,CAAKF,UAAU,kCAAiCI,SAAEH,IAE3DC,EAAAA,IAAA,KAAA,CAAIF,UAAU,oCAAmCI,SAAEV,IAElDI,GAAeI,EAAAA,IAAA,IAAA,CAAGF,UAAU,gBAAeI,SAAEN,IAE7CF,GAAWD,GACRO,EAAAA,IAAA,MAAA,CAAKF,UAAU,OAAMI,SACjBF,MAACI,EAAM,CAACX,QAASA,EAASY,KAAK,KAAIH,SAC9BR,UAO7B"}
@@ -0,0 +1,2 @@
1
+ "use strict";var e=require("react/jsx-runtime"),t=require("react"),s=require("lucide-react");module.exports=function(r){var a=r.file,i=r.onDelete,l=r.onUpdate,o=r.onView,n=r.onDownload,d=r.showActions,c=void 0===d||d,x=r.showDelete,u=void 0===x||x,h=r.showUpdate,m=void 0===h||h,g=r.showView,p=void 0===g||g,v=r.showDownload,f=void 0!==v&&v,j=r.layout,b=void 0===j?"grid":j,y=r.maxPreviewSize,w=void 0===y?200:y,N=r.className,z=void 0===N?"":N,k=t.useState(!1),D=k[0],P=k[1],M=function(e){if(0===e)return"0 Bytes";var t=Math.floor(Math.log(e)/Math.log(1024));return parseFloat((e/Math.pow(1024,t)).toFixed(2))+" "+["Bytes","KB","MB","GB"][t]},C=function(e){return e.startsWith("image/")?s.FileImage:e.startsWith("video/")?s.Video:e.startsWith("audio/")?s.Music:"application/pdf"===e?s.FileText:e.includes("zip")||e.includes("rar")?s.Archive:s.File},F=function(t){var r=t.url||(t.file?URL.createObjectURL(t.file):null);if(!r){var a=C(t.type);return e.jsx(a,{size:32,className:"text-gray-400"})}if(t.type.startsWith("image/"))return e.jsx("img",{src:r,alt:t.name,className:"w-full h-full object-cover",style:{maxWidth:w,maxHeight:w}});if("application/pdf"===t.type)return e.jsx("div",{className:"w-full h-full flex items-center justify-center bg-red-50",children:e.jsxs("div",{className:"text-center",children:[e.jsx(s.FileText,{size:32,className:"text-red-600 mx-auto mb-1"}),e.jsx("span",{className:"text-xs text-red-600 font-medium",children:"PDF"})]})});var i=C(t.type);return e.jsx("div",{className:"w-full h-full flex items-center justify-center bg-gray-50",children:e.jsx(i,{size:32,className:"text-gray-400"})})};return a?"list"===b?e.jsx("div",{className:"".concat(z),children:e.jsxs("div",{className:"flex items-center p-3 bg-white border border-gray-200 rounded-lg shadow-sm hover:shadow-md transition-shadow",onMouseEnter:function(){return P(!0)},onMouseLeave:function(){return P(!1)},children:[e.jsx("div",{className:"flex-shrink-0 w-12 h-12 rounded-lg overflow-hidden bg-gray-100 mr-3",children:F(a)}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-medium text-gray-900 truncate",children:a.name}),e.jsx("p",{className:"text-xs text-gray-500",children:M(a.size)}),void 0!==a.uploadProgress&&a.uploadProgress<100&&e.jsxs("div",{className:"mt-2",children:[e.jsx("div",{className:"h-1.5 w-full rounded-full bg-gray-200",children:e.jsx("div",{className:"h-1.5 rounded-full bg-blue-600 transition-all duration-300",style:{width:"".concat(a.uploadProgress,"%")}})}),e.jsxs("p",{className:"text-xs text-gray-500 mt-1",children:[a.uploadProgress,"%"]})]})]}),c&&(D||void 0===a.uploadProgress)&&e.jsxs("div",{className:"flex items-center space-x-2",children:[p&&o&&e.jsx("button",{onClick:o,className:"p-2 text-gray-400 hover:text-blue-600 hover:bg-blue-50 rounded-full transition-colors",title:"View",children:e.jsx(s.Eye,{size:16})}),f&&n&&e.jsx("button",{onClick:n,className:"p-2 text-gray-400 hover:text-green-600 hover:bg-green-50 rounded-full transition-colors",title:"Download",children:e.jsx(s.Download,{size:16})}),m&&l&&e.jsx("button",{onClick:l,className:"p-2 text-gray-400 hover:text-amber-600 hover:bg-amber-50 rounded-full transition-colors",title:"Update",children:e.jsx(s.Edit3,{size:16})}),u&&i&&e.jsx("button",{onClick:i,className:"p-2 text-gray-400 hover:text-red-600 hover:bg-red-50 rounded-full transition-colors",title:"Delete",children:e.jsx(s.Trash2,{size:16})})]})]})}):e.jsx("div",{className:"flex justify-center ".concat(z),children:e.jsxs("div",{className:"group relative bg-white border border-gray-200 rounded-lg shadow-sm hover:shadow-md transition-shadow overflow-hidden max-w-xs",onMouseEnter:function(){return P(!0)},onMouseLeave:function(){return P(!1)},children:[e.jsxs("div",{className:"aspect-square w-full bg-gray-50 overflow-hidden",children:[F(a),void 0!==a.uploadProgress&&a.uploadProgress<100&&e.jsx("div",{className:"absolute inset-0 bg-black bg-opacity-50 flex items-center justify-center",children:e.jsxs("div",{className:"text-center text-white",children:[e.jsx("div",{className:"w-16 h-16 rounded-full border-4 border-white border-t-transparent animate-spin mb-2"}),e.jsxs("p",{className:"text-sm",children:[a.uploadProgress,"%"]})]})}),c&&(D||void 0===a.uploadProgress)&&e.jsx("div",{className:"absolute inset-0 bg-black bg-opacity-40 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center",children:e.jsxs("div",{className:"flex space-x-2",children:[p&&o&&e.jsx("button",{onClick:o,className:"p-2 bg-white bg-opacity-90 hover:bg-opacity-100 text-gray-700 rounded-full transition-all",title:"View",children:e.jsx(s.Eye,{size:16})}),f&&n&&e.jsx("button",{onClick:n,className:"p-2 bg-white bg-opacity-90 hover:bg-opacity-100 text-gray-700 rounded-full transition-all",title:"Download",children:e.jsx(s.Download,{size:16})}),m&&l&&e.jsx("button",{onClick:l,className:"p-2 bg-white bg-opacity-90 hover:bg-opacity-100 text-gray-700 rounded-full transition-all",title:"Update",children:e.jsx(s.Edit3,{size:16})}),u&&i&&e.jsx("button",{onClick:i,className:"p-2 bg-white bg-opacity-90 hover:bg-opacity-100 text-red-600 rounded-full transition-all",title:"Delete",children:e.jsx(s.Trash2,{size:16})})]})})]}),e.jsxs("div",{className:"p-3",children:[e.jsx("p",{className:"text-sm font-medium text-gray-900 truncate",title:a.name,children:a.name}),e.jsx("p",{className:"text-xs text-gray-500",children:M(a.size)})]})]})}):e.jsxs("div",{className:"text-center py-8 text-gray-500 ".concat(z),children:[e.jsx(s.File,{size:48,className:"mx-auto mb-2 text-gray-300"}),e.jsx("p",{children:"No file to display"})]})};
2
+ //# sourceMappingURL=FileView.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileView.js","sources":["../../../../src/components/Document/FileView.tsx"],"sourcesContent":["import React, { useState } from \"react\";\nimport {\n File,\n Edit3,\n Trash2,\n Eye,\n Download,\n FileText,\n FileImage,\n Video,\n Music,\n Archive,\n} from \"lucide-react\";\nimport FileUpload from \"../Form/FileUpload/FileUpload\";\n\n// Types\nexport interface FileItem {\n id?: string;\n name: string;\n size: number;\n type: string;\n url?: string;\n file?: File;\n uploadProgress?: number;\n}\n\nexport interface FileViewProps {\n file: FileItem | null;\n onDelete?: () => void;\n onUpdate?: () => void;\n onView?: () => void;\n onDownload?: () => void;\n showActions?: boolean;\n showDelete?: boolean;\n showUpdate?: boolean;\n showView?: boolean;\n showDownload?: boolean;\n layout?: \"grid\" | \"list\";\n maxPreviewSize?: number;\n className?: string;\n}\n\nconst FileView: React.FC<FileViewProps> = ({\n file,\n onDelete,\n onUpdate,\n onView,\n onDownload,\n showActions = true,\n showDelete = true,\n showUpdate = true,\n showView = true,\n showDownload = false,\n layout = \"grid\",\n maxPreviewSize = 200,\n className = \"\"\n }) => {\n const [isHovered, setIsHovered] = useState(false);\n\n const formatFileSize = (bytes: number) => {\n if (bytes === 0) return '0 Bytes';\n const k = 1024;\n const sizes = ['Bytes', 'KB', 'MB', 'GB'];\n const i = Math.floor(Math.log(bytes) / Math.log(k));\n return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i];\n };\n\n const getFileIcon = (fileType: string) => {\n if (fileType.startsWith('image/')) return FileImage;\n if (fileType.startsWith('video/')) return Video;\n if (fileType.startsWith('audio/')) return Music;\n if (fileType === 'application/pdf') return FileText;\n if (fileType.includes('zip') || fileType.includes('rar')) return Archive;\n return File;\n };\n\n const getFilePreview = (file: FileItem) => {\n const previewUrl = file.url || (file.file ? URL.createObjectURL(file.file) : null);\n\n if (!previewUrl) {\n const IconComponent = getFileIcon(file.type);\n return <IconComponent size={32} className=\"text-gray-400\" />;\n }\n\n if (file.type.startsWith('image/')) {\n return (\n <img\n src={previewUrl}\n alt={file.name}\n className=\"w-full h-full object-cover\"\n style={{ maxWidth: maxPreviewSize, maxHeight: maxPreviewSize }}\n />\n );\n }\n\n if (file.type === 'application/pdf') {\n return (\n <div className=\"w-full h-full flex items-center justify-center bg-red-50\">\n <div className=\"text-center\">\n <FileText size={32} className=\"text-red-600 mx-auto mb-1\" />\n <span className=\"text-xs text-red-600 font-medium\">PDF</span>\n </div>\n </div>\n );\n }\n\n const IconComponent = getFileIcon(file.type);\n return (\n <div className=\"w-full h-full flex items-center justify-center bg-gray-50\">\n <IconComponent size={32} className=\"text-gray-400\" />\n </div>\n );\n };\n\n if (!file) {\n return (\n <div className={`text-center py-8 text-gray-500 ${className}`}>\n <File size={48} className=\"mx-auto mb-2 text-gray-300\" />\n <p>No file to display</p>\n </div>\n );\n }\n\n if (layout === \"list\") {\n return (\n <div className={`${className}`}>\n <div\n className=\"flex items-center p-3 bg-white border border-gray-200 rounded-lg shadow-sm hover:shadow-md transition-shadow\"\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n >\n <div className=\"flex-shrink-0 w-12 h-12 rounded-lg overflow-hidden bg-gray-100 mr-3\">\n {getFilePreview(file)}\n </div>\n\n <div className=\"flex-1 min-w-0\">\n <p className=\"text-sm font-medium text-gray-900 truncate\">{file.name}</p>\n <p className=\"text-xs text-gray-500\">{formatFileSize(file.size)}</p>\n\n {/* Upload Progress */}\n {file.uploadProgress !== undefined && file.uploadProgress < 100 && (\n <div className=\"mt-2\">\n <div className=\"h-1.5 w-full rounded-full bg-gray-200\">\n <div\n className=\"h-1.5 rounded-full bg-blue-600 transition-all duration-300\"\n style={{ width: `${file.uploadProgress}%` }}\n />\n </div>\n <p className=\"text-xs text-gray-500 mt-1\">{file.uploadProgress}%</p>\n </div>\n )}\n </div>\n\n {/* Actions */}\n {showActions && (isHovered || file.uploadProgress === undefined) && (\n <div className=\"flex items-center space-x-2\">\n {showView && onView && (\n <button\n onClick={onView}\n className=\"p-2 text-gray-400 hover:text-blue-600 hover:bg-blue-50 rounded-full transition-colors\"\n title=\"View\"\n >\n <Eye size={16} />\n </button>\n )}\n {showDownload && onDownload && (\n <button\n onClick={onDownload}\n className=\"p-2 text-gray-400 hover:text-green-600 hover:bg-green-50 rounded-full transition-colors\"\n title=\"Download\"\n >\n <Download size={16} />\n </button>\n )}\n {showUpdate && onUpdate && (\n <button\n onClick={onUpdate}\n className=\"p-2 text-gray-400 hover:text-amber-600 hover:bg-amber-50 rounded-full transition-colors\"\n title=\"Update\"\n >\n <Edit3 size={16} />\n </button>\n )}\n {showDelete && onDelete && (\n <button\n onClick={onDelete}\n className=\"p-2 text-gray-400 hover:text-red-600 hover:bg-red-50 rounded-full transition-colors\"\n title=\"Delete\"\n >\n <Trash2 size={16} />\n </button>\n )}\n </div>\n )}\n </div>\n </div>\n );\n }\n\n // Grid Layout (Single File)\n return (\n <div className={`flex justify-center ${className}`}>\n <div\n className=\"group relative bg-white border border-gray-200 rounded-lg shadow-sm hover:shadow-md transition-shadow overflow-hidden max-w-xs\"\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n >\n {/* File Preview */}\n <div className=\"aspect-square w-full bg-gray-50 overflow-hidden\">\n {getFilePreview(file)}\n\n {/* Upload Progress Overlay */}\n {file.uploadProgress !== undefined && file.uploadProgress < 100 && (\n <div className=\"absolute inset-0 bg-black bg-opacity-50 flex items-center justify-center\">\n <div className=\"text-center text-white\">\n <div className=\"w-16 h-16 rounded-full border-4 border-white border-t-transparent animate-spin mb-2\"></div>\n <p className=\"text-sm\">{file.uploadProgress}%</p>\n </div>\n </div>\n )}\n\n {/* Actions Overlay */}\n {showActions && (isHovered || file.uploadProgress === undefined) && (\n <div className=\"absolute inset-0 bg-black bg-opacity-40 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center\">\n <div className=\"flex space-x-2\">\n {showView && onView && (\n <button\n onClick={onView}\n className=\"p-2 bg-white bg-opacity-90 hover:bg-opacity-100 text-gray-700 rounded-full transition-all\"\n title=\"View\"\n >\n <Eye size={16} />\n </button>\n )}\n {showDownload && onDownload && (\n <button\n onClick={onDownload}\n className=\"p-2 bg-white bg-opacity-90 hover:bg-opacity-100 text-gray-700 rounded-full transition-all\"\n title=\"Download\"\n >\n <Download size={16} />\n </button>\n )}\n {showUpdate && onUpdate && (\n <button\n onClick={onUpdate}\n className=\"p-2 bg-white bg-opacity-90 hover:bg-opacity-100 text-gray-700 rounded-full transition-all\"\n title=\"Update\"\n >\n <Edit3 size={16} />\n </button>\n )}\n {showDelete && onDelete && (\n <button\n onClick={onDelete}\n className=\"p-2 bg-white bg-opacity-90 hover:bg-opacity-100 text-red-600 rounded-full transition-all\"\n title=\"Delete\"\n >\n <Trash2 size={16} />\n </button>\n )}\n </div>\n </div>\n )}\n </div>\n\n {/* File Info */}\n <div className=\"p-3\">\n <p className=\"text-sm font-medium text-gray-900 truncate\" title={file.name}>\n {file.name}\n </p>\n <p className=\"text-xs text-gray-500\">{formatFileSize(file.size)}</p>\n </div>\n </div>\n </div>\n );\n};\n\nexport default FileView;"],"names":["_a","file","onDelete","onUpdate","onView","onDownload","_b","showActions","_c","showDelete","_d","showUpdate","_e","showView","_f","showDownload","_g","layout","_h","maxPreviewSize","_j","className","_k","useState","isHovered","setIsHovered","formatFileSize","bytes","i","Math","floor","log","parseFloat","pow","toFixed","getFileIcon","fileType","startsWith","FileImage","Video","Music","FileText","includes","Archive","File","getFilePreview","previewUrl","url","URL","createObjectURL","IconComponent_1","type","_jsx","size","src","alt","name","style","maxWidth","maxHeight","children","_jsxs","IconComponent","concat","onMouseEnter","onMouseLeave","undefined","uploadProgress","width","onClick","title","Eye","Download","Edit3","Trash2"],"mappings":"4GA0C0C,SAACA,GACI,IAAAC,EAAID,EAAAC,KACJC,EAAQF,EAAAE,SACRC,EAAQH,EAAAG,SACRC,EAAMJ,EAAAI,OACNC,EAAUL,EAAAK,WACVC,EAAAN,EAAAO,YAAAA,OAAW,IAAAD,GAAOA,EAClBE,EAAAR,EAAAS,WAAAA,OAAU,IAAAD,GAAOA,EACjBE,EAAAV,EAAAW,WAAAA,cAAiBD,EACjBE,EAAAZ,EAAAa,SAAAA,OAAQ,IAAAD,KACRE,EAAAd,EAAAe,aAAAA,OAAY,IAAAD,GAAQA,EACpBE,WAAAC,OAAM,IAAAD,EAAG,OAAMA,EACfE,EAAAlB,EAAAmB,eAAAA,OAAc,IAAAD,EAAG,IAAGA,EACpBE,EAAApB,EAAAqB,UAAAA,OAAS,IAAAD,EAAG,GAAEA,EAEnDE,EAA4BC,EAAAA,UAAS,GAApCC,EAASF,EAAA,GAAEG,EAAYH,EAAA,GAExBI,EAAiB,SAACC,GACpB,GAAc,IAAVA,EAAa,MAAO,UACxB,IAEMC,EAAIC,KAAKC,MAAMD,KAAKE,IAAIJ,GAASE,KAAKE,IAF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,EAAAA,MAAK,CAACpB,KAAM,OAGpB5C,GAAcP,GACXkD,EAAAA,IAAA,SAAA,CACIiB,QAASnE,EACTmB,UAAU,2FACViD,MAAM,SAAQV,SAEdR,MAACsB,EAAAA,OAAM,CAACrB,KAAM,eAStCQ,EAAAA,KAAA,MAAA,CAAKxC,UAAU,MAAKuC,SAAA,CAChBR,MAAA,IAAA,CAAG/B,UAAU,6CAA6CiD,MAAOrE,EAAKuD,KAAII,SACrE3D,EAAKuD,OAEVJ,EAAAA,IAAA,IAAA,CAAG/B,UAAU,wBAAuBuC,SAAElC,EAAezB,EAAKoD,gBA3JlEQ,cAAKxC,UAAW,yCAAkCA,GAAWuC,SAAA,CACzDR,EAAAA,IAACR,EAAAA,KAAI,CAACS,KAAM,GAAIhC,UAAU,+BAC1B+B,EAAAA,IAAA,IAAA,CAAAQ,SAAA,yBA8JhB"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../node_modules/tslib/tslib.es6.js"),a=require("react/jsx-runtime"),t=require("react"),s=function(e){var s=e.variant,l=void 0===s?"check":s,r=e.size,i=void 0===r?"md":r,n=e.checked,c=void 0!==n&&n,o=e.disabled,d=void 0!==o&&o,m=e.onChange,x=e.label,h=e.labelPosition,u=void 0===h?"right":h,g=e.name,v=e.value,p=e.id,b=e.className,j=void 0===b?"":b,f=e.error,N=e.helpText,w=e.required,y=void 0!==w&&w,k=e.indeterminate,C=void 0!==k&&k,z=t.useState(c),_=z[0],S=z[1],q=t.useState(C),M=q[0],D=q[1];t.useEffect((function(){S(c)}),[c]),t.useEffect((function(){D(C)}),[C]);var R=function(){if(!d){var e=!_;S(e),D(!1),null==m||m(e)}},B={sm:{container:"h-4 w-4",toggle:"w-7 h-4",toggleCircle:"h-3 w-3",text:"text-sm"},md:{container:"h-5 w-5",toggle:"w-9 h-5",toggleCircle:"h-4 w-4",text:"text-base"},lg:{container:"h-6 w-6",toggle:"w-12 h-6",toggleCircle:"h-5 w-5",text:"text-lg"}},L=p||"checkbox-".concat(Math.random().toString(36).substr(2,9));return a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-start gap-2 ".concat(j),children:[x&&"left"===u&&a.jsxs("label",{htmlFor:L,className:"".concat(B[i].text," ").concat(d?"text-gray-400":f?"text-red-600":"text-gray-700"," cursor-pointer select-none"),children:[x,y&&a.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),a.jsxs("div",{className:"flex flex-col",children:["toggle"===l?a.jsxs("div",{className:"relative rounded-full transition-colors duration-200 ".concat(B[i].toggle," ").concat(_?"bg-primary":"bg-gray-300"," ").concat(d?"cursor-not-allowed opacity-50":"cursor-pointer","\n ").concat(f?"ring-2 ring-red-300":""),onClick:R,children:[a.jsx("div",{className:"absolute top-0.5 transform rounded-full bg-white shadow-sm transition-transform duration-200 ".concat(B[i].toggleCircle," ").concat(_?"translate-x-full":"translate-x-0.5")}),a.jsx("input",{type:"checkbox",id:L,name:g,value:v,checked:_,onChange:R,disabled:d,className:"sr-only",required:y})]}):a.jsxs("div",{className:"relative",children:[a.jsx("input",{type:"dot"===l?"radio":"checkbox",id:L,name:g,value:v,checked:_,onChange:R,disabled:d,required:y,className:"sr-only"}),a.jsxs("div",{className:"".concat(B[i].container," ").concat("check"===l?"rounded-md":"rounded-full"," flex items-center justify-center border-2 transition-all duration-200 ").concat(_||M?"border-primary bg-primary":f?"border-red-300 bg-red-50":"border-gray-300 bg-white hover:border-gray-400"," ").concat(d?"cursor-not-allowed opacity-50":"cursor-pointer","\n focus-within:ring-2 focus-within:ring-primary focus-within:ring-offset-2"),onClick:R,children:[_&&"check"===l&&a.jsx("svg",{className:"h-3 w-3 text-white",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}),M&&"check"===l&&a.jsx("div",{className:"h-0.5 w-2.5 bg-white rounded-full"}),_&&"dot"===l&&a.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-white"})]})]}),f&&a.jsxs("p",{className:"mt-1 text-xs text-red-600 flex items-center",children:[a.jsx("svg",{className:"w-3 h-3 mr-1",fill:"currentColor",viewBox:"0 0 20 20",children:a.jsx("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z",clipRule:"evenodd"})}),f]})]}),x&&"right"===u&&a.jsxs("label",{htmlFor:L,className:"".concat(B[i].text," ").concat(d?"text-gray-400":f?"text-red-600":"text-gray-700"," cursor-pointer select-none"),children:[x,y&&a.jsx("span",{className:"text-red-500 ml-1",children:"*"})]})]}),N&&!f&&a.jsx("p",{className:"mt-1 text-xs text-gray-500",children:N})]})},l=function(e){var t=e.name,l=e.value,r=e.onChange,i=e.options,n=e.size,c=void 0===n?"md":n,o=e.className,d=void 0===o?"":o,m=e.error,x=e.helpText,h=e.required,u=void 0!==h&&h,g=e.label,v=e.direction,p=void 0===v?"vertical":v;return a.jsxs("div",{className:"space-y-2 ".concat(d),children:[g&&a.jsxs("label",{className:"block text-sm font-medium text-gray-700",children:[g,u&&a.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),a.jsx("div",{className:"flex ".concat("horizontal"===p?"flex-row gap-6":"flex-col gap-2"),children:i.map((function(e){return a.jsx(s,{variant:"dot",size:c,name:t,value:e.value,checked:l===e.value,onChange:function(){return a=e.value,void(null==r||r(a));var a},label:e.label,disabled:e.disabled,error:m,required:u},e.value)}))}),m&&a.jsxs("p",{className:"text-xs text-red-600 flex items-center",children:[a.jsx("svg",{className:"w-3 h-3 mr-1",fill:"currentColor",viewBox:"0 0 20 20",children:a.jsx("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z",clipRule:"evenodd"})}),m]}),x&&!m&&a.jsx("p",{className:"text-xs text-gray-500",children:x})]})};exports.CheckBoxDemo=function(){var r=t.useState("option1"),i=r[0],n=r[1],c=t.useState({terms:!1,newsletter:!0,notifications:!1}),o=c[0],d=c[1];return a.jsx("div",{className:"min-h-screen bg-gray-50 p-8",children:a.jsx("div",{className:"mx-auto max-w-2xl space-y-8",children:a.jsxs("div",{className:"rounded-lg bg-white p-6 shadow",children:[a.jsx("h2",{className:"mb-6 text-xl font-semibold",children:"CheckBox Component Demo"}),a.jsxs("div",{className:"space-y-8",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsx("h3",{className:"font-medium",children:"Check Variant"}),a.jsxs("div",{className:"flex flex-wrap items-center gap-6",children:[a.jsx(s,{variant:"check",size:"sm",label:"Small"}),a.jsx(s,{variant:"check",size:"md",checked:!0,label:"Medium"}),a.jsx(s,{variant:"check",size:"lg",label:"Large"}),a.jsx(s,{variant:"check",disabled:!0,label:"Disabled"}),a.jsx(s,{variant:"check",indeterminate:!0,label:"Indeterminate"})]})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsx("h3",{className:"font-medium",children:"Radio Group (Dot Variant)"}),a.jsx(l,{name:"demo-radio",value:i,onChange:n,label:"Choose an option",options:[{value:"option1",label:"Option 1"},{value:"option2",label:"Option 2"},{value:"option3",label:"Option 3"},{value:"option4",label:"Option 4 (Disabled)",disabled:!0}],helpText:"Select one option from the list"})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsx("h3",{className:"font-medium",children:"Toggle Variant"}),a.jsxs("div",{className:"flex flex-wrap items-center gap-6",children:[a.jsx(s,{variant:"toggle",size:"sm",label:"Small"}),a.jsx(s,{variant:"toggle",size:"md",checked:!0,label:"Medium"}),a.jsx(s,{variant:"toggle",size:"lg",label:"Large"}),a.jsx(s,{variant:"toggle",disabled:!0,label:"Disabled"})]})]}),a.jsxs("div",{className:"space-y-4 border-t pt-6",children:[a.jsx("h3",{className:"font-medium",children:"Sample Form"}),a.jsxs("div",{className:"space-y-4",children:[a.jsx(s,{variant:"check",checked:o.terms,onChange:function(a){return d(e.__assign(e.__assign({},o),{terms:a}))},label:"I accept the terms and conditions",required:!0,error:o.terms?"":"Please accept terms to continue"}),a.jsx(s,{variant:"toggle",checked:o.newsletter,onChange:function(a){return d(e.__assign(e.__assign({},o),{newsletter:a}))},label:"Subscribe to newsletter",helpText:"Get updates about new features and releases"}),a.jsx(s,{variant:"check",checked:o.notifications,onChange:function(a){return d(e.__assign(e.__assign({},o),{notifications:a}))},label:"Enable push notifications"}),a.jsx("div",{className:"pt-4",children:a.jsx("button",{className:"rounded-md bg-primary px-4 py-2 text-white transition-colors hover:bg-primary/90 disabled:opacity-50",disabled:!o.terms,children:"Submit"})})]})]})]})]})})})},exports.RadioGroup=l,exports.default=s;
2
+ //# sourceMappingURL=CheckBox.js.map