@simplysm/solid 13.0.98 → 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.
package/docs/feedback.md CHANGED
@@ -1,81 +1,70 @@
1
1
  # Feedback Components
2
2
 
3
- Source: `src/components/feedback/**/*.tsx`
3
+ Source: `src/components/feedback/**`
4
4
 
5
- ## Progress
5
+ ## `Progress`
6
6
 
7
- Themed progress bar with percentage display.
7
+ Progress bar component with theme colors and custom content support.
8
8
 
9
- ```ts
10
- type ProgressTheme = SemanticTheme;
11
-
12
- interface ProgressProps extends JSX.HTMLAttributes<HTMLDivElement> {
13
- value: number; // 0-100
14
- theme?: ProgressTheme; // default: "primary"
9
+ ```typescript
10
+ export interface ProgressProps extends JSX.HTMLAttributes<HTMLDivElement> {
11
+ value: number;
12
+ theme?: ProgressTheme;
15
13
  size?: ComponentSize;
16
14
  inset?: boolean;
17
15
  }
18
16
  ```
19
17
 
20
- Children override the default percentage text display.
21
-
22
- ## NotificationProvider
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 |
23
24
 
24
- Notification system provider. Maintains up to 50 notifications.
25
+ ### `ProgressTheme`
25
26
 
26
- ```ts
27
- const NotificationProvider: ParentComponent;
27
+ ```typescript
28
+ export type ProgressTheme = SemanticTheme;
28
29
  ```
29
30
 
30
- ### useNotification()
31
+ ---
32
+
33
+ ## `NotificationProvider`
31
34
 
32
- Hook to create and manage notifications.
35
+ Provider for the notification system. Maintains up to 50 notifications.
36
+
37
+ ### `useNotification`
38
+
39
+ ```typescript
40
+ export function useNotification(): NotificationContextValue;
41
+ ```
33
42
 
34
- ```ts
35
- function useNotification(): NotificationContextValue;
43
+ ### `NotificationContextValue`
36
44
 
37
- interface NotificationContextValue {
38
- // State
45
+ ```typescript
46
+ export interface NotificationContextValue {
39
47
  items: Accessor<NotificationItem[]>;
40
48
  unreadCount: Accessor<number>;
41
49
  latestUnread: Accessor<NotificationItem | undefined>;
42
-
43
- // Create (returns id)
44
50
  info: (title: string, message?: string, options?: NotificationOptions) => string;
45
51
  success: (title: string, message?: string, options?: NotificationOptions) => string;
46
52
  warning: (title: string, message?: string, options?: NotificationOptions) => string;
47
53
  danger: (title: string, message?: string, options?: NotificationOptions) => string;
48
54
  error: (err?: any, header?: string) => void;
49
-
50
- // Update
51
- update: (
52
- id: string,
53
- updates: Partial<Pick<NotificationItem, "title" | "message" | "theme" | "action">>,
54
- options?: NotificationUpdateOptions,
55
- ) => void;
56
-
57
- // Delete
55
+ update: (id: string, updates: Partial<Pick<NotificationItem, "title" | "message" | "theme" | "action">>, options?: NotificationUpdateOptions) => void;
58
56
  remove: (id: string) => void;
59
-
60
- // Management
61
57
  markAsRead: (id: string) => void;
62
58
  markAllAsRead: () => void;
63
59
  dismissBanner: () => void;
64
60
  clear: () => void;
65
61
  }
62
+ ```
66
63
 
67
- interface NotificationOptions {
68
- action?: NotificationAction;
69
- }
70
-
71
- interface NotificationAction {
72
- label: string;
73
- onClick: () => void;
74
- }
75
-
76
- type NotificationTheme = "info" | "success" | "warning" | "danger";
64
+ ### `NotificationItem`
77
65
 
78
- interface NotificationItem {
66
+ ```typescript
67
+ export interface NotificationItem {
79
68
  id: string;
80
69
  theme: NotificationTheme;
81
70
  title: string;
@@ -86,46 +75,85 @@ interface NotificationItem {
86
75
  }
87
76
  ```
88
77
 
89
- ## NotificationBell
78
+ ### `NotificationTheme`
90
79
 
91
- Bell icon button with unread badge and dropdown notification list.
80
+ ```typescript
81
+ export type NotificationTheme = "info" | "success" | "warning" | "danger";
82
+ ```
83
+
84
+ ### `NotificationAction`
92
85
 
93
- ```ts
94
- interface NotificationBellProps {
95
- showBanner?: boolean; // show NotificationBanner (default: true)
86
+ ```typescript
87
+ export interface NotificationAction {
88
+ label: string;
89
+ onClick: () => void;
96
90
  }
97
91
  ```
98
92
 
99
- Marks all notifications as read when the dropdown opens.
93
+ ### `NotificationOptions`
100
94
 
101
- ## NotificationBanner
95
+ ```typescript
96
+ export interface NotificationOptions {
97
+ action?: NotificationAction;
98
+ }
99
+ ```
102
100
 
103
- Toast-style notification banner that appears for the latest unread notification. Typically used inside `NotificationBell`.
101
+ ### `NotificationUpdateOptions`
104
102
 
105
- ```ts
106
- const NotificationBanner: Component;
103
+ ```typescript
104
+ export interface NotificationUpdateOptions {
105
+ renotify?: boolean;
106
+ }
107
107
  ```
108
108
 
109
- ## BusyProvider
109
+ ---
110
+
111
+ ## `NotificationBell`
110
112
 
111
- Global loading overlay provider. Show/hide is nestable (counter-based).
113
+ Bell icon button that shows unread count badge and dropdown notification list.
112
114
 
113
- ```ts
114
- interface BusyProviderProps {
115
- variant?: BusyVariant; // default: "spinner"
115
+ ```typescript
116
+ export interface NotificationBellProps {
117
+ showBanner?: boolean;
116
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.
117
138
 
118
- type BusyVariant = "spinner" | "bar";
139
+ ```typescript
140
+ export interface BusyProviderProps {
141
+ variant?: BusyVariant;
142
+ }
119
143
  ```
120
144
 
121
- ### useBusy()
145
+ ### `BusyVariant`
146
+
147
+ ```typescript
148
+ export type BusyVariant = "spinner" | "bar";
149
+ ```
122
150
 
123
- Hook to control the loading overlay.
151
+ ### `useBusy`
124
152
 
125
- ```ts
126
- function useBusy(): BusyContextValue;
153
+ ```typescript
154
+ export function useBusy(): BusyContextValue;
127
155
 
128
- interface BusyContextValue {
156
+ export interface BusyContextValue {
129
157
  variant: Accessor<BusyVariant>;
130
158
  show: (message?: string) => void;
131
159
  hide: () => void;
@@ -133,16 +161,16 @@ interface BusyContextValue {
133
161
  }
134
162
  ```
135
163
 
136
- `show`/`hide` calls are stackable: the overlay hides only after all `show` calls have corresponding `hide` calls.
164
+ ---
137
165
 
138
- ## BusyContainer
166
+ ## `BusyContainer`
139
167
 
140
- Local loading overlay container. Can be used standalone or inside `BusyProvider`.
168
+ Inline loading overlay component with spinner or progress bar variants.
141
169
 
142
- ```ts
143
- interface BusyContainerProps extends Omit<JSX.HTMLAttributes<HTMLDivElement>, "children"> {
144
- busy?: boolean; // show loading overlay
145
- ready?: boolean; // false = hide children and show overlay (initial loading)
170
+ ```typescript
171
+ export interface BusyContainerProps extends Omit<JSX.HTMLAttributes<HTMLDivElement>, "children"> {
172
+ busy?: boolean;
173
+ ready?: boolean;
146
174
  variant?: BusyVariant;
147
175
  message?: string;
148
176
  progressPercent?: number;
@@ -150,61 +178,56 @@ interface BusyContainerProps extends Omit<JSX.HTMLAttributes<HTMLDivElement>, "c
150
178
  }
151
179
  ```
152
180
 
153
- - `busy=true`: overlay shown on top of children.
154
- - `ready=false`: children hidden, overlay shown.
155
- - Blocks keyboard input during busy state.
156
-
157
- ## PrintProvider
158
-
159
- Print and PDF generation provider. Uses off-screen Portal rendering.
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) |
160
188
 
161
- ```ts
162
- const PrintProvider: ParentComponent;
163
- ```
189
+ ---
164
190
 
165
- Requires `BusyProvider` as an ancestor.
191
+ ## `PrintProvider`
166
192
 
167
- ### usePrint()
193
+ Provider for print-to-printer and print-to-PDF functionality.
168
194
 
169
- Hook to print content or generate PDF.
195
+ ### `usePrint`
170
196
 
171
- ```ts
172
- function usePrint(): PrintContextValue;
197
+ ```typescript
198
+ export function usePrint(): PrintContextValue;
173
199
 
174
- interface PrintContextValue {
200
+ export interface PrintContextValue {
175
201
  toPrinter: (factory: () => JSX.Element, options?: PrintOptions) => Promise<void>;
176
202
  toPdf: (factory: () => JSX.Element, options?: PrintOptions) => Promise<Uint8Array>;
177
203
  }
178
-
179
- interface PrintOptions {
180
- size?: string; // e.g., "A4", "A3 landscape", "100mm 200mm"
181
- margin?: string; // CSS margin, default: "0"
182
- }
183
204
  ```
184
205
 
185
- - `toPrinter`: renders content off-screen, then calls `window.print()`.
186
- - `toPdf`: renders content off-screen, converts to images via `html-to-image`, generates PDF via `jsPDF`.
206
+ ### `PrintOptions`
187
207
 
188
- ### usePrintInstance()
208
+ ```typescript
209
+ export interface PrintOptions {
210
+ size?: string;
211
+ margin?: string;
212
+ }
213
+ ```
189
214
 
190
- Hook available inside print content factories. Call `ready()` to signal that async content (e.g., data loading) is complete.
215
+ ### `usePrintInstance`
191
216
 
192
- ```ts
193
- function usePrintInstance(): PrintInstance | undefined;
217
+ ```typescript
218
+ export function usePrintInstance(): PrintInstance | undefined;
194
219
 
195
- interface PrintInstance {
220
+ export interface PrintInstance {
196
221
  ready: () => void;
197
222
  }
198
223
  ```
199
224
 
200
- ## Print
225
+ ---
201
226
 
202
- Wrapper for print content.
227
+ ## `Print`
203
228
 
204
- ```ts
205
- const Print: ParentComponent;
206
- ```
229
+ Wrapper component for print content with page separation.
207
230
 
208
231
  ### Sub-components
209
232
 
210
- - **`Print.Page`** -- Page break boundary. Each `Print.Page` becomes a separate PDF page.
233
+ - **`Print.Page`** -- Individual print page container