@pixpilot/shadcn-ui 0.0.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 pixpilot
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,3 @@
1
+ # @pixpilot/shadcn-ui
2
+
3
+ ## Usage Add usage instructions here.
@@ -0,0 +1,477 @@
1
+ import { Button as Button$1, Calendar, Card, Command, FileUploadProps, PopoverContent as PopoverContent$1, Select as Select$1, Slider as Slider$1, Tooltip, buttonVariants, cn } from "@pixpilot/shadcn";
2
+ import React$1, { ComponentProps, ReactNode } from "react";
3
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
4
+ import { VariantProps } from "class-variance-authority";
5
+ import "@ebay/nice-modal-react";
6
+ import { ThemeProvider as ThemeProvider$1, useTheme } from "next-themes";
7
+
8
+ //#region src/AbsoluteFill.d.ts
9
+ /**
10
+ * Stretched element to enable tooltips on disabled buttons
11
+ * When a button is disabled, tooltips don't work by default.
12
+ * This element is positioned absolutely over the button to capture events.
13
+ */
14
+ declare function AbsoluteFill(props: React$1.HTMLAttributes<HTMLDivElement> & {
15
+ ref?: React$1.Ref<HTMLDivElement>;
16
+ }): react_jsx_runtime0.JSX.Element;
17
+ declare namespace AbsoluteFill {
18
+ var displayName: string;
19
+ }
20
+ //#endregion
21
+ //#region src/Alert.d.ts
22
+ type AlertVariant = 'error' | 'info' | 'warning' | 'success' | 'default';
23
+ interface AlertBaseProps {
24
+ variant?: AlertVariant;
25
+ description?: string;
26
+ duration?: number;
27
+ title?: string;
28
+ className?: string;
29
+ icon?: React$1.JSX.Element | boolean;
30
+ }
31
+ interface AlertProps extends React$1.HTMLAttributes<HTMLDivElement>, AlertBaseProps {}
32
+ declare const Alert: React$1.FC<AlertProps>;
33
+ //#endregion
34
+ //#region src/Button.d.ts
35
+ interface ButtonLoaderProps {
36
+ /**
37
+ * Position of the loader relative to button content
38
+ * @default 'end'
39
+ */
40
+ placement?: 'start' | 'end' | 'center';
41
+ }
42
+ interface ButtonProps extends React$1.ComponentProps<typeof Button$1>, VariantProps<typeof buttonVariants> {
43
+ /**
44
+ * Tooltip message to show when button is disabled
45
+ */
46
+ disabledTooltip?: string;
47
+ /**
48
+ * Regular tooltip message
49
+ */
50
+ tooltip?: string;
51
+ /**
52
+ * Loading state
53
+ */
54
+ loading?: boolean;
55
+ /**
56
+ * Loader configuration
57
+ */
58
+ LoaderProps?: ButtonLoaderProps;
59
+ /**
60
+ * Click handler for when disabled button is clicked
61
+ */
62
+ onDisabledClick?: (e: React$1.MouseEvent<HTMLDivElement>) => void;
63
+ /**
64
+ * Props to pass to the tooltip component
65
+ */
66
+ TooltipProps?: Omit<React$1.ComponentProps<typeof Tooltip>, 'children' | 'delayDuration'>;
67
+ }
68
+ declare function Button(props: ButtonProps & {
69
+ ref?: React$1.Ref<HTMLButtonElement>;
70
+ }): react_jsx_runtime0.JSX.Element;
71
+ declare namespace Button {
72
+ var displayName: string;
73
+ }
74
+ //#endregion
75
+ //#region src/CloseButtonRounded.d.ts
76
+ interface CloseButtonRoundedProps extends React$1.ComponentProps<typeof Button$1> {}
77
+ declare const CloseButtonRounded: React$1.FC<CloseButtonRoundedProps>;
78
+ //#endregion
79
+ //#region src/CloseButtonAbsolute.d.ts
80
+ interface PopoverCloseButtonProps extends React$1.ComponentProps<typeof CloseButtonRounded> {}
81
+ declare const CloseButtonAbsolute: React$1.FC<PopoverCloseButtonProps>;
82
+ //#endregion
83
+ //#region src/CommandOptionList.d.ts
84
+ interface CommandOptionListItem {
85
+ value: string;
86
+ label: string;
87
+ }
88
+ interface CommandOptionListProps {
89
+ emptyText?: string;
90
+ options: CommandOptionListItem[];
91
+ value?: unknown;
92
+ onChange?: (value: any) => void;
93
+ }
94
+ declare const CommandOptionList: React.FC<CommandOptionListProps>;
95
+ //#endregion
96
+ //#region src/Combobox.d.ts
97
+ type ComboboxProps = {
98
+ value?: string;
99
+ onChange?: (value: string) => void;
100
+ options?: CommandOptionListItem[];
101
+ placeholder?: string;
102
+ searchPlaceholder?: string;
103
+ emptyText?: string;
104
+ } & Omit<ComponentProps<typeof Command>, 'value' | 'onValueChange'>;
105
+ declare const Combobox: React$1.FC<ComboboxProps>;
106
+ //#endregion
107
+ //#region src/confirmation-dialog/ConfirmationDialog.d.ts
108
+ interface ConfirmationDialogProps {
109
+ title: string;
110
+ description?: string;
111
+ confirmText?: string;
112
+ cancelText?: string;
113
+ onConfirm?: () => void;
114
+ onCancel?: () => void;
115
+ }
116
+ //#endregion
117
+ //#region src/confirmation-dialog/confirmation-dialogs.d.ts
118
+ interface ConfirmDialog extends ConfirmationDialogProps {}
119
+ declare function showConfirmDialog(props: ConfirmDialog): Promise<boolean>;
120
+ //#endregion
121
+ //#region src/confirmation-dialog/DialogProvider.d.ts
122
+ interface DialogProviderProps {
123
+ children?: React$1.ReactNode;
124
+ }
125
+ declare const DialogProvider: React$1.FC<DialogProviderProps>;
126
+ //#endregion
127
+ //#region src/ContentCard.d.ts
128
+ interface SectionCardProps extends React$1.ComponentProps<typeof Card> {
129
+ title?: string;
130
+ children: ReactNode;
131
+ marginBottom?: boolean;
132
+ }
133
+ declare function ContentCard(props: SectionCardProps): react_jsx_runtime0.JSX.Element;
134
+ declare namespace ContentCard {
135
+ var displayName: string;
136
+ }
137
+ //#endregion
138
+ //#region src/DatePicker.d.ts
139
+ type BaseDatePickerProps = {
140
+ value?: Date;
141
+ onChange?: (date: Date | undefined) => void;
142
+ placeholder?: string;
143
+ } & Omit<ComponentProps<typeof Calendar>, 'selected' | 'onSelect' | 'mode'>;
144
+ declare function DatePicker(props: BaseDatePickerProps): react_jsx_runtime0.JSX.Element;
145
+ declare namespace DatePicker {
146
+ var displayName: string;
147
+ }
148
+ //#endregion
149
+ //#region src/FileUploadInline.d.ts
150
+ interface FileUploadInlineProps extends Omit<FileUploadProps, 'value'> {
151
+ /**
152
+ * The current file value (single file or array)
153
+ */
154
+ value?: File | File[] | null;
155
+ /**
156
+ * Callback when file changes
157
+ */
158
+ onChange?: (file: File | File[] | null) => void;
159
+ /**
160
+ * Button text when no file is selected
161
+ */
162
+ buttonText?: string;
163
+ /**
164
+ * Show file icon
165
+ */
166
+ showIcon?: boolean;
167
+ /**
168
+ * Whether to show a clear button when a file is selected
169
+ */
170
+ showClear?: boolean;
171
+ /**
172
+ * Custom class name for the container
173
+ */
174
+ className?: string;
175
+ /**
176
+ * Accepted file types
177
+ */
178
+ accept?: string;
179
+ /**
180
+ * Whether the input is disabled
181
+ */
182
+ disabled?: boolean;
183
+ /**
184
+ * Maximum file size in bytes
185
+ */
186
+ maxSize?: number;
187
+ /**
188
+ * Maximum number of files (for multiple uploads)
189
+ */
190
+ maxFiles?: number;
191
+ /**
192
+ * Allow multiple file selection
193
+ */
194
+ multiple?: boolean;
195
+ }
196
+ /**
197
+ * FileUploadInline - An inline file upload component using FileUpload primitives
198
+ *
199
+ * Features:
200
+ * - Shows a "Browse file" or custom button text
201
+ * - Displays selected filename with truncation
202
+ * - Uses FileUpload component primitives for proper file handling
203
+ * - Clean inline design
204
+ */
205
+ declare function FileUploadInline({
206
+ value,
207
+ onChange,
208
+ buttonText,
209
+ showIcon,
210
+ showClear,
211
+ className,
212
+ accept,
213
+ disabled,
214
+ maxSize,
215
+ maxFiles,
216
+ multiple,
217
+ ...rest
218
+ }: FileUploadInlineProps): react_jsx_runtime0.JSX.Element;
219
+ //#endregion
220
+ //#region src/Loader.d.ts
221
+ interface LoaderProps {
222
+ backdrop?: boolean;
223
+ /**
224
+ * Position of the loader
225
+ * @default 'center'
226
+ */
227
+ placement?: 'top' | 'bottom' | 'center';
228
+ loading: boolean;
229
+ message?: string;
230
+ /**
231
+ * Delay in milliseconds before showing the loader
232
+ * @default 300
233
+ */
234
+ delay?: number;
235
+ }
236
+ declare const Loader: React$1.FC<LoaderProps>;
237
+ //#endregion
238
+ //#region src/Pagination/Pagination.d.ts
239
+ interface PaginationProps {
240
+ /**
241
+ * Current page number (1-indexed)
242
+ */
243
+ page: number;
244
+ /**
245
+ * Total number of pages
246
+ */
247
+ totalPages: number;
248
+ /**
249
+ * Callback when page changes
250
+ */
251
+ onPageChange: (event: React$1.ChangeEvent<unknown>, page: number) => void;
252
+ /**
253
+ * Maximum number of page numbers to display (excluding ellipsis)
254
+ * For example, with maxVisiblePages=4 and 10 total pages:
255
+ * - Page 1: <1 2 3 ... 10>
256
+ * - Page 5: <1 ... 5 ... 10>
257
+ * - Page 10: <1 ... 8 9 10>
258
+ * Set to 0 to hide page numbers entirely (only show prev/next buttons)
259
+ *
260
+ * @default 4
261
+ */
262
+ maxVisiblePages?: number;
263
+ /**
264
+ * Display variant:
265
+ * - 'full': Shows page numbers with prev/next (e.g., < 1 2 3 ... 10 >)
266
+ * - 'simple': Only shows prev/next buttons (e.g., < >)
267
+ * - 'compact': Shows page indicator with all nav buttons (e.g., << < 2/10 > >>)
268
+ *
269
+ * @default 'full'
270
+ */
271
+ variant?: 'full' | 'simple' | 'compact';
272
+ /**
273
+ * Size of the pagination component
274
+ * @default 'medium'
275
+ */
276
+ size?: 'small' | 'medium' | 'large';
277
+ /**
278
+ * Whether to show first/last page buttons
279
+ * @default true
280
+ */
281
+ showFirstLastButtons?: boolean;
282
+ /**
283
+ * Whether to show page info text (e.g., "Page 1 of 10")
284
+ * Only used with 'simple' variant
285
+ * @default false
286
+ */
287
+ showPageInfo?: boolean;
288
+ className?: string;
289
+ }
290
+ /**
291
+ * Reusable pagination component with configurable page number display.
292
+ *
293
+ * @example
294
+ * // Full variant - default with page numbers
295
+ * <Pagination
296
+ * page={currentPage}
297
+ * totalPages={totalPages}
298
+ * onPageChange={handlePageChange}
299
+ * variant="full"
300
+ * />
301
+ *
302
+ * @example
303
+ * // Compact variant - page indicator with first/prev/next/last buttons
304
+ * <Pagination
305
+ * page={currentPage}
306
+ * totalPages={totalPages}
307
+ * onPageChange={handlePageChange}
308
+ * variant="compact"
309
+ * />
310
+ *
311
+ * @example
312
+ * // Simple variant - only prev/next buttons
313
+ * <Pagination
314
+ * page={currentPage}
315
+ * totalPages={totalPages}
316
+ * onPageChange={handlePageChange}
317
+ * variant="simple"
318
+ * showPageInfo={true}
319
+ * />
320
+ */
321
+ declare const Pagination: React$1.FC<PaginationProps>;
322
+ //#endregion
323
+ //#region src/PopoverContent.d.ts
324
+ interface PopoverContentProps extends React$1.ComponentProps<typeof PopoverContent$1> {}
325
+ declare const PopoverContent: React$1.FC<PopoverContentProps>;
326
+ //#endregion
327
+ //#region src/Select.d.ts
328
+ interface Option {
329
+ value: string | number;
330
+ label: string;
331
+ }
332
+ type BaseSelectProps = {
333
+ options?: Option[];
334
+ value?: string;
335
+ onChange?: (value: string) => void;
336
+ placeholder?: string;
337
+ } & Omit<ComponentProps<typeof Select$1>, 'value' | 'onValueChange' | 'children'>;
338
+ declare function Select(props: BaseSelectProps): react_jsx_runtime0.JSX.Element;
339
+ //#endregion
340
+ //#region src/Slider.d.ts
341
+ interface SliderProps extends React$1.ComponentProps<typeof Slider$1> {}
342
+ declare const Slider: React$1.FC<SliderProps>;
343
+ //#endregion
344
+ //#region src/spinner/spinner.d.ts
345
+ declare const SpinnerSize: {
346
+ readonly sm: 24;
347
+ readonly md: 40;
348
+ readonly lg: 64;
349
+ readonly xl: 96;
350
+ };
351
+ type SpinnerSizeKey = keyof typeof SpinnerSize;
352
+ interface SpinnerProps {
353
+ /**
354
+ * Size of the spinner - can be a preset ('sm', 'md', 'lg', 'xl') or a number in pixels
355
+ * @default 'md' (40px)
356
+ */
357
+ size?: SpinnerSizeKey | number;
358
+ /**
359
+ * Width of the spinner stroke in pixels
360
+ * If not provided, automatically calculated as 10% of size (minimum 2px)
361
+ * @default Auto-calculated based on size
362
+ */
363
+ strokeWidth?: number;
364
+ /**
365
+ * Duration of rotation animation in seconds
366
+ * @default 2
367
+ */
368
+ speed?: number;
369
+ /**
370
+ * Single color for the spinner
371
+ * Use 'currentColor' to inherit text color from parent (works with dark/light mode)
372
+ * @default 'currentColor'
373
+ */
374
+ color?: string;
375
+ /**
376
+ * Array of colors for color-changing animation
377
+ * If provided, overrides the color prop
378
+ */
379
+ colors?: string[];
380
+ /**
381
+ * Additional CSS class name
382
+ */
383
+ className?: string;
384
+ }
385
+ declare const Spinner: React$1.FC<SpinnerProps>;
386
+ //#endregion
387
+ //#region src/tags-input.d.ts
388
+ interface TagsInputProps {
389
+ value?: Array<string | number>;
390
+ onChange?: (value: Array<string | number>) => void;
391
+ options?: CommandOptionListItem[];
392
+ freeSolo?: boolean;
393
+ placeholder?: string;
394
+ emptyText?: string;
395
+ className?: string;
396
+ disabled?: boolean;
397
+ readOnly?: boolean;
398
+ maxTags?: number;
399
+ allowDuplicates?: boolean;
400
+ editable?: boolean;
401
+ label?: string;
402
+ delimiter?: string;
403
+ addOnPaste?: boolean;
404
+ addOnTab?: boolean;
405
+ onValidate?: (value: string) => boolean;
406
+ }
407
+ /**
408
+ * TagsInput component - Inline tags input based on DiceUI
409
+ *
410
+ * This is a different implementation than TagsInput, using the DiceUI library
411
+ * for a more streamlined inline editing experience.
412
+ *
413
+ * Features:
414
+ * - Inline tag display and editing
415
+ * - Keyboard navigation (Arrow keys, Home, End, Delete, Backspace)
416
+ * - Optional tag editing (editable prop)
417
+ * - Validation support
418
+ * - Paste support with delimiter parsing
419
+ * - Max tags limit
420
+ * - Options support with dropdown (like Select)
421
+ * - freeSolo mode for custom tags (like MUI Autocomplete)
422
+ */
423
+ declare function TagsInput({
424
+ value,
425
+ onChange,
426
+ options,
427
+ freeSolo,
428
+ placeholder,
429
+ emptyText,
430
+ className,
431
+ disabled,
432
+ readOnly,
433
+ maxTags,
434
+ allowDuplicates,
435
+ editable,
436
+ label,
437
+ delimiter,
438
+ addOnPaste,
439
+ addOnTab,
440
+ onValidate
441
+ }: TagsInputProps): react_jsx_runtime0.JSX.Element;
442
+ //#endregion
443
+ //#region src/theme-provider/ThemeProvider.d.ts
444
+ /**
445
+ * Note: In Chrome extensions, a flicker (Flash of Wrong Theme, or FOWT) may occur on page load
446
+ * during development mode. This is resolved in production builds where scripts are included
447
+ * in the HTML head to apply the theme before content renders. Do not attempt to fix this in dev.
448
+ */
449
+ interface ThemeProviderProps extends ComponentProps<typeof ThemeProvider$1> {
450
+ children: React$1.ReactNode;
451
+ }
452
+ declare const ThemeProvider: React$1.FC<ThemeProviderProps>;
453
+ //#endregion
454
+ //#region src/ThemeToggle.d.ts
455
+ declare function ThemeToggle(): react_jsx_runtime0.JSX.Element;
456
+ //#endregion
457
+ //#region src/toast/AlertToast.d.ts
458
+ interface AlertToastProps extends AlertProps {
459
+ onClose?: () => void;
460
+ }
461
+ //#endregion
462
+ //#region src/toast/toast.d.ts
463
+ declare const DEFAULT_ALERT_DURATION = 10000;
464
+ interface ToastProps extends AlertBaseProps {
465
+ duration?: number;
466
+ }
467
+ declare function toast(props: ToastProps): void;
468
+ type ToastMessage = string | ({
469
+ title: string;
470
+ description: string;
471
+ } & AlertToastProps);
472
+ declare function toastInfo(message: ToastMessage, duration?: number): void;
473
+ declare function toastSuccess(message: ToastMessage, duration?: number): void;
474
+ declare function toastWarning(message: ToastMessage, duration?: number): void;
475
+ declare function toastError(message: ToastMessage, duration?: number): void;
476
+ //#endregion
477
+ export { AbsoluteFill, Alert, AlertBaseProps, AlertProps, AlertVariant, Button, ButtonLoaderProps, ButtonProps, CloseButtonAbsolute, CloseButtonRounded, CloseButtonRoundedProps, Combobox, CommandOptionList, CommandOptionListItem, CommandOptionListProps, ConfirmationDialogProps, ContentCard, DEFAULT_ALERT_DURATION, DatePicker, DialogProvider, DialogProviderProps, FileUploadInline, FileUploadInlineProps, Loader, LoaderProps, type Option, Pagination, PaginationProps, PopoverCloseButtonProps, PopoverContent, PopoverContentProps, Select, Slider, SliderProps, Spinner, SpinnerProps, TagsInput, TagsInputProps, ThemeProvider, ThemeProviderProps, ThemeToggle, ToastMessage, cn, showConfirmDialog, toast, toastError, toastInfo, toastSuccess, toastWarning, useTheme };