@andreagiugni/tailwind-dashboard-ui 0.5.9 → 0.5.11

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/index.d.cts CHANGED
@@ -94,6 +94,8 @@ interface DropdownItemProps extends ColorOverrideProps {
94
94
  variant?: DropdownItemVariant;
95
95
  /** Full class override (escape hatch). When set, it replaces the variant styling. */
96
96
  baseClassName?: string;
97
+ /** Decorative icon rendered before the item text. */
98
+ icon?: React.ReactNode;
97
99
  className?: string;
98
100
  children: React.ReactNode;
99
101
  }
@@ -524,12 +526,13 @@ interface SwitchProps {
524
526
  }
525
527
  declare const Switch: React.FC<SwitchProps>;
526
528
 
527
- interface Option$1 {
529
+ interface SelectOption {
528
530
  value: string;
529
531
  label: string;
532
+ icon?: React.ReactNode;
530
533
  }
531
534
  interface SelectProps {
532
- options: Option$1[];
535
+ options: SelectOption[];
533
536
  placeholder?: string;
534
537
  onChange: (value: string) => void;
535
538
  className?: string;
@@ -626,4 +629,4 @@ interface SliderProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>,
626
629
  }
627
630
  declare const Slider: React.FC<SliderProps>;
628
631
 
629
- export { Accordion, AccordionItem, type AccordionItemProps, type AccordionProps, type AccordionSelectionMode, Alert, type AlertProps, type AlertVariant, Avatar, type AvatarProps, type AvatarSize, type AvatarStatus, AvatarText, type AvatarTextProps, Badge, type BadgeColor, type BadgeProps, type BadgeSize, type BadgeVariant, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, Button, type ButtonProps, Card, type CardProps, Checkbox, type CheckboxProps, Chip, type ChipColor, type ChipProps, type ChipSize, type ChipVariant, Code, type CodeColor, type CodeProps, type CodeSize, ColorOverrideProps, DatePicker, type DatePickerProps, DateTimePicker, type DateTimePickerProps, Drawer, type DrawerPlacement, type DrawerProps, Dropdown, DropdownItem, type DropdownItemProps, type DropdownItemVariant, type DropdownProps, Dropzone, type DropzoneProps, FileInput, type FileInputProps, Form, type FormProps, Input, type InputProps, Label, type LabelProps, Modal, type ModalProps, type ModalVariant, MultiSelect, type MultiSelectProps, Pagination, type PaginationAlign, type PaginationProps, PasswordInput, type PasswordInputProps, Popover, type PopoverPlacement, type PopoverProps, Progress, type ProgressColor, type ProgressProps, type ProgressSize, Radio, type RadioProps, RadioSm, type RadioSmProps, Ribbon, type RibbonColor, type RibbonPosition, type RibbonProps, type RibbonVariant, Select, type SelectProps, Skeleton, type SkeletonProps, Slider, type SliderColor, type SliderProps, Snippet, type SnippetProps, type SnippetSize, type SortDirection, Spinner, type SpinnerColor, type SpinnerProps, type SpinnerSize, Switch, type SwitchProps, Tab, type TabProps, Table, TableBody, TableCell, type TableCellProps, type TableColumn, TableHeader, type TableProps, TableRow, type TableRowProps, type TableSectionProps, Tabs, type TabsProps, type TabsVariant, TextArea, type TextAreaProps, ThemeToggleButton, type ThemeToggleButtonProps, Toast, type ToastProps, type ToastVariant, Tooltip, type TooltipPlacement, type TooltipProps, cn };
632
+ export { Accordion, AccordionItem, type AccordionItemProps, type AccordionProps, type AccordionSelectionMode, Alert, type AlertProps, type AlertVariant, Avatar, type AvatarProps, type AvatarSize, type AvatarStatus, AvatarText, type AvatarTextProps, Badge, type BadgeColor, type BadgeProps, type BadgeSize, type BadgeVariant, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, Button, type ButtonProps, Card, type CardProps, Checkbox, type CheckboxProps, Chip, type ChipColor, type ChipProps, type ChipSize, type ChipVariant, Code, type CodeColor, type CodeProps, type CodeSize, ColorOverrideProps, DatePicker, type DatePickerProps, DateTimePicker, type DateTimePickerProps, Drawer, type DrawerPlacement, type DrawerProps, Dropdown, DropdownItem, type DropdownItemProps, type DropdownItemVariant, type DropdownProps, Dropzone, type DropzoneProps, FileInput, type FileInputProps, Form, type FormProps, Input, type InputProps, Label, type LabelProps, Modal, type ModalProps, type ModalVariant, MultiSelect, type MultiSelectProps, Pagination, type PaginationAlign, type PaginationProps, PasswordInput, type PasswordInputProps, Popover, type PopoverPlacement, type PopoverProps, Progress, type ProgressColor, type ProgressProps, type ProgressSize, Radio, type RadioProps, RadioSm, type RadioSmProps, Ribbon, type RibbonColor, type RibbonPosition, type RibbonProps, type RibbonVariant, Select, type SelectOption, type SelectProps, Skeleton, type SkeletonProps, Slider, type SliderColor, type SliderProps, Snippet, type SnippetProps, type SnippetSize, type SortDirection, Spinner, type SpinnerColor, type SpinnerProps, type SpinnerSize, Switch, type SwitchProps, Tab, type TabProps, Table, TableBody, TableCell, type TableCellProps, type TableColumn, TableHeader, type TableProps, TableRow, type TableRowProps, type TableSectionProps, Tabs, type TabsProps, type TabsVariant, TextArea, type TextAreaProps, ThemeToggleButton, type ThemeToggleButtonProps, Toast, type ToastProps, type ToastVariant, Tooltip, type TooltipPlacement, type TooltipProps, cn };
package/dist/index.d.ts CHANGED
@@ -94,6 +94,8 @@ interface DropdownItemProps extends ColorOverrideProps {
94
94
  variant?: DropdownItemVariant;
95
95
  /** Full class override (escape hatch). When set, it replaces the variant styling. */
96
96
  baseClassName?: string;
97
+ /** Decorative icon rendered before the item text. */
98
+ icon?: React.ReactNode;
97
99
  className?: string;
98
100
  children: React.ReactNode;
99
101
  }
@@ -524,12 +526,13 @@ interface SwitchProps {
524
526
  }
525
527
  declare const Switch: React.FC<SwitchProps>;
526
528
 
527
- interface Option$1 {
529
+ interface SelectOption {
528
530
  value: string;
529
531
  label: string;
532
+ icon?: React.ReactNode;
530
533
  }
531
534
  interface SelectProps {
532
- options: Option$1[];
535
+ options: SelectOption[];
533
536
  placeholder?: string;
534
537
  onChange: (value: string) => void;
535
538
  className?: string;
@@ -626,4 +629,4 @@ interface SliderProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>,
626
629
  }
627
630
  declare const Slider: React.FC<SliderProps>;
628
631
 
629
- export { Accordion, AccordionItem, type AccordionItemProps, type AccordionProps, type AccordionSelectionMode, Alert, type AlertProps, type AlertVariant, Avatar, type AvatarProps, type AvatarSize, type AvatarStatus, AvatarText, type AvatarTextProps, Badge, type BadgeColor, type BadgeProps, type BadgeSize, type BadgeVariant, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, Button, type ButtonProps, Card, type CardProps, Checkbox, type CheckboxProps, Chip, type ChipColor, type ChipProps, type ChipSize, type ChipVariant, Code, type CodeColor, type CodeProps, type CodeSize, ColorOverrideProps, DatePicker, type DatePickerProps, DateTimePicker, type DateTimePickerProps, Drawer, type DrawerPlacement, type DrawerProps, Dropdown, DropdownItem, type DropdownItemProps, type DropdownItemVariant, type DropdownProps, Dropzone, type DropzoneProps, FileInput, type FileInputProps, Form, type FormProps, Input, type InputProps, Label, type LabelProps, Modal, type ModalProps, type ModalVariant, MultiSelect, type MultiSelectProps, Pagination, type PaginationAlign, type PaginationProps, PasswordInput, type PasswordInputProps, Popover, type PopoverPlacement, type PopoverProps, Progress, type ProgressColor, type ProgressProps, type ProgressSize, Radio, type RadioProps, RadioSm, type RadioSmProps, Ribbon, type RibbonColor, type RibbonPosition, type RibbonProps, type RibbonVariant, Select, type SelectProps, Skeleton, type SkeletonProps, Slider, type SliderColor, type SliderProps, Snippet, type SnippetProps, type SnippetSize, type SortDirection, Spinner, type SpinnerColor, type SpinnerProps, type SpinnerSize, Switch, type SwitchProps, Tab, type TabProps, Table, TableBody, TableCell, type TableCellProps, type TableColumn, TableHeader, type TableProps, TableRow, type TableRowProps, type TableSectionProps, Tabs, type TabsProps, type TabsVariant, TextArea, type TextAreaProps, ThemeToggleButton, type ThemeToggleButtonProps, Toast, type ToastProps, type ToastVariant, Tooltip, type TooltipPlacement, type TooltipProps, cn };
632
+ export { Accordion, AccordionItem, type AccordionItemProps, type AccordionProps, type AccordionSelectionMode, Alert, type AlertProps, type AlertVariant, Avatar, type AvatarProps, type AvatarSize, type AvatarStatus, AvatarText, type AvatarTextProps, Badge, type BadgeColor, type BadgeProps, type BadgeSize, type BadgeVariant, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, Button, type ButtonProps, Card, type CardProps, Checkbox, type CheckboxProps, Chip, type ChipColor, type ChipProps, type ChipSize, type ChipVariant, Code, type CodeColor, type CodeProps, type CodeSize, ColorOverrideProps, DatePicker, type DatePickerProps, DateTimePicker, type DateTimePickerProps, Drawer, type DrawerPlacement, type DrawerProps, Dropdown, DropdownItem, type DropdownItemProps, type DropdownItemVariant, type DropdownProps, Dropzone, type DropzoneProps, FileInput, type FileInputProps, Form, type FormProps, Input, type InputProps, Label, type LabelProps, Modal, type ModalProps, type ModalVariant, MultiSelect, type MultiSelectProps, Pagination, type PaginationAlign, type PaginationProps, PasswordInput, type PasswordInputProps, Popover, type PopoverPlacement, type PopoverProps, Progress, type ProgressColor, type ProgressProps, type ProgressSize, Radio, type RadioProps, RadioSm, type RadioSmProps, Ribbon, type RibbonColor, type RibbonPosition, type RibbonProps, type RibbonVariant, Select, type SelectOption, type SelectProps, Skeleton, type SkeletonProps, Slider, type SliderColor, type SliderProps, Snippet, type SnippetProps, type SnippetSize, type SortDirection, Spinner, type SpinnerColor, type SpinnerProps, type SpinnerSize, Switch, type SwitchProps, Tab, type TabProps, Table, TableBody, TableCell, type TableCellProps, type TableColumn, TableHeader, type TableProps, TableRow, type TableRowProps, type TableSectionProps, Tabs, type TabsProps, type TabsVariant, TextArea, type TextAreaProps, ThemeToggleButton, type ThemeToggleButtonProps, Toast, type ToastProps, type ToastVariant, Tooltip, type TooltipPlacement, type TooltipProps, cn };
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  export { BarChart } from './chunk-YAKIMPXZ.js';
3
3
  export { LineChart } from './chunk-NWIOJGF7.js';
4
- export { Calendar, Modal } from './chunk-XXWKR4DP.js';
4
+ export { Calendar, Modal } from './chunk-VHWX72IM.js';
5
5
  export { CountryMap } from './chunk-R66LONPQ.js';
6
6
  export { Editor } from './chunk-DXUWFHPF.js';
7
7
  export { ColorPicker } from './chunk-X3OP55FG.js';
@@ -456,6 +456,7 @@ var DropdownItem = ({
456
456
  onItemClick,
457
457
  variant = "default",
458
458
  baseClassName,
459
+ icon,
459
460
  className,
460
461
  bgColor,
461
462
  textColor,
@@ -471,10 +472,21 @@ var DropdownItem = ({
471
472
  if (onClick) onClick();
472
473
  if (onItemClick) onItemClick();
473
474
  };
475
+ const content = icon ? /* @__PURE__ */ jsxs(Fragment, { children: [
476
+ /* @__PURE__ */ jsx(
477
+ "span",
478
+ {
479
+ "aria-hidden": "true",
480
+ className: "flex h-5 w-5 shrink-0 items-center justify-center [&>svg]:h-5 [&>svg]:w-5",
481
+ children: icon
482
+ }
483
+ ),
484
+ /* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1", children })
485
+ ] }) : children;
474
486
  if (tag === "a" && href) {
475
- return /* @__PURE__ */ jsx("a", { href, className: combinedClasses, style, onClick: handleClick, children });
487
+ return /* @__PURE__ */ jsx("a", { href, className: combinedClasses, style, onClick: handleClick, children: content });
476
488
  }
477
- return /* @__PURE__ */ jsx("button", { onClick: handleClick, className: combinedClasses, style, children });
489
+ return /* @__PURE__ */ jsx("button", { onClick: handleClick, className: combinedClasses, style, children: content });
478
490
  };
479
491
  var Dropzone = ({
480
492
  onDrop,
@@ -2543,7 +2555,7 @@ var Select = ({
2543
2555
  onChange(value);
2544
2556
  setIsOpen(false);
2545
2557
  };
2546
- const selectedLabel = options.find((o) => o.value === selectedValue)?.label;
2558
+ const selectedOption = options.find((option) => option.value === selectedValue);
2547
2559
  return /* @__PURE__ */ jsxs("div", { ref: rootRef, className: cn("relative w-full", className), children: [
2548
2560
  /* @__PURE__ */ jsxs(
2549
2561
  "button",
@@ -2556,10 +2568,20 @@ var Select = ({
2556
2568
  className: cn(
2557
2569
  "flex h-11 w-full items-center justify-between rounded-lg border border-gray-300 bg-white px-4 py-2.5 text-left text-sm shadow-theme-xs transition focus:border-brand-300 focus:outline-hidden focus:ring-3 focus:ring-brand-500/10 dark:border-gray-700 dark:bg-gray-900 dark:focus:border-brand-800",
2558
2570
  disabled && "cursor-not-allowed opacity-50",
2559
- selectedLabel ? "text-gray-800 dark:text-white/90" : "text-gray-400 dark:text-gray-400"
2571
+ selectedOption ? "text-gray-800 dark:text-white/90" : "text-gray-400 dark:text-gray-400"
2560
2572
  ),
2561
2573
  children: [
2562
- /* @__PURE__ */ jsx("span", { className: "truncate", children: selectedLabel ?? placeholder }),
2574
+ /* @__PURE__ */ jsxs("span", { className: "flex min-w-0 items-center gap-2", children: [
2575
+ selectedOption?.icon && /* @__PURE__ */ jsx(
2576
+ "span",
2577
+ {
2578
+ "aria-hidden": "true",
2579
+ className: "flex h-5 w-5 shrink-0 items-center justify-center [&>svg]:h-4 [&>svg]:w-4",
2580
+ children: selectedOption.icon
2581
+ }
2582
+ ),
2583
+ /* @__PURE__ */ jsx("span", { className: "truncate", children: selectedOption?.label ?? placeholder })
2584
+ ] }),
2563
2585
  /* @__PURE__ */ jsx(
2564
2586
  "svg",
2565
2587
  {
@@ -2608,7 +2630,17 @@ var Select = ({
2608
2630
  isSelected ? "bg-brand-50 font-medium text-brand-600 dark:bg-brand-500/15 dark:text-brand-400" : "text-gray-700 dark:text-gray-300"
2609
2631
  ),
2610
2632
  children: [
2611
- /* @__PURE__ */ jsx("span", { className: "truncate", children: option.label }),
2633
+ /* @__PURE__ */ jsxs("span", { className: "flex min-w-0 items-center gap-2", children: [
2634
+ option.icon && /* @__PURE__ */ jsx(
2635
+ "span",
2636
+ {
2637
+ "aria-hidden": "true",
2638
+ className: "flex h-5 w-5 shrink-0 items-center justify-center [&>svg]:h-4 [&>svg]:w-4",
2639
+ children: option.icon
2640
+ }
2641
+ ),
2642
+ /* @__PURE__ */ jsx("span", { className: "truncate", children: option.label })
2643
+ ] }),
2612
2644
  isSelected && /* @__PURE__ */ jsx(
2613
2645
  "svg",
2614
2646
  {