@simplysm/solid 13.0.96 → 13.0.98
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/README.md +314 -123
- package/docs/data.md +216 -0
- package/docs/disclosure.md +164 -0
- package/docs/display.md +94 -0
- package/docs/features.md +211 -625
- package/docs/feedback.md +210 -0
- package/docs/form-control.md +537 -0
- package/docs/helpers.md +168 -0
- package/docs/hooks.md +143 -0
- package/docs/layout.md +182 -0
- package/docs/providers.md +177 -0
- package/docs/styles.md +127 -0
- package/package.json +19 -26
- package/docs/display-feedback.md +0 -404
- package/docs/form-controls.md +0 -587
- package/docs/layout-data.md +0 -392
- package/docs/providers-hooks.md +0 -516
package/docs/feedback.md
ADDED
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
# Feedback Components
|
|
2
|
+
|
|
3
|
+
Source: `src/components/feedback/**/*.tsx`
|
|
4
|
+
|
|
5
|
+
## Progress
|
|
6
|
+
|
|
7
|
+
Themed progress bar with percentage display.
|
|
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"
|
|
15
|
+
size?: ComponentSize;
|
|
16
|
+
inset?: boolean;
|
|
17
|
+
}
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Children override the default percentage text display.
|
|
21
|
+
|
|
22
|
+
## NotificationProvider
|
|
23
|
+
|
|
24
|
+
Notification system provider. Maintains up to 50 notifications.
|
|
25
|
+
|
|
26
|
+
```ts
|
|
27
|
+
const NotificationProvider: ParentComponent;
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### useNotification()
|
|
31
|
+
|
|
32
|
+
Hook to create and manage notifications.
|
|
33
|
+
|
|
34
|
+
```ts
|
|
35
|
+
function useNotification(): NotificationContextValue;
|
|
36
|
+
|
|
37
|
+
interface NotificationContextValue {
|
|
38
|
+
// State
|
|
39
|
+
items: Accessor<NotificationItem[]>;
|
|
40
|
+
unreadCount: Accessor<number>;
|
|
41
|
+
latestUnread: Accessor<NotificationItem | undefined>;
|
|
42
|
+
|
|
43
|
+
// Create (returns id)
|
|
44
|
+
info: (title: string, message?: string, options?: NotificationOptions) => string;
|
|
45
|
+
success: (title: string, message?: string, options?: NotificationOptions) => string;
|
|
46
|
+
warning: (title: string, message?: string, options?: NotificationOptions) => string;
|
|
47
|
+
danger: (title: string, message?: string, options?: NotificationOptions) => string;
|
|
48
|
+
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
|
|
58
|
+
remove: (id: string) => void;
|
|
59
|
+
|
|
60
|
+
// Management
|
|
61
|
+
markAsRead: (id: string) => void;
|
|
62
|
+
markAllAsRead: () => void;
|
|
63
|
+
dismissBanner: () => void;
|
|
64
|
+
clear: () => void;
|
|
65
|
+
}
|
|
66
|
+
|
|
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";
|
|
77
|
+
|
|
78
|
+
interface NotificationItem {
|
|
79
|
+
id: string;
|
|
80
|
+
theme: NotificationTheme;
|
|
81
|
+
title: string;
|
|
82
|
+
message?: string;
|
|
83
|
+
action?: NotificationAction;
|
|
84
|
+
createdAt: Date;
|
|
85
|
+
read: boolean;
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## NotificationBell
|
|
90
|
+
|
|
91
|
+
Bell icon button with unread badge and dropdown notification list.
|
|
92
|
+
|
|
93
|
+
```ts
|
|
94
|
+
interface NotificationBellProps {
|
|
95
|
+
showBanner?: boolean; // show NotificationBanner (default: true)
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Marks all notifications as read when the dropdown opens.
|
|
100
|
+
|
|
101
|
+
## NotificationBanner
|
|
102
|
+
|
|
103
|
+
Toast-style notification banner that appears for the latest unread notification. Typically used inside `NotificationBell`.
|
|
104
|
+
|
|
105
|
+
```ts
|
|
106
|
+
const NotificationBanner: Component;
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## BusyProvider
|
|
110
|
+
|
|
111
|
+
Global loading overlay provider. Show/hide is nestable (counter-based).
|
|
112
|
+
|
|
113
|
+
```ts
|
|
114
|
+
interface BusyProviderProps {
|
|
115
|
+
variant?: BusyVariant; // default: "spinner"
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
type BusyVariant = "spinner" | "bar";
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### useBusy()
|
|
122
|
+
|
|
123
|
+
Hook to control the loading overlay.
|
|
124
|
+
|
|
125
|
+
```ts
|
|
126
|
+
function useBusy(): BusyContextValue;
|
|
127
|
+
|
|
128
|
+
interface BusyContextValue {
|
|
129
|
+
variant: Accessor<BusyVariant>;
|
|
130
|
+
show: (message?: string) => void;
|
|
131
|
+
hide: () => void;
|
|
132
|
+
setProgress: (percent: number | undefined) => void;
|
|
133
|
+
}
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
`show`/`hide` calls are stackable: the overlay hides only after all `show` calls have corresponding `hide` calls.
|
|
137
|
+
|
|
138
|
+
## BusyContainer
|
|
139
|
+
|
|
140
|
+
Local loading overlay container. Can be used standalone or inside `BusyProvider`.
|
|
141
|
+
|
|
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)
|
|
146
|
+
variant?: BusyVariant;
|
|
147
|
+
message?: string;
|
|
148
|
+
progressPercent?: number;
|
|
149
|
+
children?: JSX.Element;
|
|
150
|
+
}
|
|
151
|
+
```
|
|
152
|
+
|
|
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.
|
|
160
|
+
|
|
161
|
+
```ts
|
|
162
|
+
const PrintProvider: ParentComponent;
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
Requires `BusyProvider` as an ancestor.
|
|
166
|
+
|
|
167
|
+
### usePrint()
|
|
168
|
+
|
|
169
|
+
Hook to print content or generate PDF.
|
|
170
|
+
|
|
171
|
+
```ts
|
|
172
|
+
function usePrint(): PrintContextValue;
|
|
173
|
+
|
|
174
|
+
interface PrintContextValue {
|
|
175
|
+
toPrinter: (factory: () => JSX.Element, options?: PrintOptions) => Promise<void>;
|
|
176
|
+
toPdf: (factory: () => JSX.Element, options?: PrintOptions) => Promise<Uint8Array>;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
interface PrintOptions {
|
|
180
|
+
size?: string; // e.g., "A4", "A3 landscape", "100mm 200mm"
|
|
181
|
+
margin?: string; // CSS margin, default: "0"
|
|
182
|
+
}
|
|
183
|
+
```
|
|
184
|
+
|
|
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`.
|
|
187
|
+
|
|
188
|
+
### usePrintInstance()
|
|
189
|
+
|
|
190
|
+
Hook available inside print content factories. Call `ready()` to signal that async content (e.g., data loading) is complete.
|
|
191
|
+
|
|
192
|
+
```ts
|
|
193
|
+
function usePrintInstance(): PrintInstance | undefined;
|
|
194
|
+
|
|
195
|
+
interface PrintInstance {
|
|
196
|
+
ready: () => void;
|
|
197
|
+
}
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
## Print
|
|
201
|
+
|
|
202
|
+
Wrapper for print content.
|
|
203
|
+
|
|
204
|
+
```ts
|
|
205
|
+
const Print: ParentComponent;
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
### Sub-components
|
|
209
|
+
|
|
210
|
+
- **`Print.Page`** -- Page break boundary. Each `Print.Page` becomes a separate PDF page.
|