@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
@@ -0,0 +1,17 @@
1
+ import { type VariantProps } from 'class-variance-authority';
2
+ import type { ComponentProps } from 'react';
3
+ import { buttonVariants } from '../Button';
4
+ import './Pagination.css';
5
+ export declare function Pagination({ className, ...props }: ComponentProps<'nav'>): import("react").JSX.Element;
6
+ export declare function PaginationContent({ className, ...props }: ComponentProps<'ul'>): import("react").JSX.Element;
7
+ export declare function PaginationItem(props: ComponentProps<'li'>): import("react").JSX.Element;
8
+ export type PaginationLinkProps = ComponentProps<'a'> & VariantProps<typeof buttonVariants> & {
9
+ /** Marks the current page (aria-current + outline styling). */
10
+ isActive?: boolean;
11
+ };
12
+ /** A page link, styled like a Button. Pass `href` for URL-driven pagination or
13
+ * `onClick` for client state. */
14
+ export declare function PaginationLink({ className, isActive, variant, size, ...props }: PaginationLinkProps): import("react").JSX.Element;
15
+ export declare function PaginationPrevious({ className, ...props }: PaginationLinkProps): import("react").JSX.Element;
16
+ export declare function PaginationNext({ className, ...props }: PaginationLinkProps): import("react").JSX.Element;
17
+ export declare function PaginationEllipsis({ className, ...props }: ComponentProps<'span'>): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ export * from './Pagination';
@@ -0,0 +1,7 @@
1
+ import { Popover as PopoverPrimitive } from 'radix-ui';
2
+ import type { ComponentProps } from 'react';
3
+ import './Popover.css';
4
+ export declare const Popover: import("react").FC<PopoverPrimitive.PopoverProps>;
5
+ export declare const PopoverTrigger: import("react").ForwardRefExoticComponent<PopoverPrimitive.PopoverTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
6
+ export declare const PopoverAnchor: import("react").ForwardRefExoticComponent<PopoverPrimitive.PopoverAnchorProps & import("react").RefAttributes<HTMLDivElement>>;
7
+ export declare function PopoverContent({ className, align, sideOffset, ...props }: ComponentProps<typeof PopoverPrimitive.Content>): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ export * from './Popover';
@@ -0,0 +1,16 @@
1
+ import { type VariantProps } from 'class-variance-authority';
2
+ import { Progress as ProgressPrimitive } from 'radix-ui';
3
+ import type { ComponentProps } from 'react';
4
+ import './Progress.css';
5
+ export declare const progressVariants: (props?: ({
6
+ variant?: "default" | "secondary" | "destructive" | "success" | null | undefined;
7
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
8
+ export type ProgressProps = ComponentProps<typeof ProgressPrimitive.Root> & VariantProps<typeof progressVariants>;
9
+ /**
10
+ * Progress bar (shadcn's Progress on the Radix primitive).
11
+ *
12
+ * - Determinate: pass `value` (0–100).
13
+ * - Indeterminate: pass `value={null}` (or omit it) — the indicator sweeps
14
+ * continuously, like a top-of-page navigation loader.
15
+ */
16
+ export declare function Progress({ className, value, variant, ...props }: ProgressProps): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ export * from './Progress';
@@ -0,0 +1,7 @@
1
+ import { RadioGroup as RadioGroupPrimitive } from 'radix-ui';
2
+ import type { ComponentProps } from 'react';
3
+ import './RadioGroup.css';
4
+ export type RadioGroupProps = ComponentProps<typeof RadioGroupPrimitive.Root>;
5
+ export declare function RadioGroup({ className, ...props }: RadioGroupProps): import("react").JSX.Element;
6
+ export type RadioGroupItemProps = ComponentProps<typeof RadioGroupPrimitive.Item>;
7
+ export declare function RadioGroupItem({ className, ...props }: RadioGroupItemProps): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ export * from './RadioGroup';
@@ -0,0 +1,16 @@
1
+ import { Select as SelectPrimitive } from 'radix-ui';
2
+ import type { ComponentProps } from 'react';
3
+ import './Select.css';
4
+ export declare const Select: import("react").FC<SelectPrimitive.SelectProps>;
5
+ export declare const SelectGroup: import("react").ForwardRefExoticComponent<SelectPrimitive.SelectGroupProps & import("react").RefAttributes<HTMLDivElement>>;
6
+ export declare const SelectValue: import("react").ForwardRefExoticComponent<SelectPrimitive.SelectValueProps & import("react").RefAttributes<HTMLSpanElement>>;
7
+ export type SelectTriggerProps = ComponentProps<typeof SelectPrimitive.Trigger> & {
8
+ size?: 'sm' | 'default';
9
+ };
10
+ export declare function SelectTrigger({ className, size, children, ...props }: SelectTriggerProps): import("react").JSX.Element;
11
+ export declare function SelectContent({ className, children, position, ...props }: ComponentProps<typeof SelectPrimitive.Content>): import("react").JSX.Element;
12
+ export declare function SelectLabel({ className, ...props }: ComponentProps<typeof SelectPrimitive.Label>): import("react").JSX.Element;
13
+ export declare function SelectItem({ className, children, ...props }: ComponentProps<typeof SelectPrimitive.Item>): import("react").JSX.Element;
14
+ export declare function SelectSeparator({ className, ...props }: ComponentProps<typeof SelectPrimitive.Separator>): import("react").JSX.Element;
15
+ export declare function SelectScrollUpButton({ className, ...props }: ComponentProps<typeof SelectPrimitive.ScrollUpButton>): import("react").JSX.Element;
16
+ export declare function SelectScrollDownButton({ className, ...props }: ComponentProps<typeof SelectPrimitive.ScrollDownButton>): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ export * from './Select';
@@ -0,0 +1,5 @@
1
+ import { Separator as SeparatorPrimitive } from 'radix-ui';
2
+ import type { ComponentProps } from 'react';
3
+ import './Separator.css';
4
+ export type SeparatorProps = ComponentProps<typeof SeparatorPrimitive.Root>;
5
+ export declare function Separator({ className, orientation, decorative, ...props }: SeparatorProps): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ export * from './Separator';
@@ -0,0 +1,17 @@
1
+ import { Dialog as SheetPrimitive } from 'radix-ui';
2
+ import type { ComponentProps } from 'react';
3
+ import './Sheet.css';
4
+ export declare const Sheet: import("react").FC<SheetPrimitive.DialogProps>;
5
+ export declare const SheetTrigger: import("react").ForwardRefExoticComponent<SheetPrimitive.DialogTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
6
+ export declare const SheetClose: import("react").ForwardRefExoticComponent<SheetPrimitive.DialogCloseProps & import("react").RefAttributes<HTMLButtonElement>>;
7
+ export declare const SheetPortal: import("react").FC<SheetPrimitive.DialogPortalProps>;
8
+ export declare function SheetOverlay({ className, ...props }: ComponentProps<typeof SheetPrimitive.Overlay>): import("react").JSX.Element;
9
+ export type SheetSide = 'top' | 'right' | 'bottom' | 'left';
10
+ export type SheetContentProps = ComponentProps<typeof SheetPrimitive.Content> & {
11
+ side?: SheetSide;
12
+ };
13
+ export declare function SheetContent({ className, children, side, ...props }: SheetContentProps): import("react").JSX.Element;
14
+ export declare function SheetHeader({ className, ...props }: ComponentProps<'div'>): import("react").JSX.Element;
15
+ export declare function SheetFooter({ className, ...props }: ComponentProps<'div'>): import("react").JSX.Element;
16
+ export declare function SheetTitle({ className, ...props }: ComponentProps<typeof SheetPrimitive.Title>): import("react").JSX.Element;
17
+ export declare function SheetDescription({ className, ...props }: ComponentProps<typeof SheetPrimitive.Description>): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ export * from './Sheet';
@@ -0,0 +1,4 @@
1
+ import type { ComponentProps } from 'react';
2
+ import './Skeleton.css';
3
+ export type SkeletonProps = ComponentProps<'div'>;
4
+ export declare function Skeleton({ className, ...props }: SkeletonProps): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ export * from './Skeleton';
@@ -0,0 +1,35 @@
1
+ import type { ComponentProps } from 'react';
2
+ import './Spinner.css';
3
+ export type SpinnerProps = ComponentProps<'svg'>;
4
+ /**
5
+ * Rotating loading indicator (shadcn's Spinner). Sized to match icon slots,
6
+ * so it drops straight into a Button to show a loading state:
7
+ *
8
+ * <Button disabled>
9
+ * <Spinner />
10
+ * Loading…
11
+ * </Button>
12
+ */
13
+ export declare function Spinner({ className, ...props }: SpinnerProps): import("react").JSX.Element;
14
+ export type DotsSpinnerProps = {
15
+ label?: string;
16
+ vertical?: boolean;
17
+ };
18
+ /**
19
+ * Three-dots spinner with an optional label. Renders as an inline-flex span
20
+ * so it can sit next to text; used by SpinnerBlock for full-area loading.
21
+ */
22
+ export declare function DotsSpinner({ label, vertical }: DotsSpinnerProps): import("react").JSX.Element;
23
+ export type SpinnerBlockProps = {
24
+ label?: string;
25
+ };
26
+ /**
27
+ * Block-level spinner that centers itself both horizontally and vertically
28
+ * within its parent. Use for full-page loading, Suspense fallbacks, etc.
29
+ */
30
+ export declare function SpinnerBlock({ label }: SpinnerBlockProps): import("react").JSX.Element;
31
+ /**
32
+ * Default for the router's HydrateFallback slot; shown only while the data
33
+ * router boots. Override via `createAppRouter`'s `hydrateFallback` option.
34
+ */
35
+ export declare function DefaultHydrateFallback(): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ export * from './Spinner';
@@ -0,0 +1,5 @@
1
+ import { Switch as SwitchPrimitive } from 'radix-ui';
2
+ import type { ComponentProps } from 'react';
3
+ import './Switch.css';
4
+ export type SwitchProps = ComponentProps<typeof SwitchPrimitive.Root>;
5
+ export declare function Switch({ className, ...props }: SwitchProps): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ export * from './Switch';
@@ -0,0 +1,11 @@
1
+ import type { ComponentProps } from 'react';
2
+ import './Table.css';
3
+ export type TableProps = ComponentProps<'table'>;
4
+ export declare function Table({ className, ...props }: TableProps): import("react").JSX.Element;
5
+ export declare function TableHeader({ className, ...props }: ComponentProps<'thead'>): import("react").JSX.Element;
6
+ export declare function TableBody({ className, ...props }: ComponentProps<'tbody'>): import("react").JSX.Element;
7
+ export declare function TableFooter({ className, ...props }: ComponentProps<'tfoot'>): import("react").JSX.Element;
8
+ export declare function TableRow({ className, ...props }: ComponentProps<'tr'>): import("react").JSX.Element;
9
+ export declare function TableHead({ className, ...props }: ComponentProps<'th'>): import("react").JSX.Element;
10
+ export declare function TableCell({ className, ...props }: ComponentProps<'td'>): import("react").JSX.Element;
11
+ export declare function TableCaption({ className, ...props }: ComponentProps<'caption'>): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ export * from './Table';
@@ -0,0 +1,8 @@
1
+ import { Tabs as TabsPrimitive } from 'radix-ui';
2
+ import type { ComponentProps } from 'react';
3
+ import './Tabs.css';
4
+ export type TabsProps = ComponentProps<typeof TabsPrimitive.Root>;
5
+ export declare function Tabs({ className, ...props }: TabsProps): import("react").JSX.Element;
6
+ export declare function TabsList({ className, ...props }: ComponentProps<typeof TabsPrimitive.List>): import("react").JSX.Element;
7
+ export declare function TabsTrigger({ className, ...props }: ComponentProps<typeof TabsPrimitive.Trigger>): import("react").JSX.Element;
8
+ export declare function TabsContent({ className, ...props }: ComponentProps<typeof TabsPrimitive.Content>): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ export * from './Tabs';
@@ -0,0 +1,4 @@
1
+ import type { ComponentProps } from 'react';
2
+ import './Textarea.css';
3
+ export type TextareaProps = ComponentProps<'textarea'>;
4
+ export declare function Textarea({ className, ...props }: TextareaProps): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ export * from './Textarea';
@@ -0,0 +1,7 @@
1
+ import { Tooltip as TooltipPrimitive } from 'radix-ui';
2
+ import type { ComponentProps } from 'react';
3
+ import './Tooltip.css';
4
+ export declare const TooltipProvider: import("react").FC<TooltipPrimitive.TooltipProviderProps>;
5
+ export declare const Tooltip: import("react").FC<TooltipPrimitive.TooltipProps>;
6
+ export declare const TooltipTrigger: import("react").ForwardRefExoticComponent<TooltipPrimitive.TooltipTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
7
+ export declare function TooltipContent({ className, sideOffset, children, ...props }: ComponentProps<typeof TooltipPrimitive.Content>): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ export * from './Tooltip';
package/ui/index.d.ts ADDED
@@ -0,0 +1,29 @@
1
+ export * from './Accordion';
2
+ export * from './Alert';
3
+ export * from './AlertDialog';
4
+ export * from './Avatar';
5
+ export * from './AwaitErrorBlock';
6
+ export * from './Badge';
7
+ export * from './Button';
8
+ export * from './Card';
9
+ export * from './Checkbox';
10
+ export * from './Command';
11
+ export * from './Dialog';
12
+ export * from './DropdownMenu';
13
+ export * from './ErrorBlock';
14
+ export * from './Input';
15
+ export * from './Label';
16
+ export * from './Pagination';
17
+ export * from './Popover';
18
+ export * from './Progress';
19
+ export * from './RadioGroup';
20
+ export * from './Select';
21
+ export * from './Separator';
22
+ export * from './Sheet';
23
+ export * from './Skeleton';
24
+ export * from './Spinner';
25
+ export * from './Switch';
26
+ export * from './Table';
27
+ export * from './Tabs';
28
+ export * from './Textarea';
29
+ export * from './Tooltip';
package/utils.d.ts ADDED
@@ -0,0 +1,8 @@
1
+ import { type ClassValue } from 'clsx';
2
+ /**
3
+ * Joins class values (strings, conditionals, arrays) into one className.
4
+ * Same call signature as shadcn's `cn`, but without tailwind-merge —
5
+ * our classes are semantic BEM names, so utility-conflict merging is
6
+ * unnecessary.
7
+ */
8
+ export declare function cn(...inputs: ClassValue[]): string;