@simplysm/solid 13.0.97 → 13.0.99

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.
@@ -0,0 +1,233 @@
1
+ # Feedback Components
2
+
3
+ Source: `src/components/feedback/**`
4
+
5
+ ## `Progress`
6
+
7
+ Progress bar component with theme colors and custom content support.
8
+
9
+ ```typescript
10
+ export interface ProgressProps extends JSX.HTMLAttributes<HTMLDivElement> {
11
+ value: number;
12
+ theme?: ProgressTheme;
13
+ size?: ComponentSize;
14
+ inset?: boolean;
15
+ }
16
+ ```
17
+
18
+ | Prop | Type | Description |
19
+ |------|------|-------------|
20
+ | `value` | `number` | Progress value (0-100) |
21
+ | `theme` | `SemanticTheme` | Bar color theme. Default: `"primary"` |
22
+ | `size` | `ComponentSize` | Padding size |
23
+ | `inset` | `boolean` | Borderless transparent background mode |
24
+
25
+ ### `ProgressTheme`
26
+
27
+ ```typescript
28
+ export type ProgressTheme = SemanticTheme;
29
+ ```
30
+
31
+ ---
32
+
33
+ ## `NotificationProvider`
34
+
35
+ Provider for the notification system. Maintains up to 50 notifications.
36
+
37
+ ### `useNotification`
38
+
39
+ ```typescript
40
+ export function useNotification(): NotificationContextValue;
41
+ ```
42
+
43
+ ### `NotificationContextValue`
44
+
45
+ ```typescript
46
+ export interface NotificationContextValue {
47
+ items: Accessor<NotificationItem[]>;
48
+ unreadCount: Accessor<number>;
49
+ latestUnread: Accessor<NotificationItem | undefined>;
50
+ info: (title: string, message?: string, options?: NotificationOptions) => string;
51
+ success: (title: string, message?: string, options?: NotificationOptions) => string;
52
+ warning: (title: string, message?: string, options?: NotificationOptions) => string;
53
+ danger: (title: string, message?: string, options?: NotificationOptions) => string;
54
+ error: (err?: any, header?: string) => void;
55
+ update: (id: string, updates: Partial<Pick<NotificationItem, "title" | "message" | "theme" | "action">>, options?: NotificationUpdateOptions) => void;
56
+ remove: (id: string) => void;
57
+ markAsRead: (id: string) => void;
58
+ markAllAsRead: () => void;
59
+ dismissBanner: () => void;
60
+ clear: () => void;
61
+ }
62
+ ```
63
+
64
+ ### `NotificationItem`
65
+
66
+ ```typescript
67
+ export interface NotificationItem {
68
+ id: string;
69
+ theme: NotificationTheme;
70
+ title: string;
71
+ message?: string;
72
+ action?: NotificationAction;
73
+ createdAt: Date;
74
+ read: boolean;
75
+ }
76
+ ```
77
+
78
+ ### `NotificationTheme`
79
+
80
+ ```typescript
81
+ export type NotificationTheme = "info" | "success" | "warning" | "danger";
82
+ ```
83
+
84
+ ### `NotificationAction`
85
+
86
+ ```typescript
87
+ export interface NotificationAction {
88
+ label: string;
89
+ onClick: () => void;
90
+ }
91
+ ```
92
+
93
+ ### `NotificationOptions`
94
+
95
+ ```typescript
96
+ export interface NotificationOptions {
97
+ action?: NotificationAction;
98
+ }
99
+ ```
100
+
101
+ ### `NotificationUpdateOptions`
102
+
103
+ ```typescript
104
+ export interface NotificationUpdateOptions {
105
+ renotify?: boolean;
106
+ }
107
+ ```
108
+
109
+ ---
110
+
111
+ ## `NotificationBell`
112
+
113
+ Bell icon button that shows unread count badge and dropdown notification list.
114
+
115
+ ```typescript
116
+ export interface NotificationBellProps {
117
+ showBanner?: boolean;
118
+ }
119
+ ```
120
+
121
+ | Prop | Type | Description |
122
+ |------|------|-------------|
123
+ | `showBanner` | `boolean` | Show notification banner. Default: `true` |
124
+
125
+ ---
126
+
127
+ ## `NotificationBanner`
128
+
129
+ Fixed-position banner showing the latest unread notification with dismiss and action buttons.
130
+
131
+ No props (reads from `NotificationContext`).
132
+
133
+ ---
134
+
135
+ ## `BusyProvider`
136
+
137
+ Provider for busy overlay state management. Supports nested show/hide calls.
138
+
139
+ ```typescript
140
+ export interface BusyProviderProps {
141
+ variant?: BusyVariant;
142
+ }
143
+ ```
144
+
145
+ ### `BusyVariant`
146
+
147
+ ```typescript
148
+ export type BusyVariant = "spinner" | "bar";
149
+ ```
150
+
151
+ ### `useBusy`
152
+
153
+ ```typescript
154
+ export function useBusy(): BusyContextValue;
155
+
156
+ export interface BusyContextValue {
157
+ variant: Accessor<BusyVariant>;
158
+ show: (message?: string) => void;
159
+ hide: () => void;
160
+ setProgress: (percent: number | undefined) => void;
161
+ }
162
+ ```
163
+
164
+ ---
165
+
166
+ ## `BusyContainer`
167
+
168
+ Inline loading overlay component with spinner or progress bar variants.
169
+
170
+ ```typescript
171
+ export interface BusyContainerProps extends Omit<JSX.HTMLAttributes<HTMLDivElement>, "children"> {
172
+ busy?: boolean;
173
+ ready?: boolean;
174
+ variant?: BusyVariant;
175
+ message?: string;
176
+ progressPercent?: number;
177
+ children?: JSX.Element;
178
+ }
179
+ ```
180
+
181
+ | Prop | Type | Description |
182
+ |------|------|-------------|
183
+ | `busy` | `boolean` | Show loading overlay (children preserved) |
184
+ | `ready` | `boolean` | If `false`, children hidden and loading shown (initial loading) |
185
+ | `variant` | `BusyVariant` | Display style. Inherits from `BusyProvider` context |
186
+ | `message` | `string` | Loading message text |
187
+ | `progressPercent` | `number` | Progress bar value (0-100) |
188
+
189
+ ---
190
+
191
+ ## `PrintProvider`
192
+
193
+ Provider for print-to-printer and print-to-PDF functionality.
194
+
195
+ ### `usePrint`
196
+
197
+ ```typescript
198
+ export function usePrint(): PrintContextValue;
199
+
200
+ export interface PrintContextValue {
201
+ toPrinter: (factory: () => JSX.Element, options?: PrintOptions) => Promise<void>;
202
+ toPdf: (factory: () => JSX.Element, options?: PrintOptions) => Promise<Uint8Array>;
203
+ }
204
+ ```
205
+
206
+ ### `PrintOptions`
207
+
208
+ ```typescript
209
+ export interface PrintOptions {
210
+ size?: string;
211
+ margin?: string;
212
+ }
213
+ ```
214
+
215
+ ### `usePrintInstance`
216
+
217
+ ```typescript
218
+ export function usePrintInstance(): PrintInstance | undefined;
219
+
220
+ export interface PrintInstance {
221
+ ready: () => void;
222
+ }
223
+ ```
224
+
225
+ ---
226
+
227
+ ## `Print`
228
+
229
+ Wrapper component for print content with page separation.
230
+
231
+ ### Sub-components
232
+
233
+ - **`Print.Page`** -- Individual print page container