@kode4/react-foundation 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (126) hide show
  1. package/DESIGN-SYSTEM.md +190 -0
  2. package/INSTRUCTIONS.md +694 -0
  3. package/LICENSE +21 -0
  4. package/README.md +53 -0
  5. package/errors.d.ts +24 -0
  6. package/forms/Form/Form.d.ts +30 -0
  7. package/forms/Form/index.d.ts +1 -0
  8. package/forms/index.d.ts +1 -0
  9. package/hooks/index.d.ts +1 -0
  10. package/hooks/useMediaQuery.d.ts +8 -0
  11. package/index.d.ts +24 -0
  12. package/index.js +1679 -0
  13. package/index.js.map +1 -0
  14. package/internal/env.d.ts +1 -0
  15. package/internal/registry.d.ts +3 -0
  16. package/internal/type-utils.d.ts +6 -0
  17. package/layout/AppLayout/AppLayout.d.ts +18 -0
  18. package/layout/AppLayout/index.d.ts +1 -0
  19. package/layout/CenteredLayout/CenteredLayout.d.ts +12 -0
  20. package/layout/CenteredLayout/index.d.ts +1 -0
  21. package/layout/Columns/Columns.d.ts +35 -0
  22. package/layout/Columns/index.d.ts +1 -0
  23. package/layout/Container/Container.d.ts +5 -0
  24. package/layout/Container/index.d.ts +1 -0
  25. package/layout/DashboardGrid/DashboardGrid.d.ts +37 -0
  26. package/layout/DashboardGrid/index.d.ts +1 -0
  27. package/layout/FillHeight/FillHeight.d.ts +16 -0
  28. package/layout/FillHeight/index.d.ts +1 -0
  29. package/layout/Footer/Footer.d.ts +5 -0
  30. package/layout/Footer/index.d.ts +1 -0
  31. package/layout/Header/Header.d.ts +13 -0
  32. package/layout/Header/index.d.ts +1 -0
  33. package/layout/SideBar/SideBar.d.ts +6 -0
  34. package/layout/SideBar/index.d.ts +1 -0
  35. package/layout/SiteLayout/SiteLayout.d.ts +27 -0
  36. package/layout/SiteLayout/index.d.ts +1 -0
  37. package/layout/SkipLink/SkipLink.d.ts +9 -0
  38. package/layout/SkipLink/index.d.ts +1 -0
  39. package/layout/TopBar/TopBar.d.ts +32 -0
  40. package/layout/TopBar/index.d.ts +1 -0
  41. package/layout/index.d.ts +12 -0
  42. package/package.json +52 -0
  43. package/query/index.d.ts +1 -0
  44. package/query/sort.d.ts +19 -0
  45. package/router/DefaultErrorBoundary.d.ts +5 -0
  46. package/router/TypedLink/TypedLink.d.ts +22 -0
  47. package/router/TypedLink/index.d.ts +1 -0
  48. package/router/adapter.d.ts +27 -0
  49. package/router/chain.d.ts +17 -0
  50. package/router/context.d.ts +24 -0
  51. package/router/createAppRouter.d.ts +15 -0
  52. package/router/defineRoute.d.ts +11 -0
  53. package/router/index.d.ts +11 -0
  54. package/router/menu.d.ts +51 -0
  55. package/router/pathTo.d.ts +21 -0
  56. package/router/types.d.ts +72 -0
  57. package/router/useRoute.d.ts +22 -0
  58. package/style.css +3 -0
  59. package/theme/ModeToggle/ModeToggle.d.ts +6 -0
  60. package/theme/ModeToggle/index.d.ts +1 -0
  61. package/theme/ThemeProvider/ThemeProvider.d.ts +25 -0
  62. package/theme/ThemeProvider/index.d.ts +1 -0
  63. package/theme/Toaster/Toaster.d.ts +9 -0
  64. package/theme/Toaster/index.d.ts +2 -0
  65. package/theme/Toaster/toast.d.ts +38 -0
  66. package/theme/index.d.ts +3 -0
  67. package/ui/Accordion/Accordion.d.ts +7 -0
  68. package/ui/Accordion/index.d.ts +1 -0
  69. package/ui/Alert/Alert.d.ts +11 -0
  70. package/ui/Alert/index.d.ts +1 -0
  71. package/ui/AlertDialog/AlertDialog.d.ts +19 -0
  72. package/ui/AlertDialog/index.d.ts +1 -0
  73. package/ui/Avatar/Avatar.d.ts +7 -0
  74. package/ui/Avatar/index.d.ts +1 -0
  75. package/ui/AwaitErrorBlock/AwaitErrorBlock.d.ts +11 -0
  76. package/ui/AwaitErrorBlock/index.d.ts +1 -0
  77. package/ui/Badge/Badge.d.ts +10 -0
  78. package/ui/Badge/index.d.ts +1 -0
  79. package/ui/Button/Button.d.ts +13 -0
  80. package/ui/Button/index.d.ts +1 -0
  81. package/ui/Card/Card.d.ts +11 -0
  82. package/ui/Card/index.d.ts +1 -0
  83. package/ui/Checkbox/Checkbox.d.ts +5 -0
  84. package/ui/Checkbox/index.d.ts +1 -0
  85. package/ui/Command/Command.d.ts +19 -0
  86. package/ui/Command/index.d.ts +1 -0
  87. package/ui/Dialog/Dialog.d.ts +17 -0
  88. package/ui/Dialog/index.d.ts +1 -0
  89. package/ui/DropdownMenu/DropdownMenu.d.ts +28 -0
  90. package/ui/DropdownMenu/index.d.ts +1 -0
  91. package/ui/ErrorBlock/ErrorBlock.d.ts +21 -0
  92. package/ui/ErrorBlock/index.d.ts +1 -0
  93. package/ui/Input/Input.d.ts +4 -0
  94. package/ui/Input/index.d.ts +1 -0
  95. package/ui/Label/Label.d.ts +5 -0
  96. package/ui/Label/index.d.ts +1 -0
  97. package/ui/Pagination/Pagination.d.ts +17 -0
  98. package/ui/Pagination/index.d.ts +1 -0
  99. package/ui/Popover/Popover.d.ts +7 -0
  100. package/ui/Popover/index.d.ts +1 -0
  101. package/ui/Progress/Progress.d.ts +16 -0
  102. package/ui/Progress/index.d.ts +1 -0
  103. package/ui/RadioGroup/RadioGroup.d.ts +7 -0
  104. package/ui/RadioGroup/index.d.ts +1 -0
  105. package/ui/Select/Select.d.ts +16 -0
  106. package/ui/Select/index.d.ts +1 -0
  107. package/ui/Separator/Separator.d.ts +5 -0
  108. package/ui/Separator/index.d.ts +1 -0
  109. package/ui/Sheet/Sheet.d.ts +17 -0
  110. package/ui/Sheet/index.d.ts +1 -0
  111. package/ui/Skeleton/Skeleton.d.ts +4 -0
  112. package/ui/Skeleton/index.d.ts +1 -0
  113. package/ui/Spinner/Spinner.d.ts +35 -0
  114. package/ui/Spinner/index.d.ts +1 -0
  115. package/ui/Switch/Switch.d.ts +5 -0
  116. package/ui/Switch/index.d.ts +1 -0
  117. package/ui/Table/Table.d.ts +11 -0
  118. package/ui/Table/index.d.ts +1 -0
  119. package/ui/Tabs/Tabs.d.ts +8 -0
  120. package/ui/Tabs/index.d.ts +1 -0
  121. package/ui/Textarea/Textarea.d.ts +4 -0
  122. package/ui/Textarea/index.d.ts +1 -0
  123. package/ui/Tooltip/Tooltip.d.ts +7 -0
  124. package/ui/Tooltip/index.d.ts +1 -0
  125. package/ui/index.d.ts +29 -0
  126. package/utils.d.ts +8 -0
package/index.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../src/lib/errors.ts","../src/lib/utils.ts","../src/lib/ui/Label/Label.tsx","../src/lib/forms/Form/Form.tsx","../src/lib/hooks/useMediaQuery.ts","../src/lib/layout/AppLayout/AppLayout.tsx","../src/lib/layout/CenteredLayout/CenteredLayout.tsx","../src/lib/layout/Columns/Columns.tsx","../src/lib/layout/Container/Container.tsx","../src/lib/layout/DashboardGrid/DashboardGrid.tsx","../src/lib/layout/FillHeight/FillHeight.tsx","../src/lib/layout/Footer/Footer.tsx","../src/lib/layout/Header/Header.tsx","../src/lib/layout/SideBar/SideBar.tsx","../src/lib/layout/SiteLayout/SiteLayout.tsx","../src/lib/layout/SkipLink/SkipLink.tsx","../src/lib/ui/Button/Button.tsx","../src/lib/ui/Sheet/Sheet.tsx","../src/lib/layout/TopBar/TopBar.tsx","../src/lib/query/sort.ts","../src/lib/ui/Alert/Alert.tsx","../src/lib/ui/ErrorBlock/ErrorBlock.tsx","../src/lib/router/DefaultErrorBoundary.tsx","../src/lib/internal/registry.ts","../src/lib/ui/Spinner/Spinner.tsx","../src/lib/router/adapter.ts","../src/lib/router/chain.ts","../src/lib/router/createAppRouter.ts","../src/lib/router/defineRoute.ts","../src/lib/router/menu.ts","../src/lib/internal/env.ts","../src/lib/router/pathTo.ts","../src/lib/router/TypedLink/TypedLink.tsx","../src/lib/router/useRoute.ts","../src/lib/ui/DropdownMenu/DropdownMenu.tsx","../src/lib/theme/ThemeProvider/ThemeProvider.tsx","../src/lib/theme/ModeToggle/ModeToggle.tsx","../src/lib/theme/Toaster/Toaster.tsx","../src/lib/theme/Toaster/toast.tsx","../src/lib/ui/Accordion/Accordion.tsx","../src/lib/ui/AlertDialog/AlertDialog.tsx","../src/lib/ui/Avatar/Avatar.tsx","../src/lib/ui/AwaitErrorBlock/AwaitErrorBlock.tsx","../src/lib/ui/Badge/Badge.tsx","../src/lib/ui/Card/Card.tsx","../src/lib/ui/Checkbox/Checkbox.tsx","../src/lib/ui/Dialog/Dialog.tsx","../src/lib/ui/Command/Command.tsx","../src/lib/ui/Input/Input.tsx","../src/lib/ui/Pagination/Pagination.tsx","../src/lib/ui/Popover/Popover.tsx","../src/lib/ui/Progress/Progress.tsx","../src/lib/ui/RadioGroup/RadioGroup.tsx","../src/lib/ui/Select/Select.tsx","../src/lib/ui/Separator/Separator.tsx","../src/lib/ui/Skeleton/Skeleton.tsx","../src/lib/ui/Switch/Switch.tsx","../src/lib/ui/Table/Table.tsx","../src/lib/ui/Tabs/Tabs.tsx","../src/lib/ui/Textarea/Textarea.tsx","../src/lib/ui/Tooltip/Tooltip.tsx"],"sourcesContent":["import { isRouteErrorResponse } from 'react-router-dom';\n\n/**\n * Structured application error. Throw this in your own code\n * when you want a machine-readable code alongside the message.\n */\nexport class AppError extends Error {\n\tcode: string;\n\tdetails?: unknown;\n\n\tconstructor(code: string, message: string, details?: unknown) {\n\t\tsuper(message);\n\t\tthis.name = 'AppError';\n\t\tthis.code = code;\n\t\tthis.details = details;\n\t}\n}\n\n/**\n * Consistent shape for displaying any error, regardless of origin.\n */\nexport type NormalizedError = {\n\tcode?: string;\n\tmessage: string;\n\tdetails?: unknown;\n\toriginal: unknown;\n};\n\n/**\n * Converts any thrown value into a consistent display shape.\n * Handles AppError, React Router responses, standard Errors,\n * strings, and unknown values.\n */\nexport function normalizeError(error: unknown): NormalizedError {\n\tif (error instanceof AppError) {\n\t\treturn {\n\t\t\tcode: error.code,\n\t\t\tmessage: error.message,\n\t\t\tdetails: error.details,\n\t\t\toriginal: error,\n\t\t};\n\t}\n\n\tif (isRouteErrorResponse(error)) {\n\t\treturn {\n\t\t\tcode: String(error.status),\n\t\t\tmessage: error.statusText || `HTTP ${error.status}`,\n\t\t\tdetails: error.data,\n\t\t\toriginal: error,\n\t\t};\n\t}\n\n\tif (error instanceof Error) {\n\t\treturn {\n\t\t\tmessage: error.message,\n\t\t\toriginal: error,\n\t\t};\n\t}\n\n\tif (typeof error === 'string') {\n\t\treturn {\n\t\t\tmessage: error,\n\t\t\toriginal: error,\n\t\t};\n\t}\n\n\treturn {\n\t\tmessage: 'An unknown error occurred',\n\t\toriginal: error,\n\t};\n}\n","import { type ClassValue, clsx } from 'clsx';\n\n/**\n * Joins class values (strings, conditionals, arrays) into one className.\n * Same call signature as shadcn's `cn`, but without tailwind-merge —\n * our classes are semantic BEM names, so utility-conflict merging is\n * unnecessary.\n */\nexport function cn(...inputs: ClassValue[]): string {\n\treturn clsx(inputs);\n}\n","import { Label as LabelPrimitive } from 'radix-ui';\nimport type { ComponentProps } from 'react';\n\nimport { cn } from '../../utils';\nimport './Label.css';\n\nexport type LabelProps = ComponentProps<typeof LabelPrimitive.Root>;\n\nexport function Label({ className, ...props }: LabelProps) {\n\treturn <LabelPrimitive.Root className={cn('k4-label', className)} {...props} />;\n}\n","import { Slot } from 'radix-ui';\nimport { type ComponentProps, createContext, useContext, useId } from 'react';\nimport {\n\tController,\n\ttype ControllerProps,\n\ttype FieldPath,\n\ttype FieldValues,\n\tFormProvider,\n\tuseFormContext,\n\tuseFormState,\n} from 'react-hook-form';\n\nimport { Label } from '../../ui/Label';\nimport { cn } from '../../utils';\nimport './Form.css';\n\n/**\n * react-hook-form integration, mirroring shadcn's Form API:\n * <Form> (FormProvider) → <FormField> (Controller) → <FormItem> with\n * <FormLabel>/<FormControl>/<FormDescription>/<FormMessage>, all wired for\n * accessibility (ids, aria-describedby, aria-invalid).\n */\nexport const Form = FormProvider;\n\ntype FormFieldContextValue<\n\tTFieldValues extends FieldValues = FieldValues,\n\tTName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n> = {\n\tname: TName;\n};\n\nconst FormFieldContext = createContext<FormFieldContextValue | undefined>(undefined);\n\nexport function FormField<\n\tTFieldValues extends FieldValues = FieldValues,\n\tTName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n>(props: ControllerProps<TFieldValues, TName>) {\n\treturn (\n\t\t<FormFieldContext.Provider value={{ name: props.name }}>\n\t\t\t<Controller {...props} />\n\t\t</FormFieldContext.Provider>\n\t);\n}\n\ntype FormItemContextValue = {\n\tid: string;\n};\n\nconst FormItemContext = createContext<FormItemContextValue | undefined>(undefined);\n\nexport function useFormField() {\n\tconst fieldContext = useContext(FormFieldContext);\n\tconst itemContext = useContext(FormItemContext);\n\tconst { getFieldState } = useFormContext();\n\tconst formState = useFormState({ name: fieldContext?.name });\n\n\tif (!fieldContext) {\n\t\tthrow new Error('useFormField should be used within <FormField>');\n\t}\n\tconst fieldState = getFieldState(fieldContext.name, formState);\n\n\tconst id = itemContext?.id ?? fieldContext.name;\n\n\treturn {\n\t\tid,\n\t\tname: fieldContext.name,\n\t\tformItemId: `${id}-form-item`,\n\t\tformDescriptionId: `${id}-form-item-description`,\n\t\tformMessageId: `${id}-form-item-message`,\n\t\t...fieldState,\n\t};\n}\n\nexport function FormItem({ className, ...props }: ComponentProps<'div'>) {\n\tconst id = useId();\n\n\treturn (\n\t\t<FormItemContext.Provider value={{ id }}>\n\t\t\t<div className={cn('k4-form__item', className)} {...props} />\n\t\t</FormItemContext.Provider>\n\t);\n}\n\nexport function FormLabel({ className, ...props }: ComponentProps<typeof Label>) {\n\tconst { error, formItemId } = useFormField();\n\n\treturn (\n\t\t<Label\n\t\t\tclassName={cn('k4-form__label', error && 'k4-form__label--error', className)}\n\t\t\thtmlFor={formItemId}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport function FormControl(props: ComponentProps<typeof Slot.Root>) {\n\tconst { error, formItemId, formDescriptionId, formMessageId } = useFormField();\n\n\treturn (\n\t\t<Slot.Root\n\t\t\tid={formItemId}\n\t\t\taria-describedby={!error ? formDescriptionId : `${formDescriptionId} ${formMessageId}`}\n\t\t\taria-invalid={!!error}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport function FormDescription({ className, ...props }: ComponentProps<'p'>) {\n\tconst { formDescriptionId } = useFormField();\n\n\treturn (\n\t\t<p id={formDescriptionId} className={cn('k4-form__description', className)} {...props} />\n\t);\n}\n\nexport function FormMessage({ className, children, ...props }: ComponentProps<'p'>) {\n\tconst { error, formMessageId } = useFormField();\n\tconst body = error ? String(error.message ?? '') : children;\n\n\tif (!body) return null;\n\n\treturn (\n\t\t<p id={formMessageId} className={cn('k4-form__message', className)} {...props}>\n\t\t\t{body}\n\t\t</p>\n\t);\n}\n","import { useEffect, useState } from 'react';\n\n/**\n * Reactively tracks a CSS media query. Returns whether it currently matches and\n * updates on change. Use for responsive behaviour that can't be pure CSS — e.g.\n * swapping an inline nav for a mobile drawer.\n *\n * const isMobile = useMediaQuery('(max-width: 768px)');\n */\nexport function useMediaQuery(query: string): boolean {\n\tconst [matches, setMatches] = useState(() =>\n\t\ttypeof window !== 'undefined' ? window.matchMedia(query).matches : false,\n\t);\n\n\tuseEffect(() => {\n\t\tconst mql = window.matchMedia(query);\n\t\tconst onChange = () => setMatches(mql.matches);\n\t\tonChange();\n\t\tmql.addEventListener('change', onChange);\n\t\treturn () => mql.removeEventListener('change', onChange);\n\t}, [query]);\n\n\treturn matches;\n}\n","import type { ComponentProps, ReactNode } from 'react';\n\nimport { cn } from '../../utils';\nimport './AppLayout.css';\n\nexport type AppLayoutProps = ComponentProps<'div'> & {\n\t/** Fixed top region (e.g. a TopBar or Header). */\n\theader?: ReactNode;\n\t/** Fixed bottom region. */\n\tfooter?: ReactNode;\n\t/** id of the scrollable <main> (the SkipLink target). Default 'main'. */\n\tmainId?: string;\n\t/** Accessible name for the scroll region (it is keyboard-focusable). */\n\tcontentLabel?: string;\n};\n\n/**\n * Desktop-app frame: a viewport-tall column with a fixed header and footer and\n * an independently-scrolling content pane between them. The chrome never\n * scrolls; only the content does.\n */\nexport function AppLayout({\n\theader,\n\tfooter,\n\tmainId = 'main',\n\tcontentLabel = 'Main content',\n\tclassName,\n\tchildren,\n\t...props\n}: AppLayoutProps) {\n\treturn (\n\t\t<div className={cn('k4-app-layout', className)} {...props}>\n\t\t\t{header != null && <div className=\"k4-app-layout__header\">{header}</div>}\n\t\t\t<main\n\t\t\t\tid={mainId}\n\t\t\t\tclassName=\"k4-app-layout__content\"\n\t\t\t\ttabIndex={0}\n\t\t\t\taria-label={contentLabel}>\n\t\t\t\t{children}\n\t\t\t</main>\n\t\t\t{footer != null && <div className=\"k4-app-layout__footer\">{footer}</div>}\n\t\t</div>\n\t);\n}\n","import type { ComponentProps, ReactNode } from 'react';\n\nimport { cn } from '../../utils';\nimport './CenteredLayout.css';\n\nexport type CenteredLayoutProps = ComponentProps<'div'> & {\n\theader?: ReactNode;\n\tfooter?: ReactNode;\n\tmainId?: string;\n};\n\n/**\n * Focused frame: centers a constrained content block in the viewport. Good for\n * auth, onboarding, and empty states. Optional header/footer.\n */\nexport function CenteredLayout({\n\theader,\n\tfooter,\n\tmainId = 'main',\n\tclassName,\n\tchildren,\n\t...props\n}: CenteredLayoutProps) {\n\treturn (\n\t\t<div className={cn('k4-centered-layout', className)} {...props}>\n\t\t\t{header != null && <div className=\"k4-centered-layout__header\">{header}</div>}\n\t\t\t<main id={mainId} className=\"k4-centered-layout__content\">\n\t\t\t\t{children}\n\t\t\t</main>\n\t\t\t{footer != null && <div className=\"k4-centered-layout__footer\">{footer}</div>}\n\t\t</div>\n\t);\n}\n","import { cva, type VariantProps } from 'class-variance-authority';\nimport type { ComponentProps, CSSProperties, ReactNode } from 'react';\n\nimport { cn } from '../../utils';\nimport './Columns.css';\n\nexport const columnsVariants = cva('k4-columns', {\n\tvariants: {\n\t\t/** Fill the layout's available content height (reuses --k4-content-height).\n\t\t * The block grows with content; the layout scrolls as one. */\n\t\tfillHeight: { true: 'k4-columns--fill', false: '' },\n\t\t/** Lock to the available height and scroll each column independently\n\t\t * (app-shell). Implies a bounded height; needs a layout that provides\n\t\t * --k4-content-height (e.g. AppLayout). */\n\t\tscroll: { true: 'k4-columns--scroll', false: '' },\n\t\t/** Gutter between columns. */\n\t\tgap: { true: 'k4-columns--gap', false: '' },\n\t},\n\tdefaultVariants: { fillHeight: false, scroll: false, gap: true },\n});\n\nexport type ColumnsProps = ComponentProps<'div'> &\n\tVariantProps<typeof columnsVariants> & {\n\t\t/** Left aside — put a <nav>/<aside> inside it for a landmark. */\n\t\tleft?: ReactNode;\n\t\t/** Right aside (e.g. an \"on this page\" table of contents). */\n\t\tright?: ReactNode;\n\t\t/** Left aside width (any CSS length). Sets --k4-columns-left for this instance. */\n\t\tleftWidth?: string;\n\t\t/** Right aside width. Sets --k4-columns-right. */\n\t\trightWidth?: string;\n\t};\n\n/**\n * Column layout — optional left and right asides around the content children\n * (the holy-grail row). It's a generic grid, so it composes anywhere: a frame's\n * content pane, a Card body, a Dialog body. Columns can be nested.\n *\n * Height modes:\n * - default — sizes to content.\n * - `fillHeight` — fills the layout's available height (`--k4-content-height`);\n * the block grows with content and the layout scrolls as one.\n * - `scroll` — locks to the available height and gives each column its own\n * scroll (with overscroll containment, so scrolling a column doesn't chain to\n * the page). The scroll cells are keyboard-focusable (WCAG 2.1.1).\n *\n * Aside widths are CSS vars, overridable per-instance (leftWidth/rightWidth) or\n * globally. Collapses to a single column on narrow screens.\n */\nexport function Columns({\n\tleft,\n\tright,\n\tleftWidth,\n\trightWidth,\n\tfillHeight,\n\tscroll,\n\tgap,\n\tclassName,\n\tstyle,\n\tchildren,\n\t...props\n}: ColumnsProps) {\n\tconst widthVars = {\n\t\t...(leftWidth ? { '--k4-columns-left': leftWidth } : null),\n\t\t...(rightWidth ? { '--k4-columns-right': rightWidth } : null),\n\t} as CSSProperties;\n\n\t// In scroll mode the cells are scroll containers; make them keyboard-\n\t// scrollable for users without focusable content inside.\n\tconst cellProps = scroll ? { tabIndex: 0 } : {};\n\n\treturn (\n\t\t<div\n\t\t\tclassName={cn(\n\t\t\t\tcolumnsVariants({ fillHeight, scroll, gap }),\n\t\t\t\tleft != null && 'k4-columns--has-left',\n\t\t\t\tright != null && 'k4-columns--has-right',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\tstyle={{ ...widthVars, ...style }}\n\t\t\t{...props}>\n\t\t\t{left != null && (\n\t\t\t\t<div className=\"k4-columns__cell k4-columns__left\" {...cellProps}>\n\t\t\t\t\t{left}\n\t\t\t\t</div>\n\t\t\t)}\n\t\t\t<div className=\"k4-columns__cell k4-columns__content\" {...cellProps}>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t\t{right != null && (\n\t\t\t\t<div className=\"k4-columns__cell k4-columns__right\" {...cellProps}>\n\t\t\t\t\t{right}\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</div>\n\t);\n}\n","import type { ComponentProps } from 'react';\n\nimport { cn } from '../../utils';\nimport './Container.css';\n\nexport type ContainerProps = ComponentProps<'div'>;\n\n/** Centers and width-constrains content; use inside full-bleed sections. */\nexport function Container({ className, ...props }: ContainerProps) {\n\treturn <div className={cn('k4-container', className)} {...props} />;\n}\n","import { createContext, useContext, type ComponentProps, type CSSProperties } from 'react';\n\nimport { cn } from '../../utils';\nimport './DashboardGrid.css';\n\n/** Carries the grid's column count down to items so spans can be clamped. */\nconst DashboardColumnsContext = createContext(4);\n\nexport type DashboardGridProps = ComponentProps<'div'> & {\n\t/** Number of equal columns (desktop/tablet). Default 4. Collapses to a single\n\t * column on phones. */\n\tcolumns?: number;\n\t/** Minimum height of one row track; rows grow past it when content needs more.\n\t * Row spans are multiples of this track, so it sets the dashboard's rhythm. */\n\trowHeight?: string;\n};\n\n/**\n * A responsive dashboard grid — equal columns with a base row height, into which\n * blocks (typically `Card`s) are dropped via `DashboardGridItem`. Blocks default\n * to one cell and can span columns and/or rows. On phones the grid collapses to\n * a single column and spans are ignored, so it's usable on touch out of the box.\n *\n * ```tsx\n * <DashboardGrid columns={4}>\n * <DashboardGridItem colSpan={2}><Card>…</Card></DashboardGridItem>\n * <DashboardGridItem><Card>…</Card></DashboardGridItem>\n * <DashboardGridItem colSpan={2} rowSpan={2}><Card>…</Card></DashboardGridItem>\n * </DashboardGrid>\n * ```\n */\nexport function DashboardGrid({\n\tcolumns = 4,\n\trowHeight = '7rem',\n\tclassName,\n\tstyle,\n\tchildren,\n\t...props\n}: DashboardGridProps) {\n\treturn (\n\t\t<DashboardColumnsContext.Provider value={columns}>\n\t\t\t<div\n\t\t\t\tclassName={cn('k4-dashboard-grid', className)}\n\t\t\t\tstyle={\n\t\t\t\t\t{\n\t\t\t\t\t\t'--k4-grid-columns': columns,\n\t\t\t\t\t\t'--k4-grid-row-height': rowHeight,\n\t\t\t\t\t\t...style,\n\t\t\t\t\t} as CSSProperties\n\t\t\t\t}\n\t\t\t\t{...props}>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t</DashboardColumnsContext.Provider>\n\t);\n}\n\nexport type DashboardGridItemProps = ComponentProps<'div'> & {\n\t/** Columns to span (default 1). Clamped to the grid's column count so a block\n\t * can never overflow the grid width. */\n\tcolSpan?: number;\n\t/** Row tracks to span (default 1). */\n\trowSpan?: number;\n};\n\n/**\n * A cell in a `DashboardGrid`. Put a `Card` (or any block) inside — it stretches\n * to fill the cell, so blocks in a row share a height.\n */\nexport function DashboardGridItem({\n\tcolSpan = 1,\n\trowSpan = 1,\n\tclassName,\n\tstyle,\n\tchildren,\n\t...props\n}: DashboardGridItemProps) {\n\tconst columns = useContext(DashboardColumnsContext);\n\tconst cols = Math.max(1, Math.min(colSpan, columns)); // never exceed the grid\n\tconst rows = Math.max(1, rowSpan);\n\n\treturn (\n\t\t<div\n\t\t\tclassName={cn('k4-dashboard-grid__item', className)}\n\t\t\tstyle={\n\t\t\t\t{\n\t\t\t\t\t'--k4-grid-col-span': cols,\n\t\t\t\t\t'--k4-grid-row-span': rows,\n\t\t\t\t\t...style,\n\t\t\t\t} as CSSProperties\n\t\t\t}\n\t\t\t{...props}>\n\t\t\t{children}\n\t\t</div>\n\t);\n}\n","import type { ComponentProps } from 'react';\n\nimport { cn } from '../../utils';\nimport './FillHeight.css';\n\nexport type FillHeightProps = ComponentProps<'div'>;\n\n/**\n * A panel that fills the available height of its layout's content area —\n * the viewport minus the chrome. Inside AppLayout it fills the scrolling\n * content pane; inside SiteLayout it fills the viewport below the (sticky)\n * header. Good for full-height hero sections and empty states.\n *\n * Reads the `--k4-content-height` variable the layouts expose, falling back to\n * the small viewport (`100svh`) when used standalone. It uses `min-height` (not\n * `height`) so taller content can still grow and scroll. Inside AppLayout it\n * should be a direct child of the content pane (it fills via 100% of that\n * definite-height pane).\n */\nexport function FillHeight({ className, ...props }: FillHeightProps) {\n\treturn <div className={cn('k4-fill-height', className)} {...props} />;\n}\n","import type { ComponentProps } from 'react';\n\nimport { cn } from '../../utils';\nimport './Footer.css';\n\nexport type FooterProps = ComponentProps<'footer'>;\n\n/** Generic bottom region (contentinfo landmark). */\nexport function Footer({ className, ...props }: FooterProps) {\n\treturn <footer className={cn('k4-footer', className)} {...props} />;\n}\n","import type { ComponentProps, ReactNode } from 'react';\n\nimport { cn } from '../../utils';\nimport './Header.css';\n\nexport type HeaderProps = ComponentProps<'header'> & {\n\t/** Left slot — typically a brand/logo. */\n\tstart?: ReactNode;\n\t/** Right slot — typically actions (theme toggle, account, …). */\n\tend?: ReactNode;\n\t/** Shrink on scroll (CSS scroll-timeline; respects prefers-reduced-motion).\n\t * Use inside SiteLayout, whose page scroll drives the animation. */\n\tcondense?: boolean;\n};\n\n/** Generic top region (banner landmark) with start / center / end slots. */\nexport function Header({ start, end, condense, className, children, ...props }: HeaderProps) {\n\treturn (\n\t\t<header\n\t\t\tclassName={cn('k4-header', condense && 'k4-header--condense', className)}\n\t\t\t{...props}>\n\t\t\t{start != null && <div className=\"k4-header__start\">{start}</div>}\n\t\t\t{children != null && <div className=\"k4-header__center\">{children}</div>}\n\t\t\t{end != null && <div className=\"k4-header__end\">{end}</div>}\n\t\t</header>\n\t);\n}\n","import type { ReactNode } from 'react';\nimport { NavLink } from 'react-router-dom';\n\nimport type { MenuItem } from '../../router/menu';\nimport { cn } from '../../utils';\nimport './SideBar.css';\n\nexport type SideBarProps = {\n\titems: MenuItem[];\n};\n\nexport function SideBar({ items }: SideBarProps) {\n\tif (!items.length) return null;\n\treturn (\n\t\t<aside className=\"k4-sidebar\">\n\t\t\t<nav>\n\t\t\t\t<ul>\n\t\t\t\t\t{items.map((item, i) => (\n\t\t\t\t\t\t<SideBarNode key={nodeKey(item, i)} item={item} />\n\t\t\t\t\t))}\n\t\t\t\t</ul>\n\t\t\t</nav>\n\t\t</aside>\n\t);\n}\n\nfunction SideBarNode({ item }: { item: MenuItem }) {\n\tswitch (item.kind) {\n\t\tcase 'item':\n\t\t\treturn <SideBarItem item={item} />;\n\t\tcase 'group':\n\t\t\treturn <SideBarGroup item={item} />;\n\t\tcase 'separator':\n\t\t\treturn <SideBarSeparator />;\n\t\tcase 'content':\n\t\t\treturn <SideBarContent>{item.content}</SideBarContent>;\n\t}\n}\n\nfunction SideBarItem({ item }: { item: MenuItem & { kind: 'item' } }) {\n\treturn (\n\t\t<li>\n\t\t\t<NavLink\n\t\t\t\tto={item.path}\n\t\t\t\tend={!item.children?.length}\n\t\t\t\tclassName={({ isActive }) =>\n\t\t\t\t\tcn('k4-sidebar__link', isActive && 'k4-sidebar__link--active')\n\t\t\t\t}>\n\t\t\t\t<span className=\"k4-sidebar__label\">{item.label}</span>\n\t\t\t</NavLink>\n\t\t\t{item.children?.length ? (\n\t\t\t\t<ul className=\"k4-sidebar__children\">\n\t\t\t\t\t{item.children.map((c, i) => (\n\t\t\t\t\t\t<SideBarNode key={nodeKey(c, i)} item={c} />\n\t\t\t\t\t))}\n\t\t\t\t</ul>\n\t\t\t) : null}\n\t\t</li>\n\t);\n}\n\nfunction SideBarGroup({ item }: { item: MenuItem & { kind: 'group' } }) {\n\treturn (\n\t\t<li className=\"k4-sidebar__group\">\n\t\t\t<span className=\"k4-sidebar__group-label\">{item.label}</span>\n\t\t\t<ul>\n\t\t\t\t{item.items.map((c, i) => (\n\t\t\t\t\t<SideBarNode key={nodeKey(c, i)} item={c} />\n\t\t\t\t))}\n\t\t\t</ul>\n\t\t</li>\n\t);\n}\n\nfunction SideBarSeparator() {\n\treturn <li className=\"k4-sidebar__separator\" role=\"separator\" />;\n}\n\nfunction SideBarContent({ children }: { children: ReactNode }) {\n\treturn <li className=\"k4-sidebar__content\">{children}</li>;\n}\n\nfunction nodeKey(item: MenuItem, index: number): string {\n\tif (item.kind === 'item') return item.path;\n\tif (item.kind === 'group') return `group-${item.label}`;\n\treturn `${item.kind}-${index}`;\n}\n","import type { ComponentProps, CSSProperties, ReactNode } from 'react';\n\nimport { cn } from '../../utils';\nimport './SiteLayout.css';\n\nexport type SiteLayoutProps = ComponentProps<'div'> & {\n\t/** Sticky top region (pass a condensing Header for shrink-on-scroll). */\n\theader?: ReactNode;\n\t/** Bottom region (sticky-footer behaviour). */\n\tfooter?: ReactNode;\n\t/** id of the <main> (the SkipLink target). Default 'main'. */\n\tmainId?: string;\n\t/**\n\t * Content width:\n\t * - `'default'` (default) — centered + constrained to the `--k4-site-width`\n\t * token; the typical website column.\n\t * - `'full'` — edge-to-edge content (landing/marketing). Re-constrain\n\t * individual sections with `<Container>` so backgrounds can bleed.\n\t * - any CSS length (e.g. `'60rem'`) — constrain to that width (sets\n\t * `--k4-site-width` inline for this instance).\n\t */\n\tmaxWidth?: 'default' | 'full' | (string & {});\n};\n\n/**\n * Website frame: the page scrolls. The header is sticky; the footer uses the\n * sticky-footer pattern (pinned to the viewport bottom when content is short,\n * pushed below the fold when content is tall). `maxWidth` switches between a\n * constrained site column and full-bleed sections.\n */\nexport function SiteLayout({\n\theader,\n\tfooter,\n\tmainId = 'main',\n\tmaxWidth = 'default',\n\tclassName,\n\tchildren,\n\t...props\n}: SiteLayoutProps) {\n\tconst constrained = maxWidth !== 'full';\n\tconst style =\n\t\tconstrained && maxWidth !== 'default'\n\t\t\t? ({ '--k4-site-width': maxWidth } as CSSProperties)\n\t\t\t: undefined;\n\n\treturn (\n\t\t<div className={cn('k4-site-layout', className)} {...props}>\n\t\t\t{header != null && <div className=\"k4-site-layout__header\">{header}</div>}\n\t\t\t<main\n\t\t\t\tid={mainId}\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'k4-site-layout__content',\n\t\t\t\t\tconstrained && 'k4-site-layout__content--constrained',\n\t\t\t\t)}\n\t\t\t\tstyle={style}>\n\t\t\t\t{children}\n\t\t\t</main>\n\t\t\t{footer != null && <div className=\"k4-site-layout__footer\">{footer}</div>}\n\t\t</div>\n\t);\n}\n","import type { ComponentProps } from 'react';\n\nimport { cn } from '../../utils';\nimport './SkipLink.css';\n\nexport type SkipLinkProps = ComponentProps<'a'> & {\n\t/** id of the main-content target. Default 'main'. */\n\ttargetId?: string;\n};\n\n/** Visually-hidden \"skip to content\" link that appears on keyboard focus.\n * Render it as the first focusable element on the page. */\nexport function SkipLink({ targetId = 'main', className, children, ...props }: SkipLinkProps) {\n\treturn (\n\t\t<a href={`#${targetId}`} className={cn('k4-skip-link', className)} {...props}>\n\t\t\t{children ?? 'Skip to main content'}\n\t\t</a>\n\t);\n}\n","import { cva, type VariantProps } from 'class-variance-authority';\nimport { Slot } from 'radix-ui';\nimport type { ComponentProps } from 'react';\n\nimport { cn } from '../../utils';\nimport './Button.css';\n\nexport const buttonVariants = cva('k4-button', {\n\tvariants: {\n\t\t/**\n\t\t * The color scheme, mirroring Alert/Toast: `default` is neutral,\n\t\t * `primary`/`secondary` use the brand tokens, `destructive`/`success`\n\t\t * are semantic. `ghost` and `link` are inherently surface-less.\n\t\t */\n\t\tvariant: {\n\t\t\tdefault: 'k4-button--default',\n\t\t\tprimary: 'k4-button--primary',\n\t\t\tsecondary: 'k4-button--secondary',\n\t\t\tdestructive: 'k4-button--destructive',\n\t\t\tsuccess: 'k4-button--success',\n\t\t\tghost: 'k4-button--ghost',\n\t\t\tlink: 'k4-button--link',\n\t\t},\n\t\t/**\n\t\t * `filled` (default) paints the surface in the variant color; `outline`\n\t\t * keeps a transparent surface and draws the variant color as the border\n\t\t * + text. Works with every color variant.\n\t\t */\n\t\tappearance: {\n\t\t\tfilled: '',\n\t\t\toutline: 'k4-button--outline',\n\t\t},\n\t\tsize: {\n\t\t\tdefault: 'k4-button--size-default',\n\t\t\tsm: 'k4-button--size-sm',\n\t\t\tlg: 'k4-button--size-lg',\n\t\t\ticon: 'k4-button--size-icon',\n\t\t},\n\t},\n\tdefaultVariants: {\n\t\tvariant: 'default',\n\t\tappearance: 'filled',\n\t\tsize: 'default',\n\t},\n});\n\nexport type ButtonProps = ComponentProps<'button'> &\n\tVariantProps<typeof buttonVariants> & {\n\t\t/** Render the child element instead of a <button>, merging props (Radix Slot). */\n\t\tasChild?: boolean;\n\t};\n\nexport function Button({\n\tclassName,\n\tvariant,\n\tappearance,\n\tsize,\n\tasChild = false,\n\t...props\n}: ButtonProps) {\n\tconst Comp = asChild ? Slot.Root : 'button';\n\treturn (\n\t\t<Comp className={cn(buttonVariants({ variant, appearance, size }), className)} {...props} />\n\t);\n}\n","import { XIcon } from 'lucide-react';\nimport { Dialog as SheetPrimitive } from 'radix-ui';\nimport type { ComponentProps } from 'react';\n\nimport { cn } from '../../utils';\nimport './Sheet.css';\n\nexport const Sheet = SheetPrimitive.Root;\nexport const SheetTrigger = SheetPrimitive.Trigger;\nexport const SheetClose = SheetPrimitive.Close;\nexport const SheetPortal = SheetPrimitive.Portal;\n\nexport function SheetOverlay({\n\tclassName,\n\t...props\n}: ComponentProps<typeof SheetPrimitive.Overlay>) {\n\treturn <SheetPrimitive.Overlay className={cn('k4-sheet__overlay', className)} {...props} />;\n}\n\nexport type SheetSide = 'top' | 'right' | 'bottom' | 'left';\n\nexport type SheetContentProps = ComponentProps<typeof SheetPrimitive.Content> & {\n\tside?: SheetSide;\n};\n\nexport function SheetContent({ className, children, side = 'right', ...props }: SheetContentProps) {\n\treturn (\n\t\t<SheetPortal>\n\t\t\t<SheetOverlay />\n\t\t\t<SheetPrimitive.Content\n\t\t\t\tclassName={cn('k4-sheet__content', `k4-sheet__content--${side}`, className)}\n\t\t\t\t{...props}>\n\t\t\t\t{children}\n\t\t\t\t<SheetPrimitive.Close className=\"k4-sheet__close\">\n\t\t\t\t\t<XIcon />\n\t\t\t\t\t<span className=\"k4-sr-only\">Close</span>\n\t\t\t\t</SheetPrimitive.Close>\n\t\t\t</SheetPrimitive.Content>\n\t\t</SheetPortal>\n\t);\n}\n\nexport function SheetHeader({ className, ...props }: ComponentProps<'div'>) {\n\treturn <div className={cn('k4-sheet__header', className)} {...props} />;\n}\n\nexport function SheetFooter({ className, ...props }: ComponentProps<'div'>) {\n\treturn <div className={cn('k4-sheet__footer', className)} {...props} />;\n}\n\nexport function SheetTitle({ className, ...props }: ComponentProps<typeof SheetPrimitive.Title>) {\n\treturn <SheetPrimitive.Title className={cn('k4-sheet__title', className)} {...props} />;\n}\n\nexport function SheetDescription({\n\tclassName,\n\t...props\n}: ComponentProps<typeof SheetPrimitive.Description>) {\n\treturn (\n\t\t<SheetPrimitive.Description className={cn('k4-sheet__description', className)} {...props} />\n\t);\n}\n","import { MenuIcon } from 'lucide-react';\nimport { useLayoutEffect, useRef, useState, type MouseEvent, type ReactNode } from 'react';\nimport { NavLink } from 'react-router-dom';\n\nimport { useMediaQuery } from '../../hooks';\nimport type { MenuItem } from '../../router/menu';\nimport { Button } from '../../ui/Button';\nimport { Sheet, SheetContent, SheetHeader, SheetTitle, SheetTrigger } from '../../ui/Sheet';\nimport { cn } from '../../utils';\nimport { SideBar } from '../SideBar';\nimport './TopBar.css';\n\n/** A media query that never matches — disables the hard floor when passed null. */\nconst NEVER = 'not all';\n\nexport type TopBarProps = {\n\titems: MenuItem[];\n\t/** Rendered at the far left — typically the app's brand link. */\n\tbrand?: ReactNode;\n\t/** Rendered at the far right — typically an auth/user widget. */\n\tend?: ReactNode;\n\t/**\n\t * Menu rendered inside the mobile drawer. Defaults to `items`; pass the full\n\t * nested menu tree here so phone/tablet users reach every page (including the\n\t * sub-navigation that a SideBar would show on desktop).\n\t */\n\tmobileMenu?: MenuItem[];\n\t/**\n\t * Hard floor: at/below this query the inline nav ALWAYS collapses to the\n\t * drawer, even if it would fit. Above it, the nav collapses automatically the\n\t * moment its items no longer fit the available width (overflow detection), so\n\t * it adapts to the menu length and device — e.g. an iPad in portrait. Pass\n\t * `null` to rely purely on overflow detection.\n\t */\n\tmobileQuery?: string | null;\n};\n\n/**\n * Responsive top navigation. The inline nav is shown while it fits; when its\n * items would overflow the available width it collapses into a hamburger that\n * opens a left-side drawer. Collapsing is content-aware (measured, not a fixed\n * breakpoint), so it adapts to the number/length of menu items and to the\n * device — phones and iPads in portrait get the drawer out of the box.\n */\nexport function TopBar({\n\titems,\n\tbrand,\n\tend,\n\tmobileMenu,\n\tmobileQuery = '(max-width: 768px)',\n}: TopBarProps) {\n\tconst navRef = useRef<HTMLElement>(null);\n\tconst [overflowing, setOverflowing] = useState(false);\n\tconst belowFloor = useMediaQuery(mobileQuery ?? NEVER);\n\n\t// Measure whether the nav's items still fit. The nav slot is `flex-1` with\n\t// `overflow: hidden`, so `scrollWidth` is the width the items need and\n\t// `clientWidth` is the width they have — overflow when the former exceeds the\n\t// latter. The nav stays mounted (just hidden) when collapsed, so this keeps\n\t// measuring and can expand again when space returns. useLayoutEffect runs\n\t// before paint, so the swap happens without a visible flash.\n\tuseLayoutEffect(() => {\n\t\tconst nav = navRef.current;\n\t\tif (!nav) return;\n\t\tconst measure = () => setOverflowing(nav.scrollWidth > nav.clientWidth + 1);\n\t\tmeasure();\n\t\tconst observer = new ResizeObserver(measure);\n\t\tobserver.observe(nav);\n\t\treturn () => observer.disconnect();\n\t}, [items]);\n\n\tconst collapsed = belowFloor || overflowing;\n\n\treturn (\n\t\t<header className=\"k4-topbar\">\n\t\t\t{collapsed ? <MobileNav items={mobileMenu ?? items} /> : null}\n\t\t\t{brand}\n\t\t\t<nav\n\t\t\t\tref={navRef}\n\t\t\t\tclassName={cn('k4-topbar__nav', collapsed && 'k4-topbar__nav--collapsed')}\n\t\t\t\tinert={collapsed}>\n\t\t\t\t{items.map((item) =>\n\t\t\t\t\titem.kind === 'item' ? (\n\t\t\t\t\t\t<NavLink\n\t\t\t\t\t\t\tkey={item.path}\n\t\t\t\t\t\t\tto={item.path}\n\t\t\t\t\t\t\tend={item.path === '/'}\n\t\t\t\t\t\t\tclassName={({ isActive }) =>\n\t\t\t\t\t\t\t\tcn('k4-topbar__link', isActive && 'k4-topbar__link--active')\n\t\t\t\t\t\t\t}>\n\t\t\t\t\t\t\t{item.label}\n\t\t\t\t\t\t</NavLink>\n\t\t\t\t\t) : null,\n\t\t\t\t)}\n\t\t\t</nav>\n\t\t\t<div className=\"k4-topbar__end\">{end}</div>\n\t\t</header>\n\t);\n}\n\n/** Hamburger + left drawer holding the full menu. Closes itself on navigation. */\nfunction MobileNav({ items }: { items: MenuItem[] }) {\n\tconst [open, setOpen] = useState(false);\n\n\t// Close the drawer when a nav link is followed (delegated, so it also covers\n\t// nested items) — no effect-on-location needed.\n\tconst closeOnLink = (e: MouseEvent<HTMLDivElement>) => {\n\t\tif ((e.target as HTMLElement).closest('a')) setOpen(false);\n\t};\n\n\treturn (\n\t\t<Sheet open={open} onOpenChange={setOpen}>\n\t\t\t<SheetTrigger asChild>\n\t\t\t\t<Button\n\t\t\t\t\tvariant=\"ghost\"\n\t\t\t\t\tsize=\"icon\"\n\t\t\t\t\tclassName=\"k4-topbar__burger\"\n\t\t\t\t\taria-label=\"Open navigation menu\">\n\t\t\t\t\t<MenuIcon />\n\t\t\t\t</Button>\n\t\t\t</SheetTrigger>\n\t\t\t<SheetContent side=\"left\" className=\"k4-topbar__drawer\">\n\t\t\t\t<SheetHeader>\n\t\t\t\t\t<SheetTitle>Navigation</SheetTitle>\n\t\t\t\t</SheetHeader>\n\t\t\t\t<div className=\"k4-topbar__drawer-nav\" onClick={closeOnLink}>\n\t\t\t\t\t<SideBar items={items} />\n\t\t\t\t</div>\n\t\t\t</SheetContent>\n\t\t</Sheet>\n\t);\n}\n","/**\n * Generic sort descriptors, shared across data-fetching code.\n *\n * The string values (`'ASC'` / `'DESC'`) match the common backend convention,\n * so a `SortOrder` can be sent straight to an API as a query/body param. Use\n * `SortOrderInput` wherever an endpoint accepts either a single sort or a\n * prioritized list of sorts.\n */\nexport enum SortDirection {\n\tAsc = 'ASC',\n\tDesc = 'DESC',\n}\n\nexport type SortOrder = {\n\t/** The field/property to sort by. */\n\tproperty: string;\n\tdirection: SortDirection;\n};\n\n/** One sort, or a prioritized list of sorts (first has highest priority). */\nexport type SortOrderInput = SortOrder | SortOrder[];\n","import { cva, type VariantProps } from 'class-variance-authority';\nimport type { ComponentProps } from 'react';\n\nimport { cn } from '../../utils';\nimport './Alert.css';\n\nexport const alertVariants = cva('k4-alert', {\n\tvariants: {\n\t\tvariant: {\n\t\t\tdefault: 'k4-alert--default',\n\t\t\tprimary: 'k4-alert--primary',\n\t\t\tsecondary: 'k4-alert--secondary',\n\t\t\tdestructive: 'k4-alert--destructive',\n\t\t\tsuccess: 'k4-alert--success',\n\t\t},\n\t\t/**\n\t\t * 'filled' (default) paints the surface in the variant color; 'outline'\n\t\t * keeps a neutral surface and draws the variant color as a border +\n\t\t * colored title/icon. Only meaningful for the `primary`/`secondary`\n\t\t * color variants.\n\t\t */\n\t\tappearance: {\n\t\t\tfilled: '',\n\t\t\toutline: 'k4-alert--outline',\n\t\t},\n\t},\n\tdefaultVariants: {\n\t\tvariant: 'default',\n\t\tappearance: 'filled',\n\t},\n});\n\nexport type AlertProps = ComponentProps<'div'> & VariantProps<typeof alertVariants>;\n\nexport function Alert({ className, variant, appearance, ...props }: AlertProps) {\n\treturn (\n\t\t<div\n\t\t\trole=\"alert\"\n\t\t\tclassName={cn(alertVariants({ variant, appearance }), className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport function AlertTitle({ className, ...props }: ComponentProps<'div'>) {\n\treturn <div className={cn('k4-alert__title', className)} {...props} />;\n}\n\nexport function AlertDescription({ className, ...props }: ComponentProps<'div'>) {\n\treturn <div className={cn('k4-alert__description', className)} {...props} />;\n}\n","import { AlertCircleIcon } from 'lucide-react';\n\nimport { type NormalizedError, normalizeError } from '../../errors';\nimport { Alert, AlertDescription, AlertTitle } from '../Alert';\nimport { Button } from '../Button';\nimport './ErrorBlock.css';\n\nexport type ErrorDisplayProps = {\n\terror: unknown;\n\ttitle?: string;\n\tonRetry?: () => void;\n};\n\n/**\n * Inline error display. Renders as a span for use next to text, inside list\n * items, or anywhere compact error feedback is needed.\n *\n * Intentionally NOT built on Button: the Button component's smallest size is\n * too tall for an inline micro-action, so the retry stays a minimal link.\n */\nexport function ErrorInline({ error, onRetry }: ErrorDisplayProps) {\n\tconst normalized = normalizeError(error);\n\treturn (\n\t\t<span className=\"k4-error-inline\">\n\t\t\t<span className=\"k4-error-inline__message\">\n\t\t\t\t{normalized.code && <strong>{normalized.code}: </strong>}\n\t\t\t\t{normalized.message}\n\t\t\t</span>\n\t\t\t{onRetry && (\n\t\t\t\t<button type=\"button\" className=\"k4-error-inline__retry\" onClick={onRetry}>\n\t\t\t\t\tretry\n\t\t\t\t</button>\n\t\t\t)}\n\t\t</span>\n\t);\n}\n\n/**\n * Block-level error display for sections and route error boundaries. Built on\n * the UI kit's destructive Alert + Button, so it follows the design system\n * (theming, dark mode) out of the box. Handles React Router responses,\n * AppError, standard Errors, and unknowns.\n */\nexport function ErrorBlock({ error, title, onRetry }: ErrorDisplayProps) {\n\tconst normalized = normalizeError(error);\n\treturn (\n\t\t<Alert variant=\"destructive\" className=\"k4-error-block\">\n\t\t\t<AlertCircleIcon />\n\t\t\t<AlertTitle>{title ?? errorTitle(normalized)}</AlertTitle>\n\t\t\t<AlertDescription>\n\t\t\t\t<p>{normalized.message}</p>\n\t\t\t\t{normalized.details ? (\n\t\t\t\t\t<pre className=\"k4-error-block__details\">\n\t\t\t\t\t\t{typeof normalized.details === 'string'\n\t\t\t\t\t\t\t? normalized.details\n\t\t\t\t\t\t\t: JSON.stringify(normalized.details, null, 2)}\n\t\t\t\t\t</pre>\n\t\t\t\t) : null}\n\t\t\t\t{onRetry && (\n\t\t\t\t\t<Button size=\"sm\" className=\"k4-error-block__retry\" onClick={onRetry}>\n\t\t\t\t\t\tTry again\n\t\t\t\t\t</Button>\n\t\t\t\t)}\n\t\t\t</AlertDescription>\n\t\t</Alert>\n\t);\n}\n\nfunction errorTitle(normalized: NormalizedError): string {\n\tif (normalized.code) return `Error ${normalized.code}`;\n\treturn 'Something went wrong';\n}\n","import { useRouteError } from 'react-router-dom';\n\nimport { ErrorBlock } from '../ui/ErrorBlock';\n\n/**\n * Default route error boundary. Delegates rendering to ErrorBlock.\n * Used by the router adapter as the fallback for every route.\n */\nexport function DefaultErrorBoundary() {\n\tconst error = useRouteError();\n\treturn <ErrorBlock error={error} />;\n}\n","import type { AnyRouteDef } from '../router/types';\n\n/**\n * Full paths assigned to routes during tree assembly.\n * Keyed by route reference identity (so each `defineRoute` result has its own slot).\n */\nconst fullPathByRoute = new WeakMap<AnyRouteDef, string>();\n\nexport function registerRoute(route: AnyRouteDef, fullPath: string): void {\n\tfullPathByRoute.set(route, fullPath);\n}\n\nexport function getFullPath(route: AnyRouteDef): string {\n\tconst path = fullPathByRoute.get(route);\n\tif (path === undefined) {\n\t\tconst label = route.path ?? route.menu?.label ?? '(anonymous)';\n\t\tthrow new Error(\n\t\t\t`Route \"${label}\" has not been registered. Did you pass it to buildRouterConfig()?`,\n\t\t);\n\t}\n\treturn path;\n}\n","import { Loader2Icon } from 'lucide-react';\nimport type { ComponentProps } from 'react';\n\nimport { cn } from '../../utils';\nimport './Spinner.css';\n\nexport type SpinnerProps = ComponentProps<'svg'>;\n\n/**\n * Rotating loading indicator (shadcn's Spinner). Sized to match icon slots,\n * so it drops straight into a Button to show a loading state:\n *\n * <Button disabled>\n * <Spinner />\n * Loading…\n * </Button>\n */\nexport function Spinner({ className, ...props }: SpinnerProps) {\n\treturn (\n\t\t<Loader2Icon\n\t\t\trole=\"status\"\n\t\t\taria-label=\"Loading\"\n\t\t\tclassName={cn('k4-spinner', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport type DotsSpinnerProps = {\n\tlabel?: string;\n\tvertical?: boolean;\n};\n\n/**\n * Three-dots spinner with an optional label. Renders as an inline-flex span\n * so it can sit next to text; used by SpinnerBlock for full-area loading.\n */\nexport function DotsSpinner({ label, vertical }: DotsSpinnerProps) {\n\treturn (\n\t\t<span className={cn('k4-dots-spinner', vertical && 'k4-dots-spinner--vertical')}>\n\t\t\t<span className=\"k4-dots-spinner__dots\">\n\t\t\t\t<span className=\"k4-dots-spinner__dot\" />\n\t\t\t\t<span className=\"k4-dots-spinner__dot\" />\n\t\t\t\t<span className=\"k4-dots-spinner__dot\" />\n\t\t\t</span>\n\t\t\t{label && <span className=\"k4-dots-spinner__label\">{label}</span>}\n\t\t</span>\n\t);\n}\n\nexport type SpinnerBlockProps = {\n\tlabel?: string;\n};\n\n/**\n * Block-level spinner that centers itself both horizontally and vertically\n * within its parent. Use for full-page loading, Suspense fallbacks, etc.\n */\nexport function SpinnerBlock({ label = 'Loading…' }: SpinnerBlockProps) {\n\treturn (\n\t\t<div className=\"k4-spinner-block\">\n\t\t\t<DotsSpinner label={label} vertical />\n\t\t</div>\n\t);\n}\n\n/**\n * Default for the router's HydrateFallback slot; shown only while the data\n * router boots. Override via `createAppRouter`'s `hydrateFallback` option.\n */\nexport function DefaultHydrateFallback() {\n\treturn <SpinnerBlock label={'Loading application…'} />;\n}\n","import type { ComponentType } from 'react';\nimport type { LoaderFunctionArgs, RouteObject } from 'react-router-dom';\n\nimport type { AppContext } from './context';\nimport { DefaultErrorBoundary } from './DefaultErrorBoundary';\nimport type { AnyRouteDef } from './types';\nimport { registerRoute } from '../internal/registry';\nimport { DefaultHydrateFallback } from '../ui/Spinner';\n\nfunction joinPaths(parent: string, child: string): string {\n\tif (!child) return parent;\n\tconst left = parent.endsWith('/') ? parent.slice(0, -1) : parent;\n\tconst right = child.startsWith('/') ? child.slice(1) : child;\n\treturn left ? `${left}/${right}` : `/${right}`;\n}\n\nfunction wrapLoader(route: AnyRouteDef, context: AppContext) {\n\tconst userLoader = route.loader;\n\tif (!userLoader) return undefined;\n\n\treturn async ({ params, request }: LoaderFunctionArgs) => {\n\t\t// Zod messages are multi-line and not valid HTTP statusText, so they go\n\t\t// into the body (read back via errorResponse.data).\n\t\tlet parsedParams: unknown = params;\n\t\tif (route.params) {\n\t\t\tconst result = route.params.safeParse(params);\n\t\t\tif (!result.success) {\n\t\t\t\tthrow new Response(result.error.message, {\n\t\t\t\t\tstatus: 400,\n\t\t\t\t\tstatusText: 'Invalid path parameters',\n\t\t\t\t});\n\t\t\t}\n\t\t\tparsedParams = result.data;\n\t\t}\n\n\t\tlet parsedSearch: unknown = {};\n\t\tif (route.search) {\n\t\t\tconst url = new URL(request.url);\n\t\t\tconst raw = Object.fromEntries(url.searchParams.entries());\n\t\t\tconst result = route.search.safeParse(raw);\n\t\t\tif (!result.success) {\n\t\t\t\tthrow new Response(result.error.message, {\n\t\t\t\t\tstatus: 400,\n\t\t\t\t\tstatusText: 'Invalid search parameters',\n\t\t\t\t});\n\t\t\t}\n\t\t\tparsedSearch = result.data;\n\t\t}\n\n\t\treturn userLoader({\n\t\t\tparams: parsedParams as never,\n\t\t\tsearch: parsedSearch as never,\n\t\t\trequest,\n\t\t\tcontext,\n\t\t});\n\t};\n}\n\nfunction toRouteObject(route: AnyRouteDef, parentPath: string, context: AppContext): RouteObject {\n\tconst fullPath = route.index || !route.path ? parentPath : joinPaths(parentPath, route.path);\n\tregisterRoute(route, fullPath);\n\n\tconst Component = route.component;\n\tconst ErrorBoundary = route.errorBoundary ?? DefaultErrorBoundary;\n\tconst loader = wrapLoader(route, context);\n\tconst children = route.children?.map((child) => toRouteObject(child, fullPath, context));\n\n\tif (route.index) {\n\t\treturn {\n\t\t\tindex: true,\n\t\t\tComponent,\n\t\t\tErrorBoundary,\n\t\t\tloader,\n\t\t} as RouteObject;\n\t}\n\n\treturn {\n\t\t...(route.path != null && { path: route.path }),\n\t\tComponent,\n\t\tErrorBoundary,\n\t\tloader,\n\t\tchildren,\n\t} as RouteObject;\n}\n\n/**\n * Converts a tree of `RouteDef`s into the `RouteObject[]` shape that\n * React Router's `createBrowserRouter` expects, while populating the\n * route registry so `pathTo()` works.\n *\n * Wraps the entire tree in a pathless root route with an error boundary,\n * so errors that escape all route-level boundaries (or unmatched URLs)\n * are always caught.\n *\n * Note: every route gets `DefaultErrorBoundary` unless it declares its own.\n * Errors therefore render inside the nearest layout's outlet rather than\n * bubbling to a parent route's boundary.\n *\n * The `context` is captured in a closure and passed to every loader,\n * so guards and loaders can reach the auth state, query client, etc.\n */\nexport type BuildRouterOptions = {\n\t/** Shown only while the data router boots (not for later suspenses). Defaults to DefaultHydrateFallback. */\n\thydrateFallback?: ComponentType;\n\t/** Root error boundary for errors that escape all routes (incl. unmatched URLs). Defaults to DefaultErrorBoundary. */\n\terrorBoundary?: ComponentType;\n};\n\nexport function buildRouterConfig(\n\troutes: AnyRouteDef[],\n\tcontext: AppContext,\n\toptions: BuildRouterOptions = {},\n): RouteObject[] {\n\treturn [\n\t\t{\n\t\t\tHydrateFallback: options.hydrateFallback ?? DefaultHydrateFallback,\n\t\t\tErrorBoundary: options.errorBoundary ?? DefaultErrorBoundary,\n\t\t\tchildren: routes.map((route) => toRouteObject(route, '/', context)),\n\t\t},\n\t];\n}\n","import type { LoaderArgs, LoaderMiddlewareCtx } from './types';\n\ntype Ctx<P, S, D extends Record<string, unknown>> = LoaderMiddlewareCtx<D> & {\n\tparams: P;\n\tsearch: S;\n};\n\ntype AnyStepFn = (ctx: any) => any;\n\nclass Chain<P, S, D extends Record<string, unknown> = Record<string, never>> {\n\tprivate steps: AnyStepFn[];\n\n\tconstructor(steps: AnyStepFn[] = []) {\n\t\tthis.steps = steps;\n\t}\n\n\t/** Side-effect step (guard, prefetch). Does not contribute to data. */\n\tuse(fn: (ctx: Ctx<P, S, D>) => void | Promise<void>): Chain<P, S, D>;\n\t/** Data step. Returned object is merged into the accumulator. */\n\tuse<T extends Record<string, unknown>>(\n\t\tfn: (ctx: Ctx<P, S, D>) => T | Promise<T>,\n\t): Chain<P, S, D & T>;\n\tuse(fn: AnyStepFn): Chain<P, S, any> {\n\t\treturn new Chain([...this.steps, fn]);\n\t}\n\n\tbuild(): (args: LoaderArgs<P, S>) => Promise<D> {\n\t\tconst steps = this.steps;\n\t\treturn async (args) => {\n\t\t\tlet data: Record<string, unknown> = {};\n\t\t\tfor (const step of steps) {\n\t\t\t\tconst result = await step({ ...args, data });\n\t\t\t\tif (result != null && typeof result === 'object') {\n\t\t\t\t\tdata = { ...data, ...result };\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn data as D;\n\t\t};\n\t}\n}\n\nexport function chain<P = unknown, S = unknown>(): Chain<P, S> {\n\treturn new Chain();\n}\n","import { createBrowserRouter } from 'react-router-dom';\n\nimport { buildRouterConfig, type BuildRouterOptions } from './adapter';\nimport type { AppContext } from './context';\nimport type { AnyRouteDef } from './types';\n\n/**\n * One-step router setup: converts the RouteDef tree and creates the\n * browser router. Equivalent to\n * `createBrowserRouter(buildRouterConfig(routes, context, options))`.\n *\n * @example\n * export const router = createAppRouter([shellRoute, loginRoute], {\n * queryClient,\n * auth: authState,\n * });\n */\nexport function createAppRouter(\n\troutes: AnyRouteDef[],\n\tcontext: AppContext,\n\toptions?: BuildRouterOptions,\n) {\n\treturn createBrowserRouter(buildRouterConfig(routes, context, options));\n}\n","import type { RouteDef } from './types';\n\n/**\n * Identity function that exists purely for TypeScript inference.\n *\n * When you write `defineRoute({ params: z.object({ id: z.coerce.number() }), ... })`,\n * TS infers TParams as { id: number } from the Zod schema and threads it through\n * the loader and component types.\n *\n * Use `typeof someRoute` to refer to the inferred type elsewhere.\n */\nexport function defineRoute<TParams, TSearch, TData>(\n\tdef: RouteDef<TParams, TSearch, TData>,\n): RouteDef<TParams, TSearch, TData> {\n\treturn def;\n}\n","import type { ReactNode } from 'react';\n\nimport type { AnyRouteDef } from './types';\nimport { getFullPath } from '../internal/registry';\n\n/**\n * Authored by the developer in the manual menu tree.\n */\nexport type MenuRouteNode = {\n\troute: AnyRouteDef;\n\tlabel?: string;\n\ticon?: ReactNode;\n\tchildren?: MenuNode[];\n};\n\nexport type MenuGroupNode = {\n\tgroup: string;\n\tchildren: MenuNode[];\n};\n\nexport type MenuContentNode = {\n\tcontent: ReactNode;\n};\n\nexport type MenuNode = MenuRouteNode | MenuGroupNode | 'separator' | MenuContentNode;\n\n/**\n * Resolved menu items ready for rendering.\n */\nexport type MenuItemRoute = {\n\tkind: 'item';\n\tlabel: string;\n\ticon?: ReactNode;\n\tpath: string;\n\tchildren?: MenuItem[];\n};\n\nexport type MenuItemGroup = {\n\tkind: 'group';\n\tlabel: string;\n\titems: MenuItem[];\n};\n\nexport type MenuItemSeparator = {\n\tkind: 'separator';\n};\n\nexport type MenuItemContent = {\n\tkind: 'content';\n\tcontent: ReactNode;\n};\n\nexport type MenuItem = MenuItemRoute | MenuItemGroup | MenuItemSeparator | MenuItemContent;\n\nfunction isRouteNode(node: MenuNode): node is MenuRouteNode {\n\treturn typeof node === 'object' && 'route' in node;\n}\n\nfunction isGroupNode(node: MenuNode): node is MenuGroupNode {\n\treturn typeof node === 'object' && 'group' in node;\n}\n\n/**\n * Resolves a manually-authored `MenuNode[]` tree into renderable `MenuItem[]`.\n */\nexport function resolveMenu(nodes: MenuNode[]): MenuItem[] {\n\treturn nodes.map((node): MenuItem => {\n\t\tif (isRouteNode(node)) {\n\t\t\tconst path = getFullPath(node.route);\n\t\t\treturn {\n\t\t\t\tkind: 'item',\n\t\t\t\tlabel: node.label ?? node.route.menu?.label ?? path,\n\t\t\t\ticon: node.icon ?? node.route.menu?.icon,\n\t\t\t\tpath,\n\t\t\t\tchildren: node.children?.length ? resolveMenu(node.children) : undefined,\n\t\t\t};\n\t\t}\n\t\tif (isGroupNode(node)) {\n\t\t\treturn {\n\t\t\t\tkind: 'group',\n\t\t\t\tlabel: node.group,\n\t\t\t\titems: resolveMenu(node.children),\n\t\t\t};\n\t\t}\n\t\tif (node === 'separator') {\n\t\t\treturn { kind: 'separator' };\n\t\t}\n\t\treturn { kind: 'content', content: node.content };\n\t});\n}\n\n/**\n * Finds the top-level menu item that \"owns\" the given pathname, matching\n * the longest prefix first. Only route items are considered.\n */\nexport function findActiveTopItem(items: MenuItem[], pathname: string): MenuItemRoute | undefined {\n\tlet best: MenuItemRoute | undefined;\n\tlet bestLength = -1;\n\n\tfor (const item of items) {\n\t\tif (item.kind === 'item' && isActivePath(item, pathname) && item.path.length > bestLength) {\n\t\t\tbest = item;\n\t\t\tbestLength = item.path.length;\n\t\t}\n\t}\n\n\treturn best;\n}\n\n/**\n * Returns true if `pathname` matches the item or any of its descendants.\n */\nfunction isActivePath(item: MenuItemRoute, pathname: string): boolean {\n\tif (matchesPath(item.path, pathname)) return true;\n\treturn (\n\t\titem.children?.some((child) => child.kind === 'item' && isActivePath(child, pathname)) ??\n\t\tfalse\n\t);\n}\n\nfunction matchesPath(itemPath: string, pathname: string): boolean {\n\tif (itemPath === '/') return pathname === '/';\n\treturn pathname === itemPath || pathname.startsWith(itemPath + '/');\n}\n","/**\n * Portable dev-mode detection. Vite injects `import.meta.env.DEV`; other\n * toolchains may not define `env` at all, so the access is defensive.\n * Internal — not exported from the library barrels.\n */\ntype MaybeViteImportMeta = ImportMeta & { env?: { DEV?: boolean } };\n\nexport const isDev: boolean = Boolean((import.meta as MaybeViteImportMeta).env?.DEV);\n","import type { z } from 'zod';\n\nimport type { RouteDef } from './types';\nimport { isDev } from '../internal/env';\nimport { getFullPath } from '../internal/registry';\nimport type { IsEmpty } from '../internal/type-utils';\n\ntype PathToArgs<TParams, TSearch> =\n\tIsEmpty<TParams> extends true\n\t\t? [] | [args: { search?: Partial<TSearch> }]\n\t\t: [args: { params: TParams; search?: Partial<TSearch> }];\n\n/**\n * Produces a fully-qualified URL string for a route, with type-safe params and search.\n *\n * @example\n * pathTo(userDetailRoute, { params: { id: 5 } })\n * pathTo(projectDetailRoute, { params: { id: 5 }, search: { tab: 'tasks' } })\n * pathTo(homeRoute) // no params, no search\n *\n * Search values are filtered through the route's Zod schema so defaults are\n * applied and unknown keys are dropped.\n */\nexport function pathTo<TParams, TSearch, TData>(\n\troute: RouteDef<TParams, TSearch, TData>,\n\t...args: PathToArgs<TParams, TSearch>\n): string {\n\tconst template = getFullPath(route);\n\tconst opts = (args[0] ?? {}) as { params?: TParams; search?: Partial<TSearch> };\n\n\tlet url = template;\n\tif (opts.params) {\n\t\tfor (const [key, value] of Object.entries(opts.params as object)) {\n\t\t\turl = url.replace(`:${key}`, encodeURIComponent(String(value)));\n\t\t}\n\t}\n\n\tif (opts.search && route.search) {\n\t\tconst schema = route.search as z.ZodType<TSearch>;\n\t\tconst parsed = schema.safeParse(opts.search);\n\t\tif (!parsed.success && isDev) {\n\t\t\tconsole.warn(\n\t\t\t\t`pathTo(): search params for \"${template}\" failed to parse and were dropped.`,\n\t\t\t\tparsed.error,\n\t\t\t);\n\t\t}\n\t\tif (parsed.success) {\n\t\t\tconst sp = new URLSearchParams();\n\t\t\tfor (const [key, value] of Object.entries(parsed.data as object)) {\n\t\t\t\tif (value === undefined || value === null) continue;\n\t\t\t\tif (Array.isArray(value)) {\n\t\t\t\t\tfor (const v of value) sp.append(key, String(v));\n\t\t\t\t} else {\n\t\t\t\t\tsp.set(key, String(value));\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst qs = sp.toString();\n\t\t\tif (qs) url += `?${qs}`;\n\t\t}\n\t}\n\n\treturn url;\n}\n","import { Link, type LinkProps } from 'react-router-dom';\n\nimport type { IsEmpty } from '../../internal/type-utils';\nimport { pathTo } from '../pathTo';\nimport type { RouteDef } from '../types';\n\nexport type TypedLinkProps<TParams, TSearch> = Omit<LinkProps, 'to'> & {\n\troute: RouteDef<TParams, TSearch, any>;\n} & (IsEmpty<TParams> extends true\n\t\t? { params?: TParams; search?: Partial<TSearch> }\n\t\t: { params: TParams; search?: Partial<TSearch> });\n\n/**\n * Type-safe link to a route. The route's params/search shape is enforced.\n *\n * @example\n * <TypedLink route={userDetailRoute} params={{ id: 5 }}>Profile</TypedLink>\n * <TypedLink route={projectDetailRoute} params={{ id: 1 }} search={{ tab: 'tasks' }}>\n * Tasks\n * </TypedLink>\n */\nexport function TypedLink<TParams, TSearch>(props: TypedLinkProps<TParams, TSearch>) {\n\tconst { route, params, search, ...rest } = props as TypedLinkProps<TParams, TSearch> & {\n\t\tparams?: TParams;\n\t\tsearch?: Partial<TSearch>;\n\t};\n\tconst to = pathTo(route, { params: params as TParams, search } as never);\n\treturn <Link to={to} {...rest} />;\n}\n","import { useMemo } from 'react';\nimport { useLoaderData, useParams, useSearchParams } from 'react-router-dom';\n\nimport type { RouteDef } from './types';\n\n/**\n * Type-safe access to a route's params, search, and loader data.\n * This is THE way page components read route state — call it with the\n * route definition co-located in the same file.\n *\n * The schemas on the route are used to parse and coerce values so that the\n * returned types match what you declared in `defineRoute`. Components never\n * see invalid data — validation failures throw at the loader boundary and\n * are caught by the error element.\n *\n * @example\n * const { params, search, data } = useRoute(userDetailRoute);\n * // ^ { id: number }\n * // ^ { tab: 'profile' | 'posts' }\n * // ^ { user: User }\n */\nexport function useRoute<TParams, TSearch, TData>(\n\troute: RouteDef<TParams, TSearch, TData>,\n): { params: TParams; search: TSearch; data: Awaited<TData> } {\n\tconst rawParams = useParams();\n\tconst [searchParams] = useSearchParams();\n\tconst data = useLoaderData() as Awaited<TData>;\n\n\tconst params = useMemo(() => {\n\t\tif (!route.params) return rawParams as TParams;\n\t\tconst result = route.params.safeParse(rawParams);\n\t\treturn result.success ? result.data : (rawParams as TParams);\n\t}, [rawParams, route.params]);\n\n\tconst search = useMemo(() => {\n\t\tif (!route.search) return {} as TSearch;\n\t\tconst raw = Object.fromEntries(searchParams.entries());\n\t\tconst result = route.search.safeParse(raw);\n\t\treturn result.success ? result.data : ({} as TSearch);\n\t}, [searchParams, route.search]);\n\n\treturn { params, search, data };\n}\n","import { CheckIcon, ChevronRightIcon, CircleIcon } from 'lucide-react';\nimport { DropdownMenu as DropdownMenuPrimitive } from 'radix-ui';\nimport type { ComponentProps } from 'react';\n\nimport { cn } from '../../utils';\nimport './DropdownMenu.css';\n\nexport const DropdownMenu = DropdownMenuPrimitive.Root;\nexport const DropdownMenuPortal = DropdownMenuPrimitive.Portal;\nexport const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;\nexport const DropdownMenuGroup = DropdownMenuPrimitive.Group;\nexport const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;\nexport const DropdownMenuSub = DropdownMenuPrimitive.Sub;\n\nexport function DropdownMenuContent({\n\tclassName,\n\tsideOffset = 4,\n\t...props\n}: ComponentProps<typeof DropdownMenuPrimitive.Content>) {\n\treturn (\n\t\t<DropdownMenuPrimitive.Portal>\n\t\t\t<DropdownMenuPrimitive.Content\n\t\t\t\tsideOffset={sideOffset}\n\t\t\t\tclassName={cn('k4-dropdown-menu__content', className)}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t</DropdownMenuPrimitive.Portal>\n\t);\n}\n\nexport type DropdownMenuItemProps = ComponentProps<typeof DropdownMenuPrimitive.Item> & {\n\tinset?: boolean;\n\tvariant?: 'default' | 'destructive';\n};\n\nexport function DropdownMenuItem({\n\tclassName,\n\tinset,\n\tvariant = 'default',\n\t...props\n}: DropdownMenuItemProps) {\n\treturn (\n\t\t<DropdownMenuPrimitive.Item\n\t\t\tclassName={cn(\n\t\t\t\t'k4-dropdown-menu__item',\n\t\t\t\tinset && 'k4-dropdown-menu__item--inset',\n\t\t\t\tvariant === 'destructive' && 'k4-dropdown-menu__item--destructive',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport function DropdownMenuCheckboxItem({\n\tclassName,\n\tchildren,\n\tchecked,\n\t...props\n}: ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>) {\n\treturn (\n\t\t<DropdownMenuPrimitive.CheckboxItem\n\t\t\tclassName={cn('k4-dropdown-menu__checkbox-item', className)}\n\t\t\tchecked={checked}\n\t\t\t{...props}>\n\t\t\t<span className=\"k4-dropdown-menu__indicator\">\n\t\t\t\t<DropdownMenuPrimitive.ItemIndicator>\n\t\t\t\t\t<CheckIcon />\n\t\t\t\t</DropdownMenuPrimitive.ItemIndicator>\n\t\t\t</span>\n\t\t\t{children}\n\t\t</DropdownMenuPrimitive.CheckboxItem>\n\t);\n}\n\nexport function DropdownMenuRadioItem({\n\tclassName,\n\tchildren,\n\t...props\n}: ComponentProps<typeof DropdownMenuPrimitive.RadioItem>) {\n\treturn (\n\t\t<DropdownMenuPrimitive.RadioItem\n\t\t\tclassName={cn('k4-dropdown-menu__radio-item', className)}\n\t\t\t{...props}>\n\t\t\t<span className=\"k4-dropdown-menu__indicator\">\n\t\t\t\t<DropdownMenuPrimitive.ItemIndicator>\n\t\t\t\t\t<CircleIcon className=\"k4-dropdown-menu__radio-dot\" />\n\t\t\t\t</DropdownMenuPrimitive.ItemIndicator>\n\t\t\t</span>\n\t\t\t{children}\n\t\t</DropdownMenuPrimitive.RadioItem>\n\t);\n}\n\nexport type DropdownMenuLabelProps = ComponentProps<typeof DropdownMenuPrimitive.Label> & {\n\tinset?: boolean;\n};\n\nexport function DropdownMenuLabel({ className, inset, ...props }: DropdownMenuLabelProps) {\n\treturn (\n\t\t<DropdownMenuPrimitive.Label\n\t\t\tclassName={cn(\n\t\t\t\t'k4-dropdown-menu__label',\n\t\t\t\tinset && 'k4-dropdown-menu__label--inset',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport function DropdownMenuSeparator({\n\tclassName,\n\t...props\n}: ComponentProps<typeof DropdownMenuPrimitive.Separator>) {\n\treturn (\n\t\t<DropdownMenuPrimitive.Separator\n\t\t\tclassName={cn('k4-dropdown-menu__separator', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport function DropdownMenuShortcut({ className, ...props }: ComponentProps<'span'>) {\n\treturn <span className={cn('k4-dropdown-menu__shortcut', className)} {...props} />;\n}\n\nexport type DropdownMenuSubTriggerProps = ComponentProps<\n\ttypeof DropdownMenuPrimitive.SubTrigger\n> & {\n\tinset?: boolean;\n};\n\nexport function DropdownMenuSubTrigger({\n\tclassName,\n\tinset,\n\tchildren,\n\t...props\n}: DropdownMenuSubTriggerProps) {\n\treturn (\n\t\t<DropdownMenuPrimitive.SubTrigger\n\t\t\tclassName={cn(\n\t\t\t\t'k4-dropdown-menu__sub-trigger',\n\t\t\t\tinset && 'k4-dropdown-menu__sub-trigger--inset',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}>\n\t\t\t{children}\n\t\t\t<ChevronRightIcon className=\"k4-dropdown-menu__sub-chevron\" />\n\t\t</DropdownMenuPrimitive.SubTrigger>\n\t);\n}\n\nexport function DropdownMenuSubContent({\n\tclassName,\n\t...props\n}: ComponentProps<typeof DropdownMenuPrimitive.SubContent>) {\n\treturn (\n\t\t<DropdownMenuPrimitive.SubContent\n\t\t\tclassName={cn('k4-dropdown-menu__sub-content', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n","import type { ReactNode } from 'react';\nimport { createContext, useCallback, useContext, useEffect, useMemo, useState } from 'react';\n\nexport type ThemeMode = 'light' | 'dark' | 'system';\n\nexport type ThemeProviderProps = {\n\tchildren: ReactNode;\n\t/** Initial mode when nothing is stored yet. */\n\tdefaultMode?: ThemeMode;\n\t/** localStorage key the chosen mode is persisted under. */\n\tstorageKey?: string;\n};\n\ntype ThemeContextValue = {\n\t/** The user's choice (may be 'system'). */\n\tmode: ThemeMode;\n\t/** What is actually applied right now. */\n\tresolvedMode: 'light' | 'dark';\n\tsetMode: (mode: ThemeMode) => void;\n};\n\nconst ThemeContext = createContext<ThemeContextValue | undefined>(undefined);\n\nconst prefersDark = () =>\n\ttypeof window !== 'undefined' && window.matchMedia('(prefers-color-scheme: dark)').matches;\n\nfunction resolve(mode: ThemeMode): 'light' | 'dark' {\n\treturn mode === 'system' ? (prefersDark() ? 'dark' : 'light') : mode;\n}\n\n/**\n * Applies the design system's light/dark mode by toggling the `.dark`\n * class on <html>. Dark-mode token values in theme.css key off that class.\n * The chosen mode is persisted; 'system' follows prefers-color-scheme live.\n */\nexport function ThemeProvider({\n\tchildren,\n\tdefaultMode = 'system',\n\tstorageKey = 'k4-ui-theme',\n}: ThemeProviderProps) {\n\tconst [mode, setModeState] = useState<ThemeMode>(() => {\n\t\tif (typeof window === 'undefined') return defaultMode;\n\t\tconst stored = window.localStorage.getItem(storageKey);\n\t\treturn stored === 'light' || stored === 'dark' || stored === 'system'\n\t\t\t? stored\n\t\t\t: defaultMode;\n\t});\n\tconst [resolvedMode, setResolvedMode] = useState<'light' | 'dark'>(() => resolve(mode));\n\n\tuseEffect(() => {\n\t\tconst apply = () => {\n\t\t\tconst next = resolve(mode);\n\t\t\tsetResolvedMode(next);\n\t\t\tdocument.documentElement.classList.toggle('dark', next === 'dark');\n\t\t};\n\t\tapply();\n\t\tif (mode !== 'system') return;\n\t\tconst media = window.matchMedia('(prefers-color-scheme: dark)');\n\t\tmedia.addEventListener('change', apply);\n\t\treturn () => media.removeEventListener('change', apply);\n\t}, [mode]);\n\n\tconst setMode = useCallback(\n\t\t(next: ThemeMode) => {\n\t\t\twindow.localStorage.setItem(storageKey, next);\n\t\t\tsetModeState(next);\n\t\t},\n\t\t[storageKey],\n\t);\n\n\tconst value = useMemo(() => ({ mode, resolvedMode, setMode }), [mode, resolvedMode, setMode]);\n\n\treturn <ThemeContext.Provider value={value}>{children}</ThemeContext.Provider>;\n}\n\n/** Read and control the design system's light/dark mode. */\nexport function useTheme(): ThemeContextValue {\n\tconst ctx = useContext(ThemeContext);\n\tif (!ctx) throw new Error('useTheme must be used inside <ThemeProvider>');\n\treturn ctx;\n}\n","import { MoonIcon, SunIcon } from 'lucide-react';\n\nimport { Button } from '../../ui/Button';\nimport {\n\tDropdownMenu,\n\tDropdownMenuContent,\n\tDropdownMenuItem,\n\tDropdownMenuTrigger,\n} from '../../ui/DropdownMenu';\nimport { useTheme } from '../ThemeProvider';\nimport './ModeToggle.css';\n\n/**\n * Light/Dark/System switcher for the design system. Drop it anywhere inside\n * <ThemeProvider> (the demo puts it in the TopBar's end slot).\n */\nexport function ModeToggle() {\n\tconst { setMode } = useTheme();\n\n\treturn (\n\t\t<DropdownMenu>\n\t\t\t<DropdownMenuTrigger asChild>\n\t\t\t\t<Button appearance=\"outline\" size=\"icon\" className=\"k4-mode-toggle\">\n\t\t\t\t\t<SunIcon className=\"k4-mode-toggle__sun\" />\n\t\t\t\t\t<MoonIcon className=\"k4-mode-toggle__moon\" />\n\t\t\t\t\t<span className=\"k4-sr-only\">Toggle theme</span>\n\t\t\t\t</Button>\n\t\t\t</DropdownMenuTrigger>\n\t\t\t<DropdownMenuContent align=\"end\">\n\t\t\t\t<DropdownMenuItem onClick={() => setMode('light')}>Light</DropdownMenuItem>\n\t\t\t\t<DropdownMenuItem onClick={() => setMode('dark')}>Dark</DropdownMenuItem>\n\t\t\t\t<DropdownMenuItem onClick={() => setMode('system')}>System</DropdownMenuItem>\n\t\t\t</DropdownMenuContent>\n\t\t</DropdownMenu>\n\t);\n}\n","import { Toaster as Sonner, type ToasterProps as SonnerProps } from 'sonner';\n\nimport { useTheme } from '../ThemeProvider';\nimport './Toaster.css';\n\nexport type ToasterProps = SonnerProps;\n\n/**\n * App-level toast outlet (sonner), wired to the design system: follows the\n * ThemeProvider's resolved mode and uses popover tokens for surfaces.\n * Render once near the app root; fire toasts via `toast(...)` from 'sonner'.\n */\nexport function Toaster(props: ToasterProps) {\n\tconst { resolvedMode } = useTheme();\n\n\treturn <Sonner theme={resolvedMode} richColors className=\"k4-toaster\" {...props} />;\n}\n","import { MegaphoneIcon, SparklesIcon } from 'lucide-react';\nimport type { ReactNode } from 'react';\nimport { type ExternalToast, toast as sonnerToast } from 'sonner';\n\n/** Plain toast options — same shape as sonner's. */\nexport type ToastOptions = ExternalToast;\n\n/** Filled paints the surface in the brand color; outline keeps a neutral\n * surface with a colored border + heading. */\nexport type ToastAppearance = 'filled' | 'outline';\n\n/**\n * Options for the brand toast variants. Extends every sonner option (so\n * `description`, `duration`, `action`, `icon`, `id`, … all pass through)\n * with an `appearance` switch. Pass `icon` to override the default icon, or\n * `icon: null` to drop it.\n */\nexport type BrandToastOptions = ExternalToast & {\n\tappearance?: ToastAppearance;\n};\n\n/** A brand toast trigger: a headline plus any sonner option, returning the\n * toast id (same as sonner's `toast`). */\nexport type BrandToast = (message: ReactNode, options?: BrandToastOptions) => string | number;\n\n/**\n * The design system's toast API: sonner's `toast` (default / success / error /\n * promise / …) plus brand-colored `primary` / `secondary` variants. Declared\n * explicitly (rather than inferred from Object.assign) so type declarations\n * reference sonner's `toast` type by name instead of inlining its non-exported\n * internals — required for the published `.d.ts`.\n */\nexport type Toast = typeof sonnerToast & {\n\tprimary: BrandToast;\n\tsecondary: BrandToast;\n};\n\n/**\n * Build a brand-colored toast trigger. Applies the `k4-toast--<variant>`\n * class (plus `k4-toast--outline` when requested) — both recolor the toast\n * via sonner's own CSS variables (see Toaster.css) — and supplies a default\n * icon the caller can override. The first argument is the toast's headline;\n * pass `{ description }` for a second line.\n */\nfunction brandVariant(variantClass: string, defaultIcon: ReactNode): BrandToast {\n\treturn (message, options = {}) => {\n\t\tconst { appearance = 'filled', className, ...rest } = options;\n\t\tconst icon = 'icon' in options ? options.icon : defaultIcon;\n\t\treturn sonnerToast(message, {\n\t\t\t...rest,\n\t\t\ticon,\n\t\t\tclassName: [variantClass, appearance === 'outline' && 'k4-toast--outline', className]\n\t\t\t\t.filter(Boolean)\n\t\t\t\t.join(' '),\n\t\t});\n\t};\n}\n\n/**\n * Render `<Toaster />` once near the app root, then fire toasts with\n * `toast(...)`, `toast.success(...)`, `toast.primary(...)`, etc.\n *\n * The wrapper is a fresh callable that copies sonner's own methods, so the\n * upstream `toast` object is left untouched.\n */\nexport const toast: Toast = Object.assign(\n\t(message: ReactNode, options?: ToastOptions) => sonnerToast(message, options),\n\tsonnerToast,\n\t{\n\t\tprimary: brandVariant('k4-toast--primary', <MegaphoneIcon />),\n\t\tsecondary: brandVariant('k4-toast--secondary', <SparklesIcon />),\n\t},\n) as Toast;\n","import { ChevronDownIcon } from 'lucide-react';\nimport { Accordion as AccordionPrimitive } from 'radix-ui';\nimport type { ComponentProps } from 'react';\n\nimport { cn } from '../../utils';\nimport './Accordion.css';\n\nexport const Accordion = AccordionPrimitive.Root;\n\nexport function AccordionItem({\n\tclassName,\n\t...props\n}: ComponentProps<typeof AccordionPrimitive.Item>) {\n\treturn <AccordionPrimitive.Item className={cn('k4-accordion__item', className)} {...props} />;\n}\n\nexport function AccordionTrigger({\n\tclassName,\n\tchildren,\n\t...props\n}: ComponentProps<typeof AccordionPrimitive.Trigger>) {\n\treturn (\n\t\t<AccordionPrimitive.Header className=\"k4-accordion__header\">\n\t\t\t<AccordionPrimitive.Trigger\n\t\t\t\tclassName={cn('k4-accordion__trigger', className)}\n\t\t\t\t{...props}>\n\t\t\t\t{children}\n\t\t\t\t<ChevronDownIcon className=\"k4-accordion__chevron\" />\n\t\t\t</AccordionPrimitive.Trigger>\n\t\t</AccordionPrimitive.Header>\n\t);\n}\n\nexport function AccordionContent({\n\tclassName,\n\tchildren,\n\t...props\n}: ComponentProps<typeof AccordionPrimitive.Content>) {\n\treturn (\n\t\t<AccordionPrimitive.Content className=\"k4-accordion__content\" {...props}>\n\t\t\t<div className={cn('k4-accordion__content-inner', className)}>{children}</div>\n\t\t</AccordionPrimitive.Content>\n\t);\n}\n","import { type VariantProps } from 'class-variance-authority';\nimport { AlertDialog as AlertDialogPrimitive } from 'radix-ui';\nimport type { ComponentProps } from 'react';\n\nimport { cn } from '../../utils';\nimport { buttonVariants } from '../Button';\nimport './AlertDialog.css';\n\nexport const AlertDialog = AlertDialogPrimitive.Root;\nexport const AlertDialogTrigger = AlertDialogPrimitive.Trigger;\nexport const AlertDialogPortal = AlertDialogPrimitive.Portal;\n\nexport function AlertDialogOverlay({\n\tclassName,\n\t...props\n}: ComponentProps<typeof AlertDialogPrimitive.Overlay>) {\n\treturn (\n\t\t<AlertDialogPrimitive.Overlay\n\t\t\tclassName={cn('k4-alert-dialog__overlay', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport function AlertDialogContent({\n\tclassName,\n\t...props\n}: ComponentProps<typeof AlertDialogPrimitive.Content>) {\n\treturn (\n\t\t<AlertDialogPortal>\n\t\t\t<AlertDialogOverlay />\n\t\t\t<AlertDialogPrimitive.Content\n\t\t\t\tclassName={cn('k4-alert-dialog__content', className)}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t</AlertDialogPortal>\n\t);\n}\n\nexport function AlertDialogHeader({ className, ...props }: ComponentProps<'div'>) {\n\treturn <div className={cn('k4-alert-dialog__header', className)} {...props} />;\n}\n\nexport function AlertDialogFooter({ className, ...props }: ComponentProps<'div'>) {\n\treturn <div className={cn('k4-alert-dialog__footer', className)} {...props} />;\n}\n\nexport function AlertDialogTitle({\n\tclassName,\n\t...props\n}: ComponentProps<typeof AlertDialogPrimitive.Title>) {\n\treturn (\n\t\t<AlertDialogPrimitive.Title\n\t\t\tclassName={cn('k4-alert-dialog__title', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport function AlertDialogDescription({\n\tclassName,\n\t...props\n}: ComponentProps<typeof AlertDialogPrimitive.Description>) {\n\treturn (\n\t\t<AlertDialogPrimitive.Description\n\t\t\tclassName={cn('k4-alert-dialog__description', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\n/** The confirm button. Styled like Button; pass `variant=\"destructive\"` for\n * dangerous confirmations. Auto-closes the dialog. */\nexport function AlertDialogAction({\n\tclassName,\n\tvariant,\n\tappearance,\n\tsize,\n\t...props\n}: ComponentProps<typeof AlertDialogPrimitive.Action> & VariantProps<typeof buttonVariants>) {\n\treturn (\n\t\t<AlertDialogPrimitive.Action\n\t\t\tclassName={cn(buttonVariants({ variant, appearance, size }), className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\n/** The dismiss button. Defaults to the outline appearance. Auto-closes. */\nexport function AlertDialogCancel({\n\tclassName,\n\tvariant,\n\tappearance = 'outline',\n\tsize,\n\t...props\n}: ComponentProps<typeof AlertDialogPrimitive.Cancel> & VariantProps<typeof buttonVariants>) {\n\treturn (\n\t\t<AlertDialogPrimitive.Cancel\n\t\t\tclassName={cn(buttonVariants({ variant, appearance, size }), className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n","import { Avatar as AvatarPrimitive } from 'radix-ui';\nimport type { ComponentProps } from 'react';\n\nimport { cn } from '../../utils';\nimport './Avatar.css';\n\nexport type AvatarProps = ComponentProps<typeof AvatarPrimitive.Root>;\n\nexport function Avatar({ className, ...props }: AvatarProps) {\n\treturn <AvatarPrimitive.Root className={cn('k4-avatar', className)} {...props} />;\n}\n\nexport function AvatarImage({ className, ...props }: ComponentProps<typeof AvatarPrimitive.Image>) {\n\treturn <AvatarPrimitive.Image className={cn('k4-avatar__image', className)} {...props} />;\n}\n\nexport function AvatarFallback({\n\tclassName,\n\t...props\n}: ComponentProps<typeof AvatarPrimitive.Fallback>) {\n\treturn <AvatarPrimitive.Fallback className={cn('k4-avatar__fallback', className)} {...props} />;\n}\n","import { useAsyncError } from 'react-router-dom';\n\nimport { ErrorBlock } from '../ErrorBlock';\n\nexport type AwaitErrorBlockProps = {\n\ttitle?: string;\n};\n\n/**\n * Drop-in errorElement for <Await>. Reads the async error from context\n * and delegates to ErrorBlock.\n *\n * @example\n * <Await resolve={promise} errorElement={<AwaitErrorBlock title=\"Failed to load\" />}>\n */\nexport function AwaitErrorBlock({ title }: AwaitErrorBlockProps) {\n\tconst error = useAsyncError();\n\treturn <ErrorBlock error={error} title={title} />;\n}\n","import { cva, type VariantProps } from 'class-variance-authority';\nimport { Slot } from 'radix-ui';\nimport type { ComponentProps } from 'react';\n\nimport { cn } from '../../utils';\nimport './Badge.css';\n\nexport const badgeVariants = cva('k4-badge', {\n\tvariants: {\n\t\tvariant: {\n\t\t\tdefault: 'k4-badge--default',\n\t\t\tsecondary: 'k4-badge--secondary',\n\t\t\tdestructive: 'k4-badge--destructive',\n\t\t\tsuccess: 'k4-badge--success',\n\t\t\toutline: 'k4-badge--outline',\n\t\t},\n\t},\n\tdefaultVariants: {\n\t\tvariant: 'default',\n\t},\n});\n\nexport type BadgeProps = ComponentProps<'span'> &\n\tVariantProps<typeof badgeVariants> & {\n\t\tasChild?: boolean;\n\t};\n\nexport function Badge({ className, variant, asChild = false, ...props }: BadgeProps) {\n\tconst Comp = asChild ? Slot.Root : 'span';\n\treturn <Comp className={cn(badgeVariants({ variant }), className)} {...props} />;\n}\n","import type { ComponentProps } from 'react';\n\nimport { cn } from '../../utils';\nimport './Card.css';\n\nexport type CardProps = ComponentProps<'div'>;\n\nexport function Card({ className, ...props }: CardProps) {\n\treturn <div className={cn('k4-card', className)} {...props} />;\n}\n\nexport function CardHeader({ className, ...props }: ComponentProps<'div'>) {\n\treturn <div className={cn('k4-card__header', className)} {...props} />;\n}\n\nexport function CardTitle({ className, ...props }: ComponentProps<'div'>) {\n\treturn <div className={cn('k4-card__title', className)} {...props} />;\n}\n\nexport function CardDescription({ className, ...props }: ComponentProps<'div'>) {\n\treturn <div className={cn('k4-card__description', className)} {...props} />;\n}\n\n/** Optional action area in the header's top-right corner (e.g. an icon button). */\nexport function CardAction({ className, ...props }: ComponentProps<'div'>) {\n\treturn <div className={cn('k4-card__action', className)} {...props} />;\n}\n\nexport function CardContent({ className, ...props }: ComponentProps<'div'>) {\n\treturn <div className={cn('k4-card__content', className)} {...props} />;\n}\n\nexport function CardFooter({ className, ...props }: ComponentProps<'div'>) {\n\treturn <div className={cn('k4-card__footer', className)} {...props} />;\n}\n","import { CheckIcon } from 'lucide-react';\nimport { Checkbox as CheckboxPrimitive } from 'radix-ui';\nimport type { ComponentProps } from 'react';\n\nimport { cn } from '../../utils';\nimport './Checkbox.css';\n\nexport type CheckboxProps = ComponentProps<typeof CheckboxPrimitive.Root>;\n\nexport function Checkbox({ className, ...props }: CheckboxProps) {\n\treturn (\n\t\t<CheckboxPrimitive.Root className={cn('k4-checkbox', className)} {...props}>\n\t\t\t<CheckboxPrimitive.Indicator className=\"k4-checkbox__indicator\">\n\t\t\t\t<CheckIcon />\n\t\t\t</CheckboxPrimitive.Indicator>\n\t\t</CheckboxPrimitive.Root>\n\t);\n}\n","import { XIcon } from 'lucide-react';\nimport { Dialog as DialogPrimitive } from 'radix-ui';\nimport type { ComponentProps } from 'react';\n\nimport { cn } from '../../utils';\nimport './Dialog.css';\n\nexport const Dialog = DialogPrimitive.Root;\nexport const DialogTrigger = DialogPrimitive.Trigger;\nexport const DialogPortal = DialogPrimitive.Portal;\nexport const DialogClose = DialogPrimitive.Close;\n\nexport function DialogOverlay({\n\tclassName,\n\t...props\n}: ComponentProps<typeof DialogPrimitive.Overlay>) {\n\treturn <DialogPrimitive.Overlay className={cn('k4-dialog__overlay', className)} {...props} />;\n}\n\nexport type DialogContentProps = ComponentProps<typeof DialogPrimitive.Content> & {\n\t/** Hide the default top-right close button. */\n\tshowCloseButton?: boolean;\n};\n\nexport function DialogContent({\n\tclassName,\n\tchildren,\n\tshowCloseButton = true,\n\t...props\n}: DialogContentProps) {\n\treturn (\n\t\t<DialogPortal>\n\t\t\t<DialogOverlay />\n\t\t\t<DialogPrimitive.Content className={cn('k4-dialog__content', className)} {...props}>\n\t\t\t\t{children}\n\t\t\t\t{showCloseButton && (\n\t\t\t\t\t<DialogPrimitive.Close className=\"k4-dialog__close\">\n\t\t\t\t\t\t<XIcon />\n\t\t\t\t\t\t<span className=\"k4-sr-only\">Close</span>\n\t\t\t\t\t</DialogPrimitive.Close>\n\t\t\t\t)}\n\t\t\t</DialogPrimitive.Content>\n\t\t</DialogPortal>\n\t);\n}\n\nexport function DialogHeader({ className, ...props }: ComponentProps<'div'>) {\n\treturn <div className={cn('k4-dialog__header', className)} {...props} />;\n}\n\nexport function DialogFooter({ className, ...props }: ComponentProps<'div'>) {\n\treturn <div className={cn('k4-dialog__footer', className)} {...props} />;\n}\n\nexport function DialogTitle({ className, ...props }: ComponentProps<typeof DialogPrimitive.Title>) {\n\treturn <DialogPrimitive.Title className={cn('k4-dialog__title', className)} {...props} />;\n}\n\nexport function DialogDescription({\n\tclassName,\n\t...props\n}: ComponentProps<typeof DialogPrimitive.Description>) {\n\treturn (\n\t\t<DialogPrimitive.Description\n\t\t\tclassName={cn('k4-dialog__description', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n","import { Command as CommandPrimitive } from 'cmdk';\nimport { SearchIcon } from 'lucide-react';\nimport type { ComponentProps } from 'react';\n\nimport { cn } from '../../utils';\nimport { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from '../Dialog';\nimport './Command.css';\n\nexport function Command({ className, ...props }: ComponentProps<typeof CommandPrimitive>) {\n\treturn <CommandPrimitive className={cn('k4-command', className)} {...props} />;\n}\n\nexport type CommandDialogProps = ComponentProps<typeof Dialog> & {\n\ttitle?: string;\n\tdescription?: string;\n\tclassName?: string;\n\tshowCloseButton?: boolean;\n};\n\nexport function CommandDialog({\n\ttitle = 'Command Palette',\n\tdescription = 'Search for a command to run...',\n\tchildren,\n\tclassName,\n\tshowCloseButton = true,\n\t...props\n}: CommandDialogProps) {\n\treturn (\n\t\t<Dialog {...props}>\n\t\t\t<DialogContent\n\t\t\t\tclassName={cn('k4-command__dialog-content', className)}\n\t\t\t\tshowCloseButton={showCloseButton}>\n\t\t\t\t<DialogHeader className=\"k4-sr-only\">\n\t\t\t\t\t<DialogTitle>{title}</DialogTitle>\n\t\t\t\t\t<DialogDescription>{description}</DialogDescription>\n\t\t\t\t</DialogHeader>\n\t\t\t\t<Command className=\"k4-command--dialog\">{children}</Command>\n\t\t\t</DialogContent>\n\t\t</Dialog>\n\t);\n}\n\nexport function CommandInput({\n\tclassName,\n\t...props\n}: ComponentProps<typeof CommandPrimitive.Input>) {\n\treturn (\n\t\t<div className=\"k4-command__input-wrapper\">\n\t\t\t<SearchIcon className=\"k4-command__search-icon\" />\n\t\t\t<CommandPrimitive.Input className={cn('k4-command__input', className)} {...props} />\n\t\t</div>\n\t);\n}\n\nexport function CommandList({ className, ...props }: ComponentProps<typeof CommandPrimitive.List>) {\n\treturn <CommandPrimitive.List className={cn('k4-command__list', className)} {...props} />;\n}\n\nexport function CommandEmpty(props: ComponentProps<typeof CommandPrimitive.Empty>) {\n\treturn <CommandPrimitive.Empty className=\"k4-command__empty\" {...props} />;\n}\n\nexport function CommandGroup({\n\tclassName,\n\t...props\n}: ComponentProps<typeof CommandPrimitive.Group>) {\n\treturn <CommandPrimitive.Group className={cn('k4-command__group', className)} {...props} />;\n}\n\nexport function CommandSeparator({\n\tclassName,\n\t...props\n}: ComponentProps<typeof CommandPrimitive.Separator>) {\n\treturn (\n\t\t<CommandPrimitive.Separator className={cn('k4-command__separator', className)} {...props} />\n\t);\n}\n\nexport function CommandItem({ className, ...props }: ComponentProps<typeof CommandPrimitive.Item>) {\n\treturn <CommandPrimitive.Item className={cn('k4-command__item', className)} {...props} />;\n}\n\nexport function CommandShortcut({ className, ...props }: ComponentProps<'span'>) {\n\treturn <span className={cn('k4-command__shortcut', className)} {...props} />;\n}\n","import type { ComponentProps } from 'react';\n\nimport { cn } from '../../utils';\nimport './Input.css';\n\nexport type InputProps = ComponentProps<'input'>;\n\nexport function Input({ className, type, ...props }: InputProps) {\n\treturn <input type={type} className={cn('k4-input', className)} {...props} />;\n}\n","import { type VariantProps } from 'class-variance-authority';\nimport { ChevronLeftIcon, ChevronRightIcon, MoreHorizontalIcon } from 'lucide-react';\nimport type { ComponentProps } from 'react';\n\nimport { cn } from '../../utils';\nimport { buttonVariants } from '../Button';\nimport './Pagination.css';\n\nexport function Pagination({ className, ...props }: ComponentProps<'nav'>) {\n\treturn (\n\t\t<nav\n\t\t\trole=\"navigation\"\n\t\t\taria-label=\"pagination\"\n\t\t\tclassName={cn('k4-pagination', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport function PaginationContent({ className, ...props }: ComponentProps<'ul'>) {\n\treturn <ul className={cn('k4-pagination__content', className)} {...props} />;\n}\n\nexport function PaginationItem(props: ComponentProps<'li'>) {\n\treturn <li {...props} />;\n}\n\nexport type PaginationLinkProps = ComponentProps<'a'> &\n\tVariantProps<typeof buttonVariants> & {\n\t\t/** Marks the current page (aria-current + outline styling). */\n\t\tisActive?: boolean;\n\t};\n\n/** A page link, styled like a Button. Pass `href` for URL-driven pagination or\n * `onClick` for client state. */\nexport function PaginationLink({\n\tclassName,\n\tisActive,\n\tvariant,\n\tsize = 'icon',\n\t...props\n}: PaginationLinkProps) {\n\treturn (\n\t\t<a\n\t\t\taria-current={isActive ? 'page' : undefined}\n\t\t\tclassName={cn(\n\t\t\t\tbuttonVariants({\n\t\t\t\t\tvariant: variant ?? (isActive ? 'default' : 'ghost'),\n\t\t\t\t\tappearance: isActive ? 'outline' : 'filled',\n\t\t\t\t\tsize,\n\t\t\t\t}),\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport function PaginationPrevious({ className, ...props }: PaginationLinkProps) {\n\treturn (\n\t\t<PaginationLink\n\t\t\taria-label=\"Go to previous page\"\n\t\t\tsize=\"default\"\n\t\t\tclassName={cn('k4-pagination__nav', className)}\n\t\t\t{...props}>\n\t\t\t<ChevronLeftIcon />\n\t\t\t<span>Previous</span>\n\t\t</PaginationLink>\n\t);\n}\n\nexport function PaginationNext({ className, ...props }: PaginationLinkProps) {\n\treturn (\n\t\t<PaginationLink\n\t\t\taria-label=\"Go to next page\"\n\t\t\tsize=\"default\"\n\t\t\tclassName={cn('k4-pagination__nav', className)}\n\t\t\t{...props}>\n\t\t\t<span>Next</span>\n\t\t\t<ChevronRightIcon />\n\t\t</PaginationLink>\n\t);\n}\n\nexport function PaginationEllipsis({ className, ...props }: ComponentProps<'span'>) {\n\treturn (\n\t\t<span aria-hidden className={cn('k4-pagination__ellipsis', className)} {...props}>\n\t\t\t<MoreHorizontalIcon />\n\t\t</span>\n\t);\n}\n","import { Popover as PopoverPrimitive } from 'radix-ui';\nimport type { ComponentProps } from 'react';\n\nimport { cn } from '../../utils';\nimport './Popover.css';\n\nexport const Popover = PopoverPrimitive.Root;\nexport const PopoverTrigger = PopoverPrimitive.Trigger;\nexport const PopoverAnchor = PopoverPrimitive.Anchor;\n\nexport function PopoverContent({\n\tclassName,\n\talign = 'center',\n\tsideOffset = 4,\n\t...props\n}: ComponentProps<typeof PopoverPrimitive.Content>) {\n\treturn (\n\t\t<PopoverPrimitive.Portal>\n\t\t\t<PopoverPrimitive.Content\n\t\t\t\talign={align}\n\t\t\t\tsideOffset={sideOffset}\n\t\t\t\tclassName={cn('k4-popover__content', className)}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t</PopoverPrimitive.Portal>\n\t);\n}\n","import { cva, type VariantProps } from 'class-variance-authority';\nimport { Progress as ProgressPrimitive } from 'radix-ui';\nimport type { ComponentProps } from 'react';\n\nimport { cn } from '../../utils';\nimport './Progress.css';\n\nexport const progressVariants = cva('k4-progress', {\n\tvariants: {\n\t\tvariant: {\n\t\t\tdefault: 'k4-progress--default',\n\t\t\tsecondary: 'k4-progress--secondary',\n\t\t\tdestructive: 'k4-progress--destructive',\n\t\t\tsuccess: 'k4-progress--success',\n\t\t},\n\t},\n\tdefaultVariants: {\n\t\tvariant: 'default',\n\t},\n});\n\nexport type ProgressProps = ComponentProps<typeof ProgressPrimitive.Root> &\n\tVariantProps<typeof progressVariants>;\n\n/**\n * Progress bar (shadcn's Progress on the Radix primitive).\n *\n * - Determinate: pass `value` (0–100).\n * - Indeterminate: pass `value={null}` (or omit it) — the indicator sweeps\n * continuously, like a top-of-page navigation loader.\n */\nexport function Progress({ className, value, variant, ...props }: ProgressProps) {\n\tconst determinate = typeof value === 'number';\n\treturn (\n\t\t<ProgressPrimitive.Root\n\t\t\tclassName={cn(progressVariants({ variant }), className)}\n\t\t\tvalue={value}\n\t\t\t{...props}>\n\t\t\t<ProgressPrimitive.Indicator\n\t\t\t\tclassName=\"k4-progress__indicator\"\n\t\t\t\tstyle={determinate ? { transform: `translateX(-${100 - value}%)` } : undefined}\n\t\t\t/>\n\t\t</ProgressPrimitive.Root>\n\t);\n}\n","import { CircleIcon } from 'lucide-react';\nimport { RadioGroup as RadioGroupPrimitive } from 'radix-ui';\nimport type { ComponentProps } from 'react';\n\nimport { cn } from '../../utils';\nimport './RadioGroup.css';\n\nexport type RadioGroupProps = ComponentProps<typeof RadioGroupPrimitive.Root>;\n\nexport function RadioGroup({ className, ...props }: RadioGroupProps) {\n\treturn <RadioGroupPrimitive.Root className={cn('k4-radio-group', className)} {...props} />;\n}\n\nexport type RadioGroupItemProps = ComponentProps<typeof RadioGroupPrimitive.Item>;\n\nexport function RadioGroupItem({ className, ...props }: RadioGroupItemProps) {\n\treturn (\n\t\t<RadioGroupPrimitive.Item className={cn('k4-radio-group__item', className)} {...props}>\n\t\t\t<RadioGroupPrimitive.Indicator className=\"k4-radio-group__indicator\">\n\t\t\t\t<CircleIcon />\n\t\t\t</RadioGroupPrimitive.Indicator>\n\t\t</RadioGroupPrimitive.Item>\n\t);\n}\n","import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from 'lucide-react';\nimport { Select as SelectPrimitive } from 'radix-ui';\nimport type { ComponentProps } from 'react';\n\nimport { cn } from '../../utils';\nimport './Select.css';\n\nexport const Select = SelectPrimitive.Root;\nexport const SelectGroup = SelectPrimitive.Group;\nexport const SelectValue = SelectPrimitive.Value;\n\nexport type SelectTriggerProps = ComponentProps<typeof SelectPrimitive.Trigger> & {\n\tsize?: 'sm' | 'default';\n};\n\nexport function SelectTrigger({\n\tclassName,\n\tsize = 'default',\n\tchildren,\n\t...props\n}: SelectTriggerProps) {\n\treturn (\n\t\t<SelectPrimitive.Trigger\n\t\t\tclassName={cn('k4-select__trigger', `k4-select__trigger--${size}`, className)}\n\t\t\t{...props}>\n\t\t\t{children}\n\t\t\t<SelectPrimitive.Icon asChild>\n\t\t\t\t<ChevronDownIcon className=\"k4-select__chevron\" />\n\t\t\t</SelectPrimitive.Icon>\n\t\t</SelectPrimitive.Trigger>\n\t);\n}\n\nexport function SelectContent({\n\tclassName,\n\tchildren,\n\tposition = 'popper',\n\t...props\n}: ComponentProps<typeof SelectPrimitive.Content>) {\n\treturn (\n\t\t<SelectPrimitive.Portal>\n\t\t\t<SelectPrimitive.Content\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'k4-select__content',\n\t\t\t\t\tposition === 'popper' && 'k4-select__content--popper',\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\tposition={position}\n\t\t\t\t{...props}>\n\t\t\t\t<SelectScrollUpButton />\n\t\t\t\t<SelectPrimitive.Viewport className=\"k4-select__viewport\">\n\t\t\t\t\t{children}\n\t\t\t\t</SelectPrimitive.Viewport>\n\t\t\t\t<SelectScrollDownButton />\n\t\t\t</SelectPrimitive.Content>\n\t\t</SelectPrimitive.Portal>\n\t);\n}\n\nexport function SelectLabel({ className, ...props }: ComponentProps<typeof SelectPrimitive.Label>) {\n\treturn <SelectPrimitive.Label className={cn('k4-select__label', className)} {...props} />;\n}\n\nexport function SelectItem({\n\tclassName,\n\tchildren,\n\t...props\n}: ComponentProps<typeof SelectPrimitive.Item>) {\n\treturn (\n\t\t<SelectPrimitive.Item className={cn('k4-select__item', className)} {...props}>\n\t\t\t<span className=\"k4-select__item-indicator\">\n\t\t\t\t<SelectPrimitive.ItemIndicator>\n\t\t\t\t\t<CheckIcon />\n\t\t\t\t</SelectPrimitive.ItemIndicator>\n\t\t\t</span>\n\t\t\t<SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n\t\t</SelectPrimitive.Item>\n\t);\n}\n\nexport function SelectSeparator({\n\tclassName,\n\t...props\n}: ComponentProps<typeof SelectPrimitive.Separator>) {\n\treturn (\n\t\t<SelectPrimitive.Separator className={cn('k4-select__separator', className)} {...props} />\n\t);\n}\n\nexport function SelectScrollUpButton({\n\tclassName,\n\t...props\n}: ComponentProps<typeof SelectPrimitive.ScrollUpButton>) {\n\treturn (\n\t\t<SelectPrimitive.ScrollUpButton\n\t\t\tclassName={cn('k4-select__scroll-button', className)}\n\t\t\t{...props}>\n\t\t\t<ChevronUpIcon />\n\t\t</SelectPrimitive.ScrollUpButton>\n\t);\n}\n\nexport function SelectScrollDownButton({\n\tclassName,\n\t...props\n}: ComponentProps<typeof SelectPrimitive.ScrollDownButton>) {\n\treturn (\n\t\t<SelectPrimitive.ScrollDownButton\n\t\t\tclassName={cn('k4-select__scroll-button', className)}\n\t\t\t{...props}>\n\t\t\t<ChevronDownIcon />\n\t\t</SelectPrimitive.ScrollDownButton>\n\t);\n}\n","import { Separator as SeparatorPrimitive } from 'radix-ui';\nimport type { ComponentProps } from 'react';\n\nimport { cn } from '../../utils';\nimport './Separator.css';\n\nexport type SeparatorProps = ComponentProps<typeof SeparatorPrimitive.Root>;\n\nexport function Separator({\n\tclassName,\n\torientation = 'horizontal',\n\tdecorative = true,\n\t...props\n}: SeparatorProps) {\n\treturn (\n\t\t<SeparatorPrimitive.Root\n\t\t\tdecorative={decorative}\n\t\t\torientation={orientation}\n\t\t\tclassName={cn('k4-separator', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n","import type { ComponentProps } from 'react';\n\nimport { cn } from '../../utils';\nimport './Skeleton.css';\n\nexport type SkeletonProps = ComponentProps<'div'>;\n\nexport function Skeleton({ className, ...props }: SkeletonProps) {\n\treturn <div className={cn('k4-skeleton', className)} {...props} />;\n}\n","import { Switch as SwitchPrimitive } from 'radix-ui';\nimport type { ComponentProps } from 'react';\n\nimport { cn } from '../../utils';\nimport './Switch.css';\n\nexport type SwitchProps = ComponentProps<typeof SwitchPrimitive.Root>;\n\nexport function Switch({ className, ...props }: SwitchProps) {\n\treturn (\n\t\t<SwitchPrimitive.Root className={cn('k4-switch', className)} {...props}>\n\t\t\t<SwitchPrimitive.Thumb className=\"k4-switch__thumb\" />\n\t\t</SwitchPrimitive.Root>\n\t);\n}\n","import type { ComponentProps } from 'react';\n\nimport { cn } from '../../utils';\nimport './Table.css';\n\nexport type TableProps = ComponentProps<'table'>;\n\nexport function Table({ className, ...props }: TableProps) {\n\treturn (\n\t\t<div className=\"k4-table-container\">\n\t\t\t<table className={cn('k4-table', className)} {...props} />\n\t\t</div>\n\t);\n}\n\nexport function TableHeader({ className, ...props }: ComponentProps<'thead'>) {\n\treturn <thead className={cn('k4-table__header', className)} {...props} />;\n}\n\nexport function TableBody({ className, ...props }: ComponentProps<'tbody'>) {\n\treturn <tbody className={cn('k4-table__body', className)} {...props} />;\n}\n\nexport function TableFooter({ className, ...props }: ComponentProps<'tfoot'>) {\n\treturn <tfoot className={cn('k4-table__footer', className)} {...props} />;\n}\n\nexport function TableRow({ className, ...props }: ComponentProps<'tr'>) {\n\treturn <tr className={cn('k4-table__row', className)} {...props} />;\n}\n\nexport function TableHead({ className, ...props }: ComponentProps<'th'>) {\n\treturn <th className={cn('k4-table__head', className)} {...props} />;\n}\n\nexport function TableCell({ className, ...props }: ComponentProps<'td'>) {\n\treturn <td className={cn('k4-table__cell', className)} {...props} />;\n}\n\nexport function TableCaption({ className, ...props }: ComponentProps<'caption'>) {\n\treturn <caption className={cn('k4-table__caption', className)} {...props} />;\n}\n","import { Tabs as TabsPrimitive } from 'radix-ui';\nimport type { ComponentProps } from 'react';\n\nimport { cn } from '../../utils';\nimport './Tabs.css';\n\nexport type TabsProps = ComponentProps<typeof TabsPrimitive.Root>;\n\nexport function Tabs({ className, ...props }: TabsProps) {\n\treturn <TabsPrimitive.Root className={cn('k4-tabs', className)} {...props} />;\n}\n\nexport function TabsList({ className, ...props }: ComponentProps<typeof TabsPrimitive.List>) {\n\treturn <TabsPrimitive.List className={cn('k4-tabs__list', className)} {...props} />;\n}\n\nexport function TabsTrigger({ className, ...props }: ComponentProps<typeof TabsPrimitive.Trigger>) {\n\treturn <TabsPrimitive.Trigger className={cn('k4-tabs__trigger', className)} {...props} />;\n}\n\nexport function TabsContent({ className, ...props }: ComponentProps<typeof TabsPrimitive.Content>) {\n\treturn <TabsPrimitive.Content className={cn('k4-tabs__content', className)} {...props} />;\n}\n","import type { ComponentProps } from 'react';\n\nimport { cn } from '../../utils';\nimport './Textarea.css';\n\nexport type TextareaProps = ComponentProps<'textarea'>;\n\nexport function Textarea({ className, ...props }: TextareaProps) {\n\treturn <textarea className={cn('k4-textarea', className)} {...props} />;\n}\n","import { Tooltip as TooltipPrimitive } from 'radix-ui';\nimport type { ComponentProps } from 'react';\n\nimport { cn } from '../../utils';\nimport './Tooltip.css';\n\nexport const TooltipProvider = TooltipPrimitive.Provider;\nexport const Tooltip = TooltipPrimitive.Root;\nexport const TooltipTrigger = TooltipPrimitive.Trigger;\n\nexport function TooltipContent({\n\tclassName,\n\tsideOffset = 0,\n\tchildren,\n\t...props\n}: ComponentProps<typeof TooltipPrimitive.Content>) {\n\treturn (\n\t\t<TooltipPrimitive.Portal>\n\t\t\t<TooltipPrimitive.Content\n\t\t\t\tsideOffset={sideOffset}\n\t\t\t\tclassName={cn('k4-tooltip__content', className)}\n\t\t\t\t{...props}>\n\t\t\t\t{children}\n\t\t\t\t<TooltipPrimitive.Arrow className=\"k4-tooltip__arrow\" />\n\t\t\t</TooltipPrimitive.Content>\n\t\t</TooltipPrimitive.Portal>\n\t);\n}\n"],"mappings":";;;;;;;;;;;AAMA,IAAa,IAAb,cAA8B,MAAM;CACnC;CACA;CAEA,YAAY,GAAc,GAAiB,GAAmB;EAI7D,AAHA,MAAM,CAAO,GACb,KAAK,OAAO,YACZ,KAAK,OAAO,GACZ,KAAK,UAAU;CAChB;AACD;AAiBA,SAAgB,EAAe,GAAiC;CAiC/D,OAhCI,aAAiB,IACb;EACN,MAAM,EAAM;EACZ,SAAS,EAAM;EACf,SAAS,EAAM;EACf,UAAU;CACX,IAGG,EAAqB,CAAK,IACtB;EACN,MAAM,OAAO,EA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,EAAE,cAAW,GAAG,KAAoB;CACxD,OAAO,kBAAC,EAAc,MAAf;EAAoB,WAAW,EAAG,WAAW,CAAS;EAAG,GAAI;CAAQ,CAAA;AAC7E;AAEA,SAAgB,GAAS,EAAE,cAAW,GAAG,KAAoD;CAC5F,OAAO,kBAAC,EAAc,MAAf;EAAoB,WAAW,EAAG,iBAAiB,CAAS;EAAG,GAAI;CAAQ,CAAA;AACnF;AAEA,SAAgB,GAAY,EAAE,cAAW,GAAG,KAAuD;CAClG,OAAO,kBAAC,EAAc,SAAf;EAAuB,WAAW,EAAG,oBAAoB,CAAS;EAAG,GAAI;CAAQ,CAAA;AACzF;AAEA,SAAgB,GAAY,EAAE,cAAW,GAAG,KAAuD;CAClG,OAAO,kBAAC,EAAc,SAAf;EAAuB,WAAW,EAAG,oBAAoB,CAAS;EAAG,GAAI;CAAQ,CAAA;AACzF;;;ACfA,SAAgB,GAAS,EAAE,cAAW,GAAG,KAAwB;CAChE,OAAO,kBAAC,YAAD;EAAU,WAAW,EAAG,eAAe,CAAS;EAAG,GAAI;CAAQ,CAAA;AACvE;;;ACHA,IAAa,KAAkB,EAAiB,UACnC,KAAU,EAAiB,MAC3B,KAAiB,EAAiB;AAE/C,SAAgB,GAAe,EAC9B,cACA,gBAAa,GACb,aACA,GAAG,KACgD;CACnD,OACC,kBAAC,EAAiB,QAAlB,EAAA,UACC,kBAAC,EAAiB,SAAlB;EACa;EACZ,WAAW,EAAG,uBAAuB,CAAS;EAC9C,GAAI;YAHL,CAIE,GACD,kBAAC,EAAiB,OAAlB,EAAwB,WAAU,oBAAqB,CAAA,CAC9B;IACF,CAAA;AAE3B"}
@@ -0,0 +1 @@
1
+ export declare const isDev: boolean;
@@ -0,0 +1,3 @@
1
+ import type { AnyRouteDef } from '../router/types';
2
+ export declare function registerRoute(route: AnyRouteDef, fullPath: string): void;
3
+ export declare function getFullPath(route: AnyRouteDef): string;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Internal type utilities. NOT part of the public API — the `internal`
3
+ * folder is excluded from the barrel exports on purpose.
4
+ */
5
+ /** True when an object type has no known keys. Used to make params/search optional where empty. */
6
+ export type IsEmpty<T> = keyof T extends never ? true : false;
@@ -0,0 +1,18 @@
1
+ import type { ComponentProps, ReactNode } from 'react';
2
+ import './AppLayout.css';
3
+ export type AppLayoutProps = ComponentProps<'div'> & {
4
+ /** Fixed top region (e.g. a TopBar or Header). */
5
+ header?: ReactNode;
6
+ /** Fixed bottom region. */
7
+ footer?: ReactNode;
8
+ /** id of the scrollable <main> (the SkipLink target). Default 'main'. */
9
+ mainId?: string;
10
+ /** Accessible name for the scroll region (it is keyboard-focusable). */
11
+ contentLabel?: string;
12
+ };
13
+ /**
14
+ * Desktop-app frame: a viewport-tall column with a fixed header and footer and
15
+ * an independently-scrolling content pane between them. The chrome never
16
+ * scrolls; only the content does.
17
+ */
18
+ export declare function AppLayout({ header, footer, mainId, contentLabel, className, children, ...props }: AppLayoutProps): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ export * from './AppLayout';
@@ -0,0 +1,12 @@
1
+ import type { ComponentProps, ReactNode } from 'react';
2
+ import './CenteredLayout.css';
3
+ export type CenteredLayoutProps = ComponentProps<'div'> & {
4
+ header?: ReactNode;
5
+ footer?: ReactNode;
6
+ mainId?: string;
7
+ };
8
+ /**
9
+ * Focused frame: centers a constrained content block in the viewport. Good for
10
+ * auth, onboarding, and empty states. Optional header/footer.
11
+ */
12
+ export declare function CenteredLayout({ header, footer, mainId, className, children, ...props }: CenteredLayoutProps): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ export * from './CenteredLayout';
@@ -0,0 +1,35 @@
1
+ import { type VariantProps } from 'class-variance-authority';
2
+ import type { ComponentProps, ReactNode } from 'react';
3
+ import './Columns.css';
4
+ export declare const columnsVariants: (props?: ({
5
+ fillHeight?: boolean | null | undefined;
6
+ scroll?: boolean | null | undefined;
7
+ gap?: boolean | null | undefined;
8
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
9
+ export type ColumnsProps = ComponentProps<'div'> & VariantProps<typeof columnsVariants> & {
10
+ /** Left aside — put a <nav>/<aside> inside it for a landmark. */
11
+ left?: ReactNode;
12
+ /** Right aside (e.g. an "on this page" table of contents). */
13
+ right?: ReactNode;
14
+ /** Left aside width (any CSS length). Sets --k4-columns-left for this instance. */
15
+ leftWidth?: string;
16
+ /** Right aside width. Sets --k4-columns-right. */
17
+ rightWidth?: string;
18
+ };
19
+ /**
20
+ * Column layout — optional left and right asides around the content children
21
+ * (the holy-grail row). It's a generic grid, so it composes anywhere: a frame's
22
+ * content pane, a Card body, a Dialog body. Columns can be nested.
23
+ *
24
+ * Height modes:
25
+ * - default — sizes to content.
26
+ * - `fillHeight` — fills the layout's available height (`--k4-content-height`);
27
+ * the block grows with content and the layout scrolls as one.
28
+ * - `scroll` — locks to the available height and gives each column its own
29
+ * scroll (with overscroll containment, so scrolling a column doesn't chain to
30
+ * the page). The scroll cells are keyboard-focusable (WCAG 2.1.1).
31
+ *
32
+ * Aside widths are CSS vars, overridable per-instance (leftWidth/rightWidth) or
33
+ * globally. Collapses to a single column on narrow screens.
34
+ */
35
+ export declare function Columns({ left, right, leftWidth, rightWidth, fillHeight, scroll, gap, className, style, children, ...props }: ColumnsProps): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ export * from './Columns';
@@ -0,0 +1,5 @@
1
+ import type { ComponentProps } from 'react';
2
+ import './Container.css';
3
+ export type ContainerProps = ComponentProps<'div'>;
4
+ /** Centers and width-constrains content; use inside full-bleed sections. */
5
+ export declare function Container({ className, ...props }: ContainerProps): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ export * from './Container';
@@ -0,0 +1,37 @@
1
+ import { type ComponentProps } from 'react';
2
+ import './DashboardGrid.css';
3
+ export type DashboardGridProps = ComponentProps<'div'> & {
4
+ /** Number of equal columns (desktop/tablet). Default 4. Collapses to a single
5
+ * column on phones. */
6
+ columns?: number;
7
+ /** Minimum height of one row track; rows grow past it when content needs more.
8
+ * Row spans are multiples of this track, so it sets the dashboard's rhythm. */
9
+ rowHeight?: string;
10
+ };
11
+ /**
12
+ * A responsive dashboard grid — equal columns with a base row height, into which
13
+ * blocks (typically `Card`s) are dropped via `DashboardGridItem`. Blocks default
14
+ * to one cell and can span columns and/or rows. On phones the grid collapses to
15
+ * a single column and spans are ignored, so it's usable on touch out of the box.
16
+ *
17
+ * ```tsx
18
+ * <DashboardGrid columns={4}>
19
+ * <DashboardGridItem colSpan={2}><Card>…</Card></DashboardGridItem>
20
+ * <DashboardGridItem><Card>…</Card></DashboardGridItem>
21
+ * <DashboardGridItem colSpan={2} rowSpan={2}><Card>…</Card></DashboardGridItem>
22
+ * </DashboardGrid>
23
+ * ```
24
+ */
25
+ export declare function DashboardGrid({ columns, rowHeight, className, style, children, ...props }: DashboardGridProps): import("react").JSX.Element;
26
+ export type DashboardGridItemProps = ComponentProps<'div'> & {
27
+ /** Columns to span (default 1). Clamped to the grid's column count so a block
28
+ * can never overflow the grid width. */
29
+ colSpan?: number;
30
+ /** Row tracks to span (default 1). */
31
+ rowSpan?: number;
32
+ };
33
+ /**
34
+ * A cell in a `DashboardGrid`. Put a `Card` (or any block) inside — it stretches
35
+ * to fill the cell, so blocks in a row share a height.
36
+ */
37
+ export declare function DashboardGridItem({ colSpan, rowSpan, className, style, children, ...props }: DashboardGridItemProps): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ export * from './DashboardGrid';
@@ -0,0 +1,16 @@
1
+ import type { ComponentProps } from 'react';
2
+ import './FillHeight.css';
3
+ export type FillHeightProps = ComponentProps<'div'>;
4
+ /**
5
+ * A panel that fills the available height of its layout's content area —
6
+ * the viewport minus the chrome. Inside AppLayout it fills the scrolling
7
+ * content pane; inside SiteLayout it fills the viewport below the (sticky)
8
+ * header. Good for full-height hero sections and empty states.
9
+ *
10
+ * Reads the `--k4-content-height` variable the layouts expose, falling back to
11
+ * the small viewport (`100svh`) when used standalone. It uses `min-height` (not
12
+ * `height`) so taller content can still grow and scroll. Inside AppLayout it
13
+ * should be a direct child of the content pane (it fills via 100% of that
14
+ * definite-height pane).
15
+ */
16
+ export declare function FillHeight({ className, ...props }: FillHeightProps): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ export * from './FillHeight';
@@ -0,0 +1,5 @@
1
+ import type { ComponentProps } from 'react';
2
+ import './Footer.css';
3
+ export type FooterProps = ComponentProps<'footer'>;
4
+ /** Generic bottom region (contentinfo landmark). */
5
+ export declare function Footer({ className, ...props }: FooterProps): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ export * from './Footer';
@@ -0,0 +1,13 @@
1
+ import type { ComponentProps, ReactNode } from 'react';
2
+ import './Header.css';
3
+ export type HeaderProps = ComponentProps<'header'> & {
4
+ /** Left slot — typically a brand/logo. */
5
+ start?: ReactNode;
6
+ /** Right slot — typically actions (theme toggle, account, …). */
7
+ end?: ReactNode;
8
+ /** Shrink on scroll (CSS scroll-timeline; respects prefers-reduced-motion).
9
+ * Use inside SiteLayout, whose page scroll drives the animation. */
10
+ condense?: boolean;
11
+ };
12
+ /** Generic top region (banner landmark) with start / center / end slots. */
13
+ export declare function Header({ start, end, condense, className, children, ...props }: HeaderProps): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ export * from './Header';
@@ -0,0 +1,6 @@
1
+ import type { MenuItem } from '../../router/menu';
2
+ import './SideBar.css';
3
+ export type SideBarProps = {
4
+ items: MenuItem[];
5
+ };
6
+ export declare function SideBar({ items }: SideBarProps): import("react").JSX.Element | null;
@@ -0,0 +1 @@
1
+ export * from './SideBar';
@@ -0,0 +1,27 @@
1
+ import type { ComponentProps, ReactNode } from 'react';
2
+ import './SiteLayout.css';
3
+ export type SiteLayoutProps = ComponentProps<'div'> & {
4
+ /** Sticky top region (pass a condensing Header for shrink-on-scroll). */
5
+ header?: ReactNode;
6
+ /** Bottom region (sticky-footer behaviour). */
7
+ footer?: ReactNode;
8
+ /** id of the <main> (the SkipLink target). Default 'main'. */
9
+ mainId?: string;
10
+ /**
11
+ * Content width:
12
+ * - `'default'` (default) — centered + constrained to the `--k4-site-width`
13
+ * token; the typical website column.
14
+ * - `'full'` — edge-to-edge content (landing/marketing). Re-constrain
15
+ * individual sections with `<Container>` so backgrounds can bleed.
16
+ * - any CSS length (e.g. `'60rem'`) — constrain to that width (sets
17
+ * `--k4-site-width` inline for this instance).
18
+ */
19
+ maxWidth?: 'default' | 'full' | (string & {});
20
+ };
21
+ /**
22
+ * Website frame: the page scrolls. The header is sticky; the footer uses the
23
+ * sticky-footer pattern (pinned to the viewport bottom when content is short,
24
+ * pushed below the fold when content is tall). `maxWidth` switches between a
25
+ * constrained site column and full-bleed sections.
26
+ */
27
+ export declare function SiteLayout({ header, footer, mainId, maxWidth, className, children, ...props }: SiteLayoutProps): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ export * from './SiteLayout';
@@ -0,0 +1,9 @@
1
+ import type { ComponentProps } from 'react';
2
+ import './SkipLink.css';
3
+ export type SkipLinkProps = ComponentProps<'a'> & {
4
+ /** id of the main-content target. Default 'main'. */
5
+ targetId?: string;
6
+ };
7
+ /** Visually-hidden "skip to content" link that appears on keyboard focus.
8
+ * Render it as the first focusable element on the page. */
9
+ export declare function SkipLink({ targetId, className, children, ...props }: SkipLinkProps): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ export * from './SkipLink';