@alepha/ui 0.13.0 → 0.13.2
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.
- package/dist/admin/{AdminFiles-CllAxb1B.js → AdminFiles-BjofP3OC.js} +11 -11
- package/dist/admin/AdminFiles-BjofP3OC.js.map +1 -0
- package/dist/admin/AdminFiles-DldZB7oo.js +3 -0
- package/dist/admin/AdminJobs-BOq6AZOW.js +3 -0
- package/dist/admin/{AdminJobs-BXkFtlVo.js → AdminJobs-CDnVxEv6.js} +11 -11
- package/dist/admin/AdminJobs-CDnVxEv6.js.map +1 -0
- package/dist/admin/AdminLayout-Bgx25J8m.js +3 -0
- package/dist/admin/{AdminLayout-CtkVYk-u.js → AdminLayout-CervL8LV.js} +6 -6
- package/dist/admin/AdminLayout-CervL8LV.js.map +1 -0
- package/dist/admin/AdminNotifications-BDQXt3-e.js +3 -0
- package/dist/admin/{AdminNotifications-DnnulNNV.js → AdminNotifications-DvI2989x.js} +6 -6
- package/dist/admin/AdminNotifications-DvI2989x.js.map +1 -0
- package/dist/admin/AdminParameters-D_v0GAvI.js +3 -0
- package/dist/admin/{AdminParameters-B3hvpLpu.js → AdminParameters-P1LB6ZI1.js} +7 -7
- package/dist/admin/AdminParameters-P1LB6ZI1.js.map +1 -0
- package/dist/admin/{AdminSessions-Pjdz-iZx.js → AdminSessions-CmDVneE2.js} +11 -11
- package/dist/admin/AdminSessions-CmDVneE2.js.map +1 -0
- package/dist/admin/AdminSessions-Dkk_fzWK.js +3 -0
- package/dist/admin/{AdminUsers-C1HsrRxn.js → AdminUsers-88De5pev.js} +9 -9
- package/dist/admin/AdminUsers-88De5pev.js.map +1 -0
- package/dist/admin/AdminUsers-oyAXqZ5l.js +3 -0
- package/dist/admin/AdminVerifications-D93TKymL.js +3 -0
- package/dist/admin/{AdminVerifications-VMpm30mS.js → AdminVerifications-DBVEoqJe.js} +6 -6
- package/dist/admin/AdminVerifications-DBVEoqJe.js.map +1 -0
- package/dist/admin/index.d.ts +320 -320
- package/dist/admin/index.js +17 -17
- package/dist/auth/{IconGoogle-Bfmuv9Rv.js → IconGoogle-v_58os2T.js} +1 -1
- package/dist/auth/{IconGoogle-Bfmuv9Rv.js.map → IconGoogle-v_58os2T.js.map} +1 -1
- package/dist/auth/Login-BC2jTczq.js +4 -0
- package/dist/auth/{Login-JeXFsUf5.js → Login-OCrvjs9U.js} +12 -12
- package/dist/auth/Login-OCrvjs9U.js.map +1 -0
- package/dist/auth/Register-Dh0lsQmI.js +4 -0
- package/dist/auth/{Register-CPQnvXCZ.js → Register-Ei34GSba.js} +16 -16
- package/dist/auth/Register-Ei34GSba.js.map +1 -0
- package/dist/auth/ResetPassword-BnlAQAOE.js +3 -0
- package/dist/auth/{ResetPassword-BzUjGG_-.js → ResetPassword-tO0oMzfo.js} +12 -12
- package/dist/auth/ResetPassword-tO0oMzfo.js.map +1 -0
- package/dist/auth/index.d.ts +1528 -1898
- package/dist/auth/index.js +10 -10
- package/dist/auth/index.js.map +1 -1
- package/dist/core/index.d.ts +152 -152
- package/dist/core/index.js +13 -6
- package/dist/core/index.js.map +1 -1
- package/package.json +6 -6
- package/src/admin/components/AdminParameters.tsx +1 -1
- package/src/core/components/buttons/OmnibarButton.tsx +10 -5
- package/src/core/components/layout/Omnibar.tsx +6 -1
- package/src/core/index.ts +1 -1
- package/dist/admin/AdminFiles-BM6_7_5A.cjs +0 -4
- package/dist/admin/AdminFiles-BaCIMeNt.js +0 -4
- package/dist/admin/AdminFiles-CllAxb1B.js.map +0 -1
- package/dist/admin/AdminFiles-DC3T8uWZ.cjs +0 -122
- package/dist/admin/AdminFiles-DC3T8uWZ.cjs.map +0 -1
- package/dist/admin/AdminJobs-BXkFtlVo.js.map +0 -1
- package/dist/admin/AdminJobs-C428qrNQ.cjs +0 -130
- package/dist/admin/AdminJobs-C428qrNQ.cjs.map +0 -1
- package/dist/admin/AdminJobs-DCPPaJ4i.cjs +0 -4
- package/dist/admin/AdminJobs-yC6DarGO.js +0 -4
- package/dist/admin/AdminLayout-Bqo4cd33.cjs +0 -4
- package/dist/admin/AdminLayout-CQpxfko6.js +0 -4
- package/dist/admin/AdminLayout-CiLlywAQ.cjs +0 -93
- package/dist/admin/AdminLayout-CiLlywAQ.cjs.map +0 -1
- package/dist/admin/AdminLayout-CtkVYk-u.js.map +0 -1
- package/dist/admin/AdminNotifications-DNUeJ-PW.cjs +0 -44
- package/dist/admin/AdminNotifications-DNUeJ-PW.cjs.map +0 -1
- package/dist/admin/AdminNotifications-DaMu1AQ4.js +0 -4
- package/dist/admin/AdminNotifications-DnnulNNV.js.map +0 -1
- package/dist/admin/AdminNotifications-ihgbKVCx.cjs +0 -4
- package/dist/admin/AdminParameters-B3hvpLpu.js.map +0 -1
- package/dist/admin/AdminParameters-U4lU1rUF.cjs +0 -4
- package/dist/admin/AdminParameters-gdf7036N.cjs +0 -44
- package/dist/admin/AdminParameters-gdf7036N.cjs.map +0 -1
- package/dist/admin/AdminParameters-prMcCgxf.js +0 -4
- package/dist/admin/AdminSessions-BF_P4lHs.cjs +0 -128
- package/dist/admin/AdminSessions-BF_P4lHs.cjs.map +0 -1
- package/dist/admin/AdminSessions-CATIU61I.cjs +0 -4
- package/dist/admin/AdminSessions-DqOXOpYR.js +0 -4
- package/dist/admin/AdminSessions-Pjdz-iZx.js.map +0 -1
- package/dist/admin/AdminUsers-BgTL-zSY.js +0 -4
- package/dist/admin/AdminUsers-C1HsrRxn.js.map +0 -1
- package/dist/admin/AdminUsers-HqvxwNGZ.cjs +0 -4
- package/dist/admin/AdminUsers-M2uEQbp5.cjs +0 -109
- package/dist/admin/AdminUsers-M2uEQbp5.cjs.map +0 -1
- package/dist/admin/AdminVerifications-BVssbtfU.cjs +0 -44
- package/dist/admin/AdminVerifications-BVssbtfU.cjs.map +0 -1
- package/dist/admin/AdminVerifications-Df6DRgNo.js +0 -4
- package/dist/admin/AdminVerifications-DxAtcYUR.cjs +0 -4
- package/dist/admin/AdminVerifications-VMpm30mS.js.map +0 -1
- package/dist/admin/core-CzO6aavT.js +0 -2507
- package/dist/admin/core-CzO6aavT.js.map +0 -1
- package/dist/admin/core-aFtK4l9I.cjs +0 -2530
- package/dist/admin/core-aFtK4l9I.cjs.map +0 -1
- package/dist/admin/index.cjs +0 -87
- package/dist/admin/index.cjs.map +0 -1
- package/dist/admin/index.d.cts +0 -1739
- package/dist/auth/IconGoogle-B17BTQyD.cjs +0 -69
- package/dist/auth/IconGoogle-B17BTQyD.cjs.map +0 -1
- package/dist/auth/Login-BTBmbnWl.cjs +0 -181
- package/dist/auth/Login-BTBmbnWl.cjs.map +0 -1
- package/dist/auth/Login-BcQOtG3v.js +0 -5
- package/dist/auth/Login-Btmd70Um.cjs +0 -5
- package/dist/auth/Login-JeXFsUf5.js.map +0 -1
- package/dist/auth/Register-CPQnvXCZ.js.map +0 -1
- package/dist/auth/Register-CbesZal3.cjs +0 -5
- package/dist/auth/Register-DpI_JdyO.js +0 -5
- package/dist/auth/Register-HP3rP71B.cjs +0 -323
- package/dist/auth/Register-HP3rP71B.cjs.map +0 -1
- package/dist/auth/ResetPassword-B-tkzV7g.cjs +0 -248
- package/dist/auth/ResetPassword-B-tkzV7g.cjs.map +0 -1
- package/dist/auth/ResetPassword-BlK3xEpU.js +0 -4
- package/dist/auth/ResetPassword-BzUjGG_-.js.map +0 -1
- package/dist/auth/ResetPassword-W3xjOnWy.cjs +0 -4
- package/dist/auth/chunk-DhGyd7sr.js +0 -28
- package/dist/auth/core-D1MHij1j.js +0 -1795
- package/dist/auth/core-D1MHij1j.js.map +0 -1
- package/dist/auth/core-rDZ9d92K.cjs +0 -1824
- package/dist/auth/core-rDZ9d92K.cjs.map +0 -1
- package/dist/auth/index.cjs +0 -211
- package/dist/auth/index.cjs.map +0 -1
- package/dist/auth/index.d.cts +0 -6265
- package/dist/core/index.cjs +0 -2620
- package/dist/core/index.cjs.map +0 -1
- package/dist/core/index.d.cts +0 -2737
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"core-rDZ9d92K.cjs","names":["notifications","IconInfoCircle","IconCheck","IconAlertTriangle","IconX","Spotlight","IconSearch","FormValidationError","ColorSchemeScript","MantineProvider","Notifications","NavigationProgress","ModalsProvider","Omnibar","NestedView","AlephaMantineProvider","Text","Box","ActionIcon","IconChevronDown","IconChevronRight","Collapse","CopyButton","Tooltip","IconCheck","IconCopy","Text","Group","Button","Text","Group","Button","Text","TextInput","Group","Button","AlertDialog","ConfirmDialog","PromptDialog","modals","Flex","JsonViewer","Menu","IconChevronRight","menuItemProps: MenuItemProps & ButtonHTMLAttributes<unknown>","ThemeIcon","IconCheck","icon","Children","Flex","Button","defaultTooltipProps: Partial<TooltipProps>","Tooltip","Anchor","IconMail","IconLink","IconPhone","IconCalendar","IconClock","IconColorPicker","IconKey","IconPalette","IconFile","IconSelector","IconToggleLeft","IconHash","IconList","IconLetterCase","IconAt","TypeBoxError","inputProps: InputProps","DateTimePicker","DateInput","TimeInput","Input","Slider","NumberInput","fields: SchemaField[]","field: SchemaField","OPERATOR_INFO: Record<\n string,\n { symbol: string; label: string; example: string }\n>","value","Popover","TextInput","IconInfoTriangle","IconFilter","ActionIcon","IconX","Group","Stack","Text","ActionButton","Divider","Flex","Badge","itemsEnum: string[] | undefined","items: any","segmentedControlProps: Partial<SegmentedControlProps>","Input","Flex","SegmentedControl","Autocomplete","TagsInput","data","MultiSelect","Select","ControlQueryBuilder","Input","Flex","ControlNumber","FileInput","ColorInput","ControlSelect","Switch","PasswordInput","Textarea","ControlDate","TextInput","AlephaReactI18n","AlephaReactHead","AlephaReactForm"],"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/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/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: () => router.go(page.name),\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 {\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 { 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 PageDescriptorOptions {\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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ACJ,mBAAmB;GAAC;GAAS;GAAS;GAAe;GAAQ;GAC7D;;AAKN,sBAAe;;;;;;;;;AC3Kf,MAAa,+BAAmB;CAC9B,MAAM;CACN,UAAU;EAAC;EAAe;EAAc;EAAW;CACnD,WAAW,aAAW;AACpB,WAAO,KAAKC,oCAAgB;AAC5B,WAAO,KAAKC,oCAAgB;AAC5B,WAAO,KAAKC,oCAAgB;AAC5B,WAAO,KAAK,cAAc;AAC1B,WAAO,KAAK,aAAa;;CAE5B,CAAC"}
|
package/dist/auth/index.cjs
DELETED
|
@@ -1,211 +0,0 @@
|
|
|
1
|
-
const require_core = require('./core-rDZ9d92K.cjs');
|
|
2
|
-
require('./IconGoogle-B17BTQyD.cjs');
|
|
3
|
-
const require_Login = require('./Login-BTBmbnWl.cjs');
|
|
4
|
-
const require_Register = require('./Register-HP3rP71B.cjs');
|
|
5
|
-
const require_ResetPassword = require('./ResetPassword-B-tkzV7g.cjs');
|
|
6
|
-
let __alepha_react_auth = require("@alepha/react/auth");
|
|
7
|
-
let __alepha_react_i18n = require("@alepha/react/i18n");
|
|
8
|
-
let alepha = require("alepha");
|
|
9
|
-
let __alepha_react = require("@alepha/react");
|
|
10
|
-
let __mantine_core = require("@mantine/core");
|
|
11
|
-
let __tabler_icons_react = require("@tabler/icons-react");
|
|
12
|
-
let react_jsx_runtime = require("react/jsx-runtime");
|
|
13
|
-
let alepha_server_links = require("alepha/server/links");
|
|
14
|
-
|
|
15
|
-
//#region src/auth/AuthI18n.ts
|
|
16
|
-
var AuthI18n = class {
|
|
17
|
-
en = (0, __alepha_react_i18n.$dictionary)({
|
|
18
|
-
name: "alepha.ui.auth.en",
|
|
19
|
-
lazy: () => ({ default: {
|
|
20
|
-
loginSignIn: "Sign in",
|
|
21
|
-
loginContinueWith: "Continue with $1",
|
|
22
|
-
loginOr: "OR",
|
|
23
|
-
loginCancel: "Cancel",
|
|
24
|
-
loginForgotPassword: "Forgot password?",
|
|
25
|
-
loginNoAccount: "Don't have an account?",
|
|
26
|
-
loginSignUp: "Sign up",
|
|
27
|
-
loginUsername: "Username",
|
|
28
|
-
loginEmail: "Email",
|
|
29
|
-
loginPhone: "Phone number",
|
|
30
|
-
loginPassword: "Password",
|
|
31
|
-
registerCreateAccount: "Create account",
|
|
32
|
-
registerContinueWith: "Continue with $1",
|
|
33
|
-
registerOr: "OR",
|
|
34
|
-
registerCancel: "Cancel",
|
|
35
|
-
registerHaveAccount: "Already have an account?",
|
|
36
|
-
registerSignIn: "Sign in",
|
|
37
|
-
registerUsername: "Username",
|
|
38
|
-
registerEmail: "Email",
|
|
39
|
-
registerPhone: "Phone number",
|
|
40
|
-
registerPassword: "Password",
|
|
41
|
-
registerConfirmPassword: "Confirm password",
|
|
42
|
-
registerDisabled: "Registration is not available. Please contact your administrator.",
|
|
43
|
-
registerBackToSignIn: "Back to sign in",
|
|
44
|
-
registerVerifyTitle: "Verify your account",
|
|
45
|
-
registerVerifyDescription: "Please enter the verification code(s) sent to you.",
|
|
46
|
-
registerEmailCode: "Email verification code",
|
|
47
|
-
registerPhoneCode: "Phone verification code",
|
|
48
|
-
registerVerifySubmit: "Complete Registration",
|
|
49
|
-
registerVerifyBack: "Back to registration",
|
|
50
|
-
resetPasswordTitle: "Reset password",
|
|
51
|
-
resetPasswordEmail: "Email",
|
|
52
|
-
resetPasswordEnterEmail: "Enter your email address to reset your password",
|
|
53
|
-
resetPasswordSendCode: "Send verification code",
|
|
54
|
-
resetPasswordCodeSent: "We've sent a verification code to your email.",
|
|
55
|
-
resetPasswordEnterCode: "Enter the 6-digit code",
|
|
56
|
-
resetPasswordResendCode: "Resend code",
|
|
57
|
-
resetPasswordEnterNewPassword: "Create your new password",
|
|
58
|
-
resetPasswordNewPassword: "New password",
|
|
59
|
-
resetPasswordConfirmPassword: "Confirm password",
|
|
60
|
-
resetPasswordSetNewPassword: "Set new password",
|
|
61
|
-
resetPasswordSuccess: "Your password has been reset successfully.",
|
|
62
|
-
resetPasswordBackToSignIn: "Back to sign in",
|
|
63
|
-
resetPasswordCancel: "Cancel",
|
|
64
|
-
resetPasswordDisabled: "Password reset is not available. Please contact your administrator."
|
|
65
|
-
} })
|
|
66
|
-
});
|
|
67
|
-
fr = (0, __alepha_react_i18n.$dictionary)({ lazy: () => ({ default: {
|
|
68
|
-
loginSignIn: "Se connecter",
|
|
69
|
-
loginContinueWith: "Continuer avec $1",
|
|
70
|
-
loginOr: "OU",
|
|
71
|
-
loginCancel: "Annuler",
|
|
72
|
-
loginForgotPassword: "Mot de passe oublié ?",
|
|
73
|
-
loginNoAccount: "Vous n'avez pas de compte ?",
|
|
74
|
-
loginSignUp: "S'inscrire",
|
|
75
|
-
loginUsername: "Nom d'utilisateur",
|
|
76
|
-
loginEmail: "E-mail",
|
|
77
|
-
loginPhone: "Numéro de téléphone",
|
|
78
|
-
loginPassword: "Mot de passe",
|
|
79
|
-
registerCreateAccount: "Créer un compte",
|
|
80
|
-
registerContinueWith: "Continuer avec $1",
|
|
81
|
-
registerOr: "OU",
|
|
82
|
-
registerCancel: "Annuler",
|
|
83
|
-
registerHaveAccount: "Vous avez déjà un compte ?",
|
|
84
|
-
registerSignIn: "Se connecter",
|
|
85
|
-
registerUsername: "Nom d'utilisateur",
|
|
86
|
-
registerEmail: "E-mail",
|
|
87
|
-
registerPhone: "Numéro de téléphone",
|
|
88
|
-
registerPassword: "Mot de passe",
|
|
89
|
-
registerConfirmPassword: "Confirmer le mot de passe",
|
|
90
|
-
registerDisabled: "L'inscription n'est pas disponible. Veuillez contacter votre administrateur.",
|
|
91
|
-
registerBackToSignIn: "Retour à la connexion",
|
|
92
|
-
registerVerifyTitle: "Vérifiez votre compte",
|
|
93
|
-
registerVerifyDescription: "Veuillez entrer le(s) code(s) de vérification qui vous ont été envoyés.",
|
|
94
|
-
registerEmailCode: "Code de vérification par e-mail",
|
|
95
|
-
registerPhoneCode: "Code de vérification par téléphone",
|
|
96
|
-
registerVerifySubmit: "Terminer l'inscription",
|
|
97
|
-
registerVerifyBack: "Retour à l'inscription",
|
|
98
|
-
resetPasswordTitle: "Réinitialiser le mot de passe",
|
|
99
|
-
resetPasswordEmail: "E-mail",
|
|
100
|
-
resetPasswordEnterEmail: "Entrez votre adresse e-mail pour réinitialiser votre mot de passe",
|
|
101
|
-
resetPasswordSendCode: "Envoyer le code de vérification",
|
|
102
|
-
resetPasswordCodeSent: "Nous avons envoyé un code de vérification à votre e-mail.",
|
|
103
|
-
resetPasswordEnterCode: "Entrez le code à 6 chiffres",
|
|
104
|
-
resetPasswordResendCode: "Renvoyer le code",
|
|
105
|
-
resetPasswordEnterNewPassword: "Créez votre nouveau mot de passe",
|
|
106
|
-
resetPasswordNewPassword: "Nouveau mot de passe",
|
|
107
|
-
resetPasswordConfirmPassword: "Confirmer le mot de passe",
|
|
108
|
-
resetPasswordSetNewPassword: "Définir le nouveau mot de passe",
|
|
109
|
-
resetPasswordSuccess: "Votre mot de passe a été réinitialisé avec succès.",
|
|
110
|
-
resetPasswordBackToSignIn: "Retour à la connexion",
|
|
111
|
-
resetPasswordCancel: "Annuler",
|
|
112
|
-
resetPasswordDisabled: "La réinitialisation du mot de passe n'est pas disponible. Veuillez contacter votre administrateur."
|
|
113
|
-
} }) });
|
|
114
|
-
};
|
|
115
|
-
|
|
116
|
-
//#endregion
|
|
117
|
-
//#region src/auth/AuthRouter.ts
|
|
118
|
-
var AuthRouter = class {
|
|
119
|
-
userRealmClient = (0, alepha_server_links.$client)();
|
|
120
|
-
login = (0, __alepha_react.$page)({
|
|
121
|
-
path: "/login",
|
|
122
|
-
schema: { query: alepha.t.object({ redirect: alepha.t.optional(alepha.t.string()) }) },
|
|
123
|
-
lazy: () => Promise.resolve().then(() => require("./Login-Btmd70Um.cjs")),
|
|
124
|
-
resolve: async () => {
|
|
125
|
-
return { realmConfig: await this.userRealmClient.getRealmConfig() };
|
|
126
|
-
}
|
|
127
|
-
});
|
|
128
|
-
register = (0, __alepha_react.$page)({
|
|
129
|
-
path: "/register",
|
|
130
|
-
schema: { query: alepha.t.object({ redirect: alepha.t.optional(alepha.t.string()) }) },
|
|
131
|
-
lazy: () => Promise.resolve().then(() => require("./Register-CbesZal3.cjs")),
|
|
132
|
-
resolve: async () => {
|
|
133
|
-
return { realmConfig: await this.userRealmClient.getRealmConfig() };
|
|
134
|
-
}
|
|
135
|
-
});
|
|
136
|
-
resetPassword = (0, __alepha_react.$page)({
|
|
137
|
-
path: "/reset-password",
|
|
138
|
-
schema: { query: alepha.t.object({ redirect: alepha.t.optional(alepha.t.string()) }) },
|
|
139
|
-
lazy: () => Promise.resolve().then(() => require("./ResetPassword-W3xjOnWy.cjs")),
|
|
140
|
-
resolve: async () => {
|
|
141
|
-
return { realmConfig: await this.userRealmClient.getRealmConfig() };
|
|
142
|
-
}
|
|
143
|
-
});
|
|
144
|
-
};
|
|
145
|
-
|
|
146
|
-
//#endregion
|
|
147
|
-
//#region src/auth/components/buttons/UserButton.tsx
|
|
148
|
-
const UserButton = (props) => {
|
|
149
|
-
const { menuItems = [], logoutLabel = "Sign out", menuConfig, showLogoutDivider = menuItems.length > 0, icon, children, ...buttonProps } = props;
|
|
150
|
-
const auth = (0, __alepha_react_auth.useAuth)();
|
|
151
|
-
if (!auth.user) return null;
|
|
152
|
-
const userLabel = auth.user.username || auth.user.email;
|
|
153
|
-
const items = [];
|
|
154
|
-
if (auth.user.email && auth.user.username) items.push({
|
|
155
|
-
type: "label",
|
|
156
|
-
label: auth.user.email
|
|
157
|
-
});
|
|
158
|
-
items.push(...menuItems);
|
|
159
|
-
if (showLogoutDivider && items.length > 0) items.push({ type: "divider" });
|
|
160
|
-
items.push({
|
|
161
|
-
label: logoutLabel,
|
|
162
|
-
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__tabler_icons_react.IconLogout, { size: require_core.ui.sizes.icon.md }),
|
|
163
|
-
color: "red",
|
|
164
|
-
onClick: () => auth.logout()
|
|
165
|
-
});
|
|
166
|
-
const hasAvatar = !icon && auth.user.picture;
|
|
167
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_core.ActionButton_default, {
|
|
168
|
-
...buttonProps,
|
|
169
|
-
icon: hasAvatar ? void 0 : icon ?? __tabler_icons_react.IconUser,
|
|
170
|
-
leftSection: hasAvatar ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__mantine_core.Avatar, {
|
|
171
|
-
src: `/api/files/${auth.user.picture}`,
|
|
172
|
-
size: 24,
|
|
173
|
-
radius: "xl"
|
|
174
|
-
}) : void 0,
|
|
175
|
-
menu: {
|
|
176
|
-
position: "bottom-end",
|
|
177
|
-
width: 200,
|
|
178
|
-
...menuConfig,
|
|
179
|
-
items
|
|
180
|
-
},
|
|
181
|
-
children: children ?? userLabel
|
|
182
|
-
});
|
|
183
|
-
};
|
|
184
|
-
var UserButton_default = UserButton;
|
|
185
|
-
|
|
186
|
-
//#endregion
|
|
187
|
-
//#region src/auth/index.ts
|
|
188
|
-
/**
|
|
189
|
-
* Login UI Module
|
|
190
|
-
*
|
|
191
|
-
* @module alepha.ui.auth
|
|
192
|
-
*/
|
|
193
|
-
const AlephaUIAuth = (0, alepha.$module)({
|
|
194
|
-
name: "alepha.ui.auth",
|
|
195
|
-
services: [
|
|
196
|
-
require_core.AlephaUI,
|
|
197
|
-
__alepha_react_auth.AlephaReactAuth,
|
|
198
|
-
__alepha_react_i18n.AlephaReactI18n,
|
|
199
|
-
AuthRouter,
|
|
200
|
-
AuthI18n
|
|
201
|
-
]
|
|
202
|
-
});
|
|
203
|
-
|
|
204
|
-
//#endregion
|
|
205
|
-
exports.AlephaUIAuth = AlephaUIAuth;
|
|
206
|
-
exports.AuthRouter = AuthRouter;
|
|
207
|
-
exports.Login = require_Login.Login_default;
|
|
208
|
-
exports.Register = require_Register.Register_default;
|
|
209
|
-
exports.ResetPassword = require_ResetPassword.ResetPassword_default;
|
|
210
|
-
exports.UserButton = UserButton_default;
|
|
211
|
-
//# sourceMappingURL=index.cjs.map
|
package/dist/auth/index.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["t","items: ActionMenuItem[]","IconLogout","ui","ActionButton","IconUser","Avatar","AlephaUI","AlephaReactAuth","AlephaReactI18n"],"sources":["../../src/auth/AuthI18n.ts","../../src/auth/AuthRouter.ts","../../src/auth/components/buttons/UserButton.tsx","../../src/auth/index.ts"],"sourcesContent":["import { $dictionary } from \"@alepha/react/i18n\";\n\nexport class AuthI18n {\n en = $dictionary({\n name: \"alepha.ui.auth.en\",\n lazy: () => ({\n default: {\n loginSignIn: \"Sign in\",\n loginContinueWith: \"Continue with $1\",\n loginOr: \"OR\",\n loginCancel: \"Cancel\",\n loginForgotPassword: \"Forgot password?\",\n loginNoAccount: \"Don't have an account?\",\n loginSignUp: \"Sign up\",\n loginUsername: \"Username\",\n loginEmail: \"Email\",\n loginPhone: \"Phone number\",\n loginPassword: \"Password\",\n registerCreateAccount: \"Create account\",\n registerContinueWith: \"Continue with $1\",\n registerOr: \"OR\",\n registerCancel: \"Cancel\",\n registerHaveAccount: \"Already have an account?\",\n registerSignIn: \"Sign in\",\n registerUsername: \"Username\",\n registerEmail: \"Email\",\n registerPhone: \"Phone number\",\n registerPassword: \"Password\",\n registerConfirmPassword: \"Confirm password\",\n registerDisabled:\n \"Registration is not available. Please contact your administrator.\",\n registerBackToSignIn: \"Back to sign in\",\n registerVerifyTitle: \"Verify your account\",\n registerVerifyDescription:\n \"Please enter the verification code(s) sent to you.\",\n registerEmailCode: \"Email verification code\",\n registerPhoneCode: \"Phone verification code\",\n registerVerifySubmit: \"Complete Registration\",\n registerVerifyBack: \"Back to registration\",\n resetPasswordTitle: \"Reset password\",\n resetPasswordEmail: \"Email\",\n resetPasswordEnterEmail:\n \"Enter your email address to reset your password\",\n resetPasswordSendCode: \"Send verification code\",\n resetPasswordCodeSent: \"We've sent a verification code to your email.\",\n resetPasswordEnterCode: \"Enter the 6-digit code\",\n resetPasswordResendCode: \"Resend code\",\n resetPasswordEnterNewPassword: \"Create your new password\",\n resetPasswordNewPassword: \"New password\",\n resetPasswordConfirmPassword: \"Confirm password\",\n resetPasswordSetNewPassword: \"Set new password\",\n resetPasswordSuccess: \"Your password has been reset successfully.\",\n resetPasswordBackToSignIn: \"Back to sign in\",\n resetPasswordCancel: \"Cancel\",\n resetPasswordDisabled:\n \"Password reset is not available. Please contact your administrator.\",\n },\n }),\n });\n\n fr = $dictionary({\n lazy: () => ({\n default: {\n loginSignIn: \"Se connecter\",\n loginContinueWith: \"Continuer avec $1\",\n loginOr: \"OU\",\n loginCancel: \"Annuler\",\n loginForgotPassword: \"Mot de passe oublié ?\",\n loginNoAccount: \"Vous n'avez pas de compte ?\",\n loginSignUp: \"S'inscrire\",\n loginUsername: \"Nom d'utilisateur\",\n loginEmail: \"E-mail\",\n loginPhone: \"Numéro de téléphone\",\n loginPassword: \"Mot de passe\",\n registerCreateAccount: \"Créer un compte\",\n registerContinueWith: \"Continuer avec $1\",\n registerOr: \"OU\",\n registerCancel: \"Annuler\",\n registerHaveAccount: \"Vous avez déjà un compte ?\",\n registerSignIn: \"Se connecter\",\n registerUsername: \"Nom d'utilisateur\",\n registerEmail: \"E-mail\",\n registerPhone: \"Numéro de téléphone\",\n registerPassword: \"Mot de passe\",\n registerConfirmPassword: \"Confirmer le mot de passe\",\n registerDisabled:\n \"L'inscription n'est pas disponible. Veuillez contacter votre administrateur.\",\n registerBackToSignIn: \"Retour à la connexion\",\n registerVerifyTitle: \"Vérifiez votre compte\",\n registerVerifyDescription:\n \"Veuillez entrer le(s) code(s) de vérification qui vous ont été envoyés.\",\n registerEmailCode: \"Code de vérification par e-mail\",\n registerPhoneCode: \"Code de vérification par téléphone\",\n registerVerifySubmit: \"Terminer l'inscription\",\n registerVerifyBack: \"Retour à l'inscription\",\n resetPasswordTitle: \"Réinitialiser le mot de passe\",\n resetPasswordEmail: \"E-mail\",\n resetPasswordEnterEmail:\n \"Entrez votre adresse e-mail pour réinitialiser votre mot de passe\",\n resetPasswordSendCode: \"Envoyer le code de vérification\",\n resetPasswordCodeSent:\n \"Nous avons envoyé un code de vérification à votre e-mail.\",\n resetPasswordEnterCode: \"Entrez le code à 6 chiffres\",\n resetPasswordResendCode: \"Renvoyer le code\",\n resetPasswordEnterNewPassword: \"Créez votre nouveau mot de passe\",\n resetPasswordNewPassword: \"Nouveau mot de passe\",\n resetPasswordConfirmPassword: \"Confirmer le mot de passe\",\n resetPasswordSetNewPassword: \"Définir le nouveau mot de passe\",\n resetPasswordSuccess:\n \"Votre mot de passe a été réinitialisé avec succès.\",\n resetPasswordBackToSignIn: \"Retour à la connexion\",\n resetPasswordCancel: \"Annuler\",\n resetPasswordDisabled:\n \"La réinitialisation du mot de passe n'est pas disponible. Veuillez contacter votre administrateur.\",\n },\n }),\n });\n}\n","import { $page } from \"@alepha/react\";\nimport { t } from \"alepha\";\nimport type { UserRealmController } from \"alepha/api/users\";\nimport { $client } from \"alepha/server/links\";\n\nexport class AuthRouter {\n userRealmClient = $client<UserRealmController>();\n\n login = $page({\n path: \"/login\",\n schema: {\n query: t.object({\n redirect: t.optional(t.string()),\n }),\n },\n lazy: () => import(\"./components/Login.tsx\"),\n resolve: async () => {\n return {\n realmConfig: await this.userRealmClient.getRealmConfig(),\n };\n },\n });\n\n register = $page({\n path: \"/register\",\n schema: {\n query: t.object({\n redirect: t.optional(t.string()),\n }),\n },\n lazy: () => import(\"./components/Register.tsx\"),\n resolve: async () => {\n return {\n realmConfig: await this.userRealmClient.getRealmConfig(),\n };\n },\n });\n\n resetPassword = $page({\n path: \"/reset-password\",\n schema: {\n query: t.object({\n redirect: t.optional(t.string()),\n }),\n },\n lazy: () => import(\"./components/ResetPassword.tsx\"),\n resolve: async () => {\n return {\n realmConfig: await this.userRealmClient.getRealmConfig(),\n };\n },\n });\n}\n","import { useAuth } from \"@alepha/react/auth\";\nimport {\n ActionButton,\n type ActionMenuConfig,\n type ActionMenuItem,\n type ActionProps,\n ui,\n} from \"@alepha/ui\";\nimport { Avatar } from \"@mantine/core\";\nimport { IconLogout, IconUser } from \"@tabler/icons-react\";\nimport type { ReactNode } from \"react\";\n\nexport interface UserButtonProps\n extends Omit<ActionProps, \"menu\" | \"icon\" | \"onClick\"> {\n /**\n * Additional menu items to display before the logout option\n */\n menuItems?: ActionMenuItem[];\n\n /**\n * Custom logout label (default: \"Sign out\")\n */\n logoutLabel?: string;\n\n /**\n * Menu configuration overrides\n */\n menuConfig?: Partial<Omit<ActionMenuConfig, \"items\">>;\n\n /**\n * Whether to show a divider before logout (default: true when menuItems provided)\n */\n showLogoutDivider?: boolean;\n\n /**\n * Custom icon to use instead of user avatar (default: IconUser)\n */\n icon?: ReactNode;\n}\n\nconst UserButton = (props: UserButtonProps) => {\n const {\n menuItems = [],\n logoutLabel = \"Sign out\",\n menuConfig,\n showLogoutDivider = menuItems.length > 0,\n icon,\n children,\n ...buttonProps\n } = props;\n\n const auth = useAuth<{\n username?: string;\n email?: string;\n picture?: string;\n }>();\n\n if (!auth.user) {\n return null;\n }\n\n const userLabel = auth.user.username || auth.user.email;\n\n const items: ActionMenuItem[] = [];\n\n // Add user info label if available\n if (auth.user.email && auth.user.username) {\n items.push({\n type: \"label\",\n label: auth.user.email,\n });\n }\n\n // Add custom menu items\n items.push(...menuItems);\n\n // Add divider before logout if needed\n if (showLogoutDivider && items.length > 0) {\n items.push({ type: \"divider\" });\n }\n\n // Add logout item\n items.push({\n label: logoutLabel,\n icon: <IconLogout size={ui.sizes.icon.md} />,\n color: \"red\",\n onClick: () => auth.logout(),\n });\n\n // Use leftSection for Avatar (JSX element), icon prop for component types\n const hasAvatar = !icon && auth.user.picture;\n\n return (\n <ActionButton\n {...buttonProps}\n icon={hasAvatar ? undefined : (icon ?? IconUser)}\n leftSection={\n hasAvatar ? (\n <Avatar\n src={`/api/files/${auth.user.picture}`}\n size={24}\n radius=\"xl\"\n />\n ) : undefined\n }\n menu={{\n position: \"bottom-end\",\n width: 200,\n ...menuConfig,\n items,\n }}\n >\n {children ?? userLabel}\n </ActionButton>\n );\n};\n\nexport default UserButton;\n","import { AlephaReactAuth } from \"@alepha/react/auth\";\nimport { AlephaReactI18n } from \"@alepha/react/i18n\";\nimport { AlephaUI } from \"@alepha/ui\";\nimport { $module } from \"alepha\";\nimport { AuthI18n } from \"./AuthI18n.ts\";\nimport { AuthRouter } from \"./AuthRouter.ts\";\n\n// ---------------------------------------------------------------------------------------------------------------------\n\nexport * from \"./AuthRouter.ts\";\nexport type { UserButtonProps } from \"./components/buttons/UserButton.tsx\";\nexport { default as UserButton } from \"./components/buttons/UserButton.tsx\";\nexport { default as Login } from \"./components/Login.tsx\";\nexport { default as Register } from \"./components/Register.tsx\";\nexport { default as ResetPassword } from \"./components/ResetPassword.tsx\";\n\n// ---------------------------------------------------------------------------------------------------------------------\n\n/**\n * Login UI Module\n *\n * @module alepha.ui.auth\n */\nexport const AlephaUIAuth = $module({\n name: \"alepha.ui.auth\",\n services: [AlephaUI, AlephaReactAuth, AlephaReactI18n, AuthRouter, AuthI18n],\n});\n"],"mappings":";;;;;;;;;;;;;;;AAEA,IAAa,WAAb,MAAsB;CACpB,0CAAiB;EACf,MAAM;EACN,aAAa,EACX,SAAS;GACP,aAAa;GACb,mBAAmB;GACnB,SAAS;GACT,aAAa;GACb,qBAAqB;GACrB,gBAAgB;GAChB,aAAa;GACb,eAAe;GACf,YAAY;GACZ,YAAY;GACZ,eAAe;GACf,uBAAuB;GACvB,sBAAsB;GACtB,YAAY;GACZ,gBAAgB;GAChB,qBAAqB;GACrB,gBAAgB;GAChB,kBAAkB;GAClB,eAAe;GACf,eAAe;GACf,kBAAkB;GAClB,yBAAyB;GACzB,kBACE;GACF,sBAAsB;GACtB,qBAAqB;GACrB,2BACE;GACF,mBAAmB;GACnB,mBAAmB;GACnB,sBAAsB;GACtB,oBAAoB;GACpB,oBAAoB;GACpB,oBAAoB;GACpB,yBACE;GACF,uBAAuB;GACvB,uBAAuB;GACvB,wBAAwB;GACxB,yBAAyB;GACzB,+BAA+B;GAC/B,0BAA0B;GAC1B,8BAA8B;GAC9B,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