@still-void/ui 3.2.0 → 3.3.1

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.
@@ -62,6 +62,7 @@ var Icon = React.forwardRef(
62
62
  {
63
63
  ...props,
64
64
  ref,
65
+ "data-icon-name": name,
65
66
  className: cn(
66
67
  "sv-icon",
67
68
  size === "sm" && "sv-icon--sm",
@@ -637,16 +638,42 @@ CardFooter.displayName = "CardFooter";
637
638
 
638
639
  // src/components/ui/alert.tsx
639
640
  import * as React5 from "react";
640
- import { jsx as jsx8 } from "react/jsx-runtime";
641
- var Alert = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx8(
642
- "div",
643
- {
644
- ref,
645
- className: cn("sv-alert", className),
646
- role: "alert",
647
- ...props
641
+ import { jsx as jsx8, jsxs as jsxs4 } from "react/jsx-runtime";
642
+ var variantConfig = {
643
+ info: { role: "status", icon: "info" },
644
+ success: { role: "status", icon: "check-circle" },
645
+ warning: { role: "alert", icon: "alert-triangle" },
646
+ danger: { role: "alert", icon: "alert-circle" }
647
+ };
648
+ var Alert = React5.forwardRef(
649
+ ({ className, variant, icon, action, role: propRole, ...props }, ref) => {
650
+ const config = variant && Object.prototype.hasOwnProperty.call(variantConfig, variant) ? variantConfig[variant] : null;
651
+ const derivedRole = config?.role ?? "alert";
652
+ const effectiveRole = config ? derivedRole : "alert";
653
+ let iconElement = null;
654
+ if (icon !== null) {
655
+ if (icon !== void 0) {
656
+ iconElement = icon;
657
+ } else if (config) {
658
+ iconElement = /* @__PURE__ */ jsx8(Icon, { name: config.icon, "aria-hidden": "true" });
659
+ }
660
+ }
661
+ return /* @__PURE__ */ jsxs4(
662
+ "div",
663
+ {
664
+ ref,
665
+ className: cn("sv-alert", config && `sv-alert--${variant}`, className),
666
+ role: effectiveRole,
667
+ ...props,
668
+ children: [
669
+ iconElement,
670
+ props.children,
671
+ action && /* @__PURE__ */ jsx8("div", { className: "sv-alert__action", children: action })
672
+ ]
673
+ }
674
+ );
648
675
  }
649
- ));
676
+ );
650
677
  Alert.displayName = "Alert";
651
678
  var AlertTitle = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx8("h5", { ref, className: cn("sv-alert__title", className), ...props }));
652
679
  AlertTitle.displayName = "AlertTitle";
@@ -822,7 +849,7 @@ Progress.displayName = "Progress";
822
849
 
823
850
  // src/components/ui/pagination.tsx
824
851
  import * as React14 from "react";
825
- import { jsx as jsx17, jsxs as jsxs4 } from "react/jsx-runtime";
852
+ import { jsx as jsx17, jsxs as jsxs5 } from "react/jsx-runtime";
826
853
  var Pagination = ({ className, ...props }) => /* @__PURE__ */ jsx17("nav", { ...props, "aria-label": "pagination", className: cn("sv-pagination", className) });
827
854
  Pagination.displayName = "Pagination";
828
855
  var PaginationContent = React14.forwardRef(
@@ -866,7 +893,7 @@ var PaginationLink = React14.forwardRef(
866
893
  }
867
894
  );
868
895
  PaginationLink.displayName = "PaginationLink";
869
- var PaginationPrevious = React14.forwardRef(({ className, label = "Previous", ...props }, ref) => /* @__PURE__ */ jsxs4(
896
+ var PaginationPrevious = React14.forwardRef(({ className, label = "Previous", ...props }, ref) => /* @__PURE__ */ jsxs5(
870
897
  PaginationLink,
871
898
  {
872
899
  ref,
@@ -881,7 +908,7 @@ var PaginationPrevious = React14.forwardRef(({ className, label = "Previous", ..
881
908
  ));
882
909
  PaginationPrevious.displayName = "PaginationPrevious";
883
910
  var PaginationNext = React14.forwardRef(
884
- ({ className, label = "Next", ...props }, ref) => /* @__PURE__ */ jsxs4(
911
+ ({ className, label = "Next", ...props }, ref) => /* @__PURE__ */ jsxs5(
885
912
  PaginationLink,
886
913
  {
887
914
  ref,
@@ -901,7 +928,7 @@ PaginationEllipsis.displayName = "PaginationEllipsis";
901
928
 
902
929
  // src/components/ui/chart.tsx
903
930
  import * as React15 from "react";
904
- import { Fragment as Fragment3, jsx as jsx18, jsxs as jsxs5 } from "react/jsx-runtime";
931
+ import { Fragment as Fragment3, jsx as jsx18, jsxs as jsxs6 } from "react/jsx-runtime";
905
932
  var ChartContainer = React15.forwardRef(
906
933
  ({ width, height, className, children, ...props }, ref) => /* @__PURE__ */ jsx18(
907
934
  "svg",
@@ -942,7 +969,7 @@ var ChartGrid = ({ orientation, positions, width, className }) => /* @__PURE__ *
942
969
  )
943
970
  ) });
944
971
  ChartGrid.displayName = "ChartGrid";
945
- var ChartAxis = ({ orientation, ticks, length, className }) => /* @__PURE__ */ jsxs5(Fragment3, { children: [
972
+ var ChartAxis = ({ orientation, ticks, length, className }) => /* @__PURE__ */ jsxs6(Fragment3, { children: [
946
973
  orientation === "bottom" ? /* @__PURE__ */ jsx18("line", { x1: 0, y1: 0, x2: length, y2: 0, className: cn("sv-chart__axis", className) }) : /* @__PURE__ */ jsx18("line", { x1: 0, y1: 0, x2: 0, y2: length, className: cn("sv-chart__axis", className) }),
947
974
  ticks.map(
948
975
  (tick) => orientation === "bottom" ? /* @__PURE__ */ jsx18(
@@ -997,9 +1024,9 @@ ChartBar.displayName = "ChartBar";
997
1024
 
998
1025
  // src/components/ui/radio-group.tsx
999
1026
  import * as React16 from "react";
1000
- import { jsx as jsx19, jsxs as jsxs6 } from "react/jsx-runtime";
1027
+ import { jsx as jsx19, jsxs as jsxs7 } from "react/jsx-runtime";
1001
1028
  var RadioGroupItem = React16.forwardRef(
1002
- ({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs6("label", { className: fieldClasses.choice, children: [
1029
+ ({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs7("label", { className: fieldClasses.choice, children: [
1003
1030
  /* @__PURE__ */ jsx19(
1004
1031
  "input",
1005
1032
  {
@@ -1025,7 +1052,7 @@ var RadioGroup = React16.forwardRef(
1025
1052
  }
1026
1053
  return React16.cloneElement(child, { name });
1027
1054
  });
1028
- return /* @__PURE__ */ jsxs6(
1055
+ return /* @__PURE__ */ jsxs7(
1029
1056
  "fieldset",
1030
1057
  {
1031
1058
  className: cn(