@blencm/ui 0.0.1

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 (97) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +128 -0
  3. package/bin/blencm-ui.mjs +99 -0
  4. package/dist/components/Accordion/accordin.test.d.ts +1 -0
  5. package/dist/components/Accordion/accordion.d.ts +7 -0
  6. package/dist/components/Button/button.d.ts +26 -0
  7. package/dist/components/Button/button.test.d.ts +1 -0
  8. package/dist/components/Button/icon-button.d.ts +26 -0
  9. package/dist/components/Form/form-checkbox.d.ts +27 -0
  10. package/dist/components/Form/form-component.d.ts +44 -0
  11. package/dist/components/Form/form-date.d.ts +60 -0
  12. package/dist/components/Form/form-field.d.ts +33 -0
  13. package/dist/components/Form/form-select.d.ts +43 -0
  14. package/dist/components/Form/form-textarea.d.ts +31 -0
  15. package/dist/components/Form/form-time.d.ts +59 -0
  16. package/dist/components/Form/form.d.ts +11 -0
  17. package/dist/components/Form/form.test.d.ts +1 -0
  18. package/dist/components/Label/label.d.ts +5 -0
  19. package/dist/components/Label/label.test.d.ts +1 -0
  20. package/dist/components/alert-dialog.d.ts +20 -0
  21. package/dist/components/alert.d.ts +8 -0
  22. package/dist/components/aspect-ratio.d.ts +3 -0
  23. package/dist/components/avatar.d.ts +6 -0
  24. package/dist/components/badge.d.ts +9 -0
  25. package/dist/components/breadcrumb.d.ts +19 -0
  26. package/dist/components/calendar.d.ts +8 -0
  27. package/dist/components/card.d.ts +8 -0
  28. package/dist/components/carousel.d.ts +34 -0
  29. package/dist/components/checkbox.d.ts +12 -0
  30. package/dist/components/collapsible.d.ts +5 -0
  31. package/dist/components/command.d.ts +82 -0
  32. package/dist/components/context-menu.d.ts +27 -0
  33. package/dist/components/dialog.d.ts +19 -0
  34. package/dist/components/drawer.d.ts +22 -0
  35. package/dist/components/dropdown-menu.d.ts +27 -0
  36. package/dist/components/hover-card.d.ts +6 -0
  37. package/dist/components/icons.d.ts +2 -0
  38. package/dist/components/input-otp.d.ts +36 -0
  39. package/dist/components/input.d.ts +15 -0
  40. package/dist/components/menubar.d.ts +28 -0
  41. package/dist/components/modal.d.ts +11 -0
  42. package/dist/components/navigation-menu.d.ts +12 -0
  43. package/dist/components/pagination.d.ts +36 -0
  44. package/dist/components/popover.d.ts +7 -0
  45. package/dist/components/progress.d.ts +4 -0
  46. package/dist/components/radio-group.d.ts +5 -0
  47. package/dist/components/resizable.d.ts +8 -0
  48. package/dist/components/scroll-area.d.ts +5 -0
  49. package/dist/components/scroll-view.d.ts +21 -0
  50. package/dist/components/search-input.d.ts +9 -0
  51. package/dist/components/searchable-select.d.ts +33 -0
  52. package/dist/components/select.d.ts +69 -0
  53. package/dist/components/separator.d.ts +4 -0
  54. package/dist/components/sheet.d.ts +25 -0
  55. package/dist/components/skeleton.d.ts +3 -0
  56. package/dist/components/slider.d.ts +4 -0
  57. package/dist/components/sonner.d.ts +5 -0
  58. package/dist/components/switch.d.ts +4 -0
  59. package/dist/components/table.d.ts +12 -0
  60. package/dist/components/tabs.d.ts +7 -0
  61. package/dist/components/textarea.d.ts +13 -0
  62. package/dist/components/toast.d.ts +15 -0
  63. package/dist/components/toaster.d.ts +2 -0
  64. package/dist/components/toggle-group.d.ts +12 -0
  65. package/dist/components/toggle.d.ts +12 -0
  66. package/dist/components/tooltip.d.ts +7 -0
  67. package/dist/components/ui/input.d.ts +14 -0
  68. package/dist/components/ui/select.d.ts +37 -0
  69. package/dist/components/ui/ui-checkbox.d.ts +17 -0
  70. package/dist/components/ui/ui-date.d.ts +44 -0
  71. package/dist/components/ui/ui-textarea.d.ts +14 -0
  72. package/dist/components/ui/ui-time.d.ts +58 -0
  73. package/dist/components/use-toast.d.ts +44 -0
  74. package/dist/helper/time.d.ts +1 -0
  75. package/dist/hooks/use-sidebar.d.ts +8 -0
  76. package/dist/index.cjs +12723 -0
  77. package/dist/index.d.ts +78 -0
  78. package/dist/index.js +12514 -0
  79. package/dist/interface/icon.d.ts +30 -0
  80. package/dist/shared/alert-modal.d.ts +15 -0
  81. package/dist/shared/breadcrumbs.d.ts +14 -0
  82. package/dist/shared/data-table-skeleton.d.ts +10 -0
  83. package/dist/shared/data-table.d.ts +175 -0
  84. package/dist/shared/dropzone.d.ts +19 -0
  85. package/dist/shared/fileupload.d.ts +15 -0
  86. package/dist/shared/heading.d.ts +7 -0
  87. package/dist/shared/page-head.d.ts +5 -0
  88. package/dist/shared/pagination-section.d.ts +8 -0
  89. package/dist/style.css +4350 -0
  90. package/dist/types/input.d.ts +4 -0
  91. package/dist/types/select.d.ts +4 -0
  92. package/dist/utils/date-formats.d.ts +387 -0
  93. package/dist/utils/form-utils.d.ts +43 -0
  94. package/dist/utils/time-formats.d.ts +157 -0
  95. package/dist/utils/utils.d.ts +2 -0
  96. package/package.json +210 -0
  97. package/templates/vscode-settings.json +11 -0
@@ -0,0 +1,30 @@
1
+ import { LucideProps } from "lucide-react";
2
+ export interface IconProps {
3
+ dashboard: React.ForwardRefExoticComponent<Omit<LucideProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
4
+ logo: React.ForwardRefExoticComponent<Omit<LucideProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
5
+ login: React.ForwardRefExoticComponent<Omit<LucideProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
6
+ close: React.ForwardRefExoticComponent<Omit<LucideProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
7
+ profile: React.ForwardRefExoticComponent<Omit<LucideProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
8
+ spinner: React.ForwardRefExoticComponent<Omit<LucideProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
9
+ kanban: React.ForwardRefExoticComponent<Omit<LucideProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
10
+ chevronLeft: React.ForwardRefExoticComponent<Omit<LucideProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
11
+ chevronRight: React.ForwardRefExoticComponent<Omit<LucideProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
12
+ trash: React.ForwardRefExoticComponent<Omit<LucideProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
13
+ employee: React.ForwardRefExoticComponent<Omit<LucideProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
14
+ post: React.ForwardRefExoticComponent<Omit<LucideProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
15
+ page: React.ForwardRefExoticComponent<Omit<LucideProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
16
+ media: React.ForwardRefExoticComponent<Omit<LucideProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
17
+ settings: React.ForwardRefExoticComponent<Omit<LucideProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
18
+ billing: React.ForwardRefExoticComponent<Omit<LucideProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
19
+ ellipsis: React.ForwardRefExoticComponent<Omit<LucideProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
20
+ add: React.ForwardRefExoticComponent<Omit<LucideProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
21
+ warning: React.ForwardRefExoticComponent<Omit<LucideProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
22
+ user: React.ForwardRefExoticComponent<Omit<LucideProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
23
+ arrowRight: React.ForwardRefExoticComponent<Omit<LucideProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
24
+ help: React.ForwardRefExoticComponent<Omit<LucideProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
25
+ pizza: React.ForwardRefExoticComponent<Omit<LucideProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
26
+ sun: React.ForwardRefExoticComponent<Omit<LucideProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
27
+ moon: React.ForwardRefExoticComponent<Omit<LucideProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
28
+ laptop: React.ForwardRefExoticComponent<Omit<LucideProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
29
+ check: React.ForwardRefExoticComponent<Omit<LucideProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
30
+ }
@@ -0,0 +1,15 @@
1
+ import * as React from "react";
2
+ type TAlertModalProps = {
3
+ isOpen: boolean;
4
+ onClose: () => void;
5
+ onConfirm: () => void;
6
+ loading: boolean;
7
+ title?: string;
8
+ description?: string;
9
+ className?: string;
10
+ cancelText?: string;
11
+ confirmText?: string;
12
+ children?: React.ReactNode;
13
+ };
14
+ declare const AlertModal: ({ isOpen, onClose, onConfirm, loading, title, description, cancelText, confirmText, className, children, }: TAlertModalProps) => React.JSX.Element;
15
+ export { AlertModal };
@@ -0,0 +1,14 @@
1
+ import * as React from 'react';
2
+ export type BreadcrumbItemProps = {
3
+ title: string;
4
+ link?: string;
5
+ className?: string;
6
+ };
7
+ export type BreadcrumbsProps = {
8
+ items: BreadcrumbItemProps[];
9
+ className?: string;
10
+ classNameList?: string;
11
+ separator?: React.ReactNode;
12
+ };
13
+ declare function Breadcrumbs({ items, className, classNameList, separator }: BreadcrumbsProps): React.JSX.Element;
14
+ export { Breadcrumbs };
@@ -0,0 +1,10 @@
1
+ import * as React from 'react';
2
+ type DataTableSkeletonProps = {
3
+ columnCount: number;
4
+ rowCount?: number;
5
+ searchableColumnCount?: number;
6
+ filterableColumnCount?: number;
7
+ showViewOptions?: boolean;
8
+ };
9
+ declare function DataTableSkeleton({ columnCount, rowCount, searchableColumnCount, filterableColumnCount, showViewOptions, }: DataTableSkeletonProps): React.JSX.Element;
10
+ export { DataTableSkeleton };
@@ -0,0 +1,175 @@
1
+ import React from "react";
2
+ import { type ColumnDef, type RowData } from "@tanstack/react-table";
3
+ export declare const dataTableFeatures: {
4
+ columnVisibilityFeature: import("@tanstack/react-table").TableFeature;
5
+ rowPaginationFeature: import("@tanstack/react-table").TableFeature;
6
+ rowSelectionFeature: import("@tanstack/react-table").TableFeature;
7
+ };
8
+ export type DataTableFeatures = typeof dataTableFeatures;
9
+ export type DataTableColumnDef<TData extends RowData, TValue = unknown> = ColumnDef<DataTableFeatures, TData, TValue>;
10
+ /** =========
11
+ * SLOTS
12
+ * =========
13
+ * Classname “slots” you can override to customize styles at specific points
14
+ * (root, table, header, rows, cells, footer, etc.).
15
+ */
16
+ export type DataTableSlots = Partial<{
17
+ root: string;
18
+ table: string;
19
+ thead: string;
20
+ theadSticky: string;
21
+ trHead: string;
22
+ th: string;
23
+ tbody: string;
24
+ tr: string;
25
+ trClickable: string;
26
+ td: string;
27
+ footer: string;
28
+ footerInner: string;
29
+ metaWrap: string;
30
+ controlsWrap: string;
31
+ pageSizeLabel: string;
32
+ pageSizeTrigger: string;
33
+ pageLabel: string;
34
+ navButton: string;
35
+ }>;
36
+ /** =========
37
+ * ACCENTS
38
+ * =========
39
+ * Accent system for highlighting interactive/selected states.
40
+ * - `accent`: choose a preset accent name
41
+ * - `accentColor`: provide a custom CSS color (overrides `accent`)
42
+ * If both are null/empty, accent styling is disabled.
43
+ */
44
+ export type DataTableAccent = "primary" | "emerald" | "indigo" | "rose" | "amber" | "zinc";
45
+ /** =========
46
+ * TEMPLATES
47
+ * =========
48
+ * Built-in visual templates (neo, glass, compact, minimal, clean, elevated, grid, cards).
49
+ * Each template is a partial set of slots. Slots are merged like:
50
+ * `neo base` + `selected template` + `classNames overrides`.
51
+ */
52
+ declare const DATA_TABLE_TEMPLATES: {
53
+ readonly neo: {
54
+ root: string;
55
+ table: string;
56
+ thead: string;
57
+ theadSticky: string;
58
+ trHead: string;
59
+ th: string;
60
+ tbody: string;
61
+ tr: string;
62
+ trClickable: string;
63
+ td: string;
64
+ footer: string;
65
+ footerInner: string;
66
+ metaWrap: string;
67
+ controlsWrap: string;
68
+ pageSizeLabel: string;
69
+ pageSizeTrigger: string;
70
+ pageLabel: string;
71
+ navButton: string;
72
+ };
73
+ readonly glass: {
74
+ root: string;
75
+ theadSticky: string;
76
+ tbody: string;
77
+ };
78
+ readonly compact: {
79
+ th: string;
80
+ td: string;
81
+ pageSizeTrigger: string;
82
+ };
83
+ readonly minimal: {
84
+ root: string;
85
+ theadSticky: string;
86
+ footer: string;
87
+ tbody: string;
88
+ };
89
+ readonly clean: {
90
+ root: string;
91
+ theadSticky: string;
92
+ tbody: string;
93
+ tr: string;
94
+ trClickable: string;
95
+ };
96
+ readonly elevated: {
97
+ root: string;
98
+ theadSticky: string;
99
+ tbody: string;
100
+ th: string;
101
+ td: string;
102
+ };
103
+ readonly grid: {
104
+ root: string;
105
+ table: string;
106
+ thead: string;
107
+ tbody: string;
108
+ tr: string;
109
+ trClickable: string;
110
+ };
111
+ readonly cards: {
112
+ root: string;
113
+ table: string;
114
+ theadSticky: string;
115
+ tr: string;
116
+ trClickable: string;
117
+ tbody: string;
118
+ };
119
+ };
120
+ type BuiltInTemplate = keyof typeof DATA_TABLE_TEMPLATES;
121
+ export interface DataTableProps<TData extends RowData, TValue = unknown> {
122
+ classNames?: DataTableSlots;
123
+ template?: BuiltInTemplate;
124
+ accent?: DataTableAccent | null;
125
+ accentColor?: string | null;
126
+ page?: number;
127
+ perPage?: number;
128
+ onPageChange?: (page: number) => void;
129
+ onPageSizeChange?: (pageSize: number) => void;
130
+ onClick?: (row: TData) => void;
131
+ columns: DataTableColumnDef<TData, TValue>[];
132
+ data: TData[];
133
+ pageSizeOptions?: number[];
134
+ pageCount: number;
135
+ totalRows?: number;
136
+ isRowsSelected?: boolean;
137
+ rowsSelectedLabel?: string;
138
+ rowPerPageLabel?: string;
139
+ pageLabel?: string;
140
+ ofLabel?: string;
141
+ emptyData?: React.ReactNode;
142
+ animate?: boolean;
143
+ heightClassName?: string;
144
+ stickyHeader?: boolean;
145
+ headerScroll?: boolean;
146
+ }
147
+ /**
148
+ * DataTable
149
+ * ----------
150
+ * A styled, template-driven table for TanStack Table with:
151
+ * - manual pagination + external page state
152
+ * - optional animated body transitions
153
+ * - optional sticky header (works because we removed wrapper div around <table>)
154
+ * - optional row click handler
155
+ * - optional accent highlight system
156
+ *
157
+ * Props:
158
+ * - columns, data: TanStack Table definitions and rows
159
+ * - page, perPage, pageCount: pagination inputs (1-based page)
160
+ * - onPageChange(page): called with 1-based page
161
+ * - onPageSizeChange(size): called when page size changes (also resets to page 1)
162
+ * - template: built-in template key
163
+ * - classNames: slot overrides (merge on top)
164
+ * - accent / accentColor: accent control (off by default)
165
+ * - stickyHeader: enables sticky header behavior (default true)
166
+ * - headerScroll: if true, header stickiness is disabled (use when header must scroll away)
167
+ * - heightClassName: sets the overall component height
168
+ * - animate: animates tbody on page changes
169
+ * - emptyData: custom empty state node
170
+ * - totalRows: optional meta display
171
+ * - isRowsSelected / rowsSelectedLabel: selection meta display
172
+ * - rowPerPageLabel, pageLabel, ofLabel: i18n labels
173
+ */
174
+ declare function DataTable<TData extends RowData, TValue = unknown>({ columns, data, pageCount, page, perPage, pageSizeOptions, rowPerPageLabel, ofLabel, pageLabel, isRowsSelected, totalRows, rowsSelectedLabel, template, classNames, accent, accentColor, emptyData, onPageChange, onClick, onPageSizeChange, animate, stickyHeader, headerScroll, heightClassName, }: DataTableProps<TData, TValue>): React.JSX.Element;
175
+ export { DataTable, DATA_TABLE_TEMPLATES };
@@ -0,0 +1,19 @@
1
+ import * as React from "react";
2
+ import { Accept, DropzoneOptions } from "react-dropzone";
3
+ export type DropzoneProps = {
4
+ label?: string;
5
+ description?: string;
6
+ descriptionActive?: string;
7
+ onChange?: (value: File[]) => void;
8
+ onDrop?: (value: File[]) => void;
9
+ value?: File[];
10
+ className?: string;
11
+ descriptionClassName?: string;
12
+ dropzoneClassName?: string;
13
+ valueClassName?: string;
14
+ labelClassName?: string;
15
+ accept?: Accept;
16
+ options?: DropzoneOptions;
17
+ };
18
+ declare function Dropzone({ label, onChange, onDrop, value, className, description, descriptionActive, accept, options, descriptionClassName, dropzoneClassName, valueClassName, labelClassName, }: DropzoneProps): React.JSX.Element;
19
+ export { Dropzone };
@@ -0,0 +1,15 @@
1
+ import { Accept, DropzoneOptions } from 'react-dropzone';
2
+ export type FileUploadProps = {
3
+ label?: string;
4
+ onChange: (value: File[]) => void;
5
+ value?: File[];
6
+ className?: string;
7
+ classNameContent?: string;
8
+ accept?: Accept;
9
+ options?: DropzoneOptions;
10
+ };
11
+ declare function FileUpload({ onChange, value, label, className, classNameContent, accept, options }: FileUploadProps): import("react").JSX.Element;
12
+ declare function ImagePreview({ file }: {
13
+ file: File;
14
+ }): import("react").JSX.Element | null;
15
+ export { FileUpload, ImagePreview };
@@ -0,0 +1,7 @@
1
+ type THeadingProps = {
2
+ title: string;
3
+ description?: string;
4
+ className?: string;
5
+ };
6
+ declare function Heading({ title, description, className }: THeadingProps): import("react").JSX.Element;
7
+ export { Heading };
@@ -0,0 +1,5 @@
1
+ export type PageHeadProps = {
2
+ title?: string;
3
+ };
4
+ declare function PageHead({ title }: PageHeadProps): import("react").JSX.Element;
5
+ export { PageHead };
@@ -0,0 +1,8 @@
1
+ type TPaginationSectionProps = {
2
+ totalPosts: number;
3
+ postsPerPage: number;
4
+ currentPage: number;
5
+ setCurrentPage: (page: number) => void;
6
+ };
7
+ declare function PaginationSection({ totalPosts, postsPerPage, currentPage, setCurrentPage, }: TPaginationSectionProps): import("react").JSX.Element;
8
+ export { PaginationSection };