@sikka/hawa 0.26.30 → 0.26.32

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 (216) hide show
  1. package/dist/{Toast-pOd4uGZz.d.ts → Toast-YaClwi7z.d.ts} +9 -1
  2. package/dist/{Toast-VBd4UvlM.d.mts → Toast-ySvjL_-K.d.mts} +9 -1
  3. package/dist/accordion/index.mjs +7 -4
  4. package/dist/accordion/index.mjs.map +1 -1
  5. package/dist/alert/index.js +4 -4
  6. package/dist/alert/index.js.map +1 -1
  7. package/dist/alert/index.mjs +11 -8
  8. package/dist/alert/index.mjs.map +1 -1
  9. package/dist/appLayout/index.js +2 -1
  10. package/dist/appLayout/index.js.map +1 -1
  11. package/dist/appLayout/index.mjs +9 -5
  12. package/dist/appLayout/index.mjs.map +1 -1
  13. package/dist/appMenubar/index.mjs +9 -4
  14. package/dist/appMenubar/index.mjs.map +1 -1
  15. package/dist/appTabs/index.mjs +9 -4
  16. package/dist/appTabs/index.mjs.map +1 -1
  17. package/dist/appTopbar/index.mjs +9 -4
  18. package/dist/appTopbar/index.mjs.map +1 -1
  19. package/dist/avatar/index.js +2 -1
  20. package/dist/avatar/index.js.map +1 -1
  21. package/dist/avatar/index.mjs +9 -5
  22. package/dist/avatar/index.mjs.map +1 -1
  23. package/dist/backToTop/index.js +6 -3
  24. package/dist/backToTop/index.js.map +1 -1
  25. package/dist/backToTop/index.mjs +13 -7
  26. package/dist/backToTop/index.mjs.map +1 -1
  27. package/dist/badge/index.js +4 -3
  28. package/dist/badge/index.js.map +1 -1
  29. package/dist/badge/index.mjs +13 -7
  30. package/dist/badge/index.mjs.map +1 -1
  31. package/dist/button/index.mjs +7 -4
  32. package/dist/button/index.mjs.map +1 -1
  33. package/dist/card/index.mjs +9 -4
  34. package/dist/card/index.mjs.map +1 -1
  35. package/dist/carousel/index.js +10 -10
  36. package/dist/carousel/index.js.map +1 -1
  37. package/dist/carousel/index.mjs +19 -14
  38. package/dist/carousel/index.mjs.map +1 -1
  39. package/dist/checkbox/index.mjs +9 -4
  40. package/dist/checkbox/index.mjs.map +1 -1
  41. package/dist/chip/index.mjs +9 -4
  42. package/dist/chip/index.mjs.map +1 -1
  43. package/dist/chunk-A3ERTYS4.mjs +29 -0
  44. package/dist/codeBlock/index.mjs +83 -23
  45. package/dist/codeBlock/index.mjs.map +1 -1
  46. package/dist/collapsible/index.mjs +0 -2
  47. package/dist/collapsible/index.mjs.map +1 -1
  48. package/dist/colorPicker/index.js +2 -1
  49. package/dist/colorPicker/index.js.map +1 -1
  50. package/dist/colorPicker/index.mjs +92 -20
  51. package/dist/colorPicker/index.mjs.map +1 -1
  52. package/dist/combobox/index.js +4 -3
  53. package/dist/combobox/index.js.map +1 -1
  54. package/dist/combobox/index.mjs +445 -27
  55. package/dist/combobox/index.mjs.map +1 -1
  56. package/dist/command/index.mjs +429 -11
  57. package/dist/command/index.mjs.map +1 -1
  58. package/dist/dataTable/index.js +36 -27
  59. package/dist/dataTable/index.js.map +1 -1
  60. package/dist/dataTable/index.mjs +43 -31
  61. package/dist/dataTable/index.mjs.map +1 -1
  62. package/dist/destroyableCard/index.js +2 -2
  63. package/dist/destroyableCard/index.js.map +1 -1
  64. package/dist/destroyableCard/index.mjs +9 -6
  65. package/dist/destroyableCard/index.mjs.map +1 -1
  66. package/dist/dialog/index.mjs +9 -4
  67. package/dist/dialog/index.mjs.map +1 -1
  68. package/dist/docsLayout/index.js +2 -2
  69. package/dist/docsLayout/index.js.map +1 -1
  70. package/dist/docsLayout/index.mjs +9 -6
  71. package/dist/docsLayout/index.mjs.map +1 -1
  72. package/dist/docsSidebar/index.js +2 -2
  73. package/dist/docsSidebar/index.js.map +1 -1
  74. package/dist/docsSidebar/index.mjs +11 -6
  75. package/dist/docsSidebar/index.mjs.map +1 -1
  76. package/dist/dropdownMenu/index.mjs +9 -4
  77. package/dist/dropdownMenu/index.mjs.map +1 -1
  78. package/dist/elements/index.d.mts +4 -2
  79. package/dist/elements/index.d.ts +4 -2
  80. package/dist/elements/index.js +7 -134
  81. package/dist/elements/index.mjs +9 -13
  82. package/dist/fileDropzone/index.js +12 -11
  83. package/dist/fileDropzone/index.js.map +1 -1
  84. package/dist/fileDropzone/index.mjs +21 -17
  85. package/dist/fileDropzone/index.mjs.map +1 -1
  86. package/dist/fileUploader/index.js +2 -1
  87. package/dist/fileUploader/index.js.map +1 -1
  88. package/dist/fileUploader/index.mjs +2 -1
  89. package/dist/fileUploader/index.mjs.map +1 -1
  90. package/dist/glow/index.js +24 -17
  91. package/dist/glow/index.js.map +1 -1
  92. package/dist/glow/index.mjs +24 -17
  93. package/dist/glow/index.mjs.map +1 -1
  94. package/dist/hooks/index.d.mts +9 -18
  95. package/dist/hooks/index.d.ts +9 -18
  96. package/dist/hooks/index.mjs +146 -27
  97. package/dist/index.d.mts +18 -17
  98. package/dist/index.d.ts +18 -17
  99. package/dist/index.js +166 -171
  100. package/dist/index.mjs +588 -593
  101. package/dist/input/index.js +3 -2
  102. package/dist/input/index.js.map +1 -1
  103. package/dist/input/index.mjs +118 -19
  104. package/dist/input/index.mjs.map +1 -1
  105. package/dist/interfaceSettings/index.js +6 -4
  106. package/dist/interfaceSettings/index.js.map +1 -1
  107. package/dist/interfaceSettings/index.mjs +130 -28
  108. package/dist/interfaceSettings/index.mjs.map +1 -1
  109. package/dist/label/index.mjs +7 -4
  110. package/dist/label/index.mjs.map +1 -1
  111. package/dist/loading/index.mjs +9 -4
  112. package/dist/loading/index.mjs.map +1 -1
  113. package/dist/navbar/index.js +3 -2
  114. package/dist/navbar/index.js.map +1 -1
  115. package/dist/navbar/index.mjs +10 -6
  116. package/dist/navbar/index.mjs.map +1 -1
  117. package/dist/navigationMenu/index.mjs +9 -4
  118. package/dist/navigationMenu/index.mjs.map +1 -1
  119. package/dist/pagination/index.mjs +9 -4
  120. package/dist/pagination/index.mjs.map +1 -1
  121. package/dist/passwordInput/index.js +3 -2
  122. package/dist/passwordInput/index.js.map +1 -1
  123. package/dist/passwordInput/index.mjs +12 -6
  124. package/dist/passwordInput/index.mjs.map +1 -1
  125. package/dist/phoneInput/index.js +10 -5
  126. package/dist/phoneInput/index.js.map +1 -1
  127. package/dist/phoneInput/index.mjs +19 -11
  128. package/dist/phoneInput/index.mjs.map +1 -1
  129. package/dist/pinInput/index.js +3 -3
  130. package/dist/pinInput/index.js.map +1 -1
  131. package/dist/pinInput/index.mjs +12 -7
  132. package/dist/pinInput/index.mjs.map +1 -1
  133. package/dist/popover/index.mjs +9 -4
  134. package/dist/popover/index.mjs.map +1 -1
  135. package/dist/progress/index.mjs +9 -4
  136. package/dist/progress/index.mjs.map +1 -1
  137. package/dist/progressCircle/index.js +2 -2
  138. package/dist/progressCircle/index.js.map +1 -1
  139. package/dist/progressCircle/index.mjs +11 -6
  140. package/dist/progressCircle/index.mjs.map +1 -1
  141. package/dist/radio/index.js +6 -4
  142. package/dist/radio/index.js.map +1 -1
  143. package/dist/radio/index.mjs +13 -8
  144. package/dist/radio/index.mjs.map +1 -1
  145. package/dist/scrollArea/index.mjs +9 -4
  146. package/dist/scrollArea/index.mjs.map +1 -1
  147. package/dist/scrollIndicator/index.js +2 -1
  148. package/dist/scrollIndicator/index.js.map +1 -1
  149. package/dist/scrollIndicator/index.mjs +2 -1
  150. package/dist/scrollIndicator/index.mjs.map +1 -1
  151. package/dist/select/index.js +6 -2
  152. package/dist/select/index.js.map +1 -1
  153. package/dist/select/index.mjs +15 -8
  154. package/dist/select/index.mjs.map +1 -1
  155. package/dist/separator/index.mjs +9 -4
  156. package/dist/separator/index.mjs.map +1 -1
  157. package/dist/sheet/index.mjs +9 -4
  158. package/dist/sheet/index.mjs.map +1 -1
  159. package/dist/sidebar/index.mjs +9 -4
  160. package/dist/sidebar/index.mjs.map +1 -1
  161. package/dist/signature/index.js +31 -11
  162. package/dist/signature/index.js.map +1 -1
  163. package/dist/signature/index.mjs +40 -15
  164. package/dist/signature/index.mjs.map +1 -1
  165. package/dist/simpleTable/index.js +18 -14
  166. package/dist/simpleTable/index.js.map +1 -1
  167. package/dist/simpleTable/index.mjs +25 -18
  168. package/dist/simpleTable/index.mjs.map +1 -1
  169. package/dist/skeleton/index.mjs +9 -4
  170. package/dist/skeleton/index.mjs.map +1 -1
  171. package/dist/slider/index.mjs +9 -4
  172. package/dist/slider/index.mjs.map +1 -1
  173. package/dist/sortButton/index.mjs +268 -11
  174. package/dist/sortButton/index.mjs.map +1 -1
  175. package/dist/splitButton/index.mjs +267 -12
  176. package/dist/splitButton/index.mjs.map +1 -1
  177. package/dist/switch/index.js +2 -1
  178. package/dist/switch/index.js.map +1 -1
  179. package/dist/switch/index.mjs +11 -5
  180. package/dist/switch/index.mjs.map +1 -1
  181. package/dist/table/index.mjs +9 -4
  182. package/dist/table/index.mjs.map +1 -1
  183. package/dist/tabs/index.mjs +7 -4
  184. package/dist/tabs/index.mjs.map +1 -1
  185. package/dist/textarea/index.js +4 -4
  186. package/dist/textarea/index.js.map +1 -1
  187. package/dist/textarea/index.mjs +11 -8
  188. package/dist/textarea/index.mjs.map +1 -1
  189. package/dist/toast/index.d.mts +9 -1
  190. package/dist/toast/index.d.ts +9 -1
  191. package/dist/toast/index.js +3 -3
  192. package/dist/toast/index.js.map +1 -1
  193. package/dist/toast/index.mjs +145 -10
  194. package/dist/toast/index.mjs.map +1 -1
  195. package/dist/toaster/index.d.mts +5 -0
  196. package/dist/toaster/index.d.ts +5 -0
  197. package/dist/toaster/index.js +17 -142
  198. package/dist/toaster/index.js.map +1 -1
  199. package/dist/toaster/index.mjs +142 -135
  200. package/dist/toaster/index.mjs.map +1 -1
  201. package/package.json +5 -5
  202. package/dist/chunk-3ODWQVIA.mjs +0 -12
  203. package/dist/chunk-3ODWQVIA.mjs.map +0 -1
  204. package/dist/chunk-53OZVR57.mjs +0 -108
  205. package/dist/chunk-53OZVR57.mjs.map +0 -1
  206. package/dist/chunk-CBRGWUZG.mjs +0 -11
  207. package/dist/chunk-CBRGWUZG.mjs.map +0 -1
  208. package/dist/chunk-HYXZRCZW.mjs +0 -265
  209. package/dist/chunk-HYXZRCZW.mjs.map +0 -1
  210. package/dist/chunk-JNUGOUYJ.mjs +0 -154
  211. package/dist/chunk-JX5YLRCU.mjs +0 -443
  212. package/dist/chunk-JX5YLRCU.mjs.map +0 -1
  213. package/dist/chunk-NV3KR5Y7.mjs +0 -82
  214. package/dist/chunk-NV3KR5Y7.mjs.map +0 -1
  215. package/dist/chunk-OQ7MNEYW.mjs +0 -151
  216. package/dist/chunk-OQ7MNEYW.mjs.map +0 -1
@@ -37,128 +37,6 @@ module.exports = __toCommonJS(toaster_exports);
37
37
  // elements/toaster/Toaster.tsx
38
38
  var import_react = __toESM(require("react"));
39
39
 
40
- // hooks/useToast.ts
41
- var React = __toESM(require("react"));
42
- var TOAST_LIMIT = 5;
43
- var TOAST_REMOVE_DELAY = 1e5;
44
- var count = 0;
45
- function genId() {
46
- count = (count + 1) % Number.MAX_VALUE;
47
- return count.toString();
48
- }
49
- var toastTimeouts = /* @__PURE__ */ new Map();
50
- var addToRemoveQueue = (toastId) => {
51
- if (toastTimeouts.has(toastId)) {
52
- return;
53
- }
54
- const timeout = setTimeout(() => {
55
- toastTimeouts.delete(toastId);
56
- dispatch({
57
- type: "REMOVE_TOAST",
58
- toastId
59
- });
60
- }, TOAST_REMOVE_DELAY);
61
- toastTimeouts.set(toastId, timeout);
62
- };
63
- var reducer = (state, action) => {
64
- switch (action.type) {
65
- case "ADD_TOAST":
66
- console.log("adding toast case");
67
- return {
68
- ...state,
69
- toasts: [action.toast, ...state.toasts].slice(0, TOAST_LIMIT)
70
- };
71
- case "UPDATE_TOAST":
72
- return {
73
- ...state,
74
- toasts: state.toasts.map(
75
- (t) => t.id === action.toast.id ? { ...t, ...action.toast } : t
76
- )
77
- };
78
- case "DISMISS_TOAST": {
79
- const { toastId } = action;
80
- if (toastId) {
81
- addToRemoveQueue(toastId);
82
- } else {
83
- state.toasts.forEach((toast2) => {
84
- addToRemoveQueue(toast2.id);
85
- });
86
- }
87
- return {
88
- ...state,
89
- toasts: state.toasts.map(
90
- (t) => t.id === toastId || toastId === void 0 ? { ...t, open: false } : t
91
- )
92
- };
93
- }
94
- case "REMOVE_TOAST":
95
- if (action.toastId === void 0) {
96
- return { ...state, toasts: [] };
97
- }
98
- return {
99
- ...state,
100
- toasts: state.toasts.filter((t) => t.id !== action.toastId)
101
- };
102
- }
103
- };
104
- var listeners = [];
105
- var memoryState = { toasts: [] };
106
- function dispatch(action) {
107
- console.log("dispatching toast");
108
- memoryState = reducer(memoryState, action);
109
- listeners.forEach((listener) => {
110
- console.log("mapping through listerners in dispathc");
111
- listener(memoryState);
112
- });
113
- }
114
- function toast({ ...props }) {
115
- const id = genId();
116
- const update = (props2) => dispatch({
117
- type: "UPDATE_TOAST",
118
- toast: { ...props2, id }
119
- });
120
- const dismiss = () => dispatch({ type: "DISMISS_TOAST", toastId: id });
121
- dispatch({
122
- type: "ADD_TOAST",
123
- toast: {
124
- ...props,
125
- id,
126
- open: true,
127
- onOpenChange: (open) => {
128
- if (!open)
129
- dismiss();
130
- }
131
- }
132
- });
133
- return {
134
- id,
135
- dismiss,
136
- update
137
- };
138
- }
139
- function useToast() {
140
- const [state, setState] = React.useState(memoryState);
141
- React.useEffect(() => {
142
- console.log("useToast triggered in useEffect");
143
- console.log("toast state", state);
144
- console.log("listerners BEFORE", listeners);
145
- console.log("TOAST: setState is ", setState);
146
- listeners.push(setState);
147
- return () => {
148
- const index = listeners.indexOf(setState);
149
- console.log("listerners AFTER", listeners);
150
- if (index > -1) {
151
- listeners.splice(index, 1);
152
- }
153
- };
154
- }, [state]);
155
- return {
156
- ...state,
157
- toast,
158
- dismiss: (toastId) => dispatch({ type: "DISMISS_TOAST", toastId })
159
- };
160
- }
161
-
162
40
  // util/index.ts
163
41
  var import_clsx = require("clsx");
164
42
  var import_tailwind_merge = require("tailwind-merge");
@@ -167,7 +45,7 @@ function cn(...inputs) {
167
45
  }
168
46
 
169
47
  // elements/toast/Toast.tsx
170
- var React2 = __toESM(require("react"));
48
+ var React = __toESM(require("react"));
171
49
  var ToastPrimitives = __toESM(require("@radix-ui/react-toast"));
172
50
  var import_class_variance_authority = require("class-variance-authority");
173
51
  var toastVariants = (0, import_class_variance_authority.cva)(
@@ -195,7 +73,7 @@ var sizeStyles = {
195
73
  sm: "hawa-text-xs"
196
74
  };
197
75
  var ToastProvider = ToastPrimitives.Provider;
198
- var ToastViewport = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React2.createElement("div", null, /* @__PURE__ */ React2.createElement(
76
+ var ToastViewport = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React.createElement(
199
77
  ToastPrimitives.Viewport,
200
78
  {
201
79
  ref,
@@ -205,10 +83,10 @@ var ToastViewport = React2.forwardRef(({ className, ...props }, ref) => /* @__PU
205
83
  ),
206
84
  ...props
207
85
  }
208
- ), /* @__PURE__ */ React2.createElement("div", null, "inside ToastViewport")));
86
+ ));
209
87
  ToastViewport.displayName = ToastPrimitives.Viewport.displayName;
210
- var Toast = React2.forwardRef(({ className, variant, severity = "none", direction, ...props }, ref) => {
211
- return /* @__PURE__ */ React2.createElement(
88
+ var Toast = React.forwardRef(({ className, variant, severity = "none", direction, ...props }, ref) => {
89
+ return /* @__PURE__ */ React.createElement(
212
90
  ToastPrimitives.Root,
213
91
  {
214
92
  ref,
@@ -223,8 +101,8 @@ var Toast = React2.forwardRef(({ className, variant, severity = "none", directio
223
101
  );
224
102
  });
225
103
  Toast.displayName = ToastPrimitives.Root.displayName;
226
- var ToastAction = React2.forwardRef(({ className, ...props }, ref) => {
227
- return /* @__PURE__ */ React2.createElement(
104
+ var ToastAction = React.forwardRef(({ className, ...props }, ref) => {
105
+ return /* @__PURE__ */ React.createElement(
228
106
  ToastPrimitives.Action,
229
107
  {
230
108
  ref,
@@ -242,7 +120,7 @@ var ToastAction = React2.forwardRef(({ className, ...props }, ref) => {
242
120
  );
243
121
  });
244
122
  ToastAction.displayName = ToastPrimitives.Action.displayName;
245
- var ToastClose = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React2.createElement(
123
+ var ToastClose = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React.createElement(
246
124
  ToastPrimitives.Close,
247
125
  {
248
126
  ref,
@@ -256,7 +134,7 @@ var ToastClose = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE_
256
134
  "toast-close": "",
257
135
  ...props
258
136
  },
259
- /* @__PURE__ */ React2.createElement(
137
+ /* @__PURE__ */ React.createElement(
260
138
  "svg",
261
139
  {
262
140
  "aria-label": "Close Icon",
@@ -265,7 +143,7 @@ var ToastClose = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE_
265
143
  fill: "currentColor",
266
144
  viewBox: "0 0 20 20"
267
145
  },
268
- /* @__PURE__ */ React2.createElement(
146
+ /* @__PURE__ */ React.createElement(
269
147
  "path",
270
148
  {
271
149
  fillRule: "evenodd",
@@ -276,7 +154,7 @@ var ToastClose = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE_
276
154
  )
277
155
  ));
278
156
  ToastClose.displayName = ToastPrimitives.Close.displayName;
279
- var ToastTitle = React2.forwardRef(({ className, size = "default", ...props }, ref) => /* @__PURE__ */ React2.createElement(
157
+ var ToastTitle = React.forwardRef(({ className, size = "default", ...props }, ref) => /* @__PURE__ */ React.createElement(
280
158
  ToastPrimitives.Title,
281
159
  {
282
160
  ref,
@@ -289,7 +167,7 @@ var ToastTitle = React2.forwardRef(({ className, size = "default", ...props }, r
289
167
  }
290
168
  ));
291
169
  ToastTitle.displayName = ToastPrimitives.Title.displayName;
292
- var ToastDescription = React2.forwardRef(({ className, size = "default", ...props }, ref) => /* @__PURE__ */ React2.createElement(
170
+ var ToastDescription = React.forwardRef(({ className, size = "default", ...props }, ref) => /* @__PURE__ */ React.createElement(
293
171
  ToastPrimitives.Description,
294
172
  {
295
173
  ref,
@@ -305,9 +183,9 @@ ToastDescription.displayName = ToastPrimitives.Description.displayName;
305
183
 
306
184
  // elements/toaster/Toaster.tsx
307
185
  function Toaster(props) {
308
- const { toasts } = useToast();
186
+ var _a;
309
187
  let isRTL = props.direction === "rtl";
310
- return /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement("div", null, "I AM INSIDE MAIN TOASTER"), /* @__PURE__ */ import_react.default.createElement(ToastProvider, { swipeDirection: isRTL ? "left" : "right" }, /* @__PURE__ */ import_react.default.createElement("div", null, "I AM INSIDE TOASTPROVIDER"), toasts.map(function({
188
+ return /* @__PURE__ */ import_react.default.createElement(ToastProvider, { swipeDirection: isRTL ? "left" : "right" }, (_a = props.toasts) == null ? void 0 : _a.map(function({
311
189
  id,
312
190
  title,
313
191
  description,
@@ -315,7 +193,7 @@ function Toaster(props) {
315
193
  action,
316
194
  ...toastProps
317
195
  }) {
318
- return /* @__PURE__ */ import_react.default.createElement(Toast, { direction: props.direction, key: id, ...toastProps }, /* @__PURE__ */ import_react.default.createElement("div", null, "I AM INSIDE TOAST"), /* @__PURE__ */ import_react.default.createElement(
196
+ return /* @__PURE__ */ import_react.default.createElement(Toast, { direction: props.direction, key: id, ...toastProps }, /* @__PURE__ */ import_react.default.createElement(
319
197
  "div",
320
198
  {
321
199
  className: cn(
@@ -330,10 +208,7 @@ function Toaster(props) {
330
208
  {
331
209
  className: cn(
332
210
  "hawa-flex hawa-w-full hawa-flex-row hawa-justify-between hawa-gap-2",
333
- {
334
- "hawa-p-4": size === "default",
335
- "hawa-p-2": size === "sm"
336
- }
211
+ { "hawa-p-4": size === "default", "hawa-p-2": size === "sm" }
337
212
  )
338
213
  },
339
214
  /* @__PURE__ */ import_react.default.createElement("div", { className: "hawa-grid hawa-gap-1 hawa-text-start" }, title && /* @__PURE__ */ import_react.default.createElement(ToastTitle, { size }, title), description && /* @__PURE__ */ import_react.default.createElement(ToastDescription, { size }, description)),
@@ -345,7 +220,7 @@ function Toaster(props) {
345
220
  {
346
221
  className: cn("hawa-gap-2", isRTL && "hawa-fixed hawa-left-0")
347
222
  }
348
- )));
223
+ ));
349
224
  }
350
225
  // Annotate the CommonJS export names for ESM import in node:
351
226
  0 && (module.exports = {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../elements/toaster/index.ts","../../elements/toaster/Toaster.tsx","../../hooks/useToast.ts","../../util/index.ts","../../elements/toast/Toast.tsx"],"sourcesContent":["export * from \"./Toaster\";\n","import React from \"react\";\n\nimport { useToast } from \"@hooks/useToast\";\nimport { cn } from \"@util/index\";\n\nimport { DirectionType } from \"@_types/commonTypes\";\n\nimport {\n Toast,\n ToastClose,\n ToastDescription,\n ToastProvider,\n ToastTitle,\n ToastViewport\n} from \"../toast\";\n\ntype ToasterProps = {\n direction?: DirectionType;\n};\n\nexport function Toaster(props: ToasterProps) {\n const { toasts } = useToast();\n let isRTL = props.direction === \"rtl\";\n return (\n <div>\n <div>I AM INSIDE MAIN TOASTER</div>\n <ToastProvider swipeDirection={isRTL ? \"left\" : \"right\"}>\n <div>I AM INSIDE TOASTPROVIDER</div>\n {toasts.map(function ({\n id,\n title,\n description,\n size = \"default\",\n action,\n ...toastProps\n }) {\n return (\n <Toast direction={props.direction} key={id} {...toastProps}>\n <div>I AM INSIDE TOAST</div>\n <div\n className={cn(\n \"hawa-flex hawa-w-full hawa-flex-row hawa-gap-2\",\n action && \"hawa-justify-between\"\n )}\n >\n <div className=\"hawa-flex hawa-h-full hawa-flex-col hawa-p-2 hawa-pe-0\">\n <ToastClose />\n </div>\n <div className=\"hawa-mx-0 hawa-h-auto hawa-max-h-full hawa-w-px hawa-bg-primary-foreground/10\"></div>\n <div\n className={cn(\n \"hawa-flex hawa-w-full hawa-flex-row hawa-justify-between hawa-gap-2\",\n {\n \"hawa-p-4\": size === \"default\",\n \"hawa-p-2\": size === \"sm\"\n }\n )}\n >\n <div className={\"hawa-grid hawa-gap-1 hawa-text-start\"}>\n {title && <ToastTitle size={size}>{title}</ToastTitle>}\n {description && (\n <ToastDescription size={size}>\n {description}\n </ToastDescription>\n )}\n </div>\n {action && (\n <div className=\"hawa-flex hawa-flex-col hawa-justify-center\">\n {action}\n </div>\n )}\n </div>\n </div>\n </Toast>\n );\n })}\n <ToastViewport\n className={cn(\"hawa-gap-2\", isRTL && \"hawa-fixed hawa-left-0\")}\n />\n </ToastProvider>\n </div>\n );\n}\n","// Inspired by react-hot-toast library\nimport * as React from \"react\";\n\nimport type { ToastActionElement, ToastProps } from \"@elements/toast\";\n\nconst TOAST_LIMIT = 5;\nconst TOAST_REMOVE_DELAY = 100000;\n\ntype ToasterToast = ToastProps & {\n id: string;\n title?: React.ReactNode;\n description?: React.ReactNode;\n severity?: \"info\" | \"warning\" | \"error\" | \"success\" | \"none\";\n action?: ToastActionElement;\n size?: \"default\" | \"sm\";\n};\n\nconst actionTypes = {\n ADD_TOAST: \"ADD_TOAST\",\n UPDATE_TOAST: \"UPDATE_TOAST\",\n DISMISS_TOAST: \"DISMISS_TOAST\",\n REMOVE_TOAST: \"REMOVE_TOAST\"\n} as const;\n\nlet count = 0;\n\nfunction genId() {\n count = (count + 1) % Number.MAX_VALUE;\n return count.toString();\n}\n\ntype ActionType = typeof actionTypes;\n\ntype Action =\n | {\n type: ActionType[\"ADD_TOAST\"];\n toast: ToasterToast;\n }\n | {\n type: ActionType[\"UPDATE_TOAST\"];\n toast: Partial<ToasterToast>;\n }\n | {\n type: ActionType[\"DISMISS_TOAST\"];\n toastId?: ToasterToast[\"id\"];\n }\n | {\n type: ActionType[\"REMOVE_TOAST\"];\n toastId?: ToasterToast[\"id\"];\n };\n\ninterface State {\n toasts: ToasterToast[];\n}\n\nconst toastTimeouts = new Map<string, ReturnType<typeof setTimeout>>();\n\nconst addToRemoveQueue = (toastId: string) => {\n if (toastTimeouts.has(toastId)) {\n return;\n }\n\n const timeout = setTimeout(() => {\n toastTimeouts.delete(toastId);\n dispatch({\n type: \"REMOVE_TOAST\",\n toastId: toastId\n });\n }, TOAST_REMOVE_DELAY);\n\n toastTimeouts.set(toastId, timeout);\n};\n\nexport const reducer = (state: State, action: Action): State => {\n switch (action.type) {\n case \"ADD_TOAST\":\n console.log(\"adding toast case\");\n return {\n ...state,\n toasts: [action.toast, ...state.toasts].slice(0, TOAST_LIMIT)\n };\n\n case \"UPDATE_TOAST\":\n return {\n ...state,\n toasts: state.toasts.map((t) =>\n t.id === action.toast.id ? { ...t, ...action.toast } : t\n )\n };\n\n case \"DISMISS_TOAST\": {\n const { toastId } = action;\n\n // ! Side effects ! - This could be extracted into a dismissToast() action,\n // but I'll keep it here for simplicity\n if (toastId) {\n addToRemoveQueue(toastId);\n } else {\n state.toasts.forEach((toast) => {\n addToRemoveQueue(toast.id);\n });\n }\n\n return {\n ...state,\n toasts: state.toasts.map((t) =>\n t.id === toastId || toastId === undefined ? { ...t, open: false } : t\n )\n };\n }\n case \"REMOVE_TOAST\":\n if (action.toastId === undefined) {\n return { ...state, toasts: [] };\n }\n return {\n ...state,\n toasts: state.toasts.filter((t) => t.id !== action.toastId)\n };\n }\n};\n\nconst listeners: Array<(state: State) => void> = [];\n\nlet memoryState: State = { toasts: [] };\n\nfunction dispatch(action: Action) {\n console.log(\"dispatching toast\");\n memoryState = reducer(memoryState, action);\n listeners.forEach((listener) => {\n console.log(\"mapping through listerners in dispathc\");\n listener(memoryState);\n });\n}\n\ntype Toast = Omit<ToasterToast, \"id\">;\n\nfunction toast({ ...props }: Toast) {\n const id = genId();\n\n const update = (props: ToasterToast) =>\n dispatch({\n type: \"UPDATE_TOAST\",\n toast: { ...props, id }\n });\n const dismiss = () => dispatch({ type: \"DISMISS_TOAST\", toastId: id });\n\n dispatch({\n type: \"ADD_TOAST\",\n toast: {\n ...props,\n id,\n open: true,\n onOpenChange: (open) => {\n if (!open) dismiss();\n }\n }\n });\n\n return {\n id: id,\n dismiss,\n update\n };\n}\n\nfunction useToast() {\n const [state, setState] = React.useState<State>(memoryState);\n\n React.useEffect(() => {\n console.log(\"useToast triggered in useEffect\");\n console.log(\"toast state\", state);\n console.log(\"listerners BEFORE\", listeners);\n console.log(\"TOAST: setState is \", setState);\n listeners.push(setState);\n return () => {\n const index = listeners.indexOf(setState);\n console.log(\"listerners AFTER\", listeners);\n if (index > -1) {\n listeners.splice(index, 1);\n }\n };\n }, [state]);\n\n return {\n ...state,\n toast,\n dismiss: (toastId?: string) => dispatch({ type: \"DISMISS_TOAST\", toastId })\n };\n}\n\nexport { useToast, toast };\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\ntype Palette = {\n name: string;\n colors: {\n [key: number]: string;\n };\n};\ntype Rgb = {\n r: number;\n g: number;\n b: number;\n};\nfunction hexToRgb(hex: string): Rgb | null {\n const sanitizedHex = hex.replaceAll(\"##\", \"#\");\n const colorParts = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(\n sanitizedHex\n );\n\n if (!colorParts) {\n return null;\n }\n\n const [, r, g, b] = colorParts;\n\n return {\n r: parseInt(r, 16),\n g: parseInt(g, 16),\n b: parseInt(b, 16)\n } as Rgb;\n}\n\nfunction rgbToHex(r: number, g: number, b: number): string {\n const toHex = (c: number) => `0${c.toString(16)}`.slice(-2);\n return `#${toHex(r)}${toHex(g)}${toHex(b)}`;\n}\n\nexport function getTextColor(color: string): \"#FFF\" | \"#333\" {\n const rgbColor = hexToRgb(color);\n\n if (!rgbColor) {\n return \"#333\";\n }\n\n const { r, g, b } = rgbColor;\n const luma = 0.2126 * r + 0.7152 * g + 0.0722 * b;\n\n return luma < 120 ? \"#FFF\" : \"#333\";\n}\n\nfunction lighten(hex: string, intensity: number): string {\n const color = hexToRgb(`#${hex}`);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r + (255 - color.r) * intensity);\n const g = Math.round(color.g + (255 - color.g) * intensity);\n const b = Math.round(color.b + (255 - color.b) * intensity);\n\n return rgbToHex(r, g, b);\n}\n\nfunction darken(hex: string, intensity: number): string {\n const color = hexToRgb(hex);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r * intensity);\n const g = Math.round(color.g * intensity);\n const b = Math.round(color.b * intensity);\n\n return rgbToHex(r, g, b);\n}\nconst parseColor = (color: any) => {\n if (color.startsWith(\"#\")) {\n // Convert hex to RGB\n let r = parseInt(color.slice(1, 3), 16);\n let g = parseInt(color.slice(3, 5), 16);\n let b = parseInt(color.slice(5, 7), 16);\n return [r, g, b];\n } else if (color.startsWith(\"rgb\")) {\n // Extract RGB values from rgb() format\n return color.match(/\\d+/g).map(Number);\n }\n // Default to white if format is unrecognized\n return [255, 255, 255];\n};\nexport const calculateLuminance = (color: any) => {\n const [r, g, b] = parseColor(color)?.map((c: any) => {\n c /= 255;\n return c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;\n });\n return 0.2126 * r + 0.7152 * g + 0.0722 * b;\n};\n\nfunction getPallette(baseColor: string): Palette {\n const name = baseColor;\n\n const response: Palette = {\n name,\n colors: {\n 500: `#${baseColor}`.replace(\"##\", \"#\")\n }\n };\n\n const intensityMap: {\n [key: number]: number;\n } = {\n 50: 0.95,\n 100: 0.9,\n 200: 0.75,\n 300: 0.6,\n 400: 0.3,\n 600: 0.9,\n 700: 0.75,\n 800: 0.6,\n 900: 0.49\n };\n\n [50, 100, 200, 300, 400].forEach((level) => {\n response.colors[level] = lighten(baseColor, intensityMap[level]);\n });\n [600, 700, 800, 900].forEach((level) => {\n response.colors[level] = darken(baseColor, intensityMap[level]);\n });\n\n return response as Palette;\n}\n\nexport { getPallette };\n\n// const hexToRgb = (hex) => {\n// let d = hex?.split(\"#\")[1];\n// var aRgbHex = d?.match(/.{1,2}/g);\n// var aRgb = [\n// parseInt(aRgbHex[0], 16),\n// parseInt(aRgbHex[1], 16),\n// parseInt(aRgbHex[2], 16)\n// ];\n// return aRgb;\n// };\n// const getTextColor = (backColor) => {\n// let rgbArray = hexToRgb(backColor);\n// if (rgbArray[0] * 0.299 + rgbArray[1] * 0.587 + rgbArray[2] * 0.114 > 186) {\n// return \"#000000\";\n// } else {\n// return \"#ffffff\";\n// }\n// };\n// const replaceAt = function (string, index, replacement) {\n// // if (replacement == \"\" || replacement == \" \") {\n// // return (\n// // string.substring(0, index) +\n// // string.substring(index + replacement.length )\n// // );\n// // }\n// const replaced = string.substring(0, index) + replacement + string.substring(index + 1)\n// return replaced\n// };\n\n// export { hexToRgb, getTextColor, replaceAt };\n","import * as React from \"react\";\n\nimport * as ToastPrimitives from \"@radix-ui/react-toast\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { DirectionType } from \"@_types/commonTypes\";\n\nimport { cn } from \"@util/index\";\n\nconst toastVariants = cva(\n \"hawa-group hawa-z-[900] hawa-pointer-events-auto hawa-relative hawa-flex hawa-w-full hawa-items-center hawa-justify-between hawa-overflow-hidden hawa-rounded-md hawa-border hawa-shadow-lg hawa-transition-all data-[swipe=cancel]:hawa-translate-x-0 data-[swipe=end]:hawa-translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:hawa-translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:hawa-transition-none data-[state=open]:hawa-animate-in data-[state=closed]:hawa-animate-out data-[swipe=end]:hawa-animate-out data-[state=closed]:hawa-fade-out-80 data-[state=open]:hawa-slide-in-from-top-full data-[state=open]:sm:hawa-slide-in-from-bottom-full\",\n {\n variants: {\n variant: {\n default: \"hawa-border hawa-bg-background hawa-text-foreground\",\n destructive:\n \"hawa-destructive hawa-group hawa-border-destructive hawa-bg-destructive hawa-text-destructive-foreground\"\n },\n severity: {\n info: \"hawa-info hawa-group hawa-text-info-foreground hawa-bg-info\",\n warning:\n \"hawa-warning hawa-group hawa-text-warning-foreground hawa-bg-warning\",\n error:\n \"hawa-error hawa-group hawa-border-error hawa-bg-error hawa-text-white\",\n success:\n \"hawa-success hawa-group hawa-text-success-foreground hawa-bg-success\",\n none: \"\"\n }\n },\n\n defaultVariants: { variant: \"default\" }\n }\n);\n\nlet sizeStyles = {\n default: \"hawa-text-sm\", // Update this based on the desired padding for rtl\n sm: \"hawa-text-xs\"\n};\nconst ToastProvider = ToastPrimitives.Provider;\n\nconst ToastViewport = React.forwardRef<\n React.ElementRef<typeof ToastPrimitives.Viewport>,\n React.ComponentPropsWithoutRef<typeof ToastPrimitives.Viewport>\n>(({ className, ...props }, ref) => (\n<div>\n <ToastPrimitives.Viewport\n ref={ref}\n className={cn(\n \"hawa-fixed hawa-top-0 hawa-z-[100] hawa-flex hawa-max-h-screen hawa-w-full hawa-flex-col-reverse hawa-p-4 sm:hawa-bottom-0 sm:hawa-right-0 sm:hawa-top-auto sm:hawa-flex-col md:hawa-max-w-[420px]\",\n className\n )}\n {...props}\n />\n <div>inside ToastViewport</div>\n</div>\n));\nToastViewport.displayName = ToastPrimitives.Viewport.displayName;\n\nconst Toast = React.forwardRef<\n React.ElementRef<typeof ToastPrimitives.Root>,\n React.ComponentPropsWithoutRef<typeof ToastPrimitives.Root> &\n VariantProps<typeof toastVariants> & {\n direction?: DirectionType;\n }\n>(({ className, variant, severity = \"none\", direction, ...props }, ref) => {\n return (\n <ToastPrimitives.Root\n ref={ref}\n className={cn(\n toastVariants({ variant, severity }),\n className,\n direction === \"rtl\"\n ? \"data-[state=closed]:hawa-slide-out-to-left-full\"\n : \"data-[state=closed]:hawa-slide-out-to-right-full\"\n )}\n dir={direction}\n {...props}\n />\n );\n});\nToast.displayName = ToastPrimitives.Root.displayName;\n\nconst ToastAction = React.forwardRef<\n React.ElementRef<typeof ToastPrimitives.Action>,\n React.ComponentPropsWithoutRef<typeof ToastPrimitives.Action>\n>(({ className, ...props }, ref) => {\n return (\n <ToastPrimitives.Action\n ref={ref}\n className={cn(\n \"hawa-inline-flex hawa-h-8 hawa-shrink-0 hawa-items-center hawa-justify-center hawa-rounded-md hawa-border hawa-bg-transparent hawa-px-3 hawa-text-sm hawa-font-medium hawa-ring-offset-background hawa-transition-colors hover:hawa-bg-secondary hover:hawa-text-secondary-foreground focus:hawa-outline-none focus:hawa-ring-2 focus:hawa-ring-ring focus:hawa-ring-offset-2 disabled:hawa-pointer-events-none disabled:hawa-opacity-50\",\n \"group-[.info]:hawa-border-muted/40 group-[.info]:hover:hawa-border-info/30 group-[.info]:hover:hawa-bg-info group-[.info]:hover:hawa-text-info-foreground group-[.info]:focus:hawa-ring-info\",\n \"group-[.error]:hawa-border-muted/40 group-[.error]:hover:hawa-border-error/30 group-[.error]:hover:hawa-bg-error group-[.error]:hover:hawa-text-error-foreground group-[.error]:focus:hawa-ring-error\",\n \"group-[.success]:hawa-border-muted/40 group-[.success]:hover:hawa-border-success/30 group-[.success]:hover:hawa-bg-success group-[.success]:hover:hawa-text-success-foreground group-[.success]:focus:hawa-ring-success\",\n \"group-[.warning]:hawa-border-muted/40 group-[.warning]:hover:hawa-border-warning/30 group-[.warning]:hover:hawa-bg-warning group-[.warning]:hover:hawa-text-warning-foreground group-[.warning]:focus:hawa-ring-warning\",\n \"hawa-whitespace-nowrap\",\n className\n )}\n {...props}\n />\n );\n});\nToastAction.displayName = ToastPrimitives.Action.displayName;\n\nconst ToastClose = React.forwardRef<\n React.ElementRef<typeof ToastPrimitives.Close>,\n React.ComponentPropsWithoutRef<typeof ToastPrimitives.Close>\n>(({ className, ...props }, ref) => (\n <ToastPrimitives.Close\n ref={ref}\n className={cn(\n // \"hawa-absolute hawa-start-2 hawa-top-2\",\n // \"group-hover:hawa-opacity-100\",\n \"hawa-opacity-100\",\n \"hawa-rounded-md hawa-p-1 hawa-text-foreground/50 hawa-transition-opacity hover:hawa-text-foreground focus:hawa-opacity-100 focus:hawa-outline-none focus:hawa-ring-2 group-[.destructive]:hawa-text-red-300 group-[.destructive]:hover:hawa-text-red-50 group-[.destructive]:focus:hawa-ring-red-400 group-[.destructive]:focus:hawa-ring-offset-red-600\",\n className\n )}\n toast-close=\"\"\n {...props}\n >\n <svg\n aria-label=\"Close Icon\"\n aria-hidden=\"true\"\n className=\"hawa-icon\"\n fill=\"currentColor\"\n viewBox=\"0 0 20 20\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\"\n clipRule=\"evenodd\"\n ></path>\n </svg>\n </ToastPrimitives.Close>\n));\nToastClose.displayName = ToastPrimitives.Close.displayName;\n\nconst ToastTitle = React.forwardRef<\n React.ElementRef<typeof ToastPrimitives.Title>,\n React.ComponentPropsWithoutRef<typeof ToastPrimitives.Title> & {\n size: \"default\" | \"sm\";\n }\n>(({ className, size = \"default\", ...props }, ref) => (\n <ToastPrimitives.Title\n ref={ref}\n className={cn(\n \"hawa-select-text hawa-text-sm hawa-font-semibold\",\n sizeStyles[size],\n className\n )}\n {...props}\n />\n));\nToastTitle.displayName = ToastPrimitives.Title.displayName;\n\nconst ToastDescription = React.forwardRef<\n React.ElementRef<typeof ToastPrimitives.Description>,\n React.ComponentPropsWithoutRef<typeof ToastPrimitives.Description> & {\n size: \"default\" | \"sm\";\n }\n>(({ className, size = \"default\", ...props }, ref) => (\n <ToastPrimitives.Description\n ref={ref}\n className={cn(\n \"hawa-select-text hawa-opacity-90\",\n sizeStyles[size],\n className\n )}\n {...props}\n />\n));\nToastDescription.displayName = ToastPrimitives.Description.displayName;\n\ntype ToastProps = React.ComponentPropsWithoutRef<typeof Toast>;\ntype ToastActionElement = React.ReactElement<typeof ToastAction>;\n\nexport {\n type ToastProps,\n type ToastActionElement,\n ToastProvider,\n ToastViewport,\n Toast,\n ToastTitle,\n ToastDescription,\n ToastClose,\n ToastAction\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,mBAAkB;;;ACClB,YAAuB;AAIvB,IAAM,cAAc;AACpB,IAAM,qBAAqB;AAkB3B,IAAI,QAAQ;AAEZ,SAAS,QAAQ;AACf,WAAS,QAAQ,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AAa,KAAM,GACxC,eACC,6BAAAA,QAAA,cAAC,oBAAiB,QACf,WACH,CAEJ;AAAA,QACC,UACC,6BAAAA,QAAA,cAAC,SAAI,WAAU,kDACZ,MACH;AAAA,MAEJ;AAAA,IACF,CACF;AAAA,EAEJ,CAAC,GACD,6BAAAA,QAAA;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,GAAG,cAAc,SAAS,wBAAwB;AAAA;AAAA,EAC/D,CACF,CACF;AAEJ;","names":["toast","props","React","React"]}
1
+ {"version":3,"sources":["../../elements/toaster/index.ts","../../elements/toaster/Toaster.tsx","../../util/index.ts","../../elements/toast/Toast.tsx"],"sourcesContent":["export * from \"./Toaster\";\n","import React from \"react\";\n\nimport { cn } from \"@util/index\";\n\nimport { DirectionType } from \"@_types/commonTypes\";\n\nimport { useToast } from \"../../hooks/useToast\";\nimport {\n Toast,\n ToastClose,\n ToastDescription,\n ToastProvider,\n ToastTitle,\n ToastViewport,\n ToasterToastProps\n} from \"../toast\";\n\ntype ToasterProps = {\n direction?: DirectionType;\n toasts?: ToasterToastProps[];\n};\n\nexport function Toaster(props: ToasterProps) {\n let isRTL = props.direction === \"rtl\";\n return (\n <ToastProvider swipeDirection={isRTL ? \"left\" : \"right\"}>\n {props.toasts?.map(function ({\n id,\n title,\n description,\n size = \"default\",\n action,\n ...toastProps\n }) {\n return (\n <Toast direction={props.direction} key={id} {...toastProps}>\n <div\n className={cn(\n \"hawa-flex hawa-w-full hawa-flex-row hawa-gap-2\",\n action && \"hawa-justify-between\"\n )}\n >\n <div className=\"hawa-flex hawa-h-full hawa-flex-col hawa-p-2 hawa-pe-0\">\n <ToastClose />\n </div>\n <div className=\"hawa-mx-0 hawa-h-auto hawa-max-h-full hawa-w-px hawa-bg-primary-foreground/10\"></div>\n <div\n className={cn(\n \"hawa-flex hawa-w-full hawa-flex-row hawa-justify-between hawa-gap-2\",\n { \"hawa-p-4\": size === \"default\", \"hawa-p-2\": size === \"sm\" }\n )}\n >\n <div className={\"hawa-grid hawa-gap-1 hawa-text-start\"}>\n {title && <ToastTitle size={size}>{title}</ToastTitle>}\n {description && (\n <ToastDescription size={size}>\n {description}\n </ToastDescription>\n )}\n </div>\n {action && (\n <div className=\"hawa-flex hawa-flex-col hawa-justify-center\">\n {action}\n </div>\n )}\n </div>\n </div>\n </Toast>\n );\n })}\n <ToastViewport\n className={cn(\"hawa-gap-2\", isRTL && \"hawa-fixed hawa-left-0\")}\n />\n </ToastProvider>\n );\n}\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\ntype Palette = {\n name: string;\n colors: {\n [key: number]: string;\n };\n};\ntype Rgb = {\n r: number;\n g: number;\n b: number;\n};\nfunction hexToRgb(hex: string): Rgb | null {\n const sanitizedHex = hex.replaceAll(\"##\", \"#\");\n const colorParts = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(\n sanitizedHex\n );\n\n if (!colorParts) {\n return null;\n }\n\n const [, r, g, b] = colorParts;\n\n return {\n r: parseInt(r, 16),\n g: parseInt(g, 16),\n b: parseInt(b, 16)\n } as Rgb;\n}\n\nfunction rgbToHex(r: number, g: number, b: number): string {\n const toHex = (c: number) => `0${c.toString(16)}`.slice(-2);\n return `#${toHex(r)}${toHex(g)}${toHex(b)}`;\n}\n\nexport function getTextColor(color: string): \"#FFF\" | \"#333\" {\n const rgbColor = hexToRgb(color);\n\n if (!rgbColor) {\n return \"#333\";\n }\n\n const { r, g, b } = rgbColor;\n const luma = 0.2126 * r + 0.7152 * g + 0.0722 * b;\n\n return luma < 120 ? \"#FFF\" : \"#333\";\n}\n\nfunction lighten(hex: string, intensity: number): string {\n const color = hexToRgb(`#${hex}`);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r + (255 - color.r) * intensity);\n const g = Math.round(color.g + (255 - color.g) * intensity);\n const b = Math.round(color.b + (255 - color.b) * intensity);\n\n return rgbToHex(r, g, b);\n}\n\nfunction darken(hex: string, intensity: number): string {\n const color = hexToRgb(hex);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r * intensity);\n const g = Math.round(color.g * intensity);\n const b = Math.round(color.b * intensity);\n\n return rgbToHex(r, g, b);\n}\nconst parseColor = (color: any) => {\n if (color.startsWith(\"#\")) {\n // Convert hex to RGB\n let r = parseInt(color.slice(1, 3), 16);\n let g = parseInt(color.slice(3, 5), 16);\n let b = parseInt(color.slice(5, 7), 16);\n return [r, g, b];\n } else if (color.startsWith(\"rgb\")) {\n // Extract RGB values from rgb() format\n return color.match(/\\d+/g).map(Number);\n }\n // Default to white if format is unrecognized\n return [255, 255, 255];\n};\nexport const calculateLuminance = (color: any) => {\n const [r, g, b] = parseColor(color)?.map((c: any) => {\n c /= 255;\n return c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;\n });\n return 0.2126 * r + 0.7152 * g + 0.0722 * b;\n};\n\nfunction getPallette(baseColor: string): Palette {\n const name = baseColor;\n\n const response: Palette = {\n name,\n colors: {\n 500: `#${baseColor}`.replace(\"##\", \"#\")\n }\n };\n\n const intensityMap: {\n [key: number]: number;\n } = {\n 50: 0.95,\n 100: 0.9,\n 200: 0.75,\n 300: 0.6,\n 400: 0.3,\n 600: 0.9,\n 700: 0.75,\n 800: 0.6,\n 900: 0.49\n };\n\n [50, 100, 200, 300, 400].forEach((level) => {\n response.colors[level] = lighten(baseColor, intensityMap[level]);\n });\n [600, 700, 800, 900].forEach((level) => {\n response.colors[level] = darken(baseColor, intensityMap[level]);\n });\n\n return response as Palette;\n}\n\nexport { getPallette };\n\n// const hexToRgb = (hex) => {\n// let d = hex?.split(\"#\")[1];\n// var aRgbHex = d?.match(/.{1,2}/g);\n// var aRgb = [\n// parseInt(aRgbHex[0], 16),\n// parseInt(aRgbHex[1], 16),\n// parseInt(aRgbHex[2], 16)\n// ];\n// return aRgb;\n// };\n// const getTextColor = (backColor) => {\n// let rgbArray = hexToRgb(backColor);\n// if (rgbArray[0] * 0.299 + rgbArray[1] * 0.587 + rgbArray[2] * 0.114 > 186) {\n// return \"#000000\";\n// } else {\n// return \"#ffffff\";\n// }\n// };\n// const replaceAt = function (string, index, replacement) {\n// // if (replacement == \"\" || replacement == \" \") {\n// // return (\n// // string.substring(0, index) +\n// // string.substring(index + replacement.length )\n// // );\n// // }\n// const replaced = string.substring(0, index) + replacement + string.substring(index + 1)\n// return replaced\n// };\n\n// export { hexToRgb, getTextColor, replaceAt };\n","import * as React from \"react\";\n\nimport * as ToastPrimitives from \"@radix-ui/react-toast\";\nimport { cn } from \"@util/index\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { DirectionType } from \"@_types/commonTypes\";\n\nconst toastVariants = cva(\n \"hawa-group hawa-z-[900] hawa-pointer-events-auto hawa-relative hawa-flex hawa-w-full hawa-items-center hawa-justify-between hawa-overflow-hidden hawa-rounded-md hawa-border hawa-shadow-lg hawa-transition-all data-[swipe=cancel]:hawa-translate-x-0 data-[swipe=end]:hawa-translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:hawa-translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:hawa-transition-none data-[state=open]:hawa-animate-in data-[state=closed]:hawa-animate-out data-[swipe=end]:hawa-animate-out data-[state=closed]:hawa-fade-out-80 data-[state=open]:hawa-slide-in-from-top-full data-[state=open]:sm:hawa-slide-in-from-bottom-full\",\n {\n variants: {\n variant: {\n default: \"hawa-border hawa-bg-background hawa-text-foreground\",\n destructive:\n \"hawa-destructive hawa-group hawa-border-destructive hawa-bg-destructive hawa-text-destructive-foreground\"\n },\n severity: {\n info: \"hawa-info hawa-group hawa-text-info-foreground hawa-bg-info\",\n warning:\n \"hawa-warning hawa-group hawa-text-warning-foreground hawa-bg-warning\",\n error:\n \"hawa-error hawa-group hawa-border-error hawa-bg-error hawa-text-white\",\n success:\n \"hawa-success hawa-group hawa-text-success-foreground hawa-bg-success\",\n none: \"\"\n }\n },\n\n defaultVariants: { variant: \"default\" }\n }\n);\n\nlet sizeStyles = {\n default: \"hawa-text-sm\", // Update this based on the desired padding for rtl\n sm: \"hawa-text-xs\"\n};\nconst ToastProvider = ToastPrimitives.Provider;\n\nconst ToastViewport = React.forwardRef<\n React.ElementRef<typeof ToastPrimitives.Viewport>,\n React.ComponentPropsWithoutRef<typeof ToastPrimitives.Viewport>\n>(({ className, ...props }, ref) => (\n <ToastPrimitives.Viewport\n ref={ref}\n className={cn(\n \"hawa-fixed hawa-top-0 hawa-z-[100] hawa-flex hawa-max-h-screen hawa-w-full hawa-flex-col-reverse hawa-p-4 sm:hawa-bottom-0 sm:hawa-right-0 sm:hawa-top-auto sm:hawa-flex-col md:hawa-max-w-[420px]\",\n className\n )}\n {...props}\n />\n));\nToastViewport.displayName = ToastPrimitives.Viewport.displayName;\n\nconst Toast = React.forwardRef<\n React.ElementRef<typeof ToastPrimitives.Root>,\n React.ComponentPropsWithoutRef<typeof ToastPrimitives.Root> &\n VariantProps<typeof toastVariants> & {\n direction?: DirectionType;\n }\n>(({ className, variant, severity = \"none\", direction, ...props }, ref) => {\n return (\n <ToastPrimitives.Root\n ref={ref}\n className={cn(\n toastVariants({ variant, severity }),\n className,\n direction === \"rtl\"\n ? \"data-[state=closed]:hawa-slide-out-to-left-full\"\n : \"data-[state=closed]:hawa-slide-out-to-right-full\"\n )}\n dir={direction}\n {...props}\n />\n );\n});\nToast.displayName = ToastPrimitives.Root.displayName;\n\nconst ToastAction = React.forwardRef<\n React.ElementRef<typeof ToastPrimitives.Action>,\n React.ComponentPropsWithoutRef<typeof ToastPrimitives.Action>\n>(({ className, ...props }, ref) => {\n return (\n <ToastPrimitives.Action\n ref={ref}\n className={cn(\n \"hawa-inline-flex hawa-h-8 hawa-shrink-0 hawa-items-center hawa-justify-center hawa-rounded-md hawa-border hawa-bg-transparent hawa-px-3 hawa-text-sm hawa-font-medium hawa-ring-offset-background hawa-transition-colors hover:hawa-bg-secondary hover:hawa-text-secondary-foreground focus:hawa-outline-none focus:hawa-ring-2 focus:hawa-ring-ring focus:hawa-ring-offset-2 disabled:hawa-pointer-events-none disabled:hawa-opacity-50\",\n \"group-[.info]:hawa-border-muted/40 group-[.info]:hover:hawa-border-info/30 group-[.info]:hover:hawa-bg-info group-[.info]:hover:hawa-text-info-foreground group-[.info]:focus:hawa-ring-info\",\n \"group-[.error]:hawa-border-muted/40 group-[.error]:hover:hawa-border-error/30 group-[.error]:hover:hawa-bg-error group-[.error]:hover:hawa-text-error-foreground group-[.error]:focus:hawa-ring-error\",\n \"group-[.success]:hawa-border-muted/40 group-[.success]:hover:hawa-border-success/30 group-[.success]:hover:hawa-bg-success group-[.success]:hover:hawa-text-success-foreground group-[.success]:focus:hawa-ring-success\",\n \"group-[.warning]:hawa-border-muted/40 group-[.warning]:hover:hawa-border-warning/30 group-[.warning]:hover:hawa-bg-warning group-[.warning]:hover:hawa-text-warning-foreground group-[.warning]:focus:hawa-ring-warning\",\n \"hawa-whitespace-nowrap\",\n className\n )}\n {...props}\n />\n );\n});\nToastAction.displayName = ToastPrimitives.Action.displayName;\n\nconst ToastClose = React.forwardRef<\n React.ElementRef<typeof ToastPrimitives.Close>,\n React.ComponentPropsWithoutRef<typeof ToastPrimitives.Close>\n>(({ className, ...props }, ref) => (\n <ToastPrimitives.Close\n ref={ref}\n className={cn(\n // \"hawa-absolute hawa-start-2 hawa-top-2\",\n // \"group-hover:hawa-opacity-100\",\n \"hawa-opacity-100\",\n \"hawa-rounded-md hawa-p-1 hawa-text-foreground/50 hawa-transition-opacity hover:hawa-text-foreground focus:hawa-opacity-100 focus:hawa-outline-none focus:hawa-ring-2 group-[.destructive]:hawa-text-red-300 group-[.destructive]:hover:hawa-text-red-50 group-[.destructive]:focus:hawa-ring-red-400 group-[.destructive]:focus:hawa-ring-offset-red-600\",\n className\n )}\n toast-close=\"\"\n {...props}\n >\n <svg\n aria-label=\"Close Icon\"\n aria-hidden=\"true\"\n className=\"hawa-icon\"\n fill=\"currentColor\"\n viewBox=\"0 0 20 20\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\"\n clipRule=\"evenodd\"\n ></path>\n </svg>\n </ToastPrimitives.Close>\n));\nToastClose.displayName = ToastPrimitives.Close.displayName;\n\nconst ToastTitle = React.forwardRef<\n React.ElementRef<typeof ToastPrimitives.Title>,\n React.ComponentPropsWithoutRef<typeof ToastPrimitives.Title> & {\n size: \"default\" | \"sm\";\n }\n>(({ className, size = \"default\", ...props }, ref) => (\n <ToastPrimitives.Title\n ref={ref}\n className={cn(\n \"hawa-select-text hawa-text-sm hawa-font-semibold\",\n sizeStyles[size],\n className\n )}\n {...props}\n />\n));\nToastTitle.displayName = ToastPrimitives.Title.displayName;\n\nconst ToastDescription = React.forwardRef<\n React.ElementRef<typeof ToastPrimitives.Description>,\n React.ComponentPropsWithoutRef<typeof ToastPrimitives.Description> & {\n size: \"default\" | \"sm\";\n }\n>(({ className, size = \"default\", ...props }, ref) => (\n <ToastPrimitives.Description\n ref={ref}\n className={cn(\n \"hawa-select-text hawa-opacity-90\",\n sizeStyles[size],\n className\n )}\n {...props}\n />\n));\nToastDescription.displayName = ToastPrimitives.Description.displayName;\n\ntype ToastProps = React.ComponentPropsWithoutRef<typeof Toast>;\ntype ToastActionElement = React.ReactElement<typeof ToastAction>;\nexport type ToasterToastProps = ToastProps & {\n id: string;\n title?: React.ReactNode;\n description?: React.ReactNode;\n severity?: \"info\" | \"warning\" | \"error\" | \"success\" | \"none\";\n action?: ToastActionElement;\n size?: \"default\" | \"sm\";\n};\nexport {\n type ToastProps,\n type ToastActionElement,\n ToastProvider,\n ToastViewport,\n Toast,\n ToastTitle,\n ToastDescription,\n ToastClose,\n ToastAction\n};\n"],"mappings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