twd-js 1.5.2 → 1.6.1

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/dist/index.d.ts CHANGED
@@ -437,6 +437,32 @@ declare interface TWDAPI {
437
437
  * ```
438
438
  */
439
439
  notExists: (selector: string) => Promise<void>;
440
+ /**
441
+ * Simulates a viewport size by constraining body dimensions, overriding
442
+ * `window.innerWidth`/`window.innerHeight` and `window.matchMedia()`, and
443
+ * rewriting CSS `@media` rules to match the simulated dimensions.
444
+ * Call with no arguments to reset to the original viewport.
445
+ *
446
+ * @param width Viewport width in pixels
447
+ * @param height Viewport height in pixels (optional — omit to leave height unconstrained)
448
+ *
449
+ * @example
450
+ * ```ts
451
+ * twd.viewport(375, 667); // mobile
452
+ * twd.viewport(768); // tablet width, height unconstrained
453
+ * twd.viewport(); // reset
454
+ * ```
455
+ */
456
+ viewport: (width?: number, height?: number) => void;
457
+ /**
458
+ * Resets the viewport to its original size (undoes a previous `twd.viewport()` call).
459
+ *
460
+ * @example
461
+ * ```ts
462
+ * twd.resetViewport();
463
+ * ```
464
+ */
465
+ resetViewport: () => void;
440
466
  }
441
467
 
442
468
  /**
@@ -470,7 +496,7 @@ declare interface TWDElemAPI {
470
496
  should: ShouldFn;
471
497
  }
472
498
 
473
- export declare const TWDSidebar: ({ open, position }: TWDSidebarProps) => JSX.Element;
499
+ export declare const TWDSidebar: ({ open, position, search }: TWDSidebarProps) => JSX.Element;
474
500
 
475
501
  declare interface TWDSidebarProps {
476
502
  /**
@@ -485,6 +511,10 @@ declare interface TWDSidebarProps {
485
511
  * @default "left"
486
512
  */
487
513
  position?: "left" | "right";
514
+ /**
515
+ * Whether to show the search/filter input
516
+ */
517
+ search?: boolean;
488
518
  }
489
519
 
490
520
  /**