@kjaniec-dev/ui 0.5.0 → 0.6.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.
package/dist/index.d.cts CHANGED
@@ -329,4 +329,35 @@ declare namespace DataTable {
329
329
  var displayName: string;
330
330
  }
331
331
 
332
- export { Accordion, AccordionContent, AccordionItem, type AccordionItemProps, type AccordionProps, AccordionTrigger, Alert, type AlertProps, Avatar, AvatarGroup, type AvatarProps, Badge, type BadgeProps, Breadcrumb, BreadcrumbItem, type BreadcrumbItemProps, BreadcrumbSeparator, Button, type ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, type CardProps, CardTitle, Checkbox, type CheckboxProps, DataTable, type DataTableColumn, type DataTableProps, DropdownMenu, DropdownMenuContent, type DropdownMenuContentProps, DropdownMenuItem, type DropdownMenuItemProps, DropdownMenuSeparator, DropdownMenuTrigger, EmptyState, type EmptyStateProps, Field, Hint, type HintProps, Input, type InputProps, Label, type LabelProps, MetricCard, type MetricCardProps, Modal, ModalActions, ModalDescription, type ModalProps, ModalTitle, PageHeader, type PageHeaderProps, Pagination, type PaginationProps, Progress, type ProgressProps, Radio, type RadioProps, Segmented, type SegmentedOption, type SegmentedProps, Select, type SelectProps, Slider, type SliderProps, Spinner, type SpinnerProps, Stat, type StatProps, Switch, type SwitchProps, Table, TableBody, TableCell, type TableCellProps, TableHead, TableHeader, TableRow, TableWrap, Tabs, TabsContent, type TabsContentProps, TabsList, type TabsProps, TabsTrigger, type TabsTriggerProps, Textarea, type TextareaProps, type ToastOptions, ToastProvider, type ToastTone, Tooltip, type TooltipProps, badgeVariants, buttonVariants, cn, sliderThumbCSS, useToast };
332
+ interface FormFieldProps extends React.HTMLAttributes<HTMLDivElement> {
333
+ label: string;
334
+ hint?: string;
335
+ error?: string;
336
+ required?: boolean;
337
+ children: React.ReactNode;
338
+ }
339
+ declare const FormField: React.ForwardRefExoticComponent<FormFieldProps & React.RefAttributes<HTMLDivElement>>;
340
+
341
+ interface ErrorStateProps extends React.HTMLAttributes<HTMLDivElement> {
342
+ title?: string;
343
+ message: string;
344
+ onRetry?: () => void;
345
+ retryLabel?: string;
346
+ }
347
+ declare const ErrorState: React.ForwardRefExoticComponent<ErrorStateProps & React.RefAttributes<HTMLDivElement>>;
348
+
349
+ interface SkeletonProps extends React.HTMLAttributes<HTMLDivElement> {
350
+ variant?: "text" | "circular" | "rectangular";
351
+ width?: string | number;
352
+ height?: string | number;
353
+ }
354
+ declare const Skeleton: React.ForwardRefExoticComponent<SkeletonProps & React.RefAttributes<HTMLDivElement>>;
355
+
356
+ interface DashboardShellProps extends React.HTMLAttributes<HTMLDivElement> {
357
+ sidebar?: React.ReactNode;
358
+ topbar?: React.ReactNode;
359
+ children: React.ReactNode;
360
+ }
361
+ declare const DashboardShell: React.ForwardRefExoticComponent<DashboardShellProps & React.RefAttributes<HTMLDivElement>>;
362
+
363
+ export { Accordion, AccordionContent, AccordionItem, type AccordionItemProps, type AccordionProps, AccordionTrigger, Alert, type AlertProps, Avatar, AvatarGroup, type AvatarProps, Badge, type BadgeProps, Breadcrumb, BreadcrumbItem, type BreadcrumbItemProps, BreadcrumbSeparator, Button, type ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, type CardProps, CardTitle, Checkbox, type CheckboxProps, DashboardShell, type DashboardShellProps, DataTable, type DataTableColumn, type DataTableProps, DropdownMenu, DropdownMenuContent, type DropdownMenuContentProps, DropdownMenuItem, type DropdownMenuItemProps, DropdownMenuSeparator, DropdownMenuTrigger, EmptyState, type EmptyStateProps, ErrorState, type ErrorStateProps, Field, FormField, type FormFieldProps, Hint, type HintProps, Input, type InputProps, Label, type LabelProps, MetricCard, type MetricCardProps, Modal, ModalActions, ModalDescription, type ModalProps, ModalTitle, PageHeader, type PageHeaderProps, Pagination, type PaginationProps, Progress, type ProgressProps, Radio, type RadioProps, Segmented, type SegmentedOption, type SegmentedProps, Select, type SelectProps, Skeleton, type SkeletonProps, Slider, type SliderProps, Spinner, type SpinnerProps, Stat, type StatProps, Switch, type SwitchProps, Table, TableBody, TableCell, type TableCellProps, TableHead, TableHeader, TableRow, TableWrap, Tabs, TabsContent, type TabsContentProps, TabsList, type TabsProps, TabsTrigger, type TabsTriggerProps, Textarea, type TextareaProps, type ToastOptions, ToastProvider, type ToastTone, Tooltip, type TooltipProps, badgeVariants, buttonVariants, cn, sliderThumbCSS, useToast };
package/dist/index.d.ts CHANGED
@@ -329,4 +329,35 @@ declare namespace DataTable {
329
329
  var displayName: string;
330
330
  }
331
331
 
332
- export { Accordion, AccordionContent, AccordionItem, type AccordionItemProps, type AccordionProps, AccordionTrigger, Alert, type AlertProps, Avatar, AvatarGroup, type AvatarProps, Badge, type BadgeProps, Breadcrumb, BreadcrumbItem, type BreadcrumbItemProps, BreadcrumbSeparator, Button, type ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, type CardProps, CardTitle, Checkbox, type CheckboxProps, DataTable, type DataTableColumn, type DataTableProps, DropdownMenu, DropdownMenuContent, type DropdownMenuContentProps, DropdownMenuItem, type DropdownMenuItemProps, DropdownMenuSeparator, DropdownMenuTrigger, EmptyState, type EmptyStateProps, Field, Hint, type HintProps, Input, type InputProps, Label, type LabelProps, MetricCard, type MetricCardProps, Modal, ModalActions, ModalDescription, type ModalProps, ModalTitle, PageHeader, type PageHeaderProps, Pagination, type PaginationProps, Progress, type ProgressProps, Radio, type RadioProps, Segmented, type SegmentedOption, type SegmentedProps, Select, type SelectProps, Slider, type SliderProps, Spinner, type SpinnerProps, Stat, type StatProps, Switch, type SwitchProps, Table, TableBody, TableCell, type TableCellProps, TableHead, TableHeader, TableRow, TableWrap, Tabs, TabsContent, type TabsContentProps, TabsList, type TabsProps, TabsTrigger, type TabsTriggerProps, Textarea, type TextareaProps, type ToastOptions, ToastProvider, type ToastTone, Tooltip, type TooltipProps, badgeVariants, buttonVariants, cn, sliderThumbCSS, useToast };
332
+ interface FormFieldProps extends React.HTMLAttributes<HTMLDivElement> {
333
+ label: string;
334
+ hint?: string;
335
+ error?: string;
336
+ required?: boolean;
337
+ children: React.ReactNode;
338
+ }
339
+ declare const FormField: React.ForwardRefExoticComponent<FormFieldProps & React.RefAttributes<HTMLDivElement>>;
340
+
341
+ interface ErrorStateProps extends React.HTMLAttributes<HTMLDivElement> {
342
+ title?: string;
343
+ message: string;
344
+ onRetry?: () => void;
345
+ retryLabel?: string;
346
+ }
347
+ declare const ErrorState: React.ForwardRefExoticComponent<ErrorStateProps & React.RefAttributes<HTMLDivElement>>;
348
+
349
+ interface SkeletonProps extends React.HTMLAttributes<HTMLDivElement> {
350
+ variant?: "text" | "circular" | "rectangular";
351
+ width?: string | number;
352
+ height?: string | number;
353
+ }
354
+ declare const Skeleton: React.ForwardRefExoticComponent<SkeletonProps & React.RefAttributes<HTMLDivElement>>;
355
+
356
+ interface DashboardShellProps extends React.HTMLAttributes<HTMLDivElement> {
357
+ sidebar?: React.ReactNode;
358
+ topbar?: React.ReactNode;
359
+ children: React.ReactNode;
360
+ }
361
+ declare const DashboardShell: React.ForwardRefExoticComponent<DashboardShellProps & React.RefAttributes<HTMLDivElement>>;
362
+
363
+ export { Accordion, AccordionContent, AccordionItem, type AccordionItemProps, type AccordionProps, AccordionTrigger, Alert, type AlertProps, Avatar, AvatarGroup, type AvatarProps, Badge, type BadgeProps, Breadcrumb, BreadcrumbItem, type BreadcrumbItemProps, BreadcrumbSeparator, Button, type ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, type CardProps, CardTitle, Checkbox, type CheckboxProps, DashboardShell, type DashboardShellProps, DataTable, type DataTableColumn, type DataTableProps, DropdownMenu, DropdownMenuContent, type DropdownMenuContentProps, DropdownMenuItem, type DropdownMenuItemProps, DropdownMenuSeparator, DropdownMenuTrigger, EmptyState, type EmptyStateProps, ErrorState, type ErrorStateProps, Field, FormField, type FormFieldProps, Hint, type HintProps, Input, type InputProps, Label, type LabelProps, MetricCard, type MetricCardProps, Modal, ModalActions, ModalDescription, type ModalProps, ModalTitle, PageHeader, type PageHeaderProps, Pagination, type PaginationProps, Progress, type ProgressProps, Radio, type RadioProps, Segmented, type SegmentedOption, type SegmentedProps, Select, type SelectProps, Skeleton, type SkeletonProps, Slider, type SliderProps, Spinner, type SpinnerProps, Stat, type StatProps, Switch, type SwitchProps, Table, TableBody, TableCell, type TableCellProps, TableHead, TableHeader, TableRow, TableWrap, Tabs, TabsContent, type TabsContentProps, TabsList, type TabsProps, TabsTrigger, type TabsTriggerProps, Textarea, type TextareaProps, type ToastOptions, ToastProvider, type ToastTone, Tooltip, type TooltipProps, badgeVariants, buttonVariants, cn, sliderThumbCSS, useToast };
package/dist/index.js CHANGED
@@ -632,7 +632,7 @@ var AccordionContent = React17.forwardRef(
632
632
  ref,
633
633
  className: cn("grid transition-[grid-template-rows] duration-200 ease-out", isOpen ? "[grid-template-rows:1fr]" : "[grid-template-rows:0fr]"),
634
634
  ...props,
635
- children: /* @__PURE__ */ jsx("div", { className: "overflow-hidden", children: /* @__PURE__ */ jsx("div", { className: cn("px-[1.2rem] pb-[1.1rem] text-[0.85rem] text-muted-foreground", className), children }) })
635
+ children: /* @__PURE__ */ jsx("div", { className: "overflow-hidden", children: /* @__PURE__ */ jsx("div", { className: cn("px-[1.2rem] pt-3 pb-4 text-[0.85rem] text-muted-foreground", className), children }) })
636
636
  }
637
637
  );
638
638
  }
@@ -1151,7 +1151,95 @@ function DataTable({
1151
1151
  ] });
1152
1152
  }
1153
1153
  DataTable.displayName = "DataTable";
1154
+ var FormField = React17.forwardRef(
1155
+ ({ className, label, hint, error, required, children, ...props }, ref) => {
1156
+ const id = React17.useId();
1157
+ const hintId = `${id}-hint`;
1158
+ const errorId = `${id}-error`;
1159
+ const child = React17.Children.only(children);
1160
+ const clonedChild = React17.cloneElement(child, {
1161
+ id: child.props.id ?? id,
1162
+ "aria-describedby": cn(
1163
+ hint && hintId,
1164
+ error && errorId,
1165
+ child.props["aria-describedby"]
1166
+ ) || void 0,
1167
+ "aria-invalid": error ? "true" : void 0,
1168
+ required: child.props.required ?? required
1169
+ });
1170
+ return /* @__PURE__ */ jsxs("div", { ref, className: cn("flex flex-col gap-1.5 w-full", className), ...props, children: [
1171
+ /* @__PURE__ */ jsx(Label, { htmlFor: id, required, children: label }),
1172
+ clonedChild,
1173
+ hint && !error && /* @__PURE__ */ jsx(Hint, { id: hintId, children: hint }),
1174
+ error && /* @__PURE__ */ jsx(Hint, { id: errorId, error: true, children: error })
1175
+ ] });
1176
+ }
1177
+ );
1178
+ FormField.displayName = "FormField";
1179
+ var ErrorState = React17.forwardRef(
1180
+ ({ className, title = "Wyst\u0105pi\u0142 b\u0142\u0105d", message, onRetry, retryLabel = "Spr\xF3buj ponownie", ...props }, ref) => /* @__PURE__ */ jsxs(
1181
+ "div",
1182
+ {
1183
+ ref,
1184
+ className: cn(
1185
+ "flex flex-col items-center justify-center text-center p-8 border border-danger/25 rounded-kj-lg bg-danger-surface/20 min-h-[300px]",
1186
+ className
1187
+ ),
1188
+ ...props,
1189
+ children: [
1190
+ /* @__PURE__ */ jsx("div", { className: "flex h-12 w-12 items-center justify-center rounded-full bg-danger-surface border border-danger/30 text-danger mb-4", children: /* @__PURE__ */ jsx("svg", { fill: "none", stroke: "currentColor", strokeWidth: 2.5, viewBox: "0 0 24 24", className: "h-6 w-6", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v3.75m9-.75a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 3.75h.008v.008H12v-.008Z" }) }) }),
1191
+ /* @__PURE__ */ jsx("h3", { className: "text-base font-bold text-foreground mb-1", children: title }),
1192
+ /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground max-w-sm mb-6 leading-relaxed", children: message }),
1193
+ onRetry && /* @__PURE__ */ jsx(Button, { size: "sm", variant: "danger", onClick: onRetry, children: retryLabel })
1194
+ ]
1195
+ }
1196
+ )
1197
+ );
1198
+ ErrorState.displayName = "ErrorState";
1199
+ var Skeleton = React17.forwardRef(
1200
+ ({ className, variant = "rectangular", width, height, style, ...props }, ref) => /* @__PURE__ */ jsx(
1201
+ "div",
1202
+ {
1203
+ ref,
1204
+ className: cn(
1205
+ "animate-pulse bg-muted/40",
1206
+ variant === "text" && "h-3 w-4/5 rounded-sm my-1.5",
1207
+ variant === "circular" && "rounded-full",
1208
+ variant === "rectangular" && "rounded-kj-md",
1209
+ className
1210
+ ),
1211
+ style: {
1212
+ width,
1213
+ height,
1214
+ ...style
1215
+ },
1216
+ ...props
1217
+ }
1218
+ )
1219
+ );
1220
+ Skeleton.displayName = "Skeleton";
1221
+ var DashboardShell = React17.forwardRef(
1222
+ ({ className, sidebar, topbar, children, ...props }, ref) => /* @__PURE__ */ jsxs(
1223
+ "div",
1224
+ {
1225
+ ref,
1226
+ className: cn(
1227
+ "min-h-screen bg-canvas text-foreground flex flex-col md:flex-row",
1228
+ className
1229
+ ),
1230
+ ...props,
1231
+ children: [
1232
+ sidebar && /* @__PURE__ */ jsx("aside", { className: "w-full md:w-64 border-r border-border bg-surface shrink-0 z-20", children: /* @__PURE__ */ jsx("div", { className: "sticky top-0 h-auto md:h-screen flex flex-col", children: sidebar }) }),
1233
+ /* @__PURE__ */ jsxs("div", { className: "flex-1 flex flex-col min-w-0", children: [
1234
+ topbar && /* @__PURE__ */ jsx("header", { className: "sticky top-0 h-14 border-b border-border bg-surface flex items-center px-6 z-10 shrink-0", children: topbar }),
1235
+ /* @__PURE__ */ jsx("main", { className: "flex-1 p-6 md:p-8 max-w-7xl w-full mx-auto", children })
1236
+ ] })
1237
+ ]
1238
+ }
1239
+ )
1240
+ );
1241
+ DashboardShell.displayName = "DashboardShell";
1154
1242
 
1155
- export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, Avatar, AvatarGroup, Badge, Breadcrumb, BreadcrumbItem, BreadcrumbSeparator, Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, DataTable, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger, EmptyState, Field, Hint, Input, Label, MetricCard, Modal, ModalActions, ModalDescription, ModalTitle, PageHeader, Pagination, Progress, Radio, Segmented, Select, Slider, Spinner, Stat, Switch, Table, TableBody, TableCell, TableHead, TableHeader, TableRow, TableWrap, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, ToastProvider, Tooltip, badgeVariants, buttonVariants, cn, sliderThumbCSS, useToast };
1243
+ export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, Avatar, AvatarGroup, Badge, Breadcrumb, BreadcrumbItem, BreadcrumbSeparator, Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, DashboardShell, DataTable, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger, EmptyState, ErrorState, Field, FormField, Hint, Input, Label, MetricCard, Modal, ModalActions, ModalDescription, ModalTitle, PageHeader, Pagination, Progress, Radio, Segmented, Select, Skeleton, Slider, Spinner, Stat, Switch, Table, TableBody, TableCell, TableHead, TableHeader, TableRow, TableWrap, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, ToastProvider, Tooltip, badgeVariants, buttonVariants, cn, sliderThumbCSS, useToast };
1156
1244
  //# sourceMappingURL=index.js.map
1157
1245
  //# sourceMappingURL=index.js.map