@pk-design/react-tailwind 1.5.4 → 1.6.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 (65) hide show
  1. package/dist/react-tailwind.cjs.js +1429 -289
  2. package/dist/react-tailwind.cjs.js.map +1 -1
  3. package/dist/react-tailwind.es.js +1420 -292
  4. package/dist/react-tailwind.es.js.map +1 -1
  5. package/dist/types/components/BodyText/BodyText.d.ts +1 -1
  6. package/dist/types/components/BodyText/BodyText.types.d.ts +47 -8
  7. package/dist/types/components/Breadcrumb/Breadcrumb.d.ts +2 -3
  8. package/dist/types/components/Breadcrumb/Breadcrumb.types.d.ts +43 -10
  9. package/dist/types/components/Button/Button.types.d.ts +17 -63
  10. package/dist/types/components/ButtonGroup/ButtonGroup.types.d.ts +16 -0
  11. package/dist/types/components/Card/Card.d.ts +7 -1
  12. package/dist/types/components/Card/Card.types.d.ts +48 -42
  13. package/dist/types/components/Checkbox/Checkbox.types.d.ts +28 -1
  14. package/dist/types/components/CheckboxGroup/CheckboxGroup.types.d.ts +53 -1
  15. package/dist/types/components/DetailedInformation/DetailedInformation.d.ts +1 -1
  16. package/dist/types/components/DetailedInformation/DetailedInformation.types.d.ts +47 -3
  17. package/dist/types/components/Drawer/Drawer.types.d.ts +37 -13
  18. package/dist/types/components/Dropdown/Dropdown.types.d.ts +17 -1
  19. package/dist/types/components/HeadingText/HeadingText.d.ts +7 -7
  20. package/dist/types/components/HeadingText/HeadingText.test.d.ts +1 -0
  21. package/dist/types/components/HeadingText/HeadingText.types.d.ts +56 -3
  22. package/dist/types/components/Input/Input.d.ts +4 -2
  23. package/dist/types/components/Input/Input.types.d.ts +36 -3
  24. package/dist/types/components/Loader/index.d.ts +1 -1
  25. package/dist/types/components/PasswordInput/PasswordInput.d.ts +8 -4
  26. package/dist/types/components/PasswordInput/PasswordInput.types.d.ts +8 -0
  27. package/dist/types/components/QuantityStepper/QuantityStepper.d.ts +3 -0
  28. package/dist/types/components/QuantityStepper/QuantityStepper.test.d.ts +1 -0
  29. package/dist/types/components/QuantityStepper/QuantityStepper.types.d.ts +49 -0
  30. package/dist/types/components/QuantityStepper/index.d.ts +2 -0
  31. package/dist/types/components/Radio/Radio.d.ts +1 -1
  32. package/dist/types/components/Radio/Radio.types.d.ts +12 -2
  33. package/dist/types/components/RadioGroup/RadioGroup.d.ts +1 -1
  34. package/dist/types/components/RadioGroup/RadioGroup.types.d.ts +41 -13
  35. package/dist/types/components/RadioSwitch/RadioSwitch.d.ts +0 -4
  36. package/dist/types/components/RadioSwitch/RadioSwitch.types.d.ts +6 -31
  37. package/dist/types/components/RangeInput/RangeInput.d.ts +1 -1
  38. package/dist/types/components/RangeInput/RangeInput.types.d.ts +14 -1
  39. package/dist/types/components/RangeSlider/RangeSlider.d.ts +1 -1
  40. package/dist/types/components/RangeSlider/RangeSlider.types.d.ts +28 -13
  41. package/dist/types/components/SegmentedControl/SegmentedControl.d.ts +3 -0
  42. package/dist/types/components/SegmentedControl/SegmentedControl.test.d.ts +1 -0
  43. package/dist/types/components/SegmentedControl/SegmentedControl.types.d.ts +53 -0
  44. package/dist/types/components/SegmentedControl/index.d.ts +2 -0
  45. package/dist/types/components/SelectBox/SelectBox.types.d.ts +23 -14
  46. package/dist/types/components/Skeleton/Skeleton.d.ts +2 -0
  47. package/dist/types/components/Skeleton/Skeleton.test.d.ts +1 -0
  48. package/dist/types/components/Skeleton/Skeleton.types.d.ts +38 -0
  49. package/dist/types/components/Skeleton/index.d.ts +2 -0
  50. package/dist/types/components/StatusPill/StatusPill.d.ts +2 -0
  51. package/dist/types/components/StatusPill/StatusPill.test.d.ts +1 -0
  52. package/dist/types/components/StatusPill/StatusPill.types.d.ts +29 -0
  53. package/dist/types/components/StatusPill/index.d.ts +2 -0
  54. package/dist/types/components/StickyActionBar/StickyActionBar.d.ts +2 -0
  55. package/dist/types/components/StickyActionBar/StickyActionBar.test.d.ts +1 -0
  56. package/dist/types/components/StickyActionBar/StickyActionBar.types.d.ts +30 -0
  57. package/dist/types/components/StickyActionBar/index.d.ts +2 -0
  58. package/dist/types/components/TextContent/TextContent.d.ts +2 -2
  59. package/dist/types/components/TextContent/TextContent.types.d.ts +47 -7
  60. package/dist/types/components/Textarea/Textarea.types.d.ts +37 -3
  61. package/dist/types/components/Toast/Toast.d.ts +1 -1
  62. package/dist/types/components/Toast/Toast.types.d.ts +117 -43
  63. package/dist/types/components/Toast/ToastProvider.d.ts +3 -6
  64. package/dist/types/index.d.ts +5 -0
  65. package/package.json +1 -1
@@ -1,55 +1,100 @@
1
+ import type { ReactNode } from 'react';
2
+ /**
3
+ * Visual style variant of the toast container.
4
+ * - `accent` — default clean container with top/left accent bar
5
+ * - `filled` — solid vibrant color tile with high contrast
6
+ * - `outlined` — subtle border with badge icon
7
+ * - `glass` — modern glassmorphism with backdrop blur
8
+ */
9
+ export type ToastVariant = 'accent' | 'filled' | 'outlined' | 'glass';
10
+ /**
11
+ * Utility type mapping the 4 possible toast types.
12
+ */
13
+ export type ToastType = 'success' | 'error' | 'info' | 'warning';
1
14
  /**
2
15
  * Props passed to the Toast UI component.
3
- * This component is rendered internally by the ToastProvider.
16
+ * Managed internally by ToastProvider.
4
17
  */
5
18
  export interface ToastProps {
6
19
  /**
7
20
  * Unique identifier of the toast instance.
8
- * Generated internally by ToastProvider.
9
21
  */
10
22
  id: number;
11
23
  /**
12
- * The message text displayed inside the toast.
24
+ * Optional headline title displayed above message.
25
+ */
26
+ title?: ReactNode;
27
+ /**
28
+ * Main text message displayed inside the toast.
29
+ */
30
+ message: ReactNode;
31
+ /**
32
+ * Visual intent style of the toast.
33
+ */
34
+ type: ToastType;
35
+ /**
36
+ * Container variant style.
37
+ * Defaults to `"accent"`.
38
+ */
39
+ variant?: ToastVariant;
40
+ /**
41
+ * Optional action button.
13
42
  */
14
- message: string;
43
+ action?: {
44
+ label: string;
45
+ onClick: () => void;
46
+ };
15
47
  /**
16
- * Visual style of the toast based on its purpose.
17
- * - `success` — positive confirmations
18
- * - `error` — failures or critical issues
19
- * - `info` — general helpful information
20
- * - `warning` — caution or attention required
48
+ * Optional custom icon override slot.
21
49
  */
22
- type: 'success' | 'error' | 'info' | 'warning';
50
+ icon?: ReactNode;
51
+ /**
52
+ * Controls whether an animated auto-close progress bar is displayed.
53
+ * Defaults to `true` when autoClose is enabled.
54
+ */
55
+ showProgressBar?: boolean;
56
+ /**
57
+ * Total duration in milliseconds for progress bar countdown.
58
+ */
59
+ duration?: number;
60
+ /**
61
+ * State indicating whether auto-close countdown is paused (e.g. on hover).
62
+ */
63
+ isPaused?: boolean;
23
64
  /**
24
65
  * Triggers removal of the toast.
25
- * Managed internally by the ToastProvider.
26
66
  */
27
67
  onClose: () => void;
28
68
  /**
29
- * Optional additional class names to customize the toast container.
69
+ * Optional additional class names.
30
70
  */
31
71
  className?: string;
32
72
  }
33
73
  /**
34
- * Utility type mapping the 4 possible toast types.
35
- */
36
- export type ToastType = ToastProps['type'];
37
- /**
38
- * Options passed when calling `showToast()`.
74
+ * Options passed when calling `showToast()` or `toast.success()`.
39
75
  */
40
76
  export interface ToastOptions {
41
77
  /**
42
- * The toast visual style.
43
- * Defaults to `"info"` if not provided.
78
+ * Optional headline title above message.
79
+ */
80
+ title?: ReactNode;
81
+ /**
82
+ * The toast visual intent type.
83
+ * Defaults to `"info"`.
44
84
  */
45
85
  type?: ToastType;
86
+ /**
87
+ * Container variant style (`accent`, `filled`, `outlined`, `glass`).
88
+ * Defaults to `"accent"`.
89
+ */
90
+ variant?: ToastVariant;
46
91
  /**
47
92
  * Duration the toast stays visible (in milliseconds).
48
- * Defaults to 3000 ms.
93
+ * Defaults to 4000 ms.
49
94
  */
50
95
  duration?: number;
51
96
  /**
52
- * Should the toast automatically close after its duration?
97
+ * Should the toast automatically close after duration?
53
98
  * Defaults to `true`.
54
99
  */
55
100
  autoClose?: boolean;
@@ -58,24 +103,41 @@ export interface ToastOptions {
58
103
  * Defaults to `true`.
59
104
  */
60
105
  pauseOnHover?: boolean;
106
+ /**
107
+ * Controls whether the auto-close progress bar is shown.
108
+ * Defaults to `true`.
109
+ */
110
+ showProgressBar?: boolean;
111
+ /**
112
+ * Optional action button inside toast (e.g. `{ label: "Undo", onClick: ... }`).
113
+ */
114
+ action?: {
115
+ label: string;
116
+ onClick: () => void;
117
+ };
118
+ /**
119
+ * Optional custom icon element.
120
+ */
121
+ icon?: ReactNode;
61
122
  }
62
123
  /**
63
124
  * Internal structure stored inside the ToastProvider state.
64
- * This is NOT exposed publicly.
65
125
  */
66
126
  export interface IToast {
67
- /** Unique toast ID */
68
127
  id: number;
69
- /** Toast message */
70
- message: string;
71
- /** Toast type variant */
128
+ title?: ReactNode;
129
+ message: ReactNode;
72
130
  type: ToastType;
73
- /** Toast lifetime in milliseconds */
131
+ variant: ToastVariant;
74
132
  duration: number;
75
- /** Whether the toast will auto-close */
76
133
  autoClose: boolean;
77
- /** Whether hover pauses auto closing */
78
134
  pauseOnHover: boolean;
135
+ showProgressBar: boolean;
136
+ action?: {
137
+ label: string;
138
+ onClick: () => void;
139
+ };
140
+ icon?: ReactNode;
79
141
  }
80
142
  /**
81
143
  * The methods exposed by the ToastProvider context.
@@ -83,35 +145,47 @@ export interface IToast {
83
145
  */
84
146
  export interface ToastContextType {
85
147
  /**
86
- * Imperatively show a toast message.
87
- *
88
- * @example
89
- * showToast("Saved!", { type: "success" })
148
+ * Imperatively show a toast notification.
90
149
  */
91
- showToast: (message: string, options?: ToastOptions) => void;
150
+ showToast: (message: ReactNode, options?: ToastOptions) => number;
92
151
  /**
93
152
  * Manually closes a toast by ID.
94
- * Normally handled internally.
95
153
  */
96
154
  closeToast: (id: number) => void;
155
+ /**
156
+ * Shorthand object providing `toast.success()`, `toast.error()`, `toast.info()`, `toast.warning()`, `toast.dismiss()`, `toast.dismissAll()`.
157
+ */
158
+ toast: {
159
+ show: (message: ReactNode, options?: ToastOptions) => number;
160
+ success: (message: ReactNode, options?: ToastOptions) => number;
161
+ error: (message: ReactNode, options?: ToastOptions) => number;
162
+ info: (message: ReactNode, options?: ToastOptions) => number;
163
+ warning: (message: ReactNode, options?: ToastOptions) => number;
164
+ dismiss: (id: number) => void;
165
+ dismissAll: () => void;
166
+ };
97
167
  }
98
168
  /**
99
- * All supported toast placements.
100
- * Used by `<ToastProvider placement=\"...\"/>`
169
+ * All supported toast placements on screen.
101
170
  */
102
171
  export type ToastPlacement = 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left' | 'top-center' | 'bottom-center';
103
172
  /**
104
173
  * Props for the ToastProvider.
105
- * Wrap your application with this provider to enable toast notifications.
106
174
  */
107
175
  export interface ToastProviderProps {
176
+ children: ReactNode;
108
177
  /**
109
- * Your application or subtree where toast notifications should be available.
110
- */
111
- children: React.ReactNode;
112
- /**
113
- * Controls where toasts appear on the screen.
178
+ * Position on screen where toasts appear.
114
179
  * Defaults to `"top-right"`.
115
180
  */
116
181
  placement?: ToastPlacement;
182
+ /**
183
+ * Maximum number of toasts visible simultaneously.
184
+ * Defaults to `5`.
185
+ */
186
+ maxToasts?: number;
187
+ /**
188
+ * Optional extra container class name override.
189
+ */
190
+ className?: string;
117
191
  }
@@ -1,7 +1,4 @@
1
- import React, { type ReactNode } from 'react';
2
- import type { ToastContextType, ToastPlacement } from './Toast.types';
1
+ import React from 'react';
2
+ import type { ToastContextType, ToastProviderProps } from './Toast.types';
3
3
  export declare const useToast: () => ToastContextType;
4
- export declare const ToastProvider: React.FC<{
5
- children: ReactNode;
6
- placement?: ToastPlacement;
7
- }>;
4
+ export declare const ToastProvider: React.FC<ToastProviderProps>;
@@ -28,6 +28,11 @@ export * from './components/RadioSwitch';
28
28
  export * from './components/RangeInput';
29
29
  export * from './components/RangeSlider';
30
30
  export * from './components/SelectBox';
31
+ export * from './components/Skeleton';
32
+ export * from './components/QuantityStepper';
33
+ export * from './components/SegmentedControl';
34
+ export * from './components/StatusPill';
35
+ export * from './components/StickyActionBar';
31
36
  export * from './components/Tabs';
32
37
  export * from './components/Table';
33
38
  export * from './components/TextContent';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pk-design/react-tailwind",
3
- "version": "1.5.4",
3
+ "version": "1.6.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",