@choice-ui/react 1.9.6 → 1.9.8

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 (51) hide show
  1. package/dist/components/button/dist/index.d.ts +9 -2
  2. package/dist/components/button/dist/index.js +19 -45
  3. package/dist/components/checkbox/dist/index.d.ts +1 -10
  4. package/dist/components/checkbox/dist/index.js +5 -49
  5. package/dist/components/code-block/dist/index.d.ts +14 -11
  6. package/dist/components/code-block/dist/index.js +93 -120
  7. package/dist/components/colors/dist/index.d.ts +6 -39
  8. package/dist/components/colors/src/color-image-paint/color-image-paint.js +2 -2
  9. package/dist/components/dropdown/dist/index.d.ts +0 -6
  10. package/dist/components/dropdown/dist/index.js +10 -20
  11. package/dist/components/emoji-picker/dist/index.d.ts +1 -30
  12. package/dist/components/emoji-picker/dist/index.js +44 -148
  13. package/dist/components/form/src/adapters/range-adapter.js +2 -2
  14. package/dist/components/icon-button/dist/index.d.ts +1 -1
  15. package/dist/components/icon-button/dist/index.js +0 -39
  16. package/dist/components/list/dist/index.d.ts +1 -1
  17. package/dist/components/md-render/dist/index.d.ts +1 -2
  18. package/dist/components/md-render/dist/index.js +9 -5
  19. package/dist/components/menus/dist/index.d.ts +0 -5
  20. package/dist/components/menus/dist/index.js +3 -32
  21. package/dist/components/modal/dist/index.js +2 -2
  22. package/dist/components/notifications/dist/index.d.ts +5 -1
  23. package/dist/components/numeric-input/dist/index.d.ts +10 -25
  24. package/dist/components/numeric-input/dist/index.js +10 -68
  25. package/dist/components/numeric-input/src/context/numeric-input-context.d.ts +1 -0
  26. package/dist/components/numeric-input/src/hooks/use-input-interactions.d.ts +3 -1
  27. package/dist/components/numeric-input/src/hooks/use-numeric-input.d.ts +1 -0
  28. package/dist/components/numeric-input/src/hooks/use-numeric-input.js +36 -13
  29. package/dist/components/numeric-input/src/numeric-input.d.ts +1 -0
  30. package/dist/components/numeric-input/src/numeric-input.js +4 -0
  31. package/dist/components/panel/dist/index.d.ts +16 -16
  32. package/dist/components/picture-preview/dist/index.d.ts +0 -5
  33. package/dist/components/picture-preview/dist/index.js +140 -287
  34. package/dist/components/popover/dist/index.d.ts +0 -5
  35. package/dist/components/popover/dist/index.js +2 -21
  36. package/dist/components/radio/dist/index.d.ts +1 -9
  37. package/dist/components/radio/dist/index.js +6 -50
  38. package/dist/components/range/dist/index.d.ts +20 -276
  39. package/dist/components/range/dist/index.js +616 -1044
  40. package/dist/components/scroll-area/dist/index.d.ts +27 -4
  41. package/dist/components/scroll-area/dist/index.js +123 -96
  42. package/dist/components/separator/dist/index.d.ts +8 -1
  43. package/dist/components/splitter/dist/index.d.ts +1 -1
  44. package/dist/components/text-field/dist/index.d.ts +3 -2
  45. package/dist/components/text-field/dist/index.js +19 -4
  46. package/dist/components/textarea/dist/index.js +1 -3
  47. package/dist/components/tooltip/dist/index.d.ts +0 -2
  48. package/dist/components/tooltip/dist/index.js +5 -23
  49. package/package.json +1 -1
  50. package/dist/components/toast/dist/index.d.ts +0 -274
  51. package/dist/components/virtual-select/dist/index.d.ts +0 -48
@@ -1,274 +0,0 @@
1
- import { ReactNode } from 'react';
2
- import * as react from 'react';
3
-
4
- type ToastType = "info" | "success" | "warning" | "error" | "loading" | "default";
5
- type ToastVariant = "default" | "accent" | "success" | "warning" | "error" | "assistive" | "reset";
6
- type ToastPosition = "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right";
7
-
8
- interface ToastAction {
9
- label: ReactNode;
10
- onClick: () => void;
11
- }
12
- interface ToastCancel {
13
- label: ReactNode;
14
- onClick?: () => void;
15
- }
16
- /**
17
- * Props for Toaster.Item slot component
18
- */
19
- interface ToasterItemSlotProps {
20
- className?: string;
21
- style?: React.CSSProperties;
22
- children?: ReactNode;
23
- }
24
- /**
25
- * Slot component for customizing toast item container
26
- */
27
- declare const ToasterItemSlot: react.ForwardRefExoticComponent<ToasterItemSlotProps & react.RefAttributes<HTMLDivElement>>;
28
- /**
29
- * Props for Toaster.Icon slot component
30
- */
31
- interface ToasterIconSlotProps {
32
- className?: string;
33
- style?: React.CSSProperties;
34
- /** Custom render function - receives type and default icon */
35
- children?: (type: ToastType, defaultIcon: ReactNode) => ReactNode;
36
- }
37
- /**
38
- * Slot component for customizing toast icon
39
- */
40
- declare const ToasterIconSlot: react.ForwardRefExoticComponent<ToasterIconSlotProps & react.RefAttributes<HTMLDivElement>>;
41
- /**
42
- * Props for Toaster.Title slot component
43
- */
44
- interface ToasterTitleSlotProps {
45
- className?: string;
46
- style?: React.CSSProperties;
47
- }
48
- /**
49
- * Slot component for customizing toast title
50
- */
51
- declare const ToasterTitleSlot: react.ForwardRefExoticComponent<ToasterTitleSlotProps & react.RefAttributes<HTMLDivElement>>;
52
- /**
53
- * Props for Toaster.Description slot component
54
- */
55
- interface ToasterDescriptionSlotProps {
56
- className?: string;
57
- style?: React.CSSProperties;
58
- }
59
- /**
60
- * Slot component for customizing toast description
61
- */
62
- declare const ToasterDescriptionSlot: react.ForwardRefExoticComponent<ToasterDescriptionSlotProps & react.RefAttributes<HTMLDivElement>>;
63
- /**
64
- * Props for Toaster.Actions slot component
65
- */
66
- interface ToasterActionsSlotProps {
67
- className?: string;
68
- style?: React.CSSProperties;
69
- /** Custom render function for actions */
70
- children?: (action: ToastAction | undefined, cancel: ToastCancel | undefined, close: () => void) => ReactNode;
71
- }
72
- /**
73
- * Slot component for customizing toast actions
74
- */
75
- declare const ToasterActionsSlot: react.ForwardRefExoticComponent<ToasterActionsSlotProps & react.RefAttributes<HTMLDivElement>>;
76
-
77
- interface ToastData {
78
- id: string;
79
- type: ToastType;
80
- variant?: ToastVariant;
81
- /**
82
- * Title content. Supports:
83
- * - Plain string: rendered as text
84
- * - HTML string (containing tags like `<b>`, `<strong>`, etc.): rendered as HTML
85
- * - ReactNode: rendered as React component
86
- */
87
- title?: React.ReactNode;
88
- /**
89
- * Description content. Supports:
90
- * - Plain string: rendered as text
91
- * - HTML string (containing tags like `<b>`, `<strong>`, etc.): rendered as HTML
92
- * - ReactNode: rendered as React component
93
- */
94
- description?: React.ReactNode;
95
- duration?: number;
96
- icon?: React.ReactNode;
97
- action?: {
98
- label: React.ReactNode;
99
- onClick: () => void;
100
- };
101
- cancel?: {
102
- label: React.ReactNode;
103
- onClick?: () => void;
104
- };
105
- onClose?: () => void;
106
- onAutoClose?: () => void;
107
- dismissible?: boolean;
108
- /**
109
- * Show progress bar for this toast. Overrides Toaster's showProgress setting.
110
- * - `true`: Always show progress bar
111
- * - `false`: Never show progress bar
112
- * - `undefined`: Use Toaster's showProgress setting
113
- */
114
- progress?: boolean;
115
- createdAt: number;
116
- height?: number;
117
- removing?: boolean;
118
- swipeDirection?: "left" | "right" | "up" | "down";
119
- }
120
- interface ToastOptions {
121
- id?: string;
122
- variant?: ToastVariant;
123
- /**
124
- * Description content. Supports:
125
- * - Plain string: rendered as text
126
- * - HTML string (containing tags like `<b>`, `<strong>`, etc.): rendered as HTML
127
- * - ReactNode: rendered as React component
128
- */
129
- description?: React.ReactNode;
130
- duration?: number;
131
- icon?: React.ReactNode;
132
- action?: {
133
- label: React.ReactNode;
134
- onClick: () => void;
135
- };
136
- cancel?: {
137
- label: React.ReactNode;
138
- onClick?: () => void;
139
- };
140
- onClose?: () => void;
141
- onAutoClose?: () => void;
142
- dismissible?: boolean;
143
- /**
144
- * Show progress bar for this toast. Overrides Toaster's showProgress setting.
145
- * - `true`: Always show progress bar
146
- * - `false`: Never show progress bar
147
- * - `undefined`: Use Toaster's showProgress setting
148
- */
149
- progress?: boolean;
150
- }
151
- interface PromiseOptions<T> {
152
- loading: string | (ToastOptions & {
153
- title: string;
154
- });
155
- success: string | (ToastOptions & {
156
- title: string;
157
- }) | ((data: T) => string | (ToastOptions & {
158
- title: string;
159
- }));
160
- error: string | (ToastOptions & {
161
- title: string;
162
- }) | ((err: unknown) => string | (ToastOptions & {
163
- title: string;
164
- }));
165
- }
166
- type ToastFunction = {
167
- (title: string, options?: ToastOptions): string;
168
- success: (title: string, options?: ToastOptions) => string;
169
- error: (title: string, options?: ToastOptions) => string;
170
- warning: (title: string, options?: ToastOptions) => string;
171
- info: (title: string, options?: ToastOptions) => string;
172
- loading: (title: string, options?: ToastOptions) => string;
173
- promise: <T>(promise: Promise<T>, options: PromiseOptions<T>) => Promise<T>;
174
- dismiss: (id: string) => void;
175
- dismissAll: () => void;
176
- use: (toasterId: string) => {
177
- (title: string, options?: ToastOptions): string;
178
- success: (title: string, options?: ToastOptions) => string;
179
- error: (title: string, options?: ToastOptions) => string;
180
- warning: (title: string, options?: ToastOptions) => string;
181
- info: (title: string, options?: ToastOptions) => string;
182
- loading: (title: string, options?: ToastOptions) => string;
183
- promise: <T>(promise: Promise<T>, options: PromiseOptions<T>) => Promise<T>;
184
- dismiss: (id: string) => void;
185
- dismissAll: () => void;
186
- };
187
- };
188
- declare const toast: ToastFunction;
189
-
190
- interface ToasterProps {
191
- /**
192
- * Unique ID for this Toaster instance
193
- * Use this to have multiple Toaster instances in the same app
194
- * @default "default"
195
- */
196
- id?: string;
197
- /**
198
- * Position of the toaster
199
- * @default "bottom-right"
200
- */
201
- position?: ToastPosition;
202
- /**
203
- * Render toasts into a custom container
204
- */
205
- container?: HTMLElement | null;
206
- /**
207
- * Label for accessibility
208
- * @default "Notifications"
209
- */
210
- label?: string;
211
- /**
212
- * Whether to use a portal for rendering
213
- * @default true
214
- */
215
- portal?: boolean;
216
- /**
217
- * Offset from viewport edges in pixels
218
- * @default 16
219
- */
220
- offset?: number;
221
- /**
222
- * Default duration for toasts in ms
223
- * @default 5000
224
- */
225
- duration?: number;
226
- /**
227
- * Maximum number of visible toasts
228
- * @default 3
229
- */
230
- visibleToasts?: number;
231
- /**
232
- * Additional class name
233
- */
234
- className?: string;
235
- /**
236
- * Children - use Toaster.Item to customize toast rendering
237
- */
238
- children?: ReactNode;
239
- /**
240
- * Show countdown progress bar at the bottom of each toast
241
- * @default false
242
- */
243
- showProgress?: boolean;
244
- /**
245
- * Layout mode for toasts
246
- * @default "default"
247
- */
248
- layout?: "default" | "compact";
249
- }
250
- interface ToasterComponent extends React.MemoExoticComponent<React.ForwardRefExoticComponent<ToasterProps & React.RefAttributes<HTMLDivElement>>> {
251
- Item: typeof ToasterItemSlot;
252
- Icon: typeof ToasterIconSlot;
253
- Title: typeof ToasterTitleSlot;
254
- Description: typeof ToasterDescriptionSlot;
255
- Actions: typeof ToasterActionsSlot;
256
- }
257
- /**
258
- * Toaster component with compound pattern
259
- *
260
- * @example
261
- * ```tsx
262
- * <Toaster id="my-toaster">
263
- * <Toaster.Item className="custom-class">
264
- * <Toaster.Icon>{(type, defaultIcon) => <CustomIcon type={type} />}</Toaster.Icon>
265
- * <Toaster.Title className="font-bold uppercase" />
266
- * <Toaster.Description className="text-sm" />
267
- * <Toaster.Actions>{(action, cancel, close) => <CustomActions />}</Toaster.Actions>
268
- * </Toaster.Item>
269
- * </Toaster>
270
- * ```
271
- */
272
- declare const Toaster: ToasterComponent;
273
-
274
- export { type ToastData, type ToastOptions, type ToastPosition, type ToastType, type ToastVariant, Toaster, type ToasterProps, toast };
@@ -1,48 +0,0 @@
1
- import { MenuContextContent, MenuDivider, MenuEmpty, MenuContextItem, MenuSearch, MenuTrigger, MenuValue } from '../../menus/src';
2
- import { FloatingFocusManagerProps } from '@floating-ui/react';
3
- import { default as React } from 'react';
4
- interface VirtualSelectOption<T = unknown> {
5
- value: string;
6
- label: string;
7
- disabled?: boolean;
8
- data?: T;
9
- }
10
- interface VirtualSelectProps<T = unknown> {
11
- className?: string;
12
- closeOnEscape?: boolean;
13
- disabled?: boolean;
14
- emptyText?: string;
15
- focusManagerProps?: Partial<FloatingFocusManagerProps>;
16
- matchTriggerWidth?: boolean;
17
- maxHeight?: number;
18
- onChange?: (value: string) => void;
19
- onOpenChange?: (open: boolean) => void;
20
- open?: boolean;
21
- options: VirtualSelectOption<T>[];
22
- overscan?: number;
23
- placeholder?: string;
24
- placement?: "bottom-start" | "bottom-end";
25
- portalId?: string;
26
- readOnly?: boolean;
27
- renderOption?: (option: VirtualSelectOption<T>, isSelected: boolean) => React.ReactNode;
28
- renderValue?: (option: VirtualSelectOption<T> | null) => React.ReactNode;
29
- root?: HTMLElement | null;
30
- searchPlaceholder?: string;
31
- size?: "default" | "large";
32
- value?: string | null;
33
- variant?: "default" | "light" | "reset";
34
- }
35
- interface VirtualSelectComponentType {
36
- <T = unknown>(props: VirtualSelectProps<T>): React.ReactElement | null;
37
- displayName?: string;
38
- Content: typeof MenuContextContent;
39
- Divider: typeof MenuDivider;
40
- Empty: typeof MenuEmpty;
41
- Item: typeof MenuContextItem;
42
- Search: typeof MenuSearch;
43
- Trigger: typeof MenuTrigger;
44
- Value: typeof MenuValue;
45
- }
46
- declare const VirtualSelect: VirtualSelectComponentType;
47
-
48
- export { VirtualSelect, type VirtualSelectOption, type VirtualSelectProps };