@murabei-data-science/pumpwood-ui 1.3.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 (167) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +145 -0
  3. package/dist/components.d.ts +1227 -0
  4. package/dist/components.esm.js +39 -0
  5. package/dist/components.js +40 -0
  6. package/dist/design-system.d.ts +391 -0
  7. package/dist/design-system.esm.js +26 -0
  8. package/dist/design-system.js +27 -0
  9. package/dist/index.css +1 -0
  10. package/dist/index.d.ts +1599 -0
  11. package/dist/index.esm.js +39 -0
  12. package/dist/index.js +40 -0
  13. package/dist/types/components/AlertWithIcon/index.d.ts +12 -0
  14. package/dist/types/components/Auth/AuthenticatedView.d.ts +18 -0
  15. package/dist/types/components/Auth/LoginCard.d.ts +33 -0
  16. package/dist/types/components/Auth/LoginCardSSO.d.ts +31 -0
  17. package/dist/types/components/Auth/NotAuthenticatedView.d.ts +21 -0
  18. package/dist/types/components/Auth/index.d.ts +4 -0
  19. package/dist/types/components/AutoFormContent/index.d.ts +46 -0
  20. package/dist/types/components/Badge/index.d.ts +17 -0
  21. package/dist/types/components/Card/index.d.ts +23 -0
  22. package/dist/types/components/ClearButton/index.d.ts +3 -0
  23. package/dist/types/components/CombinedFilterTable/index.d.ts +9 -0
  24. package/dist/types/components/ConfirmationDialog/index.d.ts +71 -0
  25. package/dist/types/components/CustomBreadcrumb/index.d.ts +6 -0
  26. package/dist/types/components/DatePicker/index.d.ts +35 -0
  27. package/dist/types/components/DeleteDialog/index.d.ts +9 -0
  28. package/dist/types/components/DetailPage/AutoDetailContent.d.ts +27 -0
  29. package/dist/types/components/DetailPage/DetailPage.d.ts +24 -0
  30. package/dist/types/components/DetailPage/detail-utils.d.ts +24 -0
  31. package/dist/types/components/DetailPage/index.d.ts +3 -0
  32. package/dist/types/components/DownloadButton/index.d.ts +20 -0
  33. package/dist/types/components/Dropzone/index.d.ts +21 -0
  34. package/dist/types/components/EmptyContainer/index.d.ts +16 -0
  35. package/dist/types/components/ErrorBoundary/index.d.ts +10 -0
  36. package/dist/types/components/ErrorMessage/index.d.ts +4 -0
  37. package/dist/types/components/ErrorToast/index.d.ts +4 -0
  38. package/dist/types/components/FKSelect/index.d.ts +63 -0
  39. package/dist/types/components/FileDropzone/index.d.ts +22 -0
  40. package/dist/types/components/FilePreview/index.d.ts +13 -0
  41. package/dist/types/components/Filters/CreatedByUserFilter.d.ts +24 -0
  42. package/dist/types/components/Filters/DateRangeFilter.d.ts +23 -0
  43. package/dist/types/components/KeyValueContent/index.d.ts +3 -0
  44. package/dist/types/components/Loading/index.d.ts +2 -0
  45. package/dist/types/components/M2MTable/index.d.ts +35 -0
  46. package/dist/types/components/MarkdownEditor/index.d.ts +12 -0
  47. package/dist/types/components/MultiSelectDropdown/index.d.ts +14 -0
  48. package/dist/types/components/NoResult/index.d.ts +15 -0
  49. package/dist/types/components/Pagination/index.d.ts +12 -0
  50. package/dist/types/components/Select/FKSelectVariant.d.ts +52 -0
  51. package/dist/types/components/Select/index.d.ts +70 -0
  52. package/dist/types/components/Sidebar/NavigationSidebar.d.ts +45 -0
  53. package/dist/types/components/Sidebar/index.d.ts +157 -0
  54. package/dist/types/components/Sidebar/useSidebarCollapse.d.ts +18 -0
  55. package/dist/types/components/Stack/index.d.ts +28 -0
  56. package/dist/types/components/Table/index.d.ts +92 -0
  57. package/dist/types/components/TableSkeleton/index.d.ts +23 -0
  58. package/dist/types/components/TagInput/index.d.ts +13 -0
  59. package/dist/types/components/Text/index.d.ts +21 -0
  60. package/dist/types/components/TooltipComponent/index.d.ts +8 -0
  61. package/dist/types/components/index.d.ts +56 -0
  62. package/dist/types/components/ui/accordion.d.ts +7 -0
  63. package/dist/types/components/ui/alert-dialog.d.ts +33 -0
  64. package/dist/types/components/ui/alert.d.ts +8 -0
  65. package/dist/types/components/ui/badge.d.ts +18 -0
  66. package/dist/types/components/ui/breadcrumb.d.ts +11 -0
  67. package/dist/types/components/ui/button.d.ts +32 -0
  68. package/dist/types/components/ui/calendar.d.ts +21 -0
  69. package/dist/types/components/ui/card.d.ts +21 -0
  70. package/dist/types/components/ui/checkbox.d.ts +4 -0
  71. package/dist/types/components/ui/combobox.d.ts +33 -0
  72. package/dist/types/components/ui/command.d.ts +31 -0
  73. package/dist/types/components/ui/dialog.d.ts +32 -0
  74. package/dist/types/components/ui/dropdown-menu.d.ts +27 -0
  75. package/dist/types/components/ui/empty.d.ts +23 -0
  76. package/dist/types/components/ui/input.d.ts +15 -0
  77. package/dist/types/components/ui/label.d.ts +5 -0
  78. package/dist/types/components/ui/popover.d.ts +18 -0
  79. package/dist/types/components/ui/radio.d.ts +3 -0
  80. package/dist/types/components/ui/select.d.ts +13 -0
  81. package/dist/types/components/ui/skeleton.d.ts +11 -0
  82. package/dist/types/components/ui/spinner.d.ts +8 -0
  83. package/dist/types/components/ui/table.d.ts +29 -0
  84. package/dist/types/components/ui/tabs.d.ts +20 -0
  85. package/dist/types/components/ui/textarea.d.ts +3 -0
  86. package/dist/types/components/ui/tooltip.d.ts +7 -0
  87. package/dist/types/design-system/Auth/AuthenticatedView.d.ts +18 -0
  88. package/dist/types/design-system/Auth/LoginCard.d.ts +33 -0
  89. package/dist/types/design-system/Auth/LoginCardSSO.d.ts +31 -0
  90. package/dist/types/design-system/Auth/NotAuthenticatedView.d.ts +21 -0
  91. package/dist/types/design-system/Auth/index.d.ts +4 -0
  92. package/dist/types/design-system/AutoFormContent/index.d.ts +46 -0
  93. package/dist/types/design-system/CombinedFilterTable/index.d.ts +9 -0
  94. package/dist/types/design-system/CustomBreadcrumb/index.d.ts +6 -0
  95. package/dist/types/design-system/DetailPage/AutoDetailContent.d.ts +27 -0
  96. package/dist/types/design-system/DetailPage/DetailPage.d.ts +24 -0
  97. package/dist/types/design-system/DetailPage/detail-utils.d.ts +24 -0
  98. package/dist/types/design-system/DetailPage/index.d.ts +3 -0
  99. package/dist/types/design-system/FilePreview/index.d.ts +13 -0
  100. package/dist/types/design-system/Filters/CreatedByUserFilter.d.ts +24 -0
  101. package/dist/types/design-system/Filters/DateRangeFilter.d.ts +23 -0
  102. package/dist/types/design-system/KeyValueContent/index.d.ts +3 -0
  103. package/dist/types/design-system/M2MTable/index.d.ts +35 -0
  104. package/dist/types/design-system/NavigationSidebar/index.d.ts +47 -0
  105. package/dist/types/design-system/index.d.ts +11 -0
  106. package/dist/types/index.d.ts +67 -0
  107. package/dist/types/lib/field-trigger.d.ts +5 -0
  108. package/dist/types/lib/fk-select-fetcher.d.ts +26 -0
  109. package/dist/types/lib/utils.d.ts +2 -0
  110. package/dist/types/src/components/Badge/index.d.ts +17 -0
  111. package/dist/types/src/components/Card/index.d.ts +23 -0
  112. package/dist/types/src/components/CombinedFilterTable/index.d.ts +9 -0
  113. package/dist/types/src/components/ConfirmationDialog/index.d.ts +71 -0
  114. package/dist/types/src/components/Dropzone/index.d.ts +21 -0
  115. package/dist/types/src/components/EmptyContainer/index.d.ts +16 -0
  116. package/dist/types/src/components/FKSelect/index.d.ts +45 -0
  117. package/dist/types/src/components/FileDropzone/index.d.ts +22 -0
  118. package/dist/types/src/components/Filters/CreatedByUserFilter.d.ts +24 -0
  119. package/dist/types/src/components/Filters/DateRangeFilter.d.ts +23 -0
  120. package/dist/types/src/components/Sidebar/index.d.ts +115 -0
  121. package/dist/types/src/components/Stack/index.d.ts +22 -0
  122. package/dist/types/src/components/Table/index.d.ts +29 -0
  123. package/dist/types/src/components/Text/index.d.ts +21 -0
  124. package/dist/types/src/components/ui/alert-dialog.d.ts +33 -0
  125. package/dist/types/src/components/ui/badge.d.ts +18 -0
  126. package/dist/types/src/components/ui/button.d.ts +22 -0
  127. package/dist/types/src/components/ui/calendar.d.ts +21 -0
  128. package/dist/types/src/components/ui/card.d.ts +21 -0
  129. package/dist/types/src/components/ui/combobox.d.ts +28 -0
  130. package/dist/types/src/components/ui/command.d.ts +31 -0
  131. package/dist/types/src/components/ui/dialog.d.ts +32 -0
  132. package/dist/types/src/components/ui/empty.d.ts +23 -0
  133. package/dist/types/src/components/ui/popover.d.ts +18 -0
  134. package/dist/types/src/components/ui/table.d.ts +29 -0
  135. package/dist/types/src/components/ui/tabs.d.ts +20 -0
  136. package/dist/types/src/index.d.ts +21 -0
  137. package/dist/types/src/lib/utils.d.ts +2 -0
  138. package/dist/types/src/stories/Components/CombinedFilterTable.stories.d.ts +8 -0
  139. package/dist/types/src/stories/Components/ConfirmationDialog.stories.d.ts +8 -0
  140. package/dist/types/src/stories/Components/CreatedByUserFilter.stories.d.ts +8 -0
  141. package/dist/types/src/stories/Components/DateRangeFilter.stories.d.ts +8 -0
  142. package/dist/types/src/stories/Components/EmptyContainer.stories.d.ts +24 -0
  143. package/dist/types/src/stories/Components/FKSelect.stories.d.ts +8 -0
  144. package/dist/types/src/stories/Components/FileDropZone.stories.d.ts +9 -0
  145. package/dist/types/src/stories/Components/Sidebar.stories.d.ts +18 -0
  146. package/dist/types/src/stories/Components/Table.stories.d.ts +11 -0
  147. package/dist/types/src/stories/Components/Tabs.stories.d.ts +13 -0
  148. package/dist/types/src/stories/Elements/Badge.stories.d.ts +13 -0
  149. package/dist/types/src/stories/Elements/Button.stories.d.ts +13 -0
  150. package/dist/types/src/stories/Elements/Stack.stories.d.ts +9 -0
  151. package/dist/types/src/stories/Elements/Text.stories.d.ts +8 -0
  152. package/dist/types/stories/Components/CombinedFilterTable.stories.d.ts +8 -0
  153. package/dist/types/stories/Components/ConfirmationDialog.stories.d.ts +8 -0
  154. package/dist/types/stories/Components/CreatedByUserFilter.stories.d.ts +8 -0
  155. package/dist/types/stories/Components/DateRangeFilter.stories.d.ts +8 -0
  156. package/dist/types/stories/Components/EmptyContainer.stories.d.ts +24 -0
  157. package/dist/types/stories/Components/FKSelect.stories.d.ts +8 -0
  158. package/dist/types/stories/Components/FileDropZone.stories.d.ts +9 -0
  159. package/dist/types/stories/Components/Sidebar.stories.d.ts +18 -0
  160. package/dist/types/stories/Components/Table.stories.d.ts +11 -0
  161. package/dist/types/stories/Components/Tabs.stories.d.ts +13 -0
  162. package/dist/types/stories/Elements/Badge.stories.d.ts +13 -0
  163. package/dist/types/stories/Elements/Button.stories.d.ts +13 -0
  164. package/dist/types/stories/Elements/Stack.stories.d.ts +9 -0
  165. package/dist/types/stories/Elements/Text.stories.d.ts +8 -0
  166. package/package.json +119 -0
  167. package/tailwind.config.ts +91 -0
@@ -0,0 +1,23 @@
1
+ export interface DateRangeFilterProps {
2
+ startDate?: Date;
3
+ endDate?: Date;
4
+ onStartDateChange: (date: Date | undefined) => void;
5
+ onEndDateChange: (date: Date | undefined) => void;
6
+ startLabel?: string;
7
+ endLabel?: string;
8
+ className?: string;
9
+ }
10
+ /**
11
+ * A date range picker filter component.
12
+ *
13
+ * @example
14
+ * ```tsx
15
+ * <DateRangeFilter
16
+ * startDate={startDate}
17
+ * endDate={endDate}
18
+ * onStartDateChange={setStartDate}
19
+ * onEndDateChange={setEndDate}
20
+ * />
21
+ * ```
22
+ */
23
+ export declare const DateRangeFilter: ({ startDate, endDate, onStartDateChange, onEndDateChange, startLabel, endLabel, className, }: DateRangeFilterProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ export declare function KeyValueContent({ data }: {
2
+ data: Record<string, any>;
3
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export default function Loading(): import("react/jsx-runtime").JSX.Element;
2
+ export { Loading };
@@ -0,0 +1,35 @@
1
+ import { type ComponentPropsWithoutRef } from "react";
2
+ import { type FKFetcherParams } from "../FKSelect";
3
+ export type M2MListFn = (modelClass: string, filterDict: Record<string, any>, fields: string[]) => Promise<[
4
+ Record<string, any>[] | null,
5
+ {
6
+ message?: string;
7
+ } | null
8
+ ]>;
9
+ export declare const M2MCreateDialog: ({ open, onOpenChange, targetModelClass, relationName, handleCreateNew, mutate, fkFetcher, }: {
10
+ open: boolean;
11
+ onOpenChange: (open: boolean) => void;
12
+ targetModelClass: string;
13
+ relationName: string;
14
+ handleCreateNew: (id: string) => void;
15
+ mutate: () => void;
16
+ fkFetcher: (params: FKFetcherParams) => Promise<any[]>;
17
+ }) => import("react/jsx-runtime").JSX.Element;
18
+ interface IM2MTableProps extends Omit<ComponentPropsWithoutRef<"div">, "onChange"> {
19
+ modelClass: string;
20
+ targetModelClass: string;
21
+ filterDict: Record<string, any>;
22
+ targetField: string;
23
+ relationName: string;
24
+ displayFields: {
25
+ name: string;
26
+ field: string;
27
+ }[];
28
+ handleCreateNew: (id: string) => void;
29
+ handleDeleteItem: (id: string) => void;
30
+ fields: string[];
31
+ listFn: M2MListFn;
32
+ fkFetcher: (params: FKFetcherParams) => Promise<any[]>;
33
+ }
34
+ export declare const M2MTable: ({ modelClass, targetModelClass, targetField, filterDict, relationName, fields, displayFields, handleCreateNew, handleDeleteItem, listFn, fkFetcher, }: IM2MTableProps) => import("react/jsx-runtime").JSX.Element;
35
+ export {};
@@ -0,0 +1,12 @@
1
+ export interface IMarkdownEditorProps {
2
+ value: string;
3
+ onChange: (value: string) => void;
4
+ placeholder?: string;
5
+ error?: string;
6
+ disabled?: boolean;
7
+ className?: string;
8
+ }
9
+ /**
10
+ * WYSIWYG markdown editor wrapper around Toast UI Editor.
11
+ */
12
+ export declare function MarkdownEditor({ value, onChange, placeholder, error, disabled, className, }: IMarkdownEditorProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,14 @@
1
+ export interface IMultiSelectOption {
2
+ label: string;
3
+ value: string;
4
+ }
5
+ interface IMultiSelectDropdownProps {
6
+ options: IMultiSelectOption[];
7
+ selected: string[];
8
+ onChange: (selected: string[]) => void;
9
+ placeholder?: string;
10
+ className?: string;
11
+ maxDisplay?: number;
12
+ }
13
+ export declare function MultiSelectDropdown({ options, selected, onChange, placeholder, className, maxDisplay, }: IMultiSelectDropdownProps): import("react/jsx-runtime").JSX.Element;
14
+ export {};
@@ -0,0 +1,15 @@
1
+ export interface INoResultProps {
2
+ /** Title shown in the empty state. */
3
+ title?: string;
4
+ /** Description shown in the empty state. */
5
+ description?: string;
6
+ }
7
+ /**
8
+ * Default empty state for tables and lists with no data.
9
+ *
10
+ * @example
11
+ * ```tsx
12
+ * <NoResult />
13
+ * ```
14
+ */
15
+ export declare function NoResult({ title, description, }: INoResultProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,12 @@
1
+ type PaginationProps = {
2
+ startRecord: number;
3
+ endRecord: number;
4
+ hasValidSearchValues: boolean;
5
+ tabCount: number;
6
+ disabledLoadBackButton: boolean;
7
+ disabledLoadMoreButton: boolean;
8
+ loadBack: () => void;
9
+ loadMore: () => void;
10
+ };
11
+ export declare const Pagination: ({ startRecord, endRecord, hasValidSearchValues, tabCount, disabledLoadBackButton, disabledLoadMoreButton, loadBack, loadMore, }: PaginationProps) => import("react/jsx-runtime").JSX.Element;
12
+ export {};
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Parameters passed to the FK fetcher function.
3
+ */
4
+ export type FKFetcherParams = {
5
+ search: string;
6
+ modelClass: string;
7
+ labelName: string;
8
+ additionalFilters?: Record<string, any>;
9
+ fields?: string[];
10
+ limit?: number;
11
+ offset?: number;
12
+ };
13
+ /**
14
+ * Props for the FK variant of the Select component.
15
+ */
16
+ export interface IFKSelectVariantProps {
17
+ /** Optional id used as data-testid on the trigger. */
18
+ id?: string;
19
+ /** Function to fetch data from the API. */
20
+ fetcher: (params: FKFetcherParams) => Promise<any[]>;
21
+ /** Optional function to resolve a value not present in the list. */
22
+ resolveValue?: (params: {
23
+ modelClass: string;
24
+ value: string | number;
25
+ }) => Promise<any>;
26
+ /** The model class name to identify the resource. */
27
+ modelClass: string;
28
+ /** The field name to use as the display label. */
29
+ labelName: string;
30
+ /** The field name to use as the value (ID). Defaults to 'pk'. */
31
+ valueField?: string;
32
+ /** Placeholder text for the search input. */
33
+ placeholder?: string;
34
+ /** Message to show when no items are found. */
35
+ emptyMessage?: string;
36
+ /** The currently selected value. */
37
+ value: string | number | null;
38
+ /** Callback when an item is selected. */
39
+ onChange: (value: string | number, item?: any) => void;
40
+ /** Additional filters to apply to the API request. */
41
+ additionalFilters?: Record<string, any>;
42
+ /** Extra fields to include in search. */
43
+ fields?: string[];
44
+ /** Optional class names for the wrapper. */
45
+ className?: string;
46
+ /** Debounce time in ms. Defaults to 300. */
47
+ debounceWait?: number;
48
+ }
49
+ /**
50
+ * FK variant of Select — async searchable combobox for foreign keys.
51
+ */
52
+ export declare const FKSelectVariant: ({ id, fetcher, resolveValue, modelClass, labelName, valueField, placeholder, emptyMessage, value, onChange, additionalFilters, fields, className, debounceWait, }: IFKSelectVariantProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,70 @@
1
+ import { type IFKSelectProps } from "@/components/FKSelect";
2
+ type Option = {
3
+ value: string;
4
+ label: string;
5
+ };
6
+ type SharedSelectProps = {
7
+ /** Optional id used as data-testid on the trigger. */
8
+ id?: string;
9
+ /** Optional class names for the select wrapper (width, layout). */
10
+ className?: string;
11
+ };
12
+ /**
13
+ * Props for the static (default) Select variant.
14
+ */
15
+ export interface IStaticSelectProps extends SharedSelectProps {
16
+ variant?: "static";
17
+ /** Placeholder text when no value is selected. */
18
+ placeholder: string;
19
+ /** Static options with value and label. */
20
+ options: Option[];
21
+ /** Controlled selected value. */
22
+ value?: string;
23
+ /** Callback when the selected value changes. */
24
+ onValueChange?: (value: string) => void;
25
+ /** Marks the field as required in HTML forms. */
26
+ required?: boolean;
27
+ /** Name attribute for HTML form submission. */
28
+ name?: string;
29
+ }
30
+ /**
31
+ * Props for the FK variant of Select.
32
+ */
33
+ export interface ISelectFKProps extends IFKSelectProps {
34
+ variant: "fk";
35
+ }
36
+ /**
37
+ * Props for the Select component (static or FK variant).
38
+ */
39
+ export type ISelectProps = IStaticSelectProps | ISelectFKProps;
40
+ /**
41
+ * A reusable dropdown component built with shadcn/ui.
42
+ *
43
+ * Supports a static variant (Radix Select) and an FK variant (async
44
+ * Combobox) for foreign-key fields.
45
+ *
46
+ * @example
47
+ * ```tsx
48
+ * <Select
49
+ * placeholder="Choose an option"
50
+ * options={[
51
+ * { value: "a", label: "Option A" },
52
+ * { value: "b", label: "Option B" },
53
+ * ]}
54
+ * value={selected}
55
+ * onValueChange={setSelected}
56
+ * />
57
+ *
58
+ * <Select
59
+ * variant="fk"
60
+ * fetcher={fetchUsers}
61
+ * modelClass="user"
62
+ * labelName="username"
63
+ * placeholder="Select user"
64
+ * value={userId}
65
+ * onChange={(id, item) => setUserId(id)}
66
+ * />
67
+ * ```
68
+ */
69
+ export declare const Select: (props: ISelectProps) => import("react/jsx-runtime").JSX.Element;
70
+ export {};
@@ -0,0 +1,45 @@
1
+ import { type LucideIcon } from "lucide-react";
2
+ import { type ComponentType, type ReactNode } from "react";
3
+ export interface INavigationSidebarSubLink {
4
+ title: string;
5
+ href: string;
6
+ }
7
+ export interface INavigationSidebarLink {
8
+ title: string;
9
+ href?: string;
10
+ icon: string;
11
+ subItems?: INavigationSidebarSubLink[];
12
+ }
13
+ export interface INavigationSidebarLogo {
14
+ src: string;
15
+ alt: string;
16
+ width?: number;
17
+ height?: number;
18
+ }
19
+ export interface INavigationSidebarProps {
20
+ links: INavigationSidebarLink[];
21
+ iconMap: Record<string, LucideIcon>;
22
+ pathname: string;
23
+ isSidebarCollapsedFromQuery?: boolean;
24
+ logo: INavigationSidebarLogo;
25
+ onLogout: () => void | Promise<void>;
26
+ logoutIcon?: LucideIcon;
27
+ logoutLabel?: string;
28
+ LinkComponent?: ComponentType<{
29
+ href: any;
30
+ className?: string;
31
+ children: ReactNode;
32
+ title?: string;
33
+ }>;
34
+ ImageComponent?: ComponentType<{
35
+ src: string;
36
+ alt: string;
37
+ width: number;
38
+ height: number;
39
+ className?: string;
40
+ }>;
41
+ }
42
+ /**
43
+ * Configurable navigation sidebar with collapse, groups and logout.
44
+ */
45
+ export declare function NavigationSidebar({ links, iconMap, pathname, isSidebarCollapsedFromQuery, logo, onLogout, logoutIcon, logoutLabel, LinkComponent, ImageComponent, }: INavigationSidebarProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,157 @@
1
+ import { type LucideIcon } from "lucide-react";
2
+ import { type ComponentType, type ReactNode } from "react";
3
+ /**
4
+ * Props for the Sidebar Root component.
5
+ */
6
+ export interface SidebarRootProps {
7
+ /** The content of the sidebar. */
8
+ children: ReactNode;
9
+ /** Whether the sidebar is currently collapsed. */
10
+ isCollapsed: boolean;
11
+ /** Whether the sidebar is mid-collapse transition. */
12
+ isCollapsing?: boolean;
13
+ /** Callback to toggle the collapsed state. */
14
+ onToggleCollapse: () => void;
15
+ /** Callback when width transition ends. */
16
+ onTransitionEnd?: () => void;
17
+ /** Additional CSS classes. */
18
+ className?: string;
19
+ }
20
+ declare function Root({ children, isCollapsed, isCollapsing, onToggleCollapse, onTransitionEnd, className, }: SidebarRootProps): import("react/jsx-runtime").JSX.Element;
21
+ /**
22
+ * Props for the Sidebar Header component.
23
+ */
24
+ export interface SidebarHeaderProps {
25
+ children: ReactNode;
26
+ className?: string;
27
+ }
28
+ declare function Header({ children, className }: SidebarHeaderProps): import("react/jsx-runtime").JSX.Element;
29
+ /**
30
+ * Props for the Sidebar Content component.
31
+ */
32
+ export interface SidebarContentProps {
33
+ children: ReactNode;
34
+ className?: string;
35
+ }
36
+ declare function Content({ children, className }: SidebarContentProps): import("react/jsx-runtime").JSX.Element;
37
+ /**
38
+ * Props for the Sidebar Footer component.
39
+ */
40
+ export interface SidebarFooterProps {
41
+ children: ReactNode;
42
+ className?: string;
43
+ }
44
+ declare function Footer({ children, className }: SidebarFooterProps): import("react/jsx-runtime").JSX.Element;
45
+ /**
46
+ * Props for the Sidebar Toggle component.
47
+ */
48
+ export interface SidebarToggleProps {
49
+ className?: string;
50
+ }
51
+ declare function Toggle({ className }: SidebarToggleProps): import("react/jsx-runtime").JSX.Element;
52
+ /**
53
+ * Props for the Sidebar Logo component.
54
+ */
55
+ export interface SidebarLogoProps {
56
+ src: string;
57
+ alt: string;
58
+ width?: number;
59
+ height?: number;
60
+ /** Logo width when the sidebar is collapsed. Defaults to 48. */
61
+ collapsedWidth?: number;
62
+ /** Logo height when the sidebar is collapsed. */
63
+ collapsedHeight?: number;
64
+ className?: string;
65
+ ImageComponent?: ComponentType<{
66
+ src: string;
67
+ alt: string;
68
+ width: number;
69
+ height: number;
70
+ className?: string;
71
+ }>;
72
+ }
73
+ declare function Logo({ src, alt, width, height, collapsedWidth, collapsedHeight, className, ImageComponent, }: SidebarLogoProps): import("react/jsx-runtime").JSX.Element;
74
+ /**
75
+ * Props for the Sidebar Link component.
76
+ */
77
+ export interface SidebarLinkProps {
78
+ icon: LucideIcon;
79
+ children: ReactNode;
80
+ href: any;
81
+ active?: boolean;
82
+ className?: string;
83
+ LinkComponent?: ComponentType<{
84
+ href: any;
85
+ className?: string;
86
+ children: ReactNode;
87
+ title?: string;
88
+ }>;
89
+ }
90
+ declare function Link({ icon: Icon, children, href, active, className, LinkComponent, }: SidebarLinkProps): import("react/jsx-runtime").JSX.Element;
91
+ export interface SidebarNavGroupProps {
92
+ icon: LucideIcon;
93
+ title: string;
94
+ isExpanded: boolean;
95
+ isActive?: boolean;
96
+ onToggle: () => void;
97
+ children: ReactNode;
98
+ className?: string;
99
+ }
100
+ declare function NavGroup({ icon: Icon, title, isExpanded, isActive, onToggle, children, className, }: SidebarNavGroupProps): import("react/jsx-runtime").JSX.Element;
101
+ export interface SidebarNavSubLinkProps {
102
+ title: string;
103
+ href: string | Record<string, unknown>;
104
+ active?: boolean;
105
+ className?: string;
106
+ LinkComponent?: ComponentType<{
107
+ href: any;
108
+ className?: string;
109
+ children: ReactNode;
110
+ title?: string;
111
+ }>;
112
+ }
113
+ declare function NavSubLink({ title, href, active, className, LinkComponent, }: SidebarNavSubLinkProps): import("react/jsx-runtime").JSX.Element;
114
+ export interface SidebarActionProps {
115
+ icon: LucideIcon;
116
+ label: string;
117
+ onClick: () => void;
118
+ className?: string;
119
+ }
120
+ declare function Action({ icon: Icon, label, onClick, className }: SidebarActionProps): import("react/jsx-runtime").JSX.Element;
121
+ /**
122
+ * A composable Sidebar component.
123
+ *
124
+ * @example
125
+ * ```tsx
126
+ * const [collapsed, setCollapsed] = useState(false);
127
+ *
128
+ * return (
129
+ * <Sidebar.Root isCollapsed={collapsed} onToggleCollapse={() => setCollapsed(!collapsed)}>
130
+ * <Sidebar.Header>
131
+ * <Sidebar.Logo src="/logo.png" alt="Logo" />
132
+ * <Sidebar.Toggle />
133
+ * </Sidebar.Header>
134
+ * <Sidebar.Content>
135
+ * <Sidebar.Link icon={HomeIcon} href="/">Home</Sidebar.Link>
136
+ * </Sidebar.Content>
137
+ * <Sidebar.Footer>
138
+ * User Info
139
+ * </Sidebar.Footer>
140
+ * </Sidebar.Root>
141
+ * )
142
+ * ```
143
+ */
144
+ export declare const Sidebar: {
145
+ Root: typeof Root;
146
+ Header: typeof Header;
147
+ Content: typeof Content;
148
+ Footer: typeof Footer;
149
+ Toggle: typeof Toggle;
150
+ Logo: typeof Logo;
151
+ Link: typeof Link;
152
+ NavGroup: typeof NavGroup;
153
+ NavSubLink: typeof NavSubLink;
154
+ Action: typeof Action;
155
+ };
156
+ export { useSidebarCollapse } from "./useSidebarCollapse";
157
+ export type { IUseSidebarCollapseOptions } from "./useSidebarCollapse";
@@ -0,0 +1,18 @@
1
+ export interface IUseSidebarCollapseOptions {
2
+ initialCollapsed?: boolean;
3
+ onPersist?: (collapsed: boolean) => void;
4
+ }
5
+ /**
6
+ * Hook for sidebar collapse state with optional persistence callback.
7
+ */
8
+ export declare function useSidebarCollapse({ initialCollapsed, onPersist, }?: IUseSidebarCollapseOptions): {
9
+ isCollapsed: boolean;
10
+ isCollapsing: boolean;
11
+ expandedItems: Record<string, boolean>;
12
+ setExpandedItems: import("react").Dispatch<import("react").SetStateAction<Record<string, boolean>>>;
13
+ toggleCollapse: () => void;
14
+ expand: () => void;
15
+ handleTransitionEnd: () => void;
16
+ toggleExpanded: (title: string) => void;
17
+ setExpandedOnCollapse: () => void;
18
+ };
@@ -0,0 +1,28 @@
1
+ import type { HTMLAttributes, ReactNode } from "react";
2
+ type StackProps = HTMLAttributes<HTMLDivElement> & {
3
+ children: ReactNode;
4
+ /** The direction of the stack. Defaults to 'col'. */
5
+ direction?: "row" | "col";
6
+ /** The gap between elements. Maps to Tailwind gap utility (e.g. 4 -> gap-4). */
7
+ gap?: number;
8
+ /** Click handler. When set, the stack becomes keyboard-accessible (role="button"). */
9
+ onClick?: () => void;
10
+ className?: string;
11
+ };
12
+ /**
13
+ * A layout component that arranges children in a stack (vertical or horizontal).
14
+ *
15
+ * When `onClick` is provided, the stack receives `role="button"`, `tabIndex={0}`,
16
+ * and responds to Enter and Space keys. Provide visible text or pass `aria-label`
17
+ * via props for accessibility.
18
+ *
19
+ * @example
20
+ * ```tsx
21
+ * <Stack direction="row" gap={4}>
22
+ * <Button>Btn 1</Button>
23
+ * <Button>Btn 2</Button>
24
+ * </Stack>
25
+ * ```
26
+ */
27
+ declare function Stack({ children, onClick, direction, gap, className, ...props }: StackProps): import("react/jsx-runtime").JSX.Element;
28
+ export default Stack;
@@ -0,0 +1,92 @@
1
+ import type { ReactNode } from "react";
2
+ /**
3
+ * Column definition for Table.
4
+ */
5
+ export interface ITableColumn<T> {
6
+ /** Row field key used to read cell value. */
7
+ key: keyof T & string;
8
+ /** Header label. */
9
+ label: string;
10
+ /** Tailwind width classes for head and cell. */
11
+ width?: string;
12
+ /** Extra classes for the header cell. */
13
+ className?: string;
14
+ /** Extra classes for the body cell. */
15
+ cellClassName?: string;
16
+ /** Whether the column supports sorting. */
17
+ sortable?: boolean;
18
+ /** Custom cell renderer. */
19
+ render?: (value: unknown, row: T) => ReactNode;
20
+ }
21
+ /**
22
+ * Props for the Table component.
23
+ */
24
+ export interface ITableProps<T> {
25
+ /** Rows to display. */
26
+ data: T[];
27
+ /** Column configuration. */
28
+ columns: ITableColumn<T>[];
29
+ /** Returns a stable key for each row. */
30
+ getRowKey: (row: T) => string | number;
31
+ /** Current sort field; prefix with '-' for descending. */
32
+ ordering?: string;
33
+ /** Called when a sortable column header is clicked. */
34
+ onSort?: (columnKey: string) => void;
35
+ /** Called when a row is clicked. */
36
+ onRowClick?: (row: T) => void;
37
+ /** Whether a data request is in progress. */
38
+ isLoading?: boolean;
39
+ /** Whether more rows can be loaded. */
40
+ hasMore?: boolean;
41
+ /** Called when the load-more button is clicked. */
42
+ onLoadMore?: () => void;
43
+ /** Extra classes for the scroll wrapper. */
44
+ className?: string;
45
+ }
46
+ /**
47
+ * A comprehensive Table component system.
48
+ *
49
+ * @example
50
+ * ```tsx
51
+ * <PumpwoodTable.Root>
52
+ * <PumpwoodTable.Header>
53
+ * <PumpwoodTable.Row>
54
+ * <PumpwoodTable.Head>ID</PumpwoodTable.Head>
55
+ * <PumpwoodTable.Head>Name</PumpwoodTable.Head>
56
+ * </PumpwoodTable.Row>
57
+ * </PumpwoodTable.Header>
58
+ * <PumpwoodTable.Body>
59
+ * <PumpwoodTable.Row>
60
+ * <PumpwoodTable.Cell>1</PumpwoodTable.Cell>
61
+ * <PumpwoodTable.Cell>John Doe</PumpwoodTable.Cell>
62
+ * </PumpwoodTable.Row>
63
+ * </PumpwoodTable.Body>
64
+ * </PumpwoodTable.Root>
65
+ * ```
66
+ */
67
+ export declare const PumpwoodTable: {
68
+ Root: import("react").ForwardRefExoticComponent<import("react").HTMLAttributes<HTMLTableElement> & import("react").RefAttributes<HTMLTableElement>>;
69
+ Body: import("react").ForwardRefExoticComponent<import("react").HTMLAttributes<HTMLTableSectionElement> & import("react").RefAttributes<HTMLTableSectionElement>>;
70
+ Cell: import("react").ForwardRefExoticComponent<import("react").TdHTMLAttributes<HTMLTableCellElement> & import("react").RefAttributes<HTMLTableCellElement>>;
71
+ Head: import("react").ForwardRefExoticComponent<import("react").ThHTMLAttributes<HTMLTableCellElement> & import("react").RefAttributes<HTMLTableCellElement>>;
72
+ Header: import("react").ForwardRefExoticComponent<import("react").HTMLAttributes<HTMLTableSectionElement> & import("react").RefAttributes<HTMLTableSectionElement>>;
73
+ Row: import("react").ForwardRefExoticComponent<import("react").HTMLAttributes<HTMLTableRowElement> & import("react").RefAttributes<HTMLTableRowElement>>;
74
+ };
75
+ /**
76
+ * Generic data table with loading, empty, sort, and load-more states.
77
+ *
78
+ * @example
79
+ * ```tsx
80
+ * <Table
81
+ * data={items}
82
+ * columns={columns}
83
+ * getRowKey={(row) => row.pk}
84
+ * ordering={ordering}
85
+ * onSort={handleSort}
86
+ * isLoading={isLoading}
87
+ * hasMore={hasMore}
88
+ * onLoadMore={handleLoadMore}
89
+ * />
90
+ * ```
91
+ */
92
+ export declare function Table<T extends Record<string, unknown>>({ data, columns, getRowKey, ordering, onSort, onRowClick, isLoading, hasMore, onLoadMore, className, }: ITableProps<T>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,23 @@
1
+ export interface ITableSkeletonColumn {
2
+ /** Tailwind width classes matching the table column. */
3
+ width?: string;
4
+ /** Extra classes for the skeleton cell. */
5
+ cellClassName?: string;
6
+ }
7
+ export interface ITableSkeletonProps {
8
+ /** Column layout or column count. */
9
+ columns: ITableSkeletonColumn[] | number;
10
+ /** Number of skeleton rows. Defaults to 5. */
11
+ rows?: number;
12
+ }
13
+ /**
14
+ * Skeleton rows rendered inside TableBody while data is loading.
15
+ *
16
+ * @example
17
+ * ```tsx
18
+ * <TableBody>
19
+ * <TableSkeleton columns={columns} rows={5} />
20
+ * </TableBody>
21
+ * ```
22
+ */
23
+ export declare function TableSkeleton({ columns, rows, }: ITableSkeletonProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,13 @@
1
+ export interface ITagItem {
2
+ key: string;
3
+ value: string;
4
+ }
5
+ interface ITagInputProps {
6
+ value: ITagItem[];
7
+ onChange: (tags: ITagItem[]) => void;
8
+ keyPlaceholder?: string;
9
+ valuePlaceholder?: string;
10
+ disabled?: boolean;
11
+ }
12
+ export default function TagInput({ value, onChange, keyPlaceholder, valuePlaceholder, disabled, }: ITagInputProps): import("react/jsx-runtime").JSX.Element;
13
+ export { TagInput };
@@ -0,0 +1,21 @@
1
+ import type { HTMLAttributes, ReactNode } from "react";
2
+ type TypographyProps = HTMLAttributes<HTMLParagraphElement> & {
3
+ children: ReactNode;
4
+ className?: string;
5
+ };
6
+ declare function H1({ children, className, ...props }: TypographyProps): import("react/jsx-runtime").JSX.Element;
7
+ declare function Muted({ children, className, ...props }: TypographyProps): import("react/jsx-runtime").JSX.Element;
8
+ /**
9
+ * Typography components for consistent text styling.
10
+ *
11
+ * @example
12
+ * ```tsx
13
+ * <Typography.H1>Main Title</Typography.H1>
14
+ * <Typography.Muted>Subtitle text</Typography.Muted>
15
+ * ```
16
+ */
17
+ export declare const Typography: {
18
+ H1: typeof H1;
19
+ Muted: typeof Muted;
20
+ };
21
+ export {};
@@ -0,0 +1,8 @@
1
+ type TooltipComponentProps = {
2
+ trigger: React.ReactNode;
3
+ children: React.ReactNode;
4
+ className?: string;
5
+ triggerClassName?: string;
6
+ };
7
+ export declare const TooltipComponent: ({ triggerClassName, className, trigger, children, }: TooltipComponentProps) => import("react/jsx-runtime").JSX.Element;
8
+ export {};