eglador-ui-react 0.1.0-alpha.3 → 0.1.0-alpha.5

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/README.md CHANGED
@@ -12,6 +12,8 @@ npm install eglador-ui-react
12
12
 
13
13
  **Peer dependencies:** `react >= 18` | `react-dom >= 18` | `tailwindcss ^4`
14
14
 
15
+ **Optional (for Carousel):** `embla-carousel ^8` | `embla-carousel-react ^8` | plugin packages as needed (`embla-carousel-autoplay`, `embla-carousel-fade`, etc.)
16
+
15
17
  ## Setup
16
18
 
17
19
  Add the following to your global stylesheet (e.g. `app/globals.css`) so Tailwind can detect the component classes:
@@ -24,7 +26,7 @@ Add the following to your global stylesheet (e.g. `app/globals.css`) so Tailwind
24
26
  ## Usage
25
27
 
26
28
  ```tsx
27
- import { Button, ButtonGroup, Checkbox, CheckboxGroup } from "eglador-ui-react";
29
+ import { Button, ButtonGroup, Checkbox, CheckboxGroup, Input, InputGroup, Dropdown, Select, MultiSelect, Tabs, Accordion, Modal, MediaImage, MediaVideo, Tooltip, Breadcrumb, Typewriter, Carousel } from "eglador-ui-react";
28
30
  ```
29
31
 
30
32
  ## Components
@@ -35,6 +37,31 @@ import { Button, ButtonGroup, Checkbox, CheckboxGroup } from "eglador-ui-react";
35
37
  | **ButtonGroup** | `variant`, `className`, `children` |
36
38
  | **Checkbox** | `variant`, `color`, `size`, `checked`, `onChange`, `indeterminate`, `label`, `description`, `disabled`, `name`, `value`, `className` |
37
39
  | **CheckboxGroup** | `variant`, `className`, `children` |
40
+ | **Input** | `variant`, `color`, `size`, `shape`, `state`, `icon`, `iconRight`, `loading`, `label`, `errorMessage`, `successMessage`, `disabled`, `wrapperClassName`, `className` |
41
+ | **InputGroup** | `variant`, `className`, `children` |
42
+ | **Dropdown** | `side`, `align`, `width`, `maxHeight`, `scroll`, `autoFlip`, `open`, `onOpenChange`, `className` |
43
+ | **Dropdown.Trigger** | `asChild`, `className`, `children` |
44
+ | **Dropdown.Content** | `className`, `children` |
45
+ | **Select** | `value`, `onChange`, `options`, `placeholder`, `disabled`, `autoFlip`, `maxHeight`, `className` |
46
+ | **MultiSelect** | `value`, `onChange`, `options`, `placeholder`, `disabled`, `autoFlip`, `maxHeight`, `searchable`, `searchPlaceholder`, `maxSelected`, `maxVisibleChips`, `className` |
47
+ | **Tabs** | `value`, `defaultValue`, `onValueChange`, `variant`, `size`, `className` |
48
+ | **Tabs.List** | `className`, `children` |
49
+ | **Tabs.Trigger** | `value`, `icon`, `activeClassName`, `disabled`, `className` |
50
+ | **Tabs.Content** | `value`, `className`, `children` |
51
+ | **Accordion** | `title`, `icon`, `extra`, `defaultOpen`, `open`, `onOpenChange`, `variant`, `size`, `disabled`, `hideChevron`, `className` |
52
+ | **Modal** | `open`, `defaultOpen`, `onOpenChange`, `size`, `closeOnBackdrop`, `closeOnEscape` |
53
+ | **Modal.Trigger** | `asChild`, `className`, `children` |
54
+ | **Modal.Content** | `className`, `children` |
55
+ | **Modal.Header** | `icon`, `hideClose`, `className`, `children` |
56
+ | **Modal.Body** | `className`, `children` |
57
+ | **Modal.Footer** | `className`, `children` |
58
+ | **MediaImage** | `src`, `alt`, `caption`, `ratio`, `size`, `shape`, `objectFit`, `loading`, `hideCaption`, `onError`, `className` |
59
+ | **MediaVideo** | `src`, `caption`, `ratio`, `size`, `shape`, `controls`, `preload`, `autoPlay`, `muted`, `loop`, `poster`, `hideCaption`, `onError`, `className` |
60
+ | **Tooltip** | `content`, `position`, `delay`, `className`, `children` |
61
+ | **Breadcrumb** | `separator`, `className`, `children` |
62
+ | **Breadcrumb.Item** | `href`, `isActive`, `className`, `children` |
63
+ | **Typewriter** | `texts`, `typingSpeed`, `deletingSpeed`, `pauseDuration`, `deleteMode`, `loop`, `startDelay`, `cursor`, `cursorStyle`, `onComplete`, `className` |
64
+ | **Carousel** | `slides`, `slidesPerView`, `align`, `containScroll`, `dragFree`, `loop`, `axis`, `direction`, `plugins`, `showNavigation`, `showPagination`, `scrollToIndex`, `breakpoints`, `className` |
38
65
 
39
66
  ## Development
40
67
 
package/dist/index.d.mts CHANGED
@@ -1,7 +1,43 @@
1
- import * as React from 'react';
2
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as React from 'react';
3
+ import { EmblaOptionsType } from 'embla-carousel';
3
4
  import { ClassValue } from 'clsx';
4
5
 
6
+ type AccordionVariant = "default" | "bordered" | "filled";
7
+ type AccordionSize = "xs" | "sm" | "md";
8
+ interface AccordionProps {
9
+ title: React.ReactNode;
10
+ icon?: React.ReactNode;
11
+ extra?: React.ReactNode;
12
+ defaultOpen?: boolean;
13
+ open?: boolean;
14
+ onOpenChange?: (open: boolean) => void;
15
+ variant?: AccordionVariant;
16
+ size?: AccordionSize;
17
+ disabled?: boolean;
18
+ hideChevron?: boolean;
19
+ children: React.ReactNode;
20
+ className?: string;
21
+ }
22
+ declare function Accordion({ title, icon, extra, defaultOpen, open, onOpenChange, variant, size, disabled, hideChevron, children, className, }: AccordionProps): react_jsx_runtime.JSX.Element;
23
+
24
+ interface BreadcrumbProps {
25
+ children: React.ReactNode;
26
+ className?: string;
27
+ separator?: React.ReactNode;
28
+ }
29
+ interface BreadcrumbItemProps {
30
+ children: React.ReactNode;
31
+ href?: string;
32
+ className?: string;
33
+ isActive?: boolean;
34
+ }
35
+ declare function BreadcrumbRoot({ children, className, separator }: BreadcrumbProps): react_jsx_runtime.JSX.Element;
36
+ declare function BreadcrumbItem({ children, href, className, isActive }: BreadcrumbItemProps): react_jsx_runtime.JSX.Element;
37
+ declare const Breadcrumb: typeof BreadcrumbRoot & {
38
+ Item: typeof BreadcrumbItem;
39
+ };
40
+
5
41
  type ButtonColor = "default" | "black" | "primary" | "danger" | "success" | "warning" | "info";
6
42
  type ButtonSize = "xs" | "sm" | "md";
7
43
  type ButtonShape = "square" | "rounded" | "circle";
@@ -20,6 +56,46 @@ interface ButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>
20
56
  }
21
57
  declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
22
58
 
59
+ type CarouselBreakpointOptions = EmblaOptionsType & {
60
+ slidesPerView?: number | "auto";
61
+ };
62
+ interface CarouselProps {
63
+ slides: React.ReactNode[];
64
+ slidesPerView?: number | "auto";
65
+ align?: EmblaOptionsType["align"];
66
+ containScroll?: EmblaOptionsType["containScroll"];
67
+ dragFree?: boolean;
68
+ loop?: boolean;
69
+ axis?: "x" | "y";
70
+ direction?: "ltr" | "rtl";
71
+ autoplay?: boolean | Record<string, unknown>;
72
+ autoScroll?: boolean | Record<string, unknown>;
73
+ autoHeight?: boolean | Record<string, unknown>;
74
+ fade?: boolean | Record<string, unknown>;
75
+ wheelGestures?: boolean | Record<string, unknown>;
76
+ classNames?: boolean | Record<string, unknown>;
77
+ parallax?: boolean;
78
+ opacity?: boolean;
79
+ lazyLoad?: boolean;
80
+ showNavigation?: boolean;
81
+ showPagination?: boolean;
82
+ scrollToIndex?: number;
83
+ breakpoints?: Record<string, CarouselBreakpointOptions>;
84
+ className?: string;
85
+ viewportClassName?: string;
86
+ containerClassName?: string;
87
+ slideClassName?: string;
88
+ styles?: {
89
+ controls?: string;
90
+ navigation?: string;
91
+ pagination?: string;
92
+ prevButton?: string;
93
+ nextButton?: string;
94
+ dot?: string;
95
+ };
96
+ }
97
+ declare function Carousel({ slides, slidesPerView, align, containScroll, dragFree, loop, axis, direction, autoplay, autoScroll, autoHeight, fade: fadeProp, wheelGestures: wheelGesturesProp, classNames: classNamesProp, parallax, opacity, lazyLoad, showNavigation, showPagination, scrollToIndex, breakpoints, className, viewportClassName, containerClassName, slideClassName, styles, }: CarouselProps): react_jsx_runtime.JSX.Element | null;
98
+
23
99
  type ButtonGroupVariant = "bordered" | "segmented";
24
100
  interface ButtonGroupProps {
25
101
  variant?: ButtonGroupVariant;
@@ -56,6 +132,284 @@ interface CheckboxGroupProps {
56
132
  }
57
133
  declare function CheckboxGroup({ variant, className, children, }: CheckboxGroupProps): react_jsx_runtime.JSX.Element;
58
134
 
135
+ type DropdownSide = "bottom" | "top" | "right" | "left";
136
+ type DropdownAlign = "left" | "right" | "top" | "bottom" | "start" | "center" | "end";
137
+ type DropdownWidth = number | "trigger" | "auto";
138
+ interface DropdownProps {
139
+ side?: DropdownSide;
140
+ align?: DropdownAlign;
141
+ width?: DropdownWidth;
142
+ maxHeight?: number;
143
+ scroll?: boolean;
144
+ autoFlip?: boolean;
145
+ open?: boolean;
146
+ onOpenChange?: (open: boolean) => void;
147
+ className?: string;
148
+ children: React.ReactNode;
149
+ }
150
+ interface DropdownTriggerProps {
151
+ className?: string;
152
+ children?: React.ReactNode;
153
+ asChild?: boolean;
154
+ }
155
+ interface DropdownContentProps {
156
+ className?: string;
157
+ children: React.ReactNode;
158
+ }
159
+ declare function DropdownTrigger({ className, children, asChild }: DropdownTriggerProps): react_jsx_runtime.JSX.Element;
160
+ declare namespace DropdownTrigger {
161
+ var displayName: string;
162
+ }
163
+ declare function DropdownContent({ className, children }: DropdownContentProps): react_jsx_runtime.JSX.Element | null;
164
+ declare namespace DropdownContent {
165
+ var displayName: string;
166
+ }
167
+ declare const Dropdown: React.ForwardRefExoticComponent<DropdownProps & React.RefAttributes<HTMLDivElement>> & {
168
+ Trigger: typeof DropdownTrigger;
169
+ Content: typeof DropdownContent;
170
+ };
171
+
172
+ type InputSize = "xs" | "sm" | "md";
173
+ type InputShape = "square" | "rounded";
174
+ type InputVariant = "default" | "outline" | "ghost";
175
+ type InputColor = "default" | "black" | "primary" | "danger" | "success" | "warning" | "info";
176
+ type InputState = "idle" | "error" | "success";
177
+ interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "size"> {
178
+ variant?: InputVariant;
179
+ size?: InputSize;
180
+ shape?: InputShape;
181
+ color?: InputColor;
182
+ state?: InputState;
183
+ icon?: React.ReactNode;
184
+ iconRight?: React.ReactNode;
185
+ loading?: boolean;
186
+ label?: string;
187
+ errorMessage?: string;
188
+ successMessage?: string;
189
+ wrapperClassName?: string;
190
+ className?: string;
191
+ }
192
+ declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
193
+
194
+ type InputGroupVariant = "bordered" | "stacked";
195
+ interface InputGroupProps {
196
+ variant?: InputGroupVariant;
197
+ className?: string;
198
+ children: React.ReactNode;
199
+ }
200
+ declare function InputGroup({ variant, className, children, }: InputGroupProps): react_jsx_runtime.JSX.Element;
201
+
202
+ type MediaImageRatio = "1:1" | "16:9" | "4:3" | "1:2" | "free";
203
+ type MediaImageSize = "xs" | "sm" | "md" | "lg";
204
+ type MediaImageShape = "square" | "rounded" | "circle";
205
+ interface MediaImageProps {
206
+ src: string;
207
+ alt: string;
208
+ caption?: string;
209
+ ratio?: MediaImageRatio;
210
+ size?: MediaImageSize;
211
+ shape?: MediaImageShape;
212
+ children?: React.ReactNode;
213
+ hideCaption?: boolean;
214
+ objectFit?: "cover" | "contain" | "fill" | "none";
215
+ loading?: "lazy" | "eager";
216
+ onError?: () => void;
217
+ className?: string;
218
+ }
219
+ declare function MediaImage({ src, alt, caption, ratio, size, shape, children, hideCaption, objectFit, loading, onError, className, }: MediaImageProps): react_jsx_runtime.JSX.Element;
220
+
221
+ type MediaVideoRatio = "1:1" | "16:9" | "4:3" | "1:2" | "free";
222
+ type MediaVideoSize = "xs" | "sm" | "md";
223
+ type MediaVideoShape = "square" | "rounded" | "circle";
224
+ interface MediaVideoProps {
225
+ src: string;
226
+ caption?: string;
227
+ ratio?: MediaVideoRatio;
228
+ size?: MediaVideoSize;
229
+ shape?: MediaVideoShape;
230
+ children?: React.ReactNode;
231
+ hideCaption?: boolean;
232
+ controls?: boolean;
233
+ preload?: "none" | "metadata" | "auto";
234
+ autoPlay?: boolean;
235
+ muted?: boolean;
236
+ loop?: boolean;
237
+ poster?: string;
238
+ onError?: () => void;
239
+ className?: string;
240
+ }
241
+ declare function MediaVideo({ src, caption, ratio, size, shape, children, hideCaption, controls, preload, autoPlay, muted, loop, poster, onError, className, }: MediaVideoProps): react_jsx_runtime.JSX.Element;
242
+
243
+ type ModalSize = "sm" | "md" | "lg";
244
+ interface ModalProps {
245
+ open?: boolean;
246
+ defaultOpen?: boolean;
247
+ onOpenChange?: (open: boolean) => void;
248
+ size?: ModalSize;
249
+ closeOnBackdrop?: boolean;
250
+ closeOnEscape?: boolean;
251
+ children: React.ReactNode;
252
+ }
253
+ interface ModalTriggerProps {
254
+ asChild?: boolean;
255
+ className?: string;
256
+ children: React.ReactNode;
257
+ }
258
+ interface ModalContentProps {
259
+ className?: string;
260
+ children: React.ReactNode;
261
+ }
262
+ interface ModalHeaderProps {
263
+ icon?: React.ReactNode;
264
+ hideClose?: boolean;
265
+ className?: string;
266
+ children: React.ReactNode;
267
+ }
268
+ interface ModalBodyProps {
269
+ className?: string;
270
+ children: React.ReactNode;
271
+ }
272
+ interface ModalFooterProps {
273
+ className?: string;
274
+ children: React.ReactNode;
275
+ }
276
+ declare function ModalRoot({ open, defaultOpen, onOpenChange, size, closeOnBackdrop, closeOnEscape, children, }: ModalProps): react_jsx_runtime.JSX.Element;
277
+ declare namespace ModalRoot {
278
+ var displayName: string;
279
+ }
280
+ declare function ModalTrigger({ asChild, className, children }: ModalTriggerProps): react_jsx_runtime.JSX.Element;
281
+ declare namespace ModalTrigger {
282
+ var displayName: string;
283
+ }
284
+ declare function ModalContent({ className, children }: ModalContentProps): React.ReactPortal | null;
285
+ declare namespace ModalContent {
286
+ var displayName: string;
287
+ }
288
+ declare function ModalHeader({ icon, hideClose, className, children }: ModalHeaderProps): react_jsx_runtime.JSX.Element;
289
+ declare namespace ModalHeader {
290
+ var displayName: string;
291
+ }
292
+ declare function ModalBody({ className, children }: ModalBodyProps): react_jsx_runtime.JSX.Element;
293
+ declare namespace ModalBody {
294
+ var displayName: string;
295
+ }
296
+ declare function ModalFooter({ className, children }: ModalFooterProps): react_jsx_runtime.JSX.Element;
297
+ declare namespace ModalFooter {
298
+ var displayName: string;
299
+ }
300
+ declare const Modal: typeof ModalRoot & {
301
+ Trigger: typeof ModalTrigger;
302
+ Content: typeof ModalContent;
303
+ Header: typeof ModalHeader;
304
+ Body: typeof ModalBody;
305
+ Footer: typeof ModalFooter;
306
+ };
307
+
308
+ interface MultiSelectOption {
309
+ label: string;
310
+ value: string;
311
+ [key: string]: unknown;
312
+ }
313
+ interface MultiSelectProps {
314
+ value?: string[];
315
+ onChange?: (values: string[], options?: MultiSelectOption[]) => void;
316
+ options?: MultiSelectOption[];
317
+ placeholder?: string;
318
+ className?: string;
319
+ disabled?: boolean;
320
+ autoFlip?: boolean;
321
+ maxHeight?: number;
322
+ searchable?: boolean;
323
+ searchPlaceholder?: string;
324
+ maxSelected?: number;
325
+ maxVisibleChips?: number;
326
+ clearLabel?: string;
327
+ selectedLabel?: string;
328
+ noResultsLabel?: string;
329
+ noOptionsLabel?: string;
330
+ }
331
+ declare function MultiSelect({ value, onChange, options, placeholder, className, disabled, autoFlip, maxHeight, searchable, searchPlaceholder, maxSelected, maxVisibleChips, clearLabel, selectedLabel, noResultsLabel, noOptionsLabel, }: MultiSelectProps): react_jsx_runtime.JSX.Element;
332
+
333
+ interface SelectOption {
334
+ label: string;
335
+ value: string;
336
+ [key: string]: unknown;
337
+ }
338
+ interface SelectProps {
339
+ value?: string;
340
+ onChange?: (value: string, option?: SelectOption) => void;
341
+ options?: SelectOption[];
342
+ placeholder?: string;
343
+ className?: string;
344
+ disabled?: boolean;
345
+ autoFlip?: boolean;
346
+ maxHeight?: number;
347
+ }
348
+ declare function Select({ value, onChange, options, placeholder, className, disabled, autoFlip, maxHeight, }: SelectProps): react_jsx_runtime.JSX.Element;
349
+
350
+ type TabsVariant = "default" | "bordered" | "segmented";
351
+ type TabsSize = "xs" | "sm" | "md";
352
+ interface TabsProps {
353
+ value?: string;
354
+ defaultValue?: string;
355
+ onValueChange?: (value: string) => void;
356
+ variant?: TabsVariant;
357
+ size?: TabsSize;
358
+ className?: string;
359
+ children: React.ReactNode;
360
+ }
361
+ interface TabsListProps {
362
+ className?: string;
363
+ children: React.ReactNode;
364
+ }
365
+ interface TabsTriggerProps {
366
+ value: string;
367
+ icon?: React.ReactNode;
368
+ activeClassName?: string;
369
+ disabled?: boolean;
370
+ className?: string;
371
+ children?: React.ReactNode;
372
+ }
373
+ interface TabsContentProps {
374
+ value: string;
375
+ className?: string;
376
+ children: React.ReactNode;
377
+ }
378
+ declare function TabsRoot({ value, defaultValue, onValueChange, variant, size, className, children, }: TabsProps): react_jsx_runtime.JSX.Element;
379
+ declare function TabsList({ className, children }: TabsListProps): react_jsx_runtime.JSX.Element;
380
+ declare function TabsTrigger({ value, icon, activeClassName, disabled, className, children }: TabsTriggerProps): react_jsx_runtime.JSX.Element;
381
+ declare function TabsContent({ value, className, children }: TabsContentProps): react_jsx_runtime.JSX.Element | null;
382
+ declare const Tabs: typeof TabsRoot & {
383
+ List: typeof TabsList;
384
+ Trigger: typeof TabsTrigger;
385
+ Content: typeof TabsContent;
386
+ };
387
+
388
+ type TooltipPosition = "top" | "bottom" | "left" | "right";
389
+ interface TooltipProps {
390
+ content: React.ReactNode;
391
+ position?: TooltipPosition;
392
+ delay?: number;
393
+ children: React.ReactElement;
394
+ className?: string;
395
+ }
396
+ declare function Tooltip({ content, position, delay, children, className, }: TooltipProps): react_jsx_runtime.JSX.Element;
397
+
398
+ interface TypewriterProps {
399
+ texts: string[];
400
+ typingSpeed?: number;
401
+ deletingSpeed?: number;
402
+ pauseDuration?: number;
403
+ deleteMode?: "backspace" | "clear";
404
+ loop?: boolean;
405
+ startDelay?: number;
406
+ cursor?: boolean;
407
+ cursorStyle?: "line" | "block" | "underscore";
408
+ onComplete?: () => void;
409
+ className?: string;
410
+ }
411
+ declare function Typewriter({ texts, typingSpeed, deletingSpeed, pauseDuration, deleteMode, loop, startDelay, cursor, cursorStyle, onComplete, className, }: TypewriterProps): react_jsx_runtime.JSX.Element;
412
+
59
413
  declare function cn(...inputs: ClassValue[]): string;
60
414
 
61
- export { Button, type ButtonColor, ButtonGroup, type ButtonGroupProps, type ButtonGroupVariant, type ButtonProps, type ButtonShape, type ButtonSize, type ButtonVariant, Checkbox, type CheckboxColor, CheckboxGroup, type CheckboxGroupProps, type CheckboxGroupVariant, type CheckboxProps, type CheckboxSize, type CheckboxVariant, cn };
415
+ export { Accordion, type AccordionProps, type AccordionSize, type AccordionVariant, Breadcrumb, type BreadcrumbItemProps, type BreadcrumbProps, Button, type ButtonColor, ButtonGroup, type ButtonGroupProps, type ButtonGroupVariant, type ButtonProps, type ButtonShape, type ButtonSize, type ButtonVariant, Carousel, type CarouselBreakpointOptions, type CarouselProps, Checkbox, type CheckboxColor, CheckboxGroup, type CheckboxGroupProps, type CheckboxGroupVariant, type CheckboxProps, type CheckboxSize, type CheckboxVariant, Dropdown, type DropdownAlign, type DropdownContentProps, type DropdownProps, type DropdownSide, type DropdownTriggerProps, type DropdownWidth, Input, type InputColor, InputGroup, type InputGroupProps, type InputGroupVariant, type InputProps, type InputShape, type InputSize, type InputState, type InputVariant, MediaImage, type MediaImageProps, type MediaImageRatio, type MediaImageShape, type MediaImageSize, MediaVideo, type MediaVideoProps, type MediaVideoRatio, type MediaVideoShape, type MediaVideoSize, Modal, type ModalBodyProps, type ModalContentProps, type ModalFooterProps, type ModalHeaderProps, type ModalProps, type ModalSize, type ModalTriggerProps, MultiSelect, type MultiSelectOption, type MultiSelectProps, Select, type SelectOption, type SelectProps, Tabs, type TabsContentProps, type TabsListProps, type TabsProps, type TabsSize, type TabsTriggerProps, type TabsVariant, Tooltip, type TooltipPosition, type TooltipProps, Typewriter, type TypewriterProps, cn };