@true-tech-team/react-components 0.0.4 → 0.0.6

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 (213) hide show
  1. package/index.css +1 -1
  2. package/index.d.ts +10 -0
  3. package/index.js +1 -1
  4. package/index.mjs +15961 -6871
  5. package/lib/components/buttons/ButtonToggleGroup/ButtonToggleGroup.d.ts +79 -0
  6. package/lib/components/buttons/ButtonToggleGroup/ButtonToggleGroupContext.d.ts +38 -0
  7. package/lib/components/buttons/ButtonToggleGroup/ButtonToggleGroupItem.d.ts +37 -0
  8. package/lib/components/buttons/ButtonToggleGroup/index.d.ts +7 -0
  9. package/lib/components/buttons/ToggleButton/ToggleButton.d.ts +96 -0
  10. package/lib/components/buttons/ToggleButton/index.d.ts +3 -0
  11. package/lib/components/display/Icon/icons/BookmarkFilled.d.ts +3 -0
  12. package/lib/components/display/Icon/icons/ChevronsLeft.d.ts +3 -0
  13. package/lib/components/display/Icon/icons/ChevronsRight.d.ts +3 -0
  14. package/lib/components/display/Icon/icons/HeartFilled.d.ts +3 -0
  15. package/lib/components/display/Icon/icons/More.d.ts +3 -0
  16. package/lib/components/display/Icon/icons/StarFilled.d.ts +3 -0
  17. package/lib/components/display/Icon/icons/ThumbsUpFilled.d.ts +3 -0
  18. package/lib/components/display/Icon/icons/index.d.ts +15 -1
  19. package/lib/components/display/List/List.d.ts +6 -0
  20. package/lib/components/display/List/ListContext.d.ts +15 -0
  21. package/lib/components/display/List/ListEmpty.d.ts +25 -0
  22. package/lib/components/display/List/ListGroup.d.ts +36 -0
  23. package/lib/components/display/List/ListHeader.d.ts +62 -0
  24. package/lib/components/display/List/ListItem.d.ts +19 -0
  25. package/lib/components/display/List/ListSearch.d.ts +32 -0
  26. package/lib/components/display/List/ListSkeleton.d.ts +27 -0
  27. package/lib/components/display/List/hooks/index.d.ts +5 -0
  28. package/lib/components/display/List/hooks/useListExpand.d.ts +6 -0
  29. package/lib/components/display/List/hooks/useListFilter.d.ts +6 -0
  30. package/lib/components/display/List/hooks/useListGroups.d.ts +6 -0
  31. package/lib/components/display/List/hooks/useListKeyboardNav.d.ts +6 -0
  32. package/lib/components/display/List/hooks/useListSelection.d.ts +6 -0
  33. package/lib/components/display/List/index.d.ts +11 -0
  34. package/lib/components/display/List/types.d.ts +485 -0
  35. package/lib/components/display/List/utils.d.ts +47 -0
  36. package/lib/components/display/OverflowText/OverflowText.d.ts +81 -0
  37. package/lib/components/display/OverflowText/index.d.ts +2 -0
  38. package/lib/components/display/ScrollArea/ScrollArea.d.ts +112 -0
  39. package/lib/components/display/ScrollArea/index.d.ts +3 -0
  40. package/lib/components/display/Table/Table.d.ts +6 -0
  41. package/lib/components/display/Table/TableBody.d.ts +4 -0
  42. package/lib/components/display/Table/TableCell.d.ts +12 -0
  43. package/lib/components/display/Table/TableContext.d.ts +10 -0
  44. package/lib/components/display/Table/TableHeader.d.ts +4 -0
  45. package/lib/components/display/Table/TableRow.d.ts +9 -0
  46. package/lib/components/display/Table/TableSearch.d.ts +32 -0
  47. package/lib/components/display/Table/TableSkeleton.d.ts +12 -0
  48. package/lib/components/display/Table/hooks/index.d.ts +10 -0
  49. package/lib/components/display/Table/hooks/useInfiniteScroll.d.ts +11 -0
  50. package/lib/components/display/Table/hooks/useTableExpand.d.ts +10 -0
  51. package/lib/components/display/Table/hooks/useTableFilter.d.ts +22 -0
  52. package/lib/components/display/Table/hooks/useTableSelection.d.ts +16 -0
  53. package/lib/components/display/Table/hooks/useTableSort.d.ts +11 -0
  54. package/lib/components/display/Table/index.d.ts +13 -0
  55. package/lib/components/display/Table/types.d.ts +295 -0
  56. package/lib/components/display/Table/utils.d.ts +37 -0
  57. package/lib/components/display/Tabs/Tab.d.ts +41 -0
  58. package/lib/components/display/Tabs/TabList.d.ts +27 -0
  59. package/lib/components/display/Tabs/TabPanel.d.ts +31 -0
  60. package/lib/components/display/Tabs/Tabs.d.ts +90 -0
  61. package/lib/components/display/Tabs/TabsContext.d.ts +63 -0
  62. package/lib/components/display/Tabs/index.d.ts +11 -0
  63. package/lib/components/display/TruncatedList/TruncatedList.d.ts +69 -0
  64. package/lib/components/display/TruncatedList/index.d.ts +2 -0
  65. package/lib/components/display/index.d.ts +4 -0
  66. package/lib/components/dnd/DndProvider/DndContext.d.ts +91 -0
  67. package/lib/components/dnd/DndProvider/DndProvider.d.ts +37 -0
  68. package/lib/components/dnd/DndProvider/index.d.ts +3 -0
  69. package/lib/components/dnd/DragHandle/DragHandle.d.ts +41 -0
  70. package/lib/components/dnd/DragHandle/index.d.ts +2 -0
  71. package/lib/components/dnd/DragOverlay/DragOverlay.d.ts +39 -0
  72. package/lib/components/dnd/DragOverlay/index.d.ts +2 -0
  73. package/lib/components/dnd/KanbanBoard/KanbanBoard.d.ts +126 -0
  74. package/lib/components/dnd/KanbanBoard/KanbanBoardContext.d.ts +62 -0
  75. package/lib/components/dnd/KanbanBoard/KanbanCard.d.ts +76 -0
  76. package/lib/components/dnd/KanbanBoard/KanbanColumn.d.ts +43 -0
  77. package/lib/components/dnd/KanbanBoard/index.d.ts +5 -0
  78. package/lib/components/dnd/ResizablePanels/ResizablePanel.d.ts +53 -0
  79. package/lib/components/dnd/ResizablePanels/ResizablePanels.d.ts +43 -0
  80. package/lib/components/dnd/ResizablePanels/ResizablePanelsContext.d.ts +64 -0
  81. package/lib/components/dnd/ResizablePanels/ResizeHandle.d.ts +28 -0
  82. package/lib/components/dnd/ResizablePanels/index.d.ts +5 -0
  83. package/lib/components/dnd/SortableGrid/SortableGrid.d.ts +76 -0
  84. package/lib/components/dnd/SortableGrid/SortableGridItem.d.ts +47 -0
  85. package/lib/components/dnd/SortableGrid/index.d.ts +3 -0
  86. package/lib/components/dnd/SortableList/SortableItem.d.ts +76 -0
  87. package/lib/components/dnd/SortableList/SortableList.d.ts +98 -0
  88. package/lib/components/dnd/SortableList/SortableListContext.d.ts +42 -0
  89. package/lib/components/dnd/SortableList/index.d.ts +4 -0
  90. package/lib/components/dnd/hooks/index.d.ts +3 -0
  91. package/lib/components/dnd/hooks/useDraggable.d.ts +66 -0
  92. package/lib/components/dnd/hooks/useDroppable.d.ts +73 -0
  93. package/lib/components/dnd/hooks/useSortable.d.ts +94 -0
  94. package/lib/components/dnd/index.d.ts +8 -0
  95. package/lib/components/filters/FilterContext.d.ts +34 -0
  96. package/lib/components/filters/core/ActiveFilters/ActiveFilters.d.ts +16 -0
  97. package/lib/components/filters/core/ActiveFilters/index.d.ts +2 -0
  98. package/lib/components/filters/core/FilterField/FilterField.d.ts +17 -0
  99. package/lib/components/filters/core/FilterField/index.d.ts +2 -0
  100. package/lib/components/filters/core/FilterProvider/FilterProvider.d.ts +4 -0
  101. package/lib/components/filters/core/FilterProvider/index.d.ts +2 -0
  102. package/lib/components/filters/core/FilterSection/FilterSection.d.ts +16 -0
  103. package/lib/components/filters/core/FilterSection/index.d.ts +2 -0
  104. package/lib/components/filters/core/index.d.ts +7 -0
  105. package/lib/components/filters/fields/CheckboxFilter.d.ts +17 -0
  106. package/lib/components/filters/fields/DateFilter.d.ts +21 -0
  107. package/lib/components/filters/fields/DateRangeFilter.d.ts +19 -0
  108. package/lib/components/filters/fields/ListSelectFilter.d.ts +19 -0
  109. package/lib/components/filters/fields/MultiSelectFilter.d.ts +19 -0
  110. package/lib/components/filters/fields/NumberFilter.d.ts +19 -0
  111. package/lib/components/filters/fields/NumberRangeFilter.d.ts +19 -0
  112. package/lib/components/filters/fields/RatingFilter.d.ts +19 -0
  113. package/lib/components/filters/fields/SelectFilter.d.ts +21 -0
  114. package/lib/components/filters/fields/TextFilter.d.ts +21 -0
  115. package/lib/components/filters/fields/ToggleFilter.d.ts +17 -0
  116. package/lib/components/filters/fields/index.d.ts +25 -0
  117. package/lib/components/filters/hooks/index.d.ts +9 -0
  118. package/lib/components/filters/hooks/useFilter.d.ts +57 -0
  119. package/lib/components/filters/hooks/useFilterDependencies.d.ts +40 -0
  120. package/lib/components/filters/hooks/useFilterOptions.d.ts +70 -0
  121. package/lib/components/filters/index.d.ts +43 -0
  122. package/lib/components/filters/layouts/FilterAccordion/FilterAccordion.d.ts +15 -0
  123. package/lib/components/filters/layouts/FilterAccordion/index.d.ts +2 -0
  124. package/lib/components/filters/layouts/FilterBar/FilterBar.d.ts +18 -0
  125. package/lib/components/filters/layouts/FilterBar/index.d.ts +2 -0
  126. package/lib/components/filters/layouts/FilterModal/FilterModal.d.ts +24 -0
  127. package/lib/components/filters/layouts/FilterModal/index.d.ts +2 -0
  128. package/lib/components/filters/layouts/FilterPopover/FilterPopover.d.ts +19 -0
  129. package/lib/components/filters/layouts/FilterPopover/index.d.ts +2 -0
  130. package/lib/components/filters/layouts/FilterSidebar/FilterSidebar.d.ts +20 -0
  131. package/lib/components/filters/layouts/FilterSidebar/index.d.ts +2 -0
  132. package/lib/components/filters/layouts/index.d.ts +8 -0
  133. package/lib/components/filters/types.d.ts +937 -0
  134. package/lib/components/index.d.ts +52 -0
  135. package/lib/components/inputs/Checkbox/Checkbox.d.ts +2 -2
  136. package/lib/components/inputs/CheckboxGroup/CheckboxGroup.d.ts +122 -0
  137. package/lib/components/inputs/CheckboxGroup/CheckboxGroupContext.d.ts +42 -0
  138. package/lib/components/inputs/CheckboxGroup/CheckboxGroupItem.d.ts +50 -0
  139. package/lib/components/inputs/CheckboxGroup/index.d.ts +7 -0
  140. package/lib/components/inputs/NumberInput/NumberInput.d.ts +3 -1
  141. package/lib/components/layout/AdaptiveGrid/AdaptiveGrid.d.ts +100 -0
  142. package/lib/components/layout/AdaptiveGrid/index.d.ts +2 -0
  143. package/lib/components/layout/MasonryLayout/MasonryLayout.d.ts +74 -0
  144. package/lib/components/layout/MasonryLayout/index.d.ts +2 -0
  145. package/lib/components/layout/Panes/Pane.d.ts +72 -0
  146. package/lib/components/layout/Panes/Panes.d.ts +75 -0
  147. package/lib/components/layout/Panes/PanesContext.d.ts +60 -0
  148. package/lib/components/layout/Panes/index.d.ts +6 -0
  149. package/lib/components/layout/ResponsiveStack/ResponsiveStack.d.ts +99 -0
  150. package/lib/components/layout/ResponsiveStack/index.d.ts +2 -0
  151. package/lib/components/layout/index.d.ts +4 -0
  152. package/lib/components/navigation/BottomNavigation/BottomNavigation.d.ts +53 -0
  153. package/lib/components/navigation/BottomNavigation/BottomNavigationContext.d.ts +27 -0
  154. package/lib/components/navigation/BottomNavigation/BottomNavigationItem.d.ts +59 -0
  155. package/lib/components/navigation/BottomNavigation/index.d.ts +7 -0
  156. package/lib/components/navigation/Breadcrumbs/BreadcrumbItem.d.ts +37 -0
  157. package/lib/components/navigation/Breadcrumbs/BreadcrumbSeparator.d.ts +22 -0
  158. package/lib/components/navigation/Breadcrumbs/Breadcrumbs.d.ts +96 -0
  159. package/lib/components/navigation/Breadcrumbs/index.d.ts +9 -0
  160. package/lib/components/navigation/Breadcrumbs/useBreadcrumbsFromPath.d.ts +73 -0
  161. package/lib/components/navigation/CollapsibleSidebar/CollapsibleSidebar.d.ts +113 -0
  162. package/lib/components/navigation/CollapsibleSidebar/index.d.ts +2 -0
  163. package/lib/components/navigation/NavLink/NavLink.d.ts +74 -0
  164. package/lib/components/navigation/NavLink/index.d.ts +3 -0
  165. package/lib/components/navigation/Navbar/Navbar.d.ts +81 -0
  166. package/lib/components/navigation/Navbar/NavbarActions.d.ts +21 -0
  167. package/lib/components/navigation/Navbar/NavbarBrand.d.ts +29 -0
  168. package/lib/components/navigation/Navbar/NavbarCollapse.d.ts +26 -0
  169. package/lib/components/navigation/Navbar/NavbarContext.d.ts +50 -0
  170. package/lib/components/navigation/Navbar/NavbarNav.d.ts +22 -0
  171. package/lib/components/navigation/Navbar/NavbarToggle.d.ts +21 -0
  172. package/lib/components/navigation/Navbar/index.d.ts +15 -0
  173. package/lib/components/navigation/Pagination/Pagination.d.ts +99 -0
  174. package/lib/components/navigation/Pagination/index.d.ts +3 -0
  175. package/lib/components/navigation/SideNav/SideNav.d.ts +89 -0
  176. package/lib/components/navigation/SideNav/SideNavContext.d.ts +43 -0
  177. package/lib/components/navigation/SideNav/SideNavDivider.d.ts +22 -0
  178. package/lib/components/navigation/SideNav/SideNavGroup.d.ts +44 -0
  179. package/lib/components/navigation/SideNav/SideNavItem.d.ts +71 -0
  180. package/lib/components/navigation/SideNav/index.d.ts +11 -0
  181. package/lib/components/navigation/Stepper/Step.d.ts +57 -0
  182. package/lib/components/navigation/Stepper/Stepper.d.ts +80 -0
  183. package/lib/components/navigation/Stepper/StepperContext.d.ts +58 -0
  184. package/lib/components/navigation/Stepper/index.d.ts +7 -0
  185. package/lib/components/navigation/index.d.ts +16 -0
  186. package/lib/components/overlays/Alert/Alert.d.ts +102 -0
  187. package/lib/components/overlays/Alert/AlertContext.d.ts +94 -0
  188. package/lib/components/overlays/Alert/AlertPresets.d.ts +42 -0
  189. package/lib/components/overlays/Alert/AlertProvider.d.ts +40 -0
  190. package/lib/components/overlays/Alert/index.d.ts +11 -0
  191. package/lib/components/overlays/Dialog/Dialog.d.ts +197 -0
  192. package/lib/components/overlays/Dialog/DialogContext.d.ts +75 -0
  193. package/lib/components/overlays/Dialog/DialogProvider.d.ts +30 -0
  194. package/lib/components/overlays/Dialog/index.d.ts +9 -0
  195. package/lib/components/overlays/Toast/Toast.d.ts +103 -0
  196. package/lib/components/overlays/Toast/ToastContainer.d.ts +37 -0
  197. package/lib/components/overlays/Toast/ToastContext.d.ts +126 -0
  198. package/lib/components/overlays/Toast/ToastProvider.d.ts +71 -0
  199. package/lib/components/overlays/Toast/index.d.ts +11 -0
  200. package/lib/hooks/index.d.ts +10 -0
  201. package/lib/hooks/useAlert/index.d.ts +2 -0
  202. package/lib/hooks/useAlert/useAlert.d.ts +99 -0
  203. package/lib/hooks/useAsyncToast/index.d.ts +2 -0
  204. package/lib/hooks/useAsyncToast/useAsyncToast.d.ts +93 -0
  205. package/lib/hooks/useDialog/index.d.ts +2 -0
  206. package/lib/hooks/useDialog/useDialog.d.ts +58 -0
  207. package/lib/hooks/useResizeObserver/index.d.ts +2 -0
  208. package/lib/hooks/useResizeObserver/useResizeObserver.d.ts +69 -0
  209. package/lib/hooks/useToast/index.d.ts +2 -0
  210. package/lib/hooks/useToast/useToast.d.ts +97 -0
  211. package/lib/providers/GlobalProvider/GlobalProvider.d.ts +16 -1
  212. package/package.json +1 -1
  213. package/README.md +0 -688
@@ -0,0 +1,40 @@
1
+ import { ReactNode } from 'react';
2
+ import { AlertProps } from './Alert';
3
+ /**
4
+ * Alert provider props
5
+ */
6
+ export interface AlertProviderProps {
7
+ /**
8
+ * Children to render
9
+ */
10
+ children: ReactNode;
11
+ /**
12
+ * Default props to apply to all alerts
13
+ */
14
+ defaultAlertProps?: Partial<AlertProps>;
15
+ }
16
+ /**
17
+ * Alert provider component
18
+ * Manages a queue of alerts for programmatic creation
19
+ *
20
+ * @example
21
+ * ```tsx
22
+ * <AlertProvider>
23
+ * <App />
24
+ * </AlertProvider>
25
+ *
26
+ * // In a component:
27
+ * const { confirm, error, success } = useAlert();
28
+ *
29
+ * const handleDelete = async () => {
30
+ * const confirmed = await confirm('Delete Item', 'Are you sure?');
31
+ * if (confirmed) {
32
+ * // perform delete
33
+ * }
34
+ * };
35
+ * ```
36
+ */
37
+ export declare function AlertProvider({ children, defaultAlertProps, }: AlertProviderProps): import("react/jsx-runtime").JSX.Element;
38
+ export declare namespace AlertProvider {
39
+ var displayName: string;
40
+ }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Alert component exports
3
+ */
4
+ export { Alert } from './Alert';
5
+ export type { AlertProps } from './Alert';
6
+ export { AlertProvider } from './AlertProvider';
7
+ export type { AlertProviderProps } from './AlertProvider';
8
+ export { AlertContext, useAlertContext, useAlertContextStrict, } from './AlertContext';
9
+ export type { AlertContextValue, AlertQueueItem, } from './AlertContext';
10
+ export { ALERT_PRESETS, getAlertPreset, } from './AlertPresets';
11
+ export type { AlertVariant, AlertPreset, } from './AlertPresets';
@@ -0,0 +1,197 @@
1
+ import { default as React, ReactNode } from 'react';
2
+ import { BaseComponentProps } from '../../../types';
3
+ /**
4
+ * Dialog size options
5
+ */
6
+ export type DialogSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
7
+ /**
8
+ * Dialog props
9
+ */
10
+ export interface DialogProps extends Omit<BaseComponentProps, 'children'> {
11
+ /**
12
+ * Whether the dialog is open (controlled)
13
+ */
14
+ isOpen?: boolean;
15
+ /**
16
+ * Default open state (uncontrolled)
17
+ * @default false
18
+ */
19
+ defaultOpen?: boolean;
20
+ /**
21
+ * Callback when open state changes
22
+ */
23
+ onOpenChange?: (isOpen: boolean) => void;
24
+ /**
25
+ * Callback when dialog requests to close
26
+ */
27
+ onClose?: () => void;
28
+ /**
29
+ * Dialog title (rendered in header)
30
+ */
31
+ title?: ReactNode;
32
+ /**
33
+ * Dialog content (main body)
34
+ */
35
+ children?: ReactNode;
36
+ /**
37
+ * Actions/buttons to render in footer
38
+ */
39
+ actions?: ReactNode;
40
+ /**
41
+ * Dialog size preset
42
+ * @default 'md'
43
+ */
44
+ size?: DialogSize;
45
+ /**
46
+ * Custom width (overrides size preset)
47
+ */
48
+ width?: string | number;
49
+ /**
50
+ * Maximum height (content scrolls if exceeded)
51
+ */
52
+ maxHeight?: string | number;
53
+ /**
54
+ * Close when clicking backdrop
55
+ * @default true
56
+ */
57
+ closeOnBackdropClick?: boolean;
58
+ /**
59
+ * Close when pressing Escape key
60
+ * @default true
61
+ */
62
+ closeOnEscape?: boolean;
63
+ /**
64
+ * Whether to show close button in header
65
+ * @default true
66
+ */
67
+ showCloseButton?: boolean;
68
+ /**
69
+ * Whether to trap focus within dialog
70
+ * @default true
71
+ */
72
+ trapFocus?: boolean;
73
+ /**
74
+ * Whether to block body scroll when open
75
+ * @default true
76
+ */
77
+ blockScroll?: boolean;
78
+ /**
79
+ * Enable backdrop blur effect
80
+ * @default false
81
+ */
82
+ blurBackdrop?: boolean;
83
+ /**
84
+ * Backdrop opacity (0-1)
85
+ * @default 0.5
86
+ */
87
+ backdropOpacity?: number;
88
+ /**
89
+ * Custom z-index
90
+ */
91
+ zIndex?: number;
92
+ /**
93
+ * Animation duration in milliseconds
94
+ * @default 200
95
+ */
96
+ animationDuration?: number;
97
+ /**
98
+ * Dialog role for accessibility
99
+ * @default 'dialog'
100
+ */
101
+ role?: 'dialog' | 'alertdialog';
102
+ /**
103
+ * ARIA labelledby ID
104
+ */
105
+ 'aria-labelledby'?: string;
106
+ /**
107
+ * ARIA describedby ID
108
+ */
109
+ 'aria-describedby'?: string;
110
+ /**
111
+ * Whether dialog is modal (prevents interaction outside)
112
+ * @default true
113
+ */
114
+ modal?: boolean;
115
+ /**
116
+ * Render function for custom header
117
+ */
118
+ renderHeader?: (props: {
119
+ title?: ReactNode;
120
+ onClose: () => void;
121
+ }) => ReactNode;
122
+ /**
123
+ * Render function for custom footer
124
+ */
125
+ renderFooter?: (props: {
126
+ actions?: ReactNode;
127
+ onClose: () => void;
128
+ }) => ReactNode;
129
+ /**
130
+ * Custom class for backdrop
131
+ */
132
+ backdropClassName?: string;
133
+ /**
134
+ * Custom class for content container
135
+ */
136
+ contentClassName?: string;
137
+ /**
138
+ * Callback after open animation completes
139
+ */
140
+ onOpenComplete?: () => void;
141
+ /**
142
+ * Callback after close animation completes
143
+ */
144
+ onCloseComplete?: () => void;
145
+ }
146
+ /**
147
+ * Dialog header props (for compound component)
148
+ */
149
+ export interface DialogHeaderProps extends BaseComponentProps {
150
+ /**
151
+ * Whether to show close button
152
+ * @default true
153
+ */
154
+ showCloseButton?: boolean;
155
+ /**
156
+ * Close button click handler
157
+ */
158
+ onClose?: () => void;
159
+ }
160
+ /**
161
+ * Dialog body props (for compound component)
162
+ */
163
+ export interface DialogBodyProps extends BaseComponentProps {
164
+ /**
165
+ * Enable scroll for content overflow
166
+ * @default true
167
+ */
168
+ scrollable?: boolean;
169
+ }
170
+ /**
171
+ * Dialog footer props (for compound component)
172
+ */
173
+ export interface DialogFooterProps extends BaseComponentProps {
174
+ /**
175
+ * Alignment of actions
176
+ * @default 'end'
177
+ */
178
+ align?: 'start' | 'center' | 'end' | 'space-between';
179
+ }
180
+ /**
181
+ * Dialog Header compound component
182
+ */
183
+ export declare const DialogHeader: React.FC<DialogHeaderProps>;
184
+ /**
185
+ * Dialog Body compound component
186
+ */
187
+ export declare const DialogBody: React.FC<DialogBodyProps>;
188
+ /**
189
+ * Dialog Footer compound component
190
+ */
191
+ export declare const DialogFooter: React.FC<DialogFooterProps>;
192
+ /**
193
+ * Dialog component
194
+ * Modal dialog for user interactions with customizable content
195
+ */
196
+ export declare const Dialog: React.ForwardRefExoticComponent<DialogProps & React.RefAttributes<HTMLDivElement>>;
197
+ export default Dialog;
@@ -0,0 +1,75 @@
1
+ import { DialogProps } from './Dialog';
2
+ /**
3
+ * Dialog stack item representing an open dialog
4
+ */
5
+ export interface DialogStackItem {
6
+ /**
7
+ * Unique dialog ID
8
+ */
9
+ id: string;
10
+ /**
11
+ * Dialog props (excluding isOpen which is managed by context)
12
+ */
13
+ props: Omit<DialogProps, 'isOpen'>;
14
+ /**
15
+ * Resolve function for promise-based dialog
16
+ */
17
+ resolve?: (value: unknown) => void;
18
+ }
19
+ /**
20
+ * Dialog context value
21
+ */
22
+ export interface DialogContextValue {
23
+ /**
24
+ * Currently open dialogs (stack for nested support)
25
+ */
26
+ dialogs: DialogStackItem[];
27
+ /**
28
+ * Open a new dialog
29
+ * @returns Promise that resolves when dialog closes with the result value
30
+ */
31
+ openDialog: <T = void>(props: Omit<DialogProps, 'isOpen'>) => Promise<T>;
32
+ /**
33
+ * Close a specific dialog by ID
34
+ * @param id - Dialog ID to close
35
+ * @param result - Optional result value to resolve the promise
36
+ */
37
+ closeDialog: (id: string, result?: unknown) => void;
38
+ /**
39
+ * Close the topmost dialog
40
+ * @param result - Optional result value to resolve the promise
41
+ */
42
+ closeTopDialog: (result?: unknown) => void;
43
+ /**
44
+ * Close all dialogs
45
+ */
46
+ closeAllDialogs: () => void;
47
+ /**
48
+ * Update props of an open dialog
49
+ * @param id - Dialog ID to update
50
+ * @param props - Partial props to merge
51
+ */
52
+ updateDialog: (id: string, props: Partial<DialogProps>) => void;
53
+ /**
54
+ * Check if a dialog is open
55
+ * @param id - Dialog ID to check
56
+ */
57
+ isDialogOpen: (id: string) => boolean;
58
+ /**
59
+ * Get the count of open dialogs
60
+ */
61
+ dialogCount: number;
62
+ }
63
+ /**
64
+ * Dialog context
65
+ */
66
+ export declare const DialogContext: import('react').Context<DialogContextValue | null>;
67
+ /**
68
+ * Hook to access dialog context (returns null if not in provider)
69
+ */
70
+ export declare function useDialogContext(): DialogContextValue | null;
71
+ /**
72
+ * Hook to access dialog context (throws if not in provider)
73
+ * @throws Error if used outside of DialogProvider
74
+ */
75
+ export declare function useDialogContextStrict(): DialogContextValue;
@@ -0,0 +1,30 @@
1
+ import { ReactNode } from 'react';
2
+ import { DialogProps } from './Dialog';
3
+ /**
4
+ * Dialog provider props
5
+ */
6
+ export interface DialogProviderProps {
7
+ /**
8
+ * Children to render
9
+ */
10
+ children: ReactNode;
11
+ /**
12
+ * Default props to apply to all dialogs
13
+ */
14
+ defaultDialogProps?: Partial<DialogProps>;
15
+ }
16
+ /**
17
+ * Dialog provider component
18
+ * Manages a stack of dialogs for programmatic creation
19
+ *
20
+ * @example
21
+ * ```tsx
22
+ * <DialogProvider>
23
+ * <App />
24
+ * </DialogProvider>
25
+ * ```
26
+ */
27
+ export declare function DialogProvider({ children, defaultDialogProps, }: DialogProviderProps): import("react/jsx-runtime").JSX.Element;
28
+ export declare namespace DialogProvider {
29
+ var displayName: string;
30
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Dialog component exports
3
+ */
4
+ export { Dialog, DialogHeader, DialogBody, DialogFooter, } from './Dialog';
5
+ export type { DialogProps, DialogSize, DialogHeaderProps, DialogBodyProps, DialogFooterProps, } from './Dialog';
6
+ export { DialogProvider } from './DialogProvider';
7
+ export type { DialogProviderProps } from './DialogProvider';
8
+ export { DialogContext, useDialogContext, useDialogContextStrict, } from './DialogContext';
9
+ export type { DialogContextValue, DialogStackItem, } from './DialogContext';
@@ -0,0 +1,103 @@
1
+ import { default as React, ReactNode } from 'react';
2
+ import { IconName } from '../../display/Icon/icons';
3
+ import { BaseComponentProps } from '../../../types';
4
+ /**
5
+ * Toast position options
6
+ */
7
+ export type ToastPosition = 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';
8
+ /**
9
+ * Toast variant types
10
+ */
11
+ export type ToastVariant = 'info' | 'success' | 'warning' | 'error' | 'loading';
12
+ /**
13
+ * Toast animation state
14
+ */
15
+ export type ToastAnimationState = 'entering' | 'entered' | 'exiting' | 'exited';
16
+ /**
17
+ * Single toast props
18
+ */
19
+ export interface ToastProps extends BaseComponentProps {
20
+ /**
21
+ * Unique toast ID
22
+ */
23
+ id: string;
24
+ /**
25
+ * Toast variant
26
+ * @default 'info'
27
+ */
28
+ variant?: ToastVariant;
29
+ /**
30
+ * Toast title
31
+ */
32
+ title?: ReactNode;
33
+ /**
34
+ * Toast message/description
35
+ */
36
+ message?: ReactNode;
37
+ /**
38
+ * Custom icon (overrides variant default)
39
+ */
40
+ icon?: IconName | ReactNode;
41
+ /**
42
+ * Hide the icon
43
+ * @default false
44
+ */
45
+ hideIcon?: boolean;
46
+ /**
47
+ * Duration in milliseconds (0 for persistent)
48
+ * @default 5000
49
+ */
50
+ duration?: number;
51
+ /**
52
+ * Whether toast can be dismissed by user
53
+ * @default true
54
+ */
55
+ dismissible?: boolean;
56
+ /**
57
+ * Action button configuration
58
+ */
59
+ action?: {
60
+ label: string;
61
+ onClick: () => void;
62
+ };
63
+ /**
64
+ * Callback when toast is dismissed
65
+ */
66
+ onDismiss?: () => void;
67
+ /**
68
+ * Whether to show progress bar for duration
69
+ * @default false
70
+ */
71
+ showProgress?: boolean;
72
+ /**
73
+ * Whether to pause duration on hover
74
+ * @default true
75
+ */
76
+ pauseOnHover?: boolean;
77
+ /**
78
+ * Custom render function for toast content
79
+ */
80
+ render?: (props: {
81
+ toast: ToastProps;
82
+ dismiss: () => void;
83
+ }) => ReactNode;
84
+ /**
85
+ * Animation state (managed by container)
86
+ */
87
+ animationState?: ToastAnimationState;
88
+ /**
89
+ * Animation duration in ms
90
+ * @default 200
91
+ */
92
+ animationDuration?: number;
93
+ /**
94
+ * Position (for animation direction)
95
+ */
96
+ position?: ToastPosition;
97
+ }
98
+ /**
99
+ * Toast component
100
+ * Single toast notification with auto-dismiss and actions
101
+ */
102
+ export declare const Toast: React.FC<ToastProps>;
103
+ export default Toast;
@@ -0,0 +1,37 @@
1
+ import { default as React, ReactNode } from 'react';
2
+ import { BaseComponentProps } from '../../../types';
3
+ import { ToastPosition } from './Toast';
4
+ /**
5
+ * Toast container props
6
+ */
7
+ export interface ToastContainerProps extends BaseComponentProps {
8
+ /**
9
+ * Position for toasts
10
+ * @default 'top-right'
11
+ */
12
+ position?: ToastPosition;
13
+ /**
14
+ * Gap between toasts in pixels
15
+ * @default 12
16
+ */
17
+ gap?: number;
18
+ /**
19
+ * Offset from viewport edge
20
+ * @default 16
21
+ */
22
+ offset?: number;
23
+ /**
24
+ * Custom z-index
25
+ */
26
+ zIndex?: number;
27
+ /**
28
+ * Children (toast elements)
29
+ */
30
+ children?: ReactNode;
31
+ }
32
+ /**
33
+ * Toast container component
34
+ * Positions and stacks toast notifications
35
+ */
36
+ export declare const ToastContainer: React.FC<ToastContainerProps>;
37
+ export default ToastContainer;
@@ -0,0 +1,126 @@
1
+ import { ToastProps, ToastPosition } from './Toast';
2
+ /**
3
+ * Toast data for creating new toasts
4
+ */
5
+ export interface ToastData extends Omit<ToastProps, 'id' | 'animationState' | 'onDismiss'> {
6
+ /**
7
+ * Optional ID (auto-generated if not provided)
8
+ */
9
+ id?: string;
10
+ }
11
+ /**
12
+ * Toast instance with full props and internal state
13
+ */
14
+ export interface ToastInstance extends ToastProps {
15
+ /**
16
+ * Timestamp when toast was created
17
+ */
18
+ createdAt: number;
19
+ /**
20
+ * Timestamp when toast was paused (if paused)
21
+ */
22
+ pausedAt?: number;
23
+ /**
24
+ * Remaining duration when paused
25
+ */
26
+ remainingDuration?: number;
27
+ }
28
+ /**
29
+ * Promise toast options
30
+ */
31
+ export interface PromiseToastOptions<T> {
32
+ /**
33
+ * Message or data to show while loading
34
+ */
35
+ loading: string | Partial<ToastData>;
36
+ /**
37
+ * Message or data to show on success
38
+ * Can be a function that receives the result
39
+ */
40
+ success: string | Partial<ToastData> | ((data: T) => string | Partial<ToastData>);
41
+ /**
42
+ * Message or data to show on error
43
+ * Can be a function that receives the error
44
+ */
45
+ error: string | Partial<ToastData> | ((error: Error) => string | Partial<ToastData>);
46
+ }
47
+ /**
48
+ * Toast context value
49
+ */
50
+ export interface ToastContextValue {
51
+ /**
52
+ * Current toast instances
53
+ */
54
+ toasts: ToastInstance[];
55
+ /**
56
+ * Add a new toast
57
+ * @returns Toast ID
58
+ */
59
+ addToast: (data: ToastData) => string;
60
+ /**
61
+ * Remove a toast by ID
62
+ */
63
+ removeToast: (id: string) => void;
64
+ /**
65
+ * Update a toast
66
+ */
67
+ updateToast: (id: string, data: Partial<ToastData>) => void;
68
+ /**
69
+ * Remove all toasts
70
+ */
71
+ removeAllToasts: () => void;
72
+ /**
73
+ * Pause a toast's timer
74
+ */
75
+ pauseToast: (id: string) => void;
76
+ /**
77
+ * Resume a toast's timer
78
+ */
79
+ resumeToast: (id: string) => void;
80
+ /**
81
+ * Show a success toast
82
+ */
83
+ success: (message: string, options?: Partial<ToastData>) => string;
84
+ /**
85
+ * Show an error toast
86
+ */
87
+ error: (message: string, options?: Partial<ToastData>) => string;
88
+ /**
89
+ * Show a warning toast
90
+ */
91
+ warning: (message: string, options?: Partial<ToastData>) => string;
92
+ /**
93
+ * Show an info toast
94
+ */
95
+ info: (message: string, options?: Partial<ToastData>) => string;
96
+ /**
97
+ * Show a loading toast
98
+ */
99
+ loading: (message: string, options?: Partial<ToastData>) => string;
100
+ /**
101
+ * Promise-based toast that shows loading, then success/error
102
+ * @returns Original promise result
103
+ */
104
+ promise: <T>(promise: Promise<T>, options: PromiseToastOptions<T>) => Promise<T>;
105
+ /**
106
+ * Container position
107
+ */
108
+ position: ToastPosition;
109
+ /**
110
+ * Maximum visible toasts
111
+ */
112
+ maxVisible: number;
113
+ }
114
+ /**
115
+ * Toast context
116
+ */
117
+ export declare const ToastContext: import('react').Context<ToastContextValue | null>;
118
+ /**
119
+ * Hook to access toast context (returns null if not in provider)
120
+ */
121
+ export declare function useToastContext(): ToastContextValue | null;
122
+ /**
123
+ * Hook to access toast context (throws if not in provider)
124
+ * @throws Error if used outside of ToastProvider
125
+ */
126
+ export declare function useToastContextStrict(): ToastContextValue;
@@ -0,0 +1,71 @@
1
+ import { ReactNode } from 'react';
2
+ import { ToastPosition } from './Toast';
3
+ import { ToastData } from './ToastContext';
4
+ /**
5
+ * Toast provider props
6
+ */
7
+ export interface ToastProviderProps {
8
+ /**
9
+ * Children to render
10
+ */
11
+ children: ReactNode;
12
+ /**
13
+ * Position for toasts
14
+ * @default 'top-right'
15
+ */
16
+ position?: ToastPosition;
17
+ /**
18
+ * Maximum number of visible toasts
19
+ * @default 5
20
+ */
21
+ maxVisible?: number;
22
+ /**
23
+ * Gap between toasts in pixels
24
+ * @default 12
25
+ */
26
+ gap?: number;
27
+ /**
28
+ * Offset from viewport edge
29
+ * @default 16
30
+ */
31
+ offset?: number;
32
+ /**
33
+ * Default duration for toasts in milliseconds
34
+ * @default 5000
35
+ */
36
+ defaultDuration?: number;
37
+ /**
38
+ * Animation duration in milliseconds
39
+ * @default 200
40
+ */
41
+ animationDuration?: number;
42
+ /**
43
+ * Default props to apply to all toasts
44
+ */
45
+ defaultToastProps?: Partial<ToastData>;
46
+ /**
47
+ * Custom z-index for toast container
48
+ */
49
+ zIndex?: number;
50
+ }
51
+ /**
52
+ * Toast provider component
53
+ * Manages a stack of toasts for programmatic creation
54
+ *
55
+ * @example
56
+ * ```tsx
57
+ * <ToastProvider position="top-right" maxVisible={5}>
58
+ * <App />
59
+ * </ToastProvider>
60
+ *
61
+ * // In a component:
62
+ * const toast = useToast();
63
+ *
64
+ * toast.success('Changes saved successfully');
65
+ * toast.error('Failed to save changes');
66
+ * ```
67
+ */
68
+ export declare function ToastProvider({ children, position, maxVisible, gap, offset, defaultDuration, animationDuration, defaultToastProps, zIndex, }: ToastProviderProps): import("react/jsx-runtime").JSX.Element;
69
+ export declare namespace ToastProvider {
70
+ var displayName: string;
71
+ }