@pk-design/react-tailwind 1.10.3 → 1.11.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.
@@ -1,3 +1,4 @@
1
+ import type { ResponsiveValue } from '../../hooks/use-breakpoint';
1
2
  import type { ReactNode } from 'react';
2
3
  /**
3
4
  * Visual style variant of the toast container.
@@ -172,13 +173,28 @@ export type ToastPlacement = 'top-right' | 'top-left' | 'bottom-right' | 'bottom
172
173
  /**
173
174
  * Props for the ToastProvider.
174
175
  */
176
+ /** Distance from the viewport edge, as CSS lengths (e.g. `'calc(var(--app-bottom-inset) + 0.75rem)'`). */
177
+ export interface ToastOffset {
178
+ /** Used by top placements. */
179
+ top?: string;
180
+ /** Used by bottom placements. */
181
+ bottom?: string;
182
+ }
175
183
  export interface ToastProviderProps {
176
184
  children: ReactNode;
177
185
  /**
178
- * Position on screen where toasts appear.
186
+ * Position on screen where toasts appear. Pass `{ base, md, lg }` to change it per
187
+ * breakpoint, e.g. `{ base: 'bottom-center', md: 'top-right' }` for toasts above a
188
+ * phone's bottom bar and in the corner on wider screens.
179
189
  * Defaults to `"top-right"`.
180
190
  */
181
- placement?: ToastPlacement;
191
+ placement?: ResponsiveValue<ToastPlacement>;
192
+ /**
193
+ * Overrides the default distance from the top or bottom edge, e.g. to sit above an
194
+ * app's fixed bottom navigation. Defaults keep the built-in spacing (bottom placements
195
+ * also clear the home-indicator safe area).
196
+ */
197
+ offset?: ToastOffset;
182
198
  /**
183
199
  * Maximum number of toasts visible simultaneously.
184
200
  * Defaults to `5`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pk-design/react-tailwind",
3
- "version": "1.10.3",
3
+ "version": "1.11.0",
4
4
  "main": "dist/react-tailwind.cjs.js",
5
5
  "module": "dist/react-tailwind.es.js",
6
6
  "types": "dist/types/index.d.ts",