mogh_ui 0.1.0

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 (330) hide show
  1. package/dist/color.cjs +62 -0
  2. package/dist/color.cjs.map +1 -0
  3. package/dist/color.d.cts +5 -0
  4. package/dist/color.d.ts +5 -0
  5. package/dist/color.js +37 -0
  6. package/dist/color.js.map +1 -0
  7. package/dist/components/back-button.cjs +43 -0
  8. package/dist/components/back-button.cjs.map +1 -0
  9. package/dist/components/back-button.d.cts +9 -0
  10. package/dist/components/back-button.d.ts +9 -0
  11. package/dist/components/back-button.js +19 -0
  12. package/dist/components/back-button.js.map +1 -0
  13. package/dist/components/config/confirm.cjs +191 -0
  14. package/dist/components/config/confirm.cjs.map +1 -0
  15. package/dist/components/config/confirm.d.cts +20 -0
  16. package/dist/components/config/confirm.d.ts +20 -0
  17. package/dist/components/config/confirm.js +167 -0
  18. package/dist/components/config/confirm.js.map +1 -0
  19. package/dist/components/config/group.cjs +102 -0
  20. package/dist/components/config/group.cjs.map +1 -0
  21. package/dist/components/config/group.d.cts +11 -0
  22. package/dist/components/config/group.d.ts +11 -0
  23. package/dist/components/config/group.js +78 -0
  24. package/dist/components/config/group.js.map +1 -0
  25. package/dist/components/config/index.cjs +237 -0
  26. package/dist/components/config/index.cjs.map +1 -0
  27. package/dist/components/config/index.d.cts +62 -0
  28. package/dist/components/config/index.d.ts +62 -0
  29. package/dist/components/config/index.js +217 -0
  30. package/dist/components/config/index.js.map +1 -0
  31. package/dist/components/config/item.cjs +139 -0
  32. package/dist/components/config/item.cjs.map +1 -0
  33. package/dist/components/config/item.d.cts +45 -0
  34. package/dist/components/config/item.d.ts +45 -0
  35. package/dist/components/config/item.js +119 -0
  36. package/dist/components/config/item.js.map +1 -0
  37. package/dist/components/config/layout.cjs +44 -0
  38. package/dist/components/config/layout.cjs.map +1 -0
  39. package/dist/components/config/layout.d.cts +11 -0
  40. package/dist/components/config/layout.d.ts +11 -0
  41. package/dist/components/config/layout.js +20 -0
  42. package/dist/components/config/layout.js.map +1 -0
  43. package/dist/components/config/unsaved-changes.cjs +47 -0
  44. package/dist/components/config/unsaved-changes.cjs.map +1 -0
  45. package/dist/components/config/unsaved-changes.d.cts +7 -0
  46. package/dist/components/config/unsaved-changes.d.ts +7 -0
  47. package/dist/components/config/unsaved-changes.js +23 -0
  48. package/dist/components/config/unsaved-changes.js.map +1 -0
  49. package/dist/components/confirm-button.cjs +85 -0
  50. package/dist/components/confirm-button.cjs.map +1 -0
  51. package/dist/components/confirm-button.d.cts +23 -0
  52. package/dist/components/confirm-button.d.ts +23 -0
  53. package/dist/components/confirm-button.js +69 -0
  54. package/dist/components/confirm-button.js.map +1 -0
  55. package/dist/components/confirm-icon.cjs +70 -0
  56. package/dist/components/confirm-icon.cjs.map +1 -0
  57. package/dist/components/confirm-icon.d.cts +20 -0
  58. package/dist/components/confirm-icon.d.ts +20 -0
  59. package/dist/components/confirm-icon.js +54 -0
  60. package/dist/components/confirm-icon.js.map +1 -0
  61. package/dist/components/confirm-modal.cjs +146 -0
  62. package/dist/components/confirm-modal.cjs.map +1 -0
  63. package/dist/components/confirm-modal.d.cts +25 -0
  64. package/dist/components/confirm-modal.d.ts +25 -0
  65. package/dist/components/confirm-modal.js +130 -0
  66. package/dist/components/confirm-modal.js.map +1 -0
  67. package/dist/components/copy-button.cjs +68 -0
  68. package/dist/components/copy-button.cjs.map +1 -0
  69. package/dist/components/copy-button.d.cts +15 -0
  70. package/dist/components/copy-button.d.ts +15 -0
  71. package/dist/components/copy-button.js +46 -0
  72. package/dist/components/copy-button.js.map +1 -0
  73. package/dist/components/copy-text.cjs +63 -0
  74. package/dist/components/copy-text.cjs.map +1 -0
  75. package/dist/components/copy-text.d.cts +11 -0
  76. package/dist/components/copy-text.d.ts +11 -0
  77. package/dist/components/copy-text.js +39 -0
  78. package/dist/components/copy-text.js.map +1 -0
  79. package/dist/components/create-modal.cjs +100 -0
  80. package/dist/components/create-modal.cjs.map +1 -0
  81. package/dist/components/create-modal.d.cts +18 -0
  82. package/dist/components/create-modal.d.ts +18 -0
  83. package/dist/components/create-modal.js +82 -0
  84. package/dist/components/create-modal.js.map +1 -0
  85. package/dist/components/data-table.cjs +240 -0
  86. package/dist/components/data-table.cjs.map +1 -0
  87. package/dist/components/data-table.d.cts +36 -0
  88. package/dist/components/data-table.d.ts +36 -0
  89. package/dist/components/data-table.js +233 -0
  90. package/dist/components/data-table.js.map +1 -0
  91. package/dist/components/divided-children/index.cjs +53 -0
  92. package/dist/components/divided-children/index.cjs.map +1 -0
  93. package/dist/components/divided-children/index.d.cts +15 -0
  94. package/dist/components/divided-children/index.d.ts +15 -0
  95. package/dist/components/divided-children/index.js +19 -0
  96. package/dist/components/divided-children/index.js.map +1 -0
  97. package/dist/components/divided-children/index.module.scss +4 -0
  98. package/dist/components/enable-switch.cjs +67 -0
  99. package/dist/components/enable-switch.cjs.map +1 -0
  100. package/dist/components/enable-switch.d.cts +12 -0
  101. package/dist/components/enable-switch.d.ts +12 -0
  102. package/dist/components/enable-switch.js +43 -0
  103. package/dist/components/enable-switch.js.map +1 -0
  104. package/dist/components/entity-header.cjs +137 -0
  105. package/dist/components/entity-header.cjs.map +1 -0
  106. package/dist/components/entity-header.d.cts +20 -0
  107. package/dist/components/entity-header.d.ts +20 -0
  108. package/dist/components/entity-header.js +113 -0
  109. package/dist/components/entity-header.js.map +1 -0
  110. package/dist/components/entity-page.cjs +45 -0
  111. package/dist/components/entity-page.cjs.map +1 -0
  112. package/dist/components/entity-page.d.cts +11 -0
  113. package/dist/components/entity-page.d.ts +11 -0
  114. package/dist/components/entity-page.js +21 -0
  115. package/dist/components/entity-page.js.map +1 -0
  116. package/dist/components/fancy-card/index.cjs +52 -0
  117. package/dist/components/fancy-card/index.cjs.map +1 -0
  118. package/dist/components/fancy-card/index.d.cts +17 -0
  119. package/dist/components/fancy-card/index.d.ts +17 -0
  120. package/dist/components/fancy-card/index.js +18 -0
  121. package/dist/components/fancy-card/index.js.map +1 -0
  122. package/dist/components/fancy-card/index.module.scss +13 -0
  123. package/dist/components/hover-error.cjs +60 -0
  124. package/dist/components/hover-error.cjs.map +1 -0
  125. package/dist/components/hover-error.d.cts +9 -0
  126. package/dist/components/hover-error.d.ts +9 -0
  127. package/dist/components/hover-error.js +36 -0
  128. package/dist/components/hover-error.js.map +1 -0
  129. package/dist/components/info-card.cjs +44 -0
  130. package/dist/components/info-card.cjs.map +1 -0
  131. package/dist/components/info-card.d.cts +21 -0
  132. package/dist/components/info-card.d.ts +21 -0
  133. package/dist/components/info-card.js +25 -0
  134. package/dist/components/info-card.js.map +1 -0
  135. package/dist/components/input-list.cjs +68 -0
  136. package/dist/components/input-list.cjs.map +1 -0
  137. package/dist/components/input-list.d.cts +14 -0
  138. package/dist/components/input-list.d.ts +14 -0
  139. package/dist/components/input-list.js +44 -0
  140. package/dist/components/input-list.js.map +1 -0
  141. package/dist/components/labelled-switch.cjs +68 -0
  142. package/dist/components/labelled-switch.cjs.map +1 -0
  143. package/dist/components/labelled-switch.d.cts +14 -0
  144. package/dist/components/labelled-switch.d.ts +14 -0
  145. package/dist/components/labelled-switch.js +48 -0
  146. package/dist/components/labelled-switch.js.map +1 -0
  147. package/dist/components/labels-group.cjs +44 -0
  148. package/dist/components/labels-group.cjs.map +1 -0
  149. package/dist/components/labels-group.d.cts +10 -0
  150. package/dist/components/labels-group.d.ts +10 -0
  151. package/dist/components/labels-group.js +20 -0
  152. package/dist/components/labels-group.js.map +1 -0
  153. package/dist/components/loading-screen.cjs +37 -0
  154. package/dist/components/loading-screen.cjs.map +1 -0
  155. package/dist/components/loading-screen.d.cts +8 -0
  156. package/dist/components/loading-screen.d.ts +8 -0
  157. package/dist/components/loading-screen.js +13 -0
  158. package/dist/components/loading-screen.js.map +1 -0
  159. package/dist/components/mobile-friendly-tabs.cjs +141 -0
  160. package/dist/components/mobile-friendly-tabs.cjs.map +1 -0
  161. package/dist/components/mobile-friendly-tabs.d.cts +43 -0
  162. package/dist/components/mobile-friendly-tabs.d.ts +43 -0
  163. package/dist/components/mobile-friendly-tabs.js +120 -0
  164. package/dist/components/mobile-friendly-tabs.js.map +1 -0
  165. package/dist/components/monaco/index.cjs +244 -0
  166. package/dist/components/monaco/index.cjs.map +1 -0
  167. package/dist/components/monaco/index.d.cts +32 -0
  168. package/dist/components/monaco/index.d.ts +32 -0
  169. package/dist/components/monaco/index.js +208 -0
  170. package/dist/components/monaco/index.js.map +1 -0
  171. package/dist/components/monaco/index.scss +3 -0
  172. package/dist/components/monaco/init.cjs +73 -0
  173. package/dist/components/monaco/init.cjs.map +1 -0
  174. package/dist/components/monaco/init.d.cts +2 -0
  175. package/dist/components/monaco/init.d.ts +2 -0
  176. package/dist/components/monaco/init.js +49 -0
  177. package/dist/components/monaco/init.js.map +1 -0
  178. package/dist/components/monaco/syntax/fancy_toml.cjs +241 -0
  179. package/dist/components/monaco/syntax/fancy_toml.cjs.map +1 -0
  180. package/dist/components/monaco/syntax/fancy_toml.d.cts +2 -0
  181. package/dist/components/monaco/syntax/fancy_toml.d.ts +2 -0
  182. package/dist/components/monaco/syntax/fancy_toml.js +218 -0
  183. package/dist/components/monaco/syntax/fancy_toml.js.map +1 -0
  184. package/dist/components/monaco/syntax/key_value.cjs +107 -0
  185. package/dist/components/monaco/syntax/key_value.cjs.map +1 -0
  186. package/dist/components/monaco/syntax/key_value.d.cts +2 -0
  187. package/dist/components/monaco/syntax/key_value.d.ts +2 -0
  188. package/dist/components/monaco/syntax/key_value.js +84 -0
  189. package/dist/components/monaco/syntax/key_value.js.map +1 -0
  190. package/dist/components/monaco/syntax/shell.cjs +246 -0
  191. package/dist/components/monaco/syntax/shell.cjs.map +1 -0
  192. package/dist/components/monaco/syntax/shell.d.cts +2 -0
  193. package/dist/components/monaco/syntax/shell.d.ts +2 -0
  194. package/dist/components/monaco/syntax/shell.js +223 -0
  195. package/dist/components/monaco/syntax/shell.js.map +1 -0
  196. package/dist/components/monaco/syntax/string_list.cjs +75 -0
  197. package/dist/components/monaco/syntax/string_list.cjs.map +1 -0
  198. package/dist/components/monaco/syntax/string_list.d.cts +2 -0
  199. package/dist/components/monaco/syntax/string_list.d.ts +2 -0
  200. package/dist/components/monaco/syntax/string_list.js +52 -0
  201. package/dist/components/monaco/syntax/string_list.js.map +1 -0
  202. package/dist/components/monaco/syntax/toml.cjs +157 -0
  203. package/dist/components/monaco/syntax/toml.cjs.map +1 -0
  204. package/dist/components/monaco/syntax/toml.d.cts +2 -0
  205. package/dist/components/monaco/syntax/toml.d.ts +2 -0
  206. package/dist/components/monaco/syntax/toml.js +134 -0
  207. package/dist/components/monaco/syntax/toml.js.map +1 -0
  208. package/dist/components/monaco/syntax/yaml.cjs +250 -0
  209. package/dist/components/monaco/syntax/yaml.cjs.map +1 -0
  210. package/dist/components/monaco/syntax/yaml.d.cts +2 -0
  211. package/dist/components/monaco/syntax/yaml.d.ts +2 -0
  212. package/dist/components/monaco/syntax/yaml.js +227 -0
  213. package/dist/components/monaco/syntax/yaml.js.map +1 -0
  214. package/dist/components/monaco/theme.cjs +721 -0
  215. package/dist/components/monaco/theme.cjs.map +1 -0
  216. package/dist/components/monaco/theme.d.cts +2 -0
  217. package/dist/components/monaco/theme.d.ts +2 -0
  218. package/dist/components/monaco/theme.js +698 -0
  219. package/dist/components/monaco/theme.js.map +1 -0
  220. package/dist/components/page-guard.cjs +44 -0
  221. package/dist/components/page-guard.cjs.map +1 -0
  222. package/dist/components/page-guard.d.cts +13 -0
  223. package/dist/components/page-guard.d.ts +13 -0
  224. package/dist/components/page-guard.js +20 -0
  225. package/dist/components/page-guard.js.map +1 -0
  226. package/dist/components/page.cjs +81 -0
  227. package/dist/components/page.cjs.map +1 -0
  228. package/dist/components/page.d.cts +31 -0
  229. package/dist/components/page.d.ts +31 -0
  230. package/dist/components/page.js +63 -0
  231. package/dist/components/page.js.map +1 -0
  232. package/dist/components/search-input.cjs +51 -0
  233. package/dist/components/search-input.cjs.map +1 -0
  234. package/dist/components/search-input.d.cts +9 -0
  235. package/dist/components/search-input.d.ts +9 -0
  236. package/dist/components/search-input.js +27 -0
  237. package/dist/components/search-input.js.map +1 -0
  238. package/dist/components/section.cjs +100 -0
  239. package/dist/components/section.cjs.map +1 -0
  240. package/dist/components/section.d.cts +33 -0
  241. package/dist/components/section.d.ts +33 -0
  242. package/dist/components/section.js +83 -0
  243. package/dist/components/section.js.map +1 -0
  244. package/dist/components/shared-text-update.cjs +83 -0
  245. package/dist/components/shared-text-update.cjs.map +1 -0
  246. package/dist/components/shared-text-update.d.cts +20 -0
  247. package/dist/components/shared-text-update.d.ts +20 -0
  248. package/dist/components/shared-text-update.js +65 -0
  249. package/dist/components/shared-text-update.js.map +1 -0
  250. package/dist/components/show-hide-button.cjs +48 -0
  251. package/dist/components/show-hide-button.cjs.map +1 -0
  252. package/dist/components/show-hide-button.d.cts +8 -0
  253. package/dist/components/show-hide-button.d.ts +8 -0
  254. package/dist/components/show-hide-button.js +24 -0
  255. package/dist/components/show-hide-button.js.map +1 -0
  256. package/dist/components/stat-bar.cjs +68 -0
  257. package/dist/components/stat-bar.cjs.map +1 -0
  258. package/dist/components/stat-bar.d.cts +15 -0
  259. package/dist/components/stat-bar.d.ts +15 -0
  260. package/dist/components/stat-bar.js +44 -0
  261. package/dist/components/stat-bar.js.map +1 -0
  262. package/dist/components/stat-cell.cjs +72 -0
  263. package/dist/components/stat-cell.cjs.map +1 -0
  264. package/dist/components/stat-cell.d.cts +17 -0
  265. package/dist/components/stat-cell.d.ts +17 -0
  266. package/dist/components/stat-cell.js +54 -0
  267. package/dist/components/stat-cell.js.map +1 -0
  268. package/dist/components/status-badge.cjs +63 -0
  269. package/dist/components/status-badge.cjs.map +1 -0
  270. package/dist/components/status-badge.d.cts +20 -0
  271. package/dist/components/status-badge.d.ts +20 -0
  272. package/dist/components/status-badge.js +39 -0
  273. package/dist/components/status-badge.js.map +1 -0
  274. package/dist/components/tabbed-page.cjs +64 -0
  275. package/dist/components/tabbed-page.cjs.map +1 -0
  276. package/dist/components/tabbed-page.d.cts +18 -0
  277. package/dist/components/tabbed-page.d.ts +18 -0
  278. package/dist/components/tabbed-page.js +40 -0
  279. package/dist/components/tabbed-page.js.map +1 -0
  280. package/dist/components/table-skeleton.cjs +36 -0
  281. package/dist/components/table-skeleton.cjs.map +1 -0
  282. package/dist/components/table-skeleton.d.cts +8 -0
  283. package/dist/components/table-skeleton.d.ts +8 -0
  284. package/dist/components/table-skeleton.js +12 -0
  285. package/dist/components/table-skeleton.js.map +1 -0
  286. package/dist/components/text-update-modal.cjs +102 -0
  287. package/dist/components/text-update-modal.cjs.map +1 -0
  288. package/dist/components/text-update-modal.d.cts +19 -0
  289. package/dist/components/text-update-modal.d.ts +19 -0
  290. package/dist/components/text-update-modal.js +85 -0
  291. package/dist/components/text-update-modal.js.map +1 -0
  292. package/dist/components/theme-toggle.cjs +73 -0
  293. package/dist/components/theme-toggle.cjs.map +1 -0
  294. package/dist/components/theme-toggle.d.cts +5 -0
  295. package/dist/components/theme-toggle.d.ts +5 -0
  296. package/dist/components/theme-toggle.js +54 -0
  297. package/dist/components/theme-toggle.js.map +1 -0
  298. package/dist/formatting.cjs +124 -0
  299. package/dist/formatting.cjs.map +1 -0
  300. package/dist/formatting.d.cts +14 -0
  301. package/dist/formatting.d.ts +14 -0
  302. package/dist/formatting.js +89 -0
  303. package/dist/formatting.js.map +1 -0
  304. package/dist/hooks.cjs +117 -0
  305. package/dist/hooks.cjs.map +1 -0
  306. package/dist/hooks.d.cts +30 -0
  307. package/dist/hooks.d.ts +30 -0
  308. package/dist/hooks.js +88 -0
  309. package/dist/hooks.js.map +1 -0
  310. package/dist/index.cjs +99 -0
  311. package/dist/index.cjs.map +1 -0
  312. package/dist/index.d.cts +47 -0
  313. package/dist/index.d.ts +47 -0
  314. package/dist/index.js +40 -0
  315. package/dist/index.js.map +1 -0
  316. package/dist/index.scss +81 -0
  317. package/dist/theme.cjs +332 -0
  318. package/dist/theme.cjs.map +1 -0
  319. package/dist/theme.d.cts +15 -0
  320. package/dist/theme.d.ts +15 -0
  321. package/dist/theme.js +330 -0
  322. package/dist/theme.js.map +1 -0
  323. package/dist/theme.scss +76 -0
  324. package/dist/utils.cjs +48 -0
  325. package/dist/utils.cjs.map +1 -0
  326. package/dist/utils.d.cts +15 -0
  327. package/dist/utils.d.ts +15 -0
  328. package/dist/utils.js +24 -0
  329. package/dist/utils.js.map +1 -0
  330. package/package.json +61 -0
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var layout_exports = {};
20
+ __export(layout_exports, {
21
+ ConfigLayout: () => ConfigLayout
22
+ });
23
+ module.exports = __toCommonJS(layout_exports);
24
+ var import_jsx_runtime = require("react/jsx-runtime");
25
+ var import_section = require("../section");
26
+ var import_lucide_react = require("lucide-react");
27
+ function ConfigLayout({
28
+ title,
29
+ icon,
30
+ titleOther,
31
+ SaveOrReset,
32
+ ...sectionProps
33
+ }) {
34
+ const titleProps = titleOther ? { titleOther } : {
35
+ title: title ?? "Config",
36
+ icon: icon ?? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Settings, { size: "1rem" })
37
+ };
38
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_section.Section, { actions: SaveOrReset, gap: "md", ...titleProps, ...sectionProps });
39
+ }
40
+ // Annotate the CommonJS export names for ESM import in node:
41
+ 0 && (module.exports = {
42
+ ConfigLayout
43
+ });
44
+ //# sourceMappingURL=layout.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/config/layout.tsx"],"sourcesContent":["import { ReactNode } from \"react\";\nimport { Section, SectionProps } from \"../section\";\nimport { Settings } from \"lucide-react\";\n\n/** Includes save buttons */\nexport function ConfigLayout({\n title,\n icon,\n titleOther,\n SaveOrReset,\n ...sectionProps\n}: {\n SaveOrReset: ReactNode | undefined;\n} & SectionProps) {\n const titleProps = titleOther\n ? { titleOther }\n : {\n title: title ?? \"Config\",\n icon: icon ?? <Settings size=\"1rem\" />,\n };\n return <Section actions={SaveOrReset} gap=\"md\" {...titleProps} {...sectionProps} />;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAkBsB;AAjBtB,qBAAsC;AACtC,0BAAyB;AAGlB,SAAS,aAAa;AAAA,EAC3B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAEkB;AAChB,QAAM,aAAa,aACf,EAAE,WAAW,IACb;AAAA,IACE,OAAO,SAAS;AAAA,IAChB,MAAM,QAAQ,4CAAC,gCAAS,MAAK,QAAO;AAAA,EACtC;AACJ,SAAO,4CAAC,0BAAQ,SAAS,aAAa,KAAI,MAAM,GAAG,YAAa,GAAG,cAAc;AACnF;","names":[]}
@@ -0,0 +1,11 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ReactNode } from 'react';
3
+ import { SectionProps } from '../section.cjs';
4
+ import '@mantine/core';
5
+
6
+ /** Includes save buttons */
7
+ declare function ConfigLayout({ title, icon, titleOther, SaveOrReset, ...sectionProps }: {
8
+ SaveOrReset: ReactNode | undefined;
9
+ } & SectionProps): react_jsx_runtime.JSX.Element;
10
+
11
+ export { ConfigLayout };
@@ -0,0 +1,11 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ReactNode } from 'react';
3
+ import { SectionProps } from '../section.js';
4
+ import '@mantine/core';
5
+
6
+ /** Includes save buttons */
7
+ declare function ConfigLayout({ title, icon, titleOther, SaveOrReset, ...sectionProps }: {
8
+ SaveOrReset: ReactNode | undefined;
9
+ } & SectionProps): react_jsx_runtime.JSX.Element;
10
+
11
+ export { ConfigLayout };
@@ -0,0 +1,20 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { Section } from "../section";
3
+ import { Settings } from "lucide-react";
4
+ function ConfigLayout({
5
+ title,
6
+ icon,
7
+ titleOther,
8
+ SaveOrReset,
9
+ ...sectionProps
10
+ }) {
11
+ const titleProps = titleOther ? { titleOther } : {
12
+ title: title ?? "Config",
13
+ icon: icon ?? /* @__PURE__ */ jsx(Settings, { size: "1rem" })
14
+ };
15
+ return /* @__PURE__ */ jsx(Section, { actions: SaveOrReset, gap: "md", ...titleProps, ...sectionProps });
16
+ }
17
+ export {
18
+ ConfigLayout
19
+ };
20
+ //# sourceMappingURL=layout.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/config/layout.tsx"],"sourcesContent":["import { ReactNode } from \"react\";\nimport { Section, SectionProps } from \"../section\";\nimport { Settings } from \"lucide-react\";\n\n/** Includes save buttons */\nexport function ConfigLayout({\n title,\n icon,\n titleOther,\n SaveOrReset,\n ...sectionProps\n}: {\n SaveOrReset: ReactNode | undefined;\n} & SectionProps) {\n const titleProps = titleOther\n ? { titleOther }\n : {\n title: title ?? \"Config\",\n icon: icon ?? <Settings size=\"1rem\" />,\n };\n return <Section actions={SaveOrReset} gap=\"md\" {...titleProps} {...sectionProps} />;\n}\n"],"mappings":"AAkBsB;AAjBtB,SAAS,eAA6B;AACtC,SAAS,gBAAgB;AAGlB,SAAS,aAAa;AAAA,EAC3B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAEkB;AAChB,QAAM,aAAa,aACf,EAAE,WAAW,IACb;AAAA,IACE,OAAO,SAAS;AAAA,IAChB,MAAM,QAAQ,oBAAC,YAAS,MAAK,QAAO;AAAA,EACtC;AACJ,SAAO,oBAAC,WAAQ,SAAS,aAAa,KAAI,MAAM,GAAG,YAAa,GAAG,cAAc;AACnF;","names":[]}
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var unsaved_changes_exports = {};
20
+ __export(unsaved_changes_exports, {
21
+ UnsavedChanges: () => UnsavedChanges
22
+ });
23
+ module.exports = __toCommonJS(unsaved_changes_exports);
24
+ var import_jsx_runtime = require("react/jsx-runtime");
25
+ var import_core = require("@mantine/core");
26
+ var import_lucide_react = require("lucide-react");
27
+ function UnsavedChanges({ fullWidth }) {
28
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
29
+ import_core.Group,
30
+ {
31
+ gap: "xs",
32
+ wrap: "nowrap",
33
+ justify: "space-evenly",
34
+ w: fullWidth ? "100%" : "fit-content",
35
+ children: [
36
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.TriangleAlert, { size: "1rem" }),
37
+ "Unsaved changes",
38
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.TriangleAlert, { size: "1rem" })
39
+ ]
40
+ }
41
+ );
42
+ }
43
+ // Annotate the CommonJS export names for ESM import in node:
44
+ 0 && (module.exports = {
45
+ UnsavedChanges
46
+ });
47
+ //# sourceMappingURL=unsaved-changes.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/config/unsaved-changes.tsx"],"sourcesContent":["import { Group } from \"@mantine/core\";\nimport { TriangleAlert } from \"lucide-react\";\n\nexport function UnsavedChanges({ fullWidth }: { fullWidth?: boolean }) {\n return (\n <Group\n gap=\"xs\"\n wrap=\"nowrap\"\n justify=\"space-evenly\"\n w={fullWidth ? \"100%\" : \"fit-content\"}\n >\n <TriangleAlert size=\"1rem\" />\n Unsaved changes\n <TriangleAlert size=\"1rem\" />\n </Group>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAKI;AALJ,kBAAsB;AACtB,0BAA8B;AAEvB,SAAS,eAAe,EAAE,UAAU,GAA4B;AACrE,SACE;AAAA,IAAC;AAAA;AAAA,MACC,KAAI;AAAA,MACJ,MAAK;AAAA,MACL,SAAQ;AAAA,MACR,GAAG,YAAY,SAAS;AAAA,MAExB;AAAA,oDAAC,qCAAc,MAAK,QAAO;AAAA,QAAE;AAAA,QAE7B,4CAAC,qCAAc,MAAK,QAAO;AAAA;AAAA;AAAA,EAC7B;AAEJ;","names":[]}
@@ -0,0 +1,7 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+
3
+ declare function UnsavedChanges({ fullWidth }: {
4
+ fullWidth?: boolean;
5
+ }): react_jsx_runtime.JSX.Element;
6
+
7
+ export { UnsavedChanges };
@@ -0,0 +1,7 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+
3
+ declare function UnsavedChanges({ fullWidth }: {
4
+ fullWidth?: boolean;
5
+ }): react_jsx_runtime.JSX.Element;
6
+
7
+ export { UnsavedChanges };
@@ -0,0 +1,23 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { Group } from "@mantine/core";
3
+ import { TriangleAlert } from "lucide-react";
4
+ function UnsavedChanges({ fullWidth }) {
5
+ return /* @__PURE__ */ jsxs(
6
+ Group,
7
+ {
8
+ gap: "xs",
9
+ wrap: "nowrap",
10
+ justify: "space-evenly",
11
+ w: fullWidth ? "100%" : "fit-content",
12
+ children: [
13
+ /* @__PURE__ */ jsx(TriangleAlert, { size: "1rem" }),
14
+ "Unsaved changes",
15
+ /* @__PURE__ */ jsx(TriangleAlert, { size: "1rem" })
16
+ ]
17
+ }
18
+ );
19
+ }
20
+ export {
21
+ UnsavedChanges
22
+ };
23
+ //# sourceMappingURL=unsaved-changes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/config/unsaved-changes.tsx"],"sourcesContent":["import { Group } from \"@mantine/core\";\nimport { TriangleAlert } from \"lucide-react\";\n\nexport function UnsavedChanges({ fullWidth }: { fullWidth?: boolean }) {\n return (\n <Group\n gap=\"xs\"\n wrap=\"nowrap\"\n justify=\"space-evenly\"\n w={fullWidth ? \"100%\" : \"fit-content\"}\n >\n <TriangleAlert size=\"1rem\" />\n Unsaved changes\n <TriangleAlert size=\"1rem\" />\n </Group>\n );\n}\n"],"mappings":"AAKI,SAME,KANF;AALJ,SAAS,aAAa;AACtB,SAAS,qBAAqB;AAEvB,SAAS,eAAe,EAAE,UAAU,GAA4B;AACrE,SACE;AAAA,IAAC;AAAA;AAAA,MACC,KAAI;AAAA,MACJ,MAAK;AAAA,MACL,SAAQ;AAAA,MACR,GAAG,YAAY,SAAS;AAAA,MAExB;AAAA,4BAAC,iBAAc,MAAK,QAAO;AAAA,QAAE;AAAA,QAE7B,oBAAC,iBAAc,MAAK,QAAO;AAAA;AAAA;AAAA,EAC7B;AAEJ;","names":[]}
@@ -0,0 +1,85 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var confirm_button_exports = {};
20
+ __export(confirm_button_exports, {
21
+ ConfirmButton: () => ConfirmButton
22
+ });
23
+ module.exports = __toCommonJS(confirm_button_exports);
24
+ var import_jsx_runtime = require("react/jsx-runtime");
25
+ var import_core = require("@mantine/core");
26
+ var import_lucide_react = require("lucide-react");
27
+ var import_react = require("react");
28
+ const ConfirmButton = (0, import_core.createPolymorphicComponent)(
29
+ (0, import_react.forwardRef)(
30
+ ({
31
+ icon,
32
+ rightSection,
33
+ children,
34
+ onClick,
35
+ onBlur,
36
+ miw,
37
+ loading,
38
+ disabled,
39
+ confirmProps,
40
+ ...props
41
+ }, ref) => {
42
+ const [clickedOnce, setClickedOnce] = (0, import_react.useState)(false);
43
+ (0, import_react.useEffect)(() => {
44
+ if (clickedOnce) {
45
+ const timeout = setTimeout(() => {
46
+ setClickedOnce(false);
47
+ }, 4e3);
48
+ return () => clearTimeout(timeout);
49
+ }
50
+ }, [clickedOnce]);
51
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
52
+ import_core.Button,
53
+ {
54
+ onClick: (e) => {
55
+ e.stopPropagation();
56
+ if (clickedOnce) {
57
+ onClick?.(e);
58
+ setClickedOnce(false);
59
+ } else {
60
+ setClickedOnce(true);
61
+ }
62
+ },
63
+ onBlur: (e) => {
64
+ onBlur?.(e);
65
+ setClickedOnce(false);
66
+ },
67
+ justify: "space-between",
68
+ w: { base: "100%", xs: 190 },
69
+ miw: "fit-content",
70
+ rightSection: clickedOnce ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Check, { size: "1rem" }) : loading ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.Loader, { size: "1rem" }) : rightSection ?? icon ?? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.CircleQuestionMark, { size: "1rem" }),
71
+ disabled: disabled || loading,
72
+ ...props,
73
+ ...clickedOnce ? confirmProps : {},
74
+ ref,
75
+ children: clickedOnce ? "Confirm" : children
76
+ }
77
+ );
78
+ }
79
+ )
80
+ );
81
+ // Annotate the CommonJS export names for ESM import in node:
82
+ 0 && (module.exports = {
83
+ ConfirmButton
84
+ });
85
+ //# sourceMappingURL=confirm-button.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/components/confirm-button.tsx"],"sourcesContent":["import {\n Button,\n ButtonProps,\n createPolymorphicComponent,\n Loader,\n} from \"@mantine/core\";\nimport { Check, CircleQuestionMark } from \"lucide-react\";\nimport {\n FocusEventHandler,\n forwardRef,\n MouseEventHandler,\n ReactNode,\n useEffect,\n useState,\n} from \"react\";\n\n// https://mantine.dev/guides/polymorphic/#create-your-own-polymorphic-components\n\nexport interface ConfirmButtonProps extends ButtonProps {\n icon?: ReactNode;\n onClick?: MouseEventHandler<HTMLButtonElement>;\n onBlur?: FocusEventHandler<HTMLButtonElement>;\n /** Passed when button is in confirm mode */\n confirmProps?: ButtonProps;\n}\n\nexport const ConfirmButton = createPolymorphicComponent<\n \"button\",\n ConfirmButtonProps\n>(\n forwardRef<HTMLButtonElement, ConfirmButtonProps>(\n (\n {\n icon,\n rightSection,\n children,\n onClick,\n onBlur,\n miw,\n loading,\n disabled,\n confirmProps,\n ...props\n },\n ref,\n ) => {\n const [clickedOnce, setClickedOnce] = useState(false);\n useEffect(() => {\n if (clickedOnce) {\n const timeout = setTimeout(() => {\n setClickedOnce(false);\n }, 4_000);\n return () => clearTimeout(timeout);\n }\n }, [clickedOnce]);\n return (\n <Button\n onClick={(e) => {\n e.stopPropagation();\n if (clickedOnce) {\n onClick?.(e);\n setClickedOnce(false);\n } else {\n setClickedOnce(true);\n }\n }}\n onBlur={(e) => {\n onBlur?.(e);\n setClickedOnce(false);\n }}\n justify=\"space-between\"\n w={{ base: \"100%\", xs: 190 }}\n miw=\"fit-content\"\n rightSection={\n clickedOnce ? (\n <Check size=\"1rem\" />\n ) : loading ? (\n <Loader size=\"1rem\" />\n ) : (\n (rightSection ?? icon ?? <CircleQuestionMark size=\"1rem\" />)\n )\n }\n disabled={disabled || loading}\n {...props}\n {...(clickedOnce ? confirmProps : {})}\n ref={ref}\n >\n {clickedOnce ? \"Confirm\" : children}\n </Button>\n );\n },\n ),\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA2Ec;AA3Ed,kBAKO;AACP,0BAA0C;AAC1C,mBAOO;AAYA,MAAM,oBAAgB;AAAA,MAI3B;AAAA,IACE,CACE;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,GAAG;AAAA,IACL,GACA,QACG;AACH,YAAM,CAAC,aAAa,cAAc,QAAI,uBAAS,KAAK;AACpD,kCAAU,MAAM;AACd,YAAI,aAAa;AACf,gBAAM,UAAU,WAAW,MAAM;AAC/B,2BAAe,KAAK;AAAA,UACtB,GAAG,GAAK;AACR,iBAAO,MAAM,aAAa,OAAO;AAAA,QACnC;AAAA,MACF,GAAG,CAAC,WAAW,CAAC;AAChB,aACE;AAAA,QAAC;AAAA;AAAA,UACC,SAAS,CAAC,MAAM;AACd,cAAE,gBAAgB;AAClB,gBAAI,aAAa;AACf,wBAAU,CAAC;AACX,6BAAe,KAAK;AAAA,YACtB,OAAO;AACL,6BAAe,IAAI;AAAA,YACrB;AAAA,UACF;AAAA,UACA,QAAQ,CAAC,MAAM;AACb,qBAAS,CAAC;AACV,2BAAe,KAAK;AAAA,UACtB;AAAA,UACA,SAAQ;AAAA,UACR,GAAG,EAAE,MAAM,QAAQ,IAAI,IAAI;AAAA,UAC3B,KAAI;AAAA,UACJ,cACE,cACE,4CAAC,6BAAM,MAAK,QAAO,IACjB,UACF,4CAAC,sBAAO,MAAK,QAAO,IAEnB,gBAAgB,QAAQ,4CAAC,0CAAmB,MAAK,QAAO;AAAA,UAG7D,UAAU,YAAY;AAAA,UACrB,GAAG;AAAA,UACH,GAAI,cAAc,eAAe,CAAC;AAAA,UACnC;AAAA,UAEC,wBAAc,YAAY;AAAA;AAAA,MAC7B;AAAA,IAEJ;AAAA,EACF;AACF;","names":[]}
@@ -0,0 +1,23 @@
1
+ import * as react from 'react';
2
+ import { ReactNode, MouseEventHandler, FocusEventHandler } from 'react';
3
+ import * as _mantine_core from '@mantine/core';
4
+ import { ButtonProps } from '@mantine/core';
5
+
6
+ interface ConfirmButtonProps extends ButtonProps {
7
+ icon?: ReactNode;
8
+ onClick?: MouseEventHandler<HTMLButtonElement>;
9
+ onBlur?: FocusEventHandler<HTMLButtonElement>;
10
+ /** Passed when button is in confirm mode */
11
+ confirmProps?: ButtonProps;
12
+ }
13
+ declare const ConfirmButton: (<C = "button">(props: _mantine_core.PolymorphicComponentProps<C, ConfirmButtonProps>) => React.ReactElement) & Omit<react.FunctionComponent<(ConfirmButtonProps & {
14
+ component?: any;
15
+ } & Omit<any, "component" | keyof ConfirmButtonProps> & {
16
+ ref?: any;
17
+ renderRoot?: (props: any) => any;
18
+ }) | (ConfirmButtonProps & {
19
+ component: React.ElementType;
20
+ renderRoot?: (props: Record<string, any>) => any;
21
+ })>, never> & Record<string, never>;
22
+
23
+ export { ConfirmButton, type ConfirmButtonProps };
@@ -0,0 +1,23 @@
1
+ import * as react from 'react';
2
+ import { ReactNode, MouseEventHandler, FocusEventHandler } from 'react';
3
+ import * as _mantine_core from '@mantine/core';
4
+ import { ButtonProps } from '@mantine/core';
5
+
6
+ interface ConfirmButtonProps extends ButtonProps {
7
+ icon?: ReactNode;
8
+ onClick?: MouseEventHandler<HTMLButtonElement>;
9
+ onBlur?: FocusEventHandler<HTMLButtonElement>;
10
+ /** Passed when button is in confirm mode */
11
+ confirmProps?: ButtonProps;
12
+ }
13
+ declare const ConfirmButton: (<C = "button">(props: _mantine_core.PolymorphicComponentProps<C, ConfirmButtonProps>) => React.ReactElement) & Omit<react.FunctionComponent<(ConfirmButtonProps & {
14
+ component?: any;
15
+ } & Omit<any, "component" | keyof ConfirmButtonProps> & {
16
+ ref?: any;
17
+ renderRoot?: (props: any) => any;
18
+ }) | (ConfirmButtonProps & {
19
+ component: React.ElementType;
20
+ renderRoot?: (props: Record<string, any>) => any;
21
+ })>, never> & Record<string, never>;
22
+
23
+ export { ConfirmButton, type ConfirmButtonProps };
@@ -0,0 +1,69 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import {
3
+ Button,
4
+ createPolymorphicComponent,
5
+ Loader
6
+ } from "@mantine/core";
7
+ import { Check, CircleQuestionMark } from "lucide-react";
8
+ import {
9
+ forwardRef,
10
+ useEffect,
11
+ useState
12
+ } from "react";
13
+ const ConfirmButton = createPolymorphicComponent(
14
+ forwardRef(
15
+ ({
16
+ icon,
17
+ rightSection,
18
+ children,
19
+ onClick,
20
+ onBlur,
21
+ miw,
22
+ loading,
23
+ disabled,
24
+ confirmProps,
25
+ ...props
26
+ }, ref) => {
27
+ const [clickedOnce, setClickedOnce] = useState(false);
28
+ useEffect(() => {
29
+ if (clickedOnce) {
30
+ const timeout = setTimeout(() => {
31
+ setClickedOnce(false);
32
+ }, 4e3);
33
+ return () => clearTimeout(timeout);
34
+ }
35
+ }, [clickedOnce]);
36
+ return /* @__PURE__ */ jsx(
37
+ Button,
38
+ {
39
+ onClick: (e) => {
40
+ e.stopPropagation();
41
+ if (clickedOnce) {
42
+ onClick?.(e);
43
+ setClickedOnce(false);
44
+ } else {
45
+ setClickedOnce(true);
46
+ }
47
+ },
48
+ onBlur: (e) => {
49
+ onBlur?.(e);
50
+ setClickedOnce(false);
51
+ },
52
+ justify: "space-between",
53
+ w: { base: "100%", xs: 190 },
54
+ miw: "fit-content",
55
+ rightSection: clickedOnce ? /* @__PURE__ */ jsx(Check, { size: "1rem" }) : loading ? /* @__PURE__ */ jsx(Loader, { size: "1rem" }) : rightSection ?? icon ?? /* @__PURE__ */ jsx(CircleQuestionMark, { size: "1rem" }),
56
+ disabled: disabled || loading,
57
+ ...props,
58
+ ...clickedOnce ? confirmProps : {},
59
+ ref,
60
+ children: clickedOnce ? "Confirm" : children
61
+ }
62
+ );
63
+ }
64
+ )
65
+ );
66
+ export {
67
+ ConfirmButton
68
+ };
69
+ //# sourceMappingURL=confirm-button.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/components/confirm-button.tsx"],"sourcesContent":["import {\n Button,\n ButtonProps,\n createPolymorphicComponent,\n Loader,\n} from \"@mantine/core\";\nimport { Check, CircleQuestionMark } from \"lucide-react\";\nimport {\n FocusEventHandler,\n forwardRef,\n MouseEventHandler,\n ReactNode,\n useEffect,\n useState,\n} from \"react\";\n\n// https://mantine.dev/guides/polymorphic/#create-your-own-polymorphic-components\n\nexport interface ConfirmButtonProps extends ButtonProps {\n icon?: ReactNode;\n onClick?: MouseEventHandler<HTMLButtonElement>;\n onBlur?: FocusEventHandler<HTMLButtonElement>;\n /** Passed when button is in confirm mode */\n confirmProps?: ButtonProps;\n}\n\nexport const ConfirmButton = createPolymorphicComponent<\n \"button\",\n ConfirmButtonProps\n>(\n forwardRef<HTMLButtonElement, ConfirmButtonProps>(\n (\n {\n icon,\n rightSection,\n children,\n onClick,\n onBlur,\n miw,\n loading,\n disabled,\n confirmProps,\n ...props\n },\n ref,\n ) => {\n const [clickedOnce, setClickedOnce] = useState(false);\n useEffect(() => {\n if (clickedOnce) {\n const timeout = setTimeout(() => {\n setClickedOnce(false);\n }, 4_000);\n return () => clearTimeout(timeout);\n }\n }, [clickedOnce]);\n return (\n <Button\n onClick={(e) => {\n e.stopPropagation();\n if (clickedOnce) {\n onClick?.(e);\n setClickedOnce(false);\n } else {\n setClickedOnce(true);\n }\n }}\n onBlur={(e) => {\n onBlur?.(e);\n setClickedOnce(false);\n }}\n justify=\"space-between\"\n w={{ base: \"100%\", xs: 190 }}\n miw=\"fit-content\"\n rightSection={\n clickedOnce ? (\n <Check size=\"1rem\" />\n ) : loading ? (\n <Loader size=\"1rem\" />\n ) : (\n (rightSection ?? icon ?? <CircleQuestionMark size=\"1rem\" />)\n )\n }\n disabled={disabled || loading}\n {...props}\n {...(clickedOnce ? confirmProps : {})}\n ref={ref}\n >\n {clickedOnce ? \"Confirm\" : children}\n </Button>\n );\n },\n ),\n);\n"],"mappings":"AA2Ec;AA3Ed;AAAA,EACE;AAAA,EAEA;AAAA,EACA;AAAA,OACK;AACP,SAAS,OAAO,0BAA0B;AAC1C;AAAA,EAEE;AAAA,EAGA;AAAA,EACA;AAAA,OACK;AAYA,MAAM,gBAAgB;AAAA,EAI3B;AAAA,IACE,CACE;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,GAAG;AAAA,IACL,GACA,QACG;AACH,YAAM,CAAC,aAAa,cAAc,IAAI,SAAS,KAAK;AACpD,gBAAU,MAAM;AACd,YAAI,aAAa;AACf,gBAAM,UAAU,WAAW,MAAM;AAC/B,2BAAe,KAAK;AAAA,UACtB,GAAG,GAAK;AACR,iBAAO,MAAM,aAAa,OAAO;AAAA,QACnC;AAAA,MACF,GAAG,CAAC,WAAW,CAAC;AAChB,aACE;AAAA,QAAC;AAAA;AAAA,UACC,SAAS,CAAC,MAAM;AACd,cAAE,gBAAgB;AAClB,gBAAI,aAAa;AACf,wBAAU,CAAC;AACX,6BAAe,KAAK;AAAA,YACtB,OAAO;AACL,6BAAe,IAAI;AAAA,YACrB;AAAA,UACF;AAAA,UACA,QAAQ,CAAC,MAAM;AACb,qBAAS,CAAC;AACV,2BAAe,KAAK;AAAA,UACtB;AAAA,UACA,SAAQ;AAAA,UACR,GAAG,EAAE,MAAM,QAAQ,IAAI,IAAI;AAAA,UAC3B,KAAI;AAAA,UACJ,cACE,cACE,oBAAC,SAAM,MAAK,QAAO,IACjB,UACF,oBAAC,UAAO,MAAK,QAAO,IAEnB,gBAAgB,QAAQ,oBAAC,sBAAmB,MAAK,QAAO;AAAA,UAG7D,UAAU,YAAY;AAAA,UACrB,GAAG;AAAA,UACH,GAAI,cAAc,eAAe,CAAC;AAAA,UACnC;AAAA,UAEC,wBAAc,YAAY;AAAA;AAAA,MAC7B;AAAA,IAEJ;AAAA,EACF;AACF;","names":[]}
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var confirm_icon_exports = {};
20
+ __export(confirm_icon_exports, {
21
+ ConfirmIcon: () => ConfirmIcon
22
+ });
23
+ module.exports = __toCommonJS(confirm_icon_exports);
24
+ var import_jsx_runtime = require("react/jsx-runtime");
25
+ var import_core = require("@mantine/core");
26
+ var import_lucide_react = require("lucide-react");
27
+ var import_react = require("react");
28
+ const ConfirmIcon = (0, import_core.createPolymorphicComponent)(
29
+ (0, import_react.forwardRef)(
30
+ ({ children, onClick, onBlur, miw, loading, disabled, ...props }, ref) => {
31
+ const [clickedOnce, setClickedOnce] = (0, import_react.useState)(false);
32
+ (0, import_react.useEffect)(() => {
33
+ if (clickedOnce) {
34
+ const timeout = setTimeout(() => {
35
+ setClickedOnce(false);
36
+ }, 4e3);
37
+ return () => clearTimeout(timeout);
38
+ }
39
+ }, [clickedOnce]);
40
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
41
+ import_core.ActionIcon,
42
+ {
43
+ onClick: (e) => {
44
+ e.stopPropagation();
45
+ if (clickedOnce) {
46
+ onClick?.(e);
47
+ setClickedOnce(false);
48
+ } else {
49
+ setClickedOnce(true);
50
+ }
51
+ },
52
+ onBlur: (e) => {
53
+ setClickedOnce(false);
54
+ onBlur?.(e);
55
+ },
56
+ onPointerDown: (e) => e.stopPropagation(),
57
+ disabled: disabled || loading,
58
+ ...props,
59
+ ref,
60
+ children: clickedOnce ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Check, { size: "1rem" }) : loading ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.Loader, { color: "white", size: "1rem" }) : children ?? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.CircleQuestionMark, { size: "1rem" })
61
+ }
62
+ );
63
+ }
64
+ )
65
+ );
66
+ // Annotate the CommonJS export names for ESM import in node:
67
+ 0 && (module.exports = {
68
+ ConfirmIcon
69
+ });
70
+ //# sourceMappingURL=confirm-icon.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/components/confirm-icon.tsx"],"sourcesContent":["import {\n ActionIcon,\n ActionIconProps,\n createPolymorphicComponent,\n Loader,\n} from \"@mantine/core\";\nimport { Check, CircleQuestionMark } from \"lucide-react\";\nimport {\n FocusEventHandler,\n forwardRef,\n MouseEventHandler,\n useEffect,\n useState,\n} from \"react\";\n\n// https://mantine.dev/guides/polymorphic/#create-your-own-polymorphic-components\n\nexport interface ConfirmIconProps extends ActionIconProps {\n onClick?: MouseEventHandler<HTMLButtonElement>;\n onBlur?: FocusEventHandler<HTMLButtonElement>;\n}\n\nexport const ConfirmIcon = createPolymorphicComponent<\n \"button\",\n ConfirmIconProps\n>(\n forwardRef<HTMLButtonElement, ConfirmIconProps>(\n ({ children, onClick, onBlur, miw, loading, disabled, ...props }, ref) => {\n const [clickedOnce, setClickedOnce] = useState(false);\n useEffect(() => {\n if (clickedOnce) {\n const timeout = setTimeout(() => {\n setClickedOnce(false);\n }, 4_000);\n return () => clearTimeout(timeout);\n }\n }, [clickedOnce]);\n return (\n <ActionIcon\n onClick={(e) => {\n e.stopPropagation();\n if (clickedOnce) {\n onClick?.(e);\n setClickedOnce(false);\n } else {\n setClickedOnce(true);\n }\n }}\n onBlur={(e) => {\n setClickedOnce(false);\n onBlur?.(e);\n }}\n onPointerDown={(e) => e.stopPropagation()}\n disabled={disabled || loading}\n {...props}\n ref={ref}\n >\n {clickedOnce ? (\n <Check size=\"1rem\" />\n ) : loading ? (\n <Loader color=\"white\" size=\"1rem\" />\n ) : (\n (children ?? <CircleQuestionMark size=\"1rem\" />)\n )}\n </ActionIcon>\n );\n },\n ),\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA0DY;AA1DZ,kBAKO;AACP,0BAA0C;AAC1C,mBAMO;AASA,MAAM,kBAAc;AAAA,MAIzB;AAAA,IACE,CAAC,EAAE,UAAU,SAAS,QAAQ,KAAK,SAAS,UAAU,GAAG,MAAM,GAAG,QAAQ;AACxE,YAAM,CAAC,aAAa,cAAc,QAAI,uBAAS,KAAK;AACpD,kCAAU,MAAM;AACd,YAAI,aAAa;AACf,gBAAM,UAAU,WAAW,MAAM;AAC/B,2BAAe,KAAK;AAAA,UACtB,GAAG,GAAK;AACR,iBAAO,MAAM,aAAa,OAAO;AAAA,QACnC;AAAA,MACF,GAAG,CAAC,WAAW,CAAC;AAChB,aACE;AAAA,QAAC;AAAA;AAAA,UACC,SAAS,CAAC,MAAM;AACd,cAAE,gBAAgB;AAClB,gBAAI,aAAa;AACf,wBAAU,CAAC;AACX,6BAAe,KAAK;AAAA,YACtB,OAAO;AACL,6BAAe,IAAI;AAAA,YACrB;AAAA,UACF;AAAA,UACA,QAAQ,CAAC,MAAM;AACb,2BAAe,KAAK;AACpB,qBAAS,CAAC;AAAA,UACZ;AAAA,UACA,eAAe,CAAC,MAAM,EAAE,gBAAgB;AAAA,UACxC,UAAU,YAAY;AAAA,UACrB,GAAG;AAAA,UACJ;AAAA,UAEC,wBACC,4CAAC,6BAAM,MAAK,QAAO,IACjB,UACF,4CAAC,sBAAO,OAAM,SAAQ,MAAK,QAAO,IAEjC,YAAY,4CAAC,0CAAmB,MAAK,QAAO;AAAA;AAAA,MAEjD;AAAA,IAEJ;AAAA,EACF;AACF;","names":[]}
@@ -0,0 +1,20 @@
1
+ import * as react from 'react';
2
+ import { MouseEventHandler, FocusEventHandler } from 'react';
3
+ import * as _mantine_core from '@mantine/core';
4
+ import { ActionIconProps } from '@mantine/core';
5
+
6
+ interface ConfirmIconProps extends ActionIconProps {
7
+ onClick?: MouseEventHandler<HTMLButtonElement>;
8
+ onBlur?: FocusEventHandler<HTMLButtonElement>;
9
+ }
10
+ declare const ConfirmIcon: (<C = "button">(props: _mantine_core.PolymorphicComponentProps<C, ConfirmIconProps>) => React.ReactElement) & Omit<react.FunctionComponent<(ConfirmIconProps & {
11
+ component?: any;
12
+ } & Omit<any, "component" | keyof ConfirmIconProps> & {
13
+ ref?: any;
14
+ renderRoot?: (props: any) => any;
15
+ }) | (ConfirmIconProps & {
16
+ component: React.ElementType;
17
+ renderRoot?: (props: Record<string, any>) => any;
18
+ })>, never> & Record<string, never>;
19
+
20
+ export { ConfirmIcon, type ConfirmIconProps };
@@ -0,0 +1,20 @@
1
+ import * as react from 'react';
2
+ import { MouseEventHandler, FocusEventHandler } from 'react';
3
+ import * as _mantine_core from '@mantine/core';
4
+ import { ActionIconProps } from '@mantine/core';
5
+
6
+ interface ConfirmIconProps extends ActionIconProps {
7
+ onClick?: MouseEventHandler<HTMLButtonElement>;
8
+ onBlur?: FocusEventHandler<HTMLButtonElement>;
9
+ }
10
+ declare const ConfirmIcon: (<C = "button">(props: _mantine_core.PolymorphicComponentProps<C, ConfirmIconProps>) => React.ReactElement) & Omit<react.FunctionComponent<(ConfirmIconProps & {
11
+ component?: any;
12
+ } & Omit<any, "component" | keyof ConfirmIconProps> & {
13
+ ref?: any;
14
+ renderRoot?: (props: any) => any;
15
+ }) | (ConfirmIconProps & {
16
+ component: React.ElementType;
17
+ renderRoot?: (props: Record<string, any>) => any;
18
+ })>, never> & Record<string, never>;
19
+
20
+ export { ConfirmIcon, type ConfirmIconProps };
@@ -0,0 +1,54 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import {
3
+ ActionIcon,
4
+ createPolymorphicComponent,
5
+ Loader
6
+ } from "@mantine/core";
7
+ import { Check, CircleQuestionMark } from "lucide-react";
8
+ import {
9
+ forwardRef,
10
+ useEffect,
11
+ useState
12
+ } from "react";
13
+ const ConfirmIcon = createPolymorphicComponent(
14
+ forwardRef(
15
+ ({ children, onClick, onBlur, miw, loading, disabled, ...props }, ref) => {
16
+ const [clickedOnce, setClickedOnce] = useState(false);
17
+ useEffect(() => {
18
+ if (clickedOnce) {
19
+ const timeout = setTimeout(() => {
20
+ setClickedOnce(false);
21
+ }, 4e3);
22
+ return () => clearTimeout(timeout);
23
+ }
24
+ }, [clickedOnce]);
25
+ return /* @__PURE__ */ jsx(
26
+ ActionIcon,
27
+ {
28
+ onClick: (e) => {
29
+ e.stopPropagation();
30
+ if (clickedOnce) {
31
+ onClick?.(e);
32
+ setClickedOnce(false);
33
+ } else {
34
+ setClickedOnce(true);
35
+ }
36
+ },
37
+ onBlur: (e) => {
38
+ setClickedOnce(false);
39
+ onBlur?.(e);
40
+ },
41
+ onPointerDown: (e) => e.stopPropagation(),
42
+ disabled: disabled || loading,
43
+ ...props,
44
+ ref,
45
+ children: clickedOnce ? /* @__PURE__ */ jsx(Check, { size: "1rem" }) : loading ? /* @__PURE__ */ jsx(Loader, { color: "white", size: "1rem" }) : children ?? /* @__PURE__ */ jsx(CircleQuestionMark, { size: "1rem" })
46
+ }
47
+ );
48
+ }
49
+ )
50
+ );
51
+ export {
52
+ ConfirmIcon
53
+ };
54
+ //# sourceMappingURL=confirm-icon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/components/confirm-icon.tsx"],"sourcesContent":["import {\n ActionIcon,\n ActionIconProps,\n createPolymorphicComponent,\n Loader,\n} from \"@mantine/core\";\nimport { Check, CircleQuestionMark } from \"lucide-react\";\nimport {\n FocusEventHandler,\n forwardRef,\n MouseEventHandler,\n useEffect,\n useState,\n} from \"react\";\n\n// https://mantine.dev/guides/polymorphic/#create-your-own-polymorphic-components\n\nexport interface ConfirmIconProps extends ActionIconProps {\n onClick?: MouseEventHandler<HTMLButtonElement>;\n onBlur?: FocusEventHandler<HTMLButtonElement>;\n}\n\nexport const ConfirmIcon = createPolymorphicComponent<\n \"button\",\n ConfirmIconProps\n>(\n forwardRef<HTMLButtonElement, ConfirmIconProps>(\n ({ children, onClick, onBlur, miw, loading, disabled, ...props }, ref) => {\n const [clickedOnce, setClickedOnce] = useState(false);\n useEffect(() => {\n if (clickedOnce) {\n const timeout = setTimeout(() => {\n setClickedOnce(false);\n }, 4_000);\n return () => clearTimeout(timeout);\n }\n }, [clickedOnce]);\n return (\n <ActionIcon\n onClick={(e) => {\n e.stopPropagation();\n if (clickedOnce) {\n onClick?.(e);\n setClickedOnce(false);\n } else {\n setClickedOnce(true);\n }\n }}\n onBlur={(e) => {\n setClickedOnce(false);\n onBlur?.(e);\n }}\n onPointerDown={(e) => e.stopPropagation()}\n disabled={disabled || loading}\n {...props}\n ref={ref}\n >\n {clickedOnce ? (\n <Check size=\"1rem\" />\n ) : loading ? (\n <Loader color=\"white\" size=\"1rem\" />\n ) : (\n (children ?? <CircleQuestionMark size=\"1rem\" />)\n )}\n </ActionIcon>\n );\n },\n ),\n);\n"],"mappings":"AA0DY;AA1DZ;AAAA,EACE;AAAA,EAEA;AAAA,EACA;AAAA,OACK;AACP,SAAS,OAAO,0BAA0B;AAC1C;AAAA,EAEE;AAAA,EAEA;AAAA,EACA;AAAA,OACK;AASA,MAAM,cAAc;AAAA,EAIzB;AAAA,IACE,CAAC,EAAE,UAAU,SAAS,QAAQ,KAAK,SAAS,UAAU,GAAG,MAAM,GAAG,QAAQ;AACxE,YAAM,CAAC,aAAa,cAAc,IAAI,SAAS,KAAK;AACpD,gBAAU,MAAM;AACd,YAAI,aAAa;AACf,gBAAM,UAAU,WAAW,MAAM;AAC/B,2BAAe,KAAK;AAAA,UACtB,GAAG,GAAK;AACR,iBAAO,MAAM,aAAa,OAAO;AAAA,QACnC;AAAA,MACF,GAAG,CAAC,WAAW,CAAC;AAChB,aACE;AAAA,QAAC;AAAA;AAAA,UACC,SAAS,CAAC,MAAM;AACd,cAAE,gBAAgB;AAClB,gBAAI,aAAa;AACf,wBAAU,CAAC;AACX,6BAAe,KAAK;AAAA,YACtB,OAAO;AACL,6BAAe,IAAI;AAAA,YACrB;AAAA,UACF;AAAA,UACA,QAAQ,CAAC,MAAM;AACb,2BAAe,KAAK;AACpB,qBAAS,CAAC;AAAA,UACZ;AAAA,UACA,eAAe,CAAC,MAAM,EAAE,gBAAgB;AAAA,UACxC,UAAU,YAAY;AAAA,UACrB,GAAG;AAAA,UACJ;AAAA,UAEC,wBACC,oBAAC,SAAM,MAAK,QAAO,IACjB,UACF,oBAAC,UAAO,OAAM,SAAQ,MAAK,QAAO,IAEjC,YAAY,oBAAC,sBAAmB,MAAK,QAAO;AAAA;AAAA,MAEjD;AAAA,IAEJ;AAAA,EACF;AACF;","names":[]}