@risalabs_frontend_org/oasis-ui-kit 0.3.0 → 0.4.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 (2) hide show
  1. package/README.md +29 -13
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -338,21 +338,37 @@ closeModal('myModal');
338
338
  ```
339
339
 
340
340
  #### `Toast`
341
- Notification toast for success/error messages.
341
+ Notification toast for success/error messages. Uses a simple imperative API.
342
342
 
343
343
  ```tsx
344
- import { Toast, controlToastState } from '@risalabs_frontend_org/oasis-ui-kit';
345
-
346
- <Toast
347
- id="successToast"
348
- type="success" // "success" | "error"
349
- header="Success!"
350
- message="Your changes have been saved."
351
- />
352
-
353
- // Show toast
354
- controlToastState('successToast', true);
355
- ```
344
+ import { ToastContainer, toast } from '@risalabs_frontend_org/oasis-ui-kit';
345
+
346
+ // 1. Add ToastContainer once in your app root (e.g., App.tsx)
347
+ function App() {
348
+ return (
349
+ <>
350
+ <ToastContainer />
351
+ {/* rest of your app */}
352
+ </>
353
+ );
354
+ }
355
+
356
+ // 2. Call toast.success or toast.error anywhere in your app
357
+ toast.success("Changes saved!");
358
+ toast.error("Something went wrong");
359
+
360
+ // With optional header
361
+ toast.success("Your file has been uploaded", "Upload Complete");
362
+
363
+ // With custom duration (default: 3000ms)
364
+ toast.error("Connection failed", "Network Error", 5000);
365
+ ```
366
+
367
+ **API:**
368
+ | Method | Parameters | Description |
369
+ |--------|------------|-------------|
370
+ | `toast.success(message, header?, duration?)` | `message: string`, `header?: string`, `duration?: number` | Show success toast |
371
+ | `toast.error(message, header?, duration?)` | `message: string`, `header?: string`, `duration?: number` | Show error toast |
356
372
 
357
373
  #### `InfoIconWithTooltip`
358
374
  An info icon with popover tooltip.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@risalabs_frontend_org/oasis-ui-kit",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "RISA Oasis UI",
5
5
  "private": false,
6
6
  "main": "dist/index.js",