@andreagiugni/tailwind-dashboard-ui 1.0.23 → 1.0.26

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
@@ -422,6 +422,9 @@ declare const Progress: React.FC<ProgressProps>;
422
422
 
423
423
  type PollResultsColor = "primary" | "success" | "error" | "warning" | "info" | "light" | "dark";
424
424
  type PollResultsSize = "sm" | "md" | "lg";
425
+ type PollResultsTextSize = React.CSSProperties["fontSize"];
426
+ type PollResultsTextColor = React.CSSProperties["color"];
427
+ type PollResultsTextWeight = React.CSSProperties["fontWeight"];
425
428
  interface PollResultsSeries {
426
429
  label?: React.ReactNode;
427
430
  value: number;
@@ -446,6 +449,18 @@ interface PollResultsProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "c
446
449
  showValueLabel?: boolean;
447
450
  showSeriesLabels?: boolean;
448
451
  valueFormatter?: (value: number, percent: number) => React.ReactNode;
452
+ labelTextSize?: PollResultsTextSize;
453
+ labelTextColor?: PollResultsTextColor;
454
+ labelTextWeight?: PollResultsTextWeight;
455
+ valueTextSize?: PollResultsTextSize;
456
+ valueTextColor?: PollResultsTextColor;
457
+ valueTextWeight?: PollResultsTextWeight;
458
+ seriesLabelTextSize?: PollResultsTextSize;
459
+ seriesLabelTextColor?: PollResultsTextColor;
460
+ seriesLabelTextWeight?: PollResultsTextWeight;
461
+ seriesValueTextSize?: PollResultsTextSize;
462
+ seriesValueTextColor?: PollResultsTextColor;
463
+ seriesValueTextWeight?: PollResultsTextWeight;
449
464
  }
450
465
  declare const PollResults: React.FC<PollResultsProps>;
451
466
 
@@ -667,4 +682,4 @@ interface SliderProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>,
667
682
  }
668
683
  declare const Slider: React.FC<SliderProps>;
669
684
 
670
- 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, PollResults, type PollResultsColor, type PollResultsOption, type PollResultsProps, type PollResultsSeries, type PollResultsSize, 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 };
685
+ 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, PollResults, type PollResultsColor, type PollResultsOption, type PollResultsProps, type PollResultsSeries, type PollResultsSize, type PollResultsTextColor, type PollResultsTextSize, type PollResultsTextWeight, 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
@@ -422,6 +422,9 @@ declare const Progress: React.FC<ProgressProps>;
422
422
 
423
423
  type PollResultsColor = "primary" | "success" | "error" | "warning" | "info" | "light" | "dark";
424
424
  type PollResultsSize = "sm" | "md" | "lg";
425
+ type PollResultsTextSize = React.CSSProperties["fontSize"];
426
+ type PollResultsTextColor = React.CSSProperties["color"];
427
+ type PollResultsTextWeight = React.CSSProperties["fontWeight"];
425
428
  interface PollResultsSeries {
426
429
  label?: React.ReactNode;
427
430
  value: number;
@@ -446,6 +449,18 @@ interface PollResultsProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "c
446
449
  showValueLabel?: boolean;
447
450
  showSeriesLabels?: boolean;
448
451
  valueFormatter?: (value: number, percent: number) => React.ReactNode;
452
+ labelTextSize?: PollResultsTextSize;
453
+ labelTextColor?: PollResultsTextColor;
454
+ labelTextWeight?: PollResultsTextWeight;
455
+ valueTextSize?: PollResultsTextSize;
456
+ valueTextColor?: PollResultsTextColor;
457
+ valueTextWeight?: PollResultsTextWeight;
458
+ seriesLabelTextSize?: PollResultsTextSize;
459
+ seriesLabelTextColor?: PollResultsTextColor;
460
+ seriesLabelTextWeight?: PollResultsTextWeight;
461
+ seriesValueTextSize?: PollResultsTextSize;
462
+ seriesValueTextColor?: PollResultsTextColor;
463
+ seriesValueTextWeight?: PollResultsTextWeight;
449
464
  }
450
465
  declare const PollResults: React.FC<PollResultsProps>;
451
466
 
@@ -667,4 +682,4 @@ interface SliderProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>,
667
682
  }
668
683
  declare const Slider: React.FC<SliderProps>;
669
684
 
670
- 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, PollResults, type PollResultsColor, type PollResultsOption, type PollResultsProps, type PollResultsSeries, type PollResultsSize, 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 };
685
+ 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, PollResults, type PollResultsColor, type PollResultsOption, type PollResultsProps, type PollResultsSeries, type PollResultsSize, type PollResultsTextColor, type PollResultsTextSize, type PollResultsTextWeight, 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
@@ -3,7 +3,7 @@ export { BarChart } from './chunk-2BCVEKTG.js';
3
3
  export { LineChart } from './chunk-W6E275RF.js';
4
4
  export { Calendar, Modal } from './chunk-NJBVRPWW.js';
5
5
  export { Editor } from './chunk-PFCUA2W2.js';
6
- export { ColorPicker } from './chunk-IT5ABBIV.js';
6
+ export { ColorPicker } from './chunk-KKDLEGKJ.js';
7
7
  import { layers } from './chunk-VX7S6VYG.js';
8
8
  import { cn } from './chunk-ZLIYUUA4.js';
9
9
  export { cn } from './chunk-ZLIYUUA4.js';
@@ -1908,6 +1908,15 @@ var nodeToLabel = (node) => {
1908
1908
  return void 0;
1909
1909
  };
1910
1910
  var defaultValueFormatter = (_value, percent) => `${percent}%`;
1911
+ var textStyle = ({
1912
+ size,
1913
+ color,
1914
+ weight
1915
+ }) => ({
1916
+ ...size ? { fontSize: size } : {},
1917
+ ...color ? { color } : {},
1918
+ ...weight ? { fontWeight: weight } : {}
1919
+ });
1911
1920
  var PollResults = ({
1912
1921
  options,
1913
1922
  maxValue = 100,
@@ -1917,6 +1926,18 @@ var PollResults = ({
1917
1926
  showValueLabel = true,
1918
1927
  showSeriesLabels = true,
1919
1928
  valueFormatter = defaultValueFormatter,
1929
+ labelTextSize,
1930
+ labelTextColor,
1931
+ labelTextWeight,
1932
+ valueTextSize,
1933
+ valueTextColor,
1934
+ valueTextWeight,
1935
+ seriesLabelTextSize,
1936
+ seriesLabelTextColor,
1937
+ seriesLabelTextWeight,
1938
+ seriesValueTextSize,
1939
+ seriesValueTextColor,
1940
+ seriesValueTextWeight,
1920
1941
  className,
1921
1942
  bgColor,
1922
1943
  textColor,
@@ -1925,6 +1946,26 @@ var PollResults = ({
1925
1946
  ...rest
1926
1947
  }) => {
1927
1948
  const safeMax = maxValue <= 0 ? 100 : maxValue;
1949
+ const optionLabelStyle = textStyle({
1950
+ size: labelTextSize,
1951
+ color: labelTextColor,
1952
+ weight: labelTextWeight
1953
+ });
1954
+ const optionValueStyle = textStyle({
1955
+ size: valueTextSize,
1956
+ color: valueTextColor,
1957
+ weight: valueTextWeight
1958
+ });
1959
+ const groupedLabelStyle = textStyle({
1960
+ size: seriesLabelTextSize,
1961
+ color: seriesLabelTextColor,
1962
+ weight: seriesLabelTextWeight
1963
+ });
1964
+ const groupedValueStyle = textStyle({
1965
+ size: seriesValueTextSize ?? valueTextSize,
1966
+ color: seriesValueTextColor ?? valueTextColor,
1967
+ weight: seriesValueTextWeight ?? valueTextWeight
1968
+ });
1928
1969
  return /* @__PURE__ */ jsx(
1929
1970
  "div",
1930
1971
  {
@@ -1945,8 +1986,22 @@ var PollResults = ({
1945
1986
  const singlePercent = toPercent(series[0]?.value ?? 0, safeMax);
1946
1987
  return /* @__PURE__ */ jsxs("div", { children: [
1947
1988
  /* @__PURE__ */ jsxs("div", { className: "mb-3 flex items-center justify-between gap-4", children: [
1948
- /* @__PURE__ */ jsx("span", { className: "min-w-0 break-words text-xl font-semibold leading-snug text-gray-800 dark:text-white/90", children: option.label }),
1949
- !isGrouped && showValueLabel && /* @__PURE__ */ jsx("span", { className: "shrink-0 text-xl font-semibold leading-snug text-gray-600 dark:text-gray-300", children: valueFormatter(series[0]?.value ?? 0, singlePercent) })
1989
+ /* @__PURE__ */ jsx(
1990
+ "span",
1991
+ {
1992
+ className: "min-w-0 break-words text-xl font-semibold leading-snug text-gray-800 dark:text-white/90",
1993
+ style: optionLabelStyle,
1994
+ children: option.label
1995
+ }
1996
+ ),
1997
+ !isGrouped && showValueLabel && /* @__PURE__ */ jsx(
1998
+ "span",
1999
+ {
2000
+ className: "shrink-0 text-xl font-semibold leading-snug text-gray-600 dark:text-gray-300",
2001
+ style: optionValueStyle,
2002
+ children: valueFormatter(series[0]?.value ?? 0, singlePercent)
2003
+ }
2004
+ )
1950
2005
  ] }),
1951
2006
  /* @__PURE__ */ jsx("div", { className: cn("flex flex-col", isGrouped ? "gap-3" : "gap-0"), children: series.map((entry, seriesIndex) => {
1952
2007
  const percent = toPercent(entry.value, safeMax);
@@ -1956,8 +2011,22 @@ var PollResults = ({
1956
2011
  const ariaLabel = entry.ariaLabel ?? [optionText, isGrouped ? entryLabel : void 0].filter(Boolean).join(" ");
1957
2012
  return /* @__PURE__ */ jsxs("div", { children: [
1958
2013
  isGrouped && (showSeriesLabels || showValueLabel) && /* @__PURE__ */ jsxs("div", { className: "mb-1.5 flex items-center justify-between gap-3", children: [
1959
- showSeriesLabels ? /* @__PURE__ */ jsx("span", { className: "min-w-0 break-words text-xs font-medium text-gray-500 dark:text-gray-400", children: entry.label }) : /* @__PURE__ */ jsx("span", {}),
1960
- showValueLabel && /* @__PURE__ */ jsx("span", { className: "shrink-0 text-xs font-semibold text-gray-600 dark:text-gray-300", children: valueFormatter(entry.value, percent) })
2014
+ showSeriesLabels ? /* @__PURE__ */ jsx(
2015
+ "span",
2016
+ {
2017
+ className: "min-w-0 break-words text-xs font-medium text-gray-500 dark:text-gray-400",
2018
+ style: groupedLabelStyle,
2019
+ children: entry.label
2020
+ }
2021
+ ) : /* @__PURE__ */ jsx("span", {}),
2022
+ showValueLabel && /* @__PURE__ */ jsx(
2023
+ "span",
2024
+ {
2025
+ className: "shrink-0 text-xs font-semibold text-gray-600 dark:text-gray-300",
2026
+ style: groupedValueStyle,
2027
+ children: valueFormatter(entry.value, percent)
2028
+ }
2029
+ )
1961
2030
  ] }),
1962
2031
  /* @__PURE__ */ jsx(
1963
2032
  "div",