@facter/ds-core 1.5.3 → 1.6.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.js CHANGED
@@ -6541,6 +6541,463 @@ var Kanban = {
6541
6541
  Column: KanbanColumn,
6542
6542
  Card: KanbanCard
6543
6543
  };
6544
+ var itemCardVariants = classVarianceAuthority.cva(
6545
+ "relative flex flex-col bg-card rounded-lg border shadow-md overflow-hidden transition-all duration-200",
6546
+ {
6547
+ variants: {
6548
+ variant: {
6549
+ default: "border-border",
6550
+ selected: "border-primary ring-2 ring-primary/20",
6551
+ muted: "border-border/50 opacity-80"
6552
+ },
6553
+ hover: {
6554
+ true: "hover:shadow-lg hover:border-border",
6555
+ false: ""
6556
+ }
6557
+ },
6558
+ defaultVariants: {
6559
+ variant: "default",
6560
+ hover: true
6561
+ }
6562
+ }
6563
+ );
6564
+ var ItemCardContext = React49__namespace.createContext(null);
6565
+ function useItemCard() {
6566
+ const context = React49__namespace.useContext(ItemCardContext);
6567
+ if (!context) {
6568
+ throw new Error("ItemCard components must be used within ItemCard.Root");
6569
+ }
6570
+ return context;
6571
+ }
6572
+ var ItemCardRoot = React49__namespace.forwardRef(
6573
+ ({
6574
+ className,
6575
+ variant,
6576
+ hover,
6577
+ selected = false,
6578
+ asButton = false,
6579
+ children,
6580
+ ...props
6581
+ }, ref) => {
6582
+ const contextValue = React49__namespace.useMemo(
6583
+ () => ({ isSelected: selected }),
6584
+ [selected]
6585
+ );
6586
+ return /* @__PURE__ */ jsxRuntime.jsx(ItemCardContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxRuntime.jsx(
6587
+ "div",
6588
+ {
6589
+ ref,
6590
+ role: asButton ? "button" : void 0,
6591
+ tabIndex: asButton ? 0 : void 0,
6592
+ className: cn(
6593
+ itemCardVariants({
6594
+ variant: selected ? "selected" : variant,
6595
+ hover
6596
+ }),
6597
+ asButton && "cursor-pointer",
6598
+ className
6599
+ ),
6600
+ ...props,
6601
+ children
6602
+ }
6603
+ ) });
6604
+ }
6605
+ );
6606
+ ItemCardRoot.displayName = "ItemCardRoot";
6607
+ var itemCardBadgeVariants = classVarianceAuthority.cva(
6608
+ "absolute -top-px right-0 rounded-none rounded-bl-lg px-2.5 py-1 text-xs font-medium border-l border-b transition-colors",
6609
+ {
6610
+ variants: {
6611
+ variant: {
6612
+ default: "bg-muted text-muted-foreground border-border",
6613
+ primary: "bg-primary/10 text-primary border-primary/20 hover:bg-primary/15",
6614
+ success: "bg-green-500/10 text-green-600 border-green-500/20 hover:bg-green-500/15",
6615
+ warning: "bg-yellow-500/10 text-yellow-600 border-yellow-500/20 hover:bg-yellow-500/15",
6616
+ destructive: "bg-red-500/10 text-red-600 border-red-500/20 hover:bg-red-500/15",
6617
+ info: "bg-blue-500/10 text-blue-600 border-blue-500/20 hover:bg-blue-500/15",
6618
+ muted: "bg-slate-500/10 text-slate-600 border-slate-500/20 hover:bg-slate-500/15"
6619
+ }
6620
+ },
6621
+ defaultVariants: {
6622
+ variant: "default"
6623
+ }
6624
+ }
6625
+ );
6626
+ var ItemCardBadge = React49__namespace.forwardRef(
6627
+ ({ className, variant, children, ...props }, ref) => {
6628
+ return /* @__PURE__ */ jsxRuntime.jsx(
6629
+ "div",
6630
+ {
6631
+ ref,
6632
+ className: cn(itemCardBadgeVariants({ variant }), className),
6633
+ ...props,
6634
+ children
6635
+ }
6636
+ );
6637
+ }
6638
+ );
6639
+ ItemCardBadge.displayName = "ItemCardBadge";
6640
+ var ItemCardHeader = React49__namespace.forwardRef(
6641
+ ({ className, align = "between", children, ...props }, ref) => {
6642
+ const alignmentClasses = {
6643
+ left: "justify-start",
6644
+ right: "justify-end",
6645
+ between: "justify-between"
6646
+ };
6647
+ return /* @__PURE__ */ jsxRuntime.jsx(
6648
+ "div",
6649
+ {
6650
+ ref,
6651
+ className: cn(
6652
+ "flex items-center gap-4 px-6 pt-6 pb-4",
6653
+ alignmentClasses[align],
6654
+ className
6655
+ ),
6656
+ ...props,
6657
+ children
6658
+ }
6659
+ );
6660
+ }
6661
+ );
6662
+ ItemCardHeader.displayName = "ItemCardHeader";
6663
+ var itemCardIconVariants = classVarianceAuthority.cva(
6664
+ "flex items-center justify-center rounded-2xl shadow-lg transition-transform",
6665
+ {
6666
+ variants: {
6667
+ size: {
6668
+ sm: "p-2 w-10 h-10",
6669
+ md: "p-3 w-12 h-12",
6670
+ lg: "p-4 w-14 h-14"
6671
+ },
6672
+ variant: {
6673
+ primary: "bg-primary text-primary-foreground shadow-primary/25",
6674
+ secondary: "bg-secondary text-secondary-foreground shadow-secondary/25",
6675
+ success: "bg-green-500 text-white shadow-green-500/25",
6676
+ warning: "bg-yellow-500 text-white shadow-yellow-500/25",
6677
+ destructive: "bg-red-500 text-white shadow-red-500/25",
6678
+ info: "bg-blue-500 text-white shadow-blue-500/25",
6679
+ muted: "bg-muted text-muted-foreground shadow-muted/25",
6680
+ outline: "bg-background border-2 border-primary text-primary shadow-none"
6681
+ }
6682
+ },
6683
+ defaultVariants: {
6684
+ size: "md",
6685
+ variant: "primary"
6686
+ }
6687
+ }
6688
+ );
6689
+ var ItemCardIcon = React49__namespace.forwardRef(
6690
+ ({ className, size, variant, ripple = false, children, ...props }, ref) => {
6691
+ if (ripple) {
6692
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
6693
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(
6694
+ "div",
6695
+ {
6696
+ className: cn(
6697
+ "absolute rounded-full opacity-20 animate-ping",
6698
+ variant === "primary" && "bg-primary",
6699
+ variant === "success" && "bg-green-500",
6700
+ variant === "warning" && "bg-yellow-500",
6701
+ variant === "destructive" && "bg-red-500",
6702
+ variant === "info" && "bg-blue-500",
6703
+ size === "sm" && "w-14 h-14",
6704
+ size === "md" && "w-16 h-16",
6705
+ size === "lg" && "w-20 h-20"
6706
+ ),
6707
+ style: { animationDuration: "2s" }
6708
+ }
6709
+ ) }),
6710
+ /* @__PURE__ */ jsxRuntime.jsx(
6711
+ "div",
6712
+ {
6713
+ ref,
6714
+ className: cn(itemCardIconVariants({ size, variant }), "relative z-10", className),
6715
+ ...props,
6716
+ children
6717
+ }
6718
+ )
6719
+ ] });
6720
+ }
6721
+ return /* @__PURE__ */ jsxRuntime.jsx(
6722
+ "div",
6723
+ {
6724
+ ref,
6725
+ className: cn(itemCardIconVariants({ size, variant }), className),
6726
+ ...props,
6727
+ children
6728
+ }
6729
+ );
6730
+ }
6731
+ );
6732
+ ItemCardIcon.displayName = "ItemCardIcon";
6733
+ var ItemCardTitleGroup = React49__namespace.forwardRef(
6734
+ ({ className, align = "right", children, ...props }, ref) => {
6735
+ const alignmentClasses = {
6736
+ left: "text-left",
6737
+ right: "text-right",
6738
+ center: "text-center"
6739
+ };
6740
+ return /* @__PURE__ */ jsxRuntime.jsx(
6741
+ "div",
6742
+ {
6743
+ ref,
6744
+ className: cn("flex-1 min-w-0", alignmentClasses[align], className),
6745
+ ...props,
6746
+ children
6747
+ }
6748
+ );
6749
+ }
6750
+ );
6751
+ ItemCardTitleGroup.displayName = "ItemCardTitleGroup";
6752
+ var ItemCardTitle = React49__namespace.forwardRef(
6753
+ ({ className, children, ...props }, ref) => {
6754
+ return /* @__PURE__ */ jsxRuntime.jsx(
6755
+ "h3",
6756
+ {
6757
+ ref,
6758
+ className: cn("text-lg font-semibold text-foreground truncate", className),
6759
+ ...props,
6760
+ children
6761
+ }
6762
+ );
6763
+ }
6764
+ );
6765
+ ItemCardTitle.displayName = "ItemCardTitle";
6766
+ var ItemCardSubtitle = React49__namespace.forwardRef(
6767
+ ({ className, children, ...props }, ref) => {
6768
+ return /* @__PURE__ */ jsxRuntime.jsx(
6769
+ "p",
6770
+ {
6771
+ ref,
6772
+ className: cn("text-sm text-muted-foreground", className),
6773
+ ...props,
6774
+ children
6775
+ }
6776
+ );
6777
+ }
6778
+ );
6779
+ ItemCardSubtitle.displayName = "ItemCardSubtitle";
6780
+ var ItemCardContent = React49__namespace.forwardRef(
6781
+ ({ className, muted = true, children, ...props }, ref) => {
6782
+ return /* @__PURE__ */ jsxRuntime.jsx(
6783
+ "div",
6784
+ {
6785
+ ref,
6786
+ className: cn(
6787
+ "px-6 py-3 space-y-2",
6788
+ muted && "bg-muted/40",
6789
+ className
6790
+ ),
6791
+ ...props,
6792
+ children
6793
+ }
6794
+ );
6795
+ }
6796
+ );
6797
+ ItemCardContent.displayName = "ItemCardContent";
6798
+ var ItemCardContentItem = React49__namespace.forwardRef(
6799
+ ({ className, label, value, secondary, children, ...props }, ref) => {
6800
+ if (children) {
6801
+ return /* @__PURE__ */ jsxRuntime.jsx(
6802
+ "div",
6803
+ {
6804
+ ref,
6805
+ className: cn(
6806
+ "flex justify-between items-center text-sm text-muted-foreground",
6807
+ className
6808
+ ),
6809
+ ...props,
6810
+ children
6811
+ }
6812
+ );
6813
+ }
6814
+ return /* @__PURE__ */ jsxRuntime.jsxs(
6815
+ "div",
6816
+ {
6817
+ ref,
6818
+ className: cn(
6819
+ "flex justify-between items-center text-sm text-muted-foreground gap-2",
6820
+ className
6821
+ ),
6822
+ ...props,
6823
+ children: [
6824
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate flex-1", children: label }),
6825
+ value && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium shrink-0", children: value }),
6826
+ secondary && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium shrink-0", children: secondary })
6827
+ ]
6828
+ }
6829
+ );
6830
+ }
6831
+ );
6832
+ ItemCardContentItem.displayName = "ItemCardContentItem";
6833
+ var ItemCardEmpty = React49__namespace.forwardRef(
6834
+ ({ className, icon, message = "Nenhum item", children, ...props }, ref) => {
6835
+ return /* @__PURE__ */ jsxRuntime.jsxs(
6836
+ "div",
6837
+ {
6838
+ ref,
6839
+ className: cn(
6840
+ "flex flex-col items-center justify-center py-6 text-center text-muted-foreground",
6841
+ className
6842
+ ),
6843
+ ...props,
6844
+ children: [
6845
+ icon && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mb-2 opacity-50", children: icon }),
6846
+ children || /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm", children: message })
6847
+ ]
6848
+ }
6849
+ );
6850
+ }
6851
+ );
6852
+ ItemCardEmpty.displayName = "ItemCardEmpty";
6853
+ var ItemCardFooter = React49__namespace.forwardRef(
6854
+ ({ className, children, ...props }, ref) => {
6855
+ return /* @__PURE__ */ jsxRuntime.jsx(
6856
+ "div",
6857
+ {
6858
+ ref,
6859
+ className: cn(
6860
+ "px-6 py-3 flex justify-between items-center gap-4",
6861
+ className
6862
+ ),
6863
+ ...props,
6864
+ children
6865
+ }
6866
+ );
6867
+ }
6868
+ );
6869
+ ItemCardFooter.displayName = "ItemCardFooter";
6870
+ var ItemCardFooterItem = React49__namespace.forwardRef(
6871
+ ({ className, label, value, align = "left", ...props }, ref) => {
6872
+ return /* @__PURE__ */ jsxRuntime.jsxs(
6873
+ "div",
6874
+ {
6875
+ ref,
6876
+ className: cn(
6877
+ "flex flex-col",
6878
+ align === "right" && "items-end",
6879
+ className
6880
+ ),
6881
+ ...props,
6882
+ children: [
6883
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-muted-foreground", children: label }),
6884
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-semibold text-sm text-foreground", children: value })
6885
+ ]
6886
+ }
6887
+ );
6888
+ }
6889
+ );
6890
+ ItemCardFooterItem.displayName = "ItemCardFooterItem";
6891
+ var ItemCardFooterDivider = React49__namespace.forwardRef(
6892
+ ({ className, ...props }, ref) => {
6893
+ return /* @__PURE__ */ jsxRuntime.jsx(
6894
+ "div",
6895
+ {
6896
+ ref,
6897
+ className: cn("flex-1", className),
6898
+ ...props
6899
+ }
6900
+ );
6901
+ }
6902
+ );
6903
+ ItemCardFooterDivider.displayName = "ItemCardFooterDivider";
6904
+ var ItemCardActions = React49__namespace.forwardRef(
6905
+ ({ className, bordered = true, children, ...props }, ref) => {
6906
+ return /* @__PURE__ */ jsxRuntime.jsx(
6907
+ "div",
6908
+ {
6909
+ ref,
6910
+ className: cn(
6911
+ "mt-auto",
6912
+ bordered && "border-t border-border",
6913
+ className
6914
+ ),
6915
+ ...props,
6916
+ children
6917
+ }
6918
+ );
6919
+ }
6920
+ );
6921
+ ItemCardActions.displayName = "ItemCardActions";
6922
+ var ItemCardActionButton = React49__namespace.forwardRef(
6923
+ ({
6924
+ className,
6925
+ showArrow = true,
6926
+ loading = false,
6927
+ variant = "default",
6928
+ disabled,
6929
+ children,
6930
+ ...props
6931
+ }, ref) => {
6932
+ const variantClasses = {
6933
+ default: "bg-muted/50 text-foreground hover:bg-muted active:bg-muted/80",
6934
+ primary: "bg-primary/10 text-primary hover:bg-primary/20 active:bg-primary/30",
6935
+ secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
6936
+ destructive: "bg-red-500/10 text-red-600 hover:bg-red-500/20 active:bg-red-500/30"
6937
+ };
6938
+ return /* @__PURE__ */ jsxRuntime.jsxs(
6939
+ "button",
6940
+ {
6941
+ ref,
6942
+ type: "button",
6943
+ disabled: disabled || loading,
6944
+ className: cn(
6945
+ "w-full px-6 py-3 flex items-center justify-between",
6946
+ "text-sm font-medium transition-colors",
6947
+ "focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
6948
+ "disabled:opacity-50 disabled:cursor-not-allowed",
6949
+ variantClasses[variant],
6950
+ className
6951
+ ),
6952
+ ...props,
6953
+ children: [
6954
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children }),
6955
+ showArrow && !loading && /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "w-4 h-4 opacity-60" }),
6956
+ loading && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-4 h-4 border-2 border-current border-t-transparent rounded-full animate-spin" })
6957
+ ]
6958
+ }
6959
+ );
6960
+ }
6961
+ );
6962
+ ItemCardActionButton.displayName = "ItemCardActionButton";
6963
+ var ItemCardActionsRow = React49__namespace.forwardRef(
6964
+ ({ className, children, ...props }, ref) => {
6965
+ return /* @__PURE__ */ jsxRuntime.jsx(
6966
+ "div",
6967
+ {
6968
+ ref,
6969
+ className: cn("flex items-center gap-2 p-3", className),
6970
+ ...props,
6971
+ children
6972
+ }
6973
+ );
6974
+ }
6975
+ );
6976
+ ItemCardActionsRow.displayName = "ItemCardActionsRow";
6977
+
6978
+ // src/components/ItemCard/ItemCard.tsx
6979
+ var ItemCard = Object.assign(ItemCardRoot, {
6980
+ // Badge
6981
+ Badge: ItemCardBadge,
6982
+ // Header components
6983
+ Header: ItemCardHeader,
6984
+ Icon: ItemCardIcon,
6985
+ TitleGroup: ItemCardTitleGroup,
6986
+ Title: ItemCardTitle,
6987
+ Subtitle: ItemCardSubtitle,
6988
+ // Content components
6989
+ Content: ItemCardContent,
6990
+ ContentItem: ItemCardContentItem,
6991
+ Empty: ItemCardEmpty,
6992
+ // Footer components
6993
+ Footer: ItemCardFooter,
6994
+ FooterItem: ItemCardFooterItem,
6995
+ FooterDivider: ItemCardFooterDivider,
6996
+ // Actions components
6997
+ Actions: ItemCardActions,
6998
+ ActionButton: ItemCardActionButton,
6999
+ ActionsRow: ItemCardActionsRow
7000
+ });
6544
7001
  var WizardContext = React49.createContext(void 0);
6545
7002
  function useWizardContext() {
6546
7003
  const context = React49.useContext(WizardContext);
@@ -7415,6 +7872,23 @@ exports.FormSwitch = FormSwitch;
7415
7872
  exports.FormTextarea = FormTextarea;
7416
7873
  exports.GlobalLoaderController = GlobalLoaderController;
7417
7874
  exports.Input = Input;
7875
+ exports.ItemCard = ItemCard;
7876
+ exports.ItemCardActionButton = ItemCardActionButton;
7877
+ exports.ItemCardActions = ItemCardActions;
7878
+ exports.ItemCardActionsRow = ItemCardActionsRow;
7879
+ exports.ItemCardBadge = ItemCardBadge;
7880
+ exports.ItemCardContent = ItemCardContent;
7881
+ exports.ItemCardContentItem = ItemCardContentItem;
7882
+ exports.ItemCardEmpty = ItemCardEmpty;
7883
+ exports.ItemCardFooter = ItemCardFooter;
7884
+ exports.ItemCardFooterDivider = ItemCardFooterDivider;
7885
+ exports.ItemCardFooterItem = ItemCardFooterItem;
7886
+ exports.ItemCardHeader = ItemCardHeader;
7887
+ exports.ItemCardIcon = ItemCardIcon;
7888
+ exports.ItemCardRoot = ItemCardRoot;
7889
+ exports.ItemCardSubtitle = ItemCardSubtitle;
7890
+ exports.ItemCardTitle = ItemCardTitle;
7891
+ exports.ItemCardTitleGroup = ItemCardTitleGroup;
7418
7892
  exports.Kanban = Kanban;
7419
7893
  exports.Loader = Loader;
7420
7894
  exports.LoaderProvider = LoaderProvider;
@@ -7493,6 +7967,9 @@ exports.WizardStepConnector = WizardStepConnector;
7493
7967
  exports.WizardStepIndicator = WizardStepIndicator;
7494
7968
  exports.WizardSteps = WizardSteps;
7495
7969
  exports.cn = cn;
7970
+ exports.itemCardBadgeVariants = itemCardBadgeVariants;
7971
+ exports.itemCardIconVariants = itemCardIconVariants;
7972
+ exports.itemCardVariants = itemCardVariants;
7496
7973
  exports.loader = loader;
7497
7974
  exports.toast = toast;
7498
7975
  exports.useDashboardLayout = useDashboardLayout;
@@ -7510,6 +7987,7 @@ exports.useDataTableState = useDataTableState;
7510
7987
  exports.useDebounce = useDebounce;
7511
7988
  exports.useDebouncedCallback = useDebouncedCallback;
7512
7989
  exports.useFormFieldContext = useFormFieldContext;
7990
+ exports.useItemCard = useItemCard;
7513
7991
  exports.useKanban = useKanban;
7514
7992
  exports.useKanbanOptional = useKanbanOptional;
7515
7993
  exports.useLoader = useLoader;