@facter/ds-core 1.7.7 → 1.8.0

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.mts CHANGED
@@ -352,6 +352,8 @@ interface DataTableSearchProps {
352
352
  column?: string;
353
353
  /** Debounce delay em ms */
354
354
  debounce?: number;
355
+ /** Callback para server-side search (recebe valor com debounce aplicado) */
356
+ onSearch?: (value: string) => void;
355
357
  /** Custom className */
356
358
  className?: string;
357
359
  }
@@ -385,6 +387,8 @@ interface DataTableContentProps {
385
387
  stripedRows?: boolean;
386
388
  /** Highlight no hover */
387
389
  highlightOnHover?: boolean;
390
+ /** Callback quando uma row é clicada */
391
+ onRowClick?: (row: unknown) => void;
388
392
  /** Custom className */
389
393
  className?: string;
390
394
  }
@@ -801,7 +805,7 @@ declare const toast: ((message: string) => string | number) & {
801
805
  };
802
806
 
803
807
  declare const checkboxVariants: (props?: ({
804
- variant?: "default" | "outline" | "secondary" | null | undefined;
808
+ variant?: "default" | "outline" | "secondary" | "muted" | null | undefined;
805
809
  size?: "sm" | "lg" | "md" | null | undefined;
806
810
  } & class_variance_authority_types.ClassProp) | undefined) => string;
807
811
  interface CheckboxProps extends React$1.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>, VariantProps<typeof checkboxVariants> {
@@ -2010,7 +2014,7 @@ interface ItemCardHeaderProps extends React$1.HTMLAttributes<HTMLDivElement> {
2010
2014
  declare const ItemCardHeader: React$1.ForwardRefExoticComponent<ItemCardHeaderProps & React$1.RefAttributes<HTMLDivElement>>;
2011
2015
  declare const itemCardIconVariants: (props?: ({
2012
2016
  size?: "sm" | "lg" | "md" | null | undefined;
2013
- variant?: "destructive" | "outline" | "secondary" | "success" | "warning" | "info" | "primary" | "muted" | null | undefined;
2017
+ variant?: "destructive" | "outline" | "secondary" | "success" | "warning" | "info" | "muted" | "primary" | null | undefined;
2014
2018
  } & class_variance_authority_types.ClassProp) | undefined) => string;
2015
2019
  interface ItemCardIconProps extends React$1.HTMLAttributes<HTMLDivElement>, VariantProps<typeof itemCardIconVariants> {
2016
2020
  /** Whether to show ripple effect */
@@ -2030,7 +2034,7 @@ interface ItemCardSubtitleProps extends React$1.HTMLAttributes<HTMLParagraphElem
2030
2034
  declare const ItemCardSubtitle: React$1.ForwardRefExoticComponent<ItemCardSubtitleProps & React$1.RefAttributes<HTMLParagraphElement>>;
2031
2035
 
2032
2036
  declare const itemCardBadgeVariants: (props?: ({
2033
- variant?: "default" | "destructive" | "success" | "warning" | "info" | "primary" | "muted" | null | undefined;
2037
+ variant?: "default" | "destructive" | "success" | "warning" | "info" | "muted" | "primary" | null | undefined;
2034
2038
  } & class_variance_authority_types.ClassProp) | undefined) => string;
2035
2039
  interface ItemCardBadgeProps extends React$1.HTMLAttributes<HTMLDivElement>, VariantProps<typeof itemCardBadgeVariants> {
2036
2040
  }
package/dist/index.d.ts CHANGED
@@ -352,6 +352,8 @@ interface DataTableSearchProps {
352
352
  column?: string;
353
353
  /** Debounce delay em ms */
354
354
  debounce?: number;
355
+ /** Callback para server-side search (recebe valor com debounce aplicado) */
356
+ onSearch?: (value: string) => void;
355
357
  /** Custom className */
356
358
  className?: string;
357
359
  }
@@ -385,6 +387,8 @@ interface DataTableContentProps {
385
387
  stripedRows?: boolean;
386
388
  /** Highlight no hover */
387
389
  highlightOnHover?: boolean;
390
+ /** Callback quando uma row é clicada */
391
+ onRowClick?: (row: unknown) => void;
388
392
  /** Custom className */
389
393
  className?: string;
390
394
  }
@@ -801,7 +805,7 @@ declare const toast: ((message: string) => string | number) & {
801
805
  };
802
806
 
803
807
  declare const checkboxVariants: (props?: ({
804
- variant?: "default" | "outline" | "secondary" | null | undefined;
808
+ variant?: "default" | "outline" | "secondary" | "muted" | null | undefined;
805
809
  size?: "sm" | "lg" | "md" | null | undefined;
806
810
  } & class_variance_authority_types.ClassProp) | undefined) => string;
807
811
  interface CheckboxProps extends React$1.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>, VariantProps<typeof checkboxVariants> {
@@ -2010,7 +2014,7 @@ interface ItemCardHeaderProps extends React$1.HTMLAttributes<HTMLDivElement> {
2010
2014
  declare const ItemCardHeader: React$1.ForwardRefExoticComponent<ItemCardHeaderProps & React$1.RefAttributes<HTMLDivElement>>;
2011
2015
  declare const itemCardIconVariants: (props?: ({
2012
2016
  size?: "sm" | "lg" | "md" | null | undefined;
2013
- variant?: "destructive" | "outline" | "secondary" | "success" | "warning" | "info" | "primary" | "muted" | null | undefined;
2017
+ variant?: "destructive" | "outline" | "secondary" | "success" | "warning" | "info" | "muted" | "primary" | null | undefined;
2014
2018
  } & class_variance_authority_types.ClassProp) | undefined) => string;
2015
2019
  interface ItemCardIconProps extends React$1.HTMLAttributes<HTMLDivElement>, VariantProps<typeof itemCardIconVariants> {
2016
2020
  /** Whether to show ripple effect */
@@ -2030,7 +2034,7 @@ interface ItemCardSubtitleProps extends React$1.HTMLAttributes<HTMLParagraphElem
2030
2034
  declare const ItemCardSubtitle: React$1.ForwardRefExoticComponent<ItemCardSubtitleProps & React$1.RefAttributes<HTMLParagraphElement>>;
2031
2035
 
2032
2036
  declare const itemCardBadgeVariants: (props?: ({
2033
- variant?: "default" | "destructive" | "success" | "warning" | "info" | "primary" | "muted" | null | undefined;
2037
+ variant?: "default" | "destructive" | "success" | "warning" | "info" | "muted" | "primary" | null | undefined;
2034
2038
  } & class_variance_authority_types.ClassProp) | undefined) => string;
2035
2039
  interface ItemCardBadgeProps extends React$1.HTMLAttributes<HTMLDivElement>, VariantProps<typeof itemCardBadgeVariants> {
2036
2040
  }
package/dist/index.js CHANGED
@@ -222,6 +222,7 @@ var Input = React10__namespace.forwardRef(
222
222
  variant: error ? "error" : variant,
223
223
  inputSize
224
224
  }),
225
+ !label && "h-9 pt-0 pb-0 py-2",
225
226
  Icon2 && "pl-10",
226
227
  type === "password" && "pr-11",
227
228
  className
@@ -614,6 +615,7 @@ var Select = React10__namespace.forwardRef(
614
615
  variant: error ? "error" : variant,
615
616
  selectSize
616
617
  }),
618
+ !label && "h-9 pt-0 pb-0 py-2",
617
619
  Icon2 && "pl-10",
618
620
  "flex items-center justify-between",
619
621
  className
@@ -1488,6 +1490,7 @@ var DataTableContent = React10__namespace.memo(function DataTableContent2({
1488
1490
  stickyHeader = false,
1489
1491
  stripedRows = false,
1490
1492
  highlightOnHover = true,
1493
+ onRowClick,
1491
1494
  className
1492
1495
  }) {
1493
1496
  const table = useDataTable();
@@ -1527,8 +1530,10 @@ var DataTableContent = React10__namespace.memo(function DataTableContent2({
1527
1530
  "data-state": row.getIsSelected() && "selected",
1528
1531
  className: cn(
1529
1532
  highlightOnHover && "hover:bg-muted/50",
1530
- stripedRows && index % 2 === 1 && "bg-muted/30"
1533
+ stripedRows && index % 2 === 1 && "bg-muted/30",
1534
+ onRowClick && "cursor-pointer"
1531
1535
  ),
1536
+ onClick: onRowClick ? () => onRowClick(row) : void 0,
1532
1537
  children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsxRuntime.jsx(TableCell, { className: cellClasses, children: reactTable.flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id))
1533
1538
  },
1534
1539
  row.id
@@ -1540,7 +1545,7 @@ var DataTableToolbar = React10__namespace.memo(function DataTableToolbar2({
1540
1545
  className,
1541
1546
  children
1542
1547
  }) {
1543
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("flex items-center justify-between gap-2", className), children });
1548
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("flex items-center justify-between gap-2 bg-accent/50 p-4 rounded-t-lg", className), children });
1544
1549
  });
1545
1550
  function useDebounce(value, delay = 300) {
1546
1551
  const [debouncedValue, setDebouncedValue] = React10__namespace.useState(value);
@@ -1867,6 +1872,7 @@ var checkboxVariants = classVarianceAuthority.cva(
1867
1872
  variants: {
1868
1873
  variant: {
1869
1874
  default: "border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",
1875
+ muted: "border-muted-foreground/40 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",
1870
1876
  secondary: "border-secondary data-[state=checked]:bg-secondary data-[state=checked]:text-secondary-foreground",
1871
1877
  outline: "border-border data-[state=checked]:bg-background data-[state=checked]:text-primary data-[state=checked]:border-primary"
1872
1878
  },
@@ -2301,7 +2307,7 @@ function DataTableTabs({
2301
2307
  return /* @__PURE__ */ jsxRuntime.jsx(
2302
2308
  "div",
2303
2309
  {
2304
- className: cn("flex items-center gap-1 border-b", className),
2310
+ className: cn("flex items-center gap-1", className),
2305
2311
  role: "tablist",
2306
2312
  "aria-label": "Filtros",
2307
2313
  children: tabs.map((tab) => {