@bleakedev/bleake-components 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as React$1 from 'react';
2
- import React__default, { ComponentProps } from 'react';
2
+ import React__default, { ReactElement, ComponentProps } from 'react';
3
3
  import { LucideIcon } from 'lucide-react';
4
4
  import { Accordion as Accordion$1, AlertDialog as AlertDialog$1, Avatar as Avatar$1, Checkbox as Checkbox$1, Collapsible as Collapsible$1, ContextMenu as ContextMenu$1, Dialog as Dialog$1, DropdownMenu as DropdownMenu$1, HoverCard as HoverCard$1, Label as Label$1, Menubar as Menubar$1, Popover as Popover$1, RadioGroup as RadioGroup$1, Select as Select$1, Separator as Separator$1, Switch as Switch$1, Tabs as Tabs$1, Toggle as Toggle$1, ToggleGroup as ToggleGroup$1, Tooltip as Tooltip$1 } from 'radix-ui';
5
5
  import { VariantProps } from 'class-variance-authority';
@@ -10,6 +10,84 @@ import { Command as Command$1 } from 'cmdk';
10
10
  import { OTPInput } from 'input-otp';
11
11
  import { ToasterProps } from 'sonner';
12
12
 
13
+ type SlideUpProps = {
14
+ children: React__default.ReactNode;
15
+ className?: string;
16
+ };
17
+ declare const SlideUp: ({ children, className }: SlideUpProps) => React__default.ReactElement;
18
+
19
+ type EmptyAction = {
20
+ label: string;
21
+ onClick: () => void;
22
+ icon?: LucideIcon;
23
+ };
24
+ type EmptyProps = {
25
+ title?: string;
26
+ description?: string;
27
+ icon?: LucideIcon;
28
+ action?: EmptyAction;
29
+ className?: string;
30
+ };
31
+ declare const Empty: ({ title, description, icon: Icon, action, className, }: EmptyProps) => React__default.ReactElement;
32
+
33
+ type ErrorFallbackProps = {
34
+ error: unknown;
35
+ resetError: () => void;
36
+ };
37
+ declare function ErrorFallback({ error, resetError }: ErrorFallbackProps): ReactElement;
38
+
39
+ type FilterSelectProps = {
40
+ label?: string;
41
+ options: Option[];
42
+ value?: string;
43
+ onChange?: (value: string) => void;
44
+ placeholder?: string;
45
+ disabled?: boolean;
46
+ className?: string;
47
+ labelClassName?: string;
48
+ inputClassName?: string;
49
+ };
50
+ declare const FilterSelect: ({ label, options, value, onChange, placeholder, disabled, className, labelClassName, inputClassName, }: FilterSelectProps) => React__default.ReactElement;
51
+
52
+ declare const SectionTitle: ({ icon: Icon, title, description, action, onEdit, editLabel, }: SectionTitleProps) => React__default.ReactElement;
53
+
54
+ type BreadcrumbItemConfig = {
55
+ label: string;
56
+ href: string;
57
+ } | {
58
+ label: string;
59
+ href?: never;
60
+ };
61
+
62
+ type AppBreadcrumbsProps = {
63
+ backRoute: string;
64
+ config: BreadcrumbItemConfig[];
65
+ };
66
+ declare const AppBreadcrumbs: ({ backRoute, config }: AppBreadcrumbsProps) => React__default.ReactElement;
67
+
68
+ type AppTabsProps<TData> = {
69
+ config: AppTabsConfig<TData>;
70
+ data: TData;
71
+ defaultValue?: string;
72
+ className?: string;
73
+ tabListClassname?: string;
74
+ variant?: "default" | "line";
75
+ size?: "default" | "sm" | "xs";
76
+ };
77
+ declare const AppTabs: <TData>({ config, data, defaultValue, className, tabListClassname, variant, size, }: AppTabsProps<TData>) => React__default.ReactElement;
78
+
79
+ /**
80
+ * Generic table pagination component.
81
+ *
82
+ * Visibility rule:
83
+ * - Renders when `totalPages >= 1` (even a single page shows the bar)
84
+ * - Hidden only when there is no data at all (`totalPages === 0`)
85
+ *
86
+ * Consumers are responsible for the outer visibility guard:
87
+ * `{totalPages >= 1 && <TablePagination ... />}`
88
+ */
89
+ declare const TablePagination: ({ page, totalPages, onPageChange, pageSize, onPageSizeChange, }: TablePaginationProps) => React__default.ReactElement;
90
+
13
91
  type ActionsMenuProps = {
14
92
  children: React__default.ReactNode;
15
93
  align?: "start" | "center" | "end";
@@ -102,7 +180,7 @@ declare const Avatar: ({ className, size, ...props }: React__default.ComponentPr
102
180
  }) => React__default.ReactElement;
103
181
 
104
182
  declare const badgeVariants: (props?: ({
105
- variant?: "default" | "outline" | "secondary" | "ghost" | "destructive" | "link" | "success" | "error" | "warning" | "info" | null | undefined;
183
+ variant?: "link" | "outline" | "default" | "secondary" | "ghost" | "destructive" | "success" | "error" | "warning" | "info" | null | undefined;
106
184
  } & class_variance_authority_types.ClassProp) | undefined) => string;
107
185
 
108
186
  declare const Badge: ({ className, variant, asChild, ...props }: React__default.ComponentProps<"span"> & VariantProps<typeof badgeVariants> & {
@@ -112,7 +190,7 @@ declare const Badge: ({ className, variant, asChild, ...props }: React__default.
112
190
  declare const Breadcrumb: ({ className, ...props }: React__default.ComponentProps<"nav">) => React__default.ReactElement;
113
191
 
114
192
  declare const buttonVariants: (props?: ({
115
- variant?: "default" | "outline" | "secondary" | "ghost" | "destructive" | "link" | "success" | null | undefined;
193
+ variant?: "link" | "outline" | "default" | "secondary" | "ghost" | "destructive" | "success" | null | undefined;
116
194
  size?: "default" | "sm" | "lg" | "icon" | null | undefined;
117
195
  } & class_variance_authority_types.ClassProp) | undefined) => string;
118
196
  type ButtonVariants = VariantProps<typeof buttonVariants>;
@@ -123,7 +201,7 @@ type Props = React__default.ComponentProps<"button"> & ButtonVariants & {
123
201
  declare const Button: ({ className, variant, size, asChild, ...props }: Props) => React__default.ReactElement;
124
202
 
125
203
  declare const buttonGroupVariants: (props?: ({
126
- orientation?: "vertical" | "horizontal" | null | undefined;
204
+ orientation?: "horizontal" | "vertical" | null | undefined;
127
205
  } & class_variance_authority_types.ClassProp) | undefined) => string;
128
206
 
129
207
  declare const ButtonGroup: ({ className, orientation, ...props }: React__default.ComponentProps<"div"> & VariantProps<typeof buttonGroupVariants>) => React__default.ReactElement;
@@ -200,7 +278,7 @@ declare const InputOTP: ({ className, containerClassName, ...props }: React__def
200
278
  }) => React__default.ReactElement;
201
279
 
202
280
  declare const itemVariants: (props?: ({
203
- variant?: "default" | "outline" | "muted" | null | undefined;
281
+ variant?: "outline" | "default" | "muted" | null | undefined;
204
282
  size?: "default" | "sm" | "xs" | null | undefined;
205
283
  } & class_variance_authority_types.ClassProp) | undefined) => string;
206
284
 
@@ -295,7 +373,7 @@ declare const Tabs: ({ className, orientation, ...props }: React__default.Compon
295
373
  declare const Textarea: ({ className, ...props }: React__default.ComponentProps<"textarea">) => React__default.ReactElement;
296
374
 
297
375
  declare const toggleVariants: (props?: ({
298
- variant?: "default" | "outline" | null | undefined;
376
+ variant?: "outline" | "default" | null | undefined;
299
377
  size?: "default" | "sm" | "lg" | null | undefined;
300
378
  } & class_variance_authority_types.ClassProp) | undefined) => string;
301
379
 
@@ -308,4 +386,4 @@ declare const ToggleGroup: ({ className, variant, size, spacing, orientation, ch
308
386
 
309
387
  declare const Tooltip: ({ ...props }: React__default.ComponentProps<typeof Tooltip$1.Root>) => React__default.ReactElement;
310
388
 
311
- export { Accordion, ActionsMenu, AlertDialog, Avatar, Badge, Breadcrumb, Button, ButtonGroup, Calendar, Card, Checkbox, Collapsible, Combobox, Command, ConfirmDialog, ContextMenu, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, Glow, HoverCard, Image, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, InputOTP, Item, Label, Menubar, Modal, Pagination, Popover, Progress, RadioGroup, SectionCard, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, Sidebar, Skeleton, Spinner, Steps, Switch, Table, Tabs, Textarea, Toaster, Toggle, ToggleGroup, Tooltip, TruncatedText, WaveLayer };
389
+ export { Accordion, ActionsMenu, AlertDialog, AppBreadcrumbs, AppTabs, Avatar, Badge, Breadcrumb, Button, ButtonGroup, Calendar, Card, Checkbox, Collapsible, Combobox, Command, ConfirmDialog, ContextMenu, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, Empty, ErrorFallback, FilterSelect, Glow, HoverCard, Image, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, InputOTP, Item, Label, Menubar, Modal, Pagination, Popover, Progress, RadioGroup, SectionCard, SectionTitle, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, Sidebar, Skeleton, SlideUp, Spinner, Steps, Switch, Table, TablePagination, Tabs, Textarea, Toaster, Toggle, ToggleGroup, Tooltip, TruncatedText, WaveLayer };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as React$1 from 'react';
2
- import React__default, { ComponentProps } from 'react';
2
+ import React__default, { ReactElement, ComponentProps } from 'react';
3
3
  import { LucideIcon } from 'lucide-react';
4
4
  import { Accordion as Accordion$1, AlertDialog as AlertDialog$1, Avatar as Avatar$1, Checkbox as Checkbox$1, Collapsible as Collapsible$1, ContextMenu as ContextMenu$1, Dialog as Dialog$1, DropdownMenu as DropdownMenu$1, HoverCard as HoverCard$1, Label as Label$1, Menubar as Menubar$1, Popover as Popover$1, RadioGroup as RadioGroup$1, Select as Select$1, Separator as Separator$1, Switch as Switch$1, Tabs as Tabs$1, Toggle as Toggle$1, ToggleGroup as ToggleGroup$1, Tooltip as Tooltip$1 } from 'radix-ui';
5
5
  import { VariantProps } from 'class-variance-authority';
@@ -10,6 +10,84 @@ import { Command as Command$1 } from 'cmdk';
10
10
  import { OTPInput } from 'input-otp';
11
11
  import { ToasterProps } from 'sonner';
12
12
 
13
+ type SlideUpProps = {
14
+ children: React__default.ReactNode;
15
+ className?: string;
16
+ };
17
+ declare const SlideUp: ({ children, className }: SlideUpProps) => React__default.ReactElement;
18
+
19
+ type EmptyAction = {
20
+ label: string;
21
+ onClick: () => void;
22
+ icon?: LucideIcon;
23
+ };
24
+ type EmptyProps = {
25
+ title?: string;
26
+ description?: string;
27
+ icon?: LucideIcon;
28
+ action?: EmptyAction;
29
+ className?: string;
30
+ };
31
+ declare const Empty: ({ title, description, icon: Icon, action, className, }: EmptyProps) => React__default.ReactElement;
32
+
33
+ type ErrorFallbackProps = {
34
+ error: unknown;
35
+ resetError: () => void;
36
+ };
37
+ declare function ErrorFallback({ error, resetError }: ErrorFallbackProps): ReactElement;
38
+
39
+ type FilterSelectProps = {
40
+ label?: string;
41
+ options: Option[];
42
+ value?: string;
43
+ onChange?: (value: string) => void;
44
+ placeholder?: string;
45
+ disabled?: boolean;
46
+ className?: string;
47
+ labelClassName?: string;
48
+ inputClassName?: string;
49
+ };
50
+ declare const FilterSelect: ({ label, options, value, onChange, placeholder, disabled, className, labelClassName, inputClassName, }: FilterSelectProps) => React__default.ReactElement;
51
+
52
+ declare const SectionTitle: ({ icon: Icon, title, description, action, onEdit, editLabel, }: SectionTitleProps) => React__default.ReactElement;
53
+
54
+ type BreadcrumbItemConfig = {
55
+ label: string;
56
+ href: string;
57
+ } | {
58
+ label: string;
59
+ href?: never;
60
+ };
61
+
62
+ type AppBreadcrumbsProps = {
63
+ backRoute: string;
64
+ config: BreadcrumbItemConfig[];
65
+ };
66
+ declare const AppBreadcrumbs: ({ backRoute, config }: AppBreadcrumbsProps) => React__default.ReactElement;
67
+
68
+ type AppTabsProps<TData> = {
69
+ config: AppTabsConfig<TData>;
70
+ data: TData;
71
+ defaultValue?: string;
72
+ className?: string;
73
+ tabListClassname?: string;
74
+ variant?: "default" | "line";
75
+ size?: "default" | "sm" | "xs";
76
+ };
77
+ declare const AppTabs: <TData>({ config, data, defaultValue, className, tabListClassname, variant, size, }: AppTabsProps<TData>) => React__default.ReactElement;
78
+
79
+ /**
80
+ * Generic table pagination component.
81
+ *
82
+ * Visibility rule:
83
+ * - Renders when `totalPages >= 1` (even a single page shows the bar)
84
+ * - Hidden only when there is no data at all (`totalPages === 0`)
85
+ *
86
+ * Consumers are responsible for the outer visibility guard:
87
+ * `{totalPages >= 1 && <TablePagination ... />}`
88
+ */
89
+ declare const TablePagination: ({ page, totalPages, onPageChange, pageSize, onPageSizeChange, }: TablePaginationProps) => React__default.ReactElement;
90
+
13
91
  type ActionsMenuProps = {
14
92
  children: React__default.ReactNode;
15
93
  align?: "start" | "center" | "end";
@@ -102,7 +180,7 @@ declare const Avatar: ({ className, size, ...props }: React__default.ComponentPr
102
180
  }) => React__default.ReactElement;
103
181
 
104
182
  declare const badgeVariants: (props?: ({
105
- variant?: "default" | "outline" | "secondary" | "ghost" | "destructive" | "link" | "success" | "error" | "warning" | "info" | null | undefined;
183
+ variant?: "link" | "outline" | "default" | "secondary" | "ghost" | "destructive" | "success" | "error" | "warning" | "info" | null | undefined;
106
184
  } & class_variance_authority_types.ClassProp) | undefined) => string;
107
185
 
108
186
  declare const Badge: ({ className, variant, asChild, ...props }: React__default.ComponentProps<"span"> & VariantProps<typeof badgeVariants> & {
@@ -112,7 +190,7 @@ declare const Badge: ({ className, variant, asChild, ...props }: React__default.
112
190
  declare const Breadcrumb: ({ className, ...props }: React__default.ComponentProps<"nav">) => React__default.ReactElement;
113
191
 
114
192
  declare const buttonVariants: (props?: ({
115
- variant?: "default" | "outline" | "secondary" | "ghost" | "destructive" | "link" | "success" | null | undefined;
193
+ variant?: "link" | "outline" | "default" | "secondary" | "ghost" | "destructive" | "success" | null | undefined;
116
194
  size?: "default" | "sm" | "lg" | "icon" | null | undefined;
117
195
  } & class_variance_authority_types.ClassProp) | undefined) => string;
118
196
  type ButtonVariants = VariantProps<typeof buttonVariants>;
@@ -123,7 +201,7 @@ type Props = React__default.ComponentProps<"button"> & ButtonVariants & {
123
201
  declare const Button: ({ className, variant, size, asChild, ...props }: Props) => React__default.ReactElement;
124
202
 
125
203
  declare const buttonGroupVariants: (props?: ({
126
- orientation?: "vertical" | "horizontal" | null | undefined;
204
+ orientation?: "horizontal" | "vertical" | null | undefined;
127
205
  } & class_variance_authority_types.ClassProp) | undefined) => string;
128
206
 
129
207
  declare const ButtonGroup: ({ className, orientation, ...props }: React__default.ComponentProps<"div"> & VariantProps<typeof buttonGroupVariants>) => React__default.ReactElement;
@@ -200,7 +278,7 @@ declare const InputOTP: ({ className, containerClassName, ...props }: React__def
200
278
  }) => React__default.ReactElement;
201
279
 
202
280
  declare const itemVariants: (props?: ({
203
- variant?: "default" | "outline" | "muted" | null | undefined;
281
+ variant?: "outline" | "default" | "muted" | null | undefined;
204
282
  size?: "default" | "sm" | "xs" | null | undefined;
205
283
  } & class_variance_authority_types.ClassProp) | undefined) => string;
206
284
 
@@ -295,7 +373,7 @@ declare const Tabs: ({ className, orientation, ...props }: React__default.Compon
295
373
  declare const Textarea: ({ className, ...props }: React__default.ComponentProps<"textarea">) => React__default.ReactElement;
296
374
 
297
375
  declare const toggleVariants: (props?: ({
298
- variant?: "default" | "outline" | null | undefined;
376
+ variant?: "outline" | "default" | null | undefined;
299
377
  size?: "default" | "sm" | "lg" | null | undefined;
300
378
  } & class_variance_authority_types.ClassProp) | undefined) => string;
301
379
 
@@ -308,4 +386,4 @@ declare const ToggleGroup: ({ className, variant, size, spacing, orientation, ch
308
386
 
309
387
  declare const Tooltip: ({ ...props }: React__default.ComponentProps<typeof Tooltip$1.Root>) => React__default.ReactElement;
310
388
 
311
- export { Accordion, ActionsMenu, AlertDialog, Avatar, Badge, Breadcrumb, Button, ButtonGroup, Calendar, Card, Checkbox, Collapsible, Combobox, Command, ConfirmDialog, ContextMenu, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, Glow, HoverCard, Image, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, InputOTP, Item, Label, Menubar, Modal, Pagination, Popover, Progress, RadioGroup, SectionCard, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, Sidebar, Skeleton, Spinner, Steps, Switch, Table, Tabs, Textarea, Toaster, Toggle, ToggleGroup, Tooltip, TruncatedText, WaveLayer };
389
+ export { Accordion, ActionsMenu, AlertDialog, AppBreadcrumbs, AppTabs, Avatar, Badge, Breadcrumb, Button, ButtonGroup, Calendar, Card, Checkbox, Collapsible, Combobox, Command, ConfirmDialog, ContextMenu, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, Empty, ErrorFallback, FilterSelect, Glow, HoverCard, Image, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, InputOTP, Item, Label, Menubar, Modal, Pagination, Popover, Progress, RadioGroup, SectionCard, SectionTitle, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, Sidebar, Skeleton, SlideUp, Spinner, Steps, Switch, Table, TablePagination, Tabs, Textarea, Toaster, Toggle, ToggleGroup, Tooltip, TruncatedText, WaveLayer };