@alepha/ui 0.13.2 → 0.13.3

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 (116) hide show
  1. package/dist/admin/AdminLayout-JakF7ESb.js +388 -0
  2. package/dist/admin/AdminLayout-JakF7ESb.js.map +1 -0
  3. package/dist/admin/AdminLayout-qNsIyl30.js +3 -0
  4. package/dist/admin/AdminNotifications-BPrxALdS.js +154 -0
  5. package/dist/admin/AdminNotifications-BPrxALdS.js.map +1 -0
  6. package/dist/admin/AdminNotifications-DV-35Fi3.js +3 -0
  7. package/dist/admin/{AdminSessions-CmDVneE2.js → AdminSessions-CMmBtbSw.js} +36 -9
  8. package/dist/admin/AdminSessions-CMmBtbSw.js.map +1 -0
  9. package/dist/admin/AdminSessions-Df2VYzlE.js +3 -0
  10. package/dist/admin/AdminUserCreate-Coa_yi6m.js +103 -0
  11. package/dist/admin/AdminUserCreate-Coa_yi6m.js.map +1 -0
  12. package/dist/admin/AdminUserCreate-DjiCcAk0.js +3 -0
  13. package/dist/admin/AdminUserDetails-BCFwOm9w.js +221 -0
  14. package/dist/admin/AdminUserDetails-BCFwOm9w.js.map +1 -0
  15. package/dist/admin/AdminUserDetails-C5yeJNa3.js +3 -0
  16. package/dist/admin/AdminUserLayout-B8ga5QvP.js +3 -0
  17. package/dist/admin/AdminUserLayout-CR2OqV9Z.js +153 -0
  18. package/dist/admin/AdminUserLayout-CR2OqV9Z.js.map +1 -0
  19. package/dist/admin/AdminUserSessions-A_5KkqTY.js +3 -0
  20. package/dist/admin/AdminUserSessions-Bcf6-rjG.js +129 -0
  21. package/dist/admin/AdminUserSessions-Bcf6-rjG.js.map +1 -0
  22. package/dist/admin/AdminUserSettings-DAsAhFjX.js +3 -0
  23. package/dist/admin/AdminUserSettings-DRYVdW6S.js +164 -0
  24. package/dist/admin/AdminUserSettings-DRYVdW6S.js.map +1 -0
  25. package/dist/admin/AdminUsers-Dd9a5UqO.js +3 -0
  26. package/dist/admin/{AdminUsers-88De5pev.js → AdminUsers-IN_2yHKt.js} +32 -14
  27. package/dist/admin/AdminUsers-IN_2yHKt.js.map +1 -0
  28. package/dist/admin/index.d.ts +5560 -416
  29. package/dist/admin/index.js +299 -41
  30. package/dist/admin/index.js.map +1 -1
  31. package/dist/auth/AuthLayout-BSL8ZHgr.js +19 -0
  32. package/dist/auth/AuthLayout-BSL8ZHgr.js.map +1 -0
  33. package/dist/auth/Login-DDsyCNAA.js +4 -0
  34. package/dist/auth/{Login-OCrvjs9U.js → Login-kBfaRgKG.js} +5 -4
  35. package/dist/auth/Login-kBfaRgKG.js.map +1 -0
  36. package/dist/auth/{Register-Ei34GSba.js → Register-BxJmOqpF.js} +9 -6
  37. package/dist/auth/Register-BxJmOqpF.js.map +1 -0
  38. package/dist/auth/Register-D10MnlQc.js +4 -0
  39. package/dist/auth/{ResetPassword-tO0oMzfo.js → ResetPassword-BhyZ9ek4.js} +3 -3
  40. package/dist/auth/ResetPassword-BhyZ9ek4.js.map +1 -0
  41. package/dist/auth/ResetPassword-llBG-STp.js +3 -0
  42. package/dist/auth/VerifyEmail-BvOG-IUC.js +3 -0
  43. package/dist/auth/VerifyEmail-DeLct3oQ.js +131 -0
  44. package/dist/auth/VerifyEmail-DeLct3oQ.js.map +1 -0
  45. package/dist/auth/index.d.ts +2412 -2254
  46. package/dist/auth/index.js +96 -20
  47. package/dist/auth/index.js.map +1 -1
  48. package/dist/core/index.d.ts +280 -95
  49. package/dist/core/index.js +1381 -392
  50. package/dist/core/index.js.map +1 -1
  51. package/package.json +5 -5
  52. package/src/admin/AdminRouter.ts +116 -29
  53. package/src/admin/MainRouter.ts +23 -0
  54. package/src/admin/components/AdminLayout.tsx +86 -103
  55. package/src/admin/components/AdminNotifications.tsx +196 -12
  56. package/src/admin/components/AdminSessions.tsx +43 -7
  57. package/src/admin/components/AdminUserCreate.tsx +84 -0
  58. package/src/admin/components/AdminUserDetails.tsx +180 -0
  59. package/src/admin/components/AdminUserLayout.tsx +172 -0
  60. package/src/admin/components/AdminUserSessions.tsx +158 -0
  61. package/src/admin/components/AdminUserSettings.tsx +165 -0
  62. package/src/admin/components/AdminUsers.tsx +29 -9
  63. package/src/admin/index.ts +12 -3
  64. package/src/auth/AuthI18n.ts +22 -0
  65. package/src/auth/AuthRouter.ts +82 -8
  66. package/src/auth/components/AuthLayout.tsx +12 -0
  67. package/src/auth/components/Login.tsx +13 -11
  68. package/src/auth/components/Register.tsx +6 -5
  69. package/src/auth/components/ResetPassword.tsx +1 -1
  70. package/src/auth/components/VerifyEmail.tsx +102 -0
  71. package/src/auth/components/buttons/UserButton.tsx +6 -2
  72. package/src/auth/index.ts +1 -0
  73. package/src/core/components/buttons/ActionButton.tsx +11 -4
  74. package/src/core/components/buttons/DarkModeButton.tsx +1 -1
  75. package/src/core/components/buttons/ThemeButton.tsx +31 -0
  76. package/src/core/components/layout/AdminShell.tsx +4 -2
  77. package/src/core/components/layout/AlephaMantineProvider.tsx +10 -4
  78. package/src/core/components/layout/Omnibar.tsx +27 -15
  79. package/src/core/components/layout/Sidebar.tsx +33 -15
  80. package/src/core/components/table/DataTable.tsx +9 -5
  81. package/src/core/hooks/useTheme.ts +25 -0
  82. package/src/core/index.ts +8 -3
  83. package/src/core/providers/ThemeProvider.ts +87 -0
  84. package/src/core/themes/aurora.ts +107 -0
  85. package/src/core/themes/crystal.ts +107 -0
  86. package/src/core/themes/default.ts +7 -0
  87. package/src/core/themes/ember.ts +107 -0
  88. package/src/core/themes/index.ts +7 -0
  89. package/src/core/themes/midnight.ts +104 -0
  90. package/src/core/themes/remoraid.ts +278 -0
  91. package/src/core/themes/slate.ts +81 -0
  92. package/dist/admin/AdminJobs-BOq6AZOW.js +0 -3
  93. package/dist/admin/AdminJobs-CDnVxEv6.js +0 -125
  94. package/dist/admin/AdminJobs-CDnVxEv6.js.map +0 -1
  95. package/dist/admin/AdminLayout-Bgx25J8m.js +0 -3
  96. package/dist/admin/AdminLayout-CervL8LV.js +0 -88
  97. package/dist/admin/AdminLayout-CervL8LV.js.map +0 -1
  98. package/dist/admin/AdminNotifications-BDQXt3-e.js +0 -3
  99. package/dist/admin/AdminNotifications-DvI2989x.js +0 -40
  100. package/dist/admin/AdminNotifications-DvI2989x.js.map +0 -1
  101. package/dist/admin/AdminParameters-D_v0GAvI.js +0 -3
  102. package/dist/admin/AdminParameters-P1LB6ZI1.js +0 -40
  103. package/dist/admin/AdminParameters-P1LB6ZI1.js.map +0 -1
  104. package/dist/admin/AdminSessions-CmDVneE2.js.map +0 -1
  105. package/dist/admin/AdminSessions-Dkk_fzWK.js +0 -3
  106. package/dist/admin/AdminUsers-88De5pev.js.map +0 -1
  107. package/dist/admin/AdminUsers-oyAXqZ5l.js +0 -3
  108. package/dist/admin/AdminVerifications-D93TKymL.js +0 -3
  109. package/dist/admin/AdminVerifications-DBVEoqJe.js +0 -40
  110. package/dist/admin/AdminVerifications-DBVEoqJe.js.map +0 -1
  111. package/dist/auth/Login-BC2jTczq.js +0 -4
  112. package/dist/auth/Login-OCrvjs9U.js.map +0 -1
  113. package/dist/auth/Register-Dh0lsQmI.js +0 -4
  114. package/dist/auth/Register-Ei34GSba.js.map +0 -1
  115. package/dist/auth/ResetPassword-BnlAQAOE.js +0 -3
  116. package/dist/auth/ResetPassword-tO0oMzfo.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["Omnibar","AlephaMantineProvider","Text","Text","Text","Text","AlertDialog","ConfirmDialog","PromptDialog","Flex","JsonViewer","menuItemProps: MenuItemProps & ButtonHTMLAttributes<unknown>","icon","Flex","defaultTooltipProps: Partial<TooltipProps>","ActionButton","Flex","ActionButton","ActionButton","ActionButton","Flex","Text","inputProps: InputProps","fields: SchemaField[]","field: SchemaField","OPERATOR_INFO: Record<\n string,\n { symbol: string; label: string; example: string }\n>","value","Text","ActionButton","Flex","itemsEnum: string[] | undefined","items: any","segmentedControlProps: Partial<SegmentedControlProps>","Flex","data","ControlQueryBuilder","Flex","ControlNumber","ControlSelect","ControlDate","schema: any","schema","Control","Flex","ActionButton","BurgerButton","DarkModeButton","OmnibarButton","LanguageButton","Flex","Flex","OmnibarButton","Text","item","ActionButton","AppBar","ActionButton","Flex","TypeForm"],"sources":["../../src/core/services/ToastService.tsx","../../src/core/hooks/useToast.ts","../../src/core/components/layout/Omnibar.tsx","../../src/core/components/layout/AlephaMantineProvider.tsx","../../src/core/RootRouter.ts","../../src/core/components/data/JsonViewer.tsx","../../src/core/components/dialogs/AlertDialog.tsx","../../src/core/components/dialogs/ConfirmDialog.tsx","../../src/core/components/dialogs/PromptDialog.tsx","../../src/core/constants/ui.ts","../../src/core/services/DialogService.tsx","../../src/core/components/buttons/ActionButton.tsx","../../src/core/components/buttons/BurgerButton.tsx","../../src/core/components/buttons/ClipboardButton.tsx","../../src/core/components/buttons/DarkModeButton.tsx","../../src/core/components/buttons/LanguageButton.tsx","../../src/core/components/buttons/OmnibarButton.tsx","../../src/core/utils/icons.tsx","../../src/core/utils/string.ts","../../src/core/utils/parseInput.ts","../../src/core/components/form/ControlDate.tsx","../../src/core/components/form/ControlNumber.tsx","../../src/core/utils/extractSchemaFields.ts","../../src/core/components/form/ControlQueryBuilder.tsx","../../src/core/components/form/ControlSelect.tsx","../../src/core/components/form/Control.tsx","../../src/core/components/form/TypeForm.tsx","../../src/core/components/layout/AppBar.tsx","../../src/core/components/layout/Sidebar.tsx","../../src/core/components/layout/AdminShell.tsx","../../src/core/components/table/DataTable.tsx","../../src/core/hooks/useDialog.ts","../../src/core/index.ts"],"sourcesContent":["import type { NotificationData } from \"@mantine/notifications\";\nimport { notifications } from \"@mantine/notifications\";\nimport {\n IconAlertTriangle,\n IconCheck,\n IconInfoCircle,\n IconX,\n} from \"@tabler/icons-react\";\n\nexport interface ToastServiceOptions {\n default?: Partial<NotificationData>;\n}\n\nexport class ToastService {\n protected readonly raw = notifications;\n\n public readonly options: ToastServiceOptions = {\n default: {\n radius: \"md\",\n withBorder: true,\n withCloseButton: true,\n autoClose: 5000,\n position: \"top-center\",\n },\n };\n\n public show(options: NotificationData) {\n notifications.show({\n ...this.options.default,\n ...options,\n });\n }\n\n public info(options: Partial<NotificationData> | string) {\n if (typeof options === \"string\") {\n options = { message: options };\n }\n this.show({\n color: \"blue\",\n icon: <IconInfoCircle size={20} />,\n title: \"Info\",\n message: \"Information notification\",\n ...options,\n });\n }\n\n public success(options: Partial<NotificationData> | string) {\n if (typeof options === \"string\") {\n options = { message: options };\n }\n this.show({\n color: \"green\",\n icon: <IconCheck size={16} />,\n title: \"Success\",\n message: \"Operation completed successfully\",\n ...options,\n });\n }\n\n public warning(options: Partial<NotificationData> | string) {\n if (typeof options === \"string\") {\n options = { message: options };\n }\n this.show({\n color: \"yellow\",\n icon: <IconAlertTriangle size={20} />,\n title: \"Warning\",\n message: \"Please review this warning\",\n ...options,\n });\n }\n\n public danger(options: Partial<NotificationData> | string) {\n if (typeof options === \"string\") {\n options = { message: options };\n }\n this.show({\n color: \"red\",\n icon: <IconX size={20} />,\n title: \"Error\",\n message: \"An error occurred\",\n ...options,\n });\n }\n}\n","import { useInject } from \"@alepha/react\";\nimport { ToastService } from \"../services/ToastService.tsx\";\n\n/**\n * Use this hook to access the Toast Service for showing notifications.\n *\n * @example\n * ```tsx\n * const toast = useToast();\n * toast.success({ message: \"Operation completed successfully!\" });\n * toast.error({ title: \"Error\", message: \"Something went wrong\" });\n * ```\n */\nexport const useToast = (): ToastService => {\n return useInject(ToastService);\n};\n","import { useRouter } from \"@alepha/react\";\nimport { Spotlight, type SpotlightActionData } from \"@mantine/spotlight\";\nimport { IconSearch } from \"@tabler/icons-react\";\nimport { type ReactNode, useMemo } from \"react\";\n\nexport interface OmnibarProps {\n shortcut?: string | string[];\n searchPlaceholder?: string;\n nothingFound?: ReactNode;\n}\n\nconst Omnibar = (props: OmnibarProps) => {\n const shortcut = props.shortcut ?? \"mod+K\";\n const searchPlaceholder = props.searchPlaceholder ?? \"Search...\";\n const nothingFound = props.nothingFound ?? \"Nothing found...\";\n const router = useRouter();\n const actions: SpotlightActionData[] = useMemo(\n () =>\n router.concretePages.map((page) => ({\n id: page.name,\n label: page.label ?? page.name,\n description: page.description,\n onClick: () => {\n if (page.staticName) {\n return router.go(page.staticName, { params: page.params });\n }\n return router.go(page.name);\n },\n leftSection: page.icon,\n })),\n [],\n );\n\n return (\n <Spotlight\n actions={actions}\n shortcut={shortcut}\n limit={10}\n searchProps={{\n leftSection: <IconSearch size={20} />,\n placeholder: searchPlaceholder,\n }}\n nothingFound={nothingFound}\n />\n );\n};\n\nexport default Omnibar;\n","import { NestedView, useEvents } from \"@alepha/react\";\nimport { FormValidationError } from \"@alepha/react/form\";\nimport type {\n ColorSchemeScriptProps,\n MantineProviderProps,\n} from \"@mantine/core\";\nimport { ColorSchemeScript, MantineProvider } from \"@mantine/core\";\nimport { ModalsProvider, type ModalsProviderProps } from \"@mantine/modals\";\nimport { Notifications, type NotificationsProps } from \"@mantine/notifications\";\nimport type { NavigationProgressProps } from \"@mantine/nprogress\";\nimport { NavigationProgress, nprogress } from \"@mantine/nprogress\";\nimport type { ReactNode } from \"react\";\nimport { useToast } from \"../../hooks/useToast.ts\";\nimport Omnibar, { type OmnibarProps } from \"./Omnibar.tsx\";\n\nexport interface AlephaMantineProviderProps {\n children?: ReactNode;\n mantine?: MantineProviderProps;\n colorSchemeScript?: ColorSchemeScriptProps;\n navigationProgress?: NavigationProgressProps;\n notifications?: NotificationsProps;\n modals?: ModalsProviderProps;\n omnibar?: OmnibarProps;\n}\n\nconst AlephaMantineProvider = (props: AlephaMantineProviderProps) => {\n const toast = useToast();\n\n useEvents(\n {\n \"react:transition:begin\": () => {\n nprogress.start();\n },\n \"react:transition:end\": () => {\n nprogress.complete();\n },\n \"react:action:error\": ({ error }) => {\n if (error instanceof FormValidationError) {\n // Validation errors are handled by the form component\n return;\n }\n\n toast.danger({\n title: error.name || \"Error\",\n message:\n error.message ?? \"An error occurred while processing your action.\",\n });\n },\n },\n [],\n );\n\n return (\n <>\n <ColorSchemeScript\n defaultColorScheme={props.mantine?.defaultColorScheme}\n {...props.colorSchemeScript}\n />\n <MantineProvider\n {...props.mantine}\n theme={{\n ...props.mantine?.theme,\n }}\n >\n <Notifications {...props.notifications} />\n <NavigationProgress {...props.navigationProgress} />\n <ModalsProvider {...props.modals}>\n <Omnibar {...props.omnibar} />\n {props.children ?? <NestedView />}\n </ModalsProvider>\n </MantineProvider>\n </>\n );\n};\n\nexport default AlephaMantineProvider;\n","import { $page } from \"@alepha/react\";\nimport AlephaMantineProvider from \"./components/layout/AlephaMantineProvider.tsx\";\n\nexport class RootRouter {\n public readonly root = $page({\n path: \"/\",\n component: AlephaMantineProvider,\n });\n}\n","import {\n ActionIcon,\n Box,\n Collapse,\n CopyButton,\n type MantineSize,\n Text,\n Tooltip,\n} from \"@mantine/core\";\nimport {\n IconCheck,\n IconChevronDown,\n IconChevronRight,\n IconCopy,\n} from \"@tabler/icons-react\";\nimport { type ReactNode, useState } from \"react\";\n\ninterface JsonViewerProps {\n data: any;\n defaultExpanded?: boolean;\n maxDepth?: number;\n copyable?: boolean;\n size?: MantineSize;\n}\n\ninterface JsonNodeProps {\n name?: string;\n value: any;\n depth: number;\n maxDepth: number;\n isLast?: boolean;\n isArrayItem?: boolean;\n size?: MantineSize;\n}\n\nconst getSizeConfig = (size: MantineSize = \"sm\") => {\n const configs = {\n xs: { text: \"xs\", icon: 12, indent: 16, gap: 2 },\n sm: { text: \"sm\", icon: 14, indent: 20, gap: 4 },\n md: { text: \"md\", icon: 16, indent: 24, gap: 6 },\n lg: { text: \"lg\", icon: 18, indent: 28, gap: 8 },\n xl: { text: \"xl\", icon: 20, indent: 32, gap: 10 },\n };\n return configs[size] || configs.sm;\n};\n\nconst JsonNode = ({\n name,\n value,\n depth,\n maxDepth,\n isLast = false,\n isArrayItem = false,\n size = \"sm\",\n}: JsonNodeProps) => {\n const [expanded, setExpanded] = useState(depth < 2);\n const sizeConfig = getSizeConfig(size);\n\n const getValueType = (val: any): string => {\n if (val === null) return \"null\";\n if (val === undefined) return \"undefined\";\n if (Array.isArray(val)) return \"array\";\n return typeof val;\n };\n\n const valueType = getValueType(value);\n\n const renderPrimitive = (val: any): ReactNode => {\n const type = getValueType(val);\n\n switch (type) {\n case \"string\":\n return (\n <Text\n component=\"span\"\n c=\"teal\"\n ff=\"monospace\"\n size={sizeConfig.text}\n style={{ whiteSpace: \"nowrap\" }}\n >\n \"{val}\"\n </Text>\n );\n case \"number\":\n return (\n <Text\n component=\"span\"\n c=\"blue\"\n ff=\"monospace\"\n size={sizeConfig.text}\n style={{ whiteSpace: \"nowrap\" }}\n >\n {val}\n </Text>\n );\n case \"boolean\":\n return (\n <Text\n component=\"span\"\n c=\"violet\"\n ff=\"monospace\"\n size={sizeConfig.text}\n style={{ whiteSpace: \"nowrap\" }}\n >\n {String(val)}\n </Text>\n );\n case \"null\":\n return (\n <Text\n component=\"span\"\n c=\"dimmed\"\n ff=\"monospace\"\n size={sizeConfig.text}\n style={{ whiteSpace: \"nowrap\" }}\n >\n null\n </Text>\n );\n case \"undefined\":\n return (\n <Text\n component=\"span\"\n c=\"dimmed\"\n ff=\"monospace\"\n size={sizeConfig.text}\n style={{ whiteSpace: \"nowrap\" }}\n >\n undefined\n </Text>\n );\n default:\n return (\n <Text\n component=\"span\"\n ff=\"monospace\"\n size={sizeConfig.text}\n style={{ whiteSpace: \"nowrap\" }}\n >\n {String(val)}\n </Text>\n );\n }\n };\n\n const renderKey = () => {\n if (!name) return null;\n return (\n <Text\n component=\"span\"\n c=\"cyan\"\n ff=\"monospace\"\n fw={500}\n size={sizeConfig.text}\n >\n {isArrayItem ? `[${name}]` : `\"${name}\"`}:\n </Text>\n );\n };\n\n if (valueType === \"object\" || valueType === \"array\") {\n const isObject = valueType === \"object\";\n const entries = isObject\n ? Object.entries(value)\n : value.map((v: any, i: number) => [i, v]);\n const isEmpty = entries.length === 0;\n const canExpand = depth < maxDepth && !isEmpty;\n\n const preview = isObject ? \"{...}\" : \"[...]\";\n const brackets = isObject ? [\"{\", \"}\"] : [\"[\", \"]\"];\n\n return (\n <Box>\n <Box\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: sizeConfig.gap,\n minWidth: \"max-content\",\n }}\n >\n {canExpand && (\n <ActionIcon\n size=\"xs\"\n variant=\"transparent\"\n c=\"dimmed\"\n onClick={() => setExpanded(!expanded)}\n style={{ cursor: \"pointer\", flexShrink: 0 }}\n >\n {expanded ? (\n <IconChevronDown size={sizeConfig.icon} />\n ) : (\n <IconChevronRight size={sizeConfig.icon} />\n )}\n </ActionIcon>\n )}\n {!canExpand && (\n <Box w={sizeConfig.icon + 6} style={{ flexShrink: 0 }} />\n )}\n <Box style={{ flexShrink: 0 }}>{renderKey()}</Box>{\" \"}\n <Text\n component=\"span\"\n c=\"dimmed\"\n ff=\"monospace\"\n size={sizeConfig.text}\n style={{ flexShrink: 0 }}\n >\n {brackets[0]}\n </Text>\n {!expanded && !isEmpty && (\n <Text\n component=\"span\"\n c=\"dimmed\"\n ff=\"monospace\"\n fs=\"italic\"\n size={sizeConfig.text}\n style={{ flexShrink: 0 }}\n >\n {preview}\n </Text>\n )}\n {(isEmpty || !expanded) && (\n <Text\n component=\"span\"\n c=\"dimmed\"\n ff=\"monospace\"\n size={sizeConfig.text}\n style={{ flexShrink: 0 }}\n >\n {brackets[1]}\n </Text>\n )}\n {!isEmpty && !expanded && (\n <Text\n component=\"span\"\n c=\"dimmed\"\n size={sizeConfig.text}\n style={{ flexShrink: 0 }}\n >\n {entries.length} {entries.length === 1 ? \"item\" : \"items\"}\n </Text>\n )}\n </Box>\n\n <Collapse in={expanded && canExpand}>\n <Box\n pl={sizeConfig.indent}\n style={{\n borderLeft: \"1px solid var(--mantine-color-default-border)\",\n marginLeft: Math.floor((sizeConfig.icon + 6) / 2),\n }}\n >\n {entries.map(\n ([key, val]: [string | number, any], index: number) => (\n <JsonNode\n key={String(key)}\n name={String(key)}\n value={val}\n depth={depth + 1}\n maxDepth={maxDepth}\n isLast={index === entries.length - 1}\n isArrayItem={!isObject}\n size={size}\n />\n ),\n )}\n </Box>\n <Box style={{ display: \"flex\", minWidth: \"max-content\" }}>\n <Box w={sizeConfig.icon + 6} style={{ flexShrink: 0 }} />\n <Text\n c=\"dimmed\"\n ff=\"monospace\"\n size={sizeConfig.text}\n style={{ flexShrink: 0 }}\n >\n {brackets[1]}\n </Text>\n </Box>\n </Collapse>\n </Box>\n );\n }\n\n return (\n <Box\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: sizeConfig.gap,\n minWidth: \"max-content\",\n }}\n >\n <Box w={sizeConfig.icon + 6} style={{ flexShrink: 0 }} />\n <Box style={{ flexShrink: 0 }}>{renderKey()}</Box>\n <Box style={{ flexShrink: 0 }}>{renderPrimitive(value)}</Box>\n {!isLast && (\n <Text\n component=\"span\"\n c=\"dimmed\"\n ff=\"monospace\"\n size={sizeConfig.text}\n style={{ flexShrink: 0 }}\n >\n ,\n </Text>\n )}\n </Box>\n );\n};\n\nexport const JsonViewer = ({\n data,\n defaultExpanded = true,\n maxDepth = 10,\n copyable = true,\n size = \"sm\",\n}: JsonViewerProps) => {\n const sizeConfig = getSizeConfig(size);\n const copyIconSize = sizeConfig.icon + 2;\n\n return (\n <Box pos=\"relative\" w={\"100%\"}>\n {copyable && (\n <Box pos=\"absolute\" top={0} right={0} style={{ zIndex: 1 }}>\n <CopyButton value={JSON.stringify(data, null, 2)}>\n {({ copied, copy }) => (\n <Tooltip label={copied ? \"Copied\" : \"Copy JSON\"}>\n <ActionIcon\n color={copied ? \"teal\" : \"gray\"}\n variant=\"subtle\"\n onClick={copy}\n size={size}\n >\n {copied ? (\n <IconCheck size={copyIconSize} />\n ) : (\n <IconCopy size={copyIconSize} />\n )}\n </ActionIcon>\n </Tooltip>\n )}\n </CopyButton>\n </Box>\n )}\n <Box pt={copyable ? 30 : 0} style={{ overflowX: \"auto\" }}>\n <JsonNode value={data} depth={0} maxDepth={maxDepth} size={size} />\n </Box>\n </Box>\n );\n};\n\nexport default JsonViewer;\n","import { Button, Group, Text } from \"@mantine/core\";\nimport type { AlertDialogProps } from \"../../services/DialogService.tsx\";\n\nconst AlertDialog = ({ options, onClose }: AlertDialogProps) => (\n <>\n {options?.message && <Text mb=\"md\">{options.message}</Text>}\n <Group justify=\"flex-end\">\n <Button onClick={onClose}>{options?.okLabel || \"OK\"}</Button>\n </Group>\n </>\n);\n\nexport default AlertDialog;\n","import { Button, Group, Text } from \"@mantine/core\";\nimport type { ConfirmDialogProps } from \"../../services/DialogService.tsx\";\n\nconst ConfirmDialog = ({ options, onConfirm }: ConfirmDialogProps) => (\n <>\n {options?.message && <Text mb=\"md\">{options.message}</Text>}\n <Group justify=\"flex-end\">\n <Button variant=\"subtle\" onClick={() => onConfirm(false)}>\n {options?.cancelLabel || \"Cancel\"}\n </Button>\n <Button\n color={options?.confirmColor || \"blue\"}\n onClick={() => onConfirm(true)}\n >\n {options?.confirmLabel || \"Confirm\"}\n </Button>\n </Group>\n </>\n);\n\nexport default ConfirmDialog;\n","import { Button, Group, Text, TextInput } from \"@mantine/core\";\nimport { useEffect, useRef, useState } from \"react\";\nimport type { PromptDialogProps } from \"../../services/DialogService.tsx\";\n\nconst PromptDialog = ({ options, onSubmit }: PromptDialogProps) => {\n const [value, setValue] = useState(options?.defaultValue || \"\");\n const inputRef = useRef<HTMLInputElement>(null);\n\n useEffect(() => {\n // autofocus the input when the dialog opens\n inputRef.current?.focus();\n }, []);\n\n const handleSubmit = () => {\n if (!options?.required || value.trim()) {\n onSubmit(value);\n }\n };\n\n const handleKeyDown = (event: React.KeyboardEvent) => {\n if (event.key === \"Enter\") {\n handleSubmit();\n }\n };\n\n return (\n <>\n {options?.message && <Text mb=\"md\">{options.message}</Text>}\n <TextInput\n ref={inputRef}\n label={options?.label}\n placeholder={options?.placeholder}\n value={value}\n onChange={(event) => setValue(event.currentTarget.value)}\n onKeyDown={handleKeyDown}\n required={options?.required}\n mb=\"md\"\n />\n <Group justify=\"flex-end\">\n <Button variant=\"subtle\" onClick={() => onSubmit(null)}>\n {options?.cancelLabel || \"Cancel\"}\n </Button>\n <Button\n onClick={handleSubmit}\n disabled={options?.required && !value.trim()}\n >\n {options?.submitLabel || \"OK\"}\n </Button>\n </Group>\n </>\n );\n};\n\nexport default PromptDialog;\n","export const ui = {\n colors: {\n transparent: \"transparent\",\n background: \"var(--alepha-background)\",\n surface: \"var(--alepha-surface)\",\n elevated: \"var(--alepha-elevated)\",\n border: \"var(--alepha-border)\",\n },\n sizes: {\n icon: {\n xs: 12,\n sm: 16,\n md: 20,\n lg: 24,\n xl: 32,\n },\n },\n};\n","import { Flex, type ModalProps } from \"@mantine/core\";\nimport { modals } from \"@mantine/modals\";\nimport type { ReactNode } from \"react\";\nimport JsonViewer from \"../components/data/JsonViewer.tsx\";\nimport AlertDialog from \"../components/dialogs/AlertDialog.tsx\";\nimport ConfirmDialog from \"../components/dialogs/ConfirmDialog.tsx\";\nimport PromptDialog from \"../components/dialogs/PromptDialog.tsx\";\nimport { ui } from \"../constants/ui.ts\";\n\n// Base interfaces\nexport interface BaseDialogOptions extends Partial<ModalProps> {\n title?: ReactNode;\n message?: ReactNode;\n content?: any; // weird typing for mantine modals content\n}\n\nexport interface AlertDialogOptions extends BaseDialogOptions {\n okLabel?: string;\n}\n\nexport interface ConfirmDialogOptions extends BaseDialogOptions {\n confirmLabel?: string;\n cancelLabel?: string;\n confirmColor?: string;\n}\n\nexport interface PromptDialogOptions extends BaseDialogOptions {\n placeholder?: string;\n defaultValue?: string;\n label?: string;\n required?: boolean;\n submitLabel?: string;\n cancelLabel?: string;\n}\n\n// Component prop interfaces\nexport interface AlertDialogProps {\n options?: AlertDialogOptions;\n onClose: () => void;\n}\n\nexport interface ConfirmDialogProps {\n options?: ConfirmDialogOptions;\n onConfirm: (confirmed: boolean) => void;\n}\n\nexport interface PromptDialogProps {\n options?: PromptDialogOptions;\n onSubmit: (value: string | null) => void;\n}\n\nexport interface DialogServiceOptions {\n default?: Partial<BaseDialogOptions>;\n}\n\nexport class DialogService {\n public readonly options: DialogServiceOptions = {\n default: {\n centered: true,\n withCloseButton: true,\n size: \"md\",\n overlayProps: {\n backgroundOpacity: 0.55,\n blur: 3,\n },\n transitionProps: {\n transition: \"pop\",\n duration: 200,\n },\n },\n };\n\n /**\n * Show an alert dialog with a message\n */\n public alert(options?: AlertDialogOptions): Promise<void> {\n return new Promise((resolve) => {\n const modalId = this.open({\n ...options,\n title: options?.title || \"Alert\",\n content: (\n <AlertDialog\n options={options}\n onClose={() => {\n this.close(modalId);\n resolve();\n }}\n />\n ),\n });\n });\n }\n\n /**\n * Show a confirmation dialog that returns a promise\n */\n public confirm(options?: ConfirmDialogOptions): Promise<boolean> {\n return new Promise((resolve) => {\n const modalId = this.open({\n ...options,\n title: options?.title || \"Confirm\",\n closeOnClickOutside: false,\n closeOnEscape: false,\n content: (\n <ConfirmDialog\n options={options}\n onConfirm={(confirmed) => {\n this.close(modalId);\n resolve(confirmed);\n }}\n />\n ),\n });\n });\n }\n\n /**\n * Show a prompt dialog to get user input\n */\n public prompt(options?: PromptDialogOptions): Promise<string | null> {\n return new Promise((resolve) => {\n const modalId = this.open({\n ...options,\n title: options?.title || \"Input\",\n closeOnClickOutside: false,\n closeOnEscape: false,\n content: (\n <PromptDialog\n options={options}\n onSubmit={(value) => {\n this.close(modalId);\n resolve(value);\n }}\n />\n ),\n });\n });\n }\n\n /**\n * Open a custom dialog with provided content\n */\n public open(options?: BaseDialogOptions): string {\n return modals.open({\n ...this.options.default,\n ...options,\n children: options?.content || options?.message,\n });\n }\n\n /**\n * Close the currently open dialog or a specific dialog by ID\n */\n public close(modalId?: string): void {\n if (modalId) {\n modals.close(modalId);\n } else {\n modals.closeAll();\n }\n }\n\n /**\n * Show a JSON editor/viewer dialog\n */\n public json(data?: any, options?: BaseDialogOptions): void {\n this.open({\n size: \"lg\",\n title: options?.title || \"Json Viewer\",\n ...options,\n content: (\n <Flex bdrs={\"md\"} w={\"100%\"} flex={1} p={\"sm\"} bg={ui.colors.surface}>\n <JsonViewer size={\"xs\"} data={data} />\n </Flex>\n ),\n });\n }\n\n /**\n * Show a form dialog for structured input\n */\n public form(options?: BaseDialogOptions): Promise<any> {\n // Implementation to be added\n return Promise.resolve(null);\n }\n\n /**\n * Show a loading/progress dialog with optional progress percentage\n */\n public loading(options?: BaseDialogOptions & { progress?: number }): void {\n // Implementation to be added\n }\n\n /**\n * Show an image viewer/gallery dialog\n */\n public image(src: string | string[], options?: BaseDialogOptions): void {\n // Implementation to be added\n }\n}\n","import {\n type RouterGoOptions,\n type UseActionReturn,\n type UseActiveOptions,\n useAction,\n useActive,\n useRouter,\n} from \"@alepha/react\";\nimport { type FormModel, useFormState } from \"@alepha/react/form\";\nimport {\n Anchor,\n type AnchorProps,\n Button,\n type ButtonProps,\n Flex,\n Menu,\n type MenuItemProps,\n type MenuProps,\n type MenuTargetProps,\n ThemeIcon,\n type ThemeIconProps,\n Tooltip,\n type TooltipProps,\n} from \"@mantine/core\";\nimport { IconCheck, IconChevronRight } from \"@tabler/icons-react\";\nimport {\n type ButtonHTMLAttributes,\n Children,\n type ComponentType,\n isValidElement,\n type ReactNode,\n} from \"react\";\nimport { ui } from \"../../constants/ui.ts\";\n\nexport interface ActionMenuItem {\n /**\n * Menu item type\n */\n type?: \"item\" | \"divider\" | \"label\";\n\n /**\n * Label text for the menu item\n */\n label?: string | ReactNode;\n\n /**\n * Icon element to display before the label\n */\n icon?: ReactNode;\n\n /**\n * Click handler for menu items\n */\n onClick?: () => void;\n\n /**\n * Href for navigation menu items\n */\n href?: string;\n\n /**\n * Color for the menu item (e.g., \"red\" for danger actions)\n */\n color?: string;\n\n /**\n * Nested submenu items\n */\n children?: ActionMenuItem[];\n\n /**\n * Whether the menu item is active\n */\n active?: boolean;\n}\n\nexport interface ActionMenuConfig {\n /**\n * Array of menu items to display\n */\n items: ActionMenuItem[];\n\n /**\n * Menu position relative to the button\n */\n position?:\n | \"bottom\"\n | \"bottom-start\"\n | \"bottom-end\"\n | \"top\"\n | \"top-start\"\n | \"top-end\"\n | \"left\"\n | \"right\";\n\n /**\n * Menu width\n */\n width?: number | string;\n\n /**\n * Menu shadow\n */\n shadow?: \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\";\n\n on?: \"hover\" | \"click\";\n\n targetProps?: MenuTargetProps;\n\n menuProps?: MenuProps;\n}\n\nexport interface ActionCommonProps extends ButtonProps {\n children?: ReactNode;\n\n textVisibleFrom?: \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\";\n\n /**\n * Tooltip to display on hover. Can be a string for simple tooltips\n * or a TooltipProps object for advanced configuration.\n */\n tooltip?: string | TooltipProps;\n\n /**\n * Menu configuration. When provided, the action will display a dropdown menu.\n */\n menu?: ActionMenuConfig;\n\n /**\n * If set, a confirmation dialog will be shown before performing the action.\n * If `true`, a default title and message will be used.\n * If a string, it will be used as the message with a default title.\n * If an object, it can contain `title` and `message` properties to customize the dialog.\n */\n confirm?: boolean | string | { title?: string; message: string };\n\n /**\n * Icon to display on the left side of the button.\n * If no children are provided, the button will be styled as an icon-only button.\n */\n icon?: ReactNode | ComponentType;\n\n /**\n * Additional props to pass to the ThemeIcon wrapping the icon.\n */\n themeIconProps?: ThemeIconProps;\n}\n\nexport type ActionProps = ActionCommonProps &\n (\n | ActionNavigationButtonProps\n | ActionClickButtonProps\n | ActionSubmitButtonProps\n | ActionHookButtonProps\n | {}\n );\n\n// ---------------------------------------------------------------------------------------------------------------------\n\n// Helper function to render menu items recursively\nconst ActionMenuItem = (props: {\n item: ActionMenuItem;\n index: number;\n}): ReactNode => {\n const { item, index } = props;\n\n const router = useRouter();\n const action = useAction(\n {\n handler: async (e: any) => {\n await item.onClick?.();\n },\n },\n [item.onClick],\n );\n\n // Render divider\n if (item.type === \"divider\") {\n return <Menu.Divider key={index} />;\n }\n\n // Render label\n if (item.type === \"label\") {\n return <Menu.Label key={index}>{item.label}</Menu.Label>;\n }\n\n // Render submenu if it has children\n if (item.children && item.children.length > 0) {\n return (\n <Menu key={index} trigger=\"hover\" position=\"right-start\" offset={2}>\n <Menu.Target>\n <Menu.Item\n leftSection={item.icon}\n rightSection={<IconChevronRight size={14} />}\n >\n {item.label}\n </Menu.Item>\n </Menu.Target>\n <Menu.Dropdown>\n {item.children.map((child, childIndex) => (\n <ActionMenuItem item={child} index={childIndex} key={childIndex} />\n ))}\n </Menu.Dropdown>\n </Menu>\n );\n }\n\n const menuItemProps: MenuItemProps & ButtonHTMLAttributes<unknown> = {};\n if (props.item.onClick) {\n menuItemProps.onClick = action.run;\n } else if (props.item.href) {\n Object.assign(menuItemProps, router.anchor(props.item.href));\n }\n\n // render regular menu item\n return (\n <Menu.Item\n key={index}\n leftSection={item.icon}\n onClick={item.onClick}\n color={item.color}\n rightSection={\n item.active ? (\n <ThemeIcon size={\"xs\"} variant={\"transparent\"}>\n <IconCheck />\n </ThemeIcon>\n ) : undefined\n }\n {...menuItemProps}\n >\n {item.label}\n </Menu.Item>\n );\n};\n\nconst ActionButton = (_props: ActionProps) => {\n const props = { variant: \"default\", ..._props };\n const { tooltip, menu, icon, ...restProps } = props;\n\n if (props.icon) {\n const icon = isComponentType(props.icon) ? (\n <props.icon size={ui.sizes.icon.md} />\n ) : (\n <ThemeIcon\n w={24} // TODO: make size configurable\n variant={\"transparent\"}\n size={\"sm\"}\n c={\"var(--mantine-color-text)\"}\n {...props.themeIconProps}\n >\n {props.icon as ReactNode}\n </ThemeIcon>\n );\n\n if (!props.children) {\n restProps.children = Children.only(icon);\n restProps.p ??= \"xs\";\n } else {\n restProps.leftSection = icon;\n }\n }\n\n if (props.leftSection && !props.children) {\n restProps.className ??= \"mantine-Action-iconOnly\";\n restProps.p ??= \"xs\";\n }\n\n if (props.textVisibleFrom) {\n const { children, textVisibleFrom, leftSection, ...rest } = restProps;\n return (\n <>\n <Flex w={\"100%\"} visibleFrom={textVisibleFrom}>\n <ActionButton\n flex={1}\n {...rest}\n leftSection={leftSection}\n tooltip={tooltip}\n menu={menu}\n >\n {children}\n </ActionButton>\n </Flex>\n <Flex w={\"100%\"} hiddenFrom={textVisibleFrom}>\n <ActionButton px={\"xs\"} {...rest} tooltip={tooltip} menu={menu}>\n {leftSection}\n </ActionButton>\n </Flex>\n </>\n );\n }\n\n const renderAction = () => {\n if (\"href\" in restProps && restProps.href) {\n if (restProps.href.startsWith(\"http\") || restProps.target) {\n return (\n <ActionHrefButton {...restProps} href={restProps.href}>\n {restProps.children}\n </ActionHrefButton>\n );\n }\n return (\n <ActionNavigationButton {...restProps} href={restProps.href}>\n {restProps.children}\n </ActionNavigationButton>\n );\n }\n\n delete (restProps as any).classNameActive;\n delete (restProps as any).variantActive;\n\n if (\"action\" in restProps && restProps.action) {\n return (\n <ActionHookButton {...restProps} action={restProps.action}>\n {restProps.children}\n </ActionHookButton>\n );\n }\n\n if (\"onClick\" in restProps && restProps.onClick) {\n return (\n <ActionClickButton {...restProps} onClick={restProps.onClick}>\n {restProps.children}\n </ActionClickButton>\n );\n }\n\n if (\"form\" in restProps && restProps.form) {\n if (restProps.type === \"reset\") {\n return (\n <ActionResetButton {...restProps} form={restProps.form}>\n {restProps.children}\n </ActionResetButton>\n );\n }\n return (\n <ActionSubmitButton {...restProps} form={restProps.form}>\n {restProps.children}\n </ActionSubmitButton>\n );\n }\n\n return <Button {...(restProps as any)}>{restProps.children}</Button>;\n };\n\n let actionElement = renderAction();\n\n // wrap with Menu if provided\n if (menu) {\n actionElement = (\n <Menu\n position={menu.position || \"bottom-start\"}\n width={menu.width || 200}\n shadow={menu.shadow || \"md\"}\n trigger={menu.on === \"hover\" ? \"hover\" : \"click\"}\n {...menu.menuProps}\n >\n <Menu.Target {...menu.targetProps}>{actionElement}</Menu.Target>\n <Menu.Dropdown>\n {menu.items.map((item, index) => (\n <ActionMenuItem item={item} index={index} key={index} />\n ))}\n </Menu.Dropdown>\n </Menu>\n );\n }\n\n // Wrap with Tooltip if provided\n if (tooltip) {\n // openDelay: 1000 -> like HTML title attribute\n const defaultTooltipProps: Partial<TooltipProps> = {\n openDelay: 1000,\n };\n const tooltipProps: TooltipProps =\n typeof tooltip === \"string\"\n ? {\n ...defaultTooltipProps,\n label: tooltip,\n children: actionElement,\n }\n : { ...defaultTooltipProps, ...tooltip, children: actionElement };\n\n return <Tooltip {...tooltipProps} />;\n }\n\n return actionElement;\n};\n\nexport default ActionButton;\n\n// ---------------------------------------------------------------------------------------------------------------------\n\n// Action Submit\n\n// ---------------------------------------------------------------------------------------------------------------------\n\nexport interface ActionSubmitButtonProps extends ButtonProps {\n form: FormModel<any>;\n type?: \"submit\" | \"reset\";\n}\n\n/**\n * Action button that submits a form with loading and disabled state handling.\n */\nconst ActionSubmitButton = (props: ActionSubmitButtonProps) => {\n const { form, ...buttonProps } = props;\n const state = useFormState(form);\n return (\n <Button\n {...buttonProps}\n loading={state.loading}\n disabled={state.loading}\n type={\"submit\"}\n >\n {props.children}\n </Button>\n );\n};\n\nconst ActionResetButton = (props: ActionSubmitButtonProps) => {\n const { form, ...buttonProps } = props;\n const state = useFormState(form);\n return (\n <Button {...buttonProps} disabled={state.loading} type={\"reset\"}>\n {props.children}\n </Button>\n );\n};\n\n// ---------------------------------------------------------------------------------------------------------------------\n\n// Action with useAction Hook\n\n// ---------------------------------------------------------------------------------------------------------------------\n\nexport interface ActionHookButtonProps extends ButtonProps {\n action: UseActionReturn<any[], any>;\n}\n\n/**\n * Action button that integrates with useAction hook return value.\n * Automatically handles loading state and executes the action on click.\n *\n * @example\n * ```tsx\n * const saveAction = useAction({\n * handler: async (data) => {\n * await api.save(data);\n * }\n * }, []);\n *\n * <ActionButton action={saveAction}>\n * Save\n * </ActionButton>\n * ```\n */\nconst ActionHookButton = (props: ActionHookButtonProps) => {\n const { action, ...buttonProps } = props;\n\n return (\n <Button\n {...buttonProps}\n disabled={action.loading || props.disabled}\n loading={action.loading}\n onClick={() => action.run()}\n >\n {props.children}\n </Button>\n );\n};\n\n// ---------------------------------------------------------------------------------------------------------------------\n\n// Action Click\n\n// ---------------------------------------------------------------------------------------------------------------------\n\nexport interface ActionClickButtonProps extends ButtonProps {\n onClick: (e: any) => any;\n}\n\n/**\n * Basic action button that handles click events with loading and error handling.\n *\n * @example\n * ```tsx\n * <ActionButton onClick={() => api.doSomething()}>\n * Do Something\n * </ActionButton>\n * ```\n */\nconst ActionClickButton = (props: ActionClickButtonProps) => {\n const action = useAction(\n {\n handler: async (e: any) => {\n await props.onClick(e);\n },\n },\n [props.onClick],\n );\n\n return (\n <Button\n {...props}\n disabled={action.loading || props.disabled}\n loading={action.loading}\n onClick={action.run}\n >\n {props.children}\n </Button>\n );\n};\n\n// ---------------------------------------------------------------------------------------------------------------------\n\n// Action Navigation\n\n// ---------------------------------------------------------------------------------------------------------------------\n\nexport interface ActionNavigationButtonProps extends ButtonProps {\n href: string;\n active?: Partial<UseActiveOptions> | false;\n routerGoOptions?: RouterGoOptions;\n classNameActive?: string;\n variantActive?: ButtonProps[\"variant\"];\n target?: string;\n anchorProps?: AnchorProps;\n}\n\n/**\n * Action for navigation with active state support.\n */\nconst ActionNavigationButton = (props: ActionNavigationButtonProps) => {\n const {\n active: options,\n classNameActive,\n variantActive,\n routerGoOptions,\n ...buttonProps\n } = props;\n const router = useRouter();\n const { isPending, isActive } = useActive(\n options ? { href: props.href, ...options } : { href: props.href },\n );\n const anchorProps = router.anchor(props.href, routerGoOptions);\n\n const className = buttonProps.className || \"\";\n if (isActive && options !== false && classNameActive) {\n buttonProps.className = `${className} ${classNameActive}`.trim();\n }\n\n if (props.anchorProps) {\n return (\n <Anchor component={\"a\"} {...anchorProps} {...props.anchorProps}>\n {props.children}\n </Anchor>\n );\n }\n\n return (\n <Button\n component={\"a\"}\n loading={isPending}\n {...buttonProps}\n {...anchorProps}\n variant={\n isActive && options !== false\n ? (variantActive ?? \"filled\")\n : (buttonProps.variant ?? \"subtle\")\n }\n >\n {props.children}\n </Button>\n );\n};\n\nconst ActionHrefButton = (props: ActionNavigationButtonProps) => {\n const {\n active: options,\n classNameActive,\n variantActive,\n routerGoOptions,\n target,\n ...buttonProps\n } = props;\n\n return (\n <Button component={\"a\"} target={target} {...buttonProps}>\n {props.children}\n </Button>\n );\n};\n\n// ---------------------------------------------------------------------------------------------------------------------\n\nexport function isComponentType(param: any): param is ComponentType<any> {\n if (isValidElement(param)) return false;\n return (\n typeof param === \"function\" ||\n (typeof param === \"object\" && param !== null && \"$$typeof\" in param)\n );\n}\n\nexport const renderIcon = (icon: ReactNode | ComponentType): ReactNode => {\n if (!icon) return null;\n if (isValidElement(icon)) return icon;\n if (isComponentType(icon)) {\n const IconComponent = icon;\n return <IconComponent size={ui.sizes.icon.md} />;\n }\n return icon as ReactNode;\n};\n","import { useStore } from \"@alepha/react\";\nimport { Burger, type BurgerProps } from \"@mantine/core\";\n\nexport interface BurgerButtonProps extends BurgerProps {}\n\nconst BurgerButton = (props: BurgerButtonProps) => {\n const [opened, setOpened] = useStore(\"alepha.ui.sidebar.opened\");\n\n return (\n <Burger\n opened={opened}\n onClick={() => setOpened(!opened)}\n hiddenFrom=\"sm\"\n size=\"sm\"\n {...props}\n />\n );\n};\n\nexport default BurgerButton;\n","import { CopyButton, Tooltip } from \"@mantine/core\";\nimport { IconCheck, IconCopy } from \"@tabler/icons-react\";\nimport ActionButton, { type ActionCommonProps } from \"./ActionButton.tsx\";\n\nexport interface ClipboardButtonProps\n extends Omit<ActionCommonProps, \"onClick\" | \"icon\"> {\n /**\n * The value to copy to the clipboard\n */\n value: string;\n\n /**\n * Timeout in ms to show the \"Copied\" state (default: 2000)\n */\n timeout?: number;\n\n /**\n * Label to show in tooltip when not copied (default: \"Copy\")\n */\n copyLabel?: string;\n\n /**\n * Label to show in tooltip when copied (default: \"Copied\")\n */\n copiedLabel?: string;\n}\n\nconst ClipboardButton = (props: ClipboardButtonProps) => {\n const {\n value,\n timeout = 2000,\n copyLabel = \"Copy\",\n copiedLabel = \"Copied\",\n children,\n ...buttonProps\n } = props;\n\n return (\n <CopyButton value={value} timeout={timeout}>\n {({ copied, copy }) => (\n <Tooltip label={copied ? copiedLabel : copyLabel} openDelay={500}>\n <ActionButton\n color={copied ? \"teal\" : undefined}\n onClick={copy}\n icon={copied ? IconCheck : IconCopy}\n {...buttonProps}\n >\n {children}\n </ActionButton>\n </Tooltip>\n )}\n </CopyButton>\n );\n};\n\nexport default ClipboardButton;\n","import {\n Flex,\n type MantineBreakpoint,\n SegmentedControl,\n type SegmentedControlProps,\n useComputedColorScheme,\n useMantineColorScheme,\n} from \"@mantine/core\";\nimport { IconMoon, IconSun } from \"@tabler/icons-react\";\nimport { useEffect, useState } from \"react\";\nimport ActionButton, { type ActionProps } from \"./ActionButton.tsx\";\n\nexport interface DarkModeButtonProps {\n mode?: \"minimal\" | \"segmented\";\n size?: MantineBreakpoint;\n variant?:\n | \"filled\"\n | \"light\"\n | \"outline\"\n | \"default\"\n | \"subtle\"\n | \"transparent\";\n\n fullWidth?: boolean;\n\n segmentedProps?: Partial<SegmentedControlProps>;\n actionProps?: Partial<ActionProps>;\n}\n\nconst DarkModeButton = (props: DarkModeButtonProps) => {\n const { setColorScheme } = useMantineColorScheme();\n const computedColorScheme = useComputedColorScheme(\"light\");\n const [colorScheme, setColorScheme2] = useState(\"default\");\n const mode = props.mode ?? \"minimal\";\n\n useEffect(() => {\n setColorScheme2(computedColorScheme);\n }, [computedColorScheme]);\n\n const toggleColorScheme = () => {\n setColorScheme(computedColorScheme === \"dark\" ? \"light\" : \"dark\");\n };\n\n if (mode === \"segmented\") {\n return (\n <SegmentedControl\n value={colorScheme}\n onChange={(value) => setColorScheme(value as \"light\" | \"dark\")}\n data={[\n {\n value: \"light\",\n label: (\n <Flex h={20} align=\"center\" justify=\"center\">\n <IconSun size={16} />\n </Flex>\n ),\n },\n {\n value: \"dark\",\n label: (\n <Flex h={20} align=\"center\" justify=\"center\">\n <IconMoon size={16} />\n </Flex>\n ),\n },\n ]}\n w={props.fullWidth ? \"100%\" : undefined}\n {...props.segmentedProps}\n />\n );\n }\n\n return (\n <ActionButton\n onClick={toggleColorScheme}\n variant={props.variant ?? \"default\"}\n size={props.size ?? \"sm\"}\n aria-label=\"Toggle color scheme\"\n px={\"xs\"}\n c={colorScheme !== \"default\" ? undefined : \"transparent\"}\n fullWidth={props.fullWidth ?? false}\n icon={\n colorScheme === \"dark\"\n ? IconSun\n : colorScheme === \"light\"\n ? IconMoon\n : IconSun\n }\n {...props.actionProps}\n />\n );\n};\n\nexport default DarkModeButton;\n","import { useI18n } from \"@alepha/react/i18n\";\nimport { IconLanguage } from \"@tabler/icons-react\";\nimport ActionButton, { type ActionProps } from \"./ActionButton.tsx\";\n\nexport interface LanguageButtonProps {\n languages?: string[];\n actionProps?: ActionProps;\n}\n\nconst LanguageButton = (props: LanguageButtonProps) => {\n const i18n = useI18n();\n return (\n <ActionButton\n variant={\"default\"}\n icon={IconLanguage}\n menu={{\n items: i18n.languages.map((lang) => ({\n label: i18n.tr(lang),\n onClick: () => i18n.setLang(lang),\n active: i18n.lang === lang,\n })),\n }}\n {...props.actionProps}\n />\n );\n};\n\nexport default LanguageButton;\n","import { Flex, Kbd, Text } from \"@mantine/core\";\nimport { spotlight } from \"@mantine/spotlight\";\nimport { IconSearch } from \"@tabler/icons-react\";\nimport ActionButton, { type ActionProps } from \"./ActionButton.tsx\";\n\nexport interface OmnibarButtonProps {\n actionProps?: ActionProps;\n collapsed?: boolean;\n}\n\nconst OmnibarButton = (props: OmnibarButtonProps) => {\n return (\n <ActionButton\n variant={\"default\"}\n onClick={spotlight.open}\n justify={\"space-between\"}\n rightSection={\n <Kbd visibleFrom={\"sm\"} size={\"sm\"}>\n ⌘+K\n </Kbd>\n }\n radius={\"md\"}\n {...props.actionProps}\n >\n <Flex align={\"center\"} gap={\"xs\"}>\n <IconSearch size={16} color={\"gray\"} />\n <Flex visibleFrom={\"sm\"} miw={192}>\n <Text size={\"xs\"} c={\"dimmed\"}>\n Search...\n </Text>\n </Flex>\n </Flex>\n </ActionButton>\n );\n};\n\nexport default OmnibarButton;\n","import {\n IconAt,\n IconCalendar,\n IconClock,\n IconColorPicker,\n IconFile,\n IconHash,\n IconKey,\n IconLetterCase,\n IconLink,\n IconList,\n IconMail,\n IconPalette,\n IconPhone,\n IconSelector,\n IconToggleLeft,\n} from \"@tabler/icons-react\";\nimport type { ReactElement } from \"react\";\nimport { ui } from \"../constants/ui.ts\";\n\nexport type IconSize = keyof typeof ui.sizes.icon;\n\n/**\n * Get the default icon for an input based on its type, format, or name.\n */\nexport const getDefaultIcon = (params: {\n type?: string;\n format?: string;\n name?: string;\n isEnum?: boolean;\n isArray?: boolean;\n size?: IconSize;\n}): ReactElement => {\n const { type, format, name, isEnum, isArray, size = \"sm\" } = params;\n const iconSize = ui.sizes.icon[size];\n\n // Format-based icons (highest priority)\n if (format) {\n switch (format) {\n case \"email\":\n return <IconMail size={iconSize} />;\n case \"url\":\n case \"uri\":\n return <IconLink size={iconSize} />;\n case \"tel\":\n case \"phone\":\n return <IconPhone size={iconSize} />;\n case \"date\":\n return <IconCalendar size={iconSize} />;\n case \"date-time\":\n return <IconCalendar size={iconSize} />;\n case \"time\":\n return <IconClock size={iconSize} />;\n case \"color\":\n return <IconColorPicker size={iconSize} />;\n case \"uuid\":\n return <IconKey size={iconSize} />;\n }\n }\n\n // Name-based icons (medium priority)\n if (name) {\n const nameLower = name.toLowerCase();\n if (nameLower.includes(\"password\") || nameLower.includes(\"secret\")) {\n return <IconKey size={iconSize} />;\n }\n if (nameLower.includes(\"email\") || nameLower.includes(\"mail\")) {\n return <IconMail size={iconSize} />;\n }\n if (nameLower.includes(\"url\") || nameLower.includes(\"link\")) {\n return <IconLink size={iconSize} />;\n }\n if (nameLower.includes(\"phone\") || nameLower.includes(\"tel\")) {\n return <IconPhone size={iconSize} />;\n }\n if (nameLower.includes(\"color\")) {\n return <IconPalette size={iconSize} />;\n }\n if (nameLower.includes(\"file\") || nameLower.includes(\"upload\")) {\n return <IconFile size={iconSize} />;\n }\n if (nameLower.includes(\"date\")) {\n return <IconCalendar size={iconSize} />;\n }\n if (nameLower.includes(\"time\")) {\n return <IconClock size={iconSize} />;\n }\n }\n\n // Type-based icons (lowest priority)\n if (isEnum || isArray) {\n return <IconSelector size={iconSize} />;\n }\n\n if (type) {\n switch (type) {\n case \"boolean\":\n return <IconToggleLeft size={iconSize} />;\n case \"number\":\n case \"integer\":\n return <IconHash size={iconSize} />;\n case \"array\":\n return <IconList size={iconSize} />;\n case \"string\":\n return <IconLetterCase size={iconSize} />;\n }\n }\n\n // Default icon\n return <IconAt size={iconSize} />;\n};\n","/**\n * Capitalizes the first letter of a string.\n *\n * @example\n * capitalize(\"hello\") // \"Hello\"\n */\nexport const capitalize = (str: string): string => {\n return str.charAt(0).toUpperCase() + str.slice(1);\n};\n\n/**\n * Converts a path or identifier string into a pretty display name.\n * Removes slashes and capitalizes the first letter.\n *\n * @example\n * prettyName(\"/userName\") // \"UserName\"\n * prettyName(\"email\") // \"Email\"\n */\nexport const prettyName = (name: string): string => {\n return capitalize(name.replaceAll(\"/\", \"\"));\n};\n","import type { InputField } from \"@alepha/react/form\";\nimport { type TObject, TypeBoxError } from \"alepha\";\nimport {\n createElement,\n isValidElement,\n type ReactElement,\n type ReactNode,\n} from \"react\";\nimport type { ControlProps } from \"../components/form/Control.tsx\";\nimport { ui } from \"../constants/ui.ts\";\nimport { getDefaultIcon } from \"./icons.tsx\";\nimport { prettyName } from \"./string.ts\";\n\nexport const parseInput = (\n props: GenericControlProps,\n form: {\n error?: Error;\n },\n): ControlInput => {\n const disabled = false; // form.loading;\n const id = props.input.props.id;\n const label =\n props.title ??\n (\"title\" in props.input.schema &&\n typeof props.input.schema.title === \"string\"\n ? props.input.schema.title\n : undefined) ??\n prettyName(props.input.path);\n const description =\n props.description ??\n (\"description\" in props.input.schema &&\n typeof props.input.schema.description === \"string\"\n ? props.input.schema.description\n : undefined);\n const error =\n form.error && form.error instanceof TypeBoxError\n ? form.error.value.message\n : undefined;\n\n // Auto-generate icon if not provided\n const icon = !props.icon\n ? getDefaultIcon({\n type:\n props.input.schema && \"type\" in props.input.schema\n ? String(props.input.schema.type)\n : undefined,\n format:\n props.input.schema &&\n \"format\" in props.input.schema &&\n typeof props.input.schema.format === \"string\"\n ? props.input.schema.format\n : undefined,\n name: props.input.props.name,\n isEnum:\n props.input.schema &&\n \"enum\" in props.input.schema &&\n Boolean(props.input.schema.enum),\n isArray:\n props.input.schema &&\n \"type\" in props.input.schema &&\n props.input.schema.type === \"array\",\n })\n : isValidElement(props.icon)\n ? props.icon\n : createElement(props.icon, { size: ui.sizes.icon.md });\n\n const format =\n props.input.schema &&\n \"format\" in props.input.schema &&\n typeof props.input.schema.format === \"string\"\n ? props.input.schema.format\n : undefined;\n\n const required = props.input.required;\n const schema = props.input.schema as TObject & { $control?: ControlProps };\n\n const inputProps: InputProps = {\n label,\n description,\n error,\n required,\n disabled,\n };\n\n if (\"minLength\" in schema && typeof schema.minLength === \"number\") {\n inputProps.minLength = schema.minLength;\n }\n if (\"maxLength\" in schema && typeof schema.maxLength === \"number\") {\n inputProps.maxLength = schema.maxLength;\n }\n if (\"minimum\" in schema && typeof schema.minimum === \"number\") {\n inputProps.minimum = schema.minimum;\n }\n if (\"maximum\" in schema && typeof schema.maximum === \"number\") {\n inputProps.maximum = schema.maximum;\n }\n\n return {\n id,\n icon,\n format,\n schema: props.input.schema as TObject & { $control?: ControlProps },\n inputProps,\n };\n};\n\nexport interface GenericControlProps {\n input: InputField;\n title?: string;\n description?: string;\n icon?: ReactElement | ((props: { size: number }) => ReactNode);\n}\n\nexport interface ControlInput {\n id?: string;\n icon: ReactElement;\n format?: string;\n schema: TObject & { $control?: ControlProps };\n inputProps: InputProps;\n}\n\nexport interface InputProps {\n label: string;\n description?: string;\n error?: string;\n required: boolean;\n disabled: boolean;\n\n minLength?: number;\n maxLength?: number;\n minimum?: number;\n maximum?: number;\n}\n","import { useFormState } from \"@alepha/react/form\";\nimport {\n DateInput,\n type DateInputProps,\n DateTimePicker,\n type DateTimePickerProps,\n TimeInput,\n type TimeInputProps,\n} from \"@mantine/dates\";\nimport {\n type GenericControlProps,\n parseInput,\n} from \"../../utils/parseInput.ts\";\n\nexport interface ControlDateProps extends GenericControlProps {\n date?: boolean | DateInputProps;\n datetime?: boolean | DateTimePickerProps;\n time?: boolean | TimeInputProps;\n}\n\n/**\n * ControlDate component for handling date, datetime, and time inputs.\n *\n * Features:\n * - DateInput for date format\n * - DateTimePicker for date-time format\n * - TimeInput for time format\n *\n * Automatically detects date formats from schema and renders appropriate picker.\n */\nconst ControlDate = (props: ControlDateProps) => {\n const form = useFormState(props.input);\n const { inputProps, id, icon, format } = parseInput(props, form);\n if (!props.input?.props) {\n return null;\n }\n\n // region <DateTimePicker/>\n if (props.datetime || format === \"date-time\") {\n const dateTimePickerProps =\n typeof props.datetime === \"object\" ? props.datetime : {};\n return (\n <DateTimePicker\n {...inputProps}\n id={id}\n leftSection={icon}\n defaultValue={\n props.input.props.defaultValue\n ? new Date(props.input.props.defaultValue)\n : undefined\n }\n onChange={(value) => {\n props.input.set(value ? new Date(value).toISOString() : undefined);\n }}\n {...dateTimePickerProps}\n />\n );\n }\n //endregion\n\n // region <DateInput/>\n if (props.date || format === \"date\") {\n const dateInputProps = typeof props.date === \"object\" ? props.date : {};\n return (\n <DateInput\n {...inputProps}\n id={id}\n leftSection={icon}\n defaultValue={\n props.input.props.defaultValue\n ? new Date(props.input.props.defaultValue)\n : undefined\n }\n onChange={(value) => {\n props.input.set(\n value ? new Date(value).toISOString().slice(0, 10) : undefined,\n );\n }}\n {...dateInputProps}\n />\n );\n }\n //endregion\n\n // region <TimeInput/>\n if (props.time || format === \"time\") {\n const timeInputProps = typeof props.time === \"object\" ? props.time : {};\n return (\n <TimeInput\n {...inputProps}\n id={id}\n leftSection={icon}\n defaultValue={props.input.props.defaultValue}\n onChange={(event) => {\n props.input.set(event.currentTarget.value);\n }}\n {...timeInputProps}\n />\n );\n }\n //endregion\n\n // Fallback - shouldn't happen\n return null;\n};\n\nexport default ControlDate;\n","import { useEvents } from \"@alepha/react\";\nimport { useFormState } from \"@alepha/react/form\";\nimport {\n Input,\n NumberInput,\n type NumberInputProps,\n Slider,\n type SliderProps,\n} from \"@mantine/core\";\nimport { useRef, useState } from \"react\";\nimport {\n type GenericControlProps,\n parseInput,\n} from \"../../utils/parseInput.ts\";\n\nexport interface ControlNumberProps extends GenericControlProps {\n numberInputProps?: Partial<NumberInputProps>;\n sliderProps?: Partial<SliderProps>;\n}\n\n/**\n *\n */\nconst ControlNumber = (props: ControlNumberProps) => {\n const form = useFormState(props.input);\n const { inputProps, id, icon } = parseInput(props, form);\n const ref = useRef<HTMLInputElement | null>(null);\n\n // HTML Reset doesn't trigger on <NumberInput /> so we handle it manually\n\n const [value, setValue] = useState<number | undefined>(\n props.input.props.defaultValue,\n );\n\n useEvents(\n {\n \"form:reset\": (event) => {\n if (event.id === props.input?.form.id && ref.current) {\n setValue(props.input.props.defaultValue);\n }\n },\n },\n [props.input],\n );\n\n if (!props.input?.props) {\n return null;\n }\n\n const { type, ...inputPropsWithoutType } = props.input.props;\n\n if (props.sliderProps) {\n return (\n <Input.Wrapper {...inputProps}>\n <div\n style={{\n height: 32,\n padding: 8,\n }}\n >\n <Slider\n {...inputProps}\n ref={ref}\n id={id}\n {...inputPropsWithoutType}\n {...props.sliderProps}\n value={value}\n onChange={(val) => {\n setValue(val);\n props.input.set(val);\n }}\n />\n </div>\n </Input.Wrapper>\n );\n }\n\n return (\n <NumberInput\n {...inputProps}\n ref={ref}\n id={id}\n leftSection={icon}\n {...inputPropsWithoutType}\n {...props.numberInputProps}\n value={value ?? \"\"}\n onChange={(val) => {\n const newValue = val !== null ? Number(val) : undefined;\n setValue(newValue);\n props.input.set(newValue);\n }}\n />\n );\n};\n\nexport default ControlNumber;\n","import type { TObject, TProperties, TSchema } from \"alepha\";\n\nexport interface SchemaField {\n name: string;\n path: string;\n type: string;\n enum?: readonly any[];\n format?: string;\n description?: string;\n nested?: SchemaField[];\n}\n\n/**\n * Extract field information from a TypeBox schema for query building.\n * Supports nested objects and provides field metadata for autocomplete.\n */\nexport function extractSchemaFields(\n schema: TObject | TProperties,\n prefix = \"\",\n): SchemaField[] {\n const fields: SchemaField[] = [];\n\n // Safety check\n if (!schema || typeof schema !== \"object\") {\n return fields;\n }\n\n // Handle TObject wrapper\n const properties =\n \"properties\" in schema ? schema.properties : (schema as TProperties);\n\n // Safety check for properties\n if (!properties || typeof properties !== \"object\") {\n return fields;\n }\n\n for (const [key, value] of Object.entries(properties)) {\n // Skip if value is not an object (type guard)\n if (typeof value !== \"object\" || value === null) {\n continue;\n }\n\n const fieldSchema = value as TSchema & {\n format?: string;\n enum?: readonly any[];\n description?: string;\n };\n\n const path = prefix ? `${prefix}.${key}` : key;\n\n // Determine the display type - use format for datetime-related fields\n const format = \"format\" in fieldSchema ? fieldSchema.format : undefined;\n const baseType =\n \"type\" in fieldSchema ? (fieldSchema.type as string) : \"object\";\n\n let displayType = baseType;\n if (format === \"date-time\") {\n displayType = \"datetime\";\n } else if (format === \"date\") {\n displayType = \"date\";\n } else if (format === \"time\") {\n displayType = \"time\";\n } else if (format === \"duration\") {\n displayType = \"duration\";\n }\n\n const field: SchemaField = {\n name: key,\n path,\n type: displayType,\n format,\n description:\n \"description\" in fieldSchema ? fieldSchema.description : undefined,\n };\n\n // Handle enum\n if (\"enum\" in fieldSchema && fieldSchema.enum) {\n field.enum = fieldSchema.enum;\n field.type = \"enum\";\n }\n\n // Handle nested objects\n if (\n \"type\" in fieldSchema &&\n fieldSchema.type === \"object\" &&\n \"properties\" in fieldSchema &&\n typeof fieldSchema.properties === \"object\"\n ) {\n field.nested = extractSchemaFields(\n fieldSchema.properties as TProperties,\n path,\n );\n }\n\n fields.push(field);\n\n // Also add nested fields to the flat list for autocomplete\n if (field.nested) {\n fields.push(...field.nested);\n }\n }\n\n return fields;\n}\n\n/**\n * Get suggested operators based on field type\n */\nexport function getOperatorsForField(field: SchemaField): string[] {\n const allOperators = [\"=\", \"!=\"];\n\n if (field.enum) {\n // Enum fields: equality and IN array\n return [...allOperators, \"in\"];\n }\n\n switch (field.type) {\n case \"string\":\n case \"text\":\n // String fields: equality and null checks (wildcards supported in = operator)\n return [...allOperators, \"null\"];\n\n case \"number\":\n case \"integer\":\n // Numeric fields: all comparison operators\n return [...allOperators, \">\", \">=\", \"<\", \"<=\"];\n\n case \"boolean\":\n // Boolean fields: only equality\n return allOperators;\n\n case \"datetime\":\n case \"date\":\n // Date fields: all comparison operators\n return [...allOperators, \">\", \">=\", \"<\", \"<=\"];\n\n default:\n return [...allOperators, \"null\"];\n }\n}\n\n/**\n * Get operator symbol and description\n */\nexport const OPERATOR_INFO: Record<\n string,\n { symbol: string; label: string; example: string }\n> = {\n eq: { symbol: \"=\", label: \"equals\", example: \"name=John\" },\n ne: { symbol: \"!=\", label: \"not equals\", example: \"status!=archived\" },\n gt: { symbol: \">\", label: \"greater than\", example: \"age>18\" },\n gte: { symbol: \">=\", label: \"greater or equal\", example: \"age>=18\" },\n lt: { symbol: \"<\", label: \"less than\", example: \"age<65\" },\n lte: { symbol: \"<=\", label: \"less or equal\", example: \"age<=65\" },\n null: { symbol: \"=null\", label: \"is null\", example: \"deletedAt=null\" },\n notNull: {\n symbol: \"!=null\",\n label: \"is not null\",\n example: \"email!=null\",\n },\n in: {\n symbol: \"[...]\",\n label: \"in array\",\n example: \"status=[active,pending]\",\n },\n};\n","import { useEvents } from \"@alepha/react\";\nimport {\n ActionIcon,\n Badge,\n Divider,\n Flex,\n Group,\n Popover,\n Stack,\n Text,\n TextInput,\n type TextInputProps,\n} from \"@mantine/core\";\nimport { IconFilter, IconInfoTriangle, IconX } from \"@tabler/icons-react\";\nimport type { TObject } from \"alepha\";\nimport { parseQueryString } from \"alepha/orm\";\nimport { useRef, useState } from \"react\";\nimport { ui } from \"../../constants/ui.ts\";\nimport {\n extractSchemaFields,\n OPERATOR_INFO,\n type SchemaField,\n} from \"../../utils/extractSchemaFields.ts\";\nimport ActionButton from \"../buttons/ActionButton.tsx\";\n\nexport interface ControlQueryBuilderProps\n extends Omit<TextInputProps, \"value\" | \"onChange\"> {\n schema?: TObject;\n value?: string;\n onChange?: (value: string) => void;\n placeholder?: string;\n}\n\n/**\n * Query builder with text input and help popover.\n * Generates query strings for parseQueryString syntax.\n */\nconst ControlQueryBuilder = ({\n schema,\n value = \"\",\n onChange,\n placeholder = \"Enter query or click for assistance...\",\n ...textInputProps\n}: ControlQueryBuilderProps) => {\n const [helpOpened, setHelpOpened] = useState(false);\n const [textValue, setTextValue] = useState(value);\n const inputRef = useRef<HTMLInputElement>(null);\n const fields = schema ? extractSchemaFields(schema) : [];\n const [error, setError] = useState<string | null>(null);\n\n const isValid = (value: string) => {\n try {\n parseQueryString(value.trim());\n } catch (e) {\n setError((e as Error).message);\n return false;\n }\n setError(null);\n return true;\n };\n\n const handleTextChange = (newValue: string) => {\n setTextValue(newValue);\n if (isValid(newValue)) {\n onChange?.(newValue);\n }\n };\n\n const handleClear = () => {\n setTextValue(\"\");\n onChange?.(\"\");\n isValid(\"\");\n };\n\n const handleInsert = (text: string) => {\n const newValue = textValue ? `${textValue}${text} ` : `${text} `;\n setTextValue(newValue);\n if (isValid(newValue)) {\n onChange?.(newValue);\n }\n // Refocus the input after inserting\n setTimeout(() => {\n inputRef.current?.focus();\n // set cursor to end\n const length = inputRef.current?.value.length || 0;\n inputRef.current?.setSelectionRange(length, length);\n }, 0);\n };\n\n useEvents(\n {\n \"form:change\": (event) => {\n if (event.id === inputRef.current?.form?.id) {\n if (event.path === (textInputProps as any)[\"data-path\"]) {\n setTextValue(event.value ?? \"\");\n }\n }\n },\n },\n [],\n );\n\n return (\n <Popover\n width={800}\n position=\"bottom-start\"\n shadow=\"md\"\n opened={helpOpened}\n onChange={setHelpOpened}\n closeOnClickOutside\n closeOnEscape\n transitionProps={{\n transition: \"fade-up\",\n duration: 200,\n timingFunction: \"ease\",\n }}\n >\n <Popover.Target>\n <TextInput\n ref={inputRef}\n placeholder={placeholder}\n value={textValue}\n onChange={(e) => handleTextChange(e.currentTarget.value)}\n onFocus={() => setHelpOpened(true)}\n leftSection={\n error ? <IconInfoTriangle size={16} /> : <IconFilter size={16} />\n }\n rightSection={\n textValue && (\n <ActionIcon\n size=\"sm\"\n variant=\"subtle\"\n color=\"gray\"\n onClick={handleClear}\n >\n <IconX size={14} />\n </ActionIcon>\n )\n }\n {...textInputProps}\n />\n </Popover.Target>\n <Popover.Dropdown\n bg={\"transparent\"}\n p={\"xs\"}\n bd={`1px solid ${ui.colors.border}`}\n style={{\n backdropFilter: \"blur(20px)\",\n }}\n >\n <QueryHelp fields={fields} onInsert={handleInsert} />\n </Popover.Dropdown>\n </Popover>\n );\n};\n\n// ---------------------------------------------------------------------------------------------------------------------\n// Query Help Component\n// ---------------------------------------------------------------------------------------------------------------------\n\ninterface QueryHelpProps {\n fields: SchemaField[];\n onInsert: (text: string) => void;\n}\n\nfunction QueryHelp({ fields, onInsert }: QueryHelpProps) {\n return (\n <Group\n gap=\"md\"\n align=\"flex-start\"\n wrap=\"nowrap\"\n bg={ui.colors.surface}\n p={\"sm\"}\n bdrs={\"sm\"}\n >\n {/* Left Column: Operators */}\n <Stack gap=\"md\" style={{ flex: 1 }}>\n {/* Available Operators */}\n <Stack gap=\"xs\">\n <Text size=\"sm\" fw={600}>\n Operators\n </Text>\n <Stack gap={4}>\n {Object.entries(OPERATOR_INFO).map(([key, info]) => (\n <Group key={key} gap=\"xs\" wrap=\"nowrap\">\n <ActionButton\n px={\"xs\"}\n size={\"xs\"}\n h={24}\n variant={\"default\"}\n justify={\"center\"}\n miw={48}\n onClick={() => onInsert(info.symbol)}\n >\n {info.symbol}\n </ActionButton>\n <Text size=\"xs\" c=\"dimmed\" style={{ flex: 1 }}>\n {info.label}\n </Text>\n </Group>\n ))}\n </Stack>\n </Stack>\n\n <Divider />\n\n {/* Logic Operators */}\n <Stack gap=\"xs\">\n <Text size=\"sm\" fw={600}>\n Logic\n </Text>\n <Stack gap={4}>\n <Group gap=\"xs\" wrap=\"nowrap\">\n <ActionButton\n px={\"xs\"}\n size={\"xs\"}\n h={24}\n variant={\"default\"}\n justify={\"center\"}\n miw={48}\n onClick={() => onInsert(\"&\")}\n >\n &\n </ActionButton>\n <Text size=\"xs\" c=\"dimmed\">\n AND\n </Text>\n </Group>\n <Group gap=\"xs\" wrap=\"nowrap\">\n <ActionButton\n px={\"xs\"}\n size={\"xs\"}\n h={24}\n variant={\"default\"}\n justify={\"center\"}\n miw={48}\n onClick={() => onInsert(\"|\")}\n >\n |\n </ActionButton>\n <Text size=\"xs\" c=\"dimmed\">\n OR\n </Text>\n </Group>\n </Stack>\n </Stack>\n </Stack>\n\n {/* Divider */}\n {fields.length > 0 && <Divider orientation=\"vertical\" />}\n\n {/* Right Column: Fields */}\n {fields.length > 0 && (\n <Flex direction={\"column\"} gap=\"xs\" style={{ flex: 2 }}>\n <Text size=\"sm\" fw={600}>\n Fields\n </Text>\n <Flex\n direction={\"column\"}\n gap={4}\n style={{ maxHeight: 300, overflowY: \"auto\" }}\n >\n {fields.map((field) => (\n <Flex key={field.path} gap=\"xs\" wrap=\"nowrap\" align=\"flex-start\">\n <ActionButton\n px={\"xs\"}\n size={\"xs\"}\n h={24}\n variant={\"default\"}\n justify={\"end\"}\n miw={120}\n onClick={() => onInsert(field.path)}\n >\n {field.path}\n </ActionButton>\n <Flex\n mt={3}\n direction={\"column\"}\n gap={2}\n style={{ flex: 1, minWidth: 0 }}\n >\n <Text size=\"xs\" c=\"dimmed\" lineClamp={1}>\n {field.description || field.type}\n </Text>\n {field.enum && (\n <Group gap={0} wrap=\"wrap\">\n {field.enum.map((enumValue) => (\n <ActionButton\n px={\"xs\"}\n size={\"xs\"}\n h={24}\n key={enumValue}\n onClick={() => onInsert(enumValue)}\n >\n {enumValue}\n </ActionButton>\n ))}\n </Group>\n )}\n </Flex>\n <Badge size=\"xs\" variant=\"light\" style={{ flexShrink: 0 }}>\n {field.type}\n </Badge>\n </Flex>\n ))}\n </Flex>\n </Flex>\n )}\n </Group>\n );\n}\n\nexport default ControlQueryBuilder;\n","import { useFormState } from \"@alepha/react/form\";\nimport {\n Autocomplete,\n type AutocompleteProps,\n Flex,\n Input,\n MultiSelect,\n type MultiSelectProps,\n SegmentedControl,\n type SegmentedControlProps,\n Select,\n type SelectProps,\n TagsInput,\n type TagsInputProps,\n} from \"@mantine/core\";\nimport { useEffect, useState } from \"react\";\nimport {\n type GenericControlProps,\n parseInput,\n} from \"../../utils/parseInput.ts\";\n\nexport type SelectValueLabel =\n | string\n | { value: string; label: string; icon?: string };\n\nexport interface ControlSelectProps extends GenericControlProps {\n select?: boolean | SelectProps;\n multi?: boolean | MultiSelectProps;\n tags?: boolean | TagsInputProps;\n autocomplete?: boolean | AutocompleteProps;\n segmented?: boolean | Partial<SegmentedControlProps>;\n\n loader?: () => Promise<SelectValueLabel[]>;\n}\n\n/**\n * ControlSelect component for handling Select, MultiSelect, and TagsInput.\n *\n * Features:\n * - Basic Select with enum support\n * - MultiSelect for array of enums\n * - TagsInput for array of strings (no enum)\n * - Future: Lazy loading\n * - Future: Searchable/filterable options\n * - Future: Custom option rendering\n *\n * Automatically detects enum values and array types from schema.\n */\nconst ControlSelect = (props: ControlSelectProps) => {\n const form = useFormState(props.input);\n const { inputProps, id, icon } = parseInput(props, form);\n\n // Detect if schema is an array type\n const isArray =\n props.input.schema &&\n \"type\" in props.input.schema &&\n props.input.schema.type === \"array\";\n\n // For arrays, check if items have enum (MultiSelect) or not (TagsInput)\n let itemsEnum: string[] | undefined;\n if (isArray && \"items\" in props.input.schema && props.input.schema.items) {\n const items: any = props.input.schema.items;\n if (\"enum\" in items && Array.isArray(items.enum)) {\n itemsEnum = items.enum;\n }\n }\n\n // Extract enum values from schema (for non-array select)\n const enumValues =\n props.input.schema &&\n \"enum\" in props.input.schema &&\n Array.isArray(props.input.schema.enum)\n ? props.input.schema.enum\n : [];\n\n const [data, setData] = useState<SelectValueLabel[]>([]);\n\n useEffect(() => {\n if (!props.input?.props) {\n return;\n }\n\n if (props.loader) {\n props.loader().then(setData);\n } else {\n setData(enumValues);\n }\n }, [props.input, props.loader]);\n\n if (!props.input?.props) {\n return null;\n }\n\n if (props.segmented) {\n const segmentedControlProps: Partial<SegmentedControlProps> =\n typeof props.segmented === \"object\" ? props.segmented : {};\n\n return (\n <Input.Wrapper {...inputProps}>\n <Flex>\n <SegmentedControl\n disabled={inputProps.disabled}\n defaultValue={String(props.input.props.defaultValue)}\n {...segmentedControlProps}\n onChange={(value) => {\n props.input.set(value);\n }}\n data={data.slice(0, 10)}\n />\n </Flex>\n </Input.Wrapper>\n );\n }\n\n if (props.autocomplete) {\n const autocompleteProps =\n typeof props.autocomplete === \"object\" ? props.autocomplete : {};\n\n return (\n <Autocomplete\n {...inputProps}\n id={id}\n leftSection={icon}\n data={data}\n {...props.input.props}\n {...autocompleteProps}\n />\n );\n }\n\n // region <TagsInput/> - for array of strings without enum\n if ((isArray && !itemsEnum) || props.tags) {\n const tagsInputProps = typeof props.tags === \"object\" ? props.tags : {};\n return (\n <TagsInput\n {...inputProps}\n id={id}\n leftSection={icon}\n defaultValue={\n Array.isArray(props.input.props.defaultValue)\n ? props.input.props.defaultValue\n : []\n }\n onChange={(value) => {\n props.input.set(value);\n }}\n {...tagsInputProps}\n />\n );\n }\n // endregion\n\n // region <MultiSelect/> - for array of enums\n if ((isArray && itemsEnum) || props.multi) {\n const data =\n itemsEnum?.map((value: string) => ({\n value,\n label: value,\n })) || [];\n\n const multiSelectProps = typeof props.multi === \"object\" ? props.multi : {};\n\n return (\n <MultiSelect\n {...inputProps}\n id={id}\n leftSection={icon}\n data={data}\n defaultValue={\n Array.isArray(props.input.props.defaultValue)\n ? props.input.props.defaultValue\n : []\n }\n onChange={(value) => {\n props.input.set(value);\n }}\n {...multiSelectProps}\n />\n );\n }\n // endregion\n\n // region <Select/> - for single enum value\n const selectProps = typeof props.select === \"object\" ? props.select : {};\n\n return (\n <Select\n {...inputProps}\n id={id}\n leftSection={icon}\n data={data}\n {...props.input.props}\n {...selectProps}\n />\n );\n // endregion\n};\n\nexport default ControlSelect;\n","import { useFormState } from \"@alepha/react/form\";\nimport {\n ColorInput,\n type ColorInputProps,\n FileInput,\n type FileInputProps,\n Flex,\n Input,\n PasswordInput,\n type PasswordInputProps,\n Switch,\n type SwitchProps,\n Textarea,\n type TextareaProps,\n TextInput,\n type TextInputProps,\n} from \"@mantine/core\";\nimport type {\n DateInputProps,\n DateTimePickerProps,\n TimeInputProps,\n} from \"@mantine/dates\";\nimport type { ComponentType } from \"react\";\nimport {\n type GenericControlProps,\n parseInput,\n} from \"../../utils/parseInput.ts\";\nimport ControlDate from \"./ControlDate.tsx\";\nimport ControlNumber, { type ControlNumberProps } from \"./ControlNumber.tsx\";\nimport ControlQueryBuilder from \"./ControlQueryBuilder.tsx\";\nimport ControlSelect, { type ControlSelectProps } from \"./ControlSelect.tsx\";\n\nexport interface ControlProps extends GenericControlProps {\n text?: TextInputProps;\n area?: boolean | TextareaProps;\n select?: boolean | Partial<ControlSelectProps>;\n password?: boolean | PasswordInputProps;\n switch?: boolean | SwitchProps;\n number?: boolean | Partial<ControlNumberProps>;\n file?: boolean | FileInputProps;\n color?: boolean | ColorInputProps;\n date?: boolean | DateInputProps;\n datetime?: boolean | DateTimePickerProps;\n time?: boolean | TimeInputProps;\n query?: any; // Enable query builder mode with schema-aware autocomplete\n custom?: ComponentType<CustomControlProps>;\n}\n\n/**\n * Generic form control that renders the appropriate input based on the schema and props.\n *\n * Supports:\n * - TextInput (with format detection: email, url, tel)\n * - Textarea\n * - NumberInput (for number/integer types)\n * - FileInput\n * - ColorInput (for color format)\n * - Select (for enum types)\n * - Autocomplete\n * - PasswordInput\n * - Switch (for boolean types)\n * - SegmentedControl (for enum types)\n * - DateInput (for date format)\n * - DateTimePicker (for date-time format)\n * - TimeInput (for time format)\n * - QueryBuilder (for building type-safe queries with autocomplete)\n * - Custom component\n *\n * Automatically handles labels, descriptions, error messages, required state, and default icons.\n */\nconst Control = (_props: ControlProps) => {\n const form = useFormState(_props.input, [\"error\"]);\n const { inputProps, id, icon, format, schema } = parseInput(_props, form);\n if (!_props.input?.props) {\n return null;\n }\n\n const props = {\n ..._props,\n ...schema.$control,\n };\n\n //region <QueryBuilder/>\n if (props.query) {\n return (\n <ControlQueryBuilder\n {...props.input.props}\n {...inputProps}\n schema={props.query}\n value={props.input.props.value}\n onChange={(value) => {\n props.input.set(value);\n }}\n />\n );\n }\n //endregion\n\n //region <Custom/>\n if (props.custom) {\n const Custom = props.custom;\n return (\n <Input.Wrapper {...inputProps}>\n <Flex flex={1} mt={\"calc(var(--mantine-spacing-xs) / 2)\"}>\n <Custom\n defaultValue={props.input.props.defaultValue}\n onChange={(value) => {\n props.input.set(value);\n }}\n />\n </Flex>\n </Input.Wrapper>\n );\n }\n //endregion\n\n //region <NumberInput/>\n if (\n props.number ||\n (props.input.schema &&\n \"type\" in props.input.schema &&\n (props.input.schema.type === \"number\" ||\n props.input.schema.type === \"integer\"))\n ) {\n const controlNumberProps =\n typeof props.number === \"object\" ? props.number : {};\n return (\n <ControlNumber\n input={props.input}\n title={props.title}\n description={props.description}\n icon={icon}\n {...controlNumberProps}\n />\n );\n }\n //endregion\n\n //region <FileInput/>\n if (props.file) {\n const fileInputProps = typeof props.file === \"object\" ? props.file : {};\n return (\n <FileInput\n {...inputProps}\n id={id}\n leftSection={icon}\n onChange={(file) => {\n props.input.set(file);\n }}\n {...fileInputProps}\n />\n );\n }\n //endregion\n\n //region <ColorInput/>\n if (props.color || format === \"color\") {\n const colorInputProps = typeof props.color === \"object\" ? props.color : {};\n return (\n <ColorInput\n {...inputProps}\n id={id}\n leftSection={icon}\n {...props.input.props}\n {...colorInputProps}\n />\n );\n }\n //endregion\n\n //region <ControlSelect/>\n // Handle: single enum, array of enum, array of strings, or explicit select/multi/tags props\n const isEnum =\n props.input.schema &&\n \"enum\" in props.input.schema &&\n props.input.schema.enum;\n const isArray =\n props.input.schema &&\n \"type\" in props.input.schema &&\n props.input.schema.type === \"array\";\n\n if (isEnum || isArray || props.select) {\n const opts = typeof props.select === \"object\" ? props.select : {};\n return (\n <ControlSelect\n input={props.input}\n title={props.title}\n description={props.description}\n icon={icon}\n {...opts}\n />\n );\n }\n //endregion\n\n //region <Switch/>\n if (\n (props.input.schema &&\n \"type\" in props.input.schema &&\n props.input.schema.type === \"boolean\") ||\n props.switch\n ) {\n const switchProps = typeof props.switch === \"object\" ? props.switch : {};\n\n return (\n <Switch\n {...inputProps}\n id={id}\n color={\"blue\"}\n defaultChecked={props.input.props.defaultValue}\n {...props.input.props}\n {...switchProps}\n />\n );\n }\n //endregion\n\n //region <PasswordInput/>\n if (props.password || props.input.props.name?.includes(\"password\")) {\n const passwordInputProps =\n typeof props.password === \"object\" ? props.password : {};\n return (\n <PasswordInput\n {...inputProps}\n id={id}\n leftSection={icon}\n {...props.input.props}\n {...passwordInputProps}\n />\n );\n }\n //endregion\n\n //region <Textarea/>\n if (props.area) {\n const textAreaProps = typeof props.area === \"object\" ? props.area : {};\n return (\n <Textarea\n {...inputProps}\n id={id}\n leftSection={icon}\n {...props.input.props}\n {...textAreaProps}\n />\n );\n }\n //endregion\n\n //region <ControlDate/>\n // Handle: date, date-time, and time formats\n if (\n props.date ||\n props.datetime ||\n props.time ||\n format === \"date\" ||\n format === \"date-time\" ||\n format === \"time\"\n ) {\n return (\n <ControlDate\n input={props.input}\n title={props.title}\n description={props.description}\n icon={icon}\n date={props.date}\n datetime={props.datetime}\n time={props.time}\n />\n );\n }\n //endregion\n\n //region <TextInput/> with format detection\n const textInputProps = typeof props.text === \"object\" ? props.text : {};\n\n // Detect HTML5 input type from format\n const getInputType = (): string | undefined => {\n switch (format) {\n case \"email\":\n return \"email\";\n case \"url\":\n case \"uri\":\n return \"url\";\n case \"tel\":\n case \"phone\":\n return \"tel\";\n default:\n return undefined;\n }\n };\n\n return (\n <TextInput\n {...inputProps}\n id={id}\n leftSection={icon}\n type={getInputType()}\n {...props.input.props}\n {...textInputProps}\n inputWrapperOrder={[\"label\", \"input\", \"description\", \"error\"]}\n />\n );\n //endregion\n};\n\nexport default Control;\n\nexport type CustomControlProps = {\n defaultValue: any;\n onChange: (value: any) => void;\n};\n","import type { FormModel } from \"@alepha/react/form\";\nimport { Flex, Grid } from \"@mantine/core\";\nimport type { TObject } from \"alepha\";\nimport type { ReactNode } from \"react\";\nimport ActionButton, {\n type ActionSubmitButtonProps,\n} from \"../buttons/ActionButton.tsx\";\nimport Control, { type ControlProps } from \"./Control.tsx\";\n\nexport interface TypeFormProps<T extends TObject> {\n form: FormModel<T>;\n columns?:\n | number\n | {\n base?: number;\n xs?: number;\n sm?: number;\n md?: number;\n lg?: number;\n xl?: number;\n };\n schema?: TObject;\n children?: (input: FormModel<T>[\"input\"]) => ReactNode;\n controlProps?: Partial<Omit<ControlProps, \"input\">>;\n skipFormElement?: boolean;\n skipSubmitButton?: boolean;\n submitButtonProps?: Partial<Omit<ActionSubmitButtonProps, \"form\">>;\n resetButtonProps?: Partial<Omit<ActionSubmitButtonProps, \"form\">>;\n}\n\n/**\n * TypeForm component that automatically renders all form inputs based on schema.\n * Uses the Control component to render individual fields and Mantine Grid for responsive layout.\n *\n * @example\n * ```tsx\n * import { t } from \"alepha\";\n * import { useForm } from \"@alepha/react/form\";\n * import { TypeForm } from \"@alepha/ui\";\n *\n * const form = useForm({\n * schema: t.object({\n * username: t.text(),\n * email: t.text(),\n * age: t.integer(),\n * subscribe: t.boolean(),\n * }),\n * handler: (values) => {\n * console.log(values);\n * },\n * });\n *\n * return <TypeForm form={form} columns={2} />;\n * ```\n */\nconst TypeForm = <T extends TObject>(props: TypeFormProps<T>) => {\n const {\n form,\n columns = 3,\n children,\n controlProps,\n skipFormElement = false,\n skipSubmitButton = false,\n submitButtonProps,\n } = props;\n\n const schema = props.schema || form.options.schema;\n if (!schema?.properties) {\n return null;\n }\n\n const fieldNames = Object.keys(schema.properties);\n\n // Filter out unsupported field types (objects only, arrays are now supported)\n const supportedFields = fieldNames.filter((fieldName) => {\n const field = form.input[fieldName as keyof typeof form.input];\n if (!field || typeof field !== \"object\" || !(\"schema\" in field)) {\n return false;\n }\n\n const schema: any = field.schema;\n\n // Skip if it's an object (not supported by Control)\n // Arrays are now supported via ControlSelect (MultiSelect/TagsInput)\n if (\"type\" in schema) {\n if (schema.type === \"object\") {\n return false;\n }\n }\n\n // Check if it has properties (nested object)\n if (\"properties\" in schema && schema.properties) {\n return false;\n }\n\n return true;\n });\n\n // Handle column configuration with defaults: xs=1, sm=2, lg=3\n const colSpan =\n typeof columns === \"number\"\n ? {\n xs: 12,\n sm: 6,\n lg: 12 / columns,\n }\n : {\n base: columns.base ? 12 / columns.base : undefined,\n xs: columns.xs ? 12 / columns.xs : 12,\n sm: columns.sm ? 12 / columns.sm : 6,\n md: columns.md ? 12 / columns.md : undefined,\n lg: columns.lg ? 12 / columns.lg : 4,\n xl: columns.xl ? 12 / columns.xl : undefined,\n };\n\n const renderFields = () => {\n if (children) {\n return <>{children(form.input)}</>;\n }\n\n return (\n <Grid>\n {supportedFields.map((fieldName) => {\n const field = form.input[fieldName as keyof typeof form.input];\n\n // Type guard to ensure field has the expected structure\n if (!field || typeof field !== \"object\" || !(\"schema\" in field)) {\n return null;\n }\n\n return (\n <Grid.Col key={fieldName} span={colSpan}>\n <Control input={field as any} {...controlProps} />\n </Grid.Col>\n );\n })}\n </Grid>\n );\n };\n\n const content = (\n <Flex direction={\"column\"} gap={\"sm\"}>\n {renderFields()}\n {!skipSubmitButton && (\n <Flex gap={\"sm\"}>\n <ActionButton form={form} {...submitButtonProps}>\n {submitButtonProps?.children ?? \"Submit\"}\n </ActionButton>\n <ActionButton type={\"reset\"}>Reset</ActionButton>\n </Flex>\n )}\n </Flex>\n );\n\n if (skipFormElement) {\n return content;\n }\n\n return <form {...form.props}>{content}</form>;\n};\n\nexport default TypeForm;\n","import { Divider, Flex, type FlexProps } from \"@mantine/core\";\nimport type { ReactNode } from \"react\";\nimport BurgerButton from \"../buttons/BurgerButton.tsx\";\nimport DarkModeButton, {\n type DarkModeButtonProps,\n} from \"../buttons/DarkModeButton.tsx\";\nimport LanguageButton, {\n type LanguageButtonProps,\n} from \"../buttons/LanguageButton.tsx\";\nimport OmnibarButton, {\n type OmnibarButtonProps,\n} from \"../buttons/OmnibarButton.tsx\";\n\nexport type AppBarItem =\n | AppBarElement\n | AppBarBurger\n | AppBarDark\n | AppBarSearch\n | AppBarLang\n | AppBarSpacer\n | AppBarDivider;\n\nexport interface AppBarElement {\n position: \"left\" | \"center\" | \"right\";\n element: ReactNode;\n}\n\nexport interface AppBarBurger {\n position: \"left\" | \"center\" | \"right\";\n type: \"burger\";\n}\n\nexport interface AppBarDark {\n position: \"left\" | \"center\" | \"right\";\n type: \"dark\";\n props?: DarkModeButtonProps;\n}\n\nexport interface AppBarSearch {\n position: \"left\" | \"center\" | \"right\";\n type: \"search\";\n props?: OmnibarButtonProps;\n}\n\nexport interface AppBarLang {\n position: \"left\" | \"center\" | \"right\";\n type: \"lang\";\n props?: LanguageButtonProps;\n}\n\nexport interface AppBarSpacer {\n position: \"left\" | \"center\" | \"right\";\n type: \"spacer\";\n}\n\nexport interface AppBarDivider {\n position: \"left\" | \"center\" | \"right\";\n type: \"divider\";\n}\n\nexport interface AppBarProps {\n flexProps?: FlexProps;\n items?: AppBarItem[];\n}\n\nconst AppBar = (props: AppBarProps) => {\n const { items = [] } = props;\n\n const renderItem = (item: AppBarItem, index: number) => {\n if (\"type\" in item) {\n if (item.type === \"burger\") {\n return <BurgerButton key={index} />;\n }\n if (item.type === \"dark\") {\n return <DarkModeButton key={index} {...item.props} />;\n }\n if (item.type === \"search\") {\n return <OmnibarButton key={index} {...item.props} />;\n }\n if (item.type === \"lang\") {\n return <LanguageButton key={index} {...item.props} />;\n }\n if (item.type === \"spacer\") {\n return <Flex key={index} w={16} />;\n }\n if (item.type === \"divider\") {\n return <Divider key={index} orientation=\"vertical\" />;\n }\n }\n if (\"element\" in item) {\n return item.element;\n }\n return null;\n };\n\n const leftItems = items.filter((item) => item.position === \"left\");\n const centerItems = items.filter((item) => item.position === \"center\");\n const rightItems = items.filter((item) => item.position === \"right\");\n\n return (\n <Flex\n h=\"100%\"\n align=\"center\"\n px=\"md\"\n justify=\"space-between\"\n {...props.flexProps}\n >\n <Flex flex={1}>\n {leftItems.map((item, index) => (\n <Flex key={index} ml={index === 0 ? 0 : \"md\"} align=\"center\">\n {renderItem(item, index)}\n </Flex>\n ))}\n </Flex>\n <Flex>\n {centerItems.map((item, index) => (\n <Flex key={index} mx=\"md\" align=\"center\">\n {renderItem(item, index)}\n </Flex>\n ))}\n </Flex>\n <Flex flex={1} align={\"center\"} justify={\"end\"}>\n {rightItems.map((item, index) => (\n <Flex key={index} ml={index === 0 ? 0 : \"md\"} align=\"center\">\n {renderItem(item, index)}\n </Flex>\n ))}\n </Flex>\n </Flex>\n );\n};\n\nexport default AppBar;\n","import { useEvents, useRouter } from \"@alepha/react\";\nimport {\n Flex,\n type FlexProps,\n type MantineBreakpoint,\n Text,\n} from \"@mantine/core\";\nimport {\n IconChevronDown,\n IconChevronRight,\n IconSquareRounded,\n} from \"@tabler/icons-react\";\nimport {\n type ComponentType,\n type ReactNode,\n useCallback,\n useState,\n} from \"react\";\nimport ActionButton, {\n type ActionProps,\n renderIcon,\n} from \"../buttons/ActionButton.tsx\";\nimport OmnibarButton from \"../buttons/OmnibarButton.tsx\";\n\nexport interface SidebarProps {\n menu?: SidebarNode[];\n top?: SidebarNode[];\n bottom?: SidebarNode[];\n onItemClick?: (item: SidebarMenuItem) => void;\n onSearchClick?: () => void;\n theme?: SidebarTheme;\n flexProps?: Partial<FlexProps>;\n collapsed?: boolean;\n gap?: MantineBreakpoint;\n hide?: {\n paths?: string[];\n };\n}\n\nexport const Sidebar = (props: SidebarProps) => {\n const router = useRouter();\n const { top = [], bottom = [], onItemClick } = props;\n\n const renderNode = (item: SidebarNode, key: number) => {\n if (\"type\" in item) {\n if (item.type === \"spacer\") {\n return <Flex key={key} h={16} />;\n }\n\n if (item.type === \"divider\") {\n return (\n <Flex\n key={key}\n h={1}\n bg={\"var(--alepha-border)\"}\n my={\"md\"}\n mx={\"sm\"}\n />\n );\n }\n\n if (item.type === \"search\") {\n return <OmnibarButton collapsed={props.collapsed} key={key} />;\n }\n\n if (item.type === \"section\") {\n if (props.collapsed) return;\n return (\n <Flex key={key} mt={\"md\"} mb={\"xs\"} align={\"center\"} gap={\"xs\"}>\n {renderIcon(item.icon)}\n <Text\n key={key}\n size={\"xs\"}\n c={\"dimmed\"}\n tt={\"uppercase\"}\n fw={\"bold\"}\n >\n {item.label}\n </Text>\n </Flex>\n );\n }\n }\n\n if (\"element\" in item) {\n return <Flex key={key}>{item.element}</Flex>;\n }\n\n if (props.collapsed) {\n return (\n <SidebarCollapsedItem\n key={key}\n item={item}\n level={0}\n onItemClick={onItemClick}\n theme={props.theme ?? {}}\n />\n );\n }\n\n return (\n <SidebarItem\n key={key}\n item={item}\n level={0}\n onItemClick={onItemClick}\n theme={props.theme ?? {}}\n />\n );\n };\n\n const padding = \"md\";\n const gap = props.gap;\n const menu =\n props.menu ??\n (router.concretePages.map((page) => ({\n label: page.label ?? page.name,\n description: page.description,\n icon: renderIcon(page.icon),\n href: router.path(page.name),\n })) as SidebarMenuItem[]);\n\n return (\n <Flex\n flex={1}\n py={padding}\n direction={\"column\"}\n className={\"overflow-auto\"}\n {...props.flexProps}\n >\n <Flex gap={gap} px={padding} direction={\"column\"}>\n {top.map((item, index) => renderNode(item, index))}\n {menu\n .filter((it) => it.position === \"top\")\n .map((item, index) => renderNode(item, index + top.length))}\n </Flex>\n <Flex\n gap={gap}\n px={padding}\n direction={\"column\"}\n flex={1}\n className={\"overflow-auto\"}\n >\n {menu\n .filter((it) => !it.position)\n .map((item, index) => renderNode(item, index))}\n </Flex>\n <Flex gap={gap} px={padding} direction={\"column\"}>\n {bottom.map((item, index) => renderNode(item, index))}\n {menu\n .filter((it) => it.position === \"bottom\")\n .map((item, index) => renderNode(item, index + bottom.length))}\n </Flex>\n </Flex>\n );\n};\n\n// ---------------------------------------------------------------------------------------------------------------------\n\nexport interface SidebarItemProps {\n item: SidebarMenuItem;\n level: number;\n onItemClick?: (item: SidebarMenuItem) => void;\n theme: SidebarTheme;\n}\n\nexport const SidebarItem = (props: SidebarItemProps) => {\n const { item, level } = props;\n const maxLevel = 2; // 0, 1, 2 = 3 levels total\n\n const router = useRouter();\n const isActive = useCallback((item: SidebarMenuItem): boolean => {\n if (!item.children) return false;\n for (const child of item.children) {\n if (child.href) {\n if (router.isActive(child.href)) {\n return true;\n }\n }\n if (isActive(child)) {\n return true;\n }\n }\n return false;\n }, []);\n\n const [isOpen, setIsOpen] = useState<boolean>(isActive(item));\n\n useEvents(\n {\n \"react:transition:end\": () => {\n // recalculate open state on transition end to ensure correct state after navigation\n if (isActive(item)) {\n setIsOpen(true);\n }\n },\n },\n [],\n );\n\n if (level > maxLevel) return null;\n\n const handleItemClick = (e: MouseEvent) => {\n if (!props.item.target) {\n e.preventDefault();\n }\n if (item.children && item.children.length > 0) {\n setIsOpen(!isOpen);\n } else {\n props.onItemClick?.(item);\n item.onClick?.();\n }\n };\n\n return (\n <Flex direction={\"column\"} ps={level === 0 ? 0 : 32} pos={\"relative\"}>\n <ActionButton\n w={\"100%\"}\n justify=\"space-between\"\n href={props.item.href}\n target={props.item.target}\n size={\n props.item.theme?.size ??\n props.theme.button?.size ??\n (level === 0 ? \"sm\" : \"xs\")\n }\n color={\"var(--alepha-text)\"}\n variant={\"subtle\"}\n variantActive={\"default\"}\n radius={props.item.theme?.radius ?? props.theme.button?.radius ?? \"md\"}\n onClick={handleItemClick}\n leftSection={\n <Flex w={\"100%\"} align=\"center\" gap={\"sm\"}>\n {renderIcon(item.icon)}\n <Flex direction={\"column\"}>\n <Flex>{item.label}</Flex>\n {item.description && (\n <Text size={\"xs\"} c={\"dimmed\"}>\n {item.description}\n </Text>\n )}\n </Flex>\n </Flex>\n }\n rightSection={\n item.children ? (\n <Flex>\n {isOpen ? (\n <IconChevronDown size={14} />\n ) : (\n <IconChevronRight size={14} />\n )}\n </Flex>\n ) : (\n props.item.rightSection\n )\n }\n {...props.item.actionProps}\n />\n\n {item.children && isOpen && (\n <Flex direction={\"column\"} data-parent-level={level}>\n <Flex\n style={{\n position: \"absolute\",\n width: 1,\n background:\n \"linear-gradient(to bottom, transparent, var(--alepha-border), transparent)\",\n top: 48,\n left: 20 + 32 * level,\n bottom: 16,\n }}\n />\n {item.children.map((child, index) => (\n <SidebarItem\n key={index}\n item={child}\n level={level + 1}\n onItemClick={props.onItemClick}\n theme={props.theme}\n />\n ))}\n </Flex>\n )}\n </Flex>\n );\n};\n\n// ---------------------------------------------------------------------------------------------------------------------\n\nexport interface SidebarItemProps {\n item: SidebarMenuItem;\n level: number;\n onItemClick?: (item: SidebarMenuItem) => void;\n theme: SidebarTheme;\n}\n\nconst SidebarCollapsedItem = (props: SidebarItemProps) => {\n const { item, level } = props;\n\n const router = useRouter();\n const isActive = useCallback((item: SidebarMenuItem): boolean => {\n if (!item.children) return false;\n for (const child of item.children) {\n if (child.href) {\n if (router.isActive(child.href)) {\n return true;\n }\n }\n if (isActive(child)) {\n return true;\n }\n }\n return false;\n }, []);\n\n const [isOpen, setIsOpen] = useState<boolean>(isActive(item));\n\n const handleItemClick = (e: MouseEvent) => {\n if (!props.item.target) {\n e.preventDefault();\n }\n if (item.children && item.children.length > 0) {\n setIsOpen(!isOpen);\n } else {\n props.onItemClick?.(item);\n item.onClick?.();\n }\n };\n\n return (\n <ActionButton\n size={\n props.item.theme?.size ??\n props.theme.button?.size ??\n (level === 0 ? \"sm\" : \"xs\")\n }\n color={\"var(--alepha-text)\"}\n variant={\"subtle\"}\n variantActive={\"default\"}\n radius={props.item.theme?.radius ?? props.theme.button?.radius ?? \"md\"}\n onClick={handleItemClick}\n icon={renderIcon(item.icon) ?? <IconSquareRounded />}\n href={props.item.href as any}\n target={props.item.target}\n menu={\n item.children\n ? ({\n position: \"right\",\n on: \"hover\",\n items: item.children.map((child) => ({\n label: child.label,\n href: child.href,\n icon: renderIcon(child.icon),\n children: child.children,\n })),\n } as any)\n : undefined\n }\n {...props.item.actionProps}\n />\n );\n};\n\n// ---------------------------------------------------------------------------------------------------------------------\n\nexport type SidebarNode =\n | SidebarMenuItem\n | SidebarSpacer\n | SidebarDivider\n | SidebarSearch\n | SidebarElement\n | SidebarSection;\n\nexport interface SidebarAbstractItem {\n position?: \"top\" | \"bottom\";\n}\n\nexport interface SidebarElement extends SidebarAbstractItem {\n element: ReactNode;\n}\n\nexport interface SidebarSpacer extends SidebarAbstractItem {\n type: \"spacer\";\n}\n\nexport interface SidebarDivider extends SidebarAbstractItem {\n type: \"divider\";\n}\n\nexport interface SidebarSearch extends SidebarAbstractItem {\n type: \"search\";\n}\n\nexport interface SidebarSection extends SidebarAbstractItem {\n type: \"section\";\n label: string;\n icon?: ReactNode | ComponentType;\n}\n\nexport interface SidebarMenuItem extends SidebarAbstractItem {\n label: string | ReactNode;\n description?: string;\n icon?: ReactNode | ComponentType;\n href?: string;\n target?: \"_blank\" | \"_self\" | \"_parent\" | \"_top\";\n activeStartsWith?: boolean; // Use startWith matching for active state\n onClick?: () => void;\n children?: SidebarMenuItem[];\n rightSection?: ReactNode;\n theme?: SidebarButtonTheme;\n actionProps?: ActionProps;\n}\n\nexport interface SidebarButtonTheme {\n radius?: MantineBreakpoint;\n size?: MantineBreakpoint;\n}\n\nexport interface SidebarTheme {\n button?: SidebarButtonTheme;\n search?: SidebarButtonTheme;\n}\n","import { NestedView, useEvents, useRouter, useStore } from \"@alepha/react\";\nimport {\n AppShell,\n type AppShellFooterProps,\n type AppShellHeaderProps,\n type AppShellMainProps,\n type AppShellNavbarProps,\n type AppShellProps,\n} from \"@mantine/core\";\nimport { type ReactNode, useState } from \"react\";\nimport { ui } from \"../../constants/ui.ts\";\nimport AppBar, { type AppBarProps } from \"./AppBar.tsx\";\nimport { Sidebar, type SidebarProps } from \"./Sidebar.tsx\";\n\nexport interface AdminShellProps {\n appShellProps?: Partial<AppShellProps>;\n appShellMainProps?: Partial<AppShellMainProps>;\n appShellHeaderProps?: Partial<AppShellHeaderProps>;\n appShellNavbarProps?: Partial<AppShellNavbarProps>;\n appShellFooterProps?: Partial<AppShellFooterProps>;\n sidebarProps?: Partial<SidebarProps>;\n appBarProps?: Partial<AppBarProps>;\n header?: ReactNode;\n footer?: ReactNode;\n children?: ReactNode;\n\n noSidebarWhen?: {\n /**\n * Paths where the sidebar should be hidden.\n */\n paths?: string[];\n };\n}\n\ndeclare module \"alepha\" {\n interface State {\n /**\n * Whether the sidebar is opened or closed.\n */\n \"alepha.ui.sidebar.opened\"?: boolean;\n\n /**\n * Whether the sidebar is collapsed (narrow) or expanded (wide).\n */\n \"alepha.ui.sidebar.collapsed\"?: boolean;\n }\n}\n\nconst AdminShell = (props: AdminShellProps) => {\n const router = useRouter();\n const [opened, setOpened] = useStore(\"alepha.ui.sidebar.opened\");\n const [collapsed] = useStore(\n \"alepha.ui.sidebar.collapsed\",\n props.sidebarProps?.collapsed,\n );\n\n const shouldShowSidebar = () => {\n if (props.noSidebarWhen?.paths) {\n for (const path of props.noSidebarWhen.paths) {\n if (\n router.isActive(path, {\n startWith: true,\n })\n ) {\n return false;\n }\n }\n }\n return true;\n };\n\n const [showSidebar, setShowSidebar] = useState(shouldShowSidebar());\n\n useEvents(\n {\n \"react:transition:end\": () => {\n setShowSidebar(shouldShowSidebar());\n },\n \"react:transition:begin\": () => {\n setOpened(false);\n },\n },\n [],\n );\n\n // Default AppBar items with burger button on the left\n const defaultAppBarItems = [\n { position: \"left\" as const, type: \"burger\" as const },\n ];\n\n const hasSidebar = showSidebar && props.sidebarProps !== undefined;\n const hasAppBar = hasSidebar || props.appBarProps || props.header;\n\n return (\n <AppShell\n padding=\"md\"\n header={hasAppBar ? { height: 60 } : undefined}\n navbar={\n hasSidebar\n ? {\n width: collapsed ? { base: 72 } : { base: 300 },\n breakpoint: \"sm\",\n collapsed: { mobile: !opened },\n }\n : undefined\n }\n footer={props.footer ? { height: 60 } : undefined}\n {...props.appShellProps}\n >\n <AppShell.Header bg={ui.colors.surface} {...props.appShellHeaderProps}>\n {props.header ?? (\n <AppBar items={defaultAppBarItems} {...props.appBarProps} />\n )}\n </AppShell.Header>\n\n {hasSidebar && (\n <AppShell.Navbar bg={ui.colors.surface} {...props.appShellNavbarProps}>\n <Sidebar collapsed={collapsed} {...(props.sidebarProps ?? {})} />\n </AppShell.Navbar>\n )}\n\n <AppShell.Main display={\"flex\"} flex={1} {...props.appShellMainProps}>\n {props.children ?? <NestedView />}\n </AppShell.Main>\n\n {props.footer && (\n <AppShell.Footer bg={ui.colors.surface} {...props.appShellFooterProps}>\n {props.footer}\n </AppShell.Footer>\n )}\n </AppShell>\n );\n};\n\nexport default AdminShell;\n","import { useInject } from \"@alepha/react\";\nimport { type FormModel, useForm } from \"@alepha/react/form\";\nimport {\n Flex,\n Pagination,\n Select,\n Table,\n type TableProps,\n type TableTrProps,\n} from \"@mantine/core\";\nimport { useDebouncedCallback } from \"@mantine/hooks\";\nimport {\n Alepha,\n type Async,\n type Page,\n type PageMetadata,\n type Static,\n type TObject,\n t,\n} from \"alepha\";\nimport { DateTimeProvider, type DurationLike } from \"alepha/datetime\";\nimport { type ReactNode, useEffect, useState } from \"react\";\nimport ActionButton from \"../buttons/ActionButton.tsx\";\nimport TypeForm, { type TypeFormProps } from \"../form/TypeForm.tsx\";\n\nexport interface DataTableColumnContext<Filters extends TObject> {\n index: number;\n form: FormModel<Filters>;\n alepha: Alepha;\n}\n\nexport interface DataTableColumn<T extends object, Filters extends TObject> {\n label: string;\n value: (item: T, ctx: DataTableColumnContext<Filters>) => ReactNode;\n fit?: boolean;\n}\n\nexport type MaybePage<T> = Omit<Page<T>, \"page\"> & {\n page?: Partial<PageMetadata>;\n};\n\nexport interface DataTableSubmitContext<T extends object> {\n items: T[];\n}\n\nexport interface DataTableProps<T extends object, Filters extends TObject> {\n /**\n * The items to display in the table. Can be a static page of items or a function that returns a promise resolving to a page of items.\n */\n items:\n | MaybePage<T>\n | ((\n filters: Static<Filters> & {\n page: number;\n size: number;\n sort?: string;\n },\n ctx: DataTableSubmitContext<T>,\n ) => Async<MaybePage<T>>);\n\n /**\n * The columns to display in the table. Each column is defined by a key and a DataTableColumn object.\n */\n columns: {\n [key: string]: DataTableColumn<T, Filters>;\n };\n\n defaultSize?: number;\n\n typeFormProps?: Partial<Omit<TypeFormProps<Filters>, \"form\">>;\n\n onFilterChange?: (\n key: string,\n value: unknown,\n form: FormModel<Filters>,\n ) => void;\n\n /**\n * Optional filters to apply to the data.\n */\n filters?: TObject;\n\n panel?: (item: T) => ReactNode;\n canPanel?: (item: T) => boolean;\n\n submitOnInit?: boolean;\n submitEvery?: DurationLike;\n\n withLineNumbers?: boolean;\n withCheckbox?: boolean;\n checkboxActions?: any[];\n\n actions?: any[];\n\n /**\n * Enable infinity scroll mode. When true, pagination controls are hidden and new items are loaded automatically when scrolling to the bottom.\n */\n infinityScroll?: boolean;\n\n // -------------------------------------------------------------------------------------------------------------------\n\n /**\n * Props to pass to the Mantine Table component.\n */\n tableProps?: TableProps;\n\n /**\n * Function to generate props for each table row based on the item.\n */\n tableTrProps?: (item: T) => TableTrProps;\n}\n\nconst DataTable = <T extends object, Filters extends TObject>(\n props: DataTableProps<T, Filters>,\n) => {\n const [items, setItems] = useState<MaybePage<T>>(\n typeof props.items === \"function\"\n ? {\n content: [],\n }\n : props.items,\n );\n\n const defaultSize = props.infinityScroll ? 100 : props.defaultSize || 10;\n const [page, setPage] = useState(1);\n const [size, setSize] = useState(String(defaultSize));\n const [currentPage, setCurrentPage] = useState(0);\n const alepha = useInject(Alepha);\n\n const form = useForm(\n {\n schema: t.object({\n ...(props.filters ? props.filters.properties : {}),\n page: t.number({ default: 0 }),\n size: t.number({ default: defaultSize }),\n sort: t.optional(t.string()),\n }),\n handler: async (values, args) => {\n if (typeof props.items === \"function\") {\n const response = await props.items(\n values as Static<Filters> & {\n page: number;\n size: number;\n sort?: string;\n },\n {\n items: items.content,\n },\n );\n\n if (props.infinityScroll && values.page > 0) {\n // Append new items to existing ones for infinity scroll\n setItems((prev) => ({\n ...response,\n content: [...prev.content, ...response.content],\n }));\n } else {\n setItems(response);\n }\n\n setCurrentPage(values.page);\n }\n },\n onReset: async () => {\n setPage(1);\n setSize(\"10\");\n await form.submit();\n },\n onChange: async (key, value) => {\n if (key === \"page\") {\n setPage(value + 1);\n await form.submit();\n return;\n }\n\n if (key === \"size\") {\n setSize(String(value));\n form.input.page.set(0);\n return;\n }\n\n props.onFilterChange?.(key, value, form as any);\n },\n },\n [items],\n );\n\n const submitDebounce = useDebouncedCallback(() => form.submit(), {\n delay: 800,\n });\n\n const dt = useInject(DateTimeProvider);\n\n useEffect(() => {\n if (props.submitOnInit) {\n form.submit();\n }\n if (props.submitEvery) {\n const it = dt.createInterval(() => {\n form.submit();\n }, props.submitEvery);\n return () => dt.clearInterval(it);\n }\n }, []);\n\n useEffect(() => {\n if (typeof props.items !== \"function\") {\n setItems(props.items);\n }\n }, [props.items]);\n\n // Infinity scroll detection\n useEffect(() => {\n if (!props.infinityScroll || typeof props.items !== \"function\") return;\n\n const handleScroll = () => {\n if (form.submitting) return;\n\n const scrollTop = window.scrollY;\n const windowHeight = window.innerHeight;\n const docHeight = document.documentElement.scrollHeight;\n\n const isNearBottom = scrollTop + windowHeight >= docHeight - 300;\n\n if (isNearBottom) {\n const totalPages = items.page?.totalPages ?? 1;\n\n if (currentPage + 1 < totalPages) {\n form.input.page.set(currentPage + 1);\n }\n }\n };\n\n window.addEventListener(\"scroll\", handleScroll);\n return () => window.removeEventListener(\"scroll\", handleScroll);\n }, [\n props.infinityScroll,\n form.submitting,\n items.page?.totalPages,\n currentPage,\n form,\n ]);\n\n const head = Object.entries(props.columns).map(([key, col]) => (\n <Table.Th\n key={key}\n style={{\n ...(col.fit\n ? {\n width: \"1%\",\n whiteSpace: \"nowrap\",\n }\n : {}),\n }}\n >\n <ActionButton justify={\"space-between\"} radius={0} fullWidth size={\"xs\"}>\n {col.label}\n </ActionButton>\n </Table.Th>\n ));\n\n const rows = items.content.map((item, index) => {\n const trProps = props.tableTrProps\n ? props.tableTrProps(item as T)\n : ({} as TableTrProps);\n return (\n <Table.Tr key={JSON.stringify(item)} {...trProps}>\n {Object.entries(props.columns).map(([key, col]) => (\n <Table.Td key={key}>\n {col.value(item as T, {\n index,\n form: form as unknown as FormModel<Filters>,\n alepha,\n })}\n </Table.Td>\n ))}\n </Table.Tr>\n );\n });\n\n const schema = t.omit(form.options.schema, [\"page\", \"size\", \"sort\"]);\n\n return (\n <Flex direction={\"column\"} gap={\"sm\"} flex={1}>\n {props.filters ? (\n <TypeForm\n {...props.typeFormProps}\n form={form as unknown as FormModel<Filters>}\n schema={schema}\n />\n ) : null}\n\n <Flex className={\"overflow-auto\"}>\n <Table\n striped\n withRowBorders\n withColumnBorders\n withTableBorder\n stripedColor={\"\"}\n {...props.tableProps}\n >\n <Table.Thead>\n <Table.Tr>{head}</Table.Tr>\n </Table.Thead>\n <Table.Tbody>{rows}</Table.Tbody>\n </Table>\n </Flex>\n\n {!props.infinityScroll && (\n <Flex justify={\"space-between\"} align={\"center\"}>\n <Pagination\n withEdges\n total={items.page?.totalPages ?? 1}\n value={page}\n onChange={(value) => {\n form.input.page.set(value - 1);\n }}\n />\n <Flex>\n <Select\n value={size}\n onChange={(value) => {\n form.input.size.set(Number(value));\n }}\n data={[\n { value: \"5\", label: \"5\" },\n { value: \"10\", label: \"10\" },\n { value: \"25\", label: \"25\" },\n { value: \"50\", label: \"50\" },\n { value: \"100\", label: \"100\" },\n ]}\n />\n </Flex>\n </Flex>\n )}\n </Flex>\n );\n};\n\nexport default DataTable;\n","import { useInject } from \"@alepha/react\";\nimport { DialogService } from \"../services/DialogService.tsx\";\n\n/**\n * Use this hook to access the Dialog Service for showing various dialog types.\n *\n * @example\n * ```tsx\n * const dialog = useDialog();\n * await dialog.alert({ title: \"Alert\", message: \"This is an alert message\" });\n * const confirmed = await dialog.confirm({ title: \"Confirm\", message: \"Are you sure?\" });\n * const input = await dialog.prompt({ title: \"Input\", message: \"Enter your name:\" });\n * ```\n */\nexport const useDialog = (): DialogService => {\n return useInject(DialogService);\n};\n","import { AlephaReactForm } from \"@alepha/react/form\";\nimport { AlephaReactHead } from \"@alepha/react/head\";\nimport { AlephaReactI18n } from \"@alepha/react/i18n\";\nimport { $module } from \"alepha\";\nimport type { ReactNode } from \"react\";\nimport type { ControlProps } from \"./components/form/Control.tsx\";\nimport { RootRouter } from \"./RootRouter.ts\";\nimport { DialogService } from \"./services/DialogService.tsx\";\nimport { ToastService } from \"./services/ToastService.tsx\";\n\n// ---------------------------------------------------------------------------------------------------------------------\n\nexport { Flex, Text } from \"@mantine/core\";\nexport type {\n ActionClickButtonProps,\n ActionCommonProps,\n ActionMenuConfig,\n ActionMenuItem,\n ActionNavigationButtonProps,\n ActionProps,\n ActionSubmitButtonProps,\n} from \"./components/buttons/ActionButton.tsx\";\nexport { default as ActionButton } from \"./components/buttons/ActionButton.tsx\";\nexport { default as BurgerButton } from \"./components/buttons/BurgerButton.tsx\";\nexport type { ClipboardButtonProps } from \"./components/buttons/ClipboardButton.tsx\";\nexport { default as ClipboardButton } from \"./components/buttons/ClipboardButton.tsx\";\nexport { default as DarkModeButton } from \"./components/buttons/DarkModeButton.tsx\";\nexport { default as LanguageButton } from \"./components/buttons/LanguageButton.tsx\";\nexport { default as OmnibarButton } from \"./components/buttons/OmnibarButton.tsx\";\nexport { default as JsonViewer } from \"./components/data/JsonViewer.tsx\";\nexport { default as AlertDialog } from \"./components/dialogs/AlertDialog.tsx\";\nexport { default as ConfirmDialog } from \"./components/dialogs/ConfirmDialog.tsx\";\nexport { default as PromptDialog } from \"./components/dialogs/PromptDialog.tsx\";\nexport { default as Control } from \"./components/form/Control.tsx\";\nexport { default as ControlDate } from \"./components/form/ControlDate.tsx\";\nexport { default as ControlQueryBuilder } from \"./components/form/ControlQueryBuilder.tsx\";\nexport { default as ControlSelect } from \"./components/form/ControlSelect.tsx\";\nexport { default as TypeForm } from \"./components/form/TypeForm.tsx\";\nexport {\n type AdminShellProps,\n default as AdminShell,\n} from \"./components/layout/AdminShell.tsx\";\nexport { default as AlephaMantineProvider } from \"./components/layout/AlephaMantineProvider.tsx\";\nexport type {\n AppBarBurger,\n AppBarDark,\n AppBarDivider,\n AppBarElement,\n AppBarItem,\n AppBarLang,\n AppBarProps,\n AppBarSearch,\n AppBarSpacer,\n} from \"./components/layout/AppBar.tsx\";\nexport { default as AppBar } from \"./components/layout/AppBar.tsx\";\nexport { default as Omnibar } from \"./components/layout/Omnibar.tsx\";\nexport type {\n SidebarAbstractItem,\n SidebarButtonTheme,\n SidebarDivider,\n SidebarElement,\n SidebarItemProps,\n SidebarMenuItem,\n SidebarNode,\n SidebarProps,\n SidebarSearch,\n SidebarSection,\n SidebarSpacer,\n SidebarTheme,\n} from \"./components/layout/Sidebar.tsx\";\nexport { Sidebar } from \"./components/layout/Sidebar.tsx\";\nexport type {\n DataTableColumn,\n DataTableProps,\n} from \"./components/table/DataTable.tsx\";\nexport { default as DataTable } from \"./components/table/DataTable.tsx\";\nexport * from \"./constants/ui.ts\";\nexport { useDialog } from \"./hooks/useDialog.ts\";\nexport { useToast } from \"./hooks/useToast.ts\";\nexport * from \"./RootRouter.ts\";\nexport type {\n AlertDialogOptions,\n AlertDialogProps,\n BaseDialogOptions,\n ConfirmDialogOptions,\n ConfirmDialogProps,\n PromptDialogOptions,\n PromptDialogProps,\n} from \"./services/DialogService.tsx\";\nexport { DialogService } from \"./services/DialogService.tsx\";\nexport { ToastService } from \"./services/ToastService.tsx\";\nexport * from \"./utils/extractSchemaFields.ts\";\nexport * from \"./utils/icons.tsx\";\nexport * from \"./utils/string.ts\";\n\n// ---------------------------------------------------------------------------------------------------------------------\n\ndeclare module \"typebox\" {\n interface TSchemaOptions {\n $control?: Omit<ControlProps, \"input\">;\n }\n}\n\ndeclare module \"@alepha/react\" {\n interface PagePrimitiveOptions {\n /**\n * Human-readable title for the page.\n * - for Sidebar navigation\n * - for Omnibar navigation\n * (soon)\n * - for Breadcrumbs\n * - for document title (with AlephaReactHead)\n */\n label?: string;\n\n /**\n * Optional description of the page.\n */\n description?: string;\n\n /**\n * Optional icon for the page.\n */\n icon?: ReactNode;\n }\n}\n\n// ---------------------------------------------------------------------------------------------------------------------\n\n/**\n * Mantine\n *\n * @module alepha.ui\n */\nexport const AlephaUI = $module({\n name: \"alepha.ui\",\n services: [DialogService, ToastService, RootRouter],\n register: (alepha) => {\n alepha.with(AlephaReactI18n);\n alepha.with(AlephaReactHead);\n alepha.with(AlephaReactForm);\n alepha.with(DialogService);\n alepha.with(ToastService);\n },\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAaA,IAAa,eAAb,MAA0B;CACxB,AAAmB,MAAM;CAEzB,AAAgB,UAA+B,EAC7C,SAAS;EACP,QAAQ;EACR,YAAY;EACZ,iBAAiB;EACjB,WAAW;EACX,UAAU;EACX,EACF;CAED,AAAO,KAAK,SAA2B;AACrC,gBAAc,KAAK;GACjB,GAAG,KAAK,QAAQ;GAChB,GAAG;GACJ,CAAC;;CAGJ,AAAO,KAAK,SAA6C;AACvD,MAAI,OAAO,YAAY,SACrB,WAAU,EAAE,SAAS,SAAS;AAEhC,OAAK,KAAK;GACR,OAAO;GACP,MAAM,oBAAC,kBAAe,MAAM,KAAM;GAClC,OAAO;GACP,SAAS;GACT,GAAG;GACJ,CAAC;;CAGJ,AAAO,QAAQ,SAA6C;AAC1D,MAAI,OAAO,YAAY,SACrB,WAAU,EAAE,SAAS,SAAS;AAEhC,OAAK,KAAK;GACR,OAAO;GACP,MAAM,oBAAC,aAAU,MAAM,KAAM;GAC7B,OAAO;GACP,SAAS;GACT,GAAG;GACJ,CAAC;;CAGJ,AAAO,QAAQ,SAA6C;AAC1D,MAAI,OAAO,YAAY,SACrB,WAAU,EAAE,SAAS,SAAS;AAEhC,OAAK,KAAK;GACR,OAAO;GACP,MAAM,oBAAC,qBAAkB,MAAM,KAAM;GACrC,OAAO;GACP,SAAS;GACT,GAAG;GACJ,CAAC;;CAGJ,AAAO,OAAO,SAA6C;AACzD,MAAI,OAAO,YAAY,SACrB,W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AK,aAAa;;CAE5B,CAAC"}
1
+ {"version":3,"file":"index.js","names":["auroraTheme: AlephaTheme","crystalTheme: AlephaTheme","defaultTheme: AlephaTheme","emberTheme: AlephaTheme","midnightTheme: AlephaTheme","remoraidTheme: AlephaTheme","slateTheme: AlephaTheme","t","menuItemProps: MenuItemProps & ButtonHTMLAttributes<unknown>","icon","Flex","defaultTooltipProps: Partial<TooltipProps>","Omnibar","AlephaMantineProvider","Text","Text","Text","Text","AlertDialog","ConfirmDialog","PromptDialog","Flex","JsonViewer","ActionButton","Flex","ActionButton","ActionButton","ActionButton","Flex","Text","ActionButton","inputProps: InputProps","fields: SchemaField[]","field: SchemaField","OPERATOR_INFO: Record<\n string,\n { symbol: string; label: string; example: string }\n>","value","Text","ActionButton","Flex","itemsEnum: string[] | undefined","items: any","segmentedControlProps: Partial<SegmentedControlProps>","Flex","data","ControlQueryBuilder","Flex","ControlNumber","ControlSelect","ControlDate","schema: any","schema","Control","Flex","ActionButton","BurgerButton","DarkModeButton","OmnibarButton","LanguageButton","Flex","Flex","OmnibarButton","Text","item","ActionButton","AppBar","ActionButton","Flex","TypeForm"],"sources":["../../src/core/themes/aurora.ts","../../src/core/themes/crystal.ts","../../src/core/themes/default.ts","../../src/core/themes/ember.ts","../../src/core/themes/midnight.ts","../../src/core/themes/remoraid.ts","../../src/core/themes/slate.ts","../../src/core/providers/ThemeProvider.ts","../../src/core/hooks/useTheme.ts","../../src/core/services/ToastService.tsx","../../src/core/hooks/useToast.ts","../../src/core/constants/ui.ts","../../src/core/components/buttons/ActionButton.tsx","../../src/core/components/layout/Omnibar.tsx","../../src/core/components/layout/AlephaMantineProvider.tsx","../../src/core/RootRouter.ts","../../src/core/components/data/JsonViewer.tsx","../../src/core/components/dialogs/AlertDialog.tsx","../../src/core/components/dialogs/ConfirmDialog.tsx","../../src/core/components/dialogs/PromptDialog.tsx","../../src/core/services/DialogService.tsx","../../src/core/components/buttons/BurgerButton.tsx","../../src/core/components/buttons/ClipboardButton.tsx","../../src/core/components/buttons/DarkModeButton.tsx","../../src/core/components/buttons/LanguageButton.tsx","../../src/core/components/buttons/OmnibarButton.tsx","../../src/core/components/buttons/ThemeButton.tsx","../../src/core/utils/icons.tsx","../../src/core/utils/string.ts","../../src/core/utils/parseInput.ts","../../src/core/components/form/ControlDate.tsx","../../src/core/components/form/ControlNumber.tsx","../../src/core/utils/extractSchemaFields.ts","../../src/core/components/form/ControlQueryBuilder.tsx","../../src/core/components/form/ControlSelect.tsx","../../src/core/components/form/Control.tsx","../../src/core/components/form/TypeForm.tsx","../../src/core/components/layout/AppBar.tsx","../../src/core/components/layout/Sidebar.tsx","../../src/core/components/layout/AdminShell.tsx","../../src/core/components/table/DataTable.tsx","../../src/core/hooks/useDialog.ts","../../src/core/index.ts"],"sourcesContent":["import type { AlephaTheme } from \"../providers/ThemeProvider.ts\";\n\nexport const auroraTheme: AlephaTheme = {\n id: \"aurora\",\n label: \"Aurora\",\n description: \"Vibrant, playful with gradients and hover effects\",\n primaryColor: \"violet\",\n primaryShade: { light: 5, dark: 4 },\n fontFamily:\n '\"Nunito\", \"Poppins\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif',\n fontFamilyMonospace:\n '\"Fira Code\", \"JetBrains Mono\", ui-monospace, Consolas, monospace',\n headings: {\n fontFamily:\n '\"Nunito\", \"Poppins\", -apple-system, BlinkMacSystemFont, sans-serif',\n fontWeight: \"700\",\n textWrap: \"wrap\",\n sizes: {\n h1: { fontSize: \"2.25rem\", lineHeight: \"1.3\" },\n h2: { fontSize: \"1.75rem\", lineHeight: \"1.35\" },\n h3: { fontSize: \"1.375rem\", lineHeight: \"1.4\" },\n h4: { fontSize: \"1.125rem\", lineHeight: \"1.45\" },\n h5: { fontSize: \"1rem\", lineHeight: \"1.5\" },\n h6: { fontSize: \"0.875rem\", lineHeight: \"1.5\" },\n },\n },\n fontSizes: {\n xs: \"0.8rem\",\n sm: \"0.9rem\",\n md: \"1rem\",\n lg: \"1.125rem\",\n xl: \"1.3rem\",\n },\n lineHeights: {\n xs: \"1.5\",\n sm: \"1.55\",\n md: \"1.6\",\n lg: \"1.65\",\n xl: \"1.7\",\n },\n radius: {\n xs: \"6px\",\n sm: \"8px\",\n md: \"12px\",\n lg: \"16px\",\n xl: \"24px\",\n },\n defaultRadius: \"md\",\n shadows: {\n xs: \"0 2px 4px rgba(139, 92, 246, 0.08)\",\n sm: \"0 4px 8px rgba(139, 92, 246, 0.1)\",\n md: \"0 8px 16px rgba(139, 92, 246, 0.12)\",\n lg: \"0 16px 32px rgba(139, 92, 246, 0.15)\",\n xl: \"0 24px 48px rgba(139, 92, 246, 0.18)\",\n },\n defaultGradient: { from: \"violet\", to: \"pink\", deg: 135 },\n colors: {\n dark: [\n \"#d4d0dc\",\n \"#a8a3b3\",\n \"#7c7689\",\n \"#5c5568\",\n \"#454050\",\n \"#302c38\",\n \"#252129\",\n \"#1e1b24\",\n \"#16141a\",\n \"#0d0c10\",\n ],\n gray: [\n \"#faf9fb\",\n \"#f3f1f5\",\n \"#e8e5ed\",\n \"#d4d0dc\",\n \"#a8a3b3\",\n \"#7c7689\",\n \"#5c5568\",\n \"#454050\",\n \"#302c38\",\n \"#1e1b24\",\n ],\n violet: [\n \"#f5f3ff\",\n \"#ede9fe\",\n \"#ddd6fe\",\n \"#c4b5fd\",\n \"#a78bfa\",\n \"#8b5cf6\",\n \"#7c3aed\",\n \"#6d28d9\",\n \"#5b21b6\",\n \"#4c1d95\",\n ],\n pink: [\n \"#fdf2f8\",\n \"#fce7f3\",\n \"#fbcfe8\",\n \"#f9a8d4\",\n \"#f472b6\",\n \"#ec4899\",\n \"#db2777\",\n \"#be185d\",\n \"#9d174d\",\n \"#831843\",\n ],\n },\n};\n","import type { AlephaTheme } from \"../providers/ThemeProvider.ts\";\n\nexport const crystalTheme: AlephaTheme = {\n id: \"crystal\",\n label: \"Crystal\",\n description: \"Glass-morphism with backdrop blur effects\",\n primaryColor: \"blue\",\n primaryShade: { light: 5, dark: 4 },\n fontFamily:\n '\"SF Pro Display\", \"Helvetica Neue\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif',\n fontFamilyMonospace:\n '\"SF Mono\", \"Fira Code\", ui-monospace, Menlo, Consolas, monospace',\n headings: {\n fontFamily:\n '\"SF Pro Display\", \"Helvetica Neue\", -apple-system, BlinkMacSystemFont, sans-serif',\n fontWeight: \"600\",\n textWrap: \"wrap\",\n sizes: {\n h1: { fontSize: \"2rem\", lineHeight: \"1.25\" },\n h2: { fontSize: \"1.5rem\", lineHeight: \"1.3\" },\n h3: { fontSize: \"1.25rem\", lineHeight: \"1.35\" },\n h4: { fontSize: \"1.0625rem\", lineHeight: \"1.4\" },\n h5: { fontSize: \"0.9375rem\", lineHeight: \"1.45\" },\n h6: { fontSize: \"0.8125rem\", lineHeight: \"1.5\" },\n },\n },\n fontSizes: {\n xs: \"0.75rem\",\n sm: \"0.8125rem\",\n md: \"0.9375rem\",\n lg: \"1.0625rem\",\n xl: \"1.25rem\",\n },\n lineHeights: {\n xs: \"1.45\",\n sm: \"1.5\",\n md: \"1.55\",\n lg: \"1.6\",\n xl: \"1.65\",\n },\n radius: {\n xs: \"4px\",\n sm: \"8px\",\n md: \"10px\",\n lg: \"14px\",\n xl: \"20px\",\n },\n defaultRadius: \"md\",\n shadows: {\n xs: \"0 2px 8px rgba(59, 130, 246, 0.04)\",\n sm: \"0 4px 12px rgba(59, 130, 246, 0.06)\",\n md: \"0 8px 20px rgba(59, 130, 246, 0.08)\",\n lg: \"0 16px 32px rgba(59, 130, 246, 0.1)\",\n xl: \"0 24px 48px rgba(59, 130, 246, 0.12)\",\n },\n defaultGradient: { from: \"cyan\", to: \"blue\", deg: 135 },\n colors: {\n dark: [\n \"#cbd5e1\",\n \"#94a3b8\",\n \"#64748b\",\n \"#475569\",\n \"#334155\",\n \"#1e293b\",\n \"#0f172a\",\n \"#0c1322\",\n \"#080e1a\",\n \"#040711\",\n ],\n gray: [\n \"#f8fafc\",\n \"#f1f5f9\",\n \"#e2e8f0\",\n \"#cbd5e1\",\n \"#94a3b8\",\n \"#64748b\",\n \"#475569\",\n \"#334155\",\n \"#1e293b\",\n \"#0f172a\",\n ],\n blue: [\n \"#f0f9ff\",\n \"#e0f2fe\",\n \"#bae6fd\",\n \"#7dd3fc\",\n \"#38bdf8\",\n \"#0ea5e9\",\n \"#0284c7\",\n \"#0369a1\",\n \"#075985\",\n \"#0c4a6e\",\n ],\n cyan: [\n \"#ecfeff\",\n \"#cffafe\",\n \"#a5f3fc\",\n \"#67e8f9\",\n \"#22d3ee\",\n \"#06b6d4\",\n \"#0891b2\",\n \"#0e7490\",\n \"#155e75\",\n \"#164e63\",\n ],\n },\n};\n","import type { AlephaTheme } from \"../providers/ThemeProvider.ts\";\n\nexport const defaultTheme: AlephaTheme = {\n id: \"default\",\n label: \"Default\",\n description: \"Mantine defaults with no customization\",\n};\n","import type { AlephaTheme } from \"../providers/ThemeProvider.ts\";\n\nexport const emberTheme: AlephaTheme = {\n id: \"ember\",\n label: \"Ember\",\n description: \"Warm, cozy with stone tints\",\n primaryColor: \"orange\",\n primaryShade: { light: 5, dark: 4 },\n fontFamily:\n '\"Source Sans Pro\", \"Open Sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", sans-serif',\n fontFamilyMonospace:\n '\"Source Code Pro\", \"Fira Code\", ui-monospace, Menlo, Consolas, monospace',\n headings: {\n fontFamily:\n '\"Source Sans Pro\", \"Open Sans\", -apple-system, BlinkMacSystemFont, sans-serif',\n fontWeight: \"600\",\n textWrap: \"wrap\",\n sizes: {\n h1: { fontSize: \"2rem\", lineHeight: \"1.3\" },\n h2: { fontSize: \"1.5rem\", lineHeight: \"1.35\" },\n h3: { fontSize: \"1.25rem\", lineHeight: \"1.4\" },\n h4: { fontSize: \"1.125rem\", lineHeight: \"1.45\" },\n h5: { fontSize: \"1rem\", lineHeight: \"1.5\" },\n h6: { fontSize: \"0.875rem\", lineHeight: \"1.5\" },\n },\n },\n fontSizes: {\n xs: \"0.75rem\",\n sm: \"0.875rem\",\n md: \"1rem\",\n lg: \"1.125rem\",\n xl: \"1.25rem\",\n },\n lineHeights: {\n xs: \"1.5\",\n sm: \"1.55\",\n md: \"1.65\",\n lg: \"1.7\",\n xl: \"1.75\",\n },\n radius: {\n xs: \"4px\",\n sm: \"6px\",\n md: \"8px\",\n lg: \"12px\",\n xl: \"16px\",\n },\n defaultRadius: \"md\",\n shadows: {\n xs: \"0 1px 3px rgba(194, 65, 12, 0.06)\",\n sm: \"0 2px 6px rgba(194, 65, 12, 0.08)\",\n md: \"0 4px 12px rgba(194, 65, 12, 0.1)\",\n lg: \"0 8px 24px rgba(194, 65, 12, 0.12)\",\n xl: \"0 16px 40px rgba(194, 65, 12, 0.14)\",\n },\n defaultGradient: { from: \"orange\", to: \"yellow\", deg: 180 },\n colors: {\n dark: [\n \"#d6d3d1\",\n \"#a8a29e\",\n \"#78716c\",\n \"#57534e\",\n \"#44403c\",\n \"#292524\",\n \"#1c1917\",\n \"#171412\",\n \"#120f0d\",\n \"#0c0a09\",\n ],\n gray: [\n \"#fafaf9\",\n \"#f5f5f4\",\n \"#e7e5e4\",\n \"#d6d3d1\",\n \"#a8a29e\",\n \"#78716c\",\n \"#57534e\",\n \"#44403c\",\n \"#292524\",\n \"#1c1917\",\n ],\n orange: [\n \"#fff7ed\",\n \"#ffedd5\",\n \"#fed7aa\",\n \"#fdba74\",\n \"#fb923c\",\n \"#f97316\",\n \"#ea580c\",\n \"#c2410c\",\n \"#9a3412\",\n \"#7c2d12\",\n ],\n yellow: [\n \"#fffbeb\",\n \"#fef3c7\",\n \"#fde68a\",\n \"#fcd34d\",\n \"#fbbf24\",\n \"#f59e0b\",\n \"#d97706\",\n \"#b45309\",\n \"#92400e\",\n \"#78350f\",\n ],\n },\n};\n","import type { AlephaTheme } from \"../providers/ThemeProvider.ts\";\n\nexport const midnightTheme: AlephaTheme = {\n id: \"midnight\",\n label: \"Midnight\",\n description: \"Clean, developer-focused design\",\n primaryColor: \"gray\",\n primaryShade: { light: 7, dark: 8 },\n fontFamily:\n '-apple-system, BlinkMacSystemFont, \"Segoe UI\", \"Noto Sans\", Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\"',\n fontFamilyMonospace:\n 'ui-monospace, SFMono-Regular, \"SF Mono\", Menlo, Consolas, \"Liberation Mono\", monospace',\n headings: {\n fontFamily:\n '-apple-system, BlinkMacSystemFont, \"Segoe UI\", \"Noto Sans\", Helvetica, Arial, sans-serif',\n fontWeight: \"600\",\n textWrap: \"wrap\",\n sizes: {\n h1: { fontSize: \"2rem\", lineHeight: \"1.25\" },\n h2: { fontSize: \"1.5rem\", lineHeight: \"1.3\" },\n h3: { fontSize: \"1.25rem\", lineHeight: \"1.4\" },\n h4: { fontSize: \"1rem\", lineHeight: \"1.5\" },\n h5: { fontSize: \"0.875rem\", lineHeight: \"1.5\" },\n h6: { fontSize: \"0.75rem\", lineHeight: \"1.5\" },\n },\n },\n fontSizes: {\n xs: \"0.75rem\",\n sm: \"0.875rem\",\n md: \"0.875rem\",\n lg: \"1rem\",\n xl: \"1.25rem\",\n },\n radius: {\n xs: \"3px\",\n sm: \"6px\",\n md: \"6px\",\n lg: \"8px\",\n xl: \"12px\",\n },\n defaultRadius: \"sm\",\n colors: {\n dark: [\n \"#d0d7de\",\n \"#8b949e\",\n \"#6e7681\",\n \"#484f58\",\n \"#30363d\",\n \"#21262d\",\n \"#161b22\",\n \"#151b23\",\n \"#0d1117\",\n \"#010409\",\n ],\n gray: [\n \"#f6f8fa\",\n \"#eaeef2\",\n \"#d0d7de\",\n \"#afb8c1\",\n \"#8c959f\",\n \"#6e7781\",\n \"#57606a\",\n \"#424a53\",\n \"#32383f\",\n \"#24292f\",\n ],\n blue: [\n \"#ddf4ff\",\n \"#b6e3ff\",\n \"#80ccff\",\n \"#54aeff\",\n \"#218bff\",\n \"#0969da\",\n \"#0550ae\",\n \"#033d8b\",\n \"#0a3069\",\n \"#002155\",\n ],\n green: [\n \"#dafbe1\",\n \"#aceebb\",\n \"#6fdd8b\",\n \"#4ac26b\",\n \"#2da44e\",\n \"#1a7f37\",\n \"#116329\",\n \"#044f1e\",\n \"#003d16\",\n \"#002d11\",\n ],\n red: [\n \"#ffebe9\",\n \"#ffcecb\",\n \"#ffaba8\",\n \"#ff8182\",\n \"#fa4549\",\n \"#cf222e\",\n \"#a40e26\",\n \"#82071e\",\n \"#660018\",\n \"#4c0014\",\n ],\n },\n};\n","import type { AlephaTheme } from \"../providers/ThemeProvider.ts\";\n\nexport const remoraidTheme: AlephaTheme = {\n id: \"remoraid\",\n label: \"Remoraid\",\n description: \"Soft, nature-inspired with green tones\",\n colors: {\n dark: [\n \"#fafcff\",\n \"#cad5e8\",\n \"#8697b5\",\n \"#4c5d7d\",\n \"#222833\",\n \"#222938\",\n \"#0b0f14\",\n \"#0b0f14\",\n \"#030405\",\n \"#000000\",\n ],\n gray: [\n \"#e3e7f1\",\n \"#d8ddeb\",\n \"#ced4e5\",\n \"#c3cadf\",\n \"#b8c1d9\",\n \"#b8c1d9\",\n \"#7b8cb8\",\n \"#4b5c8b\",\n \"#2a334d\",\n \"#090b10\",\n ],\n blue: [\n \"#ddf4ff\",\n \"#b6e3ff\",\n \"#80ccff\",\n \"#54aeff\",\n \"#218bff\",\n \"#0969da\",\n \"#0550ae\",\n \"#033d8b\",\n \"#0a3069\",\n \"#002155\",\n ],\n green: [\n \"#dafbe1\",\n \"#aceebb\",\n \"#6fdd8b\",\n \"#4ac26b\",\n \"#2da44e\",\n \"#1a7f37\",\n \"#116329\",\n \"#044f1e\",\n \"#003d16\",\n \"#002d11\",\n ],\n yellow: [\n \"#fff8c5\",\n \"#fae17d\",\n \"#eac54f\",\n \"#d4a72c\",\n \"#bf8700\",\n \"#9a6700\",\n \"#7d4e00\",\n \"#633c01\",\n \"#4d2d00\",\n \"#3b2300\",\n ],\n orange: [\n \"#fff1e5\",\n \"#ffd8b5\",\n \"#ffb77c\",\n \"#fb8f44\",\n \"#e16f24\",\n \"#bc4c00\",\n \"#953800\",\n \"#762c00\",\n \"#5c2200\",\n \"#471700\",\n ],\n red: [\n \"#fff5f5\",\n \"#ffe3e3\",\n \"#ffc9c9\",\n \"#ffa8a8\",\n \"#ff8787\",\n \"#ff6b6b\",\n \"#fa5252\",\n \"#f03e3e\",\n \"#e03131\",\n \"#c92a2a\",\n ],\n pink: [\n \"#fff0f6\",\n \"#ffdeeb\",\n \"#fcc2d7\",\n \"#faa2c1\",\n \"#f783ac\",\n \"#f06595\",\n \"#e64980\",\n \"#d6336c\",\n \"#c2255c\",\n \"#a61e4d\",\n ],\n grape: [\n \"#f8f0fc\",\n \"#f3d9fa\",\n \"#eebefa\",\n \"#e599f7\",\n \"#da77f2\",\n \"#cc5de8\",\n \"#be4bdb\",\n \"#ae3ec9\",\n \"#9c36b5\",\n \"#862e9c\",\n ],\n violet: [\n \"#f3f0ff\",\n \"#e5dbff\",\n \"#d0bfff\",\n \"#b197fc\",\n \"#9775fa\",\n \"#845ef7\",\n \"#7950f2\",\n \"#7048e8\",\n \"#6741d9\",\n \"#5f3dc4\",\n ],\n indigo: [\n \"#edf2ff\",\n \"#dbe4ff\",\n \"#bac8ff\",\n \"#91a7ff\",\n \"#748ffc\",\n \"#5c7cfa\",\n \"#4c6ef5\",\n \"#4263eb\",\n \"#3b5bdb\",\n \"#364fc7\",\n ],\n cyan: [\n \"#e3fafc\",\n \"#c5f6fa\",\n \"#99e9f2\",\n \"#66d9e8\",\n \"#3bc9db\",\n \"#22b8cf\",\n \"#15aabf\",\n \"#1098ad\",\n \"#0c8599\",\n \"#0b7285\",\n ],\n teal: [\n \"#e6fcf5\",\n \"#c3fae8\",\n \"#96f2d7\",\n \"#63e6be\",\n \"#38d9a9\",\n \"#20c997\",\n \"#12b886\",\n \"#0ca678\",\n \"#099268\",\n \"#087f5b\",\n ],\n lime: [\n \"#f4fce3\",\n \"#e9fac8\",\n \"#d8f5a2\",\n \"#c0eb75\",\n \"#a9e34b\",\n \"#94d82d\",\n \"#82c91e\",\n \"#74b816\",\n \"#66a80f\",\n \"#5c940d\",\n ],\n Remoraid: [\n \"#dcf2de\",\n \"#c7eccc\",\n \"#b2e6b9\",\n \"#9de1a6\",\n \"#88db93\",\n \"#88db93\",\n \"#5fc26d\",\n \"#479454\",\n \"#296133\",\n \"#19361d\",\n ],\n },\n primaryColor: \"Remoraid\",\n primaryShade: {\n light: 6,\n dark: 7,\n },\n white: \"#ffffff\",\n black: \"#24292f\",\n autoContrast: true,\n luminanceThreshold: 0.3,\n fontFamily: \"Open Sans\",\n fontFamilyMonospace: \"Roboto Mono\",\n headings: {\n fontFamily: \"Open Sans\",\n fontWeight: \"500\",\n sizes: {\n h1: {\n fontSize: \"3.125rem\",\n lineHeight: \"1.3\",\n fontWeight: \"700\",\n },\n h2: {\n fontSize: \"1.625rem\",\n lineHeight: \"1.35\",\n fontWeight: \"0\",\n },\n h3: {\n fontSize: \"1.375rem\",\n lineHeight: \"1.4\",\n fontWeight: \"0\",\n },\n h4: {\n fontSize: \"1.125rem\",\n lineHeight: \"1.45\",\n fontWeight: \"0\",\n },\n h5: {\n fontSize: \"1rem\",\n lineHeight: \"1.5\",\n fontWeight: \"0\",\n },\n h6: {\n fontSize: \"0.875rem\",\n lineHeight: \"1.5\",\n fontWeight: \"0\",\n },\n },\n },\n scale: 1,\n radius: {\n xs: \"0.325rem\",\n sm: \"0.75rem\",\n md: \"0.7rem\",\n lg: \"1.2rem\",\n xl: \"2.4rem\",\n },\n spacing: {\n xs: \"0.525rem\",\n sm: \"0.65rem\",\n md: \"0.9rem\",\n lg: \"1.35rem\",\n xl: \"2.2rem\",\n },\n defaultRadius: \"md\",\n breakpoints: {\n xs: \"36em\",\n sm: \"48em\",\n md: \"62em\",\n lg: \"75em\",\n xl: \"88em\",\n },\n fontSmoothing: true,\n respectReducedMotion: false,\n focusRing: \"auto\",\n cursorType: \"default\",\n components: {\n Input: {\n defaultProps: {\n variant: \"default\",\n radius: \"xl\",\n },\n styles: {},\n },\n Card: {\n defaultProps: {\n withBorder: true,\n },\n styles: {},\n },\n },\n};\n","import type { AlephaTheme } from \"../providers/ThemeProvider.ts\";\n\nexport const slateTheme: AlephaTheme = {\n id: \"slate\",\n label: \"Slate\",\n description: \"Professional, minimal zinc palette\",\n primaryColor: \"dark\",\n primaryShade: { light: 9, dark: 7 },\n fontFamily:\n '\"Inter\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif',\n fontFamilyMonospace:\n '\"JetBrains Mono\", \"Fira Code\", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace',\n headings: {\n fontFamily: '\"Inter\", -apple-system, BlinkMacSystemFont, sans-serif',\n fontWeight: \"600\",\n textWrap: \"wrap\",\n sizes: {\n h1: { fontSize: \"2rem\", lineHeight: \"1.2\" },\n h2: { fontSize: \"1.5rem\", lineHeight: \"1.25\" },\n h3: { fontSize: \"1.25rem\", lineHeight: \"1.3\" },\n h4: { fontSize: \"1rem\", lineHeight: \"1.4\" },\n h5: { fontSize: \"0.875rem\", lineHeight: \"1.5\" },\n h6: { fontSize: \"0.75rem\", lineHeight: \"1.5\" },\n },\n },\n fontSizes: {\n xs: \"0.75rem\",\n sm: \"0.875rem\",\n md: \"0.875rem\",\n lg: \"1rem\",\n xl: \"1.125rem\",\n },\n lineHeights: {\n xs: \"1.4\",\n sm: \"1.45\",\n md: \"1.5\",\n lg: \"1.55\",\n xl: \"1.6\",\n },\n radius: {\n xs: \"0.125rem\",\n sm: \"0.25rem\",\n md: \"0.375rem\",\n lg: \"0.5rem\",\n xl: \"0.75rem\",\n },\n defaultRadius: \"md\",\n shadows: {\n xs: \"0 1px 2px 0 rgba(0, 0, 0, 0.05)\",\n sm: \"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1)\",\n md: \"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1)\",\n lg: \"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1)\",\n xl: \"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1)\",\n },\n colors: {\n dark: [\n \"#f4f4f5\",\n \"#a1a1aa\",\n \"#71717a\",\n \"#52525b\",\n \"#3f3f46\",\n \"#27272a\",\n \"#18181b\",\n \"#0f0f10\",\n \"#09090b\",\n \"#000000\",\n ],\n gray: [\n \"#fafafa\",\n \"#f4f4f5\",\n \"#e4e4e7\",\n \"#d4d4d8\",\n \"#a1a1aa\",\n \"#71717a\",\n \"#52525b\",\n \"#3f3f46\",\n \"#27272a\",\n \"#18181b\",\n ],\n },\n};\n","import { $head } from \"@alepha/react/head\";\nimport type { MantineThemeOverride } from \"@mantine/core\";\nimport { $atom, $inject, Alepha, type Static, t } from \"alepha\";\nimport { $cookie } from \"alepha/server/cookies\";\nimport {\n auroraTheme,\n crystalTheme,\n defaultTheme,\n emberTheme,\n midnightTheme,\n remoraidTheme,\n slateTheme,\n} from \"../themes/index.ts\";\n\nexport const themeAtom = $atom({\n name: \"alepha.ui.theme\",\n schema: t.object({\n id: t.string(),\n }),\n default: {\n id: \"default\",\n },\n});\n\nexport type Theme = Static<typeof themeAtom.schema>;\n\ndeclare module \"alepha\" {\n interface State {\n [themeAtom.key]?: Theme;\n }\n}\n\nexport type AlephaTheme = MantineThemeOverride & {\n id: string;\n label: string;\n description: string;\n};\n\nexport class ThemeProvider {\n protected readonly alepha = $inject(Alepha);\n protected themeCookie = $cookie(themeAtom);\n\n public themes: AlephaTheme[] = [\n defaultTheme,\n remoraidTheme,\n midnightTheme,\n slateTheme,\n auroraTheme,\n emberTheme,\n crystalTheme,\n ];\n\n protected themeHead = $head(() => {\n return {\n htmlAttributes: {\n \"data-theme\": this.getTheme().id,\n },\n };\n });\n\n public setTheme(theme: Theme) {\n this.themeCookie.set(theme);\n this.alepha.store.set(themeAtom, theme);\n\n if (typeof document === \"undefined\") return;\n\n document.documentElement.removeAttribute(\"data-theme\");\n\n if (theme.id !== \"default\") {\n document.documentElement.setAttribute(\"data-theme\", theme.id);\n }\n }\n\n public getTheme() {\n // TODO: make a safe cookie getter, today it crash when Cookie Server is called inside vite pre-render\n try {\n return (\n this.themeCookie.get() ??\n this.alepha.store.get(themeAtom) ??\n themeAtom.options.default\n );\n } catch {\n // TODO: atom should take default value if undefined ???\n return this.alepha.store.get(themeAtom) ?? themeAtom.options.default;\n }\n }\n}\n","import { useInject, useStore } from \"@alepha/react\";\nimport {\n type AlephaTheme,\n type Theme,\n ThemeProvider,\n themeAtom,\n} from \"../providers/ThemeProvider.ts\";\n\nexport const useTheme = () => {\n useStore(themeAtom);\n\n const themeService = useInject(ThemeProvider);\n const currentTheme = themeService.getTheme();\n\n // Find the full theme object from the themes array\n const fullTheme =\n themeService.themes.find((t) => t.id === currentTheme.id) ??\n themeService.themes[0];\n\n const applyTheme = (theme: Theme | AlephaTheme) => {\n themeService.setTheme({ id: theme.id });\n };\n\n return [fullTheme, applyTheme] as const;\n};\n","import type { NotificationData } from \"@mantine/notifications\";\nimport { notifications } from \"@mantine/notifications\";\nimport {\n IconAlertTriangle,\n IconCheck,\n IconInfoCircle,\n IconX,\n} from \"@tabler/icons-react\";\n\nexport interface ToastServiceOptions {\n default?: Partial<NotificationData>;\n}\n\nexport class ToastService {\n protected readonly raw = notifications;\n\n public readonly options: ToastServiceOptions = {\n default: {\n radius: \"md\",\n withBorder: true,\n withCloseButton: true,\n autoClose: 5000,\n position: \"top-center\",\n },\n };\n\n public show(options: NotificationData) {\n notifications.show({\n ...this.options.default,\n ...options,\n });\n }\n\n public info(options: Partial<NotificationData> | string) {\n if (typeof options === \"string\") {\n options = { message: options };\n }\n this.show({\n color: \"blue\",\n icon: <IconInfoCircle size={20} />,\n title: \"Info\",\n message: \"Information notification\",\n ...options,\n });\n }\n\n public success(options: Partial<NotificationData> | string) {\n if (typeof options === \"string\") {\n options = { message: options };\n }\n this.show({\n color: \"green\",\n icon: <IconCheck size={16} />,\n title: \"Success\",\n message: \"Operation completed successfully\",\n ...options,\n });\n }\n\n public warning(options: Partial<NotificationData> | string) {\n if (typeof options === \"string\") {\n options = { message: options };\n }\n this.show({\n color: \"yellow\",\n icon: <IconAlertTriangle size={20} />,\n title: \"Warning\",\n message: \"Please review this warning\",\n ...options,\n });\n }\n\n public danger(options: Partial<NotificationData> | string) {\n if (typeof options === \"string\") {\n options = { message: options };\n }\n this.show({\n color: \"red\",\n icon: <IconX size={20} />,\n title: \"Error\",\n message: \"An error occurred\",\n ...options,\n });\n }\n}\n","import { useInject } from \"@alepha/react\";\nimport { ToastService } from \"../services/ToastService.tsx\";\n\n/**\n * Use this hook to access the Toast Service for showing notifications.\n *\n * @example\n * ```tsx\n * const toast = useToast();\n * toast.success({ message: \"Operation completed successfully!\" });\n * toast.error({ title: \"Error\", message: \"Something went wrong\" });\n * ```\n */\nexport const useToast = (): ToastService => {\n return useInject(ToastService);\n};\n","export const ui = {\n colors: {\n transparent: \"transparent\",\n background: \"var(--alepha-background)\",\n surface: \"var(--alepha-surface)\",\n elevated: \"var(--alepha-elevated)\",\n border: \"var(--alepha-border)\",\n },\n sizes: {\n icon: {\n xs: 12,\n sm: 16,\n md: 20,\n lg: 24,\n xl: 32,\n },\n },\n};\n","import {\n type RouterGoOptions,\n type UseActionReturn,\n type UseActiveOptions,\n useAction,\n useActive,\n useRouter,\n} from \"@alepha/react\";\nimport { type FormModel, useFormState } from \"@alepha/react/form\";\nimport {\n Anchor,\n type AnchorProps,\n Button,\n type ButtonProps,\n Flex,\n Menu,\n type MenuItemProps,\n type MenuProps,\n type MenuTargetProps,\n ThemeIcon,\n type ThemeIconProps,\n Tooltip,\n type TooltipProps,\n} from \"@mantine/core\";\nimport { IconCheck, IconChevronRight } from \"@tabler/icons-react\";\nimport {\n type ButtonHTMLAttributes,\n Children,\n type ComponentType,\n isValidElement,\n type ReactNode,\n} from \"react\";\nimport { ui } from \"../../constants/ui.ts\";\n\nexport interface ActionMenuItem {\n /**\n * Menu item type\n */\n type?: \"item\" | \"divider\" | \"label\";\n\n /**\n * Label text for the menu item\n */\n label?: string | ReactNode;\n\n /**\n * Icon element to display before the label\n */\n icon?: ReactNode;\n\n /**\n * Click handler for menu items\n */\n onClick?: () => void;\n\n /**\n * Href for navigation menu items\n */\n href?: string;\n\n /**\n * Color for the menu item (e.g., \"red\" for danger actions)\n */\n color?: string;\n\n /**\n * Nested submenu items\n */\n children?: ActionMenuItem[];\n\n /**\n * Whether the menu item is active\n */\n active?: boolean;\n}\n\nexport interface ActionMenuConfig {\n /**\n * Array of menu items to display\n */\n items: ActionMenuItem[];\n\n /**\n * Menu position relative to the button\n */\n position?:\n | \"bottom\"\n | \"bottom-start\"\n | \"bottom-end\"\n | \"top\"\n | \"top-start\"\n | \"top-end\"\n | \"left\"\n | \"right\";\n\n /**\n * Menu width\n */\n width?: number | string;\n\n /**\n * Menu shadow\n */\n shadow?: \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\";\n\n on?: \"hover\" | \"click\";\n\n targetProps?: MenuTargetProps;\n\n menuProps?: MenuProps;\n}\n\nexport interface ActionCommonProps extends ButtonProps {\n children?: ReactNode;\n\n textVisibleFrom?: \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\";\n\n /**\n * Tooltip to display on hover. Can be a string for simple tooltips\n * or a TooltipProps object for advanced configuration.\n */\n tooltip?: string | TooltipProps;\n\n /**\n * Menu configuration. When provided, the action will display a dropdown menu.\n */\n menu?: ActionMenuConfig;\n\n /**\n * If set, a confirmation dialog will be shown before performing the action.\n * If `true`, a default title and message will be used.\n * If a string, it will be used as the message with a default title.\n * If an object, it can contain `title` and `message` properties to customize the dialog.\n */\n confirm?: boolean | string | { title?: string; message: string };\n\n /**\n * Icon to display on the left side of the button.\n * If no children are provided, the button will be styled as an icon-only button.\n */\n icon?: ReactNode | ComponentType;\n\n /**\n * Additional props to pass to the ThemeIcon wrapping the icon.\n */\n themeIconProps?: ThemeIconProps;\n\n /**\n * Visual intent of the action button.\n */\n intent?: \"primary\" | \"success\" | \"danger\" | \"warning\" | \"info\";\n}\n\nexport type ActionProps = ActionCommonProps &\n (\n | ActionNavigationButtonProps\n | ActionClickButtonProps\n | ActionSubmitButtonProps\n | ActionHookButtonProps\n | {}\n );\n\n// ---------------------------------------------------------------------------------------------------------------------\n\n// Helper function to render menu items recursively\nconst ActionMenuItem = (props: {\n item: ActionMenuItem;\n index: number;\n}): ReactNode => {\n const { item, index } = props;\n\n const router = useRouter();\n const action = useAction(\n {\n handler: async (e: any) => {\n await item.onClick?.();\n },\n },\n [item.onClick],\n );\n\n // Render divider\n if (item.type === \"divider\") {\n return <Menu.Divider key={index} />;\n }\n\n // Render label\n if (item.type === \"label\") {\n return <Menu.Label key={index}>{item.label}</Menu.Label>;\n }\n\n // Render submenu if it has children\n if (item.children && item.children.length > 0) {\n return (\n <Menu key={index} trigger=\"hover\" position=\"right-start\" offset={2}>\n <Menu.Target>\n <Menu.Item\n leftSection={item.icon}\n rightSection={<IconChevronRight size={14} />}\n >\n {item.label}\n </Menu.Item>\n </Menu.Target>\n <Menu.Dropdown>\n {item.children.map((child, childIndex) => (\n <ActionMenuItem item={child} index={childIndex} key={childIndex} />\n ))}\n </Menu.Dropdown>\n </Menu>\n );\n }\n\n const menuItemProps: MenuItemProps & ButtonHTMLAttributes<unknown> = {};\n if (props.item.onClick) {\n menuItemProps.onClick = action.run;\n } else if (props.item.href) {\n Object.assign(menuItemProps, router.anchor(props.item.href));\n }\n\n // render regular menu item\n return (\n <Menu.Item\n key={index}\n leftSection={item.icon}\n onClick={item.onClick}\n color={item.color}\n rightSection={\n item.active ? (\n <ThemeIcon size={\"xs\"} variant={\"transparent\"}>\n <IconCheck />\n </ThemeIcon>\n ) : undefined\n }\n {...menuItemProps}\n >\n {item.label}\n </Menu.Item>\n );\n};\n\nconst ActionButton = (_props: ActionProps) => {\n const props = { variant: \"subtle\", ..._props };\n const { tooltip, menu, icon, ...restProps } = props;\n\n // set default color to gray (not colored)\n restProps.color ??= \"gray\";\n\n if (props.icon) {\n const icon = isComponentType(props.icon) ? (\n <props.icon size={ui.sizes.icon.md} />\n ) : (\n <ThemeIcon\n w={24} // TODO: make size configurable\n variant={\"transparent\"}\n size={\"sm\"}\n c={\"var(--mantine-color-text)\"}\n {...props.themeIconProps}\n >\n {props.icon as ReactNode}\n </ThemeIcon>\n );\n\n if (!props.children) {\n restProps.children = Children.only(icon);\n restProps.px ??= \"xs\";\n } else {\n restProps.leftSection = icon;\n }\n }\n\n if (props.leftSection && !props.children) {\n restProps.px ??= \"xs\";\n }\n\n if (props.textVisibleFrom) {\n const { children, textVisibleFrom, leftSection, ...rest } = restProps;\n return (\n <>\n <Flex w={\"100%\"} visibleFrom={textVisibleFrom}>\n <ActionButton\n flex={1}\n {...rest}\n leftSection={leftSection}\n tooltip={tooltip}\n menu={menu}\n >\n {children}\n </ActionButton>\n </Flex>\n <Flex w={\"100%\"} hiddenFrom={textVisibleFrom}>\n <ActionButton px={\"xs\"} {...rest} tooltip={tooltip} menu={menu}>\n {leftSection}\n </ActionButton>\n </Flex>\n </>\n );\n }\n\n const renderAction = () => {\n if (\"href\" in restProps && restProps.href) {\n if (restProps.href.startsWith(\"http\") || restProps.target) {\n return (\n <ActionHrefButton {...restProps} href={restProps.href}>\n {restProps.children}\n </ActionHrefButton>\n );\n }\n return (\n <ActionNavigationButton {...restProps} href={restProps.href}>\n {restProps.children}\n </ActionNavigationButton>\n );\n }\n\n delete (restProps as any).classNameActive;\n delete (restProps as any).variantActive;\n\n if (\"action\" in restProps && restProps.action) {\n return (\n <ActionHookButton {...restProps} action={restProps.action}>\n {restProps.children}\n </ActionHookButton>\n );\n }\n\n if (\"onClick\" in restProps && restProps.onClick) {\n return (\n <ActionClickButton {...restProps} onClick={restProps.onClick}>\n {restProps.children}\n </ActionClickButton>\n );\n }\n\n if (\"form\" in restProps && restProps.form) {\n if (restProps.type === \"reset\") {\n return (\n <ActionResetButton {...restProps} form={restProps.form}>\n {restProps.children}\n </ActionResetButton>\n );\n }\n return (\n <ActionSubmitButton {...restProps} form={restProps.form}>\n {restProps.children}\n </ActionSubmitButton>\n );\n }\n\n return <Button {...(restProps as any)}>{restProps.children}</Button>;\n };\n\n let actionElement = renderAction();\n\n // wrap with Menu if provided\n if (menu) {\n actionElement = (\n <Menu\n position={menu.position || \"bottom-start\"}\n width={menu.width || 200}\n shadow={menu.shadow || \"md\"}\n trigger={menu.on === \"hover\" ? \"hover\" : \"click\"}\n {...menu.menuProps}\n >\n <Menu.Target {...menu.targetProps}>{actionElement}</Menu.Target>\n <Menu.Dropdown>\n {menu.items.map((item, index) => (\n <ActionMenuItem item={item} index={index} key={index} />\n ))}\n </Menu.Dropdown>\n </Menu>\n );\n }\n\n // Wrap with Tooltip if provided\n if (tooltip) {\n // openDelay: 1000 -> like HTML title attribute\n const defaultTooltipProps: Partial<TooltipProps> = {\n openDelay: 1000,\n };\n const tooltipProps: TooltipProps =\n typeof tooltip === \"string\"\n ? {\n ...defaultTooltipProps,\n label: tooltip,\n children: actionElement,\n }\n : { ...defaultTooltipProps, ...tooltip, children: actionElement };\n\n return <Tooltip {...tooltipProps} />;\n }\n\n return actionElement;\n};\n\nexport default ActionButton;\n\n// ---------------------------------------------------------------------------------------------------------------------\n\n// Action Submit\n\n// ---------------------------------------------------------------------------------------------------------------------\n\nexport interface ActionSubmitButtonProps extends ButtonProps {\n form: FormModel<any>;\n type?: \"submit\" | \"reset\";\n}\n\n/**\n * Action button that submits a form with loading and disabled state handling.\n */\nconst ActionSubmitButton = (props: ActionSubmitButtonProps) => {\n const { form, ...buttonProps } = props;\n const state = useFormState(form);\n return (\n <Button\n {...buttonProps}\n loading={state.loading}\n disabled={state.loading}\n type={\"submit\"}\n >\n {props.children}\n </Button>\n );\n};\n\nconst ActionResetButton = (props: ActionSubmitButtonProps) => {\n const { form, ...buttonProps } = props;\n const state = useFormState(form);\n return (\n <Button {...buttonProps} disabled={state.loading} type={\"reset\"}>\n {props.children}\n </Button>\n );\n};\n\n// ---------------------------------------------------------------------------------------------------------------------\n\n// Action with useAction Hook\n\n// ---------------------------------------------------------------------------------------------------------------------\n\nexport interface ActionHookButtonProps extends ButtonProps {\n action: UseActionReturn<any[], any>;\n}\n\n/**\n * Action button that integrates with useAction hook return value.\n * Automatically handles loading state and executes the action on click.\n *\n * @example\n * ```tsx\n * const saveAction = useAction({\n * handler: async (data) => {\n * await api.save(data);\n * }\n * }, []);\n *\n * <ActionButton action={saveAction}>\n * Save\n * </ActionButton>\n * ```\n */\nconst ActionHookButton = (props: ActionHookButtonProps) => {\n const { action, ...buttonProps } = props;\n\n return (\n <Button\n {...buttonProps}\n disabled={action.loading || props.disabled}\n loading={action.loading}\n onClick={() => action.run()}\n >\n {props.children}\n </Button>\n );\n};\n\n// ---------------------------------------------------------------------------------------------------------------------\n\n// Action Click\n\n// ---------------------------------------------------------------------------------------------------------------------\n\nexport interface ActionClickButtonProps extends ButtonProps {\n onClick: (e: any) => any;\n}\n\n/**\n * Basic action button that handles click events with loading and error handling.\n *\n * @example\n * ```tsx\n * <ActionButton onClick={() => api.doSomething()}>\n * Do Something\n * </ActionButton>\n * ```\n */\nconst ActionClickButton = (props: ActionClickButtonProps) => {\n const action = useAction(\n {\n handler: async (e: any) => {\n await props.onClick(e);\n },\n },\n [props.onClick],\n );\n\n return (\n <Button\n {...props}\n disabled={action.loading || props.disabled}\n loading={action.loading}\n onClick={action.run}\n >\n {props.children}\n </Button>\n );\n};\n\n// ---------------------------------------------------------------------------------------------------------------------\n\n// Action Navigation\n\n// ---------------------------------------------------------------------------------------------------------------------\n\nexport interface ActionNavigationButtonProps extends ButtonProps {\n href: string;\n active?: Partial<UseActiveOptions> | false;\n routerGoOptions?: RouterGoOptions;\n classNameActive?: string;\n variantActive?: ButtonProps[\"variant\"];\n target?: string;\n anchorProps?: AnchorProps;\n}\n\n/**\n * Action for navigation with active state support.\n */\nconst ActionNavigationButton = (props: ActionNavigationButtonProps) => {\n const {\n active: options,\n classNameActive,\n variantActive,\n routerGoOptions,\n ...buttonProps\n } = props;\n const router = useRouter();\n const { isPending, isActive } = useActive(\n options ? { href: props.href, ...options } : { href: props.href },\n );\n const anchorProps = router.anchor(props.href, routerGoOptions);\n\n const className = buttonProps.className || \"\";\n if (isActive && options !== false && classNameActive) {\n buttonProps.className = `${className} ${classNameActive}`.trim();\n }\n\n if (props.anchorProps) {\n return (\n <Anchor component={\"a\"} {...anchorProps} {...props.anchorProps}>\n {props.children}\n </Anchor>\n );\n }\n\n return (\n <Button\n component={\"a\"}\n loading={isPending}\n {...buttonProps}\n {...anchorProps}\n variant={\n isActive && options !== false\n ? (variantActive ?? \"filled\")\n : (buttonProps.variant ?? \"subtle\")\n }\n >\n {props.children}\n </Button>\n );\n};\n\nconst ActionHrefButton = (props: ActionNavigationButtonProps) => {\n const {\n active: options,\n classNameActive,\n variantActive,\n routerGoOptions,\n target,\n ...buttonProps\n } = props;\n\n return (\n <Button component={\"a\"} target={target} {...buttonProps}>\n {props.children}\n </Button>\n );\n};\n\n// ---------------------------------------------------------------------------------------------------------------------\n\nexport function isComponentType(param: any): param is ComponentType<any> {\n if (isValidElement(param)) return false;\n return (\n typeof param === \"function\" ||\n (typeof param === \"object\" && param !== null && \"$$typeof\" in param)\n );\n}\n\nexport const renderIcon = (icon: ReactNode | ComponentType): ReactNode => {\n if (!icon) return null;\n if (isValidElement(icon)) return icon;\n if (isComponentType(icon)) {\n const IconComponent = icon;\n return <IconComponent size={ui.sizes.icon.md} />;\n }\n return icon as ReactNode;\n};\n","import { useRouter, useStore } from \"@alepha/react\";\nimport { Spotlight, type SpotlightActionData } from \"@mantine/spotlight\";\nimport { IconSearch } from \"@tabler/icons-react\";\nimport { type ReactNode, useMemo } from \"react\";\nimport { ui } from \"../../constants/ui.ts\";\nimport { renderIcon } from \"../buttons/ActionButton.tsx\";\n\nexport interface OmnibarProps {\n shortcut?: string | string[];\n searchPlaceholder?: string;\n nothingFound?: ReactNode;\n}\n\nconst Omnibar = (props: OmnibarProps) => {\n const shortcut = props.shortcut ?? \"mod+K\";\n const searchPlaceholder = props.searchPlaceholder ?? \"Search...\";\n const nothingFound = props.nothingFound ?? \"Nothing found...\";\n const router = useRouter();\n\n // watch user to re-render on permission changes\n const [user] = useStore(\"alepha.server.request.user\");\n\n const actions: SpotlightActionData[] = useMemo(\n () =>\n router.concretePages\n .filter((page) => {\n if (page.can && !page.can()) return false;\n\n return true;\n })\n .map((page) => ({\n id: page.name,\n label: page.label ?? page.name,\n description: page.description,\n onClick: () => {\n if (page.staticName) {\n return router.go(page.staticName, { params: page.params });\n }\n return router.go(page.name);\n },\n leftSection: renderIcon(page.icon),\n })),\n [user],\n );\n\n return (\n <Spotlight\n actions={actions}\n shortcut={shortcut}\n limit={10}\n searchProps={{\n leftSection: <IconSearch size={ui.sizes.icon.md} />,\n placeholder: searchPlaceholder,\n }}\n nothingFound={nothingFound}\n />\n );\n};\n\nexport default Omnibar;\n","import { NestedView, useEvents } from \"@alepha/react\";\nimport { FormValidationError } from \"@alepha/react/form\";\nimport {\n ColorSchemeScript,\n type ColorSchemeScriptProps,\n MantineProvider,\n type MantineProviderProps,\n} from \"@mantine/core\";\nimport { ModalsProvider, type ModalsProviderProps } from \"@mantine/modals\";\nimport { Notifications, type NotificationsProps } from \"@mantine/notifications\";\nimport type { NavigationProgressProps } from \"@mantine/nprogress\";\nimport { NavigationProgress, nprogress } from \"@mantine/nprogress\";\nimport type { ReactNode } from \"react\";\nimport { useTheme } from \"../../hooks/useTheme.ts\";\nimport { useToast } from \"../../hooks/useToast.ts\";\nimport Omnibar, { type OmnibarProps } from \"./Omnibar.tsx\";\n\nexport interface AlephaMantineProviderProps {\n children?: ReactNode;\n mantine?: MantineProviderProps;\n colorSchemeScript?: ColorSchemeScriptProps;\n navigationProgress?: NavigationProgressProps;\n notifications?: NotificationsProps;\n modals?: ModalsProviderProps;\n omnibar?: OmnibarProps;\n}\n\nconst AlephaMantineProvider = (props: AlephaMantineProviderProps) => {\n const toast = useToast();\n const [theme] = useTheme();\n\n useEvents(\n {\n \"react:transition:begin\": () => {\n nprogress.start();\n },\n \"react:transition:end\": () => {\n nprogress.complete();\n },\n \"react:action:error\": ({ error }) => {\n if (error instanceof FormValidationError) {\n // Validation errors are handled by the form component\n return;\n }\n\n toast.danger({\n title: error.name || \"Error\",\n message:\n error.message ?? \"An error occurred while processing your action.\",\n });\n },\n },\n [],\n );\n\n return (\n <>\n <ColorSchemeScript\n defaultColorScheme={props.mantine?.defaultColorScheme}\n {...props.colorSchemeScript}\n />\n <MantineProvider\n {...props.mantine}\n theme={{\n // Spread all theme properties from the selected theme\n ...theme,\n // User overrides take precedence\n ...props.mantine?.theme,\n }}\n >\n <Notifications {...props.notifications} />\n <NavigationProgress {...props.navigationProgress} />\n <ModalsProvider {...props.modals}>\n <Omnibar {...props.omnibar} />\n {props.children ?? <NestedView />}\n </ModalsProvider>\n </MantineProvider>\n </>\n );\n};\n\nexport default AlephaMantineProvider;\n","import { $page } from \"@alepha/react\";\nimport AlephaMantineProvider from \"./components/layout/AlephaMantineProvider.tsx\";\n\nexport class RootRouter {\n public readonly root = $page({\n path: \"/\",\n component: AlephaMantineProvider,\n });\n}\n","import {\n ActionIcon,\n Box,\n Collapse,\n CopyButton,\n type MantineSize,\n Text,\n Tooltip,\n} from \"@mantine/core\";\nimport {\n IconCheck,\n IconChevronDown,\n IconChevronRight,\n IconCopy,\n} from \"@tabler/icons-react\";\nimport { type ReactNode, useState } from \"react\";\n\ninterface JsonViewerProps {\n data: any;\n defaultExpanded?: boolean;\n maxDepth?: number;\n copyable?: boolean;\n size?: MantineSize;\n}\n\ninterface JsonNodeProps {\n name?: string;\n value: any;\n depth: number;\n maxDepth: number;\n isLast?: boolean;\n isArrayItem?: boolean;\n size?: MantineSize;\n}\n\nconst getSizeConfig = (size: MantineSize = \"sm\") => {\n const configs = {\n xs: { text: \"xs\", icon: 12, indent: 16, gap: 2 },\n sm: { text: \"sm\", icon: 14, indent: 20, gap: 4 },\n md: { text: \"md\", icon: 16, indent: 24, gap: 6 },\n lg: { text: \"lg\", icon: 18, indent: 28, gap: 8 },\n xl: { text: \"xl\", icon: 20, indent: 32, gap: 10 },\n };\n return configs[size] || configs.sm;\n};\n\nconst JsonNode = ({\n name,\n value,\n depth,\n maxDepth,\n isLast = false,\n isArrayItem = false,\n size = \"sm\",\n}: JsonNodeProps) => {\n const [expanded, setExpanded] = useState(depth < 2);\n const sizeConfig = getSizeConfig(size);\n\n const getValueType = (val: any): string => {\n if (val === null) return \"null\";\n if (val === undefined) return \"undefined\";\n if (Array.isArray(val)) return \"array\";\n return typeof val;\n };\n\n const valueType = getValueType(value);\n\n const renderPrimitive = (val: any): ReactNode => {\n const type = getValueType(val);\n\n switch (type) {\n case \"string\":\n return (\n <Text\n component=\"span\"\n c=\"teal\"\n ff=\"monospace\"\n size={sizeConfig.text}\n style={{ whiteSpace: \"nowrap\" }}\n >\n \"{val}\"\n </Text>\n );\n case \"number\":\n return (\n <Text\n component=\"span\"\n c=\"blue\"\n ff=\"monospace\"\n size={sizeConfig.text}\n style={{ whiteSpace: \"nowrap\" }}\n >\n {val}\n </Text>\n );\n case \"boolean\":\n return (\n <Text\n component=\"span\"\n c=\"violet\"\n ff=\"monospace\"\n size={sizeConfig.text}\n style={{ whiteSpace: \"nowrap\" }}\n >\n {String(val)}\n </Text>\n );\n case \"null\":\n return (\n <Text\n component=\"span\"\n c=\"dimmed\"\n ff=\"monospace\"\n size={sizeConfig.text}\n style={{ whiteSpace: \"nowrap\" }}\n >\n null\n </Text>\n );\n case \"undefined\":\n return (\n <Text\n component=\"span\"\n c=\"dimmed\"\n ff=\"monospace\"\n size={sizeConfig.text}\n style={{ whiteSpace: \"nowrap\" }}\n >\n undefined\n </Text>\n );\n default:\n return (\n <Text\n component=\"span\"\n ff=\"monospace\"\n size={sizeConfig.text}\n style={{ whiteSpace: \"nowrap\" }}\n >\n {String(val)}\n </Text>\n );\n }\n };\n\n const renderKey = () => {\n if (!name) return null;\n return (\n <Text\n component=\"span\"\n c=\"cyan\"\n ff=\"monospace\"\n fw={500}\n size={sizeConfig.text}\n >\n {isArrayItem ? `[${name}]` : `\"${name}\"`}:\n </Text>\n );\n };\n\n if (valueType === \"object\" || valueType === \"array\") {\n const isObject = valueType === \"object\";\n const entries = isObject\n ? Object.entries(value)\n : value.map((v: any, i: number) => [i, v]);\n const isEmpty = entries.length === 0;\n const canExpand = depth < maxDepth && !isEmpty;\n\n const preview = isObject ? \"{...}\" : \"[...]\";\n const brackets = isObject ? [\"{\", \"}\"] : [\"[\", \"]\"];\n\n return (\n <Box>\n <Box\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: sizeConfig.gap,\n minWidth: \"max-content\",\n }}\n >\n {canExpand && (\n <ActionIcon\n size=\"xs\"\n variant=\"transparent\"\n c=\"dimmed\"\n onClick={() => setExpanded(!expanded)}\n style={{ cursor: \"pointer\", flexShrink: 0 }}\n >\n {expanded ? (\n <IconChevronDown size={sizeConfig.icon} />\n ) : (\n <IconChevronRight size={sizeConfig.icon} />\n )}\n </ActionIcon>\n )}\n {!canExpand && (\n <Box w={sizeConfig.icon + 6} style={{ flexShrink: 0 }} />\n )}\n <Box style={{ flexShrink: 0 }}>{renderKey()}</Box>{\" \"}\n <Text\n component=\"span\"\n c=\"dimmed\"\n ff=\"monospace\"\n size={sizeConfig.text}\n style={{ flexShrink: 0 }}\n >\n {brackets[0]}\n </Text>\n {!expanded && !isEmpty && (\n <Text\n component=\"span\"\n c=\"dimmed\"\n ff=\"monospace\"\n fs=\"italic\"\n size={sizeConfig.text}\n style={{ flexShrink: 0 }}\n >\n {preview}\n </Text>\n )}\n {(isEmpty || !expanded) && (\n <Text\n component=\"span\"\n c=\"dimmed\"\n ff=\"monospace\"\n size={sizeConfig.text}\n style={{ flexShrink: 0 }}\n >\n {brackets[1]}\n </Text>\n )}\n {!isEmpty && !expanded && (\n <Text\n component=\"span\"\n c=\"dimmed\"\n size={sizeConfig.text}\n style={{ flexShrink: 0 }}\n >\n {entries.length} {entries.length === 1 ? \"item\" : \"items\"}\n </Text>\n )}\n </Box>\n\n <Collapse in={expanded && canExpand}>\n <Box\n pl={sizeConfig.indent}\n style={{\n borderLeft: \"1px solid var(--mantine-color-default-border)\",\n marginLeft: Math.floor((sizeConfig.icon + 6) / 2),\n }}\n >\n {entries.map(\n ([key, val]: [string | number, any], index: number) => (\n <JsonNode\n key={String(key)}\n name={String(key)}\n value={val}\n depth={depth + 1}\n maxDepth={maxDepth}\n isLast={index === entries.length - 1}\n isArrayItem={!isObject}\n size={size}\n />\n ),\n )}\n </Box>\n <Box style={{ display: \"flex\", minWidth: \"max-content\" }}>\n <Box w={sizeConfig.icon + 6} style={{ flexShrink: 0 }} />\n <Text\n c=\"dimmed\"\n ff=\"monospace\"\n size={sizeConfig.text}\n style={{ flexShrink: 0 }}\n >\n {brackets[1]}\n </Text>\n </Box>\n </Collapse>\n </Box>\n );\n }\n\n return (\n <Box\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: sizeConfig.gap,\n minWidth: \"max-content\",\n }}\n >\n <Box w={sizeConfig.icon + 6} style={{ flexShrink: 0 }} />\n <Box style={{ flexShrink: 0 }}>{renderKey()}</Box>\n <Box style={{ flexShrink: 0 }}>{renderPrimitive(value)}</Box>\n {!isLast && (\n <Text\n component=\"span\"\n c=\"dimmed\"\n ff=\"monospace\"\n size={sizeConfig.text}\n style={{ flexShrink: 0 }}\n >\n ,\n </Text>\n )}\n </Box>\n );\n};\n\nexport const JsonViewer = ({\n data,\n defaultExpanded = true,\n maxDepth = 10,\n copyable = true,\n size = \"sm\",\n}: JsonViewerProps) => {\n const sizeConfig = getSizeConfig(size);\n const copyIconSize = sizeConfig.icon + 2;\n\n return (\n <Box pos=\"relative\" w={\"100%\"}>\n {copyable && (\n <Box pos=\"absolute\" top={0} right={0} style={{ zIndex: 1 }}>\n <CopyButton value={JSON.stringify(data, null, 2)}>\n {({ copied, copy }) => (\n <Tooltip label={copied ? \"Copied\" : \"Copy JSON\"}>\n <ActionIcon\n color={copied ? \"teal\" : \"gray\"}\n variant=\"subtle\"\n onClick={copy}\n size={size}\n >\n {copied ? (\n <IconCheck size={copyIconSize} />\n ) : (\n <IconCopy size={copyIconSize} />\n )}\n </ActionIcon>\n </Tooltip>\n )}\n </CopyButton>\n </Box>\n )}\n <Box pt={copyable ? 30 : 0} style={{ overflowX: \"auto\" }}>\n <JsonNode value={data} depth={0} maxDepth={maxDepth} size={size} />\n </Box>\n </Box>\n );\n};\n\nexport default JsonViewer;\n","import { Button, Group, Text } from \"@mantine/core\";\nimport type { AlertDialogProps } from \"../../services/DialogService.tsx\";\n\nconst AlertDialog = ({ options, onClose }: AlertDialogProps) => (\n <>\n {options?.message && <Text mb=\"md\">{options.message}</Text>}\n <Group justify=\"flex-end\">\n <Button onClick={onClose}>{options?.okLabel || \"OK\"}</Button>\n </Group>\n </>\n);\n\nexport default AlertDialog;\n","import { Button, Group, Text } from \"@mantine/core\";\nimport type { ConfirmDialogProps } from \"../../services/DialogService.tsx\";\n\nconst ConfirmDialog = ({ options, onConfirm }: ConfirmDialogProps) => (\n <>\n {options?.message && <Text mb=\"md\">{options.message}</Text>}\n <Group justify=\"flex-end\">\n <Button variant=\"subtle\" onClick={() => onConfirm(false)}>\n {options?.cancelLabel || \"Cancel\"}\n </Button>\n <Button\n color={options?.confirmColor || \"blue\"}\n onClick={() => onConfirm(true)}\n >\n {options?.confirmLabel || \"Confirm\"}\n </Button>\n </Group>\n </>\n);\n\nexport default ConfirmDialog;\n","import { Button, Group, Text, TextInput } from \"@mantine/core\";\nimport { useEffect, useRef, useState } from \"react\";\nimport type { PromptDialogProps } from \"../../services/DialogService.tsx\";\n\nconst PromptDialog = ({ options, onSubmit }: PromptDialogProps) => {\n const [value, setValue] = useState(options?.defaultValue || \"\");\n const inputRef = useRef<HTMLInputElement>(null);\n\n useEffect(() => {\n // autofocus the input when the dialog opens\n inputRef.current?.focus();\n }, []);\n\n const handleSubmit = () => {\n if (!options?.required || value.trim()) {\n onSubmit(value);\n }\n };\n\n const handleKeyDown = (event: React.KeyboardEvent) => {\n if (event.key === \"Enter\") {\n handleSubmit();\n }\n };\n\n return (\n <>\n {options?.message && <Text mb=\"md\">{options.message}</Text>}\n <TextInput\n ref={inputRef}\n label={options?.label}\n placeholder={options?.placeholder}\n value={value}\n onChange={(event) => setValue(event.currentTarget.value)}\n onKeyDown={handleKeyDown}\n required={options?.required}\n mb=\"md\"\n />\n <Group justify=\"flex-end\">\n <Button variant=\"subtle\" onClick={() => onSubmit(null)}>\n {options?.cancelLabel || \"Cancel\"}\n </Button>\n <Button\n onClick={handleSubmit}\n disabled={options?.required && !value.trim()}\n >\n {options?.submitLabel || \"OK\"}\n </Button>\n </Group>\n </>\n );\n};\n\nexport default PromptDialog;\n","import { Flex, type ModalProps } from \"@mantine/core\";\nimport { modals } from \"@mantine/modals\";\nimport type { ReactNode } from \"react\";\nimport JsonViewer from \"../components/data/JsonViewer.tsx\";\nimport AlertDialog from \"../components/dialogs/AlertDialog.tsx\";\nimport ConfirmDialog from \"../components/dialogs/ConfirmDialog.tsx\";\nimport PromptDialog from \"../components/dialogs/PromptDialog.tsx\";\nimport { ui } from \"../constants/ui.ts\";\n\n// Base interfaces\nexport interface BaseDialogOptions extends Partial<ModalProps> {\n title?: ReactNode;\n message?: ReactNode;\n content?: any; // weird typing for mantine modals content\n}\n\nexport interface AlertDialogOptions extends BaseDialogOptions {\n okLabel?: string;\n}\n\nexport interface ConfirmDialogOptions extends BaseDialogOptions {\n confirmLabel?: string;\n cancelLabel?: string;\n confirmColor?: string;\n}\n\nexport interface PromptDialogOptions extends BaseDialogOptions {\n placeholder?: string;\n defaultValue?: string;\n label?: string;\n required?: boolean;\n submitLabel?: string;\n cancelLabel?: string;\n}\n\n// Component prop interfaces\nexport interface AlertDialogProps {\n options?: AlertDialogOptions;\n onClose: () => void;\n}\n\nexport interface ConfirmDialogProps {\n options?: ConfirmDialogOptions;\n onConfirm: (confirmed: boolean) => void;\n}\n\nexport interface PromptDialogProps {\n options?: PromptDialogOptions;\n onSubmit: (value: string | null) => void;\n}\n\nexport interface DialogServiceOptions {\n default?: Partial<BaseDialogOptions>;\n}\n\nexport class DialogService {\n public readonly options: DialogServiceOptions = {\n default: {\n centered: true,\n withCloseButton: true,\n size: \"md\",\n overlayProps: {\n backgroundOpacity: 0.55,\n blur: 3,\n },\n transitionProps: {\n transition: \"pop\",\n duration: 200,\n },\n },\n };\n\n /**\n * Show an alert dialog with a message\n */\n public alert(options?: AlertDialogOptions): Promise<void> {\n return new Promise((resolve) => {\n const modalId = this.open({\n ...options,\n title: options?.title || \"Alert\",\n content: (\n <AlertDialog\n options={options}\n onClose={() => {\n this.close(modalId);\n resolve();\n }}\n />\n ),\n });\n });\n }\n\n /**\n * Show a confirmation dialog that returns a promise\n */\n public confirm(options?: ConfirmDialogOptions): Promise<boolean> {\n return new Promise((resolve) => {\n const modalId = this.open({\n ...options,\n title: options?.title || \"Confirm\",\n closeOnClickOutside: false,\n closeOnEscape: false,\n content: (\n <ConfirmDialog\n options={options}\n onConfirm={(confirmed) => {\n this.close(modalId);\n resolve(confirmed);\n }}\n />\n ),\n });\n });\n }\n\n /**\n * Show a prompt dialog to get user input\n */\n public prompt(options?: PromptDialogOptions): Promise<string | null> {\n return new Promise((resolve) => {\n const modalId = this.open({\n ...options,\n title: options?.title || \"Input\",\n closeOnClickOutside: false,\n closeOnEscape: false,\n content: (\n <PromptDialog\n options={options}\n onSubmit={(value) => {\n this.close(modalId);\n resolve(value);\n }}\n />\n ),\n });\n });\n }\n\n /**\n * Open a custom dialog with provided content\n */\n public open(options?: BaseDialogOptions): string {\n return modals.open({\n ...this.options.default,\n ...options,\n children: options?.content || options?.message,\n });\n }\n\n /**\n * Close the currently open dialog or a specific dialog by ID\n */\n public close(modalId?: string): void {\n if (modalId) {\n modals.close(modalId);\n } else {\n modals.closeAll();\n }\n }\n\n /**\n * Show a JSON editor/viewer dialog\n */\n public json(data?: any, options?: BaseDialogOptions): void {\n this.open({\n size: \"lg\",\n title: options?.title || \"Json Viewer\",\n ...options,\n content: (\n <Flex bdrs={\"md\"} w={\"100%\"} flex={1} p={\"sm\"} bg={ui.colors.surface}>\n <JsonViewer size={\"xs\"} data={data} />\n </Flex>\n ),\n });\n }\n\n /**\n * Show a form dialog for structured input\n */\n public form(options?: BaseDialogOptions): Promise<any> {\n // Implementation to be added\n return Promise.resolve(null);\n }\n\n /**\n * Show a loading/progress dialog with optional progress percentage\n */\n public loading(options?: BaseDialogOptions & { progress?: number }): void {\n // Implementation to be added\n }\n\n /**\n * Show an image viewer/gallery dialog\n */\n public image(src: string | string[], options?: BaseDialogOptions): void {\n // Implementation to be added\n }\n}\n","import { useStore } from \"@alepha/react\";\nimport { Burger, type BurgerProps } from \"@mantine/core\";\n\nexport interface BurgerButtonProps extends BurgerProps {}\n\nconst BurgerButton = (props: BurgerButtonProps) => {\n const [opened, setOpened] = useStore(\"alepha.ui.sidebar.opened\");\n\n return (\n <Burger\n opened={opened}\n onClick={() => setOpened(!opened)}\n hiddenFrom=\"sm\"\n size=\"sm\"\n {...props}\n />\n );\n};\n\nexport default BurgerButton;\n","import { CopyButton, Tooltip } from \"@mantine/core\";\nimport { IconCheck, IconCopy } from \"@tabler/icons-react\";\nimport ActionButton, { type ActionCommonProps } from \"./ActionButton.tsx\";\n\nexport interface ClipboardButtonProps\n extends Omit<ActionCommonProps, \"onClick\" | \"icon\"> {\n /**\n * The value to copy to the clipboard\n */\n value: string;\n\n /**\n * Timeout in ms to show the \"Copied\" state (default: 2000)\n */\n timeout?: number;\n\n /**\n * Label to show in tooltip when not copied (default: \"Copy\")\n */\n copyLabel?: string;\n\n /**\n * Label to show in tooltip when copied (default: \"Copied\")\n */\n copiedLabel?: string;\n}\n\nconst ClipboardButton = (props: ClipboardButtonProps) => {\n const {\n value,\n timeout = 2000,\n copyLabel = \"Copy\",\n copiedLabel = \"Copied\",\n children,\n ...buttonProps\n } = props;\n\n return (\n <CopyButton value={value} timeout={timeout}>\n {({ copied, copy }) => (\n <Tooltip label={copied ? copiedLabel : copyLabel} openDelay={500}>\n <ActionButton\n color={copied ? \"teal\" : undefined}\n onClick={copy}\n icon={copied ? IconCheck : IconCopy}\n {...buttonProps}\n >\n {children}\n </ActionButton>\n </Tooltip>\n )}\n </CopyButton>\n );\n};\n\nexport default ClipboardButton;\n","import {\n Flex,\n type MantineBreakpoint,\n SegmentedControl,\n type SegmentedControlProps,\n useComputedColorScheme,\n useMantineColorScheme,\n} from \"@mantine/core\";\nimport { IconMoon, IconSun } from \"@tabler/icons-react\";\nimport { useEffect, useState } from \"react\";\nimport ActionButton, { type ActionProps } from \"./ActionButton.tsx\";\n\nexport interface DarkModeButtonProps {\n mode?: \"minimal\" | \"segmented\";\n size?: MantineBreakpoint;\n variant?:\n | \"filled\"\n | \"light\"\n | \"outline\"\n | \"default\"\n | \"subtle\"\n | \"transparent\";\n\n fullWidth?: boolean;\n\n segmentedProps?: Partial<SegmentedControlProps>;\n actionProps?: Partial<ActionProps>;\n}\n\nconst DarkModeButton = (props: DarkModeButtonProps) => {\n const { setColorScheme } = useMantineColorScheme();\n const computedColorScheme = useComputedColorScheme(\"light\");\n const [colorScheme, setColorScheme2] = useState(\"default\");\n const mode = props.mode ?? \"minimal\";\n\n useEffect(() => {\n setColorScheme2(computedColorScheme);\n }, [computedColorScheme]);\n\n const toggleColorScheme = () => {\n setColorScheme(computedColorScheme === \"dark\" ? \"light\" : \"dark\");\n };\n\n if (mode === \"segmented\") {\n return (\n <SegmentedControl\n value={colorScheme}\n onChange={(value) => setColorScheme(value as \"light\" | \"dark\")}\n data={[\n {\n value: \"light\",\n label: (\n <Flex h={20} align=\"center\" justify=\"center\">\n <IconSun size={16} />\n </Flex>\n ),\n },\n {\n value: \"dark\",\n label: (\n <Flex h={20} align=\"center\" justify=\"center\">\n <IconMoon size={16} />\n </Flex>\n ),\n },\n ]}\n w={props.fullWidth ? \"100%\" : undefined}\n {...props.segmentedProps}\n />\n );\n }\n\n return (\n <ActionButton\n onClick={toggleColorScheme}\n variant={props.variant ?? \"subtle\"}\n size={props.size ?? \"sm\"}\n aria-label=\"Toggle color scheme\"\n px={\"xs\"}\n c={colorScheme !== \"default\" ? undefined : \"transparent\"}\n fullWidth={props.fullWidth ?? false}\n icon={\n colorScheme === \"dark\"\n ? IconSun\n : colorScheme === \"light\"\n ? IconMoon\n : IconSun\n }\n {...props.actionProps}\n />\n );\n};\n\nexport default DarkModeButton;\n","import { useI18n } from \"@alepha/react/i18n\";\nimport { IconLanguage } from \"@tabler/icons-react\";\nimport ActionButton, { type ActionProps } from \"./ActionButton.tsx\";\n\nexport interface LanguageButtonProps {\n languages?: string[];\n actionProps?: ActionProps;\n}\n\nconst LanguageButton = (props: LanguageButtonProps) => {\n const i18n = useI18n();\n return (\n <ActionButton\n variant={\"default\"}\n icon={IconLanguage}\n menu={{\n items: i18n.languages.map((lang) => ({\n label: i18n.tr(lang),\n onClick: () => i18n.setLang(lang),\n active: i18n.lang === lang,\n })),\n }}\n {...props.actionProps}\n />\n );\n};\n\nexport default LanguageButton;\n","import { Flex, Kbd, Text } from \"@mantine/core\";\nimport { spotlight } from \"@mantine/spotlight\";\nimport { IconSearch } from \"@tabler/icons-react\";\nimport ActionButton, { type ActionProps } from \"./ActionButton.tsx\";\n\nexport interface OmnibarButtonProps {\n actionProps?: ActionProps;\n collapsed?: boolean;\n}\n\nconst OmnibarButton = (props: OmnibarButtonProps) => {\n return (\n <ActionButton\n variant={\"default\"}\n onClick={spotlight.open}\n justify={\"space-between\"}\n rightSection={\n <Kbd visibleFrom={\"sm\"} size={\"sm\"}>\n ⌘+K\n </Kbd>\n }\n radius={\"md\"}\n {...props.actionProps}\n >\n <Flex align={\"center\"} gap={\"xs\"}>\n <IconSearch size={16} color={\"gray\"} />\n <Flex visibleFrom={\"sm\"} miw={192}>\n <Text size={\"xs\"} c={\"dimmed\"}>\n Search...\n </Text>\n </Flex>\n </Flex>\n </ActionButton>\n );\n};\n\nexport default OmnibarButton;\n","import { useInject } from \"@alepha/react\";\nimport { IconPalette } from \"@tabler/icons-react\";\nimport { useTheme } from \"../../hooks/useTheme.ts\";\nimport { ThemeProvider } from \"../../providers/ThemeProvider.ts\";\nimport ActionButton, { type ActionProps } from \"./ActionButton.tsx\";\n\nexport interface ThemeButtonProps {\n actionProps?: Partial<ActionProps>;\n}\n\nconst ThemeButton = (props: ThemeButtonProps) => {\n const [theme, setTheme] = useTheme();\n const themes = useInject(ThemeProvider).themes;\n\n return (\n <ActionButton\n variant=\"subtle\"\n icon={IconPalette}\n menu={{\n items: themes.map((it) => ({\n label: it.label,\n onClick: () => setTheme(it),\n active: theme.id === it.id,\n })),\n }}\n {...props.actionProps}\n />\n );\n};\n\nexport default ThemeButton;\n","import {\n IconAt,\n IconCalendar,\n IconClock,\n IconColorPicker,\n IconFile,\n IconHash,\n IconKey,\n IconLetterCase,\n IconLink,\n IconList,\n IconMail,\n IconPalette,\n IconPhone,\n IconSelector,\n IconToggleLeft,\n} from \"@tabler/icons-react\";\nimport type { ReactElement } from \"react\";\nimport { ui } from \"../constants/ui.ts\";\n\nexport type IconSize = keyof typeof ui.sizes.icon;\n\n/**\n * Get the default icon for an input based on its type, format, or name.\n */\nexport const getDefaultIcon = (params: {\n type?: string;\n format?: string;\n name?: string;\n isEnum?: boolean;\n isArray?: boolean;\n size?: IconSize;\n}): ReactElement => {\n const { type, format, name, isEnum, isArray, size = \"sm\" } = params;\n const iconSize = ui.sizes.icon[size];\n\n // Format-based icons (highest priority)\n if (format) {\n switch (format) {\n case \"email\":\n return <IconMail size={iconSize} />;\n case \"url\":\n case \"uri\":\n return <IconLink size={iconSize} />;\n case \"tel\":\n case \"phone\":\n return <IconPhone size={iconSize} />;\n case \"date\":\n return <IconCalendar size={iconSize} />;\n case \"date-time\":\n return <IconCalendar size={iconSize} />;\n case \"time\":\n return <IconClock size={iconSize} />;\n case \"color\":\n return <IconColorPicker size={iconSize} />;\n case \"uuid\":\n return <IconKey size={iconSize} />;\n }\n }\n\n // Name-based icons (medium priority)\n if (name) {\n const nameLower = name.toLowerCase();\n if (nameLower.includes(\"password\") || nameLower.includes(\"secret\")) {\n return <IconKey size={iconSize} />;\n }\n if (nameLower.includes(\"email\") || nameLower.includes(\"mail\")) {\n return <IconMail size={iconSize} />;\n }\n if (nameLower.includes(\"url\") || nameLower.includes(\"link\")) {\n return <IconLink size={iconSize} />;\n }\n if (nameLower.includes(\"phone\") || nameLower.includes(\"tel\")) {\n return <IconPhone size={iconSize} />;\n }\n if (nameLower.includes(\"color\")) {\n return <IconPalette size={iconSize} />;\n }\n if (nameLower.includes(\"file\") || nameLower.includes(\"upload\")) {\n return <IconFile size={iconSize} />;\n }\n if (nameLower.includes(\"date\")) {\n return <IconCalendar size={iconSize} />;\n }\n if (nameLower.includes(\"time\")) {\n return <IconClock size={iconSize} />;\n }\n }\n\n // Type-based icons (lowest priority)\n if (isEnum || isArray) {\n return <IconSelector size={iconSize} />;\n }\n\n if (type) {\n switch (type) {\n case \"boolean\":\n return <IconToggleLeft size={iconSize} />;\n case \"number\":\n case \"integer\":\n return <IconHash size={iconSize} />;\n case \"array\":\n return <IconList size={iconSize} />;\n case \"string\":\n return <IconLetterCase size={iconSize} />;\n }\n }\n\n // Default icon\n return <IconAt size={iconSize} />;\n};\n","/**\n * Capitalizes the first letter of a string.\n *\n * @example\n * capitalize(\"hello\") // \"Hello\"\n */\nexport const capitalize = (str: string): string => {\n return str.charAt(0).toUpperCase() + str.slice(1);\n};\n\n/**\n * Converts a path or identifier string into a pretty display name.\n * Removes slashes and capitalizes the first letter.\n *\n * @example\n * prettyName(\"/userName\") // \"UserName\"\n * prettyName(\"email\") // \"Email\"\n */\nexport const prettyName = (name: string): string => {\n return capitalize(name.replaceAll(\"/\", \"\"));\n};\n","import type { InputField } from \"@alepha/react/form\";\nimport { type TObject, TypeBoxError } from \"alepha\";\nimport {\n createElement,\n isValidElement,\n type ReactElement,\n type ReactNode,\n} from \"react\";\nimport type { ControlProps } from \"../components/form/Control.tsx\";\nimport { ui } from \"../constants/ui.ts\";\nimport { getDefaultIcon } from \"./icons.tsx\";\nimport { prettyName } from \"./string.ts\";\n\nexport const parseInput = (\n props: GenericControlProps,\n form: {\n error?: Error;\n },\n): ControlInput => {\n const disabled = false; // form.loading;\n const id = props.input.props.id;\n const label =\n props.title ??\n (\"title\" in props.input.schema &&\n typeof props.input.schema.title === \"string\"\n ? props.input.schema.title\n : undefined) ??\n prettyName(props.input.path);\n const description =\n props.description ??\n (\"description\" in props.input.schema &&\n typeof props.input.schema.description === \"string\"\n ? props.input.schema.description\n : undefined);\n const error =\n form.error && form.error instanceof TypeBoxError\n ? form.error.value.message\n : undefined;\n\n // Auto-generate icon if not provided\n const icon = !props.icon\n ? getDefaultIcon({\n type:\n props.input.schema && \"type\" in props.input.schema\n ? String(props.input.schema.type)\n : undefined,\n format:\n props.input.schema &&\n \"format\" in props.input.schema &&\n typeof props.input.schema.format === \"string\"\n ? props.input.schema.format\n : undefined,\n name: props.input.props.name,\n isEnum:\n props.input.schema &&\n \"enum\" in props.input.schema &&\n Boolean(props.input.schema.enum),\n isArray:\n props.input.schema &&\n \"type\" in props.input.schema &&\n props.input.schema.type === \"array\",\n })\n : isValidElement(props.icon)\n ? props.icon\n : createElement(props.icon, { size: ui.sizes.icon.md });\n\n const format =\n props.input.schema &&\n \"format\" in props.input.schema &&\n typeof props.input.schema.format === \"string\"\n ? props.input.schema.format\n : undefined;\n\n const required = props.input.required;\n const schema = props.input.schema as TObject & { $control?: ControlProps };\n\n const inputProps: InputProps = {\n label,\n description,\n error,\n required,\n disabled,\n };\n\n if (\"minLength\" in schema && typeof schema.minLength === \"number\") {\n inputProps.minLength = schema.minLength;\n }\n if (\"maxLength\" in schema && typeof schema.maxLength === \"number\") {\n inputProps.maxLength = schema.maxLength;\n }\n if (\"minimum\" in schema && typeof schema.minimum === \"number\") {\n inputProps.minimum = schema.minimum;\n }\n if (\"maximum\" in schema && typeof schema.maximum === \"number\") {\n inputProps.maximum = schema.maximum;\n }\n\n return {\n id,\n icon,\n format,\n schema: props.input.schema as TObject & { $control?: ControlProps },\n inputProps,\n };\n};\n\nexport interface GenericControlProps {\n input: InputField;\n title?: string;\n description?: string;\n icon?: ReactElement | ((props: { size: number }) => ReactNode);\n}\n\nexport interface ControlInput {\n id?: string;\n icon: ReactElement;\n format?: string;\n schema: TObject & { $control?: ControlProps };\n inputProps: InputProps;\n}\n\nexport interface InputProps {\n label: string;\n description?: string;\n error?: string;\n required: boolean;\n disabled: boolean;\n\n minLength?: number;\n maxLength?: number;\n minimum?: number;\n maximum?: number;\n}\n","import { useFormState } from \"@alepha/react/form\";\nimport {\n DateInput,\n type DateInputProps,\n DateTimePicker,\n type DateTimePickerProps,\n TimeInput,\n type TimeInputProps,\n} from \"@mantine/dates\";\nimport {\n type GenericControlProps,\n parseInput,\n} from \"../../utils/parseInput.ts\";\n\nexport interface ControlDateProps extends GenericControlProps {\n date?: boolean | DateInputProps;\n datetime?: boolean | DateTimePickerProps;\n time?: boolean | TimeInputProps;\n}\n\n/**\n * ControlDate component for handling date, datetime, and time inputs.\n *\n * Features:\n * - DateInput for date format\n * - DateTimePicker for date-time format\n * - TimeInput for time format\n *\n * Automatically detects date formats from schema and renders appropriate picker.\n */\nconst ControlDate = (props: ControlDateProps) => {\n const form = useFormState(props.input);\n const { inputProps, id, icon, format } = parseInput(props, form);\n if (!props.input?.props) {\n return null;\n }\n\n // region <DateTimePicker/>\n if (props.datetime || format === \"date-time\") {\n const dateTimePickerProps =\n typeof props.datetime === \"object\" ? props.datetime : {};\n return (\n <DateTimePicker\n {...inputProps}\n id={id}\n leftSection={icon}\n defaultValue={\n props.input.props.defaultValue\n ? new Date(props.input.props.defaultValue)\n : undefined\n }\n onChange={(value) => {\n props.input.set(value ? new Date(value).toISOString() : undefined);\n }}\n {...dateTimePickerProps}\n />\n );\n }\n //endregion\n\n // region <DateInput/>\n if (props.date || format === \"date\") {\n const dateInputProps = typeof props.date === \"object\" ? props.date : {};\n return (\n <DateInput\n {...inputProps}\n id={id}\n leftSection={icon}\n defaultValue={\n props.input.props.defaultValue\n ? new Date(props.input.props.defaultValue)\n : undefined\n }\n onChange={(value) => {\n props.input.set(\n value ? new Date(value).toISOString().slice(0, 10) : undefined,\n );\n }}\n {...dateInputProps}\n />\n );\n }\n //endregion\n\n // region <TimeInput/>\n if (props.time || format === \"time\") {\n const timeInputProps = typeof props.time === \"object\" ? props.time : {};\n return (\n <TimeInput\n {...inputProps}\n id={id}\n leftSection={icon}\n defaultValue={props.input.props.defaultValue}\n onChange={(event) => {\n props.input.set(event.currentTarget.value);\n }}\n {...timeInputProps}\n />\n );\n }\n //endregion\n\n // Fallback - shouldn't happen\n return null;\n};\n\nexport default ControlDate;\n","import { useEvents } from \"@alepha/react\";\nimport { useFormState } from \"@alepha/react/form\";\nimport {\n Input,\n NumberInput,\n type NumberInputProps,\n Slider,\n type SliderProps,\n} from \"@mantine/core\";\nimport { useRef, useState } from \"react\";\nimport {\n type GenericControlProps,\n parseInput,\n} from \"../../utils/parseInput.ts\";\n\nexport interface ControlNumberProps extends GenericControlProps {\n numberInputProps?: Partial<NumberInputProps>;\n sliderProps?: Partial<SliderProps>;\n}\n\n/**\n *\n */\nconst ControlNumber = (props: ControlNumberProps) => {\n const form = useFormState(props.input);\n const { inputProps, id, icon } = parseInput(props, form);\n const ref = useRef<HTMLInputElement | null>(null);\n\n // HTML Reset doesn't trigger on <NumberInput /> so we handle it manually\n\n const [value, setValue] = useState<number | undefined>(\n props.input.props.defaultValue,\n );\n\n useEvents(\n {\n \"form:reset\": (event) => {\n if (event.id === props.input?.form.id && ref.current) {\n setValue(props.input.props.defaultValue);\n }\n },\n },\n [props.input],\n );\n\n if (!props.input?.props) {\n return null;\n }\n\n const { type, ...inputPropsWithoutType } = props.input.props;\n\n if (props.sliderProps) {\n return (\n <Input.Wrapper {...inputProps}>\n <div\n style={{\n height: 32,\n padding: 8,\n }}\n >\n <Slider\n {...inputProps}\n ref={ref}\n id={id}\n {...inputPropsWithoutType}\n {...props.sliderProps}\n value={value}\n onChange={(val) => {\n setValue(val);\n props.input.set(val);\n }}\n />\n </div>\n </Input.Wrapper>\n );\n }\n\n return (\n <NumberInput\n {...inputProps}\n ref={ref}\n id={id}\n leftSection={icon}\n {...inputPropsWithoutType}\n {...props.numberInputProps}\n value={value ?? \"\"}\n onChange={(val) => {\n const newValue = val !== null ? Number(val) : undefined;\n setValue(newValue);\n props.input.set(newValue);\n }}\n />\n );\n};\n\nexport default ControlNumber;\n","import type { TObject, TProperties, TSchema } from \"alepha\";\n\nexport interface SchemaField {\n name: string;\n path: string;\n type: string;\n enum?: readonly any[];\n format?: string;\n description?: string;\n nested?: SchemaField[];\n}\n\n/**\n * Extract field information from a TypeBox schema for query building.\n * Supports nested objects and provides field metadata for autocomplete.\n */\nexport function extractSchemaFields(\n schema: TObject | TProperties,\n prefix = \"\",\n): SchemaField[] {\n const fields: SchemaField[] = [];\n\n // Safety check\n if (!schema || typeof schema !== \"object\") {\n return fields;\n }\n\n // Handle TObject wrapper\n const properties =\n \"properties\" in schema ? schema.properties : (schema as TProperties);\n\n // Safety check for properties\n if (!properties || typeof properties !== \"object\") {\n return fields;\n }\n\n for (const [key, value] of Object.entries(properties)) {\n // Skip if value is not an object (type guard)\n if (typeof value !== \"object\" || value === null) {\n continue;\n }\n\n const fieldSchema = value as TSchema & {\n format?: string;\n enum?: readonly any[];\n description?: string;\n };\n\n const path = prefix ? `${prefix}.${key}` : key;\n\n // Determine the display type - use format for datetime-related fields\n const format = \"format\" in fieldSchema ? fieldSchema.format : undefined;\n const baseType =\n \"type\" in fieldSchema ? (fieldSchema.type as string) : \"object\";\n\n let displayType = baseType;\n if (format === \"date-time\") {\n displayType = \"datetime\";\n } else if (format === \"date\") {\n displayType = \"date\";\n } else if (format === \"time\") {\n displayType = \"time\";\n } else if (format === \"duration\") {\n displayType = \"duration\";\n }\n\n const field: SchemaField = {\n name: key,\n path,\n type: displayType,\n format,\n description:\n \"description\" in fieldSchema ? fieldSchema.description : undefined,\n };\n\n // Handle enum\n if (\"enum\" in fieldSchema && fieldSchema.enum) {\n field.enum = fieldSchema.enum;\n field.type = \"enum\";\n }\n\n // Handle nested objects\n if (\n \"type\" in fieldSchema &&\n fieldSchema.type === \"object\" &&\n \"properties\" in fieldSchema &&\n typeof fieldSchema.properties === \"object\"\n ) {\n field.nested = extractSchemaFields(\n fieldSchema.properties as TProperties,\n path,\n );\n }\n\n fields.push(field);\n\n // Also add nested fields to the flat list for autocomplete\n if (field.nested) {\n fields.push(...field.nested);\n }\n }\n\n return fields;\n}\n\n/**\n * Get suggested operators based on field type\n */\nexport function getOperatorsForField(field: SchemaField): string[] {\n const allOperators = [\"=\", \"!=\"];\n\n if (field.enum) {\n // Enum fields: equality and IN array\n return [...allOperators, \"in\"];\n }\n\n switch (field.type) {\n case \"string\":\n case \"text\":\n // String fields: equality and null checks (wildcards supported in = operator)\n return [...allOperators, \"null\"];\n\n case \"number\":\n case \"integer\":\n // Numeric fields: all comparison operators\n return [...allOperators, \">\", \">=\", \"<\", \"<=\"];\n\n case \"boolean\":\n // Boolean fields: only equality\n return allOperators;\n\n case \"datetime\":\n case \"date\":\n // Date fields: all comparison operators\n return [...allOperators, \">\", \">=\", \"<\", \"<=\"];\n\n default:\n return [...allOperators, \"null\"];\n }\n}\n\n/**\n * Get operator symbol and description\n */\nexport const OPERATOR_INFO: Record<\n string,\n { symbol: string; label: string; example: string }\n> = {\n eq: { symbol: \"=\", label: \"equals\", example: \"name=John\" },\n ne: { symbol: \"!=\", label: \"not equals\", example: \"status!=archived\" },\n gt: { symbol: \">\", label: \"greater than\", example: \"age>18\" },\n gte: { symbol: \">=\", label: \"greater or equal\", example: \"age>=18\" },\n lt: { symbol: \"<\", label: \"less than\", example: \"age<65\" },\n lte: { symbol: \"<=\", label: \"less or equal\", example: \"age<=65\" },\n null: { symbol: \"=null\", label: \"is null\", example: \"deletedAt=null\" },\n notNull: {\n symbol: \"!=null\",\n label: \"is not null\",\n example: \"email!=null\",\n },\n in: {\n symbol: \"[...]\",\n label: \"in array\",\n example: \"status=[active,pending]\",\n },\n};\n","import { useEvents } from \"@alepha/react\";\nimport {\n ActionIcon,\n Badge,\n Divider,\n Flex,\n Group,\n Popover,\n Stack,\n Text,\n TextInput,\n type TextInputProps,\n} from \"@mantine/core\";\nimport { IconFilter, IconInfoTriangle, IconX } from \"@tabler/icons-react\";\nimport type { TObject } from \"alepha\";\nimport { parseQueryString } from \"alepha/orm\";\nimport { useRef, useState } from \"react\";\nimport { ui } from \"../../constants/ui.ts\";\nimport {\n extractSchemaFields,\n OPERATOR_INFO,\n type SchemaField,\n} from \"../../utils/extractSchemaFields.ts\";\nimport ActionButton from \"../buttons/ActionButton.tsx\";\n\nexport interface ControlQueryBuilderProps\n extends Omit<TextInputProps, \"value\" | \"onChange\"> {\n schema?: TObject;\n value?: string;\n onChange?: (value: string) => void;\n placeholder?: string;\n}\n\n/**\n * Query builder with text input and help popover.\n * Generates query strings for parseQueryString syntax.\n */\nconst ControlQueryBuilder = ({\n schema,\n value = \"\",\n onChange,\n placeholder = \"Enter query or click for assistance...\",\n ...textInputProps\n}: ControlQueryBuilderProps) => {\n const [helpOpened, setHelpOpened] = useState(false);\n const [textValue, setTextValue] = useState(value);\n const inputRef = useRef<HTMLInputElement>(null);\n const fields = schema ? extractSchemaFields(schema) : [];\n const [error, setError] = useState<string | null>(null);\n\n const isValid = (value: string) => {\n try {\n parseQueryString(value.trim());\n } catch (e) {\n setError((e as Error).message);\n return false;\n }\n setError(null);\n return true;\n };\n\n const handleTextChange = (newValue: string) => {\n setTextValue(newValue);\n if (isValid(newValue)) {\n onChange?.(newValue);\n }\n };\n\n const handleClear = () => {\n setTextValue(\"\");\n onChange?.(\"\");\n isValid(\"\");\n };\n\n const handleInsert = (text: string) => {\n const newValue = textValue ? `${textValue}${text} ` : `${text} `;\n setTextValue(newValue);\n if (isValid(newValue)) {\n onChange?.(newValue);\n }\n // Refocus the input after inserting\n setTimeout(() => {\n inputRef.current?.focus();\n // set cursor to end\n const length = inputRef.current?.value.length || 0;\n inputRef.current?.setSelectionRange(length, length);\n }, 0);\n };\n\n useEvents(\n {\n \"form:change\": (event) => {\n if (event.id === inputRef.current?.form?.id) {\n if (event.path === (textInputProps as any)[\"data-path\"]) {\n setTextValue(event.value ?? \"\");\n }\n }\n },\n },\n [],\n );\n\n return (\n <Popover\n width={800}\n position=\"bottom-start\"\n shadow=\"md\"\n opened={helpOpened}\n onChange={setHelpOpened}\n closeOnClickOutside\n closeOnEscape\n transitionProps={{\n transition: \"fade-up\",\n duration: 200,\n timingFunction: \"ease\",\n }}\n >\n <Popover.Target>\n <TextInput\n ref={inputRef}\n placeholder={placeholder}\n value={textValue}\n onChange={(e) => handleTextChange(e.currentTarget.value)}\n onFocus={() => setHelpOpened(true)}\n leftSection={\n error ? <IconInfoTriangle size={16} /> : <IconFilter size={16} />\n }\n rightSection={\n textValue && (\n <ActionIcon\n size=\"sm\"\n variant=\"subtle\"\n color=\"gray\"\n onClick={handleClear}\n >\n <IconX size={14} />\n </ActionIcon>\n )\n }\n {...textInputProps}\n />\n </Popover.Target>\n <Popover.Dropdown\n bg={\"transparent\"}\n p={\"xs\"}\n bd={`1px solid ${ui.colors.border}`}\n style={{\n backdropFilter: \"blur(20px)\",\n }}\n >\n <QueryHelp fields={fields} onInsert={handleInsert} />\n </Popover.Dropdown>\n </Popover>\n );\n};\n\n// ---------------------------------------------------------------------------------------------------------------------\n// Query Help Component\n// ---------------------------------------------------------------------------------------------------------------------\n\ninterface QueryHelpProps {\n fields: SchemaField[];\n onInsert: (text: string) => void;\n}\n\nfunction QueryHelp({ fields, onInsert }: QueryHelpProps) {\n return (\n <Group\n gap=\"md\"\n align=\"flex-start\"\n wrap=\"nowrap\"\n bg={ui.colors.surface}\n p={\"sm\"}\n bdrs={\"sm\"}\n >\n {/* Left Column: Operators */}\n <Stack gap=\"md\" style={{ flex: 1 }}>\n {/* Available Operators */}\n <Stack gap=\"xs\">\n <Text size=\"sm\" fw={600}>\n Operators\n </Text>\n <Stack gap={4}>\n {Object.entries(OPERATOR_INFO).map(([key, info]) => (\n <Group key={key} gap=\"xs\" wrap=\"nowrap\">\n <ActionButton\n px={\"xs\"}\n size={\"xs\"}\n h={24}\n variant={\"default\"}\n justify={\"center\"}\n miw={48}\n onClick={() => onInsert(info.symbol)}\n >\n {info.symbol}\n </ActionButton>\n <Text size=\"xs\" c=\"dimmed\" style={{ flex: 1 }}>\n {info.label}\n </Text>\n </Group>\n ))}\n </Stack>\n </Stack>\n\n <Divider />\n\n {/* Logic Operators */}\n <Stack gap=\"xs\">\n <Text size=\"sm\" fw={600}>\n Logic\n </Text>\n <Stack gap={4}>\n <Group gap=\"xs\" wrap=\"nowrap\">\n <ActionButton\n px={\"xs\"}\n size={\"xs\"}\n h={24}\n variant={\"default\"}\n justify={\"center\"}\n miw={48}\n onClick={() => onInsert(\"&\")}\n >\n &\n </ActionButton>\n <Text size=\"xs\" c=\"dimmed\">\n AND\n </Text>\n </Group>\n <Group gap=\"xs\" wrap=\"nowrap\">\n <ActionButton\n px={\"xs\"}\n size={\"xs\"}\n h={24}\n variant={\"default\"}\n justify={\"center\"}\n miw={48}\n onClick={() => onInsert(\"|\")}\n >\n |\n </ActionButton>\n <Text size=\"xs\" c=\"dimmed\">\n OR\n </Text>\n </Group>\n </Stack>\n </Stack>\n </Stack>\n\n {/* Divider */}\n {fields.length > 0 && <Divider orientation=\"vertical\" />}\n\n {/* Right Column: Fields */}\n {fields.length > 0 && (\n <Flex direction={\"column\"} gap=\"xs\" style={{ flex: 2 }}>\n <Text size=\"sm\" fw={600}>\n Fields\n </Text>\n <Flex\n direction={\"column\"}\n gap={4}\n style={{ maxHeight: 300, overflowY: \"auto\" }}\n >\n {fields.map((field) => (\n <Flex key={field.path} gap=\"xs\" wrap=\"nowrap\" align=\"flex-start\">\n <ActionButton\n px={\"xs\"}\n size={\"xs\"}\n h={24}\n variant={\"default\"}\n justify={\"end\"}\n miw={120}\n onClick={() => onInsert(field.path)}\n >\n {field.path}\n </ActionButton>\n <Flex\n mt={3}\n direction={\"column\"}\n gap={2}\n style={{ flex: 1, minWidth: 0 }}\n >\n <Text size=\"xs\" c=\"dimmed\" lineClamp={1}>\n {field.description || field.type}\n </Text>\n {field.enum && (\n <Group gap={0} wrap=\"wrap\">\n {field.enum.map((enumValue) => (\n <ActionButton\n px={\"xs\"}\n size={\"xs\"}\n h={24}\n key={enumValue}\n onClick={() => onInsert(enumValue)}\n >\n {enumValue}\n </ActionButton>\n ))}\n </Group>\n )}\n </Flex>\n <Badge size=\"xs\" variant=\"light\" style={{ flexShrink: 0 }}>\n {field.type}\n </Badge>\n </Flex>\n ))}\n </Flex>\n </Flex>\n )}\n </Group>\n );\n}\n\nexport default ControlQueryBuilder;\n","import { useFormState } from \"@alepha/react/form\";\nimport {\n Autocomplete,\n type AutocompleteProps,\n Flex,\n Input,\n MultiSelect,\n type MultiSelectProps,\n SegmentedControl,\n type SegmentedControlProps,\n Select,\n type SelectProps,\n TagsInput,\n type TagsInputProps,\n} from \"@mantine/core\";\nimport { useEffect, useState } from \"react\";\nimport {\n type GenericControlProps,\n parseInput,\n} from \"../../utils/parseInput.ts\";\n\nexport type SelectValueLabel =\n | string\n | { value: string; label: string; icon?: string };\n\nexport interface ControlSelectProps extends GenericControlProps {\n select?: boolean | SelectProps;\n multi?: boolean | MultiSelectProps;\n tags?: boolean | TagsInputProps;\n autocomplete?: boolean | AutocompleteProps;\n segmented?: boolean | Partial<SegmentedControlProps>;\n\n loader?: () => Promise<SelectValueLabel[]>;\n}\n\n/**\n * ControlSelect component for handling Select, MultiSelect, and TagsInput.\n *\n * Features:\n * - Basic Select with enum support\n * - MultiSelect for array of enums\n * - TagsInput for array of strings (no enum)\n * - Future: Lazy loading\n * - Future: Searchable/filterable options\n * - Future: Custom option rendering\n *\n * Automatically detects enum values and array types from schema.\n */\nconst ControlSelect = (props: ControlSelectProps) => {\n const form = useFormState(props.input);\n const { inputProps, id, icon } = parseInput(props, form);\n\n // Detect if schema is an array type\n const isArray =\n props.input.schema &&\n \"type\" in props.input.schema &&\n props.input.schema.type === \"array\";\n\n // For arrays, check if items have enum (MultiSelect) or not (TagsInput)\n let itemsEnum: string[] | undefined;\n if (isArray && \"items\" in props.input.schema && props.input.schema.items) {\n const items: any = props.input.schema.items;\n if (\"enum\" in items && Array.isArray(items.enum)) {\n itemsEnum = items.enum;\n }\n }\n\n // Extract enum values from schema (for non-array select)\n const enumValues =\n props.input.schema &&\n \"enum\" in props.input.schema &&\n Array.isArray(props.input.schema.enum)\n ? props.input.schema.enum\n : [];\n\n const [data, setData] = useState<SelectValueLabel[]>([]);\n\n useEffect(() => {\n if (!props.input?.props) {\n return;\n }\n\n if (props.loader) {\n props.loader().then(setData);\n } else {\n setData(enumValues);\n }\n }, [props.input, props.loader]);\n\n if (!props.input?.props) {\n return null;\n }\n\n if (props.segmented) {\n const segmentedControlProps: Partial<SegmentedControlProps> =\n typeof props.segmented === \"object\" ? props.segmented : {};\n\n return (\n <Input.Wrapper {...inputProps}>\n <Flex>\n <SegmentedControl\n disabled={inputProps.disabled}\n defaultValue={String(props.input.props.defaultValue)}\n {...segmentedControlProps}\n onChange={(value) => {\n props.input.set(value);\n }}\n data={data.slice(0, 10)}\n />\n </Flex>\n </Input.Wrapper>\n );\n }\n\n if (props.autocomplete) {\n const autocompleteProps =\n typeof props.autocomplete === \"object\" ? props.autocomplete : {};\n\n return (\n <Autocomplete\n {...inputProps}\n id={id}\n leftSection={icon}\n data={data}\n {...props.input.props}\n {...autocompleteProps}\n />\n );\n }\n\n // region <TagsInput/> - for array of strings without enum\n if ((isArray && !itemsEnum) || props.tags) {\n const tagsInputProps = typeof props.tags === \"object\" ? props.tags : {};\n return (\n <TagsInput\n {...inputProps}\n id={id}\n leftSection={icon}\n defaultValue={\n Array.isArray(props.input.props.defaultValue)\n ? props.input.props.defaultValue\n : []\n }\n onChange={(value) => {\n props.input.set(value);\n }}\n {...tagsInputProps}\n />\n );\n }\n // endregion\n\n // region <MultiSelect/> - for array of enums\n if ((isArray && itemsEnum) || props.multi) {\n const data =\n itemsEnum?.map((value: string) => ({\n value,\n label: value,\n })) || [];\n\n const multiSelectProps = typeof props.multi === \"object\" ? props.multi : {};\n\n return (\n <MultiSelect\n {...inputProps}\n id={id}\n leftSection={icon}\n data={data}\n defaultValue={\n Array.isArray(props.input.props.defaultValue)\n ? props.input.props.defaultValue\n : []\n }\n onChange={(value) => {\n props.input.set(value);\n }}\n {...multiSelectProps}\n />\n );\n }\n // endregion\n\n // region <Select/> - for single enum value\n const selectProps = typeof props.select === \"object\" ? props.select : {};\n\n return (\n <Select\n {...inputProps}\n id={id}\n leftSection={icon}\n data={data}\n {...props.input.props}\n {...selectProps}\n />\n );\n // endregion\n};\n\nexport default ControlSelect;\n","import { useFormState } from \"@alepha/react/form\";\nimport {\n ColorInput,\n type ColorInputProps,\n FileInput,\n type FileInputProps,\n Flex,\n Input,\n PasswordInput,\n type PasswordInputProps,\n Switch,\n type SwitchProps,\n Textarea,\n type TextareaProps,\n TextInput,\n type TextInputProps,\n} from \"@mantine/core\";\nimport type {\n DateInputProps,\n DateTimePickerProps,\n TimeInputProps,\n} from \"@mantine/dates\";\nimport type { ComponentType } from \"react\";\nimport {\n type GenericControlProps,\n parseInput,\n} from \"../../utils/parseInput.ts\";\nimport ControlDate from \"./ControlDate.tsx\";\nimport ControlNumber, { type ControlNumberProps } from \"./ControlNumber.tsx\";\nimport ControlQueryBuilder from \"./ControlQueryBuilder.tsx\";\nimport ControlSelect, { type ControlSelectProps } from \"./ControlSelect.tsx\";\n\nexport interface ControlProps extends GenericControlProps {\n text?: TextInputProps;\n area?: boolean | TextareaProps;\n select?: boolean | Partial<ControlSelectProps>;\n password?: boolean | PasswordInputProps;\n switch?: boolean | SwitchProps;\n number?: boolean | Partial<ControlNumberProps>;\n file?: boolean | FileInputProps;\n color?: boolean | ColorInputProps;\n date?: boolean | DateInputProps;\n datetime?: boolean | DateTimePickerProps;\n time?: boolean | TimeInputProps;\n query?: any; // Enable query builder mode with schema-aware autocomplete\n custom?: ComponentType<CustomControlProps>;\n}\n\n/**\n * Generic form control that renders the appropriate input based on the schema and props.\n *\n * Supports:\n * - TextInput (with format detection: email, url, tel)\n * - Textarea\n * - NumberInput (for number/integer types)\n * - FileInput\n * - ColorInput (for color format)\n * - Select (for enum types)\n * - Autocomplete\n * - PasswordInput\n * - Switch (for boolean types)\n * - SegmentedControl (for enum types)\n * - DateInput (for date format)\n * - DateTimePicker (for date-time format)\n * - TimeInput (for time format)\n * - QueryBuilder (for building type-safe queries with autocomplete)\n * - Custom component\n *\n * Automatically handles labels, descriptions, error messages, required state, and default icons.\n */\nconst Control = (_props: ControlProps) => {\n const form = useFormState(_props.input, [\"error\"]);\n const { inputProps, id, icon, format, schema } = parseInput(_props, form);\n if (!_props.input?.props) {\n return null;\n }\n\n const props = {\n ..._props,\n ...schema.$control,\n };\n\n //region <QueryBuilder/>\n if (props.query) {\n return (\n <ControlQueryBuilder\n {...props.input.props}\n {...inputProps}\n schema={props.query}\n value={props.input.props.value}\n onChange={(value) => {\n props.input.set(value);\n }}\n />\n );\n }\n //endregion\n\n //region <Custom/>\n if (props.custom) {\n const Custom = props.custom;\n return (\n <Input.Wrapper {...inputProps}>\n <Flex flex={1} mt={\"calc(var(--mantine-spacing-xs) / 2)\"}>\n <Custom\n defaultValue={props.input.props.defaultValue}\n onChange={(value) => {\n props.input.set(value);\n }}\n />\n </Flex>\n </Input.Wrapper>\n );\n }\n //endregion\n\n //region <NumberInput/>\n if (\n props.number ||\n (props.input.schema &&\n \"type\" in props.input.schema &&\n (props.input.schema.type === \"number\" ||\n props.input.schema.type === \"integer\"))\n ) {\n const controlNumberProps =\n typeof props.number === \"object\" ? props.number : {};\n return (\n <ControlNumber\n input={props.input}\n title={props.title}\n description={props.description}\n icon={icon}\n {...controlNumberProps}\n />\n );\n }\n //endregion\n\n //region <FileInput/>\n if (props.file) {\n const fileInputProps = typeof props.file === \"object\" ? props.file : {};\n return (\n <FileInput\n {...inputProps}\n id={id}\n leftSection={icon}\n onChange={(file) => {\n props.input.set(file);\n }}\n {...fileInputProps}\n />\n );\n }\n //endregion\n\n //region <ColorInput/>\n if (props.color || format === \"color\") {\n const colorInputProps = typeof props.color === \"object\" ? props.color : {};\n return (\n <ColorInput\n {...inputProps}\n id={id}\n leftSection={icon}\n {...props.input.props}\n {...colorInputProps}\n />\n );\n }\n //endregion\n\n //region <ControlSelect/>\n // Handle: single enum, array of enum, array of strings, or explicit select/multi/tags props\n const isEnum =\n props.input.schema &&\n \"enum\" in props.input.schema &&\n props.input.schema.enum;\n const isArray =\n props.input.schema &&\n \"type\" in props.input.schema &&\n props.input.schema.type === \"array\";\n\n if (isEnum || isArray || props.select) {\n const opts = typeof props.select === \"object\" ? props.select : {};\n return (\n <ControlSelect\n input={props.input}\n title={props.title}\n description={props.description}\n icon={icon}\n {...opts}\n />\n );\n }\n //endregion\n\n //region <Switch/>\n if (\n (props.input.schema &&\n \"type\" in props.input.schema &&\n props.input.schema.type === \"boolean\") ||\n props.switch\n ) {\n const switchProps = typeof props.switch === \"object\" ? props.switch : {};\n\n return (\n <Switch\n {...inputProps}\n id={id}\n color={\"blue\"}\n defaultChecked={props.input.props.defaultValue}\n {...props.input.props}\n {...switchProps}\n />\n );\n }\n //endregion\n\n //region <PasswordInput/>\n if (props.password || props.input.props.name?.includes(\"password\")) {\n const passwordInputProps =\n typeof props.password === \"object\" ? props.password : {};\n return (\n <PasswordInput\n {...inputProps}\n id={id}\n leftSection={icon}\n {...props.input.props}\n {...passwordInputProps}\n />\n );\n }\n //endregion\n\n //region <Textarea/>\n if (props.area) {\n const textAreaProps = typeof props.area === \"object\" ? props.area : {};\n return (\n <Textarea\n {...inputProps}\n id={id}\n leftSection={icon}\n {...props.input.props}\n {...textAreaProps}\n />\n );\n }\n //endregion\n\n //region <ControlDate/>\n // Handle: date, date-time, and time formats\n if (\n props.date ||\n props.datetime ||\n props.time ||\n format === \"date\" ||\n format === \"date-time\" ||\n format === \"time\"\n ) {\n return (\n <ControlDate\n input={props.input}\n title={props.title}\n description={props.description}\n icon={icon}\n date={props.date}\n datetime={props.datetime}\n time={props.time}\n />\n );\n }\n //endregion\n\n //region <TextInput/> with format detection\n const textInputProps = typeof props.text === \"object\" ? props.text : {};\n\n // Detect HTML5 input type from format\n const getInputType = (): string | undefined => {\n switch (format) {\n case \"email\":\n return \"email\";\n case \"url\":\n case \"uri\":\n return \"url\";\n case \"tel\":\n case \"phone\":\n return \"tel\";\n default:\n return undefined;\n }\n };\n\n return (\n <TextInput\n {...inputProps}\n id={id}\n leftSection={icon}\n type={getInputType()}\n {...props.input.props}\n {...textInputProps}\n inputWrapperOrder={[\"label\", \"input\", \"description\", \"error\"]}\n />\n );\n //endregion\n};\n\nexport default Control;\n\nexport type CustomControlProps = {\n defaultValue: any;\n onChange: (value: any) => void;\n};\n","import type { FormModel } from \"@alepha/react/form\";\nimport { Flex, Grid } from \"@mantine/core\";\nimport type { TObject } from \"alepha\";\nimport type { ReactNode } from \"react\";\nimport ActionButton, {\n type ActionSubmitButtonProps,\n} from \"../buttons/ActionButton.tsx\";\nimport Control, { type ControlProps } from \"./Control.tsx\";\n\nexport interface TypeFormProps<T extends TObject> {\n form: FormModel<T>;\n columns?:\n | number\n | {\n base?: number;\n xs?: number;\n sm?: number;\n md?: number;\n lg?: number;\n xl?: number;\n };\n schema?: TObject;\n children?: (input: FormModel<T>[\"input\"]) => ReactNode;\n controlProps?: Partial<Omit<ControlProps, \"input\">>;\n skipFormElement?: boolean;\n skipSubmitButton?: boolean;\n submitButtonProps?: Partial<Omit<ActionSubmitButtonProps, \"form\">>;\n resetButtonProps?: Partial<Omit<ActionSubmitButtonProps, \"form\">>;\n}\n\n/**\n * TypeForm component that automatically renders all form inputs based on schema.\n * Uses the Control component to render individual fields and Mantine Grid for responsive layout.\n *\n * @example\n * ```tsx\n * import { t } from \"alepha\";\n * import { useForm } from \"@alepha/react/form\";\n * import { TypeForm } from \"@alepha/ui\";\n *\n * const form = useForm({\n * schema: t.object({\n * username: t.text(),\n * email: t.text(),\n * age: t.integer(),\n * subscribe: t.boolean(),\n * }),\n * handler: (values) => {\n * console.log(values);\n * },\n * });\n *\n * return <TypeForm form={form} columns={2} />;\n * ```\n */\nconst TypeForm = <T extends TObject>(props: TypeFormProps<T>) => {\n const {\n form,\n columns = 3,\n children,\n controlProps,\n skipFormElement = false,\n skipSubmitButton = false,\n submitButtonProps,\n } = props;\n\n const schema = props.schema || form.options.schema;\n if (!schema?.properties) {\n return null;\n }\n\n const fieldNames = Object.keys(schema.properties);\n\n // Filter out unsupported field types (objects only, arrays are now supported)\n const supportedFields = fieldNames.filter((fieldName) => {\n const field = form.input[fieldName as keyof typeof form.input];\n if (!field || typeof field !== \"object\" || !(\"schema\" in field)) {\n return false;\n }\n\n const schema: any = field.schema;\n\n // Skip if it's an object (not supported by Control)\n // Arrays are now supported via ControlSelect (MultiSelect/TagsInput)\n if (\"type\" in schema) {\n if (schema.type === \"object\") {\n return false;\n }\n }\n\n // Check if it has properties (nested object)\n if (\"properties\" in schema && schema.properties) {\n return false;\n }\n\n return true;\n });\n\n // Handle column configuration with defaults: xs=1, sm=2, lg=3\n const colSpan =\n typeof columns === \"number\"\n ? {\n xs: 12,\n sm: 6,\n lg: 12 / columns,\n }\n : {\n base: columns.base ? 12 / columns.base : undefined,\n xs: columns.xs ? 12 / columns.xs : 12,\n sm: columns.sm ? 12 / columns.sm : 6,\n md: columns.md ? 12 / columns.md : undefined,\n lg: columns.lg ? 12 / columns.lg : 4,\n xl: columns.xl ? 12 / columns.xl : undefined,\n };\n\n const renderFields = () => {\n if (children) {\n return <>{children(form.input)}</>;\n }\n\n return (\n <Grid>\n {supportedFields.map((fieldName) => {\n const field = form.input[fieldName as keyof typeof form.input];\n\n // Type guard to ensure field has the expected structure\n if (!field || typeof field !== \"object\" || !(\"schema\" in field)) {\n return null;\n }\n\n return (\n <Grid.Col key={fieldName} span={colSpan}>\n <Control input={field as any} {...controlProps} />\n </Grid.Col>\n );\n })}\n </Grid>\n );\n };\n\n const content = (\n <Flex direction={\"column\"} gap={\"sm\"}>\n {renderFields()}\n {!skipSubmitButton && (\n <Flex gap={\"sm\"}>\n <ActionButton form={form} {...submitButtonProps}>\n {submitButtonProps?.children ?? \"Submit\"}\n </ActionButton>\n <ActionButton type={\"reset\"}>Reset</ActionButton>\n </Flex>\n )}\n </Flex>\n );\n\n if (skipFormElement) {\n return content;\n }\n\n return <form {...form.props}>{content}</form>;\n};\n\nexport default TypeForm;\n","import { Divider, Flex, type FlexProps } from \"@mantine/core\";\nimport type { ReactNode } from \"react\";\nimport BurgerButton from \"../buttons/BurgerButton.tsx\";\nimport DarkModeButton, {\n type DarkModeButtonProps,\n} from \"../buttons/DarkModeButton.tsx\";\nimport LanguageButton, {\n type LanguageButtonProps,\n} from \"../buttons/LanguageButton.tsx\";\nimport OmnibarButton, {\n type OmnibarButtonProps,\n} from \"../buttons/OmnibarButton.tsx\";\n\nexport type AppBarItem =\n | AppBarElement\n | AppBarBurger\n | AppBarDark\n | AppBarSearch\n | AppBarLang\n | AppBarSpacer\n | AppBarDivider;\n\nexport interface AppBarElement {\n position: \"left\" | \"center\" | \"right\";\n element: ReactNode;\n}\n\nexport interface AppBarBurger {\n position: \"left\" | \"center\" | \"right\";\n type: \"burger\";\n}\n\nexport interface AppBarDark {\n position: \"left\" | \"center\" | \"right\";\n type: \"dark\";\n props?: DarkModeButtonProps;\n}\n\nexport interface AppBarSearch {\n position: \"left\" | \"center\" | \"right\";\n type: \"search\";\n props?: OmnibarButtonProps;\n}\n\nexport interface AppBarLang {\n position: \"left\" | \"center\" | \"right\";\n type: \"lang\";\n props?: LanguageButtonProps;\n}\n\nexport interface AppBarSpacer {\n position: \"left\" | \"center\" | \"right\";\n type: \"spacer\";\n}\n\nexport interface AppBarDivider {\n position: \"left\" | \"center\" | \"right\";\n type: \"divider\";\n}\n\nexport interface AppBarProps {\n flexProps?: FlexProps;\n items?: AppBarItem[];\n}\n\nconst AppBar = (props: AppBarProps) => {\n const { items = [] } = props;\n\n const renderItem = (item: AppBarItem, index: number) => {\n if (\"type\" in item) {\n if (item.type === \"burger\") {\n return <BurgerButton key={index} />;\n }\n if (item.type === \"dark\") {\n return <DarkModeButton key={index} {...item.props} />;\n }\n if (item.type === \"search\") {\n return <OmnibarButton key={index} {...item.props} />;\n }\n if (item.type === \"lang\") {\n return <LanguageButton key={index} {...item.props} />;\n }\n if (item.type === \"spacer\") {\n return <Flex key={index} w={16} />;\n }\n if (item.type === \"divider\") {\n return <Divider key={index} orientation=\"vertical\" />;\n }\n }\n if (\"element\" in item) {\n return item.element;\n }\n return null;\n };\n\n const leftItems = items.filter((item) => item.position === \"left\");\n const centerItems = items.filter((item) => item.position === \"center\");\n const rightItems = items.filter((item) => item.position === \"right\");\n\n return (\n <Flex\n h=\"100%\"\n align=\"center\"\n px=\"md\"\n justify=\"space-between\"\n {...props.flexProps}\n >\n <Flex flex={1}>\n {leftItems.map((item, index) => (\n <Flex key={index} ml={index === 0 ? 0 : \"md\"} align=\"center\">\n {renderItem(item, index)}\n </Flex>\n ))}\n </Flex>\n <Flex>\n {centerItems.map((item, index) => (\n <Flex key={index} mx=\"md\" align=\"center\">\n {renderItem(item, index)}\n </Flex>\n ))}\n </Flex>\n <Flex flex={1} align={\"center\"} justify={\"end\"}>\n {rightItems.map((item, index) => (\n <Flex key={index} ml={index === 0 ? 0 : \"md\"} align=\"center\">\n {renderItem(item, index)}\n </Flex>\n ))}\n </Flex>\n </Flex>\n );\n};\n\nexport default AppBar;\n","import { useEvents, useRouter } from \"@alepha/react\";\nimport {\n Flex,\n type FlexProps,\n type MantineBreakpoint,\n Text,\n} from \"@mantine/core\";\nimport {\n IconChevronDown,\n IconChevronRight,\n IconSquareRounded,\n} from \"@tabler/icons-react\";\nimport {\n type ComponentType,\n type ReactNode,\n useCallback,\n useState,\n} from \"react\";\nimport ActionButton, {\n type ActionProps,\n renderIcon,\n} from \"../buttons/ActionButton.tsx\";\nimport OmnibarButton from \"../buttons/OmnibarButton.tsx\";\n\nexport interface SidebarProps {\n menu?: SidebarNode[];\n top?: SidebarNode[];\n bottom?: SidebarNode[];\n onItemClick?: (item: SidebarMenuItem) => void;\n onSearchClick?: () => void;\n theme?: SidebarTheme;\n flexProps?: Partial<FlexProps>;\n collapsed?: boolean;\n gap?: MantineBreakpoint;\n hide?: {\n paths?: string[];\n };\n}\n\nexport const Sidebar = (props: SidebarProps) => {\n const router = useRouter();\n const { top = [], bottom = [], onItemClick } = props;\n\n const renderNode = (item: SidebarNode, key: number) => {\n if (\"type\" in item) {\n if (item.type === \"spacer\") {\n return <Flex key={key} h={16} />;\n }\n\n if (item.type === \"divider\") {\n return (\n <Flex\n key={key}\n h={1}\n bg={\"var(--alepha-border)\"}\n my={\"md\"}\n mx={\"sm\"}\n />\n );\n }\n\n if (item.type === \"search\") {\n return <OmnibarButton collapsed={props.collapsed} key={key} />;\n }\n\n if (item.type === \"section\") {\n if (props.collapsed) return;\n return (\n <Flex key={key} mt={\"md\"} mb={\"xs\"} align={\"center\"} gap={\"xs\"}>\n {renderIcon(item.icon)}\n <Text\n key={key}\n size={\"xs\"}\n c={\"dimmed\"}\n tt={\"uppercase\"}\n fw={\"bold\"}\n >\n {item.label}\n </Text>\n </Flex>\n );\n }\n }\n\n if (\"element\" in item) {\n return <Flex key={key}>{item.element}</Flex>;\n }\n\n // Check visibility control\n if (item.can && !item.can()) {\n return null;\n }\n\n if (props.collapsed) {\n return (\n <SidebarCollapsedItem\n key={key}\n item={item}\n level={0}\n onItemClick={onItemClick}\n theme={props.theme ?? {}}\n />\n );\n }\n\n return (\n <SidebarItem\n key={key}\n item={item}\n level={0}\n onItemClick={onItemClick}\n theme={props.theme ?? {}}\n />\n );\n };\n\n const padding = \"md\";\n const gap = props.gap;\n const menu =\n props.menu ??\n (router.concretePages.map((page) => ({\n label: page.label ?? page.name,\n description: page.description,\n icon: renderIcon(page.icon),\n href: router.path(page.name),\n })) as SidebarMenuItem[]);\n\n return (\n <Flex\n flex={1}\n py={padding}\n direction={\"column\"}\n className={\"overflow-auto\"}\n {...props.flexProps}\n >\n <Flex gap={gap} px={padding} direction={\"column\"}>\n {top.map((item, index) => renderNode(item, index))}\n {menu\n .filter((it) => it.position === \"top\")\n .map((item, index) => renderNode(item, index + top.length))}\n </Flex>\n <Flex\n gap={gap}\n px={padding}\n direction={\"column\"}\n flex={1}\n className={\"overflow-auto\"}\n >\n {menu\n .filter((it) => !it.position)\n .map((item, index) => renderNode(item, index))}\n </Flex>\n <Flex gap={gap} px={padding} direction={\"column\"}>\n {bottom.map((item, index) => renderNode(item, index))}\n {menu\n .filter((it) => it.position === \"bottom\")\n .map((item, index) => renderNode(item, index + bottom.length))}\n </Flex>\n </Flex>\n );\n};\n\n// ---------------------------------------------------------------------------------------------------------------------\n\nexport interface SidebarItemProps {\n item: SidebarMenuItem;\n level: number;\n onItemClick?: (item: SidebarMenuItem) => void;\n theme: SidebarTheme;\n}\n\nexport const SidebarItem = (props: SidebarItemProps) => {\n const { item, level } = props;\n const maxLevel = 2; // 0, 1, 2 = 3 levels total\n\n const router = useRouter();\n const isActive = useCallback((item: SidebarMenuItem): boolean => {\n if (!item.children) return false;\n for (const child of item.children) {\n if (child.href) {\n if (router.isActive(child.href)) {\n return true;\n }\n }\n if (isActive(child)) {\n return true;\n }\n }\n return false;\n }, []);\n\n const [isOpen, setIsOpen] = useState<boolean>(isActive(item));\n\n useEvents(\n {\n \"react:transition:end\": () => {\n // recalculate open state on transition end to ensure correct state after navigation\n if (isActive(item)) {\n setIsOpen(true);\n }\n },\n },\n [],\n );\n\n if (level > maxLevel) return null;\n\n const handleItemClick = (e: MouseEvent) => {\n if (!props.item.target) {\n e.preventDefault();\n }\n if (item.children && item.children.length > 0) {\n setIsOpen(!isOpen);\n } else {\n props.onItemClick?.(item);\n item.onClick?.();\n }\n };\n\n return (\n <Flex direction={\"column\"} ps={level === 0 ? 0 : 32} pos={\"relative\"}>\n <ActionButton\n w={\"100%\"}\n justify=\"space-between\"\n href={props.item.href}\n target={props.item.target}\n size={\n props.item.theme?.size ??\n props.theme.button?.size ??\n (level === 0 ? \"sm\" : \"xs\")\n }\n color={\"var(--alepha-text)\"}\n variant={\"subtle\"}\n variantActive={\"default\"}\n radius={props.item.theme?.radius ?? props.theme.button?.radius ?? \"md\"}\n onClick={handleItemClick}\n leftSection={\n <Flex w={\"100%\"} align=\"center\" gap={\"sm\"}>\n {renderIcon(item.icon)}\n <Flex direction={\"column\"}>\n <Flex>{item.label}</Flex>\n {item.description && (\n <Text size={\"xs\"} c={\"dimmed\"}>\n {item.description}\n </Text>\n )}\n </Flex>\n </Flex>\n }\n rightSection={\n item.children ? (\n <Flex>\n {isOpen ? (\n <IconChevronDown size={14} />\n ) : (\n <IconChevronRight size={14} />\n )}\n </Flex>\n ) : (\n props.item.rightSection\n )\n }\n {...props.item.actionProps}\n />\n\n {item.children && isOpen && (\n <Flex direction={\"column\"} data-parent-level={level}>\n <Flex\n style={{\n position: \"absolute\",\n width: 1,\n background:\n \"linear-gradient(to bottom, transparent, var(--alepha-border), transparent)\",\n top: 48,\n left: 20 + 32 * level,\n bottom: 16,\n }}\n />\n {item.children\n .filter((child) => !child.can || child.can())\n .map((child, index) => (\n <SidebarItem\n key={index}\n item={child}\n level={level + 1}\n onItemClick={props.onItemClick}\n theme={props.theme}\n />\n ))}\n </Flex>\n )}\n </Flex>\n );\n};\n\n// ---------------------------------------------------------------------------------------------------------------------\n\nexport interface SidebarItemProps {\n item: SidebarMenuItem;\n level: number;\n onItemClick?: (item: SidebarMenuItem) => void;\n theme: SidebarTheme;\n}\n\nconst SidebarCollapsedItem = (props: SidebarItemProps) => {\n const { item, level } = props;\n\n const router = useRouter();\n const isActive = useCallback((item: SidebarMenuItem): boolean => {\n if (!item.children) return false;\n for (const child of item.children) {\n if (child.href) {\n if (router.isActive(child.href)) {\n return true;\n }\n }\n if (isActive(child)) {\n return true;\n }\n }\n return false;\n }, []);\n\n const [isOpen, setIsOpen] = useState<boolean>(isActive(item));\n\n const handleItemClick = (e: MouseEvent) => {\n if (!props.item.target) {\n e.preventDefault();\n }\n if (item.children && item.children.length > 0) {\n setIsOpen(!isOpen);\n } else {\n props.onItemClick?.(item);\n item.onClick?.();\n }\n };\n\n return (\n <ActionButton\n size={\n props.item.theme?.size ??\n props.theme.button?.size ??\n (level === 0 ? \"sm\" : \"xs\")\n }\n color={\"var(--alepha-text)\"}\n variant={\"subtle\"}\n variantActive={\"default\"}\n tooltip={\n item.children\n ? undefined\n : {\n label: item.label,\n position: \"right\",\n }\n }\n radius={props.item.theme?.radius ?? props.theme.button?.radius ?? \"md\"}\n onClick={handleItemClick}\n icon={renderIcon(item.icon) ?? <IconSquareRounded />}\n href={props.item.href as any}\n target={props.item.target}\n menu={\n item.children\n ? ({\n position: \"right\",\n on: \"hover\",\n items: item.children\n .filter((child) => !child.can || child.can())\n .map((child) => ({\n label: child.label,\n href: child.href,\n icon: renderIcon(child.icon),\n children: child.children?.filter((c) => !c.can || c.can()),\n })),\n } as any)\n : undefined\n }\n {...props.item.actionProps}\n />\n );\n};\n\n// ---------------------------------------------------------------------------------------------------------------------\n\nexport type SidebarNode =\n | SidebarMenuItem\n | SidebarSpacer\n | SidebarDivider\n | SidebarSearch\n | SidebarElement\n | SidebarSection;\n\nexport interface SidebarAbstractItem {\n position?: \"top\" | \"bottom\";\n}\n\nexport interface SidebarElement extends SidebarAbstractItem {\n element: ReactNode;\n}\n\nexport interface SidebarSpacer extends SidebarAbstractItem {\n type: \"spacer\";\n}\n\nexport interface SidebarDivider extends SidebarAbstractItem {\n type: \"divider\";\n}\n\nexport interface SidebarSearch extends SidebarAbstractItem {\n type: \"search\";\n}\n\nexport interface SidebarSection extends SidebarAbstractItem {\n type: \"section\";\n label: string;\n icon?: ReactNode | ComponentType;\n}\n\nexport interface SidebarMenuItem extends SidebarAbstractItem {\n label: string | ReactNode;\n description?: string;\n icon?: ReactNode | ComponentType;\n href?: string;\n target?: \"_blank\" | \"_self\" | \"_parent\" | \"_top\";\n activeStartsWith?: boolean; // Use startWith matching for active state\n onClick?: () => void;\n children?: SidebarMenuItem[];\n rightSection?: ReactNode;\n theme?: SidebarButtonTheme;\n actionProps?: ActionProps;\n can?: () => boolean; // Visibility control: true -> visible, false -> hidden\n}\n\nexport interface SidebarButtonTheme {\n radius?: MantineBreakpoint;\n size?: MantineBreakpoint;\n}\n\nexport interface SidebarTheme {\n button?: SidebarButtonTheme;\n search?: SidebarButtonTheme;\n}\n","import { NestedView, useEvents, useRouter, useStore } from \"@alepha/react\";\nimport {\n AppShell,\n type AppShellFooterProps,\n type AppShellHeaderProps,\n type AppShellMainProps,\n type AppShellNavbarProps,\n type AppShellProps,\n} from \"@mantine/core\";\nimport { type ReactNode, useState } from \"react\";\nimport { ui } from \"../../constants/ui.ts\";\nimport AppBar, { type AppBarProps } from \"./AppBar.tsx\";\nimport { Sidebar, type SidebarProps } from \"./Sidebar.tsx\";\n\nexport interface AdminShellProps {\n appShellProps?: Partial<AppShellProps>;\n appShellMainProps?: Partial<AppShellMainProps>;\n appShellHeaderProps?: Partial<AppShellHeaderProps>;\n appShellNavbarProps?: Partial<AppShellNavbarProps>;\n appShellFooterProps?: Partial<AppShellFooterProps>;\n sidebarProps?: Partial<SidebarProps>;\n appBarProps?: Partial<AppBarProps>;\n header?: ReactNode;\n footer?: ReactNode;\n children?: ReactNode;\n\n noSidebarWhen?: {\n /**\n * Paths where the sidebar should be hidden.\n */\n paths?: string[];\n };\n}\n\ndeclare module \"alepha\" {\n interface State {\n /**\n * Whether the sidebar is opened or closed.\n */\n \"alepha.ui.sidebar.opened\"?: boolean;\n\n /**\n * Whether the sidebar is collapsed (narrow) or expanded (wide).\n */\n \"alepha.ui.sidebar.collapsed\"?: boolean;\n }\n}\n\nconst AdminShell = (props: AdminShellProps) => {\n const router = useRouter();\n const [opened, setOpened] = useStore(\"alepha.ui.sidebar.opened\");\n const [collapsed] = useStore(\n \"alepha.ui.sidebar.collapsed\",\n props.sidebarProps?.collapsed,\n );\n\n const shouldShowSidebar = () => {\n if (props.noSidebarWhen?.paths) {\n for (const path of props.noSidebarWhen.paths) {\n if (\n router.isActive(path, {\n startWith: true,\n })\n ) {\n return false;\n }\n }\n }\n return true;\n };\n\n const [showSidebar, setShowSidebar] = useState(shouldShowSidebar());\n\n useEvents(\n {\n \"react:transition:end\": () => {\n setShowSidebar(shouldShowSidebar());\n },\n \"react:transition:begin\": () => {\n setOpened(false);\n },\n },\n [],\n );\n\n // Default AppBar items with burger button on the left\n const defaultAppBarItems = [\n { position: \"left\" as const, type: \"burger\" as const },\n ];\n\n const hasSidebar = showSidebar && props.sidebarProps !== undefined;\n const hasAppBar = hasSidebar || props.appBarProps || props.header;\n\n return (\n <AppShell\n w={\"100%\"}\n flex={1}\n padding=\"md\"\n header={hasAppBar ? { height: 60 } : undefined}\n navbar={\n hasSidebar\n ? {\n width: collapsed ? { base: 78 } : { base: 300 },\n breakpoint: \"sm\",\n collapsed: { mobile: !opened },\n }\n : undefined\n }\n footer={props.footer ? { height: 24 } : undefined}\n {...props.appShellProps}\n >\n <AppShell.Header bg={ui.colors.surface} {...props.appShellHeaderProps}>\n {props.header ?? (\n <AppBar items={defaultAppBarItems} {...props.appBarProps} />\n )}\n </AppShell.Header>\n\n {hasSidebar && (\n <AppShell.Navbar bg={ui.colors.surface} {...props.appShellNavbarProps}>\n <Sidebar collapsed={collapsed} {...(props.sidebarProps ?? {})} />\n </AppShell.Navbar>\n )}\n\n <AppShell.Main display={\"flex\"} flex={1} {...props.appShellMainProps}>\n {props.children ?? <NestedView />}\n </AppShell.Main>\n\n {props.footer && (\n <AppShell.Footer bg={ui.colors.surface} {...props.appShellFooterProps}>\n {props.footer}\n </AppShell.Footer>\n )}\n </AppShell>\n );\n};\n\nexport default AdminShell;\n","import { useInject } from \"@alepha/react\";\nimport { type FormModel, useForm } from \"@alepha/react/form\";\nimport {\n Card,\n Flex,\n Pagination,\n Select,\n Table,\n type TableProps,\n type TableTrProps,\n} from \"@mantine/core\";\nimport { useDebouncedCallback } from \"@mantine/hooks\";\nimport {\n Alepha,\n type Async,\n type Page,\n type PageMetadata,\n type Static,\n type TObject,\n t,\n} from \"alepha\";\nimport { DateTimeProvider, type DurationLike } from \"alepha/datetime\";\nimport { type ReactNode, useEffect, useState } from \"react\";\nimport { ui } from \"../../constants/ui.ts\";\nimport ActionButton from \"../buttons/ActionButton.tsx\";\nimport TypeForm, { type TypeFormProps } from \"../form/TypeForm.tsx\";\n\nexport interface DataTableColumnContext<Filters extends TObject> {\n index: number;\n form: FormModel<Filters>;\n alepha: Alepha;\n}\n\nexport interface DataTableColumn<T extends object, Filters extends TObject> {\n label: string;\n value: (item: T, ctx: DataTableColumnContext<Filters>) => ReactNode;\n fit?: boolean;\n}\n\nexport type MaybePage<T> = Omit<Page<T>, \"page\"> & {\n page?: Partial<PageMetadata>;\n};\n\nexport interface DataTableSubmitContext<T extends object> {\n items: T[];\n}\n\nexport interface DataTableProps<T extends object, Filters extends TObject> {\n /**\n * The items to display in the table. Can be a static page of items or a function that returns a promise resolving to a page of items.\n */\n items:\n | MaybePage<T>\n | ((\n filters: Static<Filters> & {\n page: number;\n size: number;\n sort?: string;\n },\n ctx: DataTableSubmitContext<T>,\n ) => Async<MaybePage<T>>);\n\n /**\n * The columns to display in the table. Each column is defined by a key and a DataTableColumn object.\n */\n columns: {\n [key: string]: DataTableColumn<T, Filters>;\n };\n\n defaultSize?: number;\n\n typeFormProps?: Partial<Omit<TypeFormProps<Filters>, \"form\">>;\n\n onFilterChange?: (\n key: string,\n value: unknown,\n form: FormModel<Filters>,\n ) => void;\n\n /**\n * Optional filters to apply to the data.\n */\n filters?: TObject;\n\n panel?: (item: T) => ReactNode;\n canPanel?: (item: T) => boolean;\n\n submitOnInit?: boolean;\n submitEvery?: DurationLike;\n\n withLineNumbers?: boolean;\n withCheckbox?: boolean;\n checkboxActions?: any[];\n\n actions?: any[];\n\n /**\n * Enable infinity scroll mode. When true, pagination controls are hidden and new items are loaded automatically when scrolling to the bottom.\n */\n infinityScroll?: boolean;\n\n // -------------------------------------------------------------------------------------------------------------------\n\n /**\n * Props to pass to the Mantine Table component.\n */\n tableProps?: TableProps;\n\n /**\n * Function to generate props for each table row based on the item.\n */\n tableTrProps?: (item: T) => TableTrProps;\n}\n\nconst DataTable = <T extends object, Filters extends TObject>(\n props: DataTableProps<T, Filters>,\n) => {\n const [items, setItems] = useState<MaybePage<T>>(\n typeof props.items === \"function\"\n ? {\n content: [],\n }\n : props.items,\n );\n\n const defaultSize = props.infinityScroll ? 100 : props.defaultSize || 10;\n const [page, setPage] = useState(1);\n const [size, setSize] = useState(String(defaultSize));\n const [currentPage, setCurrentPage] = useState(0);\n const alepha = useInject(Alepha);\n\n const form = useForm(\n {\n schema: t.object({\n ...(props.filters ? props.filters.properties : {}),\n page: t.number({ default: 0 }),\n size: t.number({ default: defaultSize }),\n sort: t.optional(t.string()),\n }),\n handler: async (values, args) => {\n if (typeof props.items === \"function\") {\n const response = await props.items(\n values as Static<Filters> & {\n page: number;\n size: number;\n sort?: string;\n },\n {\n items: items.content,\n },\n );\n\n if (props.infinityScroll && values.page > 0) {\n // Append new items to existing ones for infinity scroll\n setItems((prev) => ({\n ...response,\n content: [...prev.content, ...response.content],\n }));\n } else {\n setItems(response);\n }\n\n setCurrentPage(values.page);\n }\n },\n onReset: async () => {\n setPage(1);\n setSize(\"10\");\n await form.submit();\n },\n onChange: async (key, value) => {\n if (key === \"page\") {\n setPage(value + 1);\n await form.submit();\n return;\n }\n\n if (key === \"size\") {\n setSize(String(value));\n form.input.page.set(0);\n return;\n }\n\n props.onFilterChange?.(key, value, form as any);\n },\n },\n [items],\n );\n\n const submitDebounce = useDebouncedCallback(() => form.submit(), {\n delay: 800,\n });\n\n const dt = useInject(DateTimeProvider);\n\n useEffect(() => {\n if (props.submitOnInit) {\n form.submit();\n }\n if (props.submitEvery) {\n const it = dt.createInterval(() => {\n form.submit();\n }, props.submitEvery);\n return () => dt.clearInterval(it);\n }\n }, []);\n\n useEffect(() => {\n if (typeof props.items !== \"function\") {\n setItems(props.items);\n }\n }, [props.items]);\n\n // Infinity scroll detection\n useEffect(() => {\n if (!props.infinityScroll || typeof props.items !== \"function\") return;\n\n const handleScroll = () => {\n if (form.submitting) return;\n\n const scrollTop = window.scrollY;\n const windowHeight = window.innerHeight;\n const docHeight = document.documentElement.scrollHeight;\n\n const isNearBottom = scrollTop + windowHeight >= docHeight - 300;\n\n if (isNearBottom) {\n const totalPages = items.page?.totalPages ?? 1;\n\n if (currentPage + 1 < totalPages) {\n form.input.page.set(currentPage + 1);\n }\n }\n };\n\n window.addEventListener(\"scroll\", handleScroll);\n return () => window.removeEventListener(\"scroll\", handleScroll);\n }, [\n props.infinityScroll,\n form.submitting,\n items.page?.totalPages,\n currentPage,\n form,\n ]);\n\n const head = Object.entries(props.columns).map(([key, col]) => (\n <Table.Th\n key={key}\n style={{\n ...(col.fit\n ? {\n width: \"1%\",\n whiteSpace: \"nowrap\",\n }\n : {}),\n }}\n >\n <ActionButton justify={\"space-between\"} radius={0} fullWidth size={\"xs\"}>\n {col.label}\n </ActionButton>\n </Table.Th>\n ));\n\n const rows = items.content.map((item, index) => {\n const trProps = props.tableTrProps\n ? props.tableTrProps(item as T)\n : ({} as TableTrProps);\n return (\n <Table.Tr key={JSON.stringify(item)} {...trProps}>\n {Object.entries(props.columns).map(([key, col]) => (\n <Table.Td key={key}>\n {col.value(item as T, {\n index,\n form: form as unknown as FormModel<Filters>,\n alepha,\n })}\n </Table.Td>\n ))}\n </Table.Tr>\n );\n });\n\n const schema = t.omit(form.options.schema, [\"page\", \"size\", \"sort\"]);\n\n return (\n <Flex direction={\"column\"} gap={\"sm\"} flex={1}>\n {props.filters ? (\n <Card withBorder p={\"lg\"} bg={ui.colors.elevated}>\n <TypeForm\n {...props.typeFormProps}\n form={form as unknown as FormModel<Filters>}\n schema={schema}\n />\n </Card>\n ) : null}\n\n <Flex className={\"overflow-auto\"}>\n <Table\n striped\n withRowBorders\n withColumnBorders\n withTableBorder\n stripedColor={\"\"}\n {...props.tableProps}\n >\n <Table.Thead>\n <Table.Tr>{head}</Table.Tr>\n </Table.Thead>\n <Table.Tbody>{rows}</Table.Tbody>\n </Table>\n </Flex>\n\n {!props.infinityScroll && (\n <Flex justify={\"space-between\"} align={\"center\"}>\n <Pagination\n withEdges\n total={items.page?.totalPages ?? 1}\n value={page}\n onChange={(value) => {\n form.input.page.set(value - 1);\n }}\n />\n <Flex>\n <Select\n value={size}\n onChange={(value) => {\n form.input.size.set(Number(value));\n }}\n data={[\n { value: \"5\", label: \"5\" },\n { value: \"10\", label: \"10\" },\n { value: \"25\", label: \"25\" },\n { value: \"50\", label: \"50\" },\n { value: \"100\", label: \"100\" },\n ]}\n />\n </Flex>\n </Flex>\n )}\n </Flex>\n );\n};\n\nexport default DataTable;\n","import { useInject } from \"@alepha/react\";\nimport { DialogService } from \"../services/DialogService.tsx\";\n\n/**\n * Use this hook to access the Dialog Service for showing various dialog types.\n *\n * @example\n * ```tsx\n * const dialog = useDialog();\n * await dialog.alert({ title: \"Alert\", message: \"This is an alert message\" });\n * const confirmed = await dialog.confirm({ title: \"Confirm\", message: \"Are you sure?\" });\n * const input = await dialog.prompt({ title: \"Input\", message: \"Enter your name:\" });\n * ```\n */\nexport const useDialog = (): DialogService => {\n return useInject(DialogService);\n};\n","import { AlephaReactForm } from \"@alepha/react/form\";\nimport { AlephaReactHead } from \"@alepha/react/head\";\nimport { AlephaReactI18n } from \"@alepha/react/i18n\";\nimport { $module } from \"alepha\";\nimport type { ComponentType, ReactNode } from \"react\";\nimport type { ControlProps } from \"./components/form/Control.tsx\";\nimport { ThemeProvider } from \"./providers/ThemeProvider.ts\";\nimport { RootRouter } from \"./RootRouter.ts\";\nimport { DialogService } from \"./services/DialogService.tsx\";\nimport { ToastService } from \"./services/ToastService.tsx\";\n\n// ---------------------------------------------------------------------------------------------------------------------\n\nexport { Flex, Text } from \"@mantine/core\";\nexport type {\n ActionClickButtonProps,\n ActionCommonProps,\n ActionMenuConfig,\n ActionMenuItem,\n ActionNavigationButtonProps,\n ActionProps,\n ActionSubmitButtonProps,\n} from \"./components/buttons/ActionButton.tsx\";\nexport { default as ActionButton } from \"./components/buttons/ActionButton.tsx\";\nexport { default as BurgerButton } from \"./components/buttons/BurgerButton.tsx\";\nexport type { ClipboardButtonProps } from \"./components/buttons/ClipboardButton.tsx\";\nexport { default as ClipboardButton } from \"./components/buttons/ClipboardButton.tsx\";\nexport { default as DarkModeButton } from \"./components/buttons/DarkModeButton.tsx\";\nexport { default as LanguageButton } from \"./components/buttons/LanguageButton.tsx\";\nexport { default as OmnibarButton } from \"./components/buttons/OmnibarButton.tsx\";\nexport type { ThemeButtonProps } from \"./components/buttons/ThemeButton.tsx\";\nexport { default as ThemeButton } from \"./components/buttons/ThemeButton.tsx\";\nexport { default as JsonViewer } from \"./components/data/JsonViewer.tsx\";\nexport { default as AlertDialog } from \"./components/dialogs/AlertDialog.tsx\";\nexport { default as ConfirmDialog } from \"./components/dialogs/ConfirmDialog.tsx\";\nexport { default as PromptDialog } from \"./components/dialogs/PromptDialog.tsx\";\nexport { default as Control } from \"./components/form/Control.tsx\";\nexport { default as ControlDate } from \"./components/form/ControlDate.tsx\";\nexport { default as ControlQueryBuilder } from \"./components/form/ControlQueryBuilder.tsx\";\nexport { default as ControlSelect } from \"./components/form/ControlSelect.tsx\";\nexport { default as TypeForm } from \"./components/form/TypeForm.tsx\";\nexport {\n type AdminShellProps,\n default as AdminShell,\n} from \"./components/layout/AdminShell.tsx\";\nexport { default as AlephaMantineProvider } from \"./components/layout/AlephaMantineProvider.tsx\";\nexport type {\n AppBarBurger,\n AppBarDark,\n AppBarDivider,\n AppBarElement,\n AppBarItem,\n AppBarLang,\n AppBarProps,\n AppBarSearch,\n AppBarSpacer,\n} from \"./components/layout/AppBar.tsx\";\nexport { default as AppBar } from \"./components/layout/AppBar.tsx\";\nexport { default as Omnibar } from \"./components/layout/Omnibar.tsx\";\nexport type {\n SidebarAbstractItem,\n SidebarButtonTheme,\n SidebarDivider,\n SidebarElement,\n SidebarItemProps,\n SidebarMenuItem,\n SidebarNode,\n SidebarProps,\n SidebarSearch,\n SidebarSection,\n SidebarSpacer,\n SidebarTheme,\n} from \"./components/layout/Sidebar.tsx\";\nexport { Sidebar } from \"./components/layout/Sidebar.tsx\";\nexport type {\n DataTableColumn,\n DataTableProps,\n} from \"./components/table/DataTable.tsx\";\nexport { default as DataTable } from \"./components/table/DataTable.tsx\";\nexport * from \"./constants/ui.ts\";\nexport { useDialog } from \"./hooks/useDialog.ts\";\nexport { useToast } from \"./hooks/useToast.ts\";\nexport * from \"./providers/ThemeProvider.ts\";\nexport * from \"./RootRouter.ts\";\nexport type {\n AlertDialogOptions,\n AlertDialogProps,\n BaseDialogOptions,\n ConfirmDialogOptions,\n ConfirmDialogProps,\n PromptDialogOptions,\n PromptDialogProps,\n} from \"./services/DialogService.tsx\";\nexport { DialogService } from \"./services/DialogService.tsx\";\nexport { ToastService } from \"./services/ToastService.tsx\";\nexport * from \"./utils/extractSchemaFields.ts\";\nexport * from \"./utils/icons.tsx\";\nexport * from \"./utils/string.ts\";\n\n// ---------------------------------------------------------------------------------------------------------------------\n\ndeclare module \"typebox\" {\n interface TSchemaOptions {\n $control?: Omit<ControlProps, \"input\">;\n }\n}\n\ndeclare module \"@alepha/react\" {\n interface PagePrimitiveOptions {\n /**\n * Human-readable title for the page.\n * - for Sidebar navigation\n * - for Omnibar navigation\n * (soon)\n * - for Breadcrumbs\n * - for document title (with AlephaReactHead)\n */\n label?: string;\n\n /**\n * Optional description of the page.\n */\n description?: string;\n\n /**\n * Optional icon for the page.\n */\n icon?: ReactNode | ComponentType;\n }\n}\n\n// ---------------------------------------------------------------------------------------------------------------------\n\n/**\n * Mantine\n *\n * @module alepha.ui\n */\nexport const AlephaUI = $module({\n name: \"alepha.ui\",\n services: [DialogService, ToastService, ThemeProvider, RootRouter],\n register: (alepha) => {\n alepha.with(AlephaReactI18n);\n alepha.with(AlephaReactHead);\n alepha.with(AlephaReactForm);\n alepha.with(ThemeProvider);\n alepha.with(DialogService);\n alepha.with(ToastService);\n },\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAEA,MAAaA,cAA2B;CACtC,IAAI;CACJ,OAAO;CACP,aAAa;CACb,cAAc;CACd,cAAc;EAAE,OAAO;EAAG,MAAM;EAAG;CACnC,YACE;CACF,qBACE;CACF,UAAU;EACR,YACE;EACF,YAAY;EACZ,UAAU;EACV,OAAO;GACL,IAAI;IAAE,UAAU;IAAW,YAAY;IAAO;GAC9C,IAAI;IAAE,UAAU;IAAW,YAAY;IAAQ;GAC/C,IAAI;IAAE,UAAU;IAAY,YAAY;IAAO;GAC/C,IAAI;IAAE,UAAU;IAAY,YAAY;IAAQ;GAChD,IAAI;IAAE,UAAU;IAAQ,YAAY;IAAO;GAC3C,IAAI;IAAE,UAAU;IAAY,YAAY;IAAO;GAChD;EACF;CACD,WAAW;EACT,IAAI;EACJ,IAAI;EACJ,IAAI;EACJ,IAAI;EACJ,IAAI;EACL;CACD,aAAa;EACX,IAAI;EACJ,IAAI;EACJ,IAAI;EACJ,IAAI;EACJ,IAAI;EACL;CACD,QAAQ;EACN,IAAI;EACJ,IAAI;EACJ,IAAI;EACJ,IAAI;EACJ,IAAI;EACL;CACD,eAAe;CACf,SAAS;EACP,IAAI;EACJ,IAAI;EACJ,IAAI;EACJ,IAAI;EACJ,IAAI;EACL;CACD,iBAAiB;EAAE,MAAM;EAAU,IAAI;EAAQ,KAAK;EAAK;CACzD,QAAQ;EACN,MAAM;GACJ;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACD;EACD,MAAM;GACJ;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACD;EACD,QAAQ;GACN;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACD;EACD,MAAM;GACJ;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACD;E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AAU;EACV,OAAO;GACL,IAAI;IAAE,UAAU;IAAQ,YAAY;IAAQ;GAC5C,IAAI;IAAE,UAAU;IAAU,YAAY;IAAO;GAC7C,IAAI;IAAE,UAAU;IAAW,YAAY;IAAO;GAC9C,IAAI;IAAE,UAAU;IAAQ,YAAY;IAAO;GAC3C,IAAI;IAAE,UAAU;IAAY,YAAY;IAAO;GAC/C,IAAI;IAAE,UAAU;IAAW,YAAY;IAAO;GAC/C;EACF;CACD,WAAW;EACT,IAAI;EACJ,IAAI;EACJ,IAAI;EACJ,IAAI;EACJ,IAAI;EACL;CACD,QAAQ;EACN,IAAI;EACJ,IAAI;EACJ,IAAI;EACJ,IAAI;EACJ,IAAI;EACL;CACD,eAAe;CACf,QAAQ;EACN,MAAM;GACJ;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACD;EACD,MAAM;GACJ;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACD;EACD,MAAM;GACJ;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACD;EACD,OAAO;GACL;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACD;EACD,KAAK;GACH;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACD;EACF;CACF;;;;ACrGD,MAAaC,gBAA6B;CACxC,IAAI;CACJ,OAAO;CACP,aAAa;CACb,QAAQ;EACN,MAAM;GACJ;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACD;EACD,MAAM;GACJ;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACD;EACD,MAAM;GACJ;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACD;EACD,OAAO;GACL;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACD;EACD,QAAQ;GACN;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACD;EACD,QAAQ;GACN;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACD;EACD,KAAK;GACH;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACD;EACD,MAAM;GACJ;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACD;EACD,OAAO;GACL;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACD;EACD,QAAQ;GACN;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACD;EACD,QAAQ;GACN;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACD;EACD,MAAM;GACJ;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACD;EACD,MAAM;GACJ;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACD;EACD,MAAM;GACJ;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACD;EACD,UAAU;GACR;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACD;EACF;CACD,cAAc;CACd,cAAc;EACZ,OAAO;EACP,MAAM;EACP;CACD,OAAO;CACP,OAAO;CACP,cAAc;CACd,oBAAoB;CACpB,YAAY;CACZ,qBAAqB;CACrB,UAAU;EACR,YAAY;EACZ,YAAY;EACZ,OAAO;GACL,IAAI;IACF,UAAU;IACV,YAAY;IACZ,YAAY;IACb;GACD,IAAI;IACF,UAAU;IACV,YAAY;IACZ,YAAY;IACb;GACD,IAAI;IACF,UAAU;IACV,YAAY;IACZ,YAAY;IACb;GACD,IAAI;IACF,UAAU;IACV,YAAY;IACZ,YAAY;IACb;GACD,IAAI;IACF,UAAU;IACV,YAAY;IACZ,YAAY;IACb;GACD,IAAI;IACF,UAAU;IACV,YAAY;IACZ,YAAY;IACb;GACF;EACF;CACD,OAAO;CACP,QAAQ;EACN,IAAI;EACJ,IAAI;EACJ,IAAI;EACJ,IAAI;EACJ,IAAI;EACL;CACD,SAAS;EACP,IAAI;EACJ,IAAI;EACJ,IAAI;EACJ,IAAI;EACJ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