@append-fact/react-ui 0.0.1 → 0.2.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.
@@ -0,0 +1,17 @@
1
+ import * as React from "react";
2
+ export interface AsyncSelectOption {
3
+ value: string;
4
+ label: string;
5
+ disabled?: boolean;
6
+ }
7
+ export interface AsyncSelectProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onChange"> {
8
+ options: AsyncSelectOption[];
9
+ value?: string;
10
+ onChange?: (value: string) => void;
11
+ placeholder?: string;
12
+ isLoading?: boolean;
13
+ disabled?: boolean;
14
+ emptyMessage?: string;
15
+ }
16
+ declare function AsyncSelect({ className, options, value, onChange, placeholder, isLoading, disabled, emptyMessage, ...props }: AsyncSelectProps): import("react/jsx-runtime").JSX.Element;
17
+ export { AsyncSelect };
@@ -0,0 +1,31 @@
1
+ export type BmiCategory = "underweight" | "normal" | "overweight" | "obese1" | "obese2" | "obese3";
2
+ declare const BMI_RANGES: {
3
+ category: BmiCategory;
4
+ label: string;
5
+ min: number;
6
+ max: number;
7
+ color: string;
8
+ bg: string;
9
+ }[];
10
+ declare function calcBmi(weightKg: number, heightCm: number): number;
11
+ declare function getBmiCategory(bmi: number): {
12
+ category: BmiCategory;
13
+ label: string;
14
+ min: number;
15
+ max: number;
16
+ color: string;
17
+ bg: string;
18
+ };
19
+ export interface BmiIndicatorProps {
20
+ /** Weight in kilograms */
21
+ weightKg: number;
22
+ /** Height in centimeters */
23
+ heightCm: number;
24
+ /** Show weight/height inputs alongside the indicator */
25
+ showInputs?: boolean;
26
+ onWeightChange?: (value: number) => void;
27
+ onHeightChange?: (value: number) => void;
28
+ className?: string;
29
+ }
30
+ declare function BmiIndicator({ weightKg, heightCm, showInputs, onWeightChange, onHeightChange, className, }: BmiIndicatorProps): import("react/jsx-runtime").JSX.Element;
31
+ export { BmiIndicator, calcBmi, getBmiCategory, BMI_RANGES };
@@ -0,0 +1,15 @@
1
+ import * as React from "react";
2
+ export interface DragDropItem {
3
+ id: string;
4
+ [key: string]: unknown;
5
+ }
6
+ export interface DragDropListProps<T extends DragDropItem> {
7
+ items: T[];
8
+ onReorder: (items: T[]) => void;
9
+ renderItem: (item: T, index: number) => React.ReactNode;
10
+ className?: string;
11
+ itemClassName?: string;
12
+ disabled?: boolean;
13
+ }
14
+ declare function DragDropList<T extends DragDropItem>({ items, onReorder, renderItem, className, itemClassName, disabled, }: DragDropListProps<T>): import("react/jsx-runtime").JSX.Element;
15
+ export { DragDropList };
@@ -0,0 +1,10 @@
1
+ import { LucideIcon } from 'lucide-react';
2
+ import * as React from "react";
3
+ export interface EmptyStateProps extends React.HTMLAttributes<HTMLDivElement> {
4
+ icon?: LucideIcon;
5
+ title: string;
6
+ description?: string;
7
+ action?: React.ReactNode;
8
+ }
9
+ declare function EmptyState({ className, icon: Icon, title, description, action, ...props }: EmptyStateProps): import("react/jsx-runtime").JSX.Element;
10
+ export { EmptyState };
@@ -0,0 +1,20 @@
1
+ import * as React from "react";
2
+ export interface FilterField<TFilters extends Record<string, unknown>> {
3
+ key: keyof TFilters;
4
+ label: string;
5
+ type: "text" | "select" | "date" | "boolean";
6
+ placeholder?: string;
7
+ options?: {
8
+ value: string;
9
+ label: string;
10
+ }[];
11
+ }
12
+ export interface FilterPanelProps<TFilters extends Record<string, unknown>> extends Omit<React.HTMLAttributes<HTMLDivElement>, "onChange"> {
13
+ fields: FilterField<TFilters>[];
14
+ value: TFilters;
15
+ onChange: (filters: TFilters) => void;
16
+ onReset?: () => void;
17
+ className?: string;
18
+ }
19
+ declare function FilterPanel<TFilters extends Record<string, unknown>>({ fields, value, onChange, onReset, className, ...props }: FilterPanelProps<TFilters>): import("react/jsx-runtime").JSX.Element;
20
+ export { FilterPanel };
@@ -0,0 +1,19 @@
1
+ import * as React from "react";
2
+ export interface ResponsiveTableColumn<T> {
3
+ key: keyof T;
4
+ header: string;
5
+ className?: string;
6
+ render?: (value: T[keyof T], row: T) => React.ReactNode;
7
+ /** If true, this column is shown as the primary field in mobile card view */
8
+ primary?: boolean;
9
+ }
10
+ export interface ResponsiveTableProps<T extends Record<string, unknown>> extends React.HTMLAttributes<HTMLDivElement> {
11
+ columns: ResponsiveTableColumn<T>[];
12
+ data: T[];
13
+ getRowKey: (row: T) => string;
14
+ onRowClick?: (row: T) => void;
15
+ emptyMessage?: string;
16
+ isLoading?: boolean;
17
+ }
18
+ declare function ResponsiveTable<T extends Record<string, unknown>>({ columns, data, getRowKey, onRowClick, emptyMessage, isLoading, className, ...props }: ResponsiveTableProps<T>): import("react/jsx-runtime").JSX.Element;
19
+ export { ResponsiveTable };
@@ -0,0 +1,7 @@
1
+ import * as React from "react";
2
+ export interface SpinnerProps extends React.HTMLAttributes<HTMLDivElement> {
3
+ size?: "sm" | "md" | "lg" | "xl";
4
+ variant?: "default" | "primary" | "secondary" | "muted";
5
+ }
6
+ declare function Spinner({ className, size, variant, ...props }: SpinnerProps): import("react/jsx-runtime").JSX.Element;
7
+ export { Spinner };
@@ -0,0 +1,10 @@
1
+ export interface TimePickerProps {
2
+ value?: string;
3
+ onChange?: (value: string) => void;
4
+ disabled?: boolean;
5
+ className?: string;
6
+ label?: string;
7
+ minuteStep?: number;
8
+ }
9
+ declare function TimePicker({ value, onChange, disabled, className, label, minuteStep, }: TimePickerProps): import("react/jsx-runtime").JSX.Element;
10
+ export { TimePicker };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@append-fact/react-ui",
3
- "version": "0.0.1",
3
+ "version": "0.2.0",
4
4
  "main": "./index.js",
5
5
  "types": "./index.d.ts",
6
6
  "exports": {