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
package/dist/theme.js ADDED
@@ -0,0 +1,330 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import {
3
+ ActionIcon,
4
+ Badge,
5
+ Button,
6
+ Code,
7
+ colorsTuple,
8
+ Combobox,
9
+ createTheme,
10
+ darken,
11
+ Drawer,
12
+ Fieldset,
13
+ HoverCard,
14
+ Input,
15
+ lighten,
16
+ MantineProvider,
17
+ MenuDropdown,
18
+ Modal,
19
+ MultiSelect,
20
+ PopoverDropdown,
21
+ Progress,
22
+ SegmentedControl,
23
+ Select,
24
+ Switch,
25
+ Table,
26
+ Tabs,
27
+ virtualColor
28
+ } from "@mantine/core";
29
+ import { hexColorByIntention } from "./color";
30
+ const LIGHT_BODY = "#f8f9fa";
31
+ const DARK_BODY = "#0f1115";
32
+ const DEFAULT_COLOR_SCHEME = "auto";
33
+ function ThemeProvider({
34
+ children,
35
+ additionalColors
36
+ }) {
37
+ return /* @__PURE__ */ jsx(
38
+ MantineProvider,
39
+ {
40
+ theme: theme(additionalColors),
41
+ cssVariablesResolver,
42
+ defaultColorScheme: DEFAULT_COLOR_SCHEME,
43
+ children
44
+ }
45
+ );
46
+ }
47
+ function theme(additionalColors) {
48
+ return createTheme({
49
+ cursorType: "pointer",
50
+ primaryColor: "accent",
51
+ breakpoints: {
52
+ xs: "36em",
53
+ sm: "48em",
54
+ md: "66em",
55
+ lg: "82em",
56
+ xl: "96em",
57
+ xl2: "110em",
58
+ xl3: "126em",
59
+ xl4: "142em"
60
+ },
61
+ colors: {
62
+ // Accent background color
63
+ lightAccent: functionColorsTuple(
64
+ darken(LIGHT_BODY, 0.02),
65
+ (color) => darken(color, 0.01)
66
+ ),
67
+ darkAccent: functionColorsTuple(
68
+ lighten(DARK_BODY, 0.025),
69
+ (color) => lighten(color, 0.02)
70
+ ),
71
+ accent: virtualColor({
72
+ name: "accent",
73
+ light: "lightAccent",
74
+ dark: "darkAccent"
75
+ }),
76
+ // Accent border color
77
+ lightAccentBorder: functionColorsTuple(
78
+ darken(LIGHT_BODY, 0.1),
79
+ (color) => darken(color, 0.01)
80
+ ),
81
+ darkAccentBorder: functionColorsTuple(
82
+ lighten(DARK_BODY, 0.08),
83
+ (color) => lighten(color, 0.03)
84
+ ),
85
+ "accent-border": virtualColor({
86
+ name: "accent-border",
87
+ light: "lightAccentBorder",
88
+ dark: "darkAccentBorder"
89
+ }),
90
+ lightBw: colorsTuple("#000000"),
91
+ darkBw: colorsTuple("#FFFFFF"),
92
+ bw: virtualColor({
93
+ name: "bw",
94
+ light: "lightBw",
95
+ dark: "darkBw"
96
+ }),
97
+ // Intention colors
98
+ Good: colorsTuple(hexColorByIntention("Good")),
99
+ Neutral: colorsTuple(hexColorByIntention("Neutral")),
100
+ Warning: colorsTuple(hexColorByIntention("Warning")),
101
+ Critical: colorsTuple(hexColorByIntention("Critical")),
102
+ Unknown: colorsTuple(hexColorByIntention("Unknown")),
103
+ // Additional colors (eg tags)
104
+ ...additionalColors
105
+ },
106
+ components: {
107
+ Input: Input.extend({
108
+ vars: (theme2) => ({
109
+ wrapper: {
110
+ "--input-radius": theme2.radius.sm
111
+ }
112
+ }),
113
+ styles: (theme2) => ({
114
+ input: {
115
+ backgroundColor: theme2.colors.accent[1],
116
+ border: "1px solid " + theme2.colors["accent-border"][4]
117
+ }
118
+ })
119
+ }),
120
+ Select: Select.extend({
121
+ styles: (theme2) => ({
122
+ input: {
123
+ backgroundColor: theme2.colors.accent[1],
124
+ border: "1px solid " + theme2.colors["accent-border"][4]
125
+ },
126
+ dropdown: {
127
+ backgroundColor: theme2.colors.accent[1],
128
+ borderColor: theme2.colors["accent-border"][4]
129
+ }
130
+ })
131
+ }),
132
+ MultiSelect: MultiSelect.extend({
133
+ styles: (theme2) => ({
134
+ input: {
135
+ backgroundColor: theme2.colors.accent[1],
136
+ border: "1px solid " + theme2.colors["accent-border"][4]
137
+ },
138
+ dropdown: {
139
+ backgroundColor: theme2.colors.accent[1],
140
+ borderColor: theme2.colors["accent-border"][4]
141
+ }
142
+ }),
143
+ defaultProps: {
144
+ maxDropdownHeight: 250
145
+ }
146
+ }),
147
+ Combobox: Combobox.extend({
148
+ styles: (theme2) => ({
149
+ dropdown: {
150
+ backgroundColor: theme2.colors.accent[1],
151
+ border: "1px solid " + theme2.colors["accent-border"][4]
152
+ }
153
+ })
154
+ }),
155
+ MenuDropdown: MenuDropdown.extend({
156
+ defaultProps: {
157
+ bg: "var(--mantine-color-accent-1)",
158
+ bd: "1px solid var(--mantine-color-accent-border-4)",
159
+ bdrs: "md"
160
+ }
161
+ }),
162
+ PopoverDropdown: PopoverDropdown.extend({
163
+ defaultProps: {
164
+ bg: "var(--mantine-color-accent-1)",
165
+ bd: "1px solid var(--mantine-color-accent-border-4)",
166
+ bdrs: "md"
167
+ }
168
+ }),
169
+ HoverCard: HoverCard.extend({
170
+ styles: (theme2) => ({
171
+ dropdown: {
172
+ backgroundColor: theme2.colors.accent[1],
173
+ border: "1px solid " + theme2.colors["accent-border"][4]
174
+ }
175
+ })
176
+ }),
177
+ Button: Button.extend({
178
+ vars: (theme2) => ({
179
+ root: {
180
+ "--button-color": theme2.colors.bw[0],
181
+ "--button-radius": theme2.radius.sm
182
+ }
183
+ }),
184
+ defaultProps: {
185
+ variant: "default"
186
+ },
187
+ classNames: { root: "bordered-heavy-outline" }
188
+ }),
189
+ ActionIcon: ActionIcon.extend({
190
+ vars: (theme2) => ({
191
+ root: {
192
+ "--ai-color": theme2.colors.bw[0],
193
+ "--ai-radius": theme2.radius.sm
194
+ }
195
+ })
196
+ }),
197
+ Switch: Switch.extend({
198
+ defaultProps: {
199
+ color: "green"
200
+ }
201
+ }),
202
+ Badge: Badge.extend({
203
+ defaultProps: {
204
+ bdrs: "sm",
205
+ c: "var(--mantine-color-text)"
206
+ }
207
+ }),
208
+ Table: Table.extend({
209
+ vars: (theme2) => ({
210
+ table: {
211
+ "--table-striped-color": theme2.colors.accent[0],
212
+ "--table-border-color": theme2.colors["accent-border"][0],
213
+ "--table-highlight-on-hover-color": theme2.colors["accent-border"][0]
214
+ }
215
+ }),
216
+ defaultProps: {
217
+ striped: true,
218
+ highlightOnHover: true
219
+ }
220
+ }),
221
+ Drawer: Drawer.extend({
222
+ vars: () => ({
223
+ root: {
224
+ "--drawer-flex": ""
225
+ }
226
+ }),
227
+ defaultProps: {
228
+ position: "top",
229
+ radius: "md"
230
+ },
231
+ styles: {
232
+ inner: { justifyContent: "center" }
233
+ }
234
+ }),
235
+ Modal: Modal.extend({
236
+ defaultProps: {
237
+ styles: { content: { borderRadius: "var(--mantine-radius-md)" } }
238
+ }
239
+ }),
240
+ Code: Code.extend({
241
+ defaultProps: {
242
+ bg: "var(--mantine-color-accent-0)",
243
+ bdrs: "sm",
244
+ p: "md"
245
+ }
246
+ }),
247
+ Fieldset: Fieldset.extend({
248
+ styles: (theme2) => ({
249
+ root: {
250
+ backgroundColor: "var(--mantine-color-body)",
251
+ borderRadius: theme2.radius.md
252
+ }
253
+ }),
254
+ classNames: { root: "bordered-light" }
255
+ }),
256
+ SegmentedControl: SegmentedControl.extend({
257
+ styles: (theme2) => ({
258
+ root: {
259
+ backgroundColor: theme2.colors.accent[2]
260
+ },
261
+ indicator: {
262
+ backgroundColor: theme2.colors.accent[9]
263
+ }
264
+ }),
265
+ classNames: { root: "bordered-heavy" }
266
+ }),
267
+ Progress: Progress.extend({
268
+ styles: (theme2) => ({
269
+ root: {
270
+ backgroundColor: theme2.colors.accent[4]
271
+ }
272
+ })
273
+ }),
274
+ Tabs: Tabs.extend({
275
+ vars: (theme2) => ({
276
+ root: {
277
+ "--tabs-radius": theme2.radius.sm
278
+ }
279
+ }),
280
+ styles: (theme2) => ({
281
+ list: {
282
+ backgroundColor: theme2.colors.accent[1],
283
+ borderRadius: theme2.radius.sm
284
+ }
285
+ })
286
+ })
287
+ }
288
+ });
289
+ }
290
+ const cssVariablesResolver = (theme2) => ({
291
+ variables: {},
292
+ light: {
293
+ "--mantine-color-default": theme2.colors.accent[5],
294
+ "--mantine-color-default-hover": theme2.colors.accent[9],
295
+ "--mantine-color-default-border": theme2.colors["accent-border"][5],
296
+ "--mantine-color-disabled": theme2.colors.accent[1]
297
+ },
298
+ dark: {
299
+ "--mantine-color-default": theme2.colors.accent[5],
300
+ "--mantine-color-default-hover": theme2.colors.accent[9],
301
+ "--mantine-color-default-border": theme2.colors["accent-border"][5],
302
+ "--mantine-color-disabled": theme2.colors.accent[1]
303
+ }
304
+ });
305
+ function opacityColorsTuple(baseHex, length = 10) {
306
+ return colorsTuple(
307
+ Array.from({ length }).map(
308
+ (_, i) => baseHex + (i * 10 + 9).toString(16).padStart(2, "0")
309
+ )
310
+ );
311
+ }
312
+ function functionColorsTuple(base, fn, length = 10) {
313
+ let b = base;
314
+ const array = [
315
+ base,
316
+ ...Array.from({ length: length - 1 }).map(() => {
317
+ b = fn(b);
318
+ return b;
319
+ })
320
+ ];
321
+ return colorsTuple(array);
322
+ }
323
+ export {
324
+ DARK_BODY,
325
+ LIGHT_BODY,
326
+ ThemeProvider,
327
+ functionColorsTuple,
328
+ opacityColorsTuple
329
+ };
330
+ //# sourceMappingURL=theme.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/theme.tsx"],"sourcesContent":["import {\n ActionIcon,\n Badge,\n Button,\n Code,\n colorsTuple,\n Combobox,\n createTheme,\n CSSVariablesResolver,\n darken,\n DefaultMantineColor,\n Drawer,\n Fieldset,\n HoverCard,\n Input,\n lighten,\n MantineColorScheme,\n MantineColorsTuple,\n MantineProvider,\n MenuDropdown,\n Modal,\n MultiSelect,\n PopoverDropdown,\n Progress,\n SegmentedControl,\n Select,\n Switch,\n Table,\n Tabs,\n virtualColor,\n} from \"@mantine/core\";\nimport { ReactNode } from \"react\";\nimport { hexColorByIntention } from \"./color\";\n\n// Match in ./index.css\nexport const LIGHT_BODY = \"#f8f9fa\";\nexport const DARK_BODY = \"#0f1115\";\n\nconst DEFAULT_COLOR_SCHEME: MantineColorScheme = \"auto\";\n\nexport function ThemeProvider({\n children,\n additionalColors,\n}: {\n children: ReactNode;\n additionalColors?: AdditionalColors;\n}) {\n return (\n <MantineProvider\n theme={theme(additionalColors)}\n cssVariablesResolver={cssVariablesResolver}\n defaultColorScheme={DEFAULT_COLOR_SCHEME}\n >\n {children}\n </MantineProvider>\n );\n}\n\nexport type AdditionalColors =\n | Partial<Record<DefaultMantineColor, MantineColorsTuple>>\n | undefined;\n\nfunction theme(additionalColors?: AdditionalColors) {\n return createTheme({\n cursorType: \"pointer\",\n primaryColor: \"accent\",\n breakpoints: {\n xs: \"36em\",\n sm: \"48em\",\n md: \"66em\",\n lg: \"82em\",\n xl: \"96em\",\n xl2: \"110em\",\n xl3: \"126em\",\n xl4: \"142em\",\n },\n colors: {\n // Accent background color\n lightAccent: functionColorsTuple(darken(LIGHT_BODY, 0.02), (color) =>\n darken(color, 0.01),\n ),\n darkAccent: functionColorsTuple(lighten(DARK_BODY, 0.025), (color) =>\n lighten(color, 0.02),\n ),\n accent: virtualColor({\n name: \"accent\",\n light: \"lightAccent\",\n dark: \"darkAccent\",\n }),\n // Accent border color\n lightAccentBorder: functionColorsTuple(darken(LIGHT_BODY, 0.1), (color) =>\n darken(color, 0.01),\n ),\n darkAccentBorder: functionColorsTuple(lighten(DARK_BODY, 0.08), (color) =>\n lighten(color, 0.03),\n ),\n \"accent-border\": virtualColor({\n name: \"accent-border\",\n light: \"lightAccentBorder\",\n dark: \"darkAccentBorder\",\n }),\n lightBw: colorsTuple(\"#000000\"),\n darkBw: colorsTuple(\"#FFFFFF\"),\n bw: virtualColor({\n name: \"bw\",\n light: \"lightBw\",\n dark: \"darkBw\",\n }),\n // Intention colors\n Good: colorsTuple(hexColorByIntention(\"Good\")!),\n Neutral: colorsTuple(hexColorByIntention(\"Neutral\")!),\n Warning: colorsTuple(hexColorByIntention(\"Warning\")!),\n Critical: colorsTuple(hexColorByIntention(\"Critical\")!),\n Unknown: colorsTuple(hexColorByIntention(\"Unknown\")!),\n // Additional colors (eg tags)\n ...additionalColors,\n },\n components: {\n Input: Input.extend({\n vars: (theme) => ({\n wrapper: {\n \"--input-radius\": theme.radius.sm,\n },\n }),\n styles: (theme) => ({\n input: {\n backgroundColor: theme.colors.accent[1],\n border: \"1px solid \" + theme.colors[\"accent-border\"][4],\n },\n }),\n }),\n Select: Select.extend({\n styles: (theme) => ({\n input: {\n backgroundColor: theme.colors.accent[1],\n border: \"1px solid \" + theme.colors[\"accent-border\"][4],\n },\n dropdown: {\n backgroundColor: theme.colors.accent[1],\n borderColor: theme.colors[\"accent-border\"][4],\n },\n }),\n }),\n MultiSelect: MultiSelect.extend({\n styles: (theme) => ({\n input: {\n backgroundColor: theme.colors.accent[1],\n border: \"1px solid \" + theme.colors[\"accent-border\"][4],\n },\n dropdown: {\n backgroundColor: theme.colors.accent[1],\n borderColor: theme.colors[\"accent-border\"][4],\n },\n }),\n defaultProps: {\n maxDropdownHeight: 250,\n },\n }),\n Combobox: Combobox.extend({\n styles: (theme) => ({\n dropdown: {\n backgroundColor: theme.colors.accent[1],\n border: \"1px solid \" + theme.colors[\"accent-border\"][4],\n },\n }),\n }),\n MenuDropdown: MenuDropdown.extend({\n defaultProps: {\n bg: \"var(--mantine-color-accent-1)\",\n bd: \"1px solid var(--mantine-color-accent-border-4)\",\n bdrs: \"md\",\n },\n }),\n PopoverDropdown: PopoverDropdown.extend({\n defaultProps: {\n bg: \"var(--mantine-color-accent-1)\",\n bd: \"1px solid var(--mantine-color-accent-border-4)\",\n bdrs: \"md\",\n },\n }),\n HoverCard: HoverCard.extend({\n styles: (theme) => ({\n dropdown: {\n backgroundColor: theme.colors.accent[1],\n border: \"1px solid \" + theme.colors[\"accent-border\"][4],\n },\n }),\n }),\n Button: Button.extend({\n vars: (theme) => ({\n root: {\n \"--button-color\": theme.colors.bw[0],\n \"--button-radius\": theme.radius.sm,\n },\n }),\n defaultProps: {\n variant: \"default\",\n },\n classNames: { root: \"bordered-heavy-outline\" },\n }),\n ActionIcon: ActionIcon.extend({\n vars: (theme) => ({\n root: {\n \"--ai-color\": theme.colors.bw[0],\n \"--ai-radius\": theme.radius.sm,\n },\n }),\n }),\n Switch: Switch.extend({\n defaultProps: {\n color: \"green\",\n },\n }),\n Badge: Badge.extend({\n defaultProps: {\n bdrs: \"sm\",\n c: \"var(--mantine-color-text)\",\n },\n }),\n Table: Table.extend({\n vars: (theme) => ({\n table: {\n \"--table-striped-color\": theme.colors.accent[0],\n \"--table-border-color\": theme.colors[\"accent-border\"][0],\n \"--table-highlight-on-hover-color\":\n theme.colors[\"accent-border\"][0],\n },\n }),\n defaultProps: {\n striped: true,\n highlightOnHover: true,\n },\n }),\n Drawer: Drawer.extend({\n vars: () => ({\n root: {\n \"--drawer-flex\": \"\",\n },\n }),\n defaultProps: {\n position: \"top\",\n radius: \"md\",\n },\n styles: {\n inner: { justifyContent: \"center\" },\n },\n }),\n Modal: Modal.extend({\n defaultProps: {\n styles: { content: { borderRadius: \"var(--mantine-radius-md)\" } },\n },\n }),\n Code: Code.extend({\n defaultProps: {\n bg: \"var(--mantine-color-accent-0)\",\n bdrs: \"sm\",\n p: \"md\",\n },\n }),\n Fieldset: Fieldset.extend({\n styles: (theme) => ({\n root: {\n backgroundColor: \"var(--mantine-color-body)\",\n borderRadius: theme.radius.md,\n },\n }),\n classNames: { root: \"bordered-light\" },\n }),\n SegmentedControl: SegmentedControl.extend({\n styles: (theme) => ({\n root: {\n backgroundColor: theme.colors.accent[2],\n },\n indicator: {\n backgroundColor: theme.colors.accent[9],\n },\n }),\n classNames: { root: \"bordered-heavy\" },\n }),\n Progress: Progress.extend({\n styles: (theme) => ({\n root: {\n backgroundColor: theme.colors.accent[4],\n },\n }),\n }),\n Tabs: Tabs.extend({\n vars: (theme) => ({\n root: {\n \"--tabs-radius\": theme.radius.sm,\n },\n }),\n styles: (theme) => ({\n list: {\n backgroundColor: theme.colors.accent[1],\n borderRadius: theme.radius.sm,\n },\n }),\n }),\n },\n });\n}\n\nconst cssVariablesResolver: CSSVariablesResolver = (theme) => ({\n variables: {},\n light: {\n \"--mantine-color-default\": theme.colors.accent[5],\n \"--mantine-color-default-hover\": theme.colors.accent[9],\n \"--mantine-color-default-border\": theme.colors[\"accent-border\"][5],\n \"--mantine-color-disabled\": theme.colors.accent[1],\n },\n dark: {\n \"--mantine-color-default\": theme.colors.accent[5],\n \"--mantine-color-default-hover\": theme.colors.accent[9],\n \"--mantine-color-default-border\": theme.colors[\"accent-border\"][5],\n \"--mantine-color-disabled\": theme.colors.accent[1],\n },\n});\n\nexport function opacityColorsTuple(baseHex: string, length = 10) {\n return colorsTuple(\n Array.from({ length }).map(\n (_, i) => baseHex + (i * 10 + 9).toString(16).padStart(2, \"0\"),\n ),\n );\n}\n\nexport function functionColorsTuple(\n base: string,\n fn: (color: string) => string,\n length = 10,\n) {\n let b = base;\n const array = [\n base,\n ...Array.from({ length: length - 1 }).map(() => {\n b = fn(b);\n return b;\n }),\n ];\n return colorsTuple(array);\n}\n"],"mappings":"AAgDI;AAhDJ;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAGA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,2BAA2B;AAG7B,MAAM,aAAa;AACnB,MAAM,YAAY;AAEzB,MAAM,uBAA2C;AAE1C,SAAS,cAAc;AAAA,EAC5B;AA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OAAM,OAAO,eAAe,EAAE,CAAC;AAAA,IACjE,4BAA4BA,OAAM,OAAO,OAAO,CAAC;AAAA,EACnD;AACF;AAEO,SAAS,mBAAmB,SAAiB,SAAS,IAAI;AAC/D,SAAO;AAAA,IACL,MAAM,KAAK,EAAE,OAAO,CAAC,EAAE;AAAA,MACrB,CAAC,GAAG,MAAM,WAAW,IAAI,KAAK,GAAG,SAAS,EAAE,EAAE,SAAS,GAAG,GAAG;AAAA,IAC/D;AAAA,EACF;AACF;AAEO,SAAS,oBACd,MACA,IACA,SAAS,IACT;AACA,MAAI,IAAI;AACR,QAAM,QAAQ;AAAA,IACZ;AAAA,IACA,GAAG,MAAM,KAAK,EAAE,QAAQ,SAAS,EAAE,CAAC,EAAE,IAAI,MAAM;AAC9C,UAAI,GAAG,CAAC;AACR,aAAO;AAAA,IACT,CAAC;AAAA,EACH;AACA,SAAO,YAAY,KAAK;AAC1B;","names":["theme"]}
@@ -0,0 +1,76 @@
1
+ // https://mantine.dev/styles/sass/#usage-with-vite
2
+ @use "sass:math";
3
+
4
+ :root[data-mantine-color-scheme="light"] {
5
+ --mantine-color-body: #f8f9fa;
6
+ --mantine-color-text: #000000;
7
+ }
8
+
9
+ :root[data-mantine-color-scheme="dark"] {
10
+ --mantine-color-body: #0f1115;
11
+ --mantine-color-text: #ffffff;
12
+ }
13
+
14
+ $mantine-breakpoint-xs: "40em";
15
+ $mantine-breakpoint-sm: "54em";
16
+ $mantine-breakpoint-md: "68em";
17
+ $mantine-breakpoint-lg: "82em";
18
+ $mantine-breakpoint-xl: "96em";
19
+ $mantine-breakpoint-xl2: "110em";
20
+ $mantine-breakpoint-xl3: "126em";
21
+ $mantine-breakpoint-xl4: "142em";
22
+
23
+ @function rem($value) {
24
+ @return #{math.div(math.div($value, $value * 0 + 1), 16)}rem;
25
+ }
26
+
27
+ @mixin light {
28
+ [data-mantine-color-scheme="light"] & {
29
+ @content;
30
+ }
31
+ }
32
+
33
+ @mixin dark {
34
+ [data-mantine-color-scheme="dark"] & {
35
+ @content;
36
+ }
37
+ }
38
+
39
+ @mixin hover {
40
+ @media (hover: hover) {
41
+ &:hover {
42
+ @content;
43
+ }
44
+ }
45
+
46
+ @media (hover: none) {
47
+ &:active {
48
+ @content;
49
+ }
50
+ }
51
+ }
52
+
53
+ @mixin smaller-than($breakpoint) {
54
+ @media (max-width: $breakpoint) {
55
+ @content;
56
+ }
57
+ }
58
+
59
+ @mixin larger-than($breakpoint) {
60
+ @media (min-width: $breakpoint) {
61
+ @content;
62
+ }
63
+ }
64
+
65
+ // Add direction mixins if you need rtl support
66
+ @mixin rtl {
67
+ [dir="rtl"] & {
68
+ @content;
69
+ }
70
+ }
71
+
72
+ @mixin ltr {
73
+ [dir="ltr"] & {
74
+ @content;
75
+ }
76
+ }
package/dist/utils.cjs ADDED
@@ -0,0 +1,48 @@
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 utils_exports = {};
20
+ __export(utils_exports, {
21
+ deepCompare: () => deepCompare
22
+ });
23
+ module.exports = __toCommonJS(utils_exports);
24
+ function deepCompare(a, b) {
25
+ if (!a || !b) {
26
+ return a === b;
27
+ }
28
+ const ta = typeof a;
29
+ const tb = typeof b;
30
+ if (ta !== tb) return false;
31
+ if (ta === "function") return true;
32
+ if (ta === "object") {
33
+ const ea = Object.entries(a);
34
+ const kb = Object.keys(b);
35
+ if (ea.length !== kb.length) return false;
36
+ for (const [key, va] of ea) {
37
+ const vb = b[key];
38
+ if (!deepCompare(va, vb)) return false;
39
+ }
40
+ return true;
41
+ }
42
+ return a === b;
43
+ }
44
+ // Annotate the CommonJS export names for ESM import in node:
45
+ 0 && (module.exports = {
46
+ deepCompare
47
+ });
48
+ //# sourceMappingURL=utils.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/utils.ts"],"sourcesContent":["/**\n * Does deep compare of 2 items, returning `true` if equal.\n *\n * - Functions: Always `true`\n * - Primitives: Returns direct `a === b`\n * - Arrays: Returns same items and ordering (recursive)\n * - Objects: Returns same keys / values (recursive)\n *\n * @param a Item a\n * @param b Item b\n * @returns a === b\n */\nexport function deepCompare(a: any, b: any) {\n // Short path for falsy. Important to catch typeof null === \"object\" edge case.\n if (!a || !b) {\n return a === b;\n }\n\n const ta = typeof a;\n const tb = typeof b;\n\n if (ta !== tb) return false;\n\n if (ta === \"function\") return true;\n\n if (ta === \"object\") {\n const ea = Object.entries(a);\n const kb = Object.keys(b);\n\n // Length not equal -> false\n if (ea.length !== kb.length) return false;\n\n for (const [key, va] of ea) {\n const vb = b[key];\n\n // Early return when any not equal\n if (!deepCompare(va, vb)) return false;\n }\n\n // If it gets through all, it's equal\n return true;\n }\n\n return a === b;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAYO,SAAS,YAAY,GAAQ,GAAQ;AAE1C,MAAI,CAAC,KAAK,CAAC,GAAG;AACZ,WAAO,MAAM;AAAA,EACf;AAEA,QAAM,KAAK,OAAO;AAClB,QAAM,KAAK,OAAO;AAElB,MAAI,OAAO,GAAI,QAAO;AAEtB,MAAI,OAAO,WAAY,QAAO;AAE9B,MAAI,OAAO,UAAU;AACnB,UAAM,KAAK,OAAO,QAAQ,CAAC;AAC3B,UAAM,KAAK,OAAO,KAAK,CAAC;AAGxB,QAAI,GAAG,WAAW,GAAG,OAAQ,QAAO;AAEpC,eAAW,CAAC,KAAK,EAAE,KAAK,IAAI;AAC1B,YAAM,KAAK,EAAE,GAAG;AAGhB,UAAI,CAAC,YAAY,IAAI,EAAE,EAAG,QAAO;AAAA,IACnC;AAGA,WAAO;AAAA,EACT;AAEA,SAAO,MAAM;AACf;","names":[]}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Does deep compare of 2 items, returning `true` if equal.
3
+ *
4
+ * - Functions: Always `true`
5
+ * - Primitives: Returns direct `a === b`
6
+ * - Arrays: Returns same items and ordering (recursive)
7
+ * - Objects: Returns same keys / values (recursive)
8
+ *
9
+ * @param a Item a
10
+ * @param b Item b
11
+ * @returns a === b
12
+ */
13
+ declare function deepCompare(a: any, b: any): boolean;
14
+
15
+ export { deepCompare };
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Does deep compare of 2 items, returning `true` if equal.
3
+ *
4
+ * - Functions: Always `true`
5
+ * - Primitives: Returns direct `a === b`
6
+ * - Arrays: Returns same items and ordering (recursive)
7
+ * - Objects: Returns same keys / values (recursive)
8
+ *
9
+ * @param a Item a
10
+ * @param b Item b
11
+ * @returns a === b
12
+ */
13
+ declare function deepCompare(a: any, b: any): boolean;
14
+
15
+ export { deepCompare };
package/dist/utils.js ADDED
@@ -0,0 +1,24 @@
1
+ function deepCompare(a, b) {
2
+ if (!a || !b) {
3
+ return a === b;
4
+ }
5
+ const ta = typeof a;
6
+ const tb = typeof b;
7
+ if (ta !== tb) return false;
8
+ if (ta === "function") return true;
9
+ if (ta === "object") {
10
+ const ea = Object.entries(a);
11
+ const kb = Object.keys(b);
12
+ if (ea.length !== kb.length) return false;
13
+ for (const [key, va] of ea) {
14
+ const vb = b[key];
15
+ if (!deepCompare(va, vb)) return false;
16
+ }
17
+ return true;
18
+ }
19
+ return a === b;
20
+ }
21
+ export {
22
+ deepCompare
23
+ };
24
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/utils.ts"],"sourcesContent":["/**\n * Does deep compare of 2 items, returning `true` if equal.\n *\n * - Functions: Always `true`\n * - Primitives: Returns direct `a === b`\n * - Arrays: Returns same items and ordering (recursive)\n * - Objects: Returns same keys / values (recursive)\n *\n * @param a Item a\n * @param b Item b\n * @returns a === b\n */\nexport function deepCompare(a: any, b: any) {\n // Short path for falsy. Important to catch typeof null === \"object\" edge case.\n if (!a || !b) {\n return a === b;\n }\n\n const ta = typeof a;\n const tb = typeof b;\n\n if (ta !== tb) return false;\n\n if (ta === \"function\") return true;\n\n if (ta === \"object\") {\n const ea = Object.entries(a);\n const kb = Object.keys(b);\n\n // Length not equal -> false\n if (ea.length !== kb.length) return false;\n\n for (const [key, va] of ea) {\n const vb = b[key];\n\n // Early return when any not equal\n if (!deepCompare(va, vb)) return false;\n }\n\n // If it gets through all, it's equal\n return true;\n }\n\n return a === b;\n}\n"],"mappings":"AAYO,SAAS,YAAY,GAAQ,GAAQ;AAE1C,MAAI,CAAC,KAAK,CAAC,GAAG;AACZ,WAAO,MAAM;AAAA,EACf;AAEA,QAAM,KAAK,OAAO;AAClB,QAAM,KAAK,OAAO;AAElB,MAAI,OAAO,GAAI,QAAO;AAEtB,MAAI,OAAO,WAAY,QAAO;AAE9B,MAAI,OAAO,UAAU;AACnB,UAAM,KAAK,OAAO,QAAQ,CAAC;AAC3B,UAAM,KAAK,OAAO,KAAK,CAAC;AAGxB,QAAI,GAAG,WAAW,GAAG,OAAQ,QAAO;AAEpC,eAAW,CAAC,KAAK,EAAE,KAAK,IAAI;AAC1B,YAAM,KAAK,EAAE,GAAG;AAGhB,UAAI,CAAC,YAAY,IAAI,EAAE,EAAG,QAAO;AAAA,IACnC;AAGA,WAAO;AAAA,EACT;AAEA,SAAO,MAAM;AACf;","names":[]}
package/package.json ADDED
@@ -0,0 +1,61 @@
1
+ {
2
+ "name": "mogh_ui",
3
+ "version": "0.1.0",
4
+ "description": "Common UI components and styling used across Mogh apps.",
5
+ "type": "module",
6
+ "main": "./dist/index.cjs",
7
+ "module": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "import": {
12
+ "types": "./dist/index.d.ts",
13
+ "default": "./dist/index.js"
14
+ },
15
+ "require": {
16
+ "types": "./dist/index.d.cts",
17
+ "default": "./dist/index.cjs"
18
+ }
19
+ },
20
+ "./index.scss": "./dist/index.scss",
21
+ "./theme.scss": "./dist/theme.scss"
22
+ },
23
+ "files": [
24
+ "dist"
25
+ ],
26
+ "scripts": {
27
+ "build": "tsup && cd src && find . -name '*.scss' -exec cp --parents {} ../dist \\;",
28
+ "dev": "tsup --watch",
29
+ "typecheck": "tsc --noEmit"
30
+ },
31
+ "peerDependencies": {
32
+ "@mantine/core": "^9.0.0",
33
+ "@mantine/hooks": "^9.0.0",
34
+ "@mantine/notifications": "^9.0.0",
35
+ "@monaco-editor/react": "^4.7.0",
36
+ "@tanstack/react-table": "^8.21.3",
37
+ "lucide-react": "^1.7.0",
38
+ "monaco-editor": "^0.55.1",
39
+ "monaco-yaml": "^5.4.1",
40
+ "react": "^19.0.0",
41
+ "react-dom": "^19.0.0",
42
+ "react-router-dom": "^7.14.0"
43
+ },
44
+ "devDependencies": {
45
+ "@mantine/core": "^9.0.0",
46
+ "@mantine/hooks": "^9.0.0",
47
+ "@mantine/notifications": "^9.0.0",
48
+ "@monaco-editor/react": "^4.7.0",
49
+ "@tanstack/react-table": "^8.21.3",
50
+ "@types/react": "^19.0.0",
51
+ "@types/react-dom": "^19.0.0",
52
+ "lucide-react": "^1.7.0",
53
+ "monaco-editor": "^0.55.1",
54
+ "monaco-yaml": "^5.4.1",
55
+ "react": "^19.0.0",
56
+ "react-dom": "^19.0.0",
57
+ "react-router-dom": "^7.14.0",
58
+ "tsup": "^8.5.1",
59
+ "typescript": "^6.0.2"
60
+ }
61
+ }