@pk-design/react-tailwind 1.10.3 → 1.11.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/cjs/components/SegmentedControl/SegmentedControl.js +6 -2
- package/dist/cjs/components/SegmentedControl/SegmentedControl.js.map +1 -1
- package/dist/cjs/components/Toast/Toast.js +3 -1
- package/dist/cjs/components/Toast/Toast.js.map +1 -1
- package/dist/cjs/components/Toast/ToastProvider.js +10 -5
- package/dist/cjs/components/Toast/ToastProvider.js.map +1 -1
- package/dist/es/components/SegmentedControl/SegmentedControl.js +6 -2
- package/dist/es/components/SegmentedControl/SegmentedControl.js.map +1 -1
- package/dist/es/components/Toast/Toast.js +3 -1
- package/dist/es/components/Toast/Toast.js.map +1 -1
- package/dist/es/components/Toast/ToastProvider.js +10 -5
- package/dist/es/components/Toast/ToastProvider.js.map +1 -1
- package/dist/react-tailwind.cjs.js +19 -9
- package/dist/react-tailwind.cjs.js.map +1 -1
- package/dist/react-tailwind.es.js +19 -9
- package/dist/react-tailwind.es.js.map +1 -1
- package/dist/types/components/Toast/Toast.types.d.ts +18 -2
- package/package.json +1 -1
|
@@ -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`.
|